debug
Skill35 starsChanged 52 days agoApache-2.0View on GitHub
Systematic debugging using ReAct pattern. Use when encountering bugs, errors, unexpected behavior, test failures, or performance issues. Never guess - investigate methodically.
192 other projects use a version of this.
Adopted by
Most recently taken up by
- PeanutGT/NutsSkillstheir own version, first seen Nov 8, 2026
- jskswamy/skillstheir own version, first seen Nov 8, 2026
- Firzus/agent-skillstheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- microsoft/veronatheir own version, first seen Nov 8, 2026
Used with
Projects with it also use add-discord, add-slack and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkilladd-discord
Add Discord bot channel integration via Chat SDK.
Also in 11 projects that use this
MicrosoftSkilladd-slack
Add Slack channel integration via Chat SDK.
Also in 11 projects that use this
- +10 more from microsoft
Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 192
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- anthropics/knowledge-work-plugins★ 35ksame name
- gavrielc/nanoclaw★ 31ksame name
- nanocoai/nanoclaw★ 31ksame name
- qwibitai/nanoclaw★ 31ksame name
- openai/symphony★ 27ksame name
- FalkorDB/FalkorDB★ 10ksame name
- NVIDIA/TensorRT-Model-Optimizer★ 5.6ksame name
- NVIDIA/Model-Optimizer★ 5.6ksame name
182 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 175 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Before investigating, CLARIFY with the user:
- Distinctive: line 45
WAIT for answers if unclear: Do not assume.
- Distinctive: line 65
Use the Bash tool to query recent corrections from the metrics database:
- Distinctive: line 93
If after 2 investigation cycles the root cause is unclear:
- Distinctive: line 96
Use WebSearch with the exact error message
- Distinctive: line 100
Use WebFetch on library docs for the specific API/method involved
- Distinctive: line 101
Check changelogs for recent breaking changes
- Very specific: line 105
Check dependency versions: composer show | grep <package> or npm list <package>
- Distinctive: line 148
If you catch yourself thinking:
- Distinctive: line 208
When the reproduction is a long build, a soak test or a log to tail, the native Monitor tool streams the process's events back into the …
“Common” is measured: kept by at least 6 in 10 of the 175 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/craftsman:debug - Systematic Investigation
Outcome Contract
- Outcome: the root cause of the observed behaviour, proven by a reproduction, not a plausible hypothesis.
- Done when: the failure reproduces on demand, the cause is located at file:line, the fix makes the reproduction pass, and no other test regresses.
- Evidence: the failing command output before, the same command after, and the reproduction steps.
You are a Senior Engineer debugging systematically. Never guess - investigate methodically.
The Iron Law
┌─────────────────────────────────────────────────────────────────┐
│ │
│ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION │
│ │
│ If you haven't completed Phase 1-3, you CANNOT propose fixes │
│ │
└─────────────────────────────────────────────────────────────────┘Process (ReAct Pattern)
Phase 1: Understand the Problem
Before investigating, CLARIFY with the user:
## Problem Clarification
1. **Expected behavior:** What SHOULD happen?
2. **Observed behavior:** What ACTUALLY happens?
3. **Reproduction:** Steps to reproduce?
4. **Timeline:** When did it start? What changed?
5. **Environment:** Dev/Staging/Prod? Versions?WAIT for answers if unclear. Do not assume.
Phase 2: Form Hypotheses
Based on symptoms, rank hypotheses by probability:
## Hypotheses
| # | Hypothesis | Probability | Why |
|---|------------|-------------|-----|
| 1 | [Most likely cause] | 60% | [Evidence] |
| 2 | [Second option] | 25% | [Evidence] |
| 3 | [Less likely] | 15% | [Evidence] |Phase 3: Investigate (ReAct Loop)
Recent Corrections
Use the Bash tool to query recent corrections from the metrics database:
DB=$(bash "$(craftsman-path bin/craftsman-runtime)" metrics) || exit 1
sqlite3 "$DB" "SELECT rule, file_pattern, action, context FROM corrections WHERE timestamp > datetime('now','-7 days') ORDER BY timestamp DESC LIMIT 10;" 2>/dev/null || echo "No recent corrections"Execute investigation cycles:
## Investigation Log
### Cycle 1
**THOUGHT:** Based on [observation], I suspect [cause]. I need to check [X].
**ACTION:** [Read file X / Run command Y / Check logs Z]
**OBSERVATION:** [What I found]
**CONCLUSION:** [Confirms/refutes hypothesis #N]
### Cycle 2
**THOUGHT:** [Updated thinking based on Cycle 1]
**ACTION:** [Next investigation step]
**OBSERVATION:** [Results]
**CONCLUSION:** [Updated hypothesis]Repeat until root cause is confirmed with evidence.
Web Research (when stuck)
If after 2 investigation cycles the root cause is unclear:
- Search for the error message or symptom:
- Use WebSearch with the exact error message
- Filter results for: Stack Overflow, GitHub Issues, official docs
- Fetch relevant documentation:
- Use WebFetch on library docs for the specific API/method involved
- Check changelogs for recent breaking changes
- Cross-reference findings with local code:
- Compare documentation behavior vs observed behavior
- Check dependency versions:
composer show | grep <package>ornpm list <package>
Phase 4: Root Cause Identification
## Root Cause
**Location:** [File:Line]
**Cause:** [Clear explanation]
**Evidence:** [What proves this is the cause]
**Why it wasn't caught:** [Missing test? Edge case?]Phase 5: Fix
Apply a minimal, targeted fix:
## Fix
**Change:**
```diff
- old code
+ new codeWhy this fixes it: [Explanation] Side effects: [None / List them]
### Phase 6: Prevent
```markdown
## Prevention
- [ ] **Test added:** `test_[scenario]` that would have caught this
- [ ] **Static analysis:** Rule added to catch similar issues
- [ ] **Documentation:** Updated if API/behavior changed
- [ ] **Monitoring:** Alert added if applicableRed Flags - STOP Immediately
If you catch yourself thinking:
| Thought | Reality |
| "Quick fix for now" | You'll forget. Fix properly. |
| "Just try changing X" | That's guessing, not debugging. |
| "It's probably X" | Probably ≠ Confirmed. Investigate. |
| "I don't fully understand but..." | Then you can't fix it safely. |
| "It's flaky, it passes when I run it alone" | Red in the suite and green alone is a defect: shared state, test order, time or the filesystem. A run of that test alone is evidence of the dependency, not of a pass. |
| "It was already failing, it's not mine" | Pre-existing is a fact about the past, not a verdict. Fix it, or open a ticket and name its identifier in the report. |
→ STOP. Return to Phase 1.
Common Debugging Commands
# PHP
tail -f var/log/dev.log
bin/console debug:container ServiceName
vendor/bin/phpunit --filter=TestName --debug
# Node.js
node --inspect app.js
DEBUG=* npm start
# Database
EXPLAIN ANALYZE SELECT ...;
# Memory
valgrind --leak-check=full ./programOutput Format
# Investigation: [Issue Title]
## Summary
- **Status:** [Investigating | Root Cause Found | Fixed]
- **Severity:** [Critical | High | Medium | Low]
- **Time spent:** [Duration]
## Problem
[Description]
## Root Cause
[Explanation with evidence]
## Fix
[Code changes]
## Prevention
[Tests and safeguards added]
## Lessons Learned
[What to remember for next time]Long-Running Reproductions
When the reproduction is a long build, a soak test or a log to tail, the native Monitor tool streams the process's events back into the session, so the investigation reacts to output as it lands instead of polling with sleep-and-recheck. Prefer it whenever the harness offers it.
Bias Protection
Acceleration: "Just fix it quickly" → Quick fixes become permanent bugs. Follow the process.
Dispersion: "While debugging, I noticed this other issue..." → Note it. Stay focused on THIS bug. One problem at a time.
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.

