Walkthrough

Shipping to Production

Pre-deploy checks, the migration script, the rollback plan.

Production deploys are the riskiest moment in the loop. Use the agent as a checklist enforcer: it verifies tests, types, lint, migrations, env vars, and prepares the rollback before you press the button.

Steps · 0 / 3 done
  1. Run the pre-deploy gauntlet

    Tests, types, lint, build — all four green before anything touches prod.

    Run npm test, tsc --noEmit, npm run lint, and npm run build. Stop at the first red. Don't suggest fixes — just report.
    VerifyEither all four pass, or you get a precise failure to triage.
  2. Inspect the migration

    Have the agent read the migration that's about to run, summarize what it changes, and flag any non-reversible operations.

    Read migrations/2026_05_15_orders_total.sql. Summarize what it does. Flag anything that's not reversible by a simple `down` script.
    VerifyYou get a 1-paragraph summary plus an explicit list of irreversible ops (DROPs, NOT NULL on backfilled columns, etc.).
  3. Draft the rollback plan

    Before deploying, have the agent write the rollback steps you'll run if something breaks.

    Draft the rollback plan for this deploy: how to revert app code, how to revert the migration, who to ping. Save to docs/rollbacks/2026-05-15.md.
    VerifyA markdown file exists with the rollback steps before you deploy. Future you will thank present you.
Check your understanding
Q1. Why draft the rollback plan *before* deploying instead of after a problem?
· Tick off the 3 step(s) above.
· Score 100% on the quiz.