agentleFS
QuirkybrainQuirkybrain/claude-code-swe-framework/.claude/skills/failure-diagnosis/SKILL.md

failure-diagnosis

Skill1 starsChanged 54 days agoMITView on GitHub

Observe, reproduce, classify, and determine the root cause and correct repair layer for a build, test, regression, integration, or environment failure. Use before patching when the cause is unknown or crosses layers.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    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:

    Run after a meaningful failure when the responsible layer is uncertain, on regression or integration failure, or before a second broad …

    line 14
  2. Distinctive:

    Do not edit production code or weaken tests merely to prove a hypothesis.

    line 44
  3. Very specific:

    Use UNKNOWN when evidence is insufficient.

    line 46
  4. Distinctive:

    Use Clarification Gate for expected behavior/authority ambiguity.

    line 63
  5. Distinctive:

    Stop when root cause and repair layer are supported, when missing evidence blocks progress, or with ranked hypotheses at the investigation …

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Failure Diagnosis

Purpose

Replace speculative patching with an evidence-backed Root Cause Analysis and repair direction.

Trigger

Run after a meaningful failure when the responsible layer is uncertain, on regression or integration failure, or before a second broad correction attempt.

Inputs

  • Expected/observed behavior, symptom, failing revision, reproduction, environment, logs, and reports.
  • Recent changes and last-known-good revision.
  • Relevant Requirements, architecture, detailed design, Contracts, interfaces, data, implementation, tests, and prior attempts.

Prerequisites

  • Preserve original failure evidence before changing code/tests/environment.
  • Define the failure precisely enough to distinguish success from failure.

Procedure

  1. Observe and record the exact failure, scope, timing, revision, and environment.
  2. Reproduce with the least invasive reliable method; record deterministic/intermittent status.
  3. Build a timeline and compare failing behavior with last known good evidence.
  4. Trace affected control, data, interface, and Contract paths.
  5. Form multiple plausible hypotheses and identify discriminating checks.
  6. Execute bounded diagnostics; falsify alternatives rather than confirming only the first theory.
  7. Classify the responsible layer: Requirement, Architecture, Detailed Design, Contract, Interface, Data, Implementation, Test, Environment, or UNKNOWN.
  8. Identify root cause, contributing factors, affected Artifacts/Components, and invalid evidence.
  9. Select the smallest correct repair layer and required revalidation scope.
  10. Record confidence, untested hypotheses, repair owner capability, and escalation threshold.

Decision Rules

  • Reproduction failure lowers confidence; it does not prove the issue absent.
  • Root cause must explain all material observations better than alternatives.
  • Do not edit production code or weaken tests merely to prove a hypothesis.
  • Repair at the responsible layer, not the nearest editable line.
  • Use UNKNOWN when evidence is insufficient.

Outputs

  • RCA report with observation, reproduction, evidence chain, hypotheses, and classification.
  • Root cause/confidence or ranked unresolved hypotheses.
  • Correct repair layer/owner, affected states, and revalidation plan.

Failure Cases

  • Failure cannot be reproduced and environments cannot be compared.
  • Evidence/logs are unavailable or sensitive access is unauthorized.
  • Expected behavior itself is ambiguous.
  • Investigation budget expires without a supported root cause.

Escalation

Use Clarification Gate for expected behavior/authority ambiguity. Invoke Failure Escalation for repeated failure, exhausted local diagnosis, broad cross-layer impact, or required stage rollback.

Stop Conditions

Stop when root cause and repair layer are supported, when missing evidence blocks progress, or with ranked hypotheses at the investigation budget. Do not implement the fix in this Skill.

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.