Deployment Plan
Purpose
Design a complete deployment strategy covering environment progression, pipeline stages, zero-downtime releases, rollback procedures, and feature flag management. Produces actionable deployment runbooks and pipeline configurations.
Inputs
- Feature or service being deployed
- Current infrastructure (hosting provider, container orchestration, CI/CD tooling)
- Existing deployment process (if any)
- Availability requirements (SLA/SLO targets, maintenance window constraints)
Process
Step 1: Define Deployment Environments
Map the environment progression and configuration strategy:
- Environment chain: dev → staging → production (add preview/QA if needed)
- Environment-specific configs: Feature flags, API endpoints, database connections, third-party service keys
- Environment parity: What differs between environments and why — minimize drift
- Access controls: Who can deploy to which environment, approval requirements
Step 2: Design Deployment Pipeline
Define the build-test-deploy stages:
- Build stage: Compilation, dependency resolution, asset bundling, Docker image creation
- Test stage: Unit tests, integration tests, E2E smoke tests, security scans
- Deploy stages: Per-environment deployment steps with promotion gates
- Approval gates: Automatic promotion vs manual approval between environments
- Artifact management: Image tagging strategy, artifact retention policy
Step 3: Plan Zero-Downtime Strategy
Select and design the deployment strategy:
- Blue-green: Two identical environments, instant traffic switch, simple rollback
- Rolling update: Gradual instance replacement, reduced resource overhead, longer rollout
- Canary: Progressive traffic shifting (1% → 10% → 50% → 100%), metric-gated promotion
- Feature flags: Deploy dark, enable progressively, decouple deploy from release
- Choose strategy based on risk tolerance, infrastructure capabilities, and rollback speed requirements
Step 4: Define Rollback Procedures
Plan for every failure scenario:
- Automated rollback triggers: Health check failures, error rate spikes, latency thresholds
- Manual rollback steps: Exact commands or UI steps to revert to previous version
- Data rollback considerations: Can database changes be reversed? Forward-fix vs rollback
- Rollback testing: How and when rollback procedures are verified
- Communication protocol: Who is notified during rollback, status page updates
Step 5: Design Feature Flag Strategy
Plan feature flag lifecycle:
- Flag types: Release flags (temporary), ops flags (kill switches), experiment flags (A/B), permission flags (entitlements)
- Flag lifecycle: Creation → testing → rollout → full-release → cleanup
- Cleanup schedule: Maximum flag age, review cadence, stale flag detection
- Flag management: Tooling choice, naming conventions, flag ownership
Step 6: Specify Health Checks
Define verification at every stage:
- Readiness probes: Is the new version ready to receive traffic? Dependency checks, warmup completion
- Liveness probes: Is the running instance healthy? Memory, deadlock detection, heartbeat
- Smoke tests: Post-deploy verification of critical paths — login, core API, key user flows
- Synthetic monitoring: Continuous external checks simulating user behavior
Step 7: Plan Database Migration Coordination
Coordinate schema changes with deployments:
- Migration ordering: Run migrations before deploy (expand), after deploy (contract), or both (expand-contract pattern)
- Backward-compatible migrations: Additive changes only during rollout — no column drops, no renames
- Rollback scripts: Reverse migration for every forward migration
- Data backfill: Strategy for populating new columns or transforming existing data
- Migration testing: Run against production-like data volume before deploying
Output Format
# Deployment Plan: [Feature/Service Name]
## Environment Matrix
| Environment | Purpose | URL | Deploy Method | Approval |
|-------------|---------|-----|---------------|----------|
| dev | Development testing | ... | Auto on merge to dev | None |
| staging | Pre-production validation | ... | Auto on merge to main | None |
| production | Live traffic | ... | Promotion from staging | Manual |
## Pipeline Diagram
[commit] → [build] → [test] → [deploy:dev] → [deploy:staging] → [approve] → [deploy:prod]
↓
[smoke tests]
## Deployment Strategy
**Method**: [Blue-green / Rolling / Canary / Feature flag]
[Strategy-specific details: traffic percentages, timing, promotion criteria]
## Rollback Checklist
- [ ] Trigger: [condition that initiates rollback]
- [ ] Command: [exact rollback command or procedure]
- [ ] Verify: [how to confirm rollback succeeded]
- [ ] Database: [migration rollback steps if applicable]
- [ ] Notify: [who to inform and how]
## Feature Flag Plan
| Flag Name | Type | Default | Rollout Plan | Cleanup Date |
|-----------|------|---------|--------------|--------------|
| ... | release | off | 1% → 10% → 100% | [date] |
## Health Checks
| Check | Type | Endpoint/Method | Interval | Failure Threshold |
|-------|------|-----------------|----------|-------------------|
| Readiness | probe | /health/ready | 5s | 3 consecutive |
| Liveness | probe | /health/live | 10s | 5 consecutive |
| Smoke | post-deploy | [test suite] | on deploy | any failure |
## Database Migration Plan
| Migration | Type | Reversible | Run When | Dependencies |
|-----------|------|------------|----------|--------------|
| ... | expand | yes | pre-deploy | none |
Quality Checks
Evolution Notes
1---2name: deployment-plan3description: Deployment strategy with rollback procedures, feature flags, and zero-downtime releases4---56# Deployment Plan78## Purpose910Design a complete deployment strategy covering environment progression, pipeline stages, zero-downtime releases, rollback procedures, and feature flag management. Produces actionable deployment runbooks and pipeline configurations.1112## Inputs1314- Feature or service being deployed15- Current infrastructure (hosting provider, container orchestration, CI/CD tooling)16- Existing deployment process (if any)17- Availability requirements (SLA/SLO targets, maintenance window constraints)1819## Process2021### Step 1: Define Deployment Environments2223Map the environment progression and configuration strategy:24- **Environment chain**: dev → staging → production (add preview/QA if needed)25- **Environment-specific configs**: Feature flags, API endpoints, database connections, third-party service keys26- **Environment parity**: What differs between environments and why — minimize drift27- **Access controls**: Who can deploy to which environment, approval requirements2829### Step 2: Design Deployment Pipeline3031Define the build-test-deploy stages:32- **Build stage**: Compilation, dependency resolution, asset bundling, Docker image creation33- **Test stage**: Unit tests, integration tests, E2E smoke tests, security scans34- **Deploy stages**: Per-environment deployment steps with promotion gates35- **Approval gates**: Automatic promotion vs manual approval between environments36- **Artifact management**: Image tagging strategy, artifact retention policy3738### Step 3: Plan Zero-Downtime Strategy3940Select and design the deployment strategy:41- **Blue-green**: Two identical environments, instant traffic switch, simple rollback42- **Rolling update**: Gradual instance replacement, reduced resource overhead, longer rollout43- **Canary**: Progressive traffic shifting (1% → 10% → 50% → 100%), metric-gated promotion44- **Feature flags**: Deploy dark, enable progressively, decouple deploy from release45- Choose strategy based on risk tolerance, infrastructure capabilities, and rollback speed requirements4647### Step 4: Define Rollback Procedures4849Plan for every failure scenario:50- **Automated rollback triggers**: Health check failures, error rate spikes, latency thresholds51- **Manual rollback steps**: Exact commands or UI steps to revert to previous version52- **Data rollback considerations**: Can database changes be reversed? Forward-fix vs rollback53- **Rollback testing**: How and when rollback procedures are verified54- **Communication protocol**: Who is notified during rollback, status page updates5556### Step 5: Design Feature Flag Strategy5758Plan feature flag lifecycle:59- **Flag types**: Release flags (temporary), ops flags (kill switches), experiment flags (A/B), permission flags (entitlements)60- **Flag lifecycle**: Creation → testing → rollout → full-release → cleanup61- **Cleanup schedule**: Maximum flag age, review cadence, stale flag detection62- **Flag management**: Tooling choice, naming conventions, flag ownership6364### Step 6: Specify Health Checks6566Define verification at every stage:67- **Readiness probes**: Is the new version ready to receive traffic? Dependency checks, warmup completion68- **Liveness probes**: Is the running instance healthy? Memory, deadlock detection, heartbeat69- **Smoke tests**: Post-deploy verification of critical paths — login, core API, key user flows70- **Synthetic monitoring**: Continuous external checks simulating user behavior7172### Step 7: Plan Database Migration Coordination7374Coordinate schema changes with deployments:75- **Migration ordering**: Run migrations before deploy (expand), after deploy (contract), or both (expand-contract pattern)76- **Backward-compatible migrations**: Additive changes only during rollout — no column drops, no renames77- **Rollback scripts**: Reverse migration for every forward migration78- **Data backfill**: Strategy for populating new columns or transforming existing data79- **Migration testing**: Run against production-like data volume before deploying8081## Output Format8283```markdown84# Deployment Plan: [Feature/Service Name]8586## Environment Matrix8788| Environment | Purpose | URL | Deploy Method | Approval |89|-------------|---------|-----|---------------|----------|90| dev | Development testing | ... | Auto on merge to dev | None |91| staging | Pre-production validation | ... | Auto on merge to main | None |92| production | Live traffic | ... | Promotion from staging | Manual |9394## Pipeline Diagram9596```97[commit] → [build] → [test] → [deploy:dev] → [deploy:staging] → [approve] → [deploy:prod]98 ↓99 [smoke tests]100```101102## Deployment Strategy103104**Method**: [Blue-green / Rolling / Canary / Feature flag]105106[Strategy-specific details: traffic percentages, timing, promotion criteria]107108## Rollback Checklist109110- [ ] Trigger: [condition that initiates rollback]111- [ ] Command: [exact rollback command or procedure]112- [ ] Verify: [how to confirm rollback succeeded]113- [ ] Database: [migration rollback steps if applicable]114- [ ] Notify: [who to inform and how]115116## Feature Flag Plan117118| Flag Name | Type | Default | Rollout Plan | Cleanup Date |119|-----------|------|---------|--------------|--------------|120| ... | release | off | 1% → 10% → 100% | [date] |121122## Health Checks123124| Check | Type | Endpoint/Method | Interval | Failure Threshold |125|-------|------|-----------------|----------|-------------------|126| Readiness | probe | /health/ready | 5s | 3 consecutive |127| Liveness | probe | /health/live | 10s | 5 consecutive |128| Smoke | post-deploy | [test suite] | on deploy | any failure |129130## Database Migration Plan131132| Migration | Type | Reversible | Run When | Dependencies |133|-----------|------|------------|----------|--------------|134| ... | expand | yes | pre-deploy | none |135```136137## Quality Checks138139- [ ] Every environment has defined configuration and access controls140- [ ] Pipeline includes automated tests before each promotion141- [ ] Zero-downtime strategy is specified with rollback speed estimate142- [ ] Rollback procedures are documented with exact commands143- [ ] Feature flags have defined lifecycle and cleanup dates144- [ ] Health checks cover readiness, liveness, and post-deploy smoke tests145- [ ] Database migrations are backward-compatible during rollout146- [ ] Communication plan covers both deploy and rollback scenarios147148## Evolution Notes149<!-- Observations appended after each use -->