/diagnose — Strict Diagnostic Protocol
No code edits until Gate 4 passes. No "try this and see." No speculative fixes. If you catch yourself reaching for Edit/Write before the user approves a hypothesis, stop.
Gate 1 — State the Error
Write one sentence: what is actually broken, and how do we know?
- Exact error message (copy-paste, not paraphrase)
- Command that triggered it, or symptom observed
- Expected vs actual behavior
If any of the above is missing, ASK the user. Do not guess.
Gate 2 — Gather Evidence
Pull all three before forming hypotheses:
- Logs — relevant log file, stderr, stack trace, recent entries
- Environment — relevant env vars, service state, versions, ports, locks
- Recent changes —
git log --oneline -20, git diff HEAD~1, recently modified files
Cite the evidence inline. If a source is unavailable, say so explicitly.
Gate 3 — Three Ranked Hypotheses
List exactly three hypotheses, ranked by likelihood. For each:
- Hypothesis — one sentence
- Supporting evidence — which Gate 2 finding points here
- Disproving evidence — what would rule it out
- Proposed fix — one or two lines, no code yet
Rank them #1, #2, #3. State your confidence in #1 (low/medium/high).
Gate 4 — Get Approval
End with: "Which hypothesis do you want me to act on? I will not edit code until you confirm."
Then STOP. Wait for the user. Do not proceed to Edit/Write/Bash-that-modifies-state on speculation.
Hard Rules
- No fixes in Gates 1-3. Read-only tools only (Read, Grep, Glob, Bash for logs/git/status).
- No "let me just try X" — that's a hypothesis, put it in Gate 3.
- If the user pushes for speed, remind them: this protocol exists because skipping it wastes more time than it saves.
- If evidence contradicts all three hypotheses, loop back to Gate 2 — do not invent a fourth to save face.
1---2name: diagnose3description: Strict 4-gate diagnostic protocol for bugs, failures, and broken pipelines. Forces stating the error, gathering logs/env/recent-changes, listing 3 ranked hypotheses, and getting explicit user approval BEFORE any code edit. Use when the user reports a bug, something is broken, a test is failing, a service is down, or says "diagnose X", "what's wrong with X", "why is X failing", "/diagnose".4---56# /diagnose — Strict Diagnostic Protocol78**No code edits until Gate 4 passes.** No "try this and see." No speculative fixes. If you catch yourself reaching for Edit/Write before the user approves a hypothesis, stop.910## Gate 1 — State the Error1112Write one sentence: **what is actually broken, and how do we know?**1314- Exact error message (copy-paste, not paraphrase)15- Command that triggered it, or symptom observed16- Expected vs actual behavior1718If any of the above is missing, ASK the user. Do not guess.1920## Gate 2 — Gather Evidence2122Pull all three before forming hypotheses:23241. **Logs** — relevant log file, stderr, stack trace, recent entries252. **Environment** — relevant env vars, service state, versions, ports, locks263. **Recent changes** — `git log --oneline -20`, `git diff HEAD~1`, recently modified files2728Cite the evidence inline. If a source is unavailable, say so explicitly.2930## Gate 3 — Three Ranked Hypotheses3132List exactly **three** hypotheses, ranked by likelihood. For each:3334- **Hypothesis** — one sentence35- **Supporting evidence** — which Gate 2 finding points here36- **Disproving evidence** — what would rule it out37- **Proposed fix** — one or two lines, no code yet3839Rank them #1, #2, #3. State your confidence in #1 (low/medium/high).4041## Gate 4 — Get Approval4243End with: **"Which hypothesis do you want me to act on? I will not edit code until you confirm."**4445Then STOP. Wait for the user. Do not proceed to Edit/Write/Bash-that-modifies-state on speculation.4647## Hard Rules4849- No fixes in Gates 1-3. Read-only tools only (Read, Grep, Glob, Bash for logs/git/status).50- No "let me just try X" — that's a hypothesis, put it in Gate 3.51- If the user pushes for speed, remind them: this protocol exists because skipping it wastes more time than it saves.52- If evidence contradicts all three hypotheses, loop back to Gate 2 — do not invent a fourth to save face.