---
name: diagnose
description: "Run a 6-phase scientific root-cause loop (observable signal -> delta-minimize -> ranked falsifiable hypotheses -> publish-before-probing -> structural fix -> verify) plus rigorous audit of numbers, metrics, projections, and benchmarks."
---
# Diagnose
## Mandate
Demand 100x causal accuracy. Guessing a root cause and patching symptoms guarantees recurring failure, whether debugging software, diagnosing why a startup funnel leaks, untangling a recurring family blowup, or dismantling a suspect projection. Ground this skill in the Problem-Solver Kernel (`references/KERNEL.md`) and `references/principles/attack-the-premise.md`: NEVER theorize before locking a repeatable observation signal, and treat any unverified number as a rumor.
## Entry Gate
1. Check lazily for `GLOSSARY.md`, `DECISIONS.md`, and `STATE.md`.
2. Route clean sub-mode:
- **Root-Cause Failure Diagnosis:** Follow the 6-phase loop below.
- **Number / Metric / Claim Audit:** Read `references/NUMBER-AUDIT.md` and run all 7 questions with observed evidence.
3. **HARD GATE P1 -> P2:** Never hypothesize, prescribe fixes, or explain why something failed before establishing a fast, observable, falsifiable signal in Phase 1.
## AI Responsibilities
The AI runs strict scientific discipline so confirmation bias and sloppy intuition cannot hijack investigation:
- Redact secrets/PII (`<REDACTED>`) before logging any diagnostic trace.
- Force **delta-minimization**: strip unrelated context systematically until only causal variables remain.
- Generate **3-5 competing, ranked, falsifiable hypotheses** and show them BEFORE testing so hindsight cannot rewrite predictions.
- Apply `references/principles/attack-the-premise.md` automatically after 2 failed attempts sharing one assumption.
- Refuse to leave diagnostic clutter behind once verification finishes.
## Protocol
1. **P1 (Build Observable Signal, Hard Gate):**
Establish a repeatable signal showing the failure/symptom clearly (test, CLI command, data slice, controlled comparison, exact behavioral trigger, or structured human-in-the-loop capture). If rare/flaky, increase sample size or amplify stress until signal separates from noise.
2. **P2 (Reproduce & Delta-Minimize):**
Confirm the exact reported symptom first. Remove one element/variable/assumption at a time until every remaining piece is load-bearing for reproducing the problem.
3. **P3 (Hypothesize, 3-5 Ranked Falsifiable Claims):**
State 3-5 ranked explanations strictly formatted as:
`"Hypothesis N: If X is the cause, changing Y eliminates the symptom AND changing Z worsens it."`
Discard vague stories without discriminating predictions. Expose the ranking before running probes.
4. **P4 (Publish-Before-Probing, One Variable at a Time):**
State the expected outcome *before* executing each probe. Test ONE variable per probe; record observed result immediately (never backfill narratives). If diagnosing numbers/stats, execute `references/NUMBER-AUDIT.md`.
5. **P5 (Structural Root Fix, Not Symptom Patch):**
Fix the underlying mechanism. If preventing recurrence permanently requires an architecture, process, or relationship boundary that does not exist yet, flag the **missing structural seam** explicitly as a finding instead of bolting on band-aids.
6. **P6 (Clean & Re-Verify on Full Un-Minimized Case):**
Remove temporary instrumentation/probes, verify the fix holds on the full un-minimized real scenario against independent proof, and record the root-cause lesson if durable.
## Output Contract
```markdown
## Diagnosis Report
- **P1 Signal (Verified):** <exact repeatable check/observation + output>
- **P2 Minimal Load-Bearing Case:** <smallest conditions reproducing symptom>
- **P3-P4 Hypothesis Trace:**
1. `<Hypothesis>` -> Probe: `<test>` -> Observed: `<CONFIRMED | FALSIFIED>`
- **P5 Root Cause & Fix:** <mechanism + structural seam finding if any>
- **P6 Full-Case Verification:** <post-fix observation at original scale; clean state confirmed>
```
## Failure and Exit Criteria
- **DONE:** Signal established before hypothesizing, hypotheses tested one variable at a time, root mechanism fixed or structurally isolated, and un-minimized case verified clean.
- **BLOCKED:** Symptom cannot be observed or reproduced by AI tools; hand exact minimal field-observation steps via `ask-others`.
- **Self-Rejection Trap:** Automatically reject if you jumped to your favorite fix on turn 1, tested three variables simultaneously, accepted a hypothesis without a falsifying test, or reported a performance/metric number without running `references/NUMBER-AUDIT.md`.