This example shows how to document CI jobs so that failures are self-explanatory. Each job links back to why it exists and how to fix common failures.
Why this exists: Per post-mortem 2025-12-25_migration-ordering-failure.md:
Two migrations were out of order. Prisma replays migrations into a shadow
DB, so the history could not be applied from empty.
Failure fix:
- Check migration order in
prisma/migrations/ - Ensure drops come AFTER backfills (two-step pattern)
- If history is broken, consider baseline recovery
Every CI job should answer three questions:
- What does this check?
- Why does this check exist? (link to the post-mortem or decision trace)
- How do you fix it when it fails?
When CI fails at 2am, the spec tells you exactly what to do. No archaeology required.