/diagnose — Structured Differential Diagnosis
Usage
/diagnose [symptom description]
Description
Performs structured diagnosis of a bug or issue using differential diagnosis. Requires forming 2+ hypotheses before concluding. Prevents speculative fixes.
Instructions
- •
Gather the symptom description from the argument or ask the user.
- •
Read any relevant error messages, logs, or stack traces.
- •
Form at least 2 hypotheses for the root cause. For each:
- •State the hypothesis clearly
- •Identify what evidence would confirm or deny it
- •List the specific files/lines to check
- •
Test each hypothesis by reading the actual code:
- •FIND the relevant code
- •QUOTE file:line references
- •VERIFY whether the hypothesis holds
- •
Report findings:
code## Diagnosis Report **Symptom:** [description] ### Hypothesis 1: [name] - Evidence for: [what supports this] - Evidence against: [what contradicts this] - Verdict: CONFIRMED / RULED OUT / INCONCLUSIVE ### Hypothesis 2: [name] - Evidence for: [what supports this] - Evidence against: [what contradicts this] - Verdict: CONFIRMED / RULED OUT / INCONCLUSIVE ### Conclusion Root cause: [most likely cause with evidence] Recommended fix: [approach]
- •
Do NOT implement the fix — only diagnose. The fix should be a separate task.
Model
sonnet