Skip to content
Agent Orchestration
Skill

/fault-diagnosis

Use when a test fails, a build breaks, a bug is reported, behaviour is unexpected, performance degrades or an integration stops working, before proposing or making any fix.

From plugin
godmode
12333 skills1 agent2 hooks

Claude Code

$ npx -y skills add NoobyGains/godmode --skill fault-diagnosis --agent claude-code

SKILL.md

fault-diagnosis.SKILL.md
name: fault-diagnosis
description: "Use when a test fails, a build breaks, a bug is reported, behaviour is unexpected, performance degrades or an integration stops working, before proposing or making any fix."

Fault Diagnosis

A fix that is not aimed at the root cause is a guess, and guesses pile up: each one adds a change, hides a symptom and makes the next failure harder to read. Diagnosis runs in four phases (reproduce, isolate, find the root cause, fix with a regression test) and each phase leaves evidence behind. **No fix until you can say what is broken, where, and why.**

The Prime Directive

NO FIX WITHOUT A REPRODUCED FAILURE AND A ROOT CAUSE YOU CAN STATE

No exceptions. No workarounds. No shortcuts.

When to Use

**Required:**

  • Any failing test, broken build, crash, error message or wrong output.
  • A bug report from the user or from production.
  • Flaky behaviour: passes sometimes, fails sometimes.
  • Performance that got worse, and integrations that stopped working.
  • Especially when the fix "looks obvious", when time is short, and when a previous fix did not work.

**Skip:**

  • Nothing. For a simple bug the four phases take minutes; the process is fast exactly when the problem is simple.

The Protocol

Phase 1: Reproduce

1. **Read the whole error.** The full message, the full stack trace, the exit code, the lines just before the failure. Note file paths, line numbers and error codes. Errors often state the answer outright. 2. **Reproduce it on demand.** Find the exact steps, inputs and environment that trigger it, and write them down. Run them and see the failure yourself. If you cannot reproduce it, you are not ready to fix it: gather more data (logs, inputs, versions, timing) instead of guessing. 3. **Make the reproduction small and fast.** Strip away everything that does not affect the failure until you have the shortest command or test that shows it. Ideally it is already a failing automated test. 4. **Check what changed.** `git log` and `git diff` since the last known-good state, dependency and lockfile changes, configuration, environment, data. If a known-good commit exists, `git bisect run <reproduction command>` finds the first bad commit mechanically.

Evidence: the reproduction steps and the failing output.

Phase 2: Isolate

5. **Find the failing component.** In a system with several layers (CI, build script, signing step; API, service, database), add temporary logging at each boundary: what goes in, what comes out, which configuration and environment each layer sees. Run once. The first boundary where the data goes wrong is where you look next. 6. **Trace the bad value backwards.** When the error surfaces deep in the call stack, follow the bad value up the chain to where it was created. The method is in [root cause tracing](references/root-cause-tracing.md). 7. **Compare with something that works.** Find similar code in the same codebase that works, or the reference implementation of the pattern you are using, and read it completely. List every difference, however small. Do not decide in advance which differences "cannot matter". 8. **For test pollution** (a test passes alone, fails in the suite, or the suite leaves files behind), bisect the test files: run halves of the suite in a fixed order until one file produces the effect. The root cause tracing reference describes the method.

Evidence: the component, the line or the commit where good data turns bad.

Phase 3: Root Cause

9. **State one hypothesis** in writing: "X is the root cause because Y." It must explain every symptom you have seen, not just the most visible one. 10. **Test it with the smallest possible change or observation.** One variable at a time: a log line, an assertion, a changed input. Predict the result before you run it. 11. **Confirmed:** go to phase 4. **Refuted:** discard the hypothesis, keep what you learned, form a new one. Do not stack a second change on top of the first. 12. **If you do not know, say so.** "I do not understand why X" is a valid state. Research it (read the library source, its issue tracker, its current documentation via `godmode:grounding`) or ask the user, rather than pretending.

Evidence: the hypothesis, the prediction and the observation that confirmed it.

Phase 4: Fix with a Regression Test

13. **Write the failing test first.** It reproduces the bug through the same entry point, and you watch it fail for the reason you identified (`godmode:test-first`). 14. **Fix the root cause, once.** One change, at the source, not at the place the symptom appeared. No unrelated clean-ups in the same change. 15. **Verify.** The new test passes, the full suite passes, the original reproduction from phase 1 no longer fails. Revert the fix and watch the test fail again; restore it. Report this evidence through `godmode:completion-gate`. 16. **Harden where it pays.** If bad data reached deep code, add validation at the layers it crossed so the same class of bug cannot recur: see [defense in depth](references/defense-in-depth.md). If the failure was timing-related, replace sleeps with [condition-based waiting](references/condition-based-waiting.md); a complete helper is in [the waiting example](references/condition-based-waiting-example.ts).

When fixes keep failing

Count your fix attempts for this issue. After **two** failed fixes, the next attempt must come from a new pass through phases 1 to 3, not from a variation of the last fix. After **three**, stop and invoke `godmode:error-recovery`: repeated failures that each reveal a new problem somewhere else usually mean the design is wrong, not the last line you edited. Discuss the design with the user before a fourth attempt.

When There Is No Root Cause in the Code

Sometimes the cause really is outside the code: a provider outage, a clock skew, an external rate limit, a race in a dependency you cannot change. You may conclude this only after phases 1 to 3, with evidence. Then:

1

Read more
@noobygains
Ships withgodmode

Engineering discipline for AI coding agents: question the request, verify against current docs, plan, build test-first on the cheapest capable model, review with a second model family, prove it before saying done. One repo for Claude Code, Codex, Antigravity, Cursor, Gemini CLI and OpenCode.

12333 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
123
Star history of NoobyGains/godmode on GitHub, a chart by star-history.com

Other skills on godmode.

agent-briefing

agent-briefing

Use when writing a prompt for a subagent or teammate, deciding how much context another agent needs, writing or reading a handoff…

@noobygains@noobygainsInstall Skill
code-review

code-review

Use when a task, feature or bug fix is implemented and before it is committed, merged or handed back to the user, and when the…

@noobygains@noobygainsInstall Skill
codebase-conventions

codebase-conventions

Use when about to add or change code in an existing codebase: a new file, module, route, component, service, test, migration,…

@noobygains@noobygainsInstall Skill
completion-gate

completion-gate

Use when about to say that work is done, fixed, passing, working, deployed or ready, before committing, opening or merging a pull…

@noobygains@noobygainsInstall Skill
cross-model-review

cross-model-review

Use when a reviewed change is about to land on a shared branch, be released or be deployed, and when the user asks for a second…

@noobygains@noobygainsInstall Skill
delegated-execution

delegated-execution

Use when a written implementation plan is ready to execute in the current session and its tasks are mostly independent, so each…

@noobygains@noobygainsInstall Skill

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw3d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca1d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip2d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about fault-diagnosis.

Which coding agents can use fault-diagnosis?
fault-diagnosis installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.