| name | debug |
| description | Systematic debugging using hypothesis-driven investigation with test, narrow, and resolve loops |
| layer | hub |
| category | workflow |
| triggers | ["/debug","debug this","why is this broken","find the bug","this is not working","something is wrong with"] |
| inputs | [{"symptom":"Description of the observed incorrect behavior"},{"expected":"What the correct behavior should be (optional but helpful)"},{"context":"Error messages, stack traces, reproduction steps, recent changes (optional)"}] |
| outputs | [{"rootCause":"Identified root cause with evidence"},{"hypothesis log":"Record of hypotheses tested and their outcomes"},{"fix recommendation":"Suggested fix (handed off to fix skill for application)"}] |
| linksTo | ["fix","scout","test","code-review"] |
| linkedFrom | ["cook","team","ship"] |
| preferredNextSkills | ["fix","test"] |
| fallbackSkills | ["scout","research"] |
| riskLevel | low |
| memoryReadPolicy | selective |
| memoryWritePolicy | selective |
| sideEffects | ["May run test commands to reproduce issues","May read many files during investigation","Produces hypothesis log in working memory"] |
Debug Skill
Purpose
Systematically find the root cause of bugs using a disciplined hypothesis-test-narrow loop. This skill treats debugging as a scientific investigation, not a guessing game.
The core principle: never change code to debug. Observe, hypothesize, test, narrow. Only hand off to fix once the root cause is identified with evidence.
Workflow
Phase 1: Symptom Analysis
-
Capture the symptom precisely
- What is the observed behavior? (exact error, incorrect output, crash, hang, etc.)
- What is the expected behavior?
- Is it reproducible? (always, sometimes, only under certain conditions)
- When did it start? (after a specific change, deployment, data change)
-
Gather initial evidence
- Error messages and stack traces (read them carefully -- every line matters)
- Relevant log output
- Browser console errors (if frontend)
- Network requests/responses (if applicable)
- Recent git changes in the affected area
-
Classify the bug type (this guides the investigation strategy)
- Crash/Error: Code throws an exception or returns an error
- Wrong Output: Code runs but produces incorrect results
- Performance: Code is too slow or uses too many resources
- Race Condition: Behavior depends on timing/ordering
- State Corruption: Data gets into an invalid state over time
- Integration: Works in isolation, fails when combined
- Environment: Works in one environment, fails in another
Phase 2: Hypothesis Generation
-
Generate 2-5 hypotheses ranked by likelihood. For each hypothesis:
- Statement: "The bug is caused by [X] because [reasoning]"
- Evidence for: What supports this hypothesis?
- Evidence against: What contradicts this hypothesis?
- Test: How can we confirm or eliminate this hypothesis?
- Effort: How hard is it to test? (prefer easy tests first)
-
Prioritize hypotheses using these heuristics: