agentleFS
alfonsusenricoalfonsusenrico/pakem/skills/root-cause-debugging/SKILL.md

root-cause-debugging

Skill0 starsChanged 8 days agoMITView on GitHub

Use when investigating a defect, regression, flaky or intermittent failure, failed deploy, or unexplained runtime behaviour, and before attempting a second fix for the same symptom. Corrects the responsible mechanism instead of hiding a downstream symptom.

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-audit.

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.
  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 4 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 14

    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:

    Never describe an unconfirmed change as a fix.

    line 19
  2. Distinctive:

    Verify that the running artifact contains the code being evaluated.

    line 26
  3. Distinctive:

    When known good and bad revisions exist, prefer bounded comparison or git bisect over rereading the codebase.

    line 30
  4. Distinctive:

    Follow one failing operation through every responsible boundary.

    line 35
  5. Distinctive:

    Never put secrets or personal data in telemetry.

    line 39
  6. Distinctive:

    Prefer experiments that change one variable and rule alternatives in or out.

    line 53
  7. Distinctive:

    Before changing code, name the first violated contract or incorrect state, the component that owns it, the mechanism that produced it, and …

    line 57
  8. Distinctive:

    Remove failed experimental workarounds unless separately approved, and inspect sibling paths that share the corrected contract.

    line 64
  9. Distinctive:

    Prefer a regression test that fails for the expected reason before the fix and passes after it.

    line 70
  10. Distinctive:

    Verify the owning component, the affected boundary contracts, a realistic integration path, and the original user-visible flow as risk …

    line 72
  11. Distinctive:

    After one failed fix, stop patching and update the causal model with what the result disproved.

    line 79
  12. Distinctive:

    After two failed fixes for the same symptom, make no third change until the failing state and artifact identities are re-established, …

    line 81
  13. Distinctive:

    Keep mitigation, causal correction, and cosmetic restoration separate.

    line 89
  14. Distinctive:

    Keep raw logs out of plans and handoffs.

    line 95

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

Root-Cause Debugging

Debugging is controlled causal investigation, not a sequence of plausible patches. Logs, traces, tests, code, and graphs are observations; an explanation stays a hypothesis until evidence distinguishes it from the alternatives.

1. Establish the failure

  • Separate observed behaviour from hypotheses.
  • Record expected and observed behaviour, exact input and sequence, affected and unaffected cases, frequency, and the first known bad state when available.
  • Build the narrowest faithful reproduction. If reproduction is impractical, state that limit and name the evidence that substitutes for it.
  • Never describe an unconfirmed change as a fix.

2. Confirm the tested state

  • Record repository revisions and relevant working-tree changes, built artifact or image identity, configuration schema, migration state, dependency versions, and runtime topology as applicable.
  • Verify that the running artifact contains the code being evaluated. Build success and build logs do not prove runtime behaviour or deployment identity.
  • Isolate investigation from unrelated changes with a branch or worktree based on the intended revision. Never discard user work for isolation.
  • When known good and bad revisions exist, prefer bounded comparison or git bisect over rereading the codebase.

3. Trace the responsible path

  • Follow one failing operation through every responsible boundary.
  • At each boundary compare actual input, output, state transition, ownership, timeout, retry, and error contracts.
  • Correlate processes with an existing safe request, job, or trace identifier. Never put secrets or personal data in telemetry.
  • Account for stale containers, caches, persisted data, clocks, concurrency, retries, feature flags, environment drift, and instrumentation side effects.
  • Instrumentation exposes a boundary; it is not a correction. Remove or justify it afterwards under normal privacy and review rules.

4. Manage hypotheses

  • For recurrent, cross-boundary, asynchronous, or stateful failures, keep a hypothesis ledger (template).
  • For each hypothesis record the mechanism, supporting and conflicting evidence, a prediction that must hold, the smallest discriminating experiment, and the result: confirmed, rejected, or inconclusive.
  • Preserve negative results so later sessions do not repeat disproven work.
  • Prefer experiments that change one variable and rule alternatives in or out.

5. Prove and correct the cause

  • Before changing code, name the first violated contract or incorrect state, the component that owns it, the mechanism that produced it, and how it explains every downstream symptom.
  • Root cause can be a conjunction of conditions; do not force a single-cause story or stop at the first correlation.
  • Fix the responsible mechanism and contract in its owning component. Do not compensate downstream because that hides the symptom.
  • Remove failed experimental workarounds unless separately approved, and inspect sibling paths that share the corrected contract.

6. Verify the correction

  • Prove the correction against the original failure fingerprint.
  • Prefer a regression test that fails for the expected reason before the fix and passes after it.
  • Verify the owning component, the affected boundary contracts, a realistic integration path, and the original user-visible flow as risk requires.
  • Exercise relevant negative, retry, duplicate, timeout, cancellation, restart, concurrency, and partial-failure cases.

7. Circuit breaker

  • After one failed fix, stop patching and update the causal model with what the result disproved.
  • After two failed fixes for the same symptom, make no third change until the failing state and artifact identities are re-established, competing hypotheses are reviewed, and a new discriminating experiment is defined.
  • Seek an independent review of the evidence when available. A fresh opinion without new evidence is not progress.

8. Mitigation, restoration, and record

  • Keep mitigation, causal correction, and cosmetic restoration separate.
  • Urgent mitigation may protect users, data, security, or availability before diagnosis completes. Label it temporary and record risk, owner, rollback, and removal condition. It does not close the problem.
  • For significant or recurring failures write an incident record (template).
  • Keep raw logs out of plans and handoffs; keep safe references and the facts needed to resume.
  • In planned work, keep an unknown cause explicitly unknown: plan reproduction, instrumentation, and diagnosis first, update the design with the supported explanation, then implement. Mark a fix task done only after its regression and runtime evidence pass.

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.