Pre-deployment validation for $ARGUMENTS environment:
- Tests: Run full test suite — all must pass
- Git status: Check for uncommitted changes across all repos
- Schema sync: Verify Prisma schema matches expectations
- Secrets check: Scan for hardcoded credentials, API keys, passwords
- Dev artifacts: Check for console.log, debugger statements, TODO/FIXME in production paths
- Env vars: Verify required environment variables are documented
- Auth coverage: Validate all API endpoints have auth middleware
- Dependency audit: Run
npm auditoryarn audit(detect from lockfile). Classify: CRITICAL/HIGH (action required) vs MODERATE/LOW (note). Separate production vs dev-only vulnerabilities. Check for auto-fixable with--dry-run. - Build: Verify project builds without errors
- Migration safety: Check if any Prisma models are missing (tables would be dropped)
If argument is "audit" → run only step 8 (dependency vulnerability scan) across the current project.
GO/NO-GO Criteria
- NO-GO: Any test failure, hardcoded secret found, Prisma model missing, build failure, or CRITICAL/HIGH vulnerability in production deps
- GO: All steps pass. MODERATE/LOW vulnerabilities in dev-only deps are acceptable with note.
- GO with warnings: All critical steps pass but non-blocking issues exist (dev-only vulns, TODO items in non-critical paths)
Output: GO / NO-GO status with detailed checklist results.