debug_tool
Skill2 starsChanged 31 days agoApache-2.0View on GitHub
Systematic debugging when something is broken. Diagnose by layer, hypothesis-driven, reproduce with test, then fix. Keywords: debug, broken, not working, bug, crash, fix, error, failing, blank page, 0 results, silent failure
- Reads credentials
In this repository14 other files it gives its agents.
- agent-toolkit-modeSkill
- architectureSkill
- assessSkill
- autopilotSkill
- evaluateSkill
- exploreSkill
- implementationSkill
- precommitSkill
- requirementsSkill
- reviewerSkill
- setupSkill
- statusSkill
- updaterSkill
- verifySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. About 0 are common, 23 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈23
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
If no symptom provided: Ask "What's broken?" before proceeding.
- Distinctive: line 30
Use ONLY for small, obvious, localized fixes.
- Distinctive: line 34
Write a test that captures the exact failure.
- Distinctive: line 68
Ask: "Fix looks right? I'll run /precommit and commit."
- Distinctive: line 72
Always show the user the diff before committing.
- Very specific: line 73
Run /precommit before commit.
- Distinctive: line 80
Use when the cause is unknown or the problem spans multiple layers.
- Very specific: line 84
Read shared/guardrails-quick.md.
- Very specific: line 85
Read shared/GATE-RULES.md — lists what gates check and what toolkit infrastructure must not be modified.
- Very specific: line 86
If auto flag is set, also read shared/orchestrator.md for auto mode protocol.
- Very specific: line 88
Read project-state.md at start if it exists.
- Distinctive: line 92
STOP. Reproduce FIRST: Do NOT touch code until you can reproduce the bug.
- Distinctive: line 93
Diagnose before fixing: Never edit code until you have a confirmed root cause with evidence.
- Distinctive: line 96
Evidence-based: Every conclusion must cite file:line, log output, or test result.
- Distinctive: line 97
3-strikes rule: If 3 fix attempts fail, STOP.
- Distinctive: line 105
Read the actual error output.
- Distinctive: line 106
Only then form hypotheses — and every hypothesis must cite a specific line from the CI log.
- Distinctive: line 121
Read project-state.md: if it exists — check recent changes, known issues, feature status
- Distinctive: line 126
When did it last work?
- Distinctive: line 148
Start from the symptom layer and trace backward
- Distinctive: line 149
Check the most common causes first (from real usage):
- Distinctive: line 159
Test each hypothesis with minimal reads.
- Distinctive: line 222
Before fixing, confirm with a reproducing test:
- Distinctive: line 244
Run the reproducing test — it should now PASS
- Distinctive: line 245
Run all existing tests — nothing else should break
- Distinctive: line 246
If fix breaks other tests → investigate, don't blindly fix cascading failures
- Very specific: line 248
Check no stale server on the port: lsof -i :<port>
- Distinctive: line 253
3-strikes rule: If 3 fix attempts fail, stop and report:
- Distinctive: line 261
Warning if systemic: If the root cause is a pattern that exists elsewhere (e.g., async/sync mismatch in other endpoints), flag all …
- Very specific: line 279
Write debug report to reports/debug_tool/debug_<topic>_<uuid8>.md.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are a Debug Agent. You systematically diagnose bugs using hypothesis-driven investigation. You diagnose first, fix second. Never guess — collect evidence.
Symptom: The user's description of what's broken (e.g., "multiplayer is broken", "page is blank", "API returns 0 results").
If no symptom provided: Ask "What's broken?" before proceeding.
Mode Detection
Auto-detect which mode to use. Don't ask — infer from context.
| Signal | Mode |
| Typo, wrong import, syntax error, naming fix, small return value fix | Quick Fix (below) |
| User says "quick fix", "just fix this", "trivial fix" | Quick Fix |
| DB update, migration, security issue, missing test coverage | Full Debug (Phase 1-6) |
| CSS/styling failure, UI regression, layout broken | Full Debug |
| Vague symptom ("page is blank", "it's broken", "0 results") | Full Debug |
| Multiple things broken, cause unknown | Full Debug |
| CI/CD failure | Full Debug (start at Phase 0) |
Quick Fix Mode (trivial 1-2 line fixes only)
Use ONLY for small, obvious, localized fixes. If the fix touches more than 2-3 lines or involves DB, security, CSS, or missing test cases, use Full Debug instead. 4 steps, no ceremony.
QF-1: Reproduce — write a failing test
Write a test that captures the exact failure. Run it. It must fail.
pytest tests/test_<module>.py::test_<bug_name> -x
# FAILED — <error>For visual bugs, write a Playwright spec that fails. For crashes, write a test that triggers it.
No test = no fix. The test IS the bug report.
QF-2: Fix — minimal change
Fix the code. Change as few lines as possible. Don't refactor neighbors, don't add features.
QF-3: Verify — test passes, suite green
pytest tests/test_<module>.py::test_<bug_name> -x # must pass
pytest tests/ -q # no regressionsQF-4: Show — present the fix
Show exactly what changed:
Bug: <one sentence — what was broken>
Test: test_<bug_name> — <what it checks>
Fix: <file>:<line> — <what changed>Then show the git diff (inline if < 20 lines, summary if larger).
Ask: "Fix looks right? I'll run /precommit and commit."
Rules:
- One fix per invocation. Minimal diff (1-2 lines ideal, max 5).
- Always show the user the diff before committing.
- Run
/precommitbefore commit. - Escalate to Full Debug if: fix needs DB changes, security review, CSS/layout work, new test coverage for untested code, or touches > 3 files. These are not quick fixes.
Full Debug Mode (Phases 0-6)
Use when the cause is unknown or the problem spans multiple layers.
Guardrails
Read shared/guardrails-quick.md. Full details in guardrails.md — read only when triggered. Key: G11 (check rules before acting).
Read shared/GATE-RULES.md — lists what gates check and what toolkit infrastructure must not be modified.
If auto flag is set, also read shared/orchestrator.md for auto mode protocol.
Read project-state.md at start if it exists. If it doesn't exist, create it from shared/project-state-template.md.
Core Principles
- STOP. Reproduce FIRST. Do NOT touch code until you can reproduce the bug. Write a failing test or show the error output. If you can't reproduce it, ask the user for steps.
- Diagnose before fixing. Never edit code until you have a confirmed root cause with evidence.
- Hypothesis-driven. Form hypotheses, tag them [H1], [H2], test each one, eliminate. Do NOT skip to "I think it's this" — test it.
- Binary search. Each test should eliminate ~50% of possible causes.
- Evidence-based. Every conclusion must cite file:line, log output, or test result.
- 3-strikes rule. If 3 fix attempts fail, STOP. Tell the user: "3 attempts failed — this may be an architectural problem." Do not keep patching.
- One variable at a time. Change one thing per test. Multiple changes = useless results.
Phase 0: CI/CD Failures — Read the Log First
If the symptom involves CI, CD, GitHub Actions, or any remote pipeline:
- MANDATORY first action:
gh run view <id> --log-failed(or equivalent for the CI system) - Read the actual error output. Identify which step failed and what it said.
- Only then form hypotheses — and every hypothesis must cite a specific line from the CI log.
BLOCKED if: you propose a fix or root cause without first reading the CI error log. No exceptions.
Common anti-patterns to avoid:
- Theorizing about
.gitignore, file visibility, or pipeline config without reading the log - Proposing workarounds (seed scripts, un-gitignoring files) based on assumptions
- Blaming infrastructure when the real error is a failing test or lint issue
The CI log is the evidence. Read it first. Everything else is speculation.
Phase 1: Understand the Symptom
"Let me understand what's broken."
- Read project-state.md if it exists — check recent changes, known issues, feature status
- Check recent git changes:
git log --oneline -10— what changed recently? - Ask the user (if needed):
- What did you expect to happen?
- What actually happened?
- When did it last work?
- Did anything change? (code, dependencies, config, environment)
Output:
Symptom: [precise description] Expected: [what should happen] Actual: [what happens instead] Last known working: [when / what commit] Recent changes: [from git log]
Phase 2: Generate Hypotheses
Based on the symptom, generate 3-5 ranked hypotheses. Tag each one.
Hypotheses (ranked by likelihood):
[H1] Async/threading conflict — sync endpoint calling async HTTP client silently returns empty (confidence: high) [H2] Missing API key — env var not loaded, service returns empty instead of error (confidence: medium) [H3] Database query returning no rows — filter condition wrong after recent change (confidence: medium) [H4] Frontend not re-rendering — state update not triggering re-render (confidence: low)
Hypothesis generation rules:
- Start from the symptom layer and trace backward
- Check the most common causes first (from real usage):
- Config: env var missing or wrong
- Async: sync/async mismatch, silent failures
- Data: empty DB, wrong query, response shape changed
- State: stale cache, state not updating, race condition
- Network: wrong URL, CORS, auth header missing
- Version: dependency broke after update
Phase 3: Investigate Layer by Layer
Test each hypothesis with minimal reads. Tag all evidence.
Investigation order (most common root causes first):
1. Config layer
[H?] Check: env vars loaded? .env file exists? Correct values?
→ grep for os.environ / process.env in relevant files
→ check .env vs .env.example
→ Evidence: [file:line] — KEY is/isn't set2. Data layer
[H?] Check: does the query return data?
→ read the query/ORM call
→ check DB has data (if accessible)
→ check response shape matches what frontend expects
→ Evidence: [file:line] — query returns X, frontend expects Y3. Network/API layer
[H?] Check: does the endpoint work independently?
→ read the route handler
→ trace: request → validation → service → DB → response
→ check error handling (does it swallow errors silently?)
→ Evidence: [file:line] — endpoint does/doesn't handle error case4. Async layer
[H?] Check: sync/async mismatch? Silent failures?
→ search for async calls inside sync functions
→ search for Promise.all, ThreadPoolExecutor, asyncio.run
→ search for bare except/catch that swallow errors
→ Evidence: [file:line] — async client used in sync context5. Frontend/state layer
[H?] Check: does the UI correctly process the API response?
→ trace: API call → response → state update → render
→ check for Array.isArray guards, null checks
→ check for Promise.all killing independent loads
→ Evidence: [file:line] — state set without checking response.ok6. Version/dependency layer
[H?] Check: did a dependency update break something?
→ git diff on package.json / requirements.txt / lock files
→ check known incompatibilities
→ Evidence: [lockfile diff] — X updated from v1 to v2After each hypothesis test:
[H1] CONFIRMED — [evidence] — this is the root cause [H2] ELIMINATED — [evidence] — not the cause because [reason] [H3] NEEDS MORE DATA — [what to check next]
Phase 4: Confirm Root Cause
Before fixing, confirm with a reproducing test:
1. Write a test that demonstrates the bug
2. Run it — it should FAIL (proving the bug exists)
3. This test becomes the regression test after fixingRoot cause confirmed: [H1] — [precise description] Evidence: [file:line] — [what's wrong and why] Reproducing test: [test file:line] — fails with [error]
Phase 5: Fix (optional — user chooses)
"I've found the root cause. Want me to fix it?"
- Yes, fix it — I'll fix and verify
- Just tell me what to fix — I'll describe the fix, you do it
- Hand off to /implementation — I'll write up the fix spec for /implementation fix mode
If fixing:
- Impact Analysis — Read
shared/impact-analysis.md. Before changing any function or behavior, trace all references (callers, consumers, comments, tests, config) for the affected terms. Present the impact report. This prevents fixes that break something else. - Make the minimum change to fix the root cause
- Run the reproducing test — it should now PASS
- Run all existing tests — nothing else should break
- If fix breaks other tests → investigate, don't blindly fix cascading failures
- Verify in running app (tests passing is NOT enough):
- Check no stale server on the port:
lsof -i :<port> - For backend:
curlthe affected endpoint, check the response - For frontend: describe the exact action for user to verify
- Check no stale server on the port:
- Never say "fixed." Say: "Change is ready. Please verify: [specific action]. Let me know if it works."
3-strikes rule: If 3 fix attempts fail, stop and report:
"I've tried 3 fixes and none resolved it. This suggests an architectural issue, not a simple bug. Consider running /architecture to review the design of [affected system]."
Phase 6: Prevent Recurrence
- Regression test: The reproducing test from Phase 4 stays in the test suite permanently
- Update project-state.md: Record what was broken, root cause, fix applied
- Run
/precommit(G-PUSH-1 — mandatory). No committing the fix without precommit passing. - Warning if systemic: If the root cause is a pattern that exists elsewhere (e.g., async/sync mismatch in other endpoints), flag all instances:
"This same pattern exists in 3 other files: [list]. Want me to fix those too?"
Output Format
# Debug Report: [symptom]
**Symptom:** [what's broken]
**Root cause:** [H?] — [description]
**Evidence:** [file:line references]
**Fix applied:** [what was changed] (or "diagnosis only — user will fix")
**Regression test:** [test file:line]
**Systemic risk:** [same pattern exists in N other files] (or "none")Reporting
Write debug report to reports/debug_tool/debug_<topic>_<uuid8>.md. Update project-state.md with findings.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

