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.
Scope Constraints
Reads infrastructure configurations, CI/CD definitions, and deployment documentation for strategy analysis. Does not modify files, execute deployments, or access production credentials directly.
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)
Input Sanitization
No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.
Procedure
Progress Checklist
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
Compaction resilience: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being analyzed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.
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 |
Handoff
- Hand off to observability-design if deployment health monitoring or SLO-based deployment gating needs are identified.
- Hand off to cost-analysis if deployment strategy choices have significant infrastructure cost implications (e.g., blue-green doubling compute).
Quality Checks
Evolution Notes
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: deployment-plan3description: Use when designing deployment strategies including environment progression, CI/CD pipelines, zero-downtime releases, rollback procedures, and feature flag management. Covers blue-green, rolling, and canary deployment patterns with database migration coordination. Do not use for monitoring or alerting design (use observability-design) or infrastructure cost modeling (use cost-analysis).4---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## Scope Constraints1314Reads infrastructure configurations, CI/CD definitions, and deployment documentation for strategy analysis. Does not modify files, execute deployments, or access production credentials directly.1516## Inputs1718- Feature or service being deployed19- Current infrastructure (hosting provider, container orchestration, CI/CD tooling)20- Existing deployment process (if any)21- Availability requirements (SLA/SLO targets, maintenance window constraints)2223## Input Sanitization2425No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.2627## Procedure2829### Progress Checklist30- [ ] Step 1: Define deployment environments31- [ ] Step 2: Design deployment pipeline32- [ ] Step 3: Plan zero-downtime strategy33- [ ] Step 4: Define rollback procedures34- [ ] Step 5: Design feature flag strategy35- [ ] Step 6: Specify health checks36- [ ] Step 7: Plan database migration coordination3738### Step 1: Define Deployment Environments3940Map the environment progression and configuration strategy:41- **Environment chain**: dev → staging → production (add preview/QA if needed)42- **Environment-specific configs**: Feature flags, API endpoints, database connections, third-party service keys43- **Environment parity**: What differs between environments and why — minimize drift44- **Access controls**: Who can deploy to which environment, approval requirements4546### Step 2: Design Deployment Pipeline4748Define the build-test-deploy stages:49- **Build stage**: Compilation, dependency resolution, asset bundling, Docker image creation50- **Test stage**: Unit tests, integration tests, E2E smoke tests, security scans51- **Deploy stages**: Per-environment deployment steps with promotion gates52- **Approval gates**: Automatic promotion vs manual approval between environments53- **Artifact management**: Image tagging strategy, artifact retention policy5455### Step 3: Plan Zero-Downtime Strategy5657Select and design the deployment strategy:58- **Blue-green**: Two identical environments, instant traffic switch, simple rollback59- **Rolling update**: Gradual instance replacement, reduced resource overhead, longer rollout60- **Canary**: Progressive traffic shifting (1% → 10% → 50% → 100%), metric-gated promotion61- **Feature flags**: Deploy dark, enable progressively, decouple deploy from release62- Choose strategy based on risk tolerance, infrastructure capabilities, and rollback speed requirements6364### Step 4: Define Rollback Procedures6566Plan for every failure scenario:67- **Automated rollback triggers**: Health check failures, error rate spikes, latency thresholds68- **Manual rollback steps**: Exact commands or UI steps to revert to previous version69- **Data rollback considerations**: Can database changes be reversed? Forward-fix vs rollback70- **Rollback testing**: How and when rollback procedures are verified71- **Communication protocol**: Who is notified during rollback, status page updates7273### Step 5: Design Feature Flag Strategy7475Plan feature flag lifecycle:76- **Flag types**: Release flags (temporary), ops flags (kill switches), experiment flags (A/B), permission flags (entitlements)77- **Flag lifecycle**: Creation → testing → rollout → full-release → cleanup78- **Cleanup schedule**: Maximum flag age, review cadence, stale flag detection79- **Flag management**: Tooling choice, naming conventions, flag ownership8081### Step 6: Specify Health Checks8283Define verification at every stage:84- **Readiness probes**: Is the new version ready to receive traffic? Dependency checks, warmup completion85- **Liveness probes**: Is the running instance healthy? Memory, deadlock detection, heartbeat86- **Smoke tests**: Post-deploy verification of critical paths — login, core API, key user flows87- **Synthetic monitoring**: Continuous external checks simulating user behavior8889### Step 7: Plan Database Migration Coordination9091Coordinate schema changes with deployments:92- **Migration ordering**: Run migrations before deploy (expand), after deploy (contract), or both (expand-contract pattern)93- **Backward-compatible migrations**: Additive changes only during rollout — no column drops, no renames94- **Rollback scripts**: Reverse migration for every forward migration95- **Data backfill**: Strategy for populating new columns or transforming existing data96- **Migration testing**: Run against production-like data volume before deploying9798> **Compaction resilience**: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being analyzed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.99100## Output Format101102```markdown103# Deployment Plan: [Feature/Service Name]104105## Environment Matrix106107| Environment | Purpose | URL | Deploy Method | Approval |108|-------------|---------|-----|---------------|----------|109| dev | Development testing | ... | Auto on merge to dev | None |110| staging | Pre-production validation | ... | Auto on merge to main | None |111| production | Live traffic | ... | Promotion from staging | Manual |112113## Pipeline Diagram114115```116[commit] → [build] → [test] → [deploy:dev] → [deploy:staging] → [approve] → [deploy:prod]117 ↓118 [smoke tests]119```120121## Deployment Strategy122123**Method**: [Blue-green / Rolling / Canary / Feature flag]124125[Strategy-specific details: traffic percentages, timing, promotion criteria]126127## Rollback Checklist128129- [ ] Trigger: [condition that initiates rollback]130- [ ] Command: [exact rollback command or procedure]131- [ ] Verify: [how to confirm rollback succeeded]132- [ ] Database: [migration rollback steps if applicable]133- [ ] Notify: [who to inform and how]134135## Feature Flag Plan136137| Flag Name | Type | Default | Rollout Plan | Cleanup Date |138|-----------|------|---------|--------------|--------------|139| ... | release | off | 1% → 10% → 100% | [date] |140141## Health Checks142143| Check | Type | Endpoint/Method | Interval | Failure Threshold |144|-------|------|-----------------|----------|-------------------|145| Readiness | probe | /health/ready | 5s | 3 consecutive |146| Liveness | probe | /health/live | 10s | 5 consecutive |147| Smoke | post-deploy | [test suite] | on deploy | any failure |148149## Database Migration Plan150151| Migration | Type | Reversible | Run When | Dependencies |152|-----------|------|------------|----------|--------------|153| ... | expand | yes | pre-deploy | none |154```155156## Handoff157158- Hand off to observability-design if deployment health monitoring or SLO-based deployment gating needs are identified.159- Hand off to cost-analysis if deployment strategy choices have significant infrastructure cost implications (e.g., blue-green doubling compute).160161## Quality Checks162163- [ ] Every environment has defined configuration and access controls164- [ ] Pipeline includes automated tests before each promotion165- [ ] Zero-downtime strategy is specified with rollback speed estimate166- [ ] Rollback procedures are documented with exact commands167- [ ] Feature flags have defined lifecycle and cleanup dates168- [ ] Health checks cover readiness, liveness, and post-deploy smoke tests169- [ ] Database migrations are backward-compatible during rollout170- [ ] Communication plan covers both deploy and rollback scenarios171172## Evolution Notes173<!-- Observations appended after each use -->174175---176> Converted and distributed by [TomeVault](https://tomevault.io/claim/dtsong) — claim your Tome and manage your conversions.177<!-- tomevault:4.0:skill_md:2026-04-13 -->