deep-debug
Deep Debug Skill
Adversarial hypothesis-driven debugging. Given a bug, generate competing hypotheses across orthogonal dimensions, judge each independently (two-pass blind), run discriminating probes that falsify the weaker, fix the survivor with test-first discipline, and escalate to architectural review after 3 failed attempts. Output is a verified fix with a failing-test-now-passes proof, OR an honest termination label naming why the bug resisted a code-level fix.
Execution Model
All operations use Claude Code primitives. These contracts are non-negotiable:
- All data passed to agents via files, never inline. Evidence, hypothesis lists, probe specs, known-hypothesis IDs — all written to disk before the agent prompt. Inline data is silently truncated.
- State written before agent spawn, not after.
spawn_time_isois written to state.json before the Agent tool call. Spawn failure recordsspawn_failedstatus. Resume uses persisted state, never in-memory reconstruction. - Structured output is the contract; free-text is ignored. Every judge, probe-verdict, and validator produces machine-parseable structured lines. Coordinator reads only structured fields. Unparseable output triggers fail-safe classification (
disputed, neverrejected). Hypothesis output files MUST containSTRUCTURED_OUTPUT_START/STRUCTURED_OUTPUT_ENDmarkers; files without these markers are treated as failed. - No coordinator self-review of anything load-bearing. Hypothesis plausibility, evidence tier, rebuttal verdicts, probe winner classification — all delegated to independent agents. The coordinator orchestrates; it does not evaluate.
- Termination labels are honest. One of 7 defined labels. Never "probably fixed," never "looks right," never "no critical bugs remain." A fix is
Fixed — reproducing test now passesonly when the failing test exists, passes with the change, and the full suite is clean. - Hard ceilings are absolute.
max_cycles = 3,max_probes_per_cycle = 3,fix_attempt_count ≤ 3. Three fix attempts is evidence the hypothesis space is wrong — Phase 7 architectural escalation is mandatory, never optional.
Shared contracts: this skill inherits the four execution-model contracts (files-not-inline, state-before-agent-spawn, structured-output, independence-invariant) from _shared/execution-model-contracts.md. The items listed above are the skill-specific elaborations; the shared file is authoritative for the base contracts.
Pressure awareness: this skill applies the pressure circuit breakers from _shared/pressure-awareness.md. After 3 probes with no hypothesis falsification, regenerate the hypothesis space rather than probing a 4th time. The existing max_cycles = 3 and fix_attempt_count ≤ 3 ceilings serve as the same-approach ceiling; this contract adds the diminishing-returns check between probe cycles.