agentleFS
juandelossantosjuandelossantos/another-agent-skills/skills/debugging-and-error-recovery/SKILL.md

debugging-and-error-recovery

Skill1 starsChanged 11 days agoMITView on GitHub

Debug systematically using root-cause analysis. Use when tests fail, builds break, or behavior doesn't match. Do NOT use for code review.

We split this skill into the rules it gives an agent

4 rules. 1 is common, 2 are distinctive, and 1 is very specific to this project.

  • 1

    Common

    Most of the 59 edited versions we read keep these.

  • 2

    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
  1. Distinctive:

    Test fails after a code change

    line 20
  2. Distinctive:

    Test failures, build failures, runtime errors.

    line 64
  3. Very specific:

    When the same bug is reported 3+ times with different fixes, STOP.

    line 84
  4. Common:

    After fixing a bug:

    line 96

“Common” is measured: kept by at least 6 in 10 of the 59 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Debugging and Error Recovery

Systematic debugging with structured triage. When something breaks, stop adding features, preserve evidence, and follow a structured process.

When to Activate

  • Test fails after a code change
  • Build breaks or produces errors
  • Runtime error in development or production
  • Behavior doesn't match expectations
  • Performance degrades unexpectedly
  • User reports a bug

When NOT to Use

  • Code review or quality assessment (use code-review-and-quality)
  • Building new features (use feature implementation skills)
  • Speculative debugging without evidence
  • First-time flaky test without reproduction steps

Output Contract

Bug fix with root cause documentation — modified source files (any language, any framework) in existing source tree, with regression test covering the fixed path, root cause documented (not symptoms), all existing tests passing, build succeeding.

The Stop-the-Line Rule

1. STOP adding features or making changes
2. PRESERVE evidence (error output, logs, repro steps)
3. DIAGNOSE using the triage checklist
4. FIX the root cause
5. GUARD against recurrence
6. RESUME only after verification passes

Core Workflow

Triage Checklist

→ See guides/TRIAGE.md

Reproduce → Localize → Reduce → Fix → Guard → Verify

Decision Tree

→ See guides/DECISION-TREE.md

Categorize the error type and select the right debugging path.

Error Patterns

→ See guides/ERROR-PATTERNS.md

Test failures, build failures, runtime errors. Includes "treating error output as untrusted data."

Platform Patterns

→ See guides/PLATFORM-PATTERNS.md

React, Node.js, Python, Go — common error patterns and fixes by platform.

Quick Reference

Bug reported
     │
     ▼
Reproduce it?
 ├── YES → Localize → Reduce → Fix root cause → Add guard → Verify
 └── NO  → Gather context, check timing/env/state, document if truly random

Escalation

When the same bug is reported 3+ times with different fixes, STOP. → debugging-three-strikes

Integration

SkillWhen to use
test-driven-developmentWrite a failing test first, then debug to make it pass
code-review-and-qualityAfter fix, review for quality and side effects
doubt-driven-developmentChallenge your own diagnosis before fixing

Verification

After fixing a bug:

  • Root cause identified and documented
  • Fix addresses root cause, not symptoms
  • Regression test exists and passes
  • All existing tests pass
  • Build succeeds
  • Hypothesis formed before fix (not trial-and-error)
  • Git bisect considered if cause is a regression from known-good commit

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.