agentleFS
andreymudriandreymudri/fleetmates/skills/systematic-debugging/SKILL.md

systematic-debugging

Skill3 starsChanged 10 days agoMITView on GitHub

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes - reproduce and isolate before changing anything.

190 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions 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.
  • Leodorareluctant259Skill

    chinese-code-review

    中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈

    Also in 8 projects that use this

  • Leodorareluctant259Skill

    chinese-commit-conventions

    中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化

    Also in 8 projects that use this

  • 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 20 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

  • +2 more from Leodorareluctant259
  • +5 more from mjunaidca

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 176 edited versions we read keep these.

  • 7

    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:

    Instrument to test it: Add logging, a debugger breakpoint, or a targeted probe that checks the prediction from step 3.

    line 29
  2. Distinctive:

    Fix the confirmed root cause: Not the nearest symptom, not a defensive check that papers over it — the thing step 4 confirmed.

    line 32
  3. Distinctive:

    Every fix must trace back to a hypothesis that was tested and confirmed in step 4.

    line 53
  4. Distinctive:

    If instrumentation doesn't confirm the prediction, the hypothesis is wrong.

    line 57
  5. Very specific:

    Use this loop for any bug, failing test, or unexpected behavior before proposing a fix — a tm-implementer working a task, or inline work in …

    line 85
  6. Distinctive:

    Reproduce: Run the same complete command from the main worktree root with the original run, task, plan and base arguments.

    line 94
  7. Distinctive:

    Probe: Test that prediction once.

    line 101
  8. Distinctive:

    Re-run: Run the same complete command after the fix, wait for completion, then refresh affected phase checks through the orchestrator …

    line 104

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

Adapted from the MIT-licensed superpowers plugin by Jesse Vincent. See NOTICE.md.

Overview

Core principle: find the root cause before attempting a fix. A fix aimed at a symptom without a confirmed cause is a guess, and guesses are how debugging sessions run for hours without progress.

The Loop

One step at a time. Do not skip ahead to a fix because the cause "seems obvious."

  1. Reproduce reliably. Trigger the bug on demand, with exact steps. If you can't reproduce it consistently, gather more evidence before doing anything else — don't guess at a fix for a bug you can't summon.
  2. Minimise the reproduction. Strip away everything not required to trigger it: unrelated setup, unrelated input, unrelated code paths. A smaller reproduction narrows where the cause can be.
  3. State a hypothesis that predicts something observable. "I think X is the cause because Y, and if true then Z will happen when I do W." A hypothesis that can't fail — one with no observable prediction — is not a hypothesis, it's a guess wearing a hypothesis's clothes.
  4. Instrument to test it. Add logging, a debugger breakpoint, or a targeted probe that checks the prediction from step 3. Run it once. Read the result against what you predicted, not against what you hoped.
  5. Fix the confirmed root cause. Not the nearest symptom, not a defensive check that papers over it — the thing step 4 confirmed.
  6. Add a regression test that fails without the fix. Apply the test-driven-development skill: write the test, confirm it fails for the bug's actual symptom, then confirm the fix makes it pass. Skipping this step means nothing stops the bug from coming back.

One change at a time

Change exactly one thing between test runs. Two simultaneous changes make the result uninterpretable: if the bug clears, you don't know which change fixed it or whether they cancelled each other out; if it doesn't, you don't know which change to keep. This holds even under time pressure — especially under time pressure, since that's when bundling changes feels fastest and costs the most.

No speculative or shotgun fixes

A speculative fix — "try changing X and see if it helps" — is prohibited. So is a shotgun fix — changing several plausible-looking things at once in the hope that one of them works. Both skip the hypothesis step, and both leave you unable to explain afterward why the bug is gone, which means you can't tell whether it's actually gone or just not currently triggering.

Every fix must trace back to a hypothesis that was tested and confirmed in step 4.

Discard disproved hypotheses

If instrumentation doesn't confirm the prediction, the hypothesis is wrong. Discard it and form a new one from what the evidence actually showed — don't patch the old hypothesis with an exception to keep it alive ("X is the cause, except in this case where it's also Y"). A hypothesis that needs a growing list of exceptions to survive contact with evidence isn't converging on the root cause; it's accumulating epicycles around the wrong one.

When the loop itself is failing

Roughly three fixes in, if each one clears the reported symptom but surfaces new breakage in a different place, the problem isn't a wrong hypothesis — it's coupling the design didn't anticipate, and the loop is the wrong tool for it. A fourth local fix will very likely repeat the pattern: fix here, break there. When you see this shape, stop fixing, name the architectural problem in one sentence, and raise it rather than running another iteration of the loop.

Red flags — stop and go back to reproduce

  • "Quick fix for now, investigate later"
  • "Just try changing X and see if it works"
  • "I don't fully understand it, but this might work"
  • "Let me change a few things and rerun the tests"
  • Proposing a fix before the reproduction is confirmed
  • Patching a hypothesis instead of discarding it

Any of these mid-task means: stop, go back to reproduce, and continue from there.

Applying this

Use this loop for any bug, failing test, or unexpected behavior before proposing a fix — a tm-implementer working a task, or inline work in the main session. Once the loop reaches step 6, hand off to the test-driven-development skill for the RED/GREEN discipline on the regression test itself. Before claiming the bug is fixed, the phase-gate skill is where that claim is checked against a recorded PASS rather than taken on your word.

Gate failures

  1. Reproduce. Run the same complete command from the main worktree root with the original run, task, plan and base arguments. Record the command, worktree, exit status and relevant output. Interpret the command's documented exit codes: a rejected invocation or unavailable measurement is different from a measured failing verdict.
  2. Isolate. Name the failing check and reduce its reproducer. Separate missing tooling, dependencies, inaccessible previews and stale evidence from defects in the task's code.
  3. Hypothesis. State one explanation and an observable result that would disprove it.
  4. Probe. Test that prediction once. Discard it when the evidence contradicts it.
  5. Fix. Correct the confirmed cause within the declared files. If the fix needs another owner's files or policy, report blocked; do not widen ownership or weaken checks.
  6. Re-run. Run the same complete command after the fix, wait for completion, then refresh affected phase checks through the orchestrator before reporting done. Task-only enforcement does not replace the full phase gate. Include actual output tied to the final tested 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.