production-readiness
Comprehensive pre-deployment validation ensuring code is production-ready. Runs complete audit pipeline, performance benchmarks, security scan, documentation check, and generates deployment checklist.
What this skill does
# Production Readiness
## Purpose
Comprehensive pre-deployment validation to ensure code is production-ready.
## Specialist Agent
I am a production readiness specialist ensuring deployment safety.
**Methodology** (Deployment Gate Pattern):
1. Complete quality audit (theater → functionality → style)
2. Security deep-dive (vulnerabilities, secrets, unsafe patterns)
3. Performance benchmarking (load testing, bottlenecks)
4. Documentation validation (README, API docs, deployment docs)
5. Dependency audit (outdated, vulnerable packages)
6. Configuration check (environment variables, secrets management)
7. Monitoring setup (logging, metrics, alerts)
8. Rollback plan verification
9. Generate deployment checklist
10. Final go/no-go decision
**Quality Gates** (all must pass):
- ✅ All tests passing (100%)
- ✅ Code quality ≥ 85/100
- ✅ Test coverage ≥ 80%
- ✅ Zero critical security issues
- ✅ Zero high-severity bugs
- ✅ Performance within SLAs
- ✅ Documentation complete
- ✅ Rollback plan documented
## Input Contract
```yaml
input:
target_path: string (directory to validate, required)
environment: enum[staging, production] (default: production)
skip_performance: boolean (default: false)
strict_mode: boolean (default: true)
```
## Output Contract
```yaml
output:
ready_for_deployment: boolean
quality_gates: object
tests_passing: boolean
code_quality: number
test_coverage: number
security_clean: boolean
performance_ok: boolean
docs_complete: boolean
blocking_issues: array[issue]
warnings: array[warning]
deployment_checklist: array[task]
rollback_plan: markdown
```
## Execution Flow
```bash
#!/bin/bash
set -e
TARGET_PATH="${1:-./}"
ENVIRONMENT="${2:-production}"
SKIP_PERFORMANCE="${3:-false}"
READINESS_DIR="production-readiness-$(date +%s)"
mkdir -p "$READINESS_DIR"
echo "================================================================"
echo "Production Readiness Check"
echo "Environment: $ENVIRONMENT"
echo "================================================================"
# Initialize quality gates
declare -A GATES
GATES[tests]=0
GATES[quality]=0
GATES[coverage]=0
GATES[security]=0
GATES[performance]=0
GATES[docs]=0
# GATE 1: Complete Quality Audit
echo "[1/10] Running complete quality audit..."
npx claude-flow audit-pipeline "$TARGET_PATH" \
--phase all \
--model codex-auto \
--output "$READINESS_DIR/quality-audit.json"
# Check tests
TESTS_PASSED=$(cat "$READINESS_DIR/quality-audit.json" | jq '.functionality_audit.all_passed')
if [ "$TESTS_PASSED" = "true" ]; then
GATES[tests]=1
echo "✅ GATE 1: Tests passing"
else
echo "❌ GATE 1: Tests failing"
fi
# Check code quality
QUALITY_SCORE=$(cat "$READINESS_DIR/quality-audit.json" | jq '.style_audit.quality_score')
if [ "$QUALITY_SCORE" -ge 85 ]; then
GATES[quality]=1
echo "✅ GATE 2: Code quality $QUALITY_SCORE/100"
else
echo "❌ GATE 2: Code quality too low: $QUALITY_SCORE/100 (need ≥85)"
fi
# Check test coverage
TEST_COVERAGE=$(cat "$READINESS_DIR/quality-audit.json" | jq '.functionality_audit.coverage_percent')
if [ "$TEST_COVERAGE" -ge 80 ]; then
GATES[coverage]=1
echo "✅ GATE 3: Test coverage $TEST_COVERAGE%"
else
echo "❌ GATE 3: Test coverage too low: $TEST_COVERAGE% (need ≥80%)"
fi
# GATE 2: Security Deep-Dive
echo "[2/10] Running security deep-dive..."
npx claude-flow security-scan "$TARGET_PATH" \
--deep true \
--check-secrets true \
--check-dependencies true \
--output "$READINESS_DIR/security-scan.json"
CRITICAL_SECURITY=$(cat "$READINESS_DIR/security-scan.json" | jq '.critical_issues')
HIGH_SECURITY=$(cat "$READINESS_DIR/security-scan.json" | jq '.high_issues')
if [ "$CRITICAL_SECURITY" -eq 0 ] && [ "$HIGH_SECURITY" -eq 0 ]; then
GATES[security]=1
echo "✅ GATE 4: Security scan clean"
else
echo "❌ GATE 4: Security issues found (Critical: $CRITICAL_SECURITY, High: $HIGH_SECURITY)"
fi
# GATE 3: Performance Benchmarking
if [ "$SKIP_PERFORMANCE" != "true" ]; then
echo "[3/10] Running performance benchmarks..."
# Baseline performance
npx claude-flow analysis performance-report \
--detailed true \
--export "$READINESS_DIR/performance-baseline.json"
# Bottleneck detection
npx claude-flow bottleneck detect \
--threshold 10 \
--export "$READINESS_DIR/bottlenecks.json"
# Check SLA compliance
AVG_RESPONSE_TIME=$(cat "$READINESS_DIR/performance-baseline.json" | jq '.avg_response_time')
P95_RESPONSE_TIME=$(cat "$READINESS_DIR/performance-baseline.json" | jq '.p95_response_time')
# SLAs: avg < 200ms, p95 < 500ms
if [ "$AVG_RESPONSE_TIME" -lt 200 ] && [ "$P95_RESPONSE_TIME" -lt 500 ]; then
GATES[performance]=1
echo "✅ GATE 5: Performance within SLAs"
else
echo "❌ GATE 5: Performance exceeds SLAs (avg: ${AVG_RESPONSE_TIME}ms, p95: ${P95_RESPONSE_TIME}ms)"
fi
else
echo "[3/10] Skipping performance benchmarks (--skip-performance)"
GATES[performance]=1 # Pass if skipped
fi
# GATE 4: Documentation Validation
echo "[4/10] Validating documentation..."
# Check for required docs
DOCS_COMPLETE=true
if [ ! -f "README.md" ]; then
echo "⚠️ Missing README.md"
DOCS_COMPLETE=false
fi
if [ ! -f "docs/deployment.md" ] && [ ! -f "DEPLOYMENT.md" ]; then
echo "⚠️ Missing deployment documentation"
DOCS_COMPLETE=false
fi
if [ "$ENVIRONMENT" = "production" ]; then
if [ ! -f "docs/rollback.md" ] && [ ! -f "ROLLBACK.md" ]; then
echo "⚠️ Missing rollback plan"
DOCS_COMPLETE=false
fi
fi
if [ "$DOCS_COMPLETE" = "true" ]; then
GATES[docs]=1
echo "✅ GATE 6: Documentation complete"
else
echo "❌ GATE 6: Documentation incomplete"
fi
# GATE 5: Dependency Audit
echo "[5/10] Auditing dependencies..."
if command -v npm &> /dev/null && [ -f "package.json" ]; then
npm audit --json > "$READINESS_DIR/npm-audit.json" 2>&1 || true
VULNERABLE_DEPS=$(cat "$READINESS_DIR/npm-audit.json" | jq '.metadata.vulnerabilities.high + .metadata.vulnerabilities.critical')
if [ "$VULNERABLE_DEPS" -gt 0 ]; then
echo "⚠️ Found $VULNERABLE_DEPS vulnerable dependencies"
else
echo "✅ No vulnerable dependencies"
fi
fi
# GATE 6: Configuration Check
echo "[6/10] Checking configuration..."
# Check for .env.example
if [ ! -f ".env.example" ] && [ -f ".env" ]; then
echo "⚠️ Missing .env.example file"
fi
# Check for hardcoded secrets
echo "Scanning for hardcoded secrets..."
grep -r "api_key\|password\|secret\|token" "$TARGET_PATH" --include="*.js" --include="*.ts" \
| grep -v "test" | grep -v "example" || echo "✅ No obvious hardcoded secrets"
# GATE 7: Monitoring Setup
echo "[7/10] Validating monitoring setup..."
# Check for logging
if grep -r "logger\|console.log\|winston\|pino" "$TARGET_PATH" --include="*.js" --include="*.ts" > /dev/null; then
echo "✅ Logging detected"
else
echo "⚠️ No logging framework detected"
fi
# GATE 8: Error Handling
echo "[8/10] Checking error handling..."
# Check for try-catch blocks
TRYCATCH_COUNT=$(grep -r "try {" "$TARGET_PATH" --include="*.js" --include="*.ts" | wc -l)
echo "Found $TRYCATCH_COUNT try-catch blocks"
# GATE 9: Load Testing (if not skipped)
if [ "$SKIP_PERFORMANCE" != "true" ] && [ "$ENVIRONMENT" = "production" ]; then
echo "[9/10] Running load tests..."
# Placeholder for load testing
echo "⚠️ Manual load testing required"
else
echo "[9/10] Skipping load tests"
fi
# GATE 10: Generate Deployment Checklist
echo "[10/10] Generating deployment checklist..."
cat > "$READINESS_DIR/DEPLOYMENT-CHECKLIST.md" <<EOF
# Deployment Checklist: $ENVIRONMENT
**Generated**: $(date -Iseconds)
## Quality Gates Status
| Gate | Status | Score/Details |
|------|--------|---------------|
| Tests Passing | $([ ${GATES[tests]} -eq 1 ] && echo "✅" || echo "❌") | $([ "$TESTS_PASSED" = "true" ] && echo "All tests passing" || echo "Tests failing") |
| Code Quality | $([ ${GATES[quality]} -eq 1 ] && echo "✅" || echo "❌") | $QUALITY_SCORE/100 (need ≥85) |
| Test Coverage | $([ ${GATES[coverage]} -eq 1 ] && echo "✅" || echo "❌") | $TEST_CRelated in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.