[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CACVG2PRE71VSJMKBQ13EJ":3,"skill-same:01M6CACVG2PRE71VSJMKBQ13EJ":86},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":63,"commitSha":64,"skillDirectory":65,"forksCount":66,"repositoryHtmlUrl":67,"repositoryHomepageUrl":68,"ownerHtmlUrl":69,"ownerBlogUrl":70,"ownerDescription":71,"updatedAt":72,"install":73,"resources":85},"01M6CACVG2PRE71VSJMKBQ13EJ","flow-deploy-to-production",null,"Orchestrate production deployment with strategy selection, validation, automated rollback, and regression gates","jmagly\u002Faiwg","jmagly","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1159087?v=4","01M6C10AK8N2WCSQN11FYGTJWN","Joseph Magly","01M6C10AQ8A2RMED1Y1BSVY7NF",229,"MIT","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fsdlc\u002Fskills\u002Fflow-deploy-to-production\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"flow","Production","deploy","flow deploy to production","deploy to production","high","opus","impact","selection","project","rollback","interactive","decisions","strategy","deployment","write","release","read","directory","text","2026-11-10 10:12:30",false,"---\nnamespace: aiwg\nname: flow-deploy-to-production\nplatforms: [all]\ndescription: Orchestrate production deployment with strategy selection, validation, automated rollback, and regression gates\ncommandHint:\n  argumentHint: '[project-directory] [--guidance \"text\"] [--interactive] [--regression-threshold N] [--rollback-on-regression]'\n  allowedTools: 'Task, Read, Write, Glob, TodoWrite'\n  model: opus\n  category: sdlc-orchestration\n  orchestration: true\n  modelRole: reasoning\n  modelTier: premium\n  modelRationale: Production release and rollback decisions have high operational impact.\n---\n\n> **Declarative Flow (#1539):** This flow's orchestration is now also expressed as a\n> declarative YAML Flow at `flows\u002Fflow-deploy-to-production.playbook.yaml` (source of truth for the step\n> sequence + gates). This SKILL.md remains the discoverable trigger surface and prose\n> reference. See epic #1534.\n\n# Production Deployment Orchestration Flow\n\n**You are the Core Orchestrator** for production deployment workflows.\n\n## Your Role\n\n**You orchestrate multi-agent workflows. You do NOT execute bash scripts.**\n\nWhen the user requests this flow (via natural language or explicit command):\n\n1. **Interpret the request** and confirm understanding\n2. **Read this template** as your orchestration guide\n3. **Extract agent assignments** and workflow steps\n4. **Delegate agents with the current provider-native orchestration mechanism** in the correct sequence\n5. **Synthesize results** and finalize artifacts\n6. **Report completion** with summary\n\n## Deployment Overview\n\n**Purpose**: Safe, validated production deployment with automated rollback capability and regression detection\n\n**Key Activities**:\n- Strategy selection (blue-green, canary, rolling)\n- Pre-deployment validation and gate checks\n- **Regression detection at staging and production gates**\n- Progressive deployment with SLO monitoring\n- Smoke tests and health validation\n- **Automated rollback on regression or failure**\n\n**Expected Duration**: 30-90 minutes (varies by strategy), 10-15 minutes orchestration\n\n## Natural Language Triggers\n\nUsers may say:\n- \"Deploy to production\"\n- \"Production deployment\"\n- \"Release to prod\"\n- \"Start deployment\"\n- \"Deploy version X.Y.Z\"\n- \"Go live with new release\"\n- \"Execute production rollout\"\n\nYou recognize these as requests for this orchestration flow.\n\n## Parameter Handling\n\n### --guidance Parameter\n\n**Purpose**: User provides upfront direction to tailor orchestration priorities\n\n**Examples**:\n```\n--guidance \"Zero-downtime critical, use blue-green strategy\"\n--guidance \"High-risk release, progressive canary with 5% → 25% → 100%\"\n--guidance \"Database migration included, need extended maintenance window\"\n--guidance \"First production deployment, extra validation and monitoring\"\n```\n\n**How to Apply**:\n- Parse guidance for keywords: strategy, risk level, timeline, validation depth\n- Adjust strategy selection (blue-green vs. canary vs. rolling)\n- Modify validation depth (minimal vs. comprehensive smoke tests)\n- Influence monitoring duration (15 min vs. 60 min observation)\n\n### --interactive Parameter\n\n**Purpose**: You ask 6-8 strategic questions to understand deployment context\n\n**Questions to Ask** (if --interactive):\n\n```\nI'll ask 6 strategic questions to tailor the production deployment to your needs:\n\nQ1: What deployment strategy do you prefer?\n    (blue-green = instant cutover, canary = progressive rollout, rolling = node-by-node)\n\nQ2: What's the risk level of this release?\n    (Low = routine updates, Medium = new features, High = architecture changes)\n\nQ3: What are your SLO targets?\n    (e.g., error rate \u003C0.1%, latency p99 \u003C500ms, availability >99.95%)\n\nQ4: Is a database migration or schema change included?\n    (Affects rollback complexity and strategy selection)\n\nQ5: What's your rollback tolerance?\n    (How quickly must you be able to rollback? Instant vs. 5 min vs. 30 min)\n\nQ6: What's your monitoring observation period?\n    (How long to monitor before declaring success? 15 min vs. 30 min vs. 60 min)\n\nBased on your answers, I'll adjust:\n- Deployment strategy selection\n- Smoke test depth and coverage\n- SLO monitoring thresholds and duration\n- Rollback automation triggers\n```\n\n**Synthesize Guidance**: Combine answers into structured guidance string for execution\n\n### --regression-threshold Parameter\n\n**Purpose**: Set acceptable regression rate for deployment gates\n\n**Default**: `0` (zero tolerance - any regression blocks deployment)\n\n**Format**: `--regression-threshold N` where N = percentage (0-100)\n\n**Examples**:\n```bash\n# Zero tolerance (default)\n\u002Fflow-deploy-to-production --regression-threshold 0\n\n# Allow up to 5% regression\n\u002Fflow-deploy-to-production --regression-threshold 5\n\n# Relaxed threshold for low-risk deployments\n\u002Fflow-deploy-to-production --regression-threshold 10\n```\n\n**Application**:\n- **Staging Gate**: If regression rate > threshold → BLOCK promotion to production\n- **Production Gate**: If regression rate > threshold → TRIGGER automatic rollback\n- Threshold applies to both test regression and metric regression\n\n**Typical Thresholds**:\n| Risk Level | Recommended Threshold | Rationale |\n|------------|----------------------|-----------|\n| High | 0% | Zero tolerance for critical releases |\n| Medium | 2-5% | Allow minor acceptable regression |\n| Low | 5-10% | Relaxed for routine updates |\n\n### --rollback-on-regression Parameter\n\n**Purpose**: Control automatic rollback behavior when regression detected\n\n**Default**: `true` (automatic rollback enabled)\n\n**Format**: `--rollback-on-regression` (boolean flag)\n\n**Examples**:\n```bash\n# Automatic rollback enabled (default)\n\u002Fflow-deploy-to-production --rollback-on-regression\n\n# Manual intervention required\n\u002Fflow-deploy-to-production --no-rollback-on-regression\n```\n\n**Behavior**:\n- **If true**: Production regression → Immediate automated rollback\n- **If false**: Production regression → Alert user, await manual decision\n- Recommended: Keep enabled for production safety\n\n## Artifacts to Generate\n\n**Primary Deliverables**:\n- **Deployment Readiness Report**: Pre-flight validation → `.aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md`\n- **Regression Gate Reports**: Staging and production regression checks → `.aiwg\u002Fdeployment\u002Fregression-gate-staging.md`, `.aiwg\u002Fdeployment\u002Fregression-gate-production.md`\n- **Deployment Execution Log**: Real-time progress tracking → `.aiwg\u002Fdeployment\u002Fdeployment-execution-log.md`\n- **SLO Monitoring Report**: Metrics and breach detection → `.aiwg\u002Fdeployment\u002Fslo-monitoring-report.md`\n- **Deployment Summary Report**: Final outcome and lessons learned → `.aiwg\u002Freports\u002Fdeployment-report-{version}.md`\n- **Rollback Report** (if needed): Rollback execution and RCA → `.aiwg\u002Fdeployment\u002Frollback-report-{version}.md`\n\n**Supporting Artifacts**:\n- Smoke test results (working doc)\n- SLO breach alerts (archived)\n- Infrastructure health snapshots (archived)\n- Regression analysis reports (archived)\n\n## Regression Gates\n\n**Purpose**: Detect and block regressions before they reach production or impact users\n\n**Two-Gate Model**:\n\n### Staging Regression Gate\n\n**When**: After deployment to staging environment, before production cutover\n\n**What**: Compare staging behavior against production baseline\n\n**Checks**:\n1. **Test Regression**: Run full regression suite, compare pass rates\n2. **Metric Regression**: Compare error rates, latency, throughput\n3. **Smoke Test Regression**: Validate critical paths match production behavior\n\n**Decision**:\n- **Pass (regression ≤ threshold)**: Proceed to production deployment\n- **Fail (regression > threshold)**: BLOCK promotion, investigate, fix\n\n**Rationale**: Catch regressions in staging before they impact real users\n\n### Production Regression Gate\n\n**When**: After production deployment, during monitoring period\n\n**What**: Compare production behavior against pre-deployment baseline\n\n**Checks**:\n1. **Smoke Test Regression**: Validate critical paths still pass\n2. **SLO Regression**: Detect degradation in error rate, latency, availability\n3. **User Journey Regression**: Validate top user flows still complete successfully\n\n**Decision**:\n- **Pass (regression ≤ threshold)**: Deployment successful\n- **Fail (regression > threshold)**: TRIGGER automatic rollback (if `--rollback-on-regression`)\n\n**Rationale**: Immediate detection and rollback on production regression\n\n### Regression Detection Methodology\n\n**Test Regression**:\n```yaml\nbaseline: production test suite results\ncandidate: staging\u002Fproduction test suite results\nregression_rate: (baseline_pass_count - candidate_pass_count) \u002F baseline_pass_count * 100\n\nthreshold_check: regression_rate > threshold → FAIL\n```\n\n**Metric Regression**:\n```yaml\nbaseline: production metrics (pre-deployment)\ncandidate: staging\u002Fproduction metrics (post-deployment)\n\nregressions_to_detect:\n  - error_rate_increase > threshold\n  - latency_p99_increase > threshold\n  - throughput_decrease > threshold\n\nthreshold_check: any_regression > threshold → FAIL\n```\n\n**Scope Options**:\n- **full**: All tests and metrics (comprehensive)\n- **critical**: Only P0\u002FP1 tests and critical metrics (faster)\n- **targeted**: Tests\u002Fmetrics related to changed components\n\n### Integration with \u002Fregression-check\n\nThe regression gates use the `\u002Fregression-check` command:\n\n**Staging Gate**:\n```bash\n\u002Fregression-check --baseline production --candidate staging --scope full --threshold {threshold}\n```\n\n**Production Gate**:\n```bash\n\u002Fregression-check --baseline production-pre-deploy --candidate production-post-deploy --scope critical --threshold {threshold}\n```\n\n### Rollback Trigger on Regression\n\nIf production regression detected and `--rollback-on-regression` enabled:\n\n```yaml\nregression_detected:\n  trigger: regression_rate > threshold\n  action: automated_rollback\n  strategy: {blue-green | canary | rolling}\n  notification:\n    - alert_team\n    - declare_incident\n    - start_rca_process\n```\n\n## Multi-Agent Orchestration Workflow\n\n### Step 1: Deployment Strategy Selection\n\n**Purpose**: Choose deployment strategy based on risk, infrastructure, and requirements\n\n**Your Actions**:\n\n1. **Analyze Context**:\n   ```\n   Read:\n   - .aiwg\u002Fintake\u002Fproject-intake.md (understand project constraints)\n   - .aiwg\u002Fdeployment\u002Fdeployment-plan-*.md (existing deployment plans)\n   - .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md (infrastructure capabilities)\n   - User guidance (--guidance parameter or interactive answers)\n   ```\n\n2. **Launch Strategy Selection Agent**:\n   ```\n   Task(\n       subagent_type=\"deployment-manager\",\n       description=\"Recommend deployment strategy\",\n       prompt=\"\"\"\n       Read project context and architecture documentation\n\n       Recommend deployment strategy based on:\n\n       **Blue-Green Strategy**:\n       - When: Zero-downtime critical, instant rollback required\n       - Requires: 2x infrastructure capacity (temporary)\n       - Pros: Instant cutover, instant rollback, low risk\n       - Cons: Higher cost, requires duplicate environments\n\n       **Canary Strategy**:\n       - When: Progressive validation needed, high-risk release\n       - Requires: Traffic routing capability (Argo Rollouts, Flagger)\n       - Pros: Gradual rollout, SLO-driven automation, cost-efficient\n       - Cons: Slower rollout, complex automation setup\n\n       **Rolling Strategy**:\n       - When: Legacy systems, stateful services, simpler deployments\n       - Requires: Basic orchestration (Kubernetes rollout)\n       - Pros: No additional infrastructure, simple setup\n       - Cons: Slower rollout, manual validation, harder rollback\n\n       Analyze project requirements:\n       - Risk level: {from guidance or interactive}\n       - Infrastructure: {cloud provider, orchestration platform}\n       - Downtime tolerance: {zero vs. minimal vs. acceptable}\n       - Rollback requirements: {instant vs. fast vs. manual}\n\n       Recommend strategy with rationale\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fstrategy-recommendation.md\n       \"\"\"\n   )\n   ```\n\n3. **Confirm Strategy with User**:\n   ```\n   Read .aiwg\u002Fworking\u002Fdeployment\u002Fstrategy-recommendation.md\n\n   Present to user:\n   ─────────────────────────────────────────────\n   Deployment Strategy Recommendation\n   ─────────────────────────────────────────────\n\n   **Recommended**: {Blue-Green | Canary | Rolling}\n\n   **Rationale**: {why this strategy fits project needs}\n\n   **Trade-offs**:\n   - Pros: {list benefits}\n   - Cons: {list drawbacks}\n\n   **Requirements**:\n   - Infrastructure: {what's needed}\n   - Duration: {expected deployment time}\n   - Monitoring: {observation period}\n\n   Proceed with this strategy? (yes\u002Fno)\n   ─────────────────────────────────────────────\n   ```\n\n**Communicate Progress**:\n```\n✓ Analyzed deployment context\n✓ Strategy recommendation: {Blue-Green | Canary | Rolling}\n⏳ Awaiting user confirmation...\n```\n\n### Step 2: Pre-Deployment Validation\n\n**Purpose**: Verify all quality gates passed and environment is ready\n\n**Your Actions**:\n\n1. **Launch Parallel Validation Agents**:\n   ```\n   # Agent 1: Quality Gate Validation\n   Task(\n       subagent_type=\"project-manager\",\n       description=\"Validate all quality gates passed\",\n       prompt=\"\"\"\n       Check quality gate status for Transition phase\n\n       Read gate criteria: $AIWG_ROOT\u002F...\u002Fflows\u002Fgate-criteria-by-phase.md (Transition section)\n\n       Validate gates:\n       - [ ] Security Gate: No High\u002FCritical vulnerabilities\n       - [ ] Reliability Gate: SLOs met in staging\n       - [ ] Test Gate: Integration tests 100% passing\n       - [ ] Approval Gate: Release Manager signoff obtained\n\n       Generate gate validation report:\n       - Status: PASS | FAIL\n       - Gate checklist with results\n       - Decision: GO | NO-GO\n       - Gaps (if NO-GO): List missing approvals or failures\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fgate-validation-report.md\n       \"\"\"\n   )\n\n   # Agent 2: Environment Health Check\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Validate production environment health\",\n       prompt=\"\"\"\n       Check production environment readiness\n\n       Validate infrastructure health:\n       - [ ] All nodes healthy (Kubernetes cluster)\n       - [ ] No pods in crash loop or pending state\n       - [ ] Database connections healthy\n       - [ ] External integrations operational\n       - [ ] Monitoring and alerting functional\n       - [ ] No active P0\u002FP1 incidents\n\n       Check deployment artifacts:\n       - [ ] Container images available and tagged\n       - [ ] Checksums verified\n       - [ ] Container signatures validated (if required)\n       - [ ] Database migrations prepared (if applicable)\n\n       Generate environment health report:\n       - Infrastructure status: HEALTHY | DEGRADED | UNHEALTHY\n       - Artifacts status: READY | MISSING | INVALID\n       - Decision: GO | NO-GO\n       - Issues (if NO-GO): List blockers\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fenvironment-health-report.md\n       \"\"\"\n   )\n\n   # Agent 3: Rollback Plan Validation\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Validate rollback plan tested and ready\",\n       prompt=\"\"\"\n       Read rollback plan: .aiwg\u002Fdeployment\u002Frollback-plan-*.md\n\n       Validate rollback readiness:\n       - [ ] Rollback plan documented\n       - [ ] Rollback tested in staging (within last 7 days)\n       - [ ] Rollback automation configured (scripts, runbooks)\n       - [ ] Rollback SLOs defined (how fast can we rollback?)\n       - [ ] Communication plan for rollback scenario\n\n       If database migration included:\n       - [ ] Migration rollback script tested\n       - [ ] Data backup verified\n       - [ ] Backup restoration tested\n\n       Generate rollback validation report:\n       - Rollback readiness: READY | NOT_READY\n       - Rollback strategy: {blue-green instant | canary abort | rolling undo}\n       - Rollback SLO: {duration to full rollback}\n       - Issues (if NOT_READY): List gaps\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Frollback-validation-report.md\n       \"\"\"\n   )\n   ```\n\n2. **Synthesize Pre-Deployment Readiness**:\n   ```\n   Task(\n       subagent_type=\"deployment-manager\",\n       description=\"Synthesize deployment readiness report\",\n       prompt=\"\"\"\n       Read all validation reports:\n       - .aiwg\u002Fworking\u002Fdeployment\u002Fgate-validation-report.md\n       - .aiwg\u002Fworking\u002Fdeployment\u002Fenvironment-health-report.md\n       - .aiwg\u002Fworking\u002Fdeployment\u002Frollback-validation-report.md\n\n       Synthesize Deployment Readiness Report:\n\n       1. Overall Status: GO | CONDITIONAL_GO | NO-GO\n       2. Gate Validation: {status and details}\n       3. Environment Health: {status and details}\n       4. Rollback Readiness: {status and details}\n       5. Pre-Flight Checklist: {comprehensive checklist}\n       6. Decision Rationale: {why GO or NO-GO}\n       7. Conditions (if CONDITIONAL_GO): {what must be addressed}\n\n       Use template: agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fdeployment\u002Fdeployment-plan-template.md\n\n       Output: .aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md\n       \"\"\"\n   )\n   ```\n\n3. **Decision Point**:\n   ```\n   Read .aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md\n\n   If GO → Continue to Step 3\n   If CONDITIONAL_GO → Present conditions to user, wait for confirmation\n   If NO-GO → Report gaps, recommend remediation, STOP deployment\n   ```\n\n**Communicate Progress**:\n```\n⏳ Validating deployment readiness...\n  ✓ Quality gates validated: {PASS | FAIL}\n  ✓ Environment health checked: {HEALTHY | DEGRADED}\n  ✓ Rollback plan validated: {READY | NOT_READY}\n✓ Pre-deployment validation: {GO | CONDITIONAL_GO | NO-GO}\n```\n\n### Step 2.5: Staging Regression Gate\n\n**Purpose**: Detect regressions in staging before production deployment\n\n**Your Actions**:\n\n1. **Deploy to Staging**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Deploy new version to staging environment\",\n       prompt=\"\"\"\n       Execute deployment to staging environment\n\n       Actions:\n       1. Deploy new version to staging\n       2. Wait for all pods running and healthy\n       3. Validate health checks passing\n\n       Report:\n       - Staging deployment status: SUCCESS | FAILED\n       - Pods running: {count}\u002F{total}\n       - Health checks: {PASS | FAIL}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fstaging-deployment-log.md\n\n       If FAILED: Stop deployment, do NOT proceed to regression check\n       \"\"\"\n   )\n   ```\n\n2. **Execute Staging Regression Check**:\n   ```\n   Task(\n       subagent_type=\"regression-analyst\",\n       description=\"Run regression analysis on staging deployment\",\n       prompt=\"\"\"\n       Execute comprehensive regression check: staging vs. production baseline\n\n       Command: \u002Fregression-check --baseline production --candidate staging --scope full --threshold {threshold}\n\n       This checks:\n       1. Test Regression: Full regression suite comparison\n       2. Metric Regression: Error rate, latency, throughput comparison\n       3. Smoke Test Regression: Critical path validation\n\n       Parameters:\n       - baseline: Production (current live version)\n       - candidate: Staging (new version under test)\n       - scope: full (comprehensive check)\n       - threshold: {from --regression-threshold parameter, default 0}\n\n       Generate regression gate report:\n       - Regression rate: {percentage}\n       - Test failures: {new failures not in baseline}\n       - Metric degradations: {error rate, latency, throughput}\n       - Decision: PASS | FAIL\n       - Blockers (if FAIL): {list regression details}\n\n       Use schema: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fschemas\u002Fflows\u002Fregression-gate.yaml\n\n       Output: .aiwg\u002Fdeployment\u002Fregression-gate-staging.md\n\n       If FAIL (regression > threshold): BLOCK promotion to production\n       \"\"\"\n   )\n   ```\n\n3. **Staging Gate Decision Point**:\n   ```\n   Read .aiwg\u002Fdeployment\u002Fregression-gate-staging.md\n\n   Check regression_rate vs. threshold:\n\n   If regression_rate \u003C= threshold:\n     ✓ Staging regression gate PASSED\n     → Continue to Step 3 (Production Deployment)\n\n   If regression_rate > threshold:\n     ❌ Staging regression gate FAILED\n     → BLOCK promotion to production\n     → Report regression details to user\n     → Recommend investigation and fixes\n     → STOP deployment\n\n   Decision logged in deployment execution log\n   ```\n\n4. **Launch Regression Impact Assessment** (if regression detected):\n   ```\n   # Only if staging gate fails\n\n   Task(\n       subagent_type=\"regression-analyst\",\n       description=\"Assess regression impact and root cause\",\n       prompt=\"\"\"\n       Staging regression detected: {regression_rate}% > threshold {threshold}%\n\n       Analyze regression impact:\n\n       1. Categorize Regressions:\n          - Test regressions: {which tests now failing}\n          - Metric regressions: {which metrics degraded}\n          - Functional regressions: {which features broken}\n\n       2. Assess Root Cause:\n          - Code changes: {which commits introduced regression}\n          - Configuration changes: {any config differences}\n          - Dependency changes: {any library\u002Fservice updates}\n\n       3. Estimate Impact:\n          - Severity: {CRITICAL | HIGH | MEDIUM | LOW}\n          - User impact: {which user journeys affected}\n          - Scope: {percentage of users affected}\n\n       4. Recommend Remediation:\n          - Immediate fix: {what to change}\n          - Rollback option: {can we revert specific changes}\n          - Validation: {how to verify fix}\n\n       Use regression analysis agent tools and documentation\n\n       Output: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-staging.md\n\n       See: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fagents\u002Fregression-analyst.md\n       \"\"\"\n   )\n   ```\n\n**Communicate Progress**:\n```\n⏳ Staging Regression Gate...\n  ✓ Deployed to staging: {SUCCESS | FAILED}\n  ✓ Regression check: {PASS | FAIL}\n  {If PASS}\n  ✓ Staging gate PASSED: Regression {rate}% ≤ threshold {threshold}%\n  {If FAIL}\n  ❌ Staging gate FAILED: Regression {rate}% > threshold {threshold}%\n  ⏳ Analyzing regression impact...\n  ✓ Impact assessment: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-staging.md\n  ⚠️ Deployment BLOCKED until regressions fixed\n```\n\n### Step 3: Execute Deployment (Strategy-Specific)\n\n**Purpose**: Deploy new version using selected strategy with continuous monitoring\n\n#### Blue-Green Deployment\n\n**Your Actions**:\n\n1. **Deploy to Green Environment**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Deploy new version to green environment\",\n       prompt=\"\"\"\n       Execute blue-green deployment to green environment\n\n       Actions:\n       1. Deploy new version to green environment (while blue serves production)\n       2. Wait for all green pods to be running and ready\n       3. Validate green environment health checks passing\n\n       Log all actions with timestamps to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-green.md\n\n       Report:\n       - Green deployment status: SUCCESS | FAILED\n       - Pods running: {count}\u002F{total}\n       - Health checks: {PASS | FAIL}\n       - Duration: {minutes}\n\n       If FAILED: Stop deployment, do NOT cutover traffic\n       \"\"\"\n   )\n   ```\n\n2. **Run Smoke Tests on Green**:\n   ```\n   Task(\n       subagent_type=\"qa-engineer\",\n       description=\"Execute smoke tests on green environment\",\n       prompt=\"\"\"\n       Read smoke test plan: agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Ftest\u002Ftest-suite-card.md\n\n       Execute critical path smoke tests:\n       - [ ] API health endpoints (200 OK)\n       - [ ] User authentication flow\n       - [ ] Critical business operations (top 5-10 journeys)\n       - [ ] Database connectivity\n       - [ ] External integrations (payment gateway, email, etc.)\n       - [ ] Monitoring and logging operational\n\n       Test against green environment URL (not production)\n\n       Generate smoke test report:\n       - Tests passed: {count}\u002F{total}\n       - Tests failed: {list failures with details}\n       - Status: PASS | FAIL\n       - Duration: {minutes}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fsmoke-test-results-green.md\n\n       If FAIL: Stop deployment, do NOT cutover traffic\n       \"\"\"\n   )\n   ```\n\n3. **Cutover Traffic to Green**:\n   ```\n   # Only proceed if green deployment and smoke tests passed\n\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Cutover production traffic to green environment\",\n       prompt=\"\"\"\n       Execute traffic cutover from blue to green\n\n       Actions:\n       1. Update load balancer or service selector to point to green\n       2. Verify traffic is flowing to green (0% blue → 100% green)\n       3. Confirm blue environment still running (for instant rollback)\n\n       Log cutover actions with timestamps\n\n       Report:\n       - Cutover status: SUCCESS | FAILED\n       - Traffic distribution: {blue-percentage}% blue, {green-percentage}% green\n       - Timestamp: {cutover-time}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-cutover.md\n       \"\"\"\n   )\n   ```\n\n4. **Monitor SLOs Post-Cutover** (Step 4 will handle this)\n\n#### Canary Deployment\n\n**Your Actions**:\n\n1. **Deploy Canary (1-5% Traffic)**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Deploy canary version with 1-5% traffic\",\n       prompt=\"\"\"\n       Execute canary deployment with progressive rollout\n\n       Stage 1: Deploy canary receiving 1-5% of production traffic\n\n       Actions:\n       1. Deploy canary version alongside stable baseline\n       2. Configure traffic routing (1-5% to canary, 95-99% to baseline)\n       3. Verify canary pods running and healthy\n\n       Log all actions with timestamps\n\n       Report:\n       - Canary deployment status: SUCCESS | FAILED\n       - Traffic distribution: {canary-percentage}% canary, {baseline-percentage}% baseline\n       - Pods running: {count}\u002F{total}\n       - Health checks: {PASS | FAIL}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-canary-stage1.md\n\n       If FAILED: Stop deployment, scale down canary\n       \"\"\"\n   )\n   ```\n\n2. **Launch SLO Monitoring Agent** (runs continuously):\n   ```\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Monitor canary SLOs at 1-5% stage\",\n       prompt=\"\"\"\n       Monitor SLOs for canary vs. baseline for 10-15 minutes\n\n       Compare metrics:\n       - Error rate: canary should not exceed baseline by >2%\n       - Latency p99: canary should not exceed baseline by >20%\n       - Throughput: canary should be proportional to traffic share\n\n       SLO breach detection:\n       - If error rate breach: ABORT deployment, trigger rollback\n       - If latency breach: ABORT deployment, trigger rollback\n       - If infrastructure failure: ABORT deployment, trigger rollback\n\n       Generate monitoring report every 5 minutes:\n       - Status: PASS | BREACH\n       - Metrics comparison: {baseline vs. canary}\n       - Decision: CONTINUE | ABORT\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fslo-monitoring-canary-stage1.md\n\n       If BREACH: Immediately notify orchestrator to trigger rollback\n       \"\"\"\n   )\n   ```\n\n3. **Progressive Rollout** (if SLOs pass):\n   ```\n   # If Stage 1 SLOs pass, promote to 25%, then 50%, then 100%\n   # Repeat monitoring at each stage\n\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Promote canary to 25% traffic\",\n       prompt=\"\"\"\n       Stage 2: Promote canary to 25% traffic\n\n       Actions:\n       1. Update traffic routing (25% canary, 75% baseline)\n       2. Verify traffic distribution\n       3. Monitor SLOs for 10-15 minutes (launch new monitoring agent)\n\n       Report and save to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-canary-stage2.md\n\n       If SLO breach at any stage: ABORT, trigger rollback\n       \"\"\"\n   )\n\n   # Repeat for 50% and 100% stages\n   ```\n\n#### Rolling Deployment\n\n**Your Actions**:\n\n1. **Rolling Update Execution**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Execute rolling deployment node-by-node\",\n       prompt=\"\"\"\n       Execute rolling deployment strategy\n\n       Actions:\n       1. Update 1 instance\u002Fnode at a time\n       2. Wait for new instance to pass health checks\n       3. Monitor for 5 minutes before proceeding to next instance\n       4. Continue until all instances updated\n\n       Pause conditions:\n       - If health check fails: STOP, evaluate, rollback if needed\n       - If error rate increases: STOP, evaluate, rollback if needed\n\n       Log all actions with timestamps\n\n       Report:\n       - Instances updated: {count}\u002F{total}\n       - Current instance status: {status}\n       - Health checks: {PASS | FAIL}\n       - Error rate: {current vs. baseline}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-rolling.md\n       \"\"\"\n   )\n   ```\n\n**Communicate Progress** (all strategies):\n```\n⏳ Executing {Blue-Green | Canary | Rolling} deployment...\n  ✓ {Strategy-specific milestone 1}: {status}\n  ✓ {Strategy-specific milestone 2}: {status}\n  ⏳ {Strategy-specific milestone 3}: In progress...\n```\n\n### Step 4: Monitor SLOs and Production Regression Gate\n\n**Purpose**: Continuous validation that deployment is meeting reliability targets and no regressions introduced\n\n**Your Actions**:\n\n1. **Capture Production Baseline (Pre-Deployment)**:\n   ```\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Capture production baseline metrics before deployment\",\n       prompt=\"\"\"\n       Capture production baseline for regression comparison\n\n       Metrics to capture:\n       - Error rate (last 1 hour average)\n       - Latency p50, p95, p99 (last 1 hour)\n       - Throughput (requests\u002Fsec, last 1 hour)\n       - Availability (uptime percentage)\n       - Critical user journey completion rates\n\n       Test suite state:\n       - Smoke test pass rate (current)\n       - Integration test pass rate (current)\n       - Critical path test results\n\n       Save baseline snapshot:\n       - Timestamp: {pre-deployment time}\n       - Version: {current production version}\n       - Metrics: {captured values}\n\n       Output: .aiwg\u002Fworking\u002Fdeployment\u002Fproduction-baseline-snapshot.md\n\n       This baseline used for post-deployment regression comparison\n       \"\"\"\n   )\n   ```\n\n2. **Launch Parallel Monitoring Agents**:\n   ```\n   # Agent 1: SLO Monitoring\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Monitor production SLOs post-deployment\",\n       prompt=\"\"\"\n       Monitor SLOs for 15-30 minutes post-deployment (or as specified in guidance)\n\n       Key SLOs to track:\n       - Error rate: {target \u003C0.1% or custom}\n       - Latency p99: {target \u003C500ms or custom}\n       - Throughput: {baseline ±10% or custom}\n       - Availability: {target >99.95% or custom}\n\n       Compare current metrics vs. baseline (pre-deployment)\n\n       Automated breach detection:\n       - Error rate >2% above baseline → TRIGGER ROLLBACK\n       - Latency p99 >20% above baseline → TRIGGER ROLLBACK\n       - Throughput drop >30% below baseline → TRIGGER ROLLBACK\n       - Infrastructure alarms triggered → TRIGGER ROLLBACK\n\n       Generate SLO monitoring report every 5 minutes:\n       - Status: PASS | BREACH\n       - Metrics: {current vs. baseline vs. target}\n       - Alerts triggered: {count and details}\n       - Decision: CONTINUE | ROLLBACK\n\n       Save to: .aiwg\u002Fdeployment\u002Fslo-monitoring-report.md\n\n       If BREACH: Immediately notify orchestrator to trigger rollback (Step 5)\n       \"\"\"\n   )\n\n   # Agent 2: Smoke Tests (Production)\n   Task(\n       subagent_type=\"qa-engineer\",\n       description=\"Execute smoke tests against production\",\n       prompt=\"\"\"\n       Run smoke tests against production environment post-deployment\n\n       Execute critical path tests:\n       - [ ] API health endpoints\n       - [ ] User authentication and authorization\n       - [ ] Top 5-10 business operations\n       - [ ] Database read\u002Fwrite operations\n       - [ ] External integrations\n       - [ ] Monitoring and logging functional\n\n       Test against production URL (real traffic)\n\n       Generate smoke test report:\n       - Tests passed: {count}\u002F{total}\n       - Tests failed: {list failures with details}\n       - Status: PASS | FAIL\n       - Duration: {minutes}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fsmoke-test-results-production.md\n\n       If FAIL: Immediately notify orchestrator to trigger rollback\n       \"\"\"\n   )\n\n   # Agent 3: Infrastructure Health Monitoring\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Monitor infrastructure health continuously\",\n       prompt=\"\"\"\n       Monitor infrastructure health for 15-30 minutes post-deployment\n\n       Track infrastructure metrics:\n       - Pod restarts: >3 restarts in 5 minutes → ALERT\n       - OOM kills: Any OOM kill → TRIGGER ROLLBACK\n       - Node health: Any unhealthy nodes → ALERT\n       - Network errors: Elevated error rates → ALERT\n\n       Generate infrastructure health report every 5 minutes:\n       - Status: HEALTHY | DEGRADED | UNHEALTHY\n       - Pods: {running}\u002F{total}, restarts: {count}\n       - Nodes: {healthy}\u002F{total}\n       - Alerts: {list active alerts}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Finfrastructure-health-report.md\n\n       If UNHEALTHY: Immediately notify orchestrator to trigger rollback\n       \"\"\"\n   )\n\n   # Agent 4: Production Regression Gate\n   Task(\n       subagent_type=\"regression-analyst\",\n       description=\"Execute production regression check\",\n       prompt=\"\"\"\n       Execute production regression gate check\n\n       Command: \u002Fregression-check --baseline production-pre-deploy --candidate production-post-deploy --scope critical --threshold {threshold}\n\n       This checks:\n       1. Smoke Test Regression: Critical path validation\n       2. SLO Regression: Error rate, latency, availability\n       3. User Journey Regression: Top user flows completion\n\n       Parameters:\n       - baseline: Production snapshot (pre-deployment)\n       - candidate: Production current (post-deployment)\n       - scope: critical (P0\u002FP1 tests and critical metrics only)\n       - threshold: {from --regression-threshold parameter, default 0}\n\n       Compare against baseline from .aiwg\u002Fworking\u002Fdeployment\u002Fproduction-baseline-snapshot.md\n\n       Generate regression gate report:\n       - Regression rate: {percentage}\n       - New failures: {tests now failing}\n       - Metric degradations: {SLO breaches}\n       - Decision: PASS | FAIL\n       - Severity: {CRITICAL | HIGH | MEDIUM | LOW}\n\n       Use schema: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fschemas\u002Fflows\u002Fregression-gate.yaml\n\n       Output: .aiwg\u002Fdeployment\u002Fregression-gate-production.md\n\n       If FAIL (regression > threshold):\n         - Check --rollback-on-regression flag\n         - If enabled: Trigger automatic rollback\n         - If disabled: Alert user, await manual decision\n       \"\"\"\n   )\n   ```\n\n3. **Production Regression Gate Decision Point**:\n   ```\n   Read .aiwg\u002Fdeployment\u002Fregression-gate-production.md\n\n   Check regression_rate vs. threshold:\n\n   If regression_rate \u003C= threshold:\n     ✓ Production regression gate PASSED\n     → Continue monitoring, deployment successful\n\n   If regression_rate > threshold:\n     ❌ Production regression gate FAILED\n     → Check --rollback-on-regression flag:\n\n       If --rollback-on-regression enabled (default):\n         ⚠️ Automatic rollback TRIGGERED\n         → Execute Step 5 (Rollback)\n\n       If --rollback-on-regression disabled:\n         ⚠️ Regression detected, awaiting manual decision\n         → Alert user with regression details\n         → User must decide: [rollback | accept risk | investigate]\n\n   Decision logged in deployment execution log\n   ```\n\n4. **Aggregate Monitoring Results**:\n   ```\n   # You monitor all 4 agents continuously\n   # If ANY agent reports BREACH, FAIL, or UNHEALTHY → Trigger Step 5 (Rollback)\n   # If production regression gate FAILS and --rollback-on-regression → Trigger Step 5 (Rollback)\n   # If ALL agents report success for monitoring duration → Proceed to Step 6 (Success)\n   ```\n\n**Communicate Progress**:\n```\n⏳ Monitoring deployment health (15-30 min observation)...\n  ✓ Production baseline captured: .aiwg\u002Fworking\u002Fdeployment\u002Fproduction-baseline-snapshot.md\n  ✓ SLO monitoring: {PASS | BREACH} (updated every 5 min)\n  ✓ Smoke tests: {PASS | FAIL}\n  ✓ Infrastructure health: {HEALTHY | DEGRADED}\n  ✓ Production regression gate: {PASS | FAIL} (regression {rate}% vs. threshold {threshold}%)\n  {If regression detected}\n  ⚠️ Regression detected: {rate}% > threshold {threshold}%\n  {If --rollback-on-regression enabled}\n  ⏳ Automatic rollback triggered...\n  {If --rollback-on-regression disabled}\n  ⚠️ Awaiting manual decision: [rollback | accept | investigate]\n[If all passing for full duration]\n✓ Deployment validation complete: All checks passed, no regressions\n```\n\n### Step 5: Rollback (If Failure or Regression Detected)\n\n**Purpose**: Automated rollback execution if SLO breach, regression, or failure detected\n\n**Trigger Conditions**:\n- SLO breach detected (error rate, latency, throughput)\n- Smoke test failure\n- Infrastructure health degraded or unhealthy\n- **Regression detected at production gate** (if `--rollback-on-regression` enabled)\n- Manual abort by user\n\n**Your Actions**:\n\n1. **Execute Strategy-Specific Rollback**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Execute automated rollback\",\n       prompt=\"\"\"\n       ROLLBACK TRIGGERED: {reason - SLO breach | smoke test failure | infrastructure failure | regression detected}\n\n       Execute rollback strategy: {Blue-Green | Canary | Rolling}\n\n       **Blue-Green Rollback**:\n       1. Switch traffic back to blue environment (instant cutover)\n       2. Verify traffic flowing to blue (100% blue, 0% green)\n       3. Confirm SLOs return to baseline\n       4. Scale down green environment (optional, for cost)\n\n       **Canary Rollback**:\n       1. Abort canary rollout (stop progressive promotion)\n       2. Scale down canary pods to 0\n       3. Verify baseline serving 100% traffic\n       4. Confirm SLOs return to baseline\n\n       **Rolling Rollback**:\n       1. Trigger rollout undo (revert to previous version)\n       2. Wait for all pods to rollback to previous version\n       3. Verify all pods running previous version\n       4. Confirm SLOs return to baseline\n\n       Log all rollback actions with timestamps\n\n       Report:\n       - Rollback trigger: {reason}\n       - Rollback strategy: {strategy}\n       - Rollback status: SUCCESS | FAILED\n       - Duration: {minutes}\n       - Traffic distribution: {current}\n       - SLOs post-rollback: {status}\n\n       Save to: .aiwg\u002Fdeployment\u002Frollback-execution-log.md\n\n       If rollback FAILED: CRITICAL ESCALATION to Incident Commander\n       \"\"\"\n   )\n   ```\n\n2. **Verify Rollback Success**:\n   ```\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Validate rollback successful\",\n       prompt=\"\"\"\n       Verify rollback restored stable state\n\n       Validate:\n       - [ ] Old version serving 100% traffic\n       - [ ] SLOs returned to baseline (error rate, latency)\n       - [ ] Smoke tests passing on rolled-back version\n       - [ ] No active alerts or incidents\n       - [ ] Infrastructure health restored\n\n       Generate rollback validation report:\n       - Status: SUCCESS | PARTIAL | FAILED\n       - SLOs: {current vs. baseline}\n       - Smoke tests: {PASS | FAIL}\n       - Stability: {STABLE | UNSTABLE}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Frollback-validation-report.md\n\n       If rollback FAILED or PARTIAL: CRITICAL ESCALATION\n       \"\"\"\n   )\n   ```\n\n3. **Post-Rollback Regression Verification**:\n   ```\n   # Only if rollback triggered by regression\n\n   Task(\n       subagent_type=\"regression-analyst\",\n       description=\"Verify rollback eliminated regression\",\n       prompt=\"\"\"\n       Rollback complete, verify regression eliminated\n\n       Execute regression check post-rollback:\n       - Baseline: Production (pre-deployment snapshot)\n       - Candidate: Production (post-rollback)\n\n       Command: \u002Fregression-check --baseline production-pre-deploy --candidate production-post-rollback --scope critical\n\n       Validate:\n       - [ ] Regression eliminated (rate back to 0%)\n       - [ ] All tests back to passing\n       - [ ] Metrics returned to baseline\n\n       Generate post-rollback regression report:\n       - Regression eliminated: YES | NO\n       - Tests restored: {count}\u002F{total}\n       - Metrics restored: {error rate, latency, throughput}\n\n       Output: .aiwg\u002Fdeployment\u002Fregression-verification-post-rollback.md\n\n       If regression NOT eliminated: Deeper issue, escalate\n       \"\"\"\n   )\n   ```\n\n4. **Declare Incident and Initiate RCA**:\n   ```\n   Task(\n       subagent_type=\"incident-commander\",\n       description=\"Declare incident and start root cause analysis\",\n       prompt=\"\"\"\n       Deployment failed, rollback executed\n\n       Declare incident:\n       - Severity: P0 (if production impact) | P1 (if rollback successful)\n       - Summary: Deployment rollback - {reason}\n       - Impact: {describe user\u002Fbusiness impact}\n       - Timeline: {deployment start → failure detected → rollback completed}\n\n       Include regression details if applicable:\n       - Regression rate: {percentage}\n       - Regression threshold: {threshold}\n       - Specific regressions: {test failures, metric degradations}\n\n       Initiate root cause analysis:\n       - Assemble incident response team\n       - Preserve all logs and metrics (deployment logs, SLO data, infrastructure snapshots, regression reports)\n       - Schedule incident review meeting\n\n       Use template: agentic\u002Fcode\u002Fframeworks\u002Fops-complete\u002Ftemplates\u002Fincident.md\n\n       Output incident report: .aiwg\u002Fdeployment\u002Frollback-report-{version}.md\n       \"\"\"\n   )\n   ```\n\n**Communicate Progress**:\n```\n❌ Deployment failure detected: {reason}\n{If regression triggered}\n⚠️ Regression detected: {rate}% > threshold {threshold}%\n⏳ Executing automated rollback...\n  ✓ Rollback execution: {SUCCESS | FAILED}\n  ✓ Rollback validation: {SUCCESS | PARTIAL | FAILED}\n  ✓ Regression verification: {ELIMINATED | PERSISTS}\n  ✓ Incident declared: {incident-id}\n✓ Rollback complete: Production restored to previous version\n```\n\n### Step 6: Generate Deployment Report (Success Path)\n\n**Purpose**: Document successful deployment with metrics and lessons learned\n\n**Your Actions**:\n\n1. **Synthesize Deployment Summary**:\n   ```\n   Task(\n       subagent_type=\"deployment-manager\",\n       description=\"Generate comprehensive deployment report\",\n       prompt=\"\"\"\n       Read all deployment artifacts:\n       - .aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md (pre-flight)\n       - .aiwg\u002Fdeployment\u002Fregression-gate-staging.md (staging regression check)\n       - .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-*.md (deployment actions)\n       - .aiwg\u002Fdeployment\u002Fslo-monitoring-report.md (SLO validation)\n       - .aiwg\u002Fdeployment\u002Fregression-gate-production.md (production regression check)\n       - .aiwg\u002Fworking\u002Fdeployment\u002Fsmoke-test-results-*.md (test results)\n       - .aiwg\u002Fworking\u002Fdeployment\u002Finfrastructure-health-report.md (health checks)\n\n       Generate Deployment Summary Report:\n\n       1. Overview\n          - Status: SUCCESS | ROLLBACK\n          - Version: {version}\n          - Strategy: {Blue-Green | Canary | Rolling}\n          - Duration: {total deployment time}\n\n       2. Deployment Timeline\n          - Pre-deployment validation: {timestamp, duration}\n          - Staging regression gate: {timestamp, result}\n          - Deployment execution: {timestamp, duration, strategy milestones}\n          - Smoke tests: {timestamp, duration}\n          - SLO monitoring: {timestamp, duration}\n          - Production regression gate: {timestamp, result}\n          - Completion: {timestamp}\n\n       3. Pre-Deployment Validation Results\n          - Quality gates: {status}\n          - Environment health: {status}\n          - Rollback readiness: {status}\n\n       4. Regression Gate Results\n          - Staging gate: {PASS | FAIL, regression rate: {rate}%}\n          - Production gate: {PASS | FAIL, regression rate: {rate}%}\n          - Threshold: {threshold}%\n          - Rollback triggered: {YES | NO}\n\n       5. Deployment Execution Details (strategy-specific)\n          - {Blue-Green: green deployment, cutover, blue retirement}\n          - {Canary: 1-5%, 25%, 50%, 100% progression}\n          - {Rolling: node-by-node updates}\n\n       6. SLO Metrics\n          - Error rate: {baseline vs. post-deployment vs. target}\n          - Latency p99: {baseline vs. post-deployment vs. target}\n          - Throughput: {baseline vs. post-deployment}\n          - Availability: {uptime percentage}\n\n       7. Smoke Test Results\n          - Critical path tests: {passed\u002Ftotal}\n          - API tests: {passed\u002Ftotal}\n          - Database tests: {passed\u002Ftotal}\n          - Integration tests: {passed\u002Ftotal}\n\n       8. Infrastructure Health\n          - Pods: {running\u002Ftotal, restarts}\n          - Nodes: {healthy\u002Ftotal}\n          - Alerts triggered: {count, resolved}\n\n       9. Issues and Resolutions\n          - {list any issues encountered and how resolved}\n\n       10. Lessons Learned\n          - What went well: {list successes}\n          - What could improve: {list improvement opportunities}\n          - Action items: {concrete actions for future deployments}\n\n       11. Approvals and Sign-offs\n          - Deployment Manager: {name, timestamp}\n          - Reliability Engineer: {name, timestamp}\n          - Operations Lead: {name, timestamp}\n\n       Use the deployment report fields listed above\n\n       Output: .aiwg\u002Freports\u002Fdeployment-report-{version}.md\n       \"\"\"\n   )\n   ```\n\n2. **Archive Workflow Artifacts**:\n   ```\n   # You handle archiving directly\n\n   Archive complete deployment workflow:\n   - Move .aiwg\u002Fworking\u002Fdeployment\u002F to .aiwg\u002Farchive\u002F{date}\u002Fdeployment-{version}\u002F\n   - Create audit trail: .aiwg\u002Farchive\u002F{date}\u002Fdeployment-{version}\u002Faudit-trail.md\n\n   Audit trail includes:\n   - Timeline of all agent actions\n   - Decision points and outcomes\n   - Regression gate results\n   - SLO metrics snapshots\n   - Final deployment report location\n   ```\n\n**Communicate Progress**:\n```\n⏳ Generating deployment report...\n✓ Deployment report complete: .aiwg\u002Freports\u002Fdeployment-report-{version}.md\n✓ Workflow archived: .aiwg\u002Farchive\u002F{date}\u002Fdeployment-{version}\u002F\n```\n\n### Step 7: Notify Stakeholders and Update Documentation\n\n**Purpose**: Communicate deployment outcome and update operational documentation\n\n**Your Actions**:\n\n1. **Generate Stakeholder Notification**:\n   ```\n   Task(\n       subagent_type=\"support-lead\",\n       description=\"Draft stakeholder notification\",\n       prompt=\"\"\"\n       Read deployment report: .aiwg\u002Freports\u002Fdeployment-report-{version}.md\n\n       Draft stakeholder notification email:\n\n       Subject: Production Deployment {SUCCESS | COMPLETED WITH ROLLBACK} - Version {version}\n\n       Body:\n       - Deployment status: {SUCCESS | ROLLBACK}\n       - Version deployed: {version}\n       - Strategy used: {Blue-Green | Canary | Rolling}\n       - Duration: {total time}\n       - Regression gates: {PASSED | FAILED}\n       - SLO metrics: {error rate, latency, availability}\n       - User impact: {None | Minimal | Moderate}\n       - Next steps: {monitoring, support readiness, known issues}\n\n       Audience:\n       - Executive stakeholders\n       - Product team\n       - Customer support team\n       - Engineering team\n\n       Save notification draft to: .aiwg\u002Fworking\u002Fdeployment\u002Fstakeholder-notification-{version}.md\n\n       Note: User must review and send notification\n       \"\"\"\n   )\n   ```\n\n2. **Update Operational Runbooks**:\n   ```\n   Task(\n       subagent_type=\"deployment-manager\",\n       description=\"Update deployment runbooks with lessons learned\",\n       prompt=\"\"\"\n       Read lessons learned from deployment report\n\n       Update deployment runbooks with improvements:\n       - Process improvements identified\n       - New smoke tests to add\n       - SLO threshold adjustments\n       - Regression gate threshold tuning\n       - Monitoring improvements\n       - Rollback procedure refinements\n\n       Document updates to: .aiwg\u002Fdeployment\u002Fdeployment-runbook-updates-{version}.md\n\n       Note: User should review and apply to operational documentation\n       \"\"\"\n   )\n   ```\n\n**Communicate Progress**:\n```\n✓ Stakeholder notification drafted: .aiwg\u002Fworking\u002Fdeployment\u002Fstakeholder-notification-{version}.md\n✓ Runbook updates documented: .aiwg\u002Fdeployment\u002Fdeployment-runbook-updates-{version}.md\n```\n\n## Final Summary Report\n\n**Present to User**:\n\n```\n─────────────────────────────────────────────\nProduction Deployment Complete\n─────────────────────────────────────────────\n\n**Status**: {SUCCESS | ROLLBACK}\n**Version**: {version}\n**Strategy**: {Blue-Green | Canary | Rolling}\n**Duration**: {total deployment time}\n\n**Timeline**:\n- Pre-deployment validation: {duration}\n- Staging regression gate: {PASS | FAIL, regression {rate}%}\n- Deployment execution: {duration}\n- SLO monitoring: {duration}\n- Production regression gate: {PASS | FAIL, regression {rate}%}\n- Total: {total duration}\n\n**Regression Gates**:\n✓ Staging gate: {PASS | FAIL} (threshold: {threshold}%)\n✓ Production gate: {PASS | FAIL} (threshold: {threshold}%)\n{If regression detected}\n⚠️ Regression: {rate}% {≤ | >} threshold {threshold}%\n{If rollback triggered}\n✓ Automatic rollback: {SUCCESS | FAILED}\n\n**SLO Metrics**:\n✓ Error rate: {current}% (target: \u003C{target}%)\n✓ Latency p99: {current}ms (target: \u003C{target}ms)\n✓ Throughput: {current} req\u002Fs (baseline: {baseline} req\u002Fs)\n✓ Availability: {percentage}%\n\n**Smoke Tests**: {passed}\u002F{total} passed\n\n**Infrastructure**: {pods} pods running, {nodes} nodes healthy\n\n**Artifacts Generated**:\n- Deployment Readiness Report: .aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md\n- Staging Regression Gate: .aiwg\u002Fdeployment\u002Fregression-gate-staging.md\n- Production Regression Gate: .aiwg\u002Fdeployment\u002Fregression-gate-production.md\n- SLO Monitoring Report: .aiwg\u002Fdeployment\u002Fslo-monitoring-report.md\n- Deployment Summary Report: .aiwg\u002Freports\u002Fdeployment-report-{version}.md\n{If rollback}\n- Rollback Report: .aiwg\u002Fdeployment\u002Frollback-report-{version}.md\n- Regression Impact Assessment: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-*.md\n- Incident Report: {link to incident}\n\n**Next Steps**:\n- Review deployment report for lessons learned\n- Send stakeholder notification (draft ready)\n- Update operational runbooks with improvements\n- Continue monitoring SLOs for 24-48 hours\n{If rollback}\n- Conduct incident review meeting\n- Perform root cause analysis on regression\n- Fix issues identified\n- Plan re-deployment\n\n─────────────────────────────────────────────\n```\n\n## Regression-Blocked Deployment Example\n\n**Scenario**: Staging regression gate detects 8% test failure rate (threshold: 5%)\n\n```\n─────────────────────────────────────────────\nDeployment BLOCKED: Staging Regression Gate Failed\n─────────────────────────────────────────────\n\n**Status**: BLOCKED\n**Version**: v2026.1.5\n**Strategy**: Blue-Green\n**Regression Detected**: 8.0% > threshold 5.0%\n\n**Staging Regression Gate**:\n❌ FAILED: 8.0% regression rate exceeds threshold\n- Test failures: 12 new failures (150 total, 138 baseline)\n- Metric degradations:\n  • Error rate: 0.15% (+0.12% from baseline)\n  • Latency p99: 580ms (+18% from baseline)\n- Critical path: 2\u002F10 user journeys failing\n\n**Impact Assessment**:\n- Severity: HIGH\n- Affected areas: Authentication, Payment processing\n- Root cause: New rate limiting logic breaking retry logic\n- User impact: 15-20% of login attempts would fail\n\n**Remediation Required**:\n1. Revert rate limiting changes (commit abc123)\n2. Add retry backoff logic to authentication client\n3. Update tests to cover rate limiting scenarios\n4. Re-deploy to staging and re-run regression check\n\n**Artifacts**:\n- Regression gate report: .aiwg\u002Fdeployment\u002Fregression-gate-staging.md\n- Impact assessment: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-staging.md\n\n**Decision**: Deployment BLOCKED until regressions resolved\n\n─────────────────────────────────────────────\n```\n\n## Quality Gates\n\nBefore marking workflow complete, verify:\n- [ ] Pre-deployment validation passed (quality gates, environment health, rollback plan)\n- [ ] Staging regression gate passed (or deployment blocked if failed)\n- [ ] Deployment executed successfully (strategy-specific milestones)\n- [ ] Smoke tests passed (production validation)\n- [ ] SLOs met for monitoring duration (15-30 minutes)\n- [ ] Production regression gate passed (or rollback triggered if failed)\n- [ ] Deployment report generated with metrics and lessons learned\n- [ ] Regression gate results documented\n- [ ] Artifacts saved to .aiwg\u002Fdeployment\u002F and .aiwg\u002Freports\u002F\n- [ ] Working drafts archived to .aiwg\u002Farchive\u002F\n- [ ] Stakeholder notification drafted\n\n## User Communication\n\n**At start**: Confirm understanding and strategy\n\n```\nUnderstood. I'll orchestrate the production deployment.\n\nStrategy: {Blue-Green | Canary | Rolling}\nVersion: {version}\nDuration: {expected deployment time}\nRegression Threshold: {threshold}%\nRollback on Regression: {enabled | disabled}\n\nThis will:\n- Validate deployment readiness (quality gates, environment, rollback)\n- Staging regression gate (block if regression > {threshold}%)\n- Execute {strategy} deployment with continuous monitoring\n- Production regression gate (rollback if regression > {threshold}%)\n- Run smoke tests and SLO validation\n- Automated rollback on failure or regression\n- Generate comprehensive deployment report\n\nExpected duration: {30-90 minutes for deployment, 10-15 minutes orchestration}\n\nStarting orchestration...\n```\n\n**During**: Update progress with clear indicators\n\n```\n✓ = Complete\n⏳ = In progress\n❌ = Error\u002Fblocked\n⚠️ = Warning\u002Fattention needed\n```\n\n**At end**: Summary report with status and artifacts (see Final Summary Report above)\n\n## Error Handling\n\n**Quality Gate Failure**:\n```\n❌ Pre-deployment validation failed: {gate-name}\n\nGaps identified:\n- {list missing approvals or failures}\n\nRecommendation: Resolve gate failures before proceeding\n- Command: \u002Fgate-check transition\n- Fix: {specific actions to resolve each gap}\n\nDeployment BLOCKED until all gates pass.\n```\n\n**Staging Regression Gate Failure**:\n```\n❌ Staging regression gate failed: {regression-rate}% > threshold {threshold}%\n\nRegressions detected:\n- Test failures: {count new failures}\n- Metric degradations: {error rate, latency, throughput}\n- Critical paths affected: {list user journeys}\n\nImpact assessment: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-staging.md\n\nRecommendation: Fix regressions before production deployment\n- Root cause: {likely causes}\n- Fix: {specific remediation actions}\n- Re-test: Run \u002Fregression-check after fixes\n\nDeployment BLOCKED until regressions resolved.\n```\n\n**Environment Health Degraded**:\n```\n❌ Production environment unhealthy: {issue-description}\n\nIssues:\n- {list infrastructure problems}\n\nRecommendation: Resolve environment issues before deploying\n- Check: {kubectl commands to diagnose}\n- Fix: {specific remediation actions}\n\nDeployment BLOCKED until environment healthy.\n```\n\n**Deployment Execution Failure**:\n```\n❌ Deployment failed during execution: {error-message}\n\nError: {description}\n\nRecommended Actions:\n1. Review deployment logs: {path}\n2. Check {specific components}: {diagnostic commands}\n3. Fix identified issue\n4. Re-run deployment\n\nNo rollback needed (failure before cutover to new version).\n```\n\n**SLO Breach Detected**:\n```\n❌ SLO breach detected: {slo-name}\n- Current: {current-value}\n- Target: {target-value}\n- Threshold: {threshold-value}\n\nAutomated rollback TRIGGERED\n\n⏳ Executing rollback...\n✓ Rollback complete: Production restored to version {previous-version}\n✓ SLOs returned to baseline\n\nIncident declared: {incident-id}\nRoot cause analysis initiated.\n\nRecommended Actions:\n1. Review SLO monitoring report: {path}\n2. Analyze failure reason: {likely causes}\n3. Fix issues identified\n4. Validate in staging\n5. Plan re-deployment\n```\n\n**Production Regression Gate Failure**:\n```\n❌ Production regression gate failed: {regression-rate}% > threshold {threshold}%\n\nRegressions detected:\n- Test failures: {count new failures}\n- Metric degradations: {error rate, latency, availability}\n- User journeys affected: {list critical paths}\n\n{If --rollback-on-regression enabled}\nAutomated rollback TRIGGERED\n\n⏳ Executing rollback...\n✓ Rollback complete: Production restored to version {previous-version}\n✓ Regression verification: {ELIMINATED | PERSISTS}\n\n{If --rollback-on-regression disabled}\n⚠️ Manual decision required:\n- [rollback] Rollback to previous version\n- [accept] Accept regression risk, continue monitoring\n- [investigate] Keep deployed, investigate root cause\n\nRegression details: .aiwg\u002Fdeployment\u002Fregression-gate-production.md\n\nIncident declared: {incident-id}\nRoot cause analysis initiated.\n\nRecommended Actions:\n1. Review regression gate report: {path}\n2. Analyze regression root cause: {likely causes}\n3. Fix issues identified\n4. Validate in staging with \u002Fregression-check\n5. Plan re-deployment or accept risk\n```\n\n**Rollback Failure (CRITICAL)**:\n```\n❌ CRITICAL: Rollback failed - {error-message}\n\nThis is a P0 production incident.\n\nIMMEDIATE ACTIONS:\n1. Escalate to Incident Commander\n2. Assemble incident response team\n3. Manual intervention required: {specific actions}\n4. Notify all stakeholders of service disruption\n\nIncident declared: {incident-id}\nIncident Commander: {contact info}\n\nDo NOT attempt re-deployment until incident resolved.\n```\n\n**Smoke Test Failure**:\n```\n❌ Smoke tests failed: {test-name}\n\nFailed tests:\n- {list failures with details}\n\nIf deployed to production: Automated rollback TRIGGERED\nIf not yet cutover: Deployment STOPPED (no rollback needed)\n\nRecommended Actions:\n1. Review smoke test logs: {path}\n2. Diagnose failure: {likely causes}\n3. Fix issues identified\n4. Re-run smoke tests in staging\n5. Plan re-deployment\n```\n\n## Success Criteria\n\nThis orchestration succeeds when:\n- [ ] Pre-deployment validation passed (all quality gates GO)\n- [ ] Deployment strategy selected and confirmed\n- [ ] Staging regression gate passed (regression ≤ threshold)\n- [ ] Deployment executed successfully (strategy-specific milestones)\n- [ ] Smoke tests passed (production validation)\n- [ ] SLOs met for monitoring duration (15-30 minutes)\n- [ ] Production regression gate passed (regression ≤ threshold)\n- [ ] No rollback triggered (or rollback successful if triggered)\n- [ ] Deployment report generated with metrics and lessons learned\n- [ ] Regression analysis documented\n- [ ] Stakeholder notification drafted\n- [ ] Operational runbooks updated with improvements\n- [ ] Complete audit trails archived\n\n## Metrics to Track\n\n**During orchestration, track**:\n- Deployment duration: {total time from start to completion}\n- Regression rates: {staging and production}\n- SLO metrics: {error rate, latency, throughput, availability}\n- Smoke test pass rate: {passed\u002Ftotal}\n- Infrastructure health: {pods running, nodes healthy, alerts triggered}\n- Rollback count: {number of rollbacks triggered}\n- Regression-triggered rollbacks: {count}\n- Mean time to rollback (MTTR): {time from failure detection to rollback completion}\n\n## References\n\n**Templates** (via $AIWG_ROOT):\n- Deployment Plan: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fdeployment\u002Fdeployment-plan-template.md`\n- Rollback Plan: rollback steps in this skill\n- SLO Definition: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Freliability\u002Fslo-sli-template.md`\n- Smoke Test Checklist: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Ftest\u002Ftest-suite-card.md`\n- Deployment Report: deployment report fields in this skill\n- Incident Report: `agentic\u002Fcode\u002Fframeworks\u002Fops-complete\u002Ftemplates\u002Fincident.md`\n\n**Gate Criteria**:\n- `flows\u002Fgate-criteria-by-phase.md` (Transition section)\n\n**Schemas**:\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fschemas\u002Fflows\u002Fregression-gate.yaml - Regression gate format\n\n**Commands**:\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fcommands\u002Fregression-check.md - Regression detection command\n\n**Agents**:\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fagents\u002Fregression-analyst.md - Regression analysis agent\n\n**Multi-Agent Pattern**:\n- `docs\u002Fmulti-agent-documentation-pattern.md`\n\n**Orchestrator Architecture**:\n- `docs\u002Forchestrator-architecture.md`\n\n**Natural Language Translations**:\n- `docs\u002Fsimple-language-translations.md`\n","> **Declarative Flow (#1539):** This flow's orchestration is now also expressed as a\n> declarative YAML Flow at `flows\u002Fflow-deploy-to-production.playbook.yaml` (source of truth for the step\n> sequence + gates). This SKILL.md remains the discoverable trigger surface and prose\n> reference. See epic #1534.\n\n# Production Deployment Orchestration Flow\n\n**You are the Core Orchestrator** for production deployment workflows.\n\n## Your Role\n\n**You orchestrate multi-agent workflows. You do NOT execute bash scripts.**\n\nWhen the user requests this flow (via natural language or explicit command):\n\n1. **Interpret the request** and confirm understanding\n2. **Read this template** as your orchestration guide\n3. **Extract agent assignments** and workflow steps\n4. **Delegate agents with the current provider-native orchestration mechanism** in the correct sequence\n5. **Synthesize results** and finalize artifacts\n6. **Report completion** with summary\n\n## Deployment Overview\n\n**Purpose**: Safe, validated production deployment with automated rollback capability and regression detection\n\n**Key Activities**:\n- Strategy selection (blue-green, canary, rolling)\n- Pre-deployment validation and gate checks\n- **Regression detection at staging and production gates**\n- Progressive deployment with SLO monitoring\n- Smoke tests and health validation\n- **Automated rollback on regression or failure**\n\n**Expected Duration**: 30-90 minutes (varies by strategy), 10-15 minutes orchestration\n\n## Natural Language Triggers\n\nUsers may say:\n- \"Deploy to production\"\n- \"Production deployment\"\n- \"Release to prod\"\n- \"Start deployment\"\n- \"Deploy version X.Y.Z\"\n- \"Go live with new release\"\n- \"Execute production rollout\"\n\nYou recognize these as requests for this orchestration flow.\n\n## Parameter Handling\n\n### --guidance Parameter\n\n**Purpose**: User provides upfront direction to tailor orchestration priorities\n\n**Examples**:\n```\n--guidance \"Zero-downtime critical, use blue-green strategy\"\n--guidance \"High-risk release, progressive canary with 5% → 25% → 100%\"\n--guidance \"Database migration included, need extended maintenance window\"\n--guidance \"First production deployment, extra validation and monitoring\"\n```\n\n**How to Apply**:\n- Parse guidance for keywords: strategy, risk level, timeline, validation depth\n- Adjust strategy selection (blue-green vs. canary vs. rolling)\n- Modify validation depth (minimal vs. comprehensive smoke tests)\n- Influence monitoring duration (15 min vs. 60 min observation)\n\n### --interactive Parameter\n\n**Purpose**: You ask 6-8 strategic questions to understand deployment context\n\n**Questions to Ask** (if --interactive):\n\n```\nI'll ask 6 strategic questions to tailor the production deployment to your needs:\n\nQ1: What deployment strategy do you prefer?\n    (blue-green = instant cutover, canary = progressive rollout, rolling = node-by-node)\n\nQ2: What's the risk level of this release?\n    (Low = routine updates, Medium = new features, High = architecture changes)\n\nQ3: What are your SLO targets?\n    (e.g., error rate \u003C0.1%, latency p99 \u003C500ms, availability >99.95%)\n\nQ4: Is a database migration or schema change included?\n    (Affects rollback complexity and strategy selection)\n\nQ5: What's your rollback tolerance?\n    (How quickly must you be able to rollback? Instant vs. 5 min vs. 30 min)\n\nQ6: What's your monitoring observation period?\n    (How long to monitor before declaring success? 15 min vs. 30 min vs. 60 min)\n\nBased on your answers, I'll adjust:\n- Deployment strategy selection\n- Smoke test depth and coverage\n- SLO monitoring thresholds and duration\n- Rollback automation triggers\n```\n\n**Synthesize Guidance**: Combine answers into structured guidance string for execution\n\n### --regression-threshold Parameter\n\n**Purpose**: Set acceptable regression rate for deployment gates\n\n**Default**: `0` (zero tolerance - any regression blocks deployment)\n\n**Format**: `--regression-threshold N` where N = percentage (0-100)\n\n**Examples**:\n```bash\n# Zero tolerance (default)\n\u002Fflow-deploy-to-production --regression-threshold 0\n\n# Allow up to 5% regression\n\u002Fflow-deploy-to-production --regression-threshold 5\n\n# Relaxed threshold for low-risk deployments\n\u002Fflow-deploy-to-production --regression-threshold 10\n```\n\n**Application**:\n- **Staging Gate**: If regression rate > threshold → BLOCK promotion to production\n- **Production Gate**: If regression rate > threshold → TRIGGER automatic rollback\n- Threshold applies to both test regression and metric regression\n\n**Typical Thresholds**:\n| Risk Level | Recommended Threshold | Rationale |\n|------------|----------------------|-----------|\n| High | 0% | Zero tolerance for critical releases |\n| Medium | 2-5% | Allow minor acceptable regression |\n| Low | 5-10% | Relaxed for routine updates |\n\n### --rollback-on-regression Parameter\n\n**Purpose**: Control automatic rollback behavior when regression detected\n\n**Default**: `true` (automatic rollback enabled)\n\n**Format**: `--rollback-on-regression` (boolean flag)\n\n**Examples**:\n```bash\n# Automatic rollback enabled (default)\n\u002Fflow-deploy-to-production --rollback-on-regression\n\n# Manual intervention required\n\u002Fflow-deploy-to-production --no-rollback-on-regression\n```\n\n**Behavior**:\n- **If true**: Production regression → Immediate automated rollback\n- **If false**: Production regression → Alert user, await manual decision\n- Recommended: Keep enabled for production safety\n\n## Artifacts to Generate\n\n**Primary Deliverables**:\n- **Deployment Readiness Report**: Pre-flight validation → `.aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md`\n- **Regression Gate Reports**: Staging and production regression checks → `.aiwg\u002Fdeployment\u002Fregression-gate-staging.md`, `.aiwg\u002Fdeployment\u002Fregression-gate-production.md`\n- **Deployment Execution Log**: Real-time progress tracking → `.aiwg\u002Fdeployment\u002Fdeployment-execution-log.md`\n- **SLO Monitoring Report**: Metrics and breach detection → `.aiwg\u002Fdeployment\u002Fslo-monitoring-report.md`\n- **Deployment Summary Report**: Final outcome and lessons learned → `.aiwg\u002Freports\u002Fdeployment-report-{version}.md`\n- **Rollback Report** (if needed): Rollback execution and RCA → `.aiwg\u002Fdeployment\u002Frollback-report-{version}.md`\n\n**Supporting Artifacts**:\n- Smoke test results (working doc)\n- SLO breach alerts (archived)\n- Infrastructure health snapshots (archived)\n- Regression analysis reports (archived)\n\n## Regression Gates\n\n**Purpose**: Detect and block regressions before they reach production or impact users\n\n**Two-Gate Model**:\n\n### Staging Regression Gate\n\n**When**: After deployment to staging environment, before production cutover\n\n**What**: Compare staging behavior against production baseline\n\n**Checks**:\n1. **Test Regression**: Run full regression suite, compare pass rates\n2. **Metric Regression**: Compare error rates, latency, throughput\n3. **Smoke Test Regression**: Validate critical paths match production behavior\n\n**Decision**:\n- **Pass (regression ≤ threshold)**: Proceed to production deployment\n- **Fail (regression > threshold)**: BLOCK promotion, investigate, fix\n\n**Rationale**: Catch regressions in staging before they impact real users\n\n### Production Regression Gate\n\n**When**: After production deployment, during monitoring period\n\n**What**: Compare production behavior against pre-deployment baseline\n\n**Checks**:\n1. **Smoke Test Regression**: Validate critical paths still pass\n2. **SLO Regression**: Detect degradation in error rate, latency, availability\n3. **User Journey Regression**: Validate top user flows still complete successfully\n\n**Decision**:\n- **Pass (regression ≤ threshold)**: Deployment successful\n- **Fail (regression > threshold)**: TRIGGER automatic rollback (if `--rollback-on-regression`)\n\n**Rationale**: Immediate detection and rollback on production regression\n\n### Regression Detection Methodology\n\n**Test Regression**:\n```yaml\nbaseline: production test suite results\ncandidate: staging\u002Fproduction test suite results\nregression_rate: (baseline_pass_count - candidate_pass_count) \u002F baseline_pass_count * 100\n\nthreshold_check: regression_rate > threshold → FAIL\n```\n\n**Metric Regression**:\n```yaml\nbaseline: production metrics (pre-deployment)\ncandidate: staging\u002Fproduction metrics (post-deployment)\n\nregressions_to_detect:\n  - error_rate_increase > threshold\n  - latency_p99_increase > threshold\n  - throughput_decrease > threshold\n\nthreshold_check: any_regression > threshold → FAIL\n```\n\n**Scope Options**:\n- **full**: All tests and metrics (comprehensive)\n- **critical**: Only P0\u002FP1 tests and critical metrics (faster)\n- **targeted**: Tests\u002Fmetrics related to changed components\n\n### Integration with \u002Fregression-check\n\nThe regression gates use the `\u002Fregression-check` command:\n\n**Staging Gate**:\n```bash\n\u002Fregression-check --baseline production --candidate staging --scope full --threshold {threshold}\n```\n\n**Production Gate**:\n```bash\n\u002Fregression-check --baseline production-pre-deploy --candidate production-post-deploy --scope critical --threshold {threshold}\n```\n\n### Rollback Trigger on Regression\n\nIf production regression detected and `--rollback-on-regression` enabled:\n\n```yaml\nregression_detected:\n  trigger: regression_rate > threshold\n  action: automated_rollback\n  strategy: {blue-green | canary | rolling}\n  notification:\n    - alert_team\n    - declare_incident\n    - start_rca_process\n```\n\n## Multi-Agent Orchestration Workflow\n\n### Step 1: Deployment Strategy Selection\n\n**Purpose**: Choose deployment strategy based on risk, infrastructure, and requirements\n\n**Your Actions**:\n\n1. **Analyze Context**:\n   ```\n   Read:\n   - .aiwg\u002Fintake\u002Fproject-intake.md (understand project constraints)\n   - .aiwg\u002Fdeployment\u002Fdeployment-plan-*.md (existing deployment plans)\n   - .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md (infrastructure capabilities)\n   - User guidance (--guidance parameter or interactive answers)\n   ```\n\n2. **Launch Strategy Selection Agent**:\n   ```\n   Task(\n       subagent_type=\"deployment-manager\",\n       description=\"Recommend deployment strategy\",\n       prompt=\"\"\"\n       Read project context and architecture documentation\n\n       Recommend deployment strategy based on:\n\n       **Blue-Green Strategy**:\n       - When: Zero-downtime critical, instant rollback required\n       - Requires: 2x infrastructure capacity (temporary)\n       - Pros: Instant cutover, instant rollback, low risk\n       - Cons: Higher cost, requires duplicate environments\n\n       **Canary Strategy**:\n       - When: Progressive validation needed, high-risk release\n       - Requires: Traffic routing capability (Argo Rollouts, Flagger)\n       - Pros: Gradual rollout, SLO-driven automation, cost-efficient\n       - Cons: Slower rollout, complex automation setup\n\n       **Rolling Strategy**:\n       - When: Legacy systems, stateful services, simpler deployments\n       - Requires: Basic orchestration (Kubernetes rollout)\n       - Pros: No additional infrastructure, simple setup\n       - Cons: Slower rollout, manual validation, harder rollback\n\n       Analyze project requirements:\n       - Risk level: {from guidance or interactive}\n       - Infrastructure: {cloud provider, orchestration platform}\n       - Downtime tolerance: {zero vs. minimal vs. acceptable}\n       - Rollback requirements: {instant vs. fast vs. manual}\n\n       Recommend strategy with rationale\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fstrategy-recommendation.md\n       \"\"\"\n   )\n   ```\n\n3. **Confirm Strategy with User**:\n   ```\n   Read .aiwg\u002Fworking\u002Fdeployment\u002Fstrategy-recommendation.md\n\n   Present to user:\n   ─────────────────────────────────────────────\n   Deployment Strategy Recommendation\n   ─────────────────────────────────────────────\n\n   **Recommended**: {Blue-Green | Canary | Rolling}\n\n   **Rationale**: {why this strategy fits project needs}\n\n   **Trade-offs**:\n   - Pros: {list benefits}\n   - Cons: {list drawbacks}\n\n   **Requirements**:\n   - Infrastructure: {what's needed}\n   - Duration: {expected deployment time}\n   - Monitoring: {observation period}\n\n   Proceed with this strategy? (yes\u002Fno)\n   ─────────────────────────────────────────────\n   ```\n\n**Communicate Progress**:\n```\n✓ Analyzed deployment context\n✓ Strategy recommendation: {Blue-Green | Canary | Rolling}\n⏳ Awaiting user confirmation...\n```\n\n### Step 2: Pre-Deployment Validation\n\n**Purpose**: Verify all quality gates passed and environment is ready\n\n**Your Actions**:\n\n1. **Launch Parallel Validation Agents**:\n   ```\n   # Agent 1: Quality Gate Validation\n   Task(\n       subagent_type=\"project-manager\",\n       description=\"Validate all quality gates passed\",\n       prompt=\"\"\"\n       Check quality gate status for Transition phase\n\n       Read gate criteria: $AIWG_ROOT\u002F...\u002Fflows\u002Fgate-criteria-by-phase.md (Transition section)\n\n       Validate gates:\n       - [ ] Security Gate: No High\u002FCritical vulnerabilities\n       - [ ] Reliability Gate: SLOs met in staging\n       - [ ] Test Gate: Integration tests 100% passing\n       - [ ] Approval Gate: Release Manager signoff obtained\n\n       Generate gate validation report:\n       - Status: PASS | FAIL\n       - Gate checklist with results\n       - Decision: GO | NO-GO\n       - Gaps (if NO-GO): List missing approvals or failures\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fgate-validation-report.md\n       \"\"\"\n   )\n\n   # Agent 2: Environment Health Check\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Validate production environment health\",\n       prompt=\"\"\"\n       Check production environment readiness\n\n       Validate infrastructure health:\n       - [ ] All nodes healthy (Kubernetes cluster)\n       - [ ] No pods in crash loop or pending state\n       - [ ] Database connections healthy\n       - [ ] External integrations operational\n       - [ ] Monitoring and alerting functional\n       - [ ] No active P0\u002FP1 incidents\n\n       Check deployment artifacts:\n       - [ ] Container images available and tagged\n       - [ ] Checksums verified\n       - [ ] Container signatures validated (if required)\n       - [ ] Database migrations prepared (if applicable)\n\n       Generate environment health report:\n       - Infrastructure status: HEALTHY | DEGRADED | UNHEALTHY\n       - Artifacts status: READY | MISSING | INVALID\n       - Decision: GO | NO-GO\n       - Issues (if NO-GO): List blockers\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fenvironment-health-report.md\n       \"\"\"\n   )\n\n   # Agent 3: Rollback Plan Validation\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Validate rollback plan tested and ready\",\n       prompt=\"\"\"\n       Read rollback plan: .aiwg\u002Fdeployment\u002Frollback-plan-*.md\n\n       Validate rollback readiness:\n       - [ ] Rollback plan documented\n       - [ ] Rollback tested in staging (within last 7 days)\n       - [ ] Rollback automation configured (scripts, runbooks)\n       - [ ] Rollback SLOs defined (how fast can we rollback?)\n       - [ ] Communication plan for rollback scenario\n\n       If database migration included:\n       - [ ] Migration rollback script tested\n       - [ ] Data backup verified\n       - [ ] Backup restoration tested\n\n       Generate rollback validation report:\n       - Rollback readiness: READY | NOT_READY\n       - Rollback strategy: {blue-green instant | canary abort | rolling undo}\n       - Rollback SLO: {duration to full rollback}\n       - Issues (if NOT_READY): List gaps\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Frollback-validation-report.md\n       \"\"\"\n   )\n   ```\n\n2. **Synthesize Pre-Deployment Readiness**:\n   ```\n   Task(\n       subagent_type=\"deployment-manager\",\n       description=\"Synthesize deployment readiness report\",\n       prompt=\"\"\"\n       Read all validation reports:\n       - .aiwg\u002Fworking\u002Fdeployment\u002Fgate-validation-report.md\n       - .aiwg\u002Fworking\u002Fdeployment\u002Fenvironment-health-report.md\n       - .aiwg\u002Fworking\u002Fdeployment\u002Frollback-validation-report.md\n\n       Synthesize Deployment Readiness Report:\n\n       1. Overall Status: GO | CONDITIONAL_GO | NO-GO\n       2. Gate Validation: {status and details}\n       3. Environment Health: {status and details}\n       4. Rollback Readiness: {status and details}\n       5. Pre-Flight Checklist: {comprehensive checklist}\n       6. Decision Rationale: {why GO or NO-GO}\n       7. Conditions (if CONDITIONAL_GO): {what must be addressed}\n\n       Use template: agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fdeployment\u002Fdeployment-plan-template.md\n\n       Output: .aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md\n       \"\"\"\n   )\n   ```\n\n3. **Decision Point**:\n   ```\n   Read .aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md\n\n   If GO → Continue to Step 3\n   If CONDITIONAL_GO → Present conditions to user, wait for confirmation\n   If NO-GO → Report gaps, recommend remediation, STOP deployment\n   ```\n\n**Communicate Progress**:\n```\n⏳ Validating deployment readiness...\n  ✓ Quality gates validated: {PASS | FAIL}\n  ✓ Environment health checked: {HEALTHY | DEGRADED}\n  ✓ Rollback plan validated: {READY | NOT_READY}\n✓ Pre-deployment validation: {GO | CONDITIONAL_GO | NO-GO}\n```\n\n### Step 2.5: Staging Regression Gate\n\n**Purpose**: Detect regressions in staging before production deployment\n\n**Your Actions**:\n\n1. **Deploy to Staging**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Deploy new version to staging environment\",\n       prompt=\"\"\"\n       Execute deployment to staging environment\n\n       Actions:\n       1. Deploy new version to staging\n       2. Wait for all pods running and healthy\n       3. Validate health checks passing\n\n       Report:\n       - Staging deployment status: SUCCESS | FAILED\n       - Pods running: {count}\u002F{total}\n       - Health checks: {PASS | FAIL}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fstaging-deployment-log.md\n\n       If FAILED: Stop deployment, do NOT proceed to regression check\n       \"\"\"\n   )\n   ```\n\n2. **Execute Staging Regression Check**:\n   ```\n   Task(\n       subagent_type=\"regression-analyst\",\n       description=\"Run regression analysis on staging deployment\",\n       prompt=\"\"\"\n       Execute comprehensive regression check: staging vs. production baseline\n\n       Command: \u002Fregression-check --baseline production --candidate staging --scope full --threshold {threshold}\n\n       This checks:\n       1. Test Regression: Full regression suite comparison\n       2. Metric Regression: Error rate, latency, throughput comparison\n       3. Smoke Test Regression: Critical path validation\n\n       Parameters:\n       - baseline: Production (current live version)\n       - candidate: Staging (new version under test)\n       - scope: full (comprehensive check)\n       - threshold: {from --regression-threshold parameter, default 0}\n\n       Generate regression gate report:\n       - Regression rate: {percentage}\n       - Test failures: {new failures not in baseline}\n       - Metric degradations: {error rate, latency, throughput}\n       - Decision: PASS | FAIL\n       - Blockers (if FAIL): {list regression details}\n\n       Use schema: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fschemas\u002Fflows\u002Fregression-gate.yaml\n\n       Output: .aiwg\u002Fdeployment\u002Fregression-gate-staging.md\n\n       If FAIL (regression > threshold): BLOCK promotion to production\n       \"\"\"\n   )\n   ```\n\n3. **Staging Gate Decision Point**:\n   ```\n   Read .aiwg\u002Fdeployment\u002Fregression-gate-staging.md\n\n   Check regression_rate vs. threshold:\n\n   If regression_rate \u003C= threshold:\n     ✓ Staging regression gate PASSED\n     → Continue to Step 3 (Production Deployment)\n\n   If regression_rate > threshold:\n     ❌ Staging regression gate FAILED\n     → BLOCK promotion to production\n     → Report regression details to user\n     → Recommend investigation and fixes\n     → STOP deployment\n\n   Decision logged in deployment execution log\n   ```\n\n4. **Launch Regression Impact Assessment** (if regression detected):\n   ```\n   # Only if staging gate fails\n\n   Task(\n       subagent_type=\"regression-analyst\",\n       description=\"Assess regression impact and root cause\",\n       prompt=\"\"\"\n       Staging regression detected: {regression_rate}% > threshold {threshold}%\n\n       Analyze regression impact:\n\n       1. Categorize Regressions:\n          - Test regressions: {which tests now failing}\n          - Metric regressions: {which metrics degraded}\n          - Functional regressions: {which features broken}\n\n       2. Assess Root Cause:\n          - Code changes: {which commits introduced regression}\n          - Configuration changes: {any config differences}\n          - Dependency changes: {any library\u002Fservice updates}\n\n       3. Estimate Impact:\n          - Severity: {CRITICAL | HIGH | MEDIUM | LOW}\n          - User impact: {which user journeys affected}\n          - Scope: {percentage of users affected}\n\n       4. Recommend Remediation:\n          - Immediate fix: {what to change}\n          - Rollback option: {can we revert specific changes}\n          - Validation: {how to verify fix}\n\n       Use regression analysis agent tools and documentation\n\n       Output: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-staging.md\n\n       See: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fagents\u002Fregression-analyst.md\n       \"\"\"\n   )\n   ```\n\n**Communicate Progress**:\n```\n⏳ Staging Regression Gate...\n  ✓ Deployed to staging: {SUCCESS | FAILED}\n  ✓ Regression check: {PASS | FAIL}\n  {If PASS}\n  ✓ Staging gate PASSED: Regression {rate}% ≤ threshold {threshold}%\n  {If FAIL}\n  ❌ Staging gate FAILED: Regression {rate}% > threshold {threshold}%\n  ⏳ Analyzing regression impact...\n  ✓ Impact assessment: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-staging.md\n  ⚠️ Deployment BLOCKED until regressions fixed\n```\n\n### Step 3: Execute Deployment (Strategy-Specific)\n\n**Purpose**: Deploy new version using selected strategy with continuous monitoring\n\n#### Blue-Green Deployment\n\n**Your Actions**:\n\n1. **Deploy to Green Environment**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Deploy new version to green environment\",\n       prompt=\"\"\"\n       Execute blue-green deployment to green environment\n\n       Actions:\n       1. Deploy new version to green environment (while blue serves production)\n       2. Wait for all green pods to be running and ready\n       3. Validate green environment health checks passing\n\n       Log all actions with timestamps to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-green.md\n\n       Report:\n       - Green deployment status: SUCCESS | FAILED\n       - Pods running: {count}\u002F{total}\n       - Health checks: {PASS | FAIL}\n       - Duration: {minutes}\n\n       If FAILED: Stop deployment, do NOT cutover traffic\n       \"\"\"\n   )\n   ```\n\n2. **Run Smoke Tests on Green**:\n   ```\n   Task(\n       subagent_type=\"qa-engineer\",\n       description=\"Execute smoke tests on green environment\",\n       prompt=\"\"\"\n       Read smoke test plan: agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Ftest\u002Ftest-suite-card.md\n\n       Execute critical path smoke tests:\n       - [ ] API health endpoints (200 OK)\n       - [ ] User authentication flow\n       - [ ] Critical business operations (top 5-10 journeys)\n       - [ ] Database connectivity\n       - [ ] External integrations (payment gateway, email, etc.)\n       - [ ] Monitoring and logging operational\n\n       Test against green environment URL (not production)\n\n       Generate smoke test report:\n       - Tests passed: {count}\u002F{total}\n       - Tests failed: {list failures with details}\n       - Status: PASS | FAIL\n       - Duration: {minutes}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fsmoke-test-results-green.md\n\n       If FAIL: Stop deployment, do NOT cutover traffic\n       \"\"\"\n   )\n   ```\n\n3. **Cutover Traffic to Green**:\n   ```\n   # Only proceed if green deployment and smoke tests passed\n\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Cutover production traffic to green environment\",\n       prompt=\"\"\"\n       Execute traffic cutover from blue to green\n\n       Actions:\n       1. Update load balancer or service selector to point to green\n       2. Verify traffic is flowing to green (0% blue → 100% green)\n       3. Confirm blue environment still running (for instant rollback)\n\n       Log cutover actions with timestamps\n\n       Report:\n       - Cutover status: SUCCESS | FAILED\n       - Traffic distribution: {blue-percentage}% blue, {green-percentage}% green\n       - Timestamp: {cutover-time}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-cutover.md\n       \"\"\"\n   )\n   ```\n\n4. **Monitor SLOs Post-Cutover** (Step 4 will handle this)\n\n#### Canary Deployment\n\n**Your Actions**:\n\n1. **Deploy Canary (1-5% Traffic)**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Deploy canary version with 1-5% traffic\",\n       prompt=\"\"\"\n       Execute canary deployment with progressive rollout\n\n       Stage 1: Deploy canary receiving 1-5% of production traffic\n\n       Actions:\n       1. Deploy canary version alongside stable baseline\n       2. Configure traffic routing (1-5% to canary, 95-99% to baseline)\n       3. Verify canary pods running and healthy\n\n       Log all actions with timestamps\n\n       Report:\n       - Canary deployment status: SUCCESS | FAILED\n       - Traffic distribution: {canary-percentage}% canary, {baseline-percentage}% baseline\n       - Pods running: {count}\u002F{total}\n       - Health checks: {PASS | FAIL}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-canary-stage1.md\n\n       If FAILED: Stop deployment, scale down canary\n       \"\"\"\n   )\n   ```\n\n2. **Launch SLO Monitoring Agent** (runs continuously):\n   ```\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Monitor canary SLOs at 1-5% stage\",\n       prompt=\"\"\"\n       Monitor SLOs for canary vs. baseline for 10-15 minutes\n\n       Compare metrics:\n       - Error rate: canary should not exceed baseline by >2%\n       - Latency p99: canary should not exceed baseline by >20%\n       - Throughput: canary should be proportional to traffic share\n\n       SLO breach detection:\n       - If error rate breach: ABORT deployment, trigger rollback\n       - If latency breach: ABORT deployment, trigger rollback\n       - If infrastructure failure: ABORT deployment, trigger rollback\n\n       Generate monitoring report every 5 minutes:\n       - Status: PASS | BREACH\n       - Metrics comparison: {baseline vs. canary}\n       - Decision: CONTINUE | ABORT\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fslo-monitoring-canary-stage1.md\n\n       If BREACH: Immediately notify orchestrator to trigger rollback\n       \"\"\"\n   )\n   ```\n\n3. **Progressive Rollout** (if SLOs pass):\n   ```\n   # If Stage 1 SLOs pass, promote to 25%, then 50%, then 100%\n   # Repeat monitoring at each stage\n\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Promote canary to 25% traffic\",\n       prompt=\"\"\"\n       Stage 2: Promote canary to 25% traffic\n\n       Actions:\n       1. Update traffic routing (25% canary, 75% baseline)\n       2. Verify traffic distribution\n       3. Monitor SLOs for 10-15 minutes (launch new monitoring agent)\n\n       Report and save to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-canary-stage2.md\n\n       If SLO breach at any stage: ABORT, trigger rollback\n       \"\"\"\n   )\n\n   # Repeat for 50% and 100% stages\n   ```\n\n#### Rolling Deployment\n\n**Your Actions**:\n\n1. **Rolling Update Execution**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Execute rolling deployment node-by-node\",\n       prompt=\"\"\"\n       Execute rolling deployment strategy\n\n       Actions:\n       1. Update 1 instance\u002Fnode at a time\n       2. Wait for new instance to pass health checks\n       3. Monitor for 5 minutes before proceeding to next instance\n       4. Continue until all instances updated\n\n       Pause conditions:\n       - If health check fails: STOP, evaluate, rollback if needed\n       - If error rate increases: STOP, evaluate, rollback if needed\n\n       Log all actions with timestamps\n\n       Report:\n       - Instances updated: {count}\u002F{total}\n       - Current instance status: {status}\n       - Health checks: {PASS | FAIL}\n       - Error rate: {current vs. baseline}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-rolling.md\n       \"\"\"\n   )\n   ```\n\n**Communicate Progress** (all strategies):\n```\n⏳ Executing {Blue-Green | Canary | Rolling} deployment...\n  ✓ {Strategy-specific milestone 1}: {status}\n  ✓ {Strategy-specific milestone 2}: {status}\n  ⏳ {Strategy-specific milestone 3}: In progress...\n```\n\n### Step 4: Monitor SLOs and Production Regression Gate\n\n**Purpose**: Continuous validation that deployment is meeting reliability targets and no regressions introduced\n\n**Your Actions**:\n\n1. **Capture Production Baseline (Pre-Deployment)**:\n   ```\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Capture production baseline metrics before deployment\",\n       prompt=\"\"\"\n       Capture production baseline for regression comparison\n\n       Metrics to capture:\n       - Error rate (last 1 hour average)\n       - Latency p50, p95, p99 (last 1 hour)\n       - Throughput (requests\u002Fsec, last 1 hour)\n       - Availability (uptime percentage)\n       - Critical user journey completion rates\n\n       Test suite state:\n       - Smoke test pass rate (current)\n       - Integration test pass rate (current)\n       - Critical path test results\n\n       Save baseline snapshot:\n       - Timestamp: {pre-deployment time}\n       - Version: {current production version}\n       - Metrics: {captured values}\n\n       Output: .aiwg\u002Fworking\u002Fdeployment\u002Fproduction-baseline-snapshot.md\n\n       This baseline used for post-deployment regression comparison\n       \"\"\"\n   )\n   ```\n\n2. **Launch Parallel Monitoring Agents**:\n   ```\n   # Agent 1: SLO Monitoring\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Monitor production SLOs post-deployment\",\n       prompt=\"\"\"\n       Monitor SLOs for 15-30 minutes post-deployment (or as specified in guidance)\n\n       Key SLOs to track:\n       - Error rate: {target \u003C0.1% or custom}\n       - Latency p99: {target \u003C500ms or custom}\n       - Throughput: {baseline ±10% or custom}\n       - Availability: {target >99.95% or custom}\n\n       Compare current metrics vs. baseline (pre-deployment)\n\n       Automated breach detection:\n       - Error rate >2% above baseline → TRIGGER ROLLBACK\n       - Latency p99 >20% above baseline → TRIGGER ROLLBACK\n       - Throughput drop >30% below baseline → TRIGGER ROLLBACK\n       - Infrastructure alarms triggered → TRIGGER ROLLBACK\n\n       Generate SLO monitoring report every 5 minutes:\n       - Status: PASS | BREACH\n       - Metrics: {current vs. baseline vs. target}\n       - Alerts triggered: {count and details}\n       - Decision: CONTINUE | ROLLBACK\n\n       Save to: .aiwg\u002Fdeployment\u002Fslo-monitoring-report.md\n\n       If BREACH: Immediately notify orchestrator to trigger rollback (Step 5)\n       \"\"\"\n   )\n\n   # Agent 2: Smoke Tests (Production)\n   Task(\n       subagent_type=\"qa-engineer\",\n       description=\"Execute smoke tests against production\",\n       prompt=\"\"\"\n       Run smoke tests against production environment post-deployment\n\n       Execute critical path tests:\n       - [ ] API health endpoints\n       - [ ] User authentication and authorization\n       - [ ] Top 5-10 business operations\n       - [ ] Database read\u002Fwrite operations\n       - [ ] External integrations\n       - [ ] Monitoring and logging functional\n\n       Test against production URL (real traffic)\n\n       Generate smoke test report:\n       - Tests passed: {count}\u002F{total}\n       - Tests failed: {list failures with details}\n       - Status: PASS | FAIL\n       - Duration: {minutes}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Fsmoke-test-results-production.md\n\n       If FAIL: Immediately notify orchestrator to trigger rollback\n       \"\"\"\n   )\n\n   # Agent 3: Infrastructure Health Monitoring\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Monitor infrastructure health continuously\",\n       prompt=\"\"\"\n       Monitor infrastructure health for 15-30 minutes post-deployment\n\n       Track infrastructure metrics:\n       - Pod restarts: >3 restarts in 5 minutes → ALERT\n       - OOM kills: Any OOM kill → TRIGGER ROLLBACK\n       - Node health: Any unhealthy nodes → ALERT\n       - Network errors: Elevated error rates → ALERT\n\n       Generate infrastructure health report every 5 minutes:\n       - Status: HEALTHY | DEGRADED | UNHEALTHY\n       - Pods: {running}\u002F{total}, restarts: {count}\n       - Nodes: {healthy}\u002F{total}\n       - Alerts: {list active alerts}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Finfrastructure-health-report.md\n\n       If UNHEALTHY: Immediately notify orchestrator to trigger rollback\n       \"\"\"\n   )\n\n   # Agent 4: Production Regression Gate\n   Task(\n       subagent_type=\"regression-analyst\",\n       description=\"Execute production regression check\",\n       prompt=\"\"\"\n       Execute production regression gate check\n\n       Command: \u002Fregression-check --baseline production-pre-deploy --candidate production-post-deploy --scope critical --threshold {threshold}\n\n       This checks:\n       1. Smoke Test Regression: Critical path validation\n       2. SLO Regression: Error rate, latency, availability\n       3. User Journey Regression: Top user flows completion\n\n       Parameters:\n       - baseline: Production snapshot (pre-deployment)\n       - candidate: Production current (post-deployment)\n       - scope: critical (P0\u002FP1 tests and critical metrics only)\n       - threshold: {from --regression-threshold parameter, default 0}\n\n       Compare against baseline from .aiwg\u002Fworking\u002Fdeployment\u002Fproduction-baseline-snapshot.md\n\n       Generate regression gate report:\n       - Regression rate: {percentage}\n       - New failures: {tests now failing}\n       - Metric degradations: {SLO breaches}\n       - Decision: PASS | FAIL\n       - Severity: {CRITICAL | HIGH | MEDIUM | LOW}\n\n       Use schema: @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fschemas\u002Fflows\u002Fregression-gate.yaml\n\n       Output: .aiwg\u002Fdeployment\u002Fregression-gate-production.md\n\n       If FAIL (regression > threshold):\n         - Check --rollback-on-regression flag\n         - If enabled: Trigger automatic rollback\n         - If disabled: Alert user, await manual decision\n       \"\"\"\n   )\n   ```\n\n3. **Production Regression Gate Decision Point**:\n   ```\n   Read .aiwg\u002Fdeployment\u002Fregression-gate-production.md\n\n   Check regression_rate vs. threshold:\n\n   If regression_rate \u003C= threshold:\n     ✓ Production regression gate PASSED\n     → Continue monitoring, deployment successful\n\n   If regression_rate > threshold:\n     ❌ Production regression gate FAILED\n     → Check --rollback-on-regression flag:\n\n       If --rollback-on-regression enabled (default):\n         ⚠️ Automatic rollback TRIGGERED\n         → Execute Step 5 (Rollback)\n\n       If --rollback-on-regression disabled:\n         ⚠️ Regression detected, awaiting manual decision\n         → Alert user with regression details\n         → User must decide: [rollback | accept risk | investigate]\n\n   Decision logged in deployment execution log\n   ```\n\n4. **Aggregate Monitoring Results**:\n   ```\n   # You monitor all 4 agents continuously\n   # If ANY agent reports BREACH, FAIL, or UNHEALTHY → Trigger Step 5 (Rollback)\n   # If production regression gate FAILS and --rollback-on-regression → Trigger Step 5 (Rollback)\n   # If ALL agents report success for monitoring duration → Proceed to Step 6 (Success)\n   ```\n\n**Communicate Progress**:\n```\n⏳ Monitoring deployment health (15-30 min observation)...\n  ✓ Production baseline captured: .aiwg\u002Fworking\u002Fdeployment\u002Fproduction-baseline-snapshot.md\n  ✓ SLO monitoring: {PASS | BREACH} (updated every 5 min)\n  ✓ Smoke tests: {PASS | FAIL}\n  ✓ Infrastructure health: {HEALTHY | DEGRADED}\n  ✓ Production regression gate: {PASS | FAIL} (regression {rate}% vs. threshold {threshold}%)\n  {If regression detected}\n  ⚠️ Regression detected: {rate}% > threshold {threshold}%\n  {If --rollback-on-regression enabled}\n  ⏳ Automatic rollback triggered...\n  {If --rollback-on-regression disabled}\n  ⚠️ Awaiting manual decision: [rollback | accept | investigate]\n[If all passing for full duration]\n✓ Deployment validation complete: All checks passed, no regressions\n```\n\n### Step 5: Rollback (If Failure or Regression Detected)\n\n**Purpose**: Automated rollback execution if SLO breach, regression, or failure detected\n\n**Trigger Conditions**:\n- SLO breach detected (error rate, latency, throughput)\n- Smoke test failure\n- Infrastructure health degraded or unhealthy\n- **Regression detected at production gate** (if `--rollback-on-regression` enabled)\n- Manual abort by user\n\n**Your Actions**:\n\n1. **Execute Strategy-Specific Rollback**:\n   ```\n   Task(\n       subagent_type=\"devops-engineer\",\n       description=\"Execute automated rollback\",\n       prompt=\"\"\"\n       ROLLBACK TRIGGERED: {reason - SLO breach | smoke test failure | infrastructure failure | regression detected}\n\n       Execute rollback strategy: {Blue-Green | Canary | Rolling}\n\n       **Blue-Green Rollback**:\n       1. Switch traffic back to blue environment (instant cutover)\n       2. Verify traffic flowing to blue (100% blue, 0% green)\n       3. Confirm SLOs return to baseline\n       4. Scale down green environment (optional, for cost)\n\n       **Canary Rollback**:\n       1. Abort canary rollout (stop progressive promotion)\n       2. Scale down canary pods to 0\n       3. Verify baseline serving 100% traffic\n       4. Confirm SLOs return to baseline\n\n       **Rolling Rollback**:\n       1. Trigger rollout undo (revert to previous version)\n       2. Wait for all pods to rollback to previous version\n       3. Verify all pods running previous version\n       4. Confirm SLOs return to baseline\n\n       Log all rollback actions with timestamps\n\n       Report:\n       - Rollback trigger: {reason}\n       - Rollback strategy: {strategy}\n       - Rollback status: SUCCESS | FAILED\n       - Duration: {minutes}\n       - Traffic distribution: {current}\n       - SLOs post-rollback: {status}\n\n       Save to: .aiwg\u002Fdeployment\u002Frollback-execution-log.md\n\n       If rollback FAILED: CRITICAL ESCALATION to Incident Commander\n       \"\"\"\n   )\n   ```\n\n2. **Verify Rollback Success**:\n   ```\n   Task(\n       subagent_type=\"reliability-engineer\",\n       description=\"Validate rollback successful\",\n       prompt=\"\"\"\n       Verify rollback restored stable state\n\n       Validate:\n       - [ ] Old version serving 100% traffic\n       - [ ] SLOs returned to baseline (error rate, latency)\n       - [ ] Smoke tests passing on rolled-back version\n       - [ ] No active alerts or incidents\n       - [ ] Infrastructure health restored\n\n       Generate rollback validation report:\n       - Status: SUCCESS | PARTIAL | FAILED\n       - SLOs: {current vs. baseline}\n       - Smoke tests: {PASS | FAIL}\n       - Stability: {STABLE | UNSTABLE}\n\n       Save to: .aiwg\u002Fworking\u002Fdeployment\u002Frollback-validation-report.md\n\n       If rollback FAILED or PARTIAL: CRITICAL ESCALATION\n       \"\"\"\n   )\n   ```\n\n3. **Post-Rollback Regression Verification**:\n   ```\n   # Only if rollback triggered by regression\n\n   Task(\n       subagent_type=\"regression-analyst\",\n       description=\"Verify rollback eliminated regression\",\n       prompt=\"\"\"\n       Rollback complete, verify regression eliminated\n\n       Execute regression check post-rollback:\n       - Baseline: Production (pre-deployment snapshot)\n       - Candidate: Production (post-rollback)\n\n       Command: \u002Fregression-check --baseline production-pre-deploy --candidate production-post-rollback --scope critical\n\n       Validate:\n       - [ ] Regression eliminated (rate back to 0%)\n       - [ ] All tests back to passing\n       - [ ] Metrics returned to baseline\n\n       Generate post-rollback regression report:\n       - Regression eliminated: YES | NO\n       - Tests restored: {count}\u002F{total}\n       - Metrics restored: {error rate, latency, throughput}\n\n       Output: .aiwg\u002Fdeployment\u002Fregression-verification-post-rollback.md\n\n       If regression NOT eliminated: Deeper issue, escalate\n       \"\"\"\n   )\n   ```\n\n4. **Declare Incident and Initiate RCA**:\n   ```\n   Task(\n       subagent_type=\"incident-commander\",\n       description=\"Declare incident and start root cause analysis\",\n       prompt=\"\"\"\n       Deployment failed, rollback executed\n\n       Declare incident:\n       - Severity: P0 (if production impact) | P1 (if rollback successful)\n       - Summary: Deployment rollback - {reason}\n       - Impact: {describe user\u002Fbusiness impact}\n       - Timeline: {deployment start → failure detected → rollback completed}\n\n       Include regression details if applicable:\n       - Regression rate: {percentage}\n       - Regression threshold: {threshold}\n       - Specific regressions: {test failures, metric degradations}\n\n       Initiate root cause analysis:\n       - Assemble incident response team\n       - Preserve all logs and metrics (deployment logs, SLO data, infrastructure snapshots, regression reports)\n       - Schedule incident review meeting\n\n       Use template: agentic\u002Fcode\u002Fframeworks\u002Fops-complete\u002Ftemplates\u002Fincident.md\n\n       Output incident report: .aiwg\u002Fdeployment\u002Frollback-report-{version}.md\n       \"\"\"\n   )\n   ```\n\n**Communicate Progress**:\n```\n❌ Deployment failure detected: {reason}\n{If regression triggered}\n⚠️ Regression detected: {rate}% > threshold {threshold}%\n⏳ Executing automated rollback...\n  ✓ Rollback execution: {SUCCESS | FAILED}\n  ✓ Rollback validation: {SUCCESS | PARTIAL | FAILED}\n  ✓ Regression verification: {ELIMINATED | PERSISTS}\n  ✓ Incident declared: {incident-id}\n✓ Rollback complete: Production restored to previous version\n```\n\n### Step 6: Generate Deployment Report (Success Path)\n\n**Purpose**: Document successful deployment with metrics and lessons learned\n\n**Your Actions**:\n\n1. **Synthesize Deployment Summary**:\n   ```\n   Task(\n       subagent_type=\"deployment-manager\",\n       description=\"Generate comprehensive deployment report\",\n       prompt=\"\"\"\n       Read all deployment artifacts:\n       - .aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md (pre-flight)\n       - .aiwg\u002Fdeployment\u002Fregression-gate-staging.md (staging regression check)\n       - .aiwg\u002Fworking\u002Fdeployment\u002Fexecution-log-*.md (deployment actions)\n       - .aiwg\u002Fdeployment\u002Fslo-monitoring-report.md (SLO validation)\n       - .aiwg\u002Fdeployment\u002Fregression-gate-production.md (production regression check)\n       - .aiwg\u002Fworking\u002Fdeployment\u002Fsmoke-test-results-*.md (test results)\n       - .aiwg\u002Fworking\u002Fdeployment\u002Finfrastructure-health-report.md (health checks)\n\n       Generate Deployment Summary Report:\n\n       1. Overview\n          - Status: SUCCESS | ROLLBACK\n          - Version: {version}\n          - Strategy: {Blue-Green | Canary | Rolling}\n          - Duration: {total deployment time}\n\n       2. Deployment Timeline\n          - Pre-deployment validation: {timestamp, duration}\n          - Staging regression gate: {timestamp, result}\n          - Deployment execution: {timestamp, duration, strategy milestones}\n          - Smoke tests: {timestamp, duration}\n          - SLO monitoring: {timestamp, duration}\n          - Production regression gate: {timestamp, result}\n          - Completion: {timestamp}\n\n       3. Pre-Deployment Validation Results\n          - Quality gates: {status}\n          - Environment health: {status}\n          - Rollback readiness: {status}\n\n       4. Regression Gate Results\n          - Staging gate: {PASS | FAIL, regression rate: {rate}%}\n          - Production gate: {PASS | FAIL, regression rate: {rate}%}\n          - Threshold: {threshold}%\n          - Rollback triggered: {YES | NO}\n\n       5. Deployment Execution Details (strategy-specific)\n          - {Blue-Green: green deployment, cutover, blue retirement}\n          - {Canary: 1-5%, 25%, 50%, 100% progression}\n          - {Rolling: node-by-node updates}\n\n       6. SLO Metrics\n          - Error rate: {baseline vs. post-deployment vs. target}\n          - Latency p99: {baseline vs. post-deployment vs. target}\n          - Throughput: {baseline vs. post-deployment}\n          - Availability: {uptime percentage}\n\n       7. Smoke Test Results\n          - Critical path tests: {passed\u002Ftotal}\n          - API tests: {passed\u002Ftotal}\n          - Database tests: {passed\u002Ftotal}\n          - Integration tests: {passed\u002Ftotal}\n\n       8. Infrastructure Health\n          - Pods: {running\u002Ftotal, restarts}\n          - Nodes: {healthy\u002Ftotal}\n          - Alerts triggered: {count, resolved}\n\n       9. Issues and Resolutions\n          - {list any issues encountered and how resolved}\n\n       10. Lessons Learned\n          - What went well: {list successes}\n          - What could improve: {list improvement opportunities}\n          - Action items: {concrete actions for future deployments}\n\n       11. Approvals and Sign-offs\n          - Deployment Manager: {name, timestamp}\n          - Reliability Engineer: {name, timestamp}\n          - Operations Lead: {name, timestamp}\n\n       Use the deployment report fields listed above\n\n       Output: .aiwg\u002Freports\u002Fdeployment-report-{version}.md\n       \"\"\"\n   )\n   ```\n\n2. **Archive Workflow Artifacts**:\n   ```\n   # You handle archiving directly\n\n   Archive complete deployment workflow:\n   - Move .aiwg\u002Fworking\u002Fdeployment\u002F to .aiwg\u002Farchive\u002F{date}\u002Fdeployment-{version}\u002F\n   - Create audit trail: .aiwg\u002Farchive\u002F{date}\u002Fdeployment-{version}\u002Faudit-trail.md\n\n   Audit trail includes:\n   - Timeline of all agent actions\n   - Decision points and outcomes\n   - Regression gate results\n   - SLO metrics snapshots\n   - Final deployment report location\n   ```\n\n**Communicate Progress**:\n```\n⏳ Generating deployment report...\n✓ Deployment report complete: .aiwg\u002Freports\u002Fdeployment-report-{version}.md\n✓ Workflow archived: .aiwg\u002Farchive\u002F{date}\u002Fdeployment-{version}\u002F\n```\n\n### Step 7: Notify Stakeholders and Update Documentation\n\n**Purpose**: Communicate deployment outcome and update operational documentation\n\n**Your Actions**:\n\n1. **Generate Stakeholder Notification**:\n   ```\n   Task(\n       subagent_type=\"support-lead\",\n       description=\"Draft stakeholder notification\",\n       prompt=\"\"\"\n       Read deployment report: .aiwg\u002Freports\u002Fdeployment-report-{version}.md\n\n       Draft stakeholder notification email:\n\n       Subject: Production Deployment {SUCCESS | COMPLETED WITH ROLLBACK} - Version {version}\n\n       Body:\n       - Deployment status: {SUCCESS | ROLLBACK}\n       - Version deployed: {version}\n       - Strategy used: {Blue-Green | Canary | Rolling}\n       - Duration: {total time}\n       - Regression gates: {PASSED | FAILED}\n       - SLO metrics: {error rate, latency, availability}\n       - User impact: {None | Minimal | Moderate}\n       - Next steps: {monitoring, support readiness, known issues}\n\n       Audience:\n       - Executive stakeholders\n       - Product team\n       - Customer support team\n       - Engineering team\n\n       Save notification draft to: .aiwg\u002Fworking\u002Fdeployment\u002Fstakeholder-notification-{version}.md\n\n       Note: User must review and send notification\n       \"\"\"\n   )\n   ```\n\n2. **Update Operational Runbooks**:\n   ```\n   Task(\n       subagent_type=\"deployment-manager\",\n       description=\"Update deployment runbooks with lessons learned\",\n       prompt=\"\"\"\n       Read lessons learned from deployment report\n\n       Update deployment runbooks with improvements:\n       - Process improvements identified\n       - New smoke tests to add\n       - SLO threshold adjustments\n       - Regression gate threshold tuning\n       - Monitoring improvements\n       - Rollback procedure refinements\n\n       Document updates to: .aiwg\u002Fdeployment\u002Fdeployment-runbook-updates-{version}.md\n\n       Note: User should review and apply to operational documentation\n       \"\"\"\n   )\n   ```\n\n**Communicate Progress**:\n```\n✓ Stakeholder notification drafted: .aiwg\u002Fworking\u002Fdeployment\u002Fstakeholder-notification-{version}.md\n✓ Runbook updates documented: .aiwg\u002Fdeployment\u002Fdeployment-runbook-updates-{version}.md\n```\n\n## Final Summary Report\n\n**Present to User**:\n\n```\n─────────────────────────────────────────────\nProduction Deployment Complete\n─────────────────────────────────────────────\n\n**Status**: {SUCCESS | ROLLBACK}\n**Version**: {version}\n**Strategy**: {Blue-Green | Canary | Rolling}\n**Duration**: {total deployment time}\n\n**Timeline**:\n- Pre-deployment validation: {duration}\n- Staging regression gate: {PASS | FAIL, regression {rate}%}\n- Deployment execution: {duration}\n- SLO monitoring: {duration}\n- Production regression gate: {PASS | FAIL, regression {rate}%}\n- Total: {total duration}\n\n**Regression Gates**:\n✓ Staging gate: {PASS | FAIL} (threshold: {threshold}%)\n✓ Production gate: {PASS | FAIL} (threshold: {threshold}%)\n{If regression detected}\n⚠️ Regression: {rate}% {≤ | >} threshold {threshold}%\n{If rollback triggered}\n✓ Automatic rollback: {SUCCESS | FAILED}\n\n**SLO Metrics**:\n✓ Error rate: {current}% (target: \u003C{target}%)\n✓ Latency p99: {current}ms (target: \u003C{target}ms)\n✓ Throughput: {current} req\u002Fs (baseline: {baseline} req\u002Fs)\n✓ Availability: {percentage}%\n\n**Smoke Tests**: {passed}\u002F{total} passed\n\n**Infrastructure**: {pods} pods running, {nodes} nodes healthy\n\n**Artifacts Generated**:\n- Deployment Readiness Report: .aiwg\u002Fdeployment\u002Fdeployment-readiness-report.md\n- Staging Regression Gate: .aiwg\u002Fdeployment\u002Fregression-gate-staging.md\n- Production Regression Gate: .aiwg\u002Fdeployment\u002Fregression-gate-production.md\n- SLO Monitoring Report: .aiwg\u002Fdeployment\u002Fslo-monitoring-report.md\n- Deployment Summary Report: .aiwg\u002Freports\u002Fdeployment-report-{version}.md\n{If rollback}\n- Rollback Report: .aiwg\u002Fdeployment\u002Frollback-report-{version}.md\n- Regression Impact Assessment: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-*.md\n- Incident Report: {link to incident}\n\n**Next Steps**:\n- Review deployment report for lessons learned\n- Send stakeholder notification (draft ready)\n- Update operational runbooks with improvements\n- Continue monitoring SLOs for 24-48 hours\n{If rollback}\n- Conduct incident review meeting\n- Perform root cause analysis on regression\n- Fix issues identified\n- Plan re-deployment\n\n─────────────────────────────────────────────\n```\n\n## Regression-Blocked Deployment Example\n\n**Scenario**: Staging regression gate detects 8% test failure rate (threshold: 5%)\n\n```\n─────────────────────────────────────────────\nDeployment BLOCKED: Staging Regression Gate Failed\n─────────────────────────────────────────────\n\n**Status**: BLOCKED\n**Version**: v2026.1.5\n**Strategy**: Blue-Green\n**Regression Detected**: 8.0% > threshold 5.0%\n\n**Staging Regression Gate**:\n❌ FAILED: 8.0% regression rate exceeds threshold\n- Test failures: 12 new failures (150 total, 138 baseline)\n- Metric degradations:\n  • Error rate: 0.15% (+0.12% from baseline)\n  • Latency p99: 580ms (+18% from baseline)\n- Critical path: 2\u002F10 user journeys failing\n\n**Impact Assessment**:\n- Severity: HIGH\n- Affected areas: Authentication, Payment processing\n- Root cause: New rate limiting logic breaking retry logic\n- User impact: 15-20% of login attempts would fail\n\n**Remediation Required**:\n1. Revert rate limiting changes (commit abc123)\n2. Add retry backoff logic to authentication client\n3. Update tests to cover rate limiting scenarios\n4. Re-deploy to staging and re-run regression check\n\n**Artifacts**:\n- Regression gate report: .aiwg\u002Fdeployment\u002Fregression-gate-staging.md\n- Impact assessment: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-staging.md\n\n**Decision**: Deployment BLOCKED until regressions resolved\n\n─────────────────────────────────────────────\n```\n\n## Quality Gates\n\nBefore marking workflow complete, verify:\n- [ ] Pre-deployment validation passed (quality gates, environment health, rollback plan)\n- [ ] Staging regression gate passed (or deployment blocked if failed)\n- [ ] Deployment executed successfully (strategy-specific milestones)\n- [ ] Smoke tests passed (production validation)\n- [ ] SLOs met for monitoring duration (15-30 minutes)\n- [ ] Production regression gate passed (or rollback triggered if failed)\n- [ ] Deployment report generated with metrics and lessons learned\n- [ ] Regression gate results documented\n- [ ] Artifacts saved to .aiwg\u002Fdeployment\u002F and .aiwg\u002Freports\u002F\n- [ ] Working drafts archived to .aiwg\u002Farchive\u002F\n- [ ] Stakeholder notification drafted\n\n## User Communication\n\n**At start**: Confirm understanding and strategy\n\n```\nUnderstood. I'll orchestrate the production deployment.\n\nStrategy: {Blue-Green | Canary | Rolling}\nVersion: {version}\nDuration: {expected deployment time}\nRegression Threshold: {threshold}%\nRollback on Regression: {enabled | disabled}\n\nThis will:\n- Validate deployment readiness (quality gates, environment, rollback)\n- Staging regression gate (block if regression > {threshold}%)\n- Execute {strategy} deployment with continuous monitoring\n- Production regression gate (rollback if regression > {threshold}%)\n- Run smoke tests and SLO validation\n- Automated rollback on failure or regression\n- Generate comprehensive deployment report\n\nExpected duration: {30-90 minutes for deployment, 10-15 minutes orchestration}\n\nStarting orchestration...\n```\n\n**During**: Update progress with clear indicators\n\n```\n✓ = Complete\n⏳ = In progress\n❌ = Error\u002Fblocked\n⚠️ = Warning\u002Fattention needed\n```\n\n**At end**: Summary report with status and artifacts (see Final Summary Report above)\n\n## Error Handling\n\n**Quality Gate Failure**:\n```\n❌ Pre-deployment validation failed: {gate-name}\n\nGaps identified:\n- {list missing approvals or failures}\n\nRecommendation: Resolve gate failures before proceeding\n- Command: \u002Fgate-check transition\n- Fix: {specific actions to resolve each gap}\n\nDeployment BLOCKED until all gates pass.\n```\n\n**Staging Regression Gate Failure**:\n```\n❌ Staging regression gate failed: {regression-rate}% > threshold {threshold}%\n\nRegressions detected:\n- Test failures: {count new failures}\n- Metric degradations: {error rate, latency, throughput}\n- Critical paths affected: {list user journeys}\n\nImpact assessment: .aiwg\u002Fdeployment\u002Fregression-impact-assessment-staging.md\n\nRecommendation: Fix regressions before production deployment\n- Root cause: {likely causes}\n- Fix: {specific remediation actions}\n- Re-test: Run \u002Fregression-check after fixes\n\nDeployment BLOCKED until regressions resolved.\n```\n\n**Environment Health Degraded**:\n```\n❌ Production environment unhealthy: {issue-description}\n\nIssues:\n- {list infrastructure problems}\n\nRecommendation: Resolve environment issues before deploying\n- Check: {kubectl commands to diagnose}\n- Fix: {specific remediation actions}\n\nDeployment BLOCKED until environment healthy.\n```\n\n**Deployment Execution Failure**:\n```\n❌ Deployment failed during execution: {error-message}\n\nError: {description}\n\nRecommended Actions:\n1. Review deployment logs: {path}\n2. Check {specific components}: {diagnostic commands}\n3. Fix identified issue\n4. Re-run deployment\n\nNo rollback needed (failure before cutover to new version).\n```\n\n**SLO Breach Detected**:\n```\n❌ SLO breach detected: {slo-name}\n- Current: {current-value}\n- Target: {target-value}\n- Threshold: {threshold-value}\n\nAutomated rollback TRIGGERED\n\n⏳ Executing rollback...\n✓ Rollback complete: Production restored to version {previous-version}\n✓ SLOs returned to baseline\n\nIncident declared: {incident-id}\nRoot cause analysis initiated.\n\nRecommended Actions:\n1. Review SLO monitoring report: {path}\n2. Analyze failure reason: {likely causes}\n3. Fix issues identified\n4. Validate in staging\n5. Plan re-deployment\n```\n\n**Production Regression Gate Failure**:\n```\n❌ Production regression gate failed: {regression-rate}% > threshold {threshold}%\n\nRegressions detected:\n- Test failures: {count new failures}\n- Metric degradations: {error rate, latency, availability}\n- User journeys affected: {list critical paths}\n\n{If --rollback-on-regression enabled}\nAutomated rollback TRIGGERED\n\n⏳ Executing rollback...\n✓ Rollback complete: Production restored to version {previous-version}\n✓ Regression verification: {ELIMINATED | PERSISTS}\n\n{If --rollback-on-regression disabled}\n⚠️ Manual decision required:\n- [rollback] Rollback to previous version\n- [accept] Accept regression risk, continue monitoring\n- [investigate] Keep deployed, investigate root cause\n\nRegression details: .aiwg\u002Fdeployment\u002Fregression-gate-production.md\n\nIncident declared: {incident-id}\nRoot cause analysis initiated.\n\nRecommended Actions:\n1. Review regression gate report: {path}\n2. Analyze regression root cause: {likely causes}\n3. Fix issues identified\n4. Validate in staging with \u002Fregression-check\n5. Plan re-deployment or accept risk\n```\n\n**Rollback Failure (CRITICAL)**:\n```\n❌ CRITICAL: Rollback failed - {error-message}\n\nThis is a P0 production incident.\n\nIMMEDIATE ACTIONS:\n1. Escalate to Incident Commander\n2. Assemble incident response team\n3. Manual intervention required: {specific actions}\n4. Notify all stakeholders of service disruption\n\nIncident declared: {incident-id}\nIncident Commander: {contact info}\n\nDo NOT attempt re-deployment until incident resolved.\n```\n\n**Smoke Test Failure**:\n```\n❌ Smoke tests failed: {test-name}\n\nFailed tests:\n- {list failures with details}\n\nIf deployed to production: Automated rollback TRIGGERED\nIf not yet cutover: Deployment STOPPED (no rollback needed)\n\nRecommended Actions:\n1. Review smoke test logs: {path}\n2. Diagnose failure: {likely causes}\n3. Fix issues identified\n4. Re-run smoke tests in staging\n5. Plan re-deployment\n```\n\n## Success Criteria\n\nThis orchestration succeeds when:\n- [ ] Pre-deployment validation passed (all quality gates GO)\n- [ ] Deployment strategy selected and confirmed\n- [ ] Staging regression gate passed (regression ≤ threshold)\n- [ ] Deployment executed successfully (strategy-specific milestones)\n- [ ] Smoke tests passed (production validation)\n- [ ] SLOs met for monitoring duration (15-30 minutes)\n- [ ] Production regression gate passed (regression ≤ threshold)\n- [ ] No rollback triggered (or rollback successful if triggered)\n- [ ] Deployment report generated with metrics and lessons learned\n- [ ] Regression analysis documented\n- [ ] Stakeholder notification drafted\n- [ ] Operational runbooks updated with improvements\n- [ ] Complete audit trails archived\n\n## Metrics to Track\n\n**During orchestration, track**:\n- Deployment duration: {total time from start to completion}\n- Regression rates: {staging and production}\n- SLO metrics: {error rate, latency, throughput, availability}\n- Smoke test pass rate: {passed\u002Ftotal}\n- Infrastructure health: {pods running, nodes healthy, alerts triggered}\n- Rollback count: {number of rollbacks triggered}\n- Regression-triggered rollbacks: {count}\n- Mean time to rollback (MTTR): {time from failure detection to rollback completion}\n\n## References\n\n**Templates** (via $AIWG_ROOT):\n- Deployment Plan: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fdeployment\u002Fdeployment-plan-template.md`\n- Rollback Plan: rollback steps in this skill\n- SLO Definition: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Freliability\u002Fslo-sli-template.md`\n- Smoke Test Checklist: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Ftest\u002Ftest-suite-card.md`\n- Deployment Report: deployment report fields in this skill\n- Incident Report: `agentic\u002Fcode\u002Fframeworks\u002Fops-complete\u002Ftemplates\u002Fincident.md`\n\n**Gate Criteria**:\n- `flows\u002Fgate-criteria-by-phase.md` (Transition section)\n\n**Schemas**:\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fschemas\u002Fflows\u002Fregression-gate.yaml - Regression gate format\n\n**Commands**:\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fcommands\u002Fregression-check.md - Regression detection command\n\n**Agents**:\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fagents\u002Fregression-analyst.md - Regression analysis agent\n\n**Multi-Agent Pattern**:\n- `docs\u002Fmulti-agent-documentation-pattern.md`\n\n**Orchestrator Architecture**:\n- `docs\u002Forchestrator-architecture.md`\n\n**Natural Language Translations**:\n- `docs\u002Fsimple-language-translations.md`\n",{"name":5,"namespace":52,"platforms":53,"commandHint":55,"description":7},"aiwg",[54],"all",{"model":33,"category":56,"modelRole":57,"modelTier":58,"allowedTools":59,"argumentHint":60,"orchestration":61,"modelRationale":62},"sdlc-orchestration","reasoning","premium","Task, Read, Write, Glob, TodoWrite","[project-directory] [--guidance \"text\"] [--interactive] [--regression-threshold N] [--rollback-on-regression]",true,"Production release and rollback decisions have high operational impact.","main","a602706fc62ff1cfcb18001358ac39647b08acf5","agentic\u002Fcode\u002Fplugins\u002Fsdlc\u002Fskills\u002Fflow-deploy-to-production",36,"https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg","https:\u002F\u002Faiwg.io","https:\u002F\u002Fgithub.com\u002Fjmagly","https:\u002F\u002Fintegrolabs.io","ml\u002Fai, industrial automation, safety\u002Fsecurity, ssi\r\n\r\nmagly.net\r\nintegrolabs.io\r\naiwg.io\r\nfortemi.com\r\npagenary.com\r\nbytecask.com","2026-11-11 08:11:25",{"source":8,"skillName":5,"commands":74,"prompt":84,"zipAvailable":61},[75,78,81],{"tool":76,"command":77},"npx","npx skills add jmagly\u002Faiwg --skill flow-deploy-to-production",{"tool":79,"command":80},"bunx","bunx skills add jmagly\u002Faiwg --skill flow-deploy-to-production",{"tool":82,"command":83},"pnpm","pnpm dlx skills add jmagly\u002Faiwg --skill flow-deploy-to-production","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fsdlc\u002Fskills\u002Fflow-deploy-to-production\u002FSKILL.md",[],[87,114,135,141,148,162],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":94,"publishedAt":47},"01M70QA0BSYJ49EES9V4RE8QH1","host-hardening","Read-only system hardening baseline and plan-first host hardening recommendations for SSH, Docker bind addresses, firewall persistence, datastores, exporters and audit retention.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[93],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[95,96,97,44,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113],"host","host hardening","hardening","re","recommendations","remediation","plan","port","verification","Bash","access","only","retention","audit","never","firewall","bind","secrets","request",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":122,"publishedAt":47},"01M70PNT2Z4HMZPRBTAF6073NN","exposure-analysis","Read-only firewall analysis and effective host exposure reconstruction for Docker published ports, UFW bypass, stale rules, CDN scope, IPv6 asymmetry and external probe allowlists.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fforensics\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[120,121],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[123,124,125,44,126,102,127,128,104,129,95,130,106,131,132,109,110,133,134,42],"exposure analysis","analysis","unknown","credentials","collection","ufw","ports","internet","local","scope","reconstruction","operator",{"skillNo":136,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":140,"publishedAt":47},"01M70P8QATMPKA78E4FT5D2TNA","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[139],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[97,95,96,105,44,113,100,99,108,101,102,103,104,112,106,107,98,109,110,111],{"skillNo":142,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":147,"publishedAt":47},"01M70NMPVJ5H0JH131P60FW4R8","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[145,146],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[124,123,109,126,102,127,104,125,95,130,106,131,132,44,110,129,128,133,134,42],{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":155,"publishedAt":47},"01M6CB4DDR0B4NNCFK7ZK7449H","fixture-skill","Exercise rule delivery.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frule-delivery\u002Fskills\u002Ffixture-skill\u002FSKILL.md",[154],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[156,157,158,159,160,161],"fixture skill","fixture","rule","delivery","true","exercise",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":169,"publishedAt":47},"01M6CB4AVK1W76MFMPP0JP32CJ","pi-local","Pi-local duplicate-precedence fixture.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fproviders\u002Fpi\u002Fproject\u002F.pi\u002Fskills\u002Fpi-local\u002FSKILL.md",[168],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[170,171,131,172,157],"pi","pi local","duplicate"]