Debugging Prompt — the Investigation Contract
"Fix this error" gets guesses. The investigation contract gets a ten-stage diagnosis: facts separated from assumptions, alternatives weighed, fixes justified.
Stabilize, then diagnose: impact first, rollback options before intervention, timeline from the deploy history — forensic discipline under fire.
Production incidents punish improvisation twice: once in the outage, once in the confused retelling. This setup runs the incident strategy under forensic mode on an ongoing checkout outage: impact assessment and containment explicitly ordered before root cause, rollback options reviewed before any intervention, the timeline established from deployment history and the symptom window, monitoring gaps recorded as findings — and recovery verified in monitoring, not in the absence of complaints. The incident checklist covers the usual suspects: deploys, infrastructure changes, dependency outages.
Impact before cause
Who is affected, how badly, is it ongoing — the contract refuses to theorize before the blast radius is known.
Check rollback first
The fastest fix is often reverting — the contract requires knowing the rollback options before trying anything cleverer.
Verify recovery in monitoring
Error rates at baseline on the dashboards — silence from customers is not a recovery signal.
The SYSTEM CONTEXT orders it deliberately: 'Assess customer impact first' and 'Review rollback options before any intervention' both precede diagnosis, on the logic that 'a controlled degradation beats an uncontrolled outage.' So the prompt scopes severity and reversibility of the checkout outage before theorizing about the payments-gateway timeouts. You still decide whether to roll back or hold.
Under the EVIDENCE RULES it is a HYPOTHESIS, a testable causal claim that ships with its test. The log line '14:06:02 WARN connection pool exhausted pool=payments size=50' is a FACT, but 'the pool caused the 40% failures' stays a HYPOTHESIS until validated. The generated prompt enforces these labels; the assistant you run it in fills them.
Not from customer silence alone. The POST-FIX VERIFICATION section wants error rates back at baseline (under 1%) on the dashboards, checks for regressions in the paths the fix touched, and asks you to state an observation window before declaring resolution. The prompt structures that check; your monitoring confirms recovery, since NewPrompt doesn't watch your dashboards.
"Fix this error" gets guesses. The investigation contract gets a ten-stage diagnosis: facts separated from assumptions, alternatives weighed, fixes justified.
An exception is a symptom, not a diagnosis: trace from the throw site back to the root trigger, with the runtime checklist on the table.
Measure before reasoning: find WHERE the time goes, separate latency from memory from throughput, and think at production scale.
"Review this code" gets shallow comments. The review contract gets findings with severities, a checklist, and a verdict.
getByRole over CSS chains, auto-wait over sleep, web-first assertions — Playwright tests written the way Playwright wants.
"Refactor this code" invites silent behavior changes. The refactoring contract preserves business rules, outputs, and side effects — and flags uncertainty instead of deciding it.
Build debugging prompts from symptoms, environment, and reproduction steps — root cause first, fix second.
Work a live production incident in the right order — triage and stabilize first, then find the cause, then write the summary and postmortem — so the fire is out before the writeup begins.