agents/skills/debug/SKILL.md
Multi-agent competing hypotheses debugging. Use when stuck on a bug, need root cause analysis, or want competing debug theories.
npx skillsauth add drn/dots debugInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Spawn multiple investigators to debug a problem in parallel. Each pursues a different theory and they argue with each other to converge on the root cause.
Agent teams must be enabled in Claude Code settings:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
If agent teams are not enabled, report: "Agent teams required. Add CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 to your Claude Code settings (env section)." and stop.
$ARGUMENTS - Required: description of the bug, failing test, error message, or unexpected behaviorIf no arguments are provided, ask the user what they're debugging.
git branch --show-currentgit status --shortpwdfind . -maxdepth 1 \( -name go.mod -o -name Gemfile -o -name package.json -o -name Cargo.toml -o -name pyproject.toml -o -name setup.py -o -name requirements.txt -o -name pom.xml -o -name build.gradle -o -name Makefile \) 2>/dev/null | head -5git log --oneline -10find . -maxdepth 4 -name "*_test.*" -o -name "*.test.*" -o -name "*_spec.*" 2>/dev/null | head -10You are the lead investigator coordinating a debugging team. Your job is to formulate hypotheses, assign them to investigators, moderate the debate, and produce a root cause analysis.
Problem to debug: $ARGUMENTS
You do NOT investigate yourself. You formulate hypotheses, assign them, moderate debate, and synthesize findings.
Why this works: A single agent investigating a bug tends to anchor on the first plausible explanation. Multiple agents pursuing different theories in parallel, then actively trying to disprove each other, surface the actual root cause faster.
Clean working tree: If there are uncommitted changes, commit them with message "WIP: pre-debug-session state" before proceeding.
Analyze the problem from $ARGUMENTS and the context above.
Formulate 3 hypotheses for what might be causing the bug. Each hypothesis should be:
Present the hypotheses to the user before proceeding.
Create the team (clean up stale session first if needed):
TeamDelete() -- ignore if no existing team
TeamCreate(team_name: "debug-session", description: "Debug: {brief problem summary}")
Create the task list with TaskCreate:
Spawn 3 investigators in a single message with 3 Task tool calls. Use the agent briefing below. Use model: "sonnet" for all investigators.
Send each investigator their assignment via SendMessage:
PROBLEM: {full problem description from $ARGUMENTS}
YOUR HYPOTHESIS: {the specific hypothesis assigned to this investigator}
OTHER HYPOTHESES BEING INVESTIGATED:
- investigator-1: {hypothesis 1}
- investigator-2: {hypothesis 2}
- investigator-3: {hypothesis 3}
INSTRUCTIONS:
1. Explore the codebase to gather evidence FOR your hypothesis.
2. Also look for evidence AGAINST your hypothesis -- be honest.
3. Try to reproduce the bug if possible.
4. Check git history for recent changes related to your hypothesis.
5. When you have findings, share them with ALL other investigators:
- Message each investigator directly with your evidence.
- Explain what you found and how it supports or undermines your theory.
6. Read and respond to other investigators' findings:
- If their evidence contradicts your hypothesis, acknowledge it.
- If you can poke holes in their theory, do so with evidence.
- If you become convinced another hypothesis is correct, say so.
After investigation and debate, message me (the lead) with:
- Your verdict: CONFIRMED, DISPROVED, or INCONCLUSIVE
- Key evidence (file paths, line numbers, reproduction steps)
- Whether you now support a different hypothesis
Mark your task as completed.
Wait for all investigators to report. Allow time for peer debate -- don't rush this phase.
Collect all reports and assess:
IF investigators converged on a single root cause:
→ Proceed to Phase 3 with that cause
IF two or more theories remain plausible:
→ Send a tiebreaker prompt (see below)
IF all hypotheses disproved:
→ Formulate new hypotheses based on evidence gathered, return to Phase 1
(max 2 total rounds)
We have competing theories. Let's settle this.
REMAINING HYPOTHESES:
{list the hypotheses still standing with evidence for each}
INSTRUCTIONS:
1. Design a SPECIFIC test that would distinguish between these theories.
(e.g., "If hypothesis A is correct, then X should happen when we do Y.
If hypothesis B is correct, Z should happen instead.")
2. Run that test or trace through the code to determine the outcome.
3. Share your results with all other investigators.
4. Message me with your final verdict.
Wait for convergence.
Once the root cause is identified:
Create fix tasks:
Send fix request to the assigned investigator:
ROOT CAUSE CONFIRMED: {description}
Implement a fix. Keep it minimal -- fix the bug, nothing more.
Run any related tests to verify.
When done, message me with your changes.
{investigator name} is implementing a fix for: {root cause}
Once they finish, review their fix:
- Does it actually address the root cause?
- Could it introduce new issues?
- Run the relevant tests to confirm.
Message me with your verification results.
{investigator name} is implementing a fix for: {root cause}
Once they finish, check for broader regressions:
- Run the full test suite (not just the targeted tests).
- Look for any code that depends on the behavior being changed.
- Check if similar patterns exist elsewhere that might have the same bug.
Message me with your regression analysis.
Wait for all three to complete.
Shut down all investigators:
For each investigator:
SendMessage(type: "shutdown_request", recipient: {name}, content: "Investigation complete.")
Wait for confirmations.
Clean up the team with TeamDelete.
Produce the investigation report:
## Debug Report
### Problem
{original problem description}
### Root Cause
{1-2 sentences explaining the root cause}
### Investigation
| Hypothesis | Investigator | Verdict | Key Evidence |
|------------|-------------|---------|--------------|
| {hypothesis 1} | investigator-1 | CONFIRMED / DISPROVED | {1-line} |
| {hypothesis 2} | investigator-2 | CONFIRMED / DISPROVED | {1-line} |
| {hypothesis 3} | investigator-3 | CONFIRMED / DISPROVED | {1-line} |
### How It Was Found
{Brief narrative of how the team converged: which evidence was decisive, what disproved the wrong theories}
### Fix Applied
| File | Change | Description |
|------|--------|-------------|
| path/to/file | modified | brief description |
### Verification
- **Tests pass:** YES / NO
- **Verified by:** {investigator name}
- **Regression check:** {investigator name} -- {result}
- **Regression risk:** {low/medium/high with explanation}
### Diff
{git diff --stat output}
When spawning investigators in Phase 0, use this prompt for all 3:
You are an INVESTIGATOR on a debugging team. You find root causes.
YOUR TEAMMATES:
- Lead: assigns hypotheses, moderates debate, synthesizes findings.
- Other investigators: pursuing different theories. You DEBATE with them.
YOUR APPROACH:
1. Gather evidence for AND against your hypothesis.
2. Share findings with other investigators via direct messages.
3. Challenge their theories with evidence. Accept challenges to yours.
4. If your theory is disproved, pivot -- help validate or disprove others.
5. Be specific: cite file paths, line numbers, and reproduction steps.
6. If you find the root cause, you may be asked to implement a fix, verify a fix, or check for regressions.
The goal is TRUTH, not winning. Abandon your hypothesis the moment
evidence disproves it.
Always use TaskUpdate to mark tasks completed.
| Failure | Action | |---------|--------| | Agent fails to spawn | Retry once. Proceed with 2 investigators if needed. | | All hypotheses disproved (round 1) | Formulate new hypotheses based on gathered evidence. Run a second round. | | All hypotheses disproved (round 2) | Produce report with evidence gathered. Suggest next steps for manual investigation. | | Investigators can't converge | Lead makes a judgment call based on evidence weight. Note uncertainty in report. | | Bug can't be reproduced | Document the investigation and evidence. Note reproduction difficulty in report. | | Team creation fails (teams not enabled) | Report the prerequisite and stop. |
development
Walk every unresolved review thread on a PR, triage each one, reply with a rationale of whether or not the comment will be acted upon, make the code change if warranted, and mark the thread resolved. Use when the user asks to address only the open PR comments without re-running CI, respond to review feedback, resolve review threads, or clear bot comments on a PR.
tools
Iteratively run /rereview, fix the findings, and loop until reviewers approve clean. Use for iterative automated review, when you want /rereview to loop until clean, or for a paranoid pre-merge review that auto-addresses every blocker.
development
Generate self-contained HTML visualizations with Plannotator theming. Use for implementation plans, PR explainers, architecture diagrams, data tables, slide decks, and any visual explanation of technical concepts. Plans and PR explainers follow Plannotator's prescriptive approach; all other visual content delegates to nicobailon/visual-explainer.
development
Create reviewed Codex goal setup packages for long-running /goal work. Use when the user wants to turn an idea, backlog, project mission, or vague objective into durable goal files under a project goals slug folder, with Plannotator review gates for brief, narrative plan with acceptance criteria, verification, blockers, and the final /goal prompt.