fault-localize
Skill4 starsChanged 3 months agoMITView on GitHub
Find the earliest decisive failure in an agent run trace and propose an evidence-backed targeted repair. Load when a run failed, results are wrong, or the user asks what went wrong in an agent session. Also triggers on "localize the fault", "first incorrect step", "debug this run", "trace attribution", "why did the agent fail", or after run-trace captures errors. Pairs with debug-and-fix for code defects and dynamic-routing for plan faults.
- Reads credentials
In this repository125 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/agent-loom-routing.mdcCursor rule
- .cursor/rules/agent-loom-skills-index.mdcCursor rule
- adversarial-hatSkill
- agent-builderSkill
- agent-launcherSkill
- agent-loom-syncSkill
- agent-observabilitySkill
- agent-run-retroSkill
- agent-system-architectureSkill
- api-and-interface-designSkill
- api-deprecation-and-migrationSkill
- apply-paper-to-projectSkill
- app-security-hardeningSkill
- architectural-decision-logSkill
- assumption-mappingSkill
- brainstormingSkill
- browser-testing-with-devtoolsSkill
- business-modelingSkill
- ci-cd-and-automationSkill
- codebase-understandingSkill
- code-review-crspSkill
- code-simplificationSkill
- compress-skillSkill
- context-engineeringSkill
- create-agent-promptSkill
- cross-link-skillsSkill
- customer-discoverySkill
- debug-and-fixSkill
- deep-thinkingSkill
- dependency-mappingSkill
- deploy-anywhereSkill
- deprecate-skillSkill
- design-directionSkill
- design-reviewSkill
- design-systemSkill
- dynamic-routingSkill
- eval-judgeSkill
- eval-outputSkill
- eval-pipelineSkill
- eval-rubric-designSkill
- experimentationSkill
- experiment-backlogSkill
- experiment-readoutSkill
- experiment-runbookSkill
- experiment-specSkill
- feature-specSkill
- fermiSkill
- first-principlesSkill
- frontend-designSkill
- generate-changelogSkill
- git-workflow-and-versioningSkill
- gsap-animationSkill
- harness-engineeringSkill
- harness-evolutionSkill
- harness-generationSkill
- idea-evaluationSkill
- idea-generationSkill
- implementation-planSkill
- improve-skillsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Follow references/LOCALIZATION.md — earliest error/divergence wins.
- Very specific: line 40
Run trace_query.py timeline and errors.
- Distinctive: line 60
Write attribution record. If no flip, consider next candidate step.
≈ “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.
Files
Fault Localize
You find the earliest decisive divergence in a trace, hypothesize cause from evidence, apply a targeted repair, replay from that point, and verify an outcome flip. No vague retries.
Hard Rules
Require a trace file (.agent-loom/traces/<run-id>.jsonl) or reconstruct from session tool history.
Follow references/LOCALIZATION.md — earliest error/divergence wins.
Hypothesis must cite output_ref or error from the trace record.
Replay from suspected step — not full blind restart unless plan-layer fault.
Record attribution with outcome_flip boolean.
Route code defects to debug-and-fix; plan faults to dynamic-routing.
Workflow
Step 1 — Load trace
Run trace_query.py timeline and errors. If no trace, build minimal timeline from session history.
Step 2 — Identify suspected step
Earliest record with error or output contradicting expected. State suspected_step_id.
Step 3 — Write hypothesis
Three lines max — cite evidence. Classify layer.
Step 4 — Propose targeted repair
One intervention matched to layer. Not a kitchen-sink fix.
Step 5 — Replay and verify
Re-run from suspected step. Compare outcome.
Step 6 — Attribute
Write attribution record. If no flip, consider next candidate step.
Gotchas
- Latest error ≠ earliest cause — always scan chronologically.
- Fixing symptoms downstream masks upstream plan errors.
- Flaky tests need two replays before attributing.
Output Format
## Fault localization — [run_id]
Suspected step: **Sx** @ [ts]
Hypothesis: [evidence-cited]
Layer: [tooling|code|plan|environment]
Proposed repair: [one intervention]
Replay result: [pass|fail]
Outcome flip: [true|false]
Attribution: `.agent-loom/traces/[run_id]-attribution.json`
Next: [resume plan | debug-and-fix | escalate]Examples
Teaser: Trace shows S1 pass, S2 npm test fail → hypothesize missing env → repair .env.example → replay S2 → flip true.
Full pairs: references/examples.md
Common Rationalizations
| Excuse | Reality |
| "Last error is the cause" | Downstream errors are often symptoms. |
| "Retry whole run" | Expensive; masks localized fix opportunity. |
| "Guess and patch" | Hypothesis without evidence → wrong attribution. |
| "Trace is optional" | Localization without trace is reconstruction guesswork. |
| "One flip proves root cause" | Flaky tests need confirmatory replay. |
Verification
- Suspected step is earliest divergence
- Hypothesis cites trace evidence
- Attribution record written
- Layer-appropriate handoff if not fixed
Red Flags
- Hypothesis with no trace citation
- Full rerun without identifying suspected step
- outcome_flip true on single flaky test
Prune Log
Last pruned: 2026-07-05
- Initial release from high-leverage skill spec (Skill 4 family)
Impact Report
Localize: [run_id] | Suspected: [step] | Flip: [bool] | Layer: [layer]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
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.

