agentleFS
EzraAppleEzraApple/skills-init/skills/systematic-debugging/SKILL.md

systematic-debugging

Skill2 starsChanged 4 months agoMITView on GitHub

Use when behavior is broken, regressed, flaky, inconsistent, unexpectedly slow, or failing in tests, local development, CI, staging, or production and the root cause is not yet proven. Use for diagnosis before proposing or implementing a fix.

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

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

  • 0

    Common

    Most of the 173 edited versions we read keep these.

  • 10

    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:

    Start at the visible failure and trace control and data backward toward the earliest divergence.

    line 35
  2. Distinctive:

    Read full functions and directly relevant callers instead of judging an isolated diff or matching filename.

    line 37
  3. Distinctive:

    If reproduction is unsafe or unavailable, state that limitation and use the strongest static or runtime evidence available.

    line 43
  4. Distinctive:

    Use a small ledger when more than one cause is plausible:

    line 48
  5. Distinctive:

    When fixes are in scope:

    line 75
  6. Distinctive:

    Avoid retries, delays, refreshes, broad null guards, or duplicated checks unless they are the actual contract.

    line 78
  7. Distinctive:

    Add a stable regression witness when it meaningfully prevents recurrence.

    line 82
  8. Distinctive:

    Do not manufacture brittle tests for behavior better proven elsewhere.

    line 83
  9. Distinctive:

    Run the narrow checks for the changed boundary.

    line 88
  10. Distinctive:

    Use this compact structure:

    line 99

“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

Find the causal mechanism before changing code. Treat logs, traces, failing tests, runtime state, and exact reproduction output as evidence; treat plausible code as a hypothesis.

Preserve the Requested Boundary

Diagnosis does not imply authorization to fix. Stay read-only when the user asks for investigation, explanation, or review. If the user asks to fix the problem, diagnose first and then make the smallest causal change.

Pin Down the Failure

Record:

  • actual behavior, including exact errors or wrong output;
  • expected behavior and the source of that expectation;
  • environment, input, identity, and relevant configuration;
  • frequency and timing;
  • last known good version, deploy, or state when available;
  • the witness that can reproduce or directly observe the failure.

Separate the reported explanation from the observed symptom. Users are reliable about what they experienced; their proposed cause is still a hypothesis.

Trace Before Hypothesizing

  1. Reproduce or observe the failure with the closest available witness.
  2. Start at the visible failure and trace control and data backward toward the earliest divergence.
  3. Read full functions and directly relevant callers instead of judging an isolated diff or matching filename.
  4. Inspect recent history only when regression timing or design rationale can narrow the cause.
  5. Identify the invariant that should have held and the boundary that owns it.

If reproduction is unsafe or unavailable, state that limitation and use the strongest static or runtime evidence available.

Maintain a Hypothesis Ledger

Use a small ledger when more than one cause is plausible:

HypothesisSupporting evidenceContradicting evidenceNext discriminating probeStatus
Specific causal claimConcrete observationConcrete observationOne check that separates it from alternativesopen / confirmed / ruled out

Form hypotheses that can be falsified. Prefer one probe that distinguishes several hypotheses over several probes that merely collect more logs.

Mark disproven hypotheses as ruled out; do not quietly replace them. If repeated probes fail, widen the boundary or improve instrumentation rather than promoting the most plausible guess.

State Root Cause Precisely

A root-cause statement must name:

  • the triggering input, event, or state;
  • the responsible boundary or operation;
  • the incorrect mechanism or missing invariant;
  • how that mechanism produces the observed symptom;
  • the evidence that confirms the chain.

"A race condition," "bad state," or "the cache" is a category, not a root cause.

Fix at the Owning Boundary

When fixes are in scope:

  1. Change the smallest boundary that owns the violated invariant.
  2. Avoid retries, delays, refreshes, broad null guards, or duplicated checks unless they are the actual contract.
  3. Preserve unrelated behavior and public compatibility unless the root cause requires a deliberate contract change.
  4. Add a stable regression witness when it meaningfully prevents recurrence. Do not manufacture brittle tests for behavior better proven elsewhere.

Verify the Repair

  • Re-run the original reproduction or observe the original failure surface.
  • Run the narrow checks for the changed boundary.
  • Exercise the important negative or edge path implicated by the cause.
  • For intermittent failures, compare repeated baseline and treatment runs.
  • For environment-specific failures, verify in that environment or state clearly what remains unproven.

A new unit test alone does not close a production symptom unless it exercises the confirmed mechanism.

Report

Use this compact structure:

Symptom: <observed failure>
Root cause: <trigger + mechanism + owning boundary>
Evidence: <what proved the causal chain>
Fix: <change made, or recommended if report-only>
Verification: <original reproduction plus focused checks>
Remaining uncertainty: <none, or the exact unverified boundary>

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.