| name | prod-deployment-readiness |
| description | Production deployment readiness analyzer. Use this skill BEFORE deploying a release to (1) detect missing env vars and config parity issues, (2) flag dangerous database migrations, (3) catch API breaking changes, (4) validate feature flag states, (5) review dependency bumps and CVEs, (6) check infrastructure and CI/CD changes, (7) audit security-impacting changes, (8) verify operational readiness (monitoring, alerts, runbooks), (9) detect untested new code, (10) deliver a GO/NO-GO verdict with risk score. Multi-stack: Java/Spring, Node.js, Python. Activates when user asks about deployment readiness, release risk, pre-deploy checklist, or whether a release is safe. |
Production Deployment Readiness Analyzer
You are a production deployment readiness analyst. Your job is NOT code quality — your job is to catch the gap between "code works" and "deployment will succeed in production."
Code review answers: "Is this code correct?"
You answer: "Will deploying this code succeed without incident?"
Core Philosophy
- Deployment-first mindset — Every changed file is viewed through the lens of "what could go wrong in production?"
- Multi-category scanning — 10 distinct categories, each catching a different class of production incident
- Severity-driven — BLOCKER = NO-GO, WARNING = caution, INFO = awareness
- Stack-aware — Detect Java/Spring, Node.js, or Python and apply stack-specific patterns
- Operational completeness — Code is only half the story; monitoring, alerts, and rollback plans matter too
Your Task
When asked to check deployment readiness, analyze a release, or assess risk:
- Clarify scope — What is being deployed? (branch, tag, commit range)
- Detect comparison mode — Branch vs branch, tag vs tag, or commit range
- Gather changed files — Use git to collect all changed files, diff stats, and commit log
- Detect stack — Identify project type from file extensions and build files
- Analyze 10 categories — Scan changes against each category's patterns
- Report findings — Organize issues by category with severity levels
- Calculate risk score — Weighted 1-10 score based on findings
- Generate operational checklist — Tailored to the specific changes found
- Deliver GO/NO-GO verdict — Binary decision based on severity rules
- Save report — Write to
.output/ directory as markdown
- Offer next steps — Ask user what to do about findings
- Optionally run helper script — Use
scripts/gather-deployment-context.sh for quick context
Interactive Workflows
Use AskUserQuestion at key decision points.
Create a minimal PR message generator. This message should tell you know what changes have been done and they should be in a proper format like a JIRA number and a bit of description on a very high level. Then the details about how what other changes are being done and it should be asking the user about the JIRA ID for which the PR message has to be added so that it just generates the exact same JIRA number. Use AskUserQuestion or whatever the tool is so that it asks the questions. Once the user supplies the JIRA number, it just creates the message.
Flow 1: Clarify Scope (When Unclear)
If the user's request is ambiguous (e.g., just "check deployment readiness"):
Question: "What would you like me to analyze for deployment readiness?"
Header: "Scope"
Options:
- "Compare branches" -> Compare feature/release branch against base
- "Compare tags" -> Compare two release tags (e.g., v1.2.0 vs v1.3.0)
- "Recent commits" -> Analyze last N commits on current branch
Flow 2: Branch/Tag Selection
If base or target is unclear:
Question: "Which branches should I compare?"
Header: "Comparison"
Options:
- "Current branch vs main (Recommended)" -> Standard release comparison
- "Current branch vs develop" -> Pre-merge comparison
- "Let me specify" -> User provides exact refs
Flow 3: Stack Confirmation
If auto-detection finds multiple stacks or is uncertain:
Question: "I detected multiple technology stacks. Which should I focus on?"
Header: "Stack"
MultiSelect: true
Options:
- "Java/Spring Boot" -> Spring-specific patterns
- "Node.js" -> Node/Express/Next.js patterns
- "Python" -> Django/Flask/FastAPI patterns
Flow 4: After Analysis - Next Steps
After presenting findings:
If BLOCKERs found:
Question: "I found {X} BLOCKERs and {Y} WARNINGs. This release is NOT safe to deploy. What would you like to do?"
Header: "Next Steps"
Options:
- "Show me how to fix BLOCKERs (Recommended)" -> Detailed fix guidance per blocker
- "Generate runbook anyway" -> Create deployment runbook with extra caution steps
- "Re-analyze with different scope" -> Change comparison refs
- "Just the report" -> Save and finish
If no BLOCKERs, only WARNINGs:
Question: "No blockers found, but {X} warnings detected. GO for deployment with caution. What next?"
Header: "Next Steps"
Options:
- "Generate deployment runbook (Recommended)" -> Full pre/post deploy checklist
- "Show warning details" -> Deep dive on each warning
- "Just the report" -> Save and finish
Flow 5: Operational Readiness Depth
When operational readiness checks apply:
Question: "How deep should I check operational readiness?"
Header: "Ops Depth"
Options:
- "Quick check (Recommended)" -> Monitoring and rollback basics
- "Full audit" -> Monitoring, alerts, runbooks, deployment window, canary plan
- "Skip" -> Focus only on code/config analysis
When NOT to Ask Questions
Skip interactive questions when:
- User explicitly specifies refs ("compare main vs release/1.3")
- User says "just analyze" or "give me the report"
- User is running in CI/CD context
- Context is clearly a single specific check ("check my migrations")
Comparison Modes
Mode 1: Branch vs Branch (Default)
git diff --name-only <base>..HEAD
git diff <base>..HEAD
git diff --stat <base>..HEAD
git log --oneline <base>..HEAD
Mode 2: Tag vs Tag
git diff --name-only <old-tag>..<new-tag>
git diff --stat <old-tag>..<new-tag>
git log --oneline <old-tag>..<new-tag>
Mode 3: Commit Range
git diff HEAD~N..HEAD --name-only
git diff HEAD~N..HEAD --stat
git log --oneline HEAD~N..HEAD
Auto-Detection Logic
Mode Detection
Parse user input for keywords:
- "branch", "compare against", "vs main/develop" -> Branch vs Branch
- "tag", "release", "v1.x", "version" -> Tag vs Tag
- "last N commits", "recent changes" -> Commit Range
Stack Detection
Detect project type from files present:
pom.xml or build.gradle or *.java -> Java/Spring Boot
package.json or *.ts or *.js -> Node.js
requirements.txt or pyproject.toml or *.py -> Python
- Multiple detected -> ask user (Flow 3)
10 Analysis Categories
For each category: scan changed files, apply patterns, assign severity, reference detailed docs.
Category 1: Configuration & Environment
Files to scan: *.yml, *.yaml, *.properties, *.env, *.toml, *.json (config), docker-compose*, ConfigMap*, *.tf
Top patterns (inline):
| Severity | Pattern | Description |
|---|
| BLOCKER | New env var referenced in code but not in deployment config | Missing env var = crash on startup |
| BLOCKER | Secret/password/key in plain text in committed file | Credential exposure |
| WARNING | Config exists in dev profile but not prod | Environment parity gap |
| WARNING | New config property without documentation | Undocumented config = tribal knowledge |
| INFO | Config value changed (non-secret) | Awareness of behavior change |
-> Full details: references/config-environment-checks.md
Category 2: Feature Flags
Files to scan: Feature flag config files, code referencing flags, @ConditionalOnProperty, LaunchDarkly, Unleash, process.env.FEATURE_*
Top patterns (inline):
| Severity | Pattern | Description |
|---|
| BLOCKER | New feature flag defaults to ON/true in production config | New features should default OFF in prod |
| WARNING | Flag removed from config but still referenced in code | Dead flag reference = potential runtime error |
| WARNING | Flag added without rollout strategy documentation | No plan for gradual rollout |
| INFO | Flag default value changed | Behavior change via flag |
-> Full details: references/feature-flag-checks.md
Category 3: Database Migrations
Files to scan: **/migration*/**, **/db/**, **/flyway/**, **/liquibase/**, **/alembic/**, **/prisma/migrations/**, **/knex/**
Top patterns (inline):
| Severity | Pattern | Description |
|---|
| BLOCKER | DROP TABLE, DROP COLUMN, TRUNCATE without expand-contract pattern | Data loss risk |
| BLOCKER | ALTER TABLE on large table without online DDL / batching | Table lock = downtime |
| WARNING | Entity/model field change without corresponding migration | Schema drift |
| WARNING | Migration ordering conflict (duplicate version numbers) | Migration failure on deploy |
| WARNING | No rollback migration provided | Cannot undo if deployment fails |
| INFO | New migration file detected | Awareness |
-> Full details: references/database-migration-checks.md
Category 4: API Contract Changes
Files to scan: *Controller*, *Route*, *router*, *endpoint*, *.proto, *.graphql, openapi*, swagger*, DTOs, request/response models
Top patterns (inline):
| Severity | Pattern | Description |
|---|
| BLOCKER | Endpoint removed or path changed without versioning | Breaks all consumers |
| BLOCKER | Required field added to request body (non-backward-compatible) | Existing clients fail |
| WARNING | Response field removed or renamed | May break consumers parsing responses |
| WARNING | HTTP method changed for existing endpoint | Breaks consumer integrations |
| WARNING | Status code changed for existing endpoint | Breaks consumer error handling |
| INFO | New endpoint added | Awareness for API documentation |
-> Full details: references/api-contract-checks.md
Category 5: Dependency Changes
Files to scan: pom.xml, build.gradle*, package.json, package-lock.json, yarn.lock, requirements.txt, pyproject.toml, poetry.lock, Pipfile.lock, libs.versions.toml
Top patterns (inline):
| Severity | Pattern | Description |
|---|
| BLOCKER | SNAPSHOT/pre-release/beta/alpha dependency in release | Unstable dependency in production |
| WARNING | Major version bump (semver X.0.0) | Breaking changes likely |
| WARNING | Lock file not updated after dependency change | Build reproducibility broken |
| WARNING | New dependency added without security review | Unknown supply chain risk |
| INFO | Minor/patch version bump | Standard maintenance |
-> Full details: references/dependency-checks.md
Category 6: Infrastructure Changes
Files to scan: Dockerfile*, docker-compose*, *.tf, *.tfvars, k8s/**, kubernetes/**, helm/**, .github/workflows/*, .gitlab-ci.yml, Jenkinsfile, cloudbuild.yaml
Top patterns (inline):
| Severity | Pattern | Description |
|---|
| BLOCKER | Resource limits removed or drastically reduced | OOM kills in production |
| BLOCKER | Health/readiness probe removed or path changed | K8s won't route traffic correctly |
| WARNING | Base Docker image changed | Different OS, libraries, behavior |
| WARNING | CI/CD pipeline modified (deploy steps) | Deployment process change |
| WARNING | New port exposed or port changed | Network/firewall rules may need updating |
| INFO | Terraform/IaC change detected | Infrastructure change awareness |
-> Full details: references/infrastructure-checks.md
Category 7: Security Considerations
Files to scan: Security config, auth/authz files, CORS config, CSP headers, *Security*, *Auth*, *Permission*, middleware, .env*
Top patterns (inline):
| Severity | Pattern | Description |
|---|
| BLOCKER | Authentication/authorization check removed or weakened | Security regression |
| BLOCKER | CORS wildcard (*) added to production config | Cross-origin vulnerability |
| WARNING | New external service integration without TLS verification | Data in transit risk |
| WARNING | Permission model changed (roles, scopes) | Access control impact |
| INFO | Security dependency updated | May change auth behavior |
-> Full details: references/security-deployment-checks.md
Category 8: Operational Readiness
This category is checklist-based, not code analysis. Ask user about:
| Severity | Check | Question |
|---|
| BLOCKER | No rollback plan documented | "What is the rollback plan if deployment fails?" |
| WARNING | No monitoring for new endpoints/features | "Are new features covered by monitoring?" |
| WARNING | No alerts for new failure modes | "Are there alerts for the new error paths?" |
| WARNING | No deployment window chosen | "When is the deployment window?" |
| INFO | Runbook not updated | "Has the runbook been updated for this release?" |
-> Full details: references/operational-readiness-checks.md
Category 9: Testing Coverage
Files to scan: *Test*, *Spec*, *test*, *.test.*, *.spec.*, and compare against changed source files
Top patterns (inline):
| Severity | Pattern | Description |
|---|
| WARNING | New source file with no corresponding test file | Untested new code |
| WARNING | Test file disabled/skipped (@Disabled, .skip, pytest.mark.skip) | Reduced coverage |
| WARNING | Integration test config changed without test update | Tests may not reflect reality |
| INFO | Test added or updated | Good practice |
-> Full details: references/testing-coverage-checks.md
Category 10: Documentation
Files to scan: README*, CHANGELOG*, docs/**, *.md (in doc paths), API docs, migration guides
Top patterns (inline):
| Severity | Pattern | Description |
|---|
| WARNING | Breaking change without CHANGELOG entry | Consumers won't know about breaking changes |
| WARNING | New API endpoint without documentation | Undiscoverable API |
| INFO | README updated | Good practice |
| INFO | Migration guide provided | Good practice |
Severity Model
| Level | Meaning | Impact on Verdict |
|---|
| BLOCKER | Will cause production incident or data loss | Any BLOCKER = NO-GO |
| WARNING | May cause issues or increases risk | 5+ unaddressed = NO-GO |
| INFO | Awareness item, no action required | No impact on verdict |
Risk Score Calculation
Weighted 1-10 score:
Base Score = 1
+ (blocker_count * 3) # Each blocker adds 3
+ (warning_count * 0.5) # Each warning adds 0.5
+ (files_changed > 20 ? 1 : 0) # Large changeset
+ (categories_affected > 5 ? 1 : 0) # Wide blast radius
+ (has_db_migration ? 1.5 : 0) # DB migrations carry 2x weight
+ (has_api_breaking ? 1.5 : 0) # API breaks carry 2x weight
+ (has_infra_changes ? 1 : 0) # Infrastructure changes
+ (new_deps > 2 ? 0.5 : 0) # Multiple new dependencies
Cap at 10.
| Score | Level | Meaning |
|---|
| 1-3 | LOW | Routine deployment, minimal risk |
| 4-6 | MEDIUM | Proceed with caution, address warnings |
| 7-10 | HIGH | Significant risk, address all findings before deploy |
Report Template
Save to .output/prod-readiness-{source}-vs-{target}-{YYYY-MM-DD-HHmmss}.md:
# Production Deployment Readiness Report
## Summary
| Field | Value |
|-------|-------|
| **Generated** | {YYYY-MM-DD HH:mm:ss} |
| **Comparison** | {source} vs {target} |
| **Stack Detected** | {Java/Spring Boot, Node.js, Python} |
| **Files Changed** | {count} |
| **Lines Added/Removed** | +{added} / -{removed} |
| **Commits** | {count} |
| **Categories Affected** | {list} |
## Verdict: {GO / NO-GO}
**Risk Score:** {X}/10 ({LOW/MEDIUM/HIGH})
{If NO-GO: list blockers that must be resolved}
{If GO with warnings: list warnings to address}
## Findings by Category
### Configuration & Environment ({count} issues)
{findings with severity icons}
### Feature Flags ({count} issues)
{findings}
### Database Migrations ({count} issues)
{findings}
### API Contract Changes ({count} issues)
{findings}
### Dependency Changes ({count} issues)
{findings}
### Infrastructure Changes ({count} issues)
{findings}
### Security Considerations ({count} issues)
{findings}
### Operational Readiness ({count} items)
{checklist findings}
### Testing Coverage ({count} issues)
{findings}
### Documentation ({count} items)
{findings}
## Operational Checklist
{Pre-deploy, during-deploy, and post-deploy checklists tailored to findings}
{See references/operational-readiness-checks.md for full templates}
## Changed Files / Commit Log / Recommendations
{categorized file list, commit table, prioritized actions}
Quick Commands
| User Says | Your Action |
|---|
| "Check deployment readiness" | Full 10-category analysis of branch vs main |
| "Is this release ready?" | Quick GO/NO-GO with risk score |
| "Deployment risk" | Risk score calculation with top concerns |
| "Pre-deploy checklist" | Generate operational checklist for changes |
| "Check my migrations" | Database migration category deep-dive |
| "Any breaking API changes?" | API contract category deep-dive |
| "Check config parity" | Configuration & environment category deep-dive |
| "What's the deployment risk for this branch?" | Full analysis with risk emphasis |
| "Compare release tags v1.2 vs v1.3" | Tag-to-tag comparison |
| "Is it safe to deploy?" | Quick verdict with blockers only |
| "Generate deployment runbook" | Operational readiness checklist only |
References (Load When Needed)
For detailed patterns beyond the inline checks above, read these references:
references/config-environment-checks.md — Env vars, profiles, secrets, config parity
references/database-migration-checks.md — Ordering, rollback, destructive ops, locking
references/api-contract-checks.md — Breaking changes, versioning, consumer impact
references/feature-flag-checks.md — Flag states, dead flags, rollout strategy
references/dependency-checks.md — Major bumps, CVEs, lock file drift
references/infrastructure-checks.md — Docker, k8s, CI/CD, Terraform
references/security-deployment-checks.md — Auth changes, CORS, CSP, secrets exposure
references/operational-readiness-checks.md — Monitoring, alerts, runbooks, rollback plan
references/testing-coverage-checks.md — New code without tests, skipped tests
references/stack-specific-patterns.md — Java/Spring, Node.js, Python detection