agentleFS
Cody-SimsCody-Sims/agent-skills/skills/systematic-debugging/SKILL.md

systematic-debugging

Skill0 starsChanged 4 months agoMITView on GitHub

Diagnoses bugs, failing tests, build failures, crashes, exceptions, stack traces, and unexpected or intermittent behavior by reproducing the failure, capturing exact error output, isolating the root cause, and fixing the cause rather than the symptom. Use when something is broken, a test or build fails, output is wrong, or a defect must be traced to its origin.

191 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use diagnosing-superpowers, building-chatgpt-apps 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.
  • obraSkill

    diagnosing-superpowers

    Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

    Also in 6 projects that use this

  • mjunaidcaSkill

    building-chatgpt-apps

    Guides creation of ChatGPT Apps with interactive widgets using OpenAI Apps SDK and MCP servers. Use when building ChatGPT custom apps with visual UI components, embedded widgets, or rich interactive experiences. Covers widget architecture, MCP server setup with FastMCP, response metadata, and Developer Mode configuration. NOT when building standard MCP servers without widgets (use building-mcp-servers skill instead).

    Also in 4 projects that use this

  • mjunaidcaSkill

    building-chat-interfaces

    Build AI chat interfaces with custom backends, authentication, and context injection. Use when integrating chat UI with AI agents, adding auth to chat, injecting user/page context, or implementing httpOnly cookie proxies. Covers ChatKitServer, useChatKit, and MCP auth patterns. NOT when building simple chatbots without persistence or custom agent integration.

    Also in 4 projects that use this

  • MorningStar0709Skill

    chinese-git-workflow

    Configure Git for domestic platforms and manage branching strategies suitable for Chinese teams. Use when the user asks to configure remotes, set up SSH, or manage Git workflows for Gitee, Coding, Jihu GitLab, or CNB, including requests like "配置国内 Git", "设置 Gitee 远程仓库", "推荐适合小团队的 Git 流程".

    Also in 4 projects that use this

  • +8 more from mjunaidca

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 173 edited versions we read keep these.

  • 4

    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:

    Do not change code until you can reproduce the failure and explain what is wrong.

    line 20
  2. Distinctive:

    Test the hypothesis with the smallest possible probe.

    line 39
  3. Distinctive:

    Add a regression test that fails without the fix and passes with it.

    line 49
  4. Distinctive:

    If repeated fixes keep exposing new failures in unrelated areas, stop patching.

    line 66

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

Systematic Debugging

Goal

Find the true root cause of a failure and correct it with a verified fix and a regression test. Replace guess-and-check editing with evidence.

Core rule

Do not change code until you can reproduce the failure and explain what is wrong. Speculative edits hide symptoms, add noise, and destroy the evidence you need. Test one hypothesis at a time.

Workflow

  1. Capture the exact failure. Copy the full error message, stack trace, exit code, and failing assertion verbatim. Do not paraphrase or summarize away detail; the precise text names the file, line, and condition that failed.
  2. Reproduce deterministically. Find the smallest command that triggers the failure every time, for example the repository's test command scoped to the failing case. Record it. If the failure is intermittent, treat it as a nondeterminism problem and read references/flaky-tests.md.
  3. Establish the search space. Note what changed recently, what environment differs from a known-good state, and which components sit between the input and the failing output.
  4. Form one falsifiable hypothesis. State it concretely: the value is wrong because a specific thing happens at a specific place. A hypothesis you cannot prove false is not useful.
  5. Test the hypothesis with the smallest possible probe. Add instrumentation or a breakpoint at a component boundary, or bisect the input, the history, or the code path. Confirm or reject the hypothesis before forming the next one.
  6. Trace the bad state backward. Follow the incorrect value from where it surfaces to where it originates. The first place the state becomes wrong is the root cause, not the last place it is observed. See references/root-cause-tracing.md.
  7. Fix the cause. Correct the origin of the bad state, not the symptom downstream. Suppressing an error, clamping a wrong value, or special-casing the observed input treats the symptom.
  8. Add a regression test that fails without the fix and passes with it. This proves the diagnosis and prevents recurrence.
  9. Confirm the original reproduction now passes. Run the exact command from step 2, then run the surrounding tests to check for collateral damage.

Forbidden approaches

  • Shotgun edits: changing several things at once hoping one works. You will not know which change mattered or why.
  • Try-things-until-it-works: each blind change is unverified and may mask the defect while leaving it present.
  • Fixing the symptom: catching and swallowing the exception, clamping a bad value, or retrying without understanding why the value was wrong.
  • Claiming a fix without rerunning the reproduction command.

When to stop and reconsider

If repeated fixes keep exposing new failures in unrelated areas, stop patching. This signals a wrong mental model or an architectural coupling problem. Return to step 3, widen the search space, and compare against a known-good state.

Output

Report the reproduction command, the captured error, the confirmed root cause, the fix, the regression test, and the passing verification output. Note any remaining uncertainty.

References

  • references/root-cause-tracing.md — binary search, bisecting, instrumentation, reading stack traces, and differential diagnosis against a known-good state.
  • references/flaky-tests.md — diagnosing nondeterminism, condition-based waiting, seeding randomness, isolating shared state, and timeout diagnostics.

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.