agentleFS
kriscardkriscard/Skills/skills/dev/debug/SKILL.md

debug

Skill14 starsChanged 4 months agoMITView on GitHub

Debugs errors, test failures, and unexpected behavior with systematic root-cause analysis. Use when the user reports a bug, says "this isn't working", a test is failing, an exception is thrown, output is wrong, or asks to investigate "why does X happen". Applies to frontend, backend, database, network, and performance issues.

144 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-ollama-tool, 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.
  • MicrosoftSkill

    add-ollama-tool

    Add Ollama MCP server so the container agent can call local models and optionally manage the Ollama model library.

    Also in 6 projects that use this

  • MicrosoftSkill

    add-slack

    Add Slack channel integration via Chat SDK.

    Also in 6 projects that use this

  • sskarzSkill

    add-telegram-swarm

    Add Agent Swarm (Teams) support to Telegram. Each subagent gets its own bot identity in the group. Requires Telegram channel to be set up first (use /add-telegram). Triggers on "agent swarm", "agent teams telegram", "telegram swarm", "bot pool".

    Also in 5 projects that use this

  • +9 more from microsoft

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 127 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Don't make random changes hoping something fixes it — form a hypothesis first

    line 65
  2. Distinctive:

    Don't fix symptoms without understanding root cause

    line 66
  3. Distinctive:

    Don't debug in production without safeguards

    line 67
  4. Distinctive:

    Don't leave debug logs or breakpoints in committed code

    line 68
  5. Distinctive:

    Don't trust your mental model — read the actual code

    line 69

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

Debug

Trace the failure before changing code. Systematic root-cause analysis: reproduce, isolate, hypothesize, fix, verify.

Process

  1. Trace the failure — capture the exact error, stack trace, failing command, and relevant logs. Done only when the failure can be quoted back verbatim.
  2. Reproduce reliably — identify the smallest command or action that fails. Done only when it fails twice the same way, or is labeled intermittent with evidence.
  3. Gather evidence before hypothesis — check recent changes, logs around the failure, expected environment, config, versions, and whether timing/races are plausible. Done only when each relevant item is recorded or ruled out.
  4. Isolate — binary search via git bisect, comment blocks, feature flags, or a minimal repro. Done only when the failure is narrowed to a component, commit, input, or condition.
  5. Hypothesize — state one specific theory and the observation that would disprove it. Do not change multiple things at once.
  6. Test hypothesis — add temporary logging, use a debugger, or run a focused experiment. Done only when the result supports or rejects the theory.
  7. Apply minimal fix — smallest change that addresses root cause, not symptoms.
  8. Verify — rerun the original reproduction and relevant regression checks. Done only when the original failure no longer occurs and regressions are not detected or are explicitly reported.

Evidence to Gather Before Hypothesis

  • Full error message, stack trace, and error code
  • Recent changes: git log --oneline -10 / git diff HEAD~1
  • Logs around the time of failure
  • Environment: versions, env vars, config, external service state
  • Consistency: deterministic failure or intermittent pattern

Reproduction:

# Find the commit that introduced it
git bisect start
git bisect bad HEAD
git bisect good <last-known-good-sha>

Strategic logging:

// Entry/exit with parameters — temporary, remove after fix
console.log('[debug] functionName called', { param1, param2 });
// ...
console.log('[debug] functionName result', { result });

Anti-Patterns

  • Don't make random changes hoping something fixes it — form a hypothesis first
  • Don't fix symptoms without understanding root cause
  • Don't debug in production without safeguards
  • Don't leave debug logs or breakpoints in committed code
  • Don't trust your mental model — read the actual code

Output

## Root Cause
[What actually caused the issue]

## Evidence
- [Log excerpt / stack trace / variable state]

## Fix
`file:line`
```diff
- broken code
+ fixed code
```

**Why this fixes it:** [reasoning]

## Verification
- [Command/repro rerun and result]

## Prevention
- [Recommendation to avoid recurrence]

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.