Debugging and error recovery
Skill moberghr/mtk-agent-toolkit/.claude/skills/debugging-and-error-recovery
Use when a test fails, a runtime error occurs, or a behavioral regression is reported — reproduce first, then fix the root cause within scope.From its SKILL.md
npx -y skills add moberghr/mtk-agent-toolkit --skill debugging-and-error-recoveryAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.9 KB, as published. Nobody here has run it
Debugging And Error Recovery
Current State
echo "--- Branch ---"
git branch --show-current 2>/dev/null || echo "(detached)"
echo "--- Working tree ---"
git status --short 2>/dev/null | head -15 || echo "(not a git repo)"
Overview
Start from the failure, confirm the cause, make the smallest correct fix, and verify it with build and test evidence. Guesswork is not debugging.
When To Use
- Bug fixes
- Failing tests
- Runtime errors
- Small behavioral regressions
When NOT To Use
- New feature design
- Large scope changes requiring formal planning first
Workflow
- Reproduce: capture the failing test, error output, or behavioral evidence before editing.
- Localize: read the failing file, its neighbors, and the most relevant standard sections.
- Reduce: narrow the likely root cause to the smallest responsible area.
- Hypothesize: state what you think is wrong before editing.
- Fix: apply the smallest correction that matches the local codebase pattern.
- Guard: add or update a regression test if behavior changed or failure could recur.
- Verify: run the active tech stack's build/test commands (from
.claude/skills/tech-stack-{stack}/SKILL.md## Build & Test Commands). - Escalate to the full implementation workflow if the task grows past 3 files or needs new architecture.
Rules
- Read before editing.
- Match existing patterns.
- Do not gold-plate unrelated improvements.
- Stop after repeated failed attempts and explain what is blocking forward progress.
- Fix the root cause, not just the visible symptom.
Common Rationalizations
See .claude/skills/context-engineering/SKILL.md for the shared table. Debugging-specific traps: "the test already fails, I don't need a regression test" (if the failure can recur, guard it explicitly — an ad-hoc repro doesn't become a permanent test by accident), and "this quick change should fix it" (state the hypothesis first so the fix can be judged against it, not just against "the error is gone").
Red Flags
- Editing based on guesswork without reproduction
- Touching a 4th file without escalation
- Fixing symptoms while leaving the root cause intact
- Multiple failed attempts with no updated hypothesis
Verification
- Root cause is stated clearly
- Build passes
- Relevant tests pass
- Regression coverage exists when behavior changed
- Scope remained within quick-fix boundaries or was escalated