{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/deployment-pipeline-design",
  "version": "1.0.0",
  "name": "Deployment Pipeline Design",
  "description": "Design multi-stage CI/CD pipelines with approval gates, security checks, and deployment orchestration. Use when architecting deployment workflows, setting up continuous delivery, or implementing Gi...",
  "system_prompt_fragment": "# Deployment Pipeline Design\n\nArchitecture patterns for multi-stage CI/CD pipelines with approval gates and deployment strategies.\n\n## Do not use this skill when\n\n- The task is unrelated to deployment pipeline design\n- You need a different domain or tool outside this scope\n\n## Instructions\n\n- Clarify goals, constraints, and required inputs.\n- Apply relevant best practices and validate outcomes.\n- Provide actionable steps and verification.\n- If detailed examples are required, open `resources/implementation-playbook.md`.\n\n## Purpose\n\nDesign robust, secure deployment pipelines that balance speed with safety through proper stage organization and approval workflows.\n\n## Use this skill when\n\n- Design CI/CD architecture\n- Implement deployment gates\n- Configure multi-environment pipelines\n- Establish deployment best practices\n- Implement progressive delivery\n\n## Pipeline Stages\n\n### Standard Pipeline Flow\n\n```\n┌─────────┐   ┌──────┐   ┌─────────┐   ┌────────┐   ┌──────────┐\n│  Build  │ → │ Test │ → │ Staging │ → │ Approve│ → │Production│\n└─────────┘   └──────┘   └─────────┘   └────────┘   └──────────┘\n```\n\n### Detailed Stage Breakdown\n\n1. **Source** - Code checkout\n2. **Build** - Compile, package, containerize\n3. **Test** - Unit, integration, security scans\n4. **Staging Deploy** - Deploy to staging environment\n5. **Integration Tests** - E2E, smoke tests\n6. **Approval Gate** - Manual approval required\n7. **Production Deploy** - Canary, blue-green, rolling\n8. **Verification** - Health checks, monitoring\n9. **Rollback** - Automated rollback on failure\n\n## Approval Gate Patterns\n\n### Pattern 1: Manual Approval\n\n```yaml\n# GitHub Actions\nproduction-deploy:\n  needs: staging-deploy\n  environment:\n    name: production\n    url: https://app.example.com\n  runs-on: ubuntu-latest\n  steps:\n    - name: Deploy to production\n      run: |\n        # Deployment commands\n```\n\n### Pattern 2: Time-Based Approval\n\n```yaml\n# GitLab CI\ndeploy:production:\n  stage: deploy\n  script:\n    - deploy.sh production\n  environment:\n    name: production\n  when: delayed\n  start_in: 30 minutes\n  only:\n    - main\n```\n\n### Pattern 3: Multi-Approver\n\n```yaml\n# Azure Pipelines\nstages:\n- stage: Production\n  dependsOn: Staging\n  jobs:\n  - deployment: Deploy\n    environment:\n      name: production\n      resourceType: Kubernetes\n    strategy:\n      runOnce:\n        preDeploy:\n          steps:\n          - task: ManualValidation@0\n            inputs:\n              notifyUsers: 'team-leads@example.com'\n              instructions: 'Review staging metrics before approving'\n```\n\n**Reference:** See `assets/approval-gate-template.yml`\n\n## Deployment Strategies\n\n### 1. Rolling Deployment\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: my-app\nspec:\n  replicas: 10\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxSurge: 2\n      maxUnavailable: 1\n```\n\n**Characteristics:**\n- Gradual rollout\n- Zero downtime\n- Easy rollback\n- Best for most applications\n\n### 2. Blue-Green Deployment\n\n```yaml\n# Blue (current)\nkubectl apply -f blue-deployment.yaml\nkubectl label service my-app version=blue\n\n# Green (new)\nkubectl apply -f green-deployment.yaml\n# Test green environment\nkubectl label service my-app version=green\n\n# Rollback if needed\nkubectl label service my-app version=blue\n```\n\n**Characteristics:**\n- Instant switchover\n- Easy rollback\n- Doubles infrastructure cost temporarily\n- Good for high-risk deployments\n\n### 3. Canary Deployment\n\n```yaml\napiVersion: argoproj.io/v1alpha1\nkind: Rollout\nmetadata:\n  name: my-app\nspec:\n  replicas: 10\n  strategy:\n    canary:\n      steps:\n      - setWeight: 10\n      - pause: {duration: 5m}\n      - setWeight: 25\n      - pause: {duration: 5m}\n      - setWeight: 50\n      - pause: {duration: 5m}\n      - setWeight: 100\n```\n\n**Characteristics:**\n- Gradual traffic shift\n- Risk mitigation\n- Real user testing\n- Requires service mesh or similar\n\n### 4. Feature Flags\n\n```python\nfrom flagsmith import Flagsmith\n\nflagsmith = Flagsmith(environment_key=\"API_KEY\")\n\nif flagsmith.has_feature(\"new_checkout_flow\"):\n    # New code path\n    process_checkout_v2()\nelse:\n    # Existing code path\n    process_checkout_v1()\n```\n\n**Characteristics:**\n- Deploy without releasing\n- A/B testing\n- Instant rollback\n- Granular control\n\n## Pipeline Orchestration\n\n### Multi-Stage Pipeline Example\n\n```yaml\nname: Production Pipeline\n\non:\n  push:\n    branches: [ main ]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Build application\n        run: make build\n      - name: Build Docker image\n        run: docker build -t myapp:${{ github.sha }} .\n      - name: Push to registry\n        run: docker push myapp:${{ github.sha }}\n\n  test:\n    needs: build\n    runs-on: ubuntu-latest\n    steps:\n      - name: Unit tests\n        run: make test\n      - name: Security scan\n        run: trivy image myapp:${{ github.sha }}\n\n  deploy-staging:\n    needs: test\n    runs-on: ubuntu-latest\n    environment:\n      name: staging\n    steps:\n      - name: Deploy to staging\n        run: kubectl apply -f k8s/staging/\n\n  integration-test:\n    needs: deploy-staging\n    runs-on: ubuntu-latest\n    steps:\n      - name: Run E2E tests\n        run: npm run test:e2e\n\n  deploy-production:\n    needs: integration-test\n    runs-on: ubuntu-latest\n    environment:\n      name: production\n    steps:\n      - name: Canary deployment\n        run: |\n          kubectl apply -f k8s/production/\n          kubectl argo rollouts promote my-app\n\n  verify:\n    needs: deploy-production\n    runs-on: ubuntu-latest\n    steps:\n      - name: Health check\n        run: curl -f https://app.example.com/health\n      - name: Notify team\n        run: |\n          curl -X POST ${{ secrets.SLACK_WEBHOOK }} \\\n            -d '{\"text\":\"Production deployment successful!\"}'\n```\n\n## Pipeline Best Practices\n\n1. **Fail fast** - Run quick tests first\n2. **Parallel execution** - Run independent jobs concurrently\n3. **Caching** - Cache dependencies between runs\n4. **Artifact management** - Store build artifacts\n5. **Environment parity** - Keep environments consistent\n6. **Secrets management** - Use secret stores (Vault, etc.)\n7. **Deployment windows** - Schedule deployments appropriately\n8. **Monitoring integration** - Track deployment metrics\n9. **Rollback automation** - Auto-rollback on failures\n10. **Documentation** - Document pipeline stages\n\n## Rollback Strategies\n\n### Automated Rollback\n\n```yaml\ndeploy-and-verify:\n  steps:\n    - name: Deploy new version\n      run: kubectl apply -f k8s/\n\n    - name: Wait for rollout\n      run: kubectl rollout status deployment/my-app\n\n    - name: Health check\n      id: health\n      run: |\n        for i in {1..10}; do\n          if curl -sf https://app.example.com/health; then\n            exit 0\n          fi\n          sleep 10\n        done\n        exit 1\n\n    - name: Rollback on failure\n      if: failure()\n      run: kubectl rollout undo deployment/my-app\n```\n\n### Manual Rollback\n\n```bash\n# List revision history\nkubectl rollout history deployment/my-app\n\n# Rollback to previous version\nkubectl rollout undo deployment/my-app\n\n# Rollback to specific revision\nkubectl rollout undo deployment/my-app --to-revision=3\n```\n\n## Monitoring and Metrics\n\n### Key Pipeline Metrics\n\n- **Deployment Frequency** - How often deployments occur\n- **Lead Time** - Time from commit to production\n- **Change Failure Rate** - Percentage of failed deployments\n- **Mean Time to Recovery (MTTR)** - Time to recover from failure\n- **Pipeline Success Rate** - Percentage of successful runs\n- **Average Pipeline Duration** - Time to complete pipeline\n\n### Integration with Monitoring\n\n```yaml\n- name: Post-deployment verification\n  run: |\n    # Wait for metrics stabilization\n    sleep 60\n\n    # Check error rate\n    ERROR_RATE=$(curl -s \"$PROMETHEUS_URL/api/v1/query?query=rate(http_errors_total[5m])\" | jq '.data.result[0].value[1]')\n\n    if (( $(echo \"$ERROR_RATE > 0.01\" | bc -l) )); then\n      echo \"Error rate too high: $ERROR_RATE\"\n      exit 1\n    fi\n```\n\n## Reference Files\n\n- `references/pipeline-orchestration.md` - Complex pipeline patterns\n- `assets/approval-gate-template.yml` - Approval workflow templates\n\n## Related Skills\n\n- `github-actions-templates` - For GitHub Actions implementation\n- `gitlab-ci-patterns` - For GitLab CI implementation\n- `secrets-management` - For secrets handling",
  "applicable_domains": [
    "devops"
  ],
  "category": "devops",
  "invocation": [
    "/deployment-pipeline-design"
  ],
  "authored_by": "claudeskills.in community",
  "source_url": "https://claudeskills.in/skill/deployment-pipeline-design",
  "provenance": {
    "source": "claudeskills.in",
    "source_url": "https://claudeskills.in/skill/deployment-pipeline-design",
    "license": "unknown",
    "imported_at": "2026-09-03",
    "notes": "Aggregated by claudeskills.in from community GitHub lists."
  },
  "tags": [
    "claudeskills",
    "devops"
  ],
  "lifecycle": "draft"
}