Skip to content
Agentmart
Submit a tool

root-cause

Find the real cause of a bug before changing code.

Skill by shankarr1503

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/shankarr1503-root-cause

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Find the real cause of a bug before changing code. Use when something fails, crashes, returns wrong results, is flaky, or "worked before" — and before proposing any fix. Reproduce, isolate, prove the cause, then fix once.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/root-cause

What's inside

Skill name
root-cause
Description
Find the real cause of a bug before changing code. Use when something fails, crashes, returns wrong results, is flaky, or "worked before" — and before proposing any fix. Reproduce, isolate, prove the cause, then fix once.
License
MIT
Instructions
61 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Root cause

A fix without a proven cause is a guess. Guesses pass review, then the bug comes back. Follow these phases in order. Do not edit production code until phase 3 is done.

## 1. Reproduce

- Get the exact failure: full error, stack trace, failing command, input, environment, version/commit.
- Run it yourself. Record the command and the output verbatim.
- If you cannot reproduce it, say so and gather more evidence (logs, the reporter's exact steps, environment differences). Do not "fix" what you cannot observe.
- Shrink it: the smallest input, test or script that still fails. A 5-line repro is worth an hour of reading.

## 2. Isolate

Narrow where the fault lives using evidence, not intuition:

- **Read the error literally.** The file, line and message usually say more than people credit. Read the code at that line and its callers.
- **Diff against a known-good state.** `git log -p -- <file>`, `git diff <good>..<bad>`. If it "worked before", run `git bisect run <repro-command>`; it is mechanical and fast.
- **Bisect the data path.** Log or assert the value at the midpoint between the input (known good) and the output (known bad). Repeat until two adjacent steps disagree.
- **Change one variable at a time.** Environment, input, dependency version, config flag.

## 3. Prove the cause

Write down, in one or two sentences: _"X happens because Y, at file:line."_ Then prove it with something you ran:

- Explain every symptom, not just the main one. If a symptom is unexplained, the cause is incomplete.
- Predict: "if this is the cause, then changing Z will make the failure disappear/appear." Run that.
- Hypotheses you ruled out are worth one line each so nobody re-checks them.

## 4. Fix

- Write a failing test that captures the bug **first** (it must fail for the right reason). A failing test you were handed usually checks the symptom; also add one that targets the cause, in the code you change, so the bug cannot return through another caller.
- Fix the cause, not the symptom. Wrapping the crash in `try/catch`, adding a null check where the value should never be null, retrying a deterministic failure, or bumping a timeout are symptom fixes — reject them unless you can justify why the symptom _is_ the bug.
- Keep the fix minimal. Refactors go in a separate change.
- Look for siblings: grep for the same pattern elsewhere. The same mistake is usually made more than once.

## 5. Confirm

- The new test passes; the original repro no longer fails; the surrounding test suite still passes. Show the commands and results.
- For flaky failures: run the test many times (e.g. 50–200 loops) before and after. One green run proves nothing.

## Stop and ask when

- Three fix attempts have failed — your model of the system is wrong. Go back to phase 2 and question an assumption you have not verified.
- The cause is in a dependency, infrastructure, or code you were not asked to touch. Report the evidence and a proposed patch instead of working around it silently.

## Report

```
Symptom:   <what failed, with the exact error>
Repro:     <command>
Cause:     <one or two sentences, file:line>
Evidence:  <what you ran that proves it>
Fix:       <what changed and why it addresses the cause>
Test:      <the test you added for the cause, and how it failed before the fix>
Verified:  <tests/commands run and their results>
Ruled out: <hypotheses eliminated>
```

Never say "this should fix it". Say what you ran and what it showed.

From shankarr1503/omnistack, MIT.

More from shankarr1503/omnistack

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 22, 2026 (6 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from shankarr1503

Cite this page

root-cause skill. Agent Mart. https://agentmart.dev/skills/shankarr1503-root-cause (last updated 2026-10-24)