Pre-Deploy Checklist Command
Comprehensive production readiness verification before deployment. Runs automated checks for tests, types, lint, security, environment variables, database migrations, and performance. Generates a go/no-go report with clear blocking issues.
Command
/pre-deploy
Description
Runs a comprehensive checklist to verify your application is ready for production deployment. Automates every check that can be automated and provides a clear go/no-go decision with specific blocking issues highlighted.
Behavior
Checks Performed
1. Build Verification
# Does it build without errors? npm run build 2>&1 # Exit code 0 = PASS, non-zero = FAIL
2. Test Suite
# Do all tests pass? npm test 2>&1 # Check exit code and parse for failures
3. Type Safety
# TypeScript type checking npx tsc --noEmit 2>&1
4. Linting
# Code style and quality npm run lint 2>&1
5. Security Audit
# Dependency vulnerabilities npm audit --production 2>&1 # Check for critical/high severity
6. Environment Variables
# Verify all required env vars are documented # Compare .env.example with actual code usage grep -roh 'process\.env\.[A-Z_]*' src/ | sort -u
7. Database Migrations
# Check for pending migrations # Verify migration files are committed git status -- '**/migrations/**'
8. Git Status
# Clean working tree? git status --porcelain # All changes committed and pushed? git log origin/main..HEAD --oneline
9. Bundle Size (Frontend)
# Check for unexpected size increases npm run build -- --stats 2>/dev/null
10. Sensitive Files
# Ensure no secrets in the repo git ls-files | grep -iE '\.(env|pem|key|p12|pfx)$' # Should return empty
Output Format
## Pre-Deploy Report **Branch**: feat/user-auth -> main **Commits**: 5 (abc1234..def5678) **Date**: 2025-03-25 14:30 UTC ### Checklist | Check | Status | Details | |-------|--------|---------| | Build | PASS | Built in 12.3s | | Tests | PASS | 142/142 passing | | Types | PASS | 0 errors | | Lint | PASS | 0 warnings | | Security | WARN | 1 moderate vulnerability (lodash) | | Env Vars | PASS | All documented in .env.example | | Migrations | PASS | No pending migrations | | Git Status | PASS | Clean, pushed to origin | | Bundle Size | PASS | 245KB gzipped (prev: 242KB, +1.2%) | | Secrets | PASS | No sensitive files tracked | ### Decision: GO All critical checks pass. The moderate lodash vulnerability is in a dev dependency and does not affect production. ### Deployment Steps 1. Merge PR #143 to main 2. Wait for CI pipeline to complete 3. Verify staging deployment 4. Promote to production 5. Monitor error rates for 30 minutes
Examples
# Full pre-deploy check /pre-deploy # Quick check (skip bundle analysis) /pre-deploy --quick
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.