/agent-skills:root-causefrom agent-skills
Find and prove the cause of a bug, flake or slowdown before anyone fixes it. Builds a tight pass/fail loop that shows the reported symptom, shrinks it to a minimal reproduction, tests 3 to 5 ranked hypotheses that can each be proven false (in parallel worktrees when probes are slow), and ends with a diagnosis, meaning the cause at file and line, the failing test, fix options with their cost and risk, and where the work goes next (a pr-author fix PR, a roadmap fix node, an issue, or security-fix). Works alone or as a parallel-roadmap `diagnose` node. Use this skill whenever the user reports something broken, throwing, failing, flaky, wrong or slow, says "debug" or "why does", when a roadmap worker or pr-review reports "not reproduced" but the symptom stands, or when pr-author finds a bug whose cause is unclear, even if they do not say "root cause".
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A fix is only as good as its cause. This skill finds the cause with evidence and hands a fix-ready diagnosis to whatever ships the fix. It does not fix anything itself, except for the regression test it leaves ready.
The whole method rests on one thing: a command that goes red on this bug. With one, bisection, hypotheses and probes are mechanical. Without one, reading code produces guesses. So most of the effort goes into step 2.
diagnose node: the brief's Goal holds the symptom and its Evidence line holds what is known. The diagnosis goes in the node's outcome.md.python3 <skill>/scripts/loop.py --runs 20 --symptom '<regex>' [--cwd <dir>] -- <command> # tight, slow, flaky, wrong-failure or green
python3 <skills>/pr-review/scripts/repro.py <base> <head> --copy <test> -- <command> # fails on base, passes on head?
python3 <skills>/pr-review/scripts/worktrees.py prepare --base <ref> --head <ref> # two checkouts side by side
python3 <skills>/perf-pass/scripts/bench.py --dir base=<path> --dir a=<path> -- <command> # slow paths: a cost beyond the noise
python3 <skills>/pr-author/scripts/wt.py new <branch> --base <ref> # one worktree per probe
git stash: every worktree shares one stash list..git/root-cause/<slug>/ (the diagnosis, the reproduction, captured traces). Git never commits that folder, so nothing leaks by accident. In a roadmap node, the diagnosis goes in outcome.md and the reproduction in nodes/<id>/repro/ instead.<REDACTED>. Build loops on environment variables so credentials stay out of what you show.Write down the exact symptom: the error text, the wrong value next to the right one, the timing, the rate of a flake. Note where it was seen: commit, version, environment, input. A report is a lead. The code may have moved since.
"A cent too low" and "a missing item" are different bugs. Every later step checks against this exact symptom, so a different failure nearby is not mistaken for it.
Read references/loops.md for the kinds of loop and how to choose. In short, start with a failing test at the seam that reaches the bug. Then try a script against a running server, a CLI run diffed against known-good output, or a browser script. Later options are a replayed trace, a throwaway harness, a property loop, a bisection and a differential run.
Run each candidate through loop.py with --symptom:
For a slowdown, the loop is a benchmark: bench.py on the good and bad commits, with the cost beyond the noise. Logs do not find slowdowns. Measurements do.
2b. When nothing reproduces. The report is usually true and the loop uses the wrong input. Match the symptom: rounding errors point to floating point, ordering errors point to unstable sorts or races. Loop over a range of inputs against an exact computation, try boundaries (0, 1, empty, halves, the largest values), and try the inputs named in the report. If it still does not show after the budget, stop. Ask for access to the environment that shows it, a captured artifact (log, HAR file, core dump, recording with timestamps), or permission to add temporary instrumentation. Do not hypothesize without a loop.
Step 2 is done when you can name one command, already run, with its output shown, that loop.py calls tight (or flaky at a fixed, high rate).
Cut inputs, callers, config, data and steps one at a time, and rerun the loop after each cut. Keep only what the failure needs. Done when removing any remaining part turns the loop green. The minimal reproduction narrows the hypotheses and becomes the regression test.
When the bug appeared between two known states (two commits, two versions, two datasets), run git bisect run with the loop in a worktree. A first bad commit often names the cause outright.
Write 3 to 5 hypotheses before testing any. One hypothesis anchors on the first idea that fits. Each one states its prediction:
If is the cause, then makes the loop green, and makes it worse.
A hypothesis with no prediction is a guess: sharpen it or drop it. Rank by likelihood and by how cheap the probe is.
Show the ranked list to the user before probing, or to the orchestrator as a roadmap worker. They often know which one changed last week, or which they already ruled out. Do not block on it: proceed with your ranking if no answer comes.
Each probe tests one prediction and changes one variable.
[RC-a4f2], so one grep removes them all.Parallel probes. When three or more hypotheses are left, they touch different code, and each probe takes minutes (a build, a long suite, a bisection), test them at once. Give each its own worktree with wt.py new and one agent, and send each agent only its hypothesis, the loop command and the prediction. Cheap probes run one after another: an agent that loads the repo costs more than a short probe. A roadmap worker is a subagent and cannot spawn agents, so it probes one at a time.
When every hypothesis is ruled out, write a new round from what the probes showed. After two rounds, stop and report (see Budget).
A cause is confirmed when three things hold. Changing it turns the loop green. Putting it back turns the loop red. It explains the exact symptom from step 1. Then:
nodes/<id>/repro/ until the fix node moves it into the suite. A failing test in the suite would break every check. Sometimes no seam reaches the real pattern, for example when a unit test cannot rebuild the chain of callers that triggers it. That is a finding: the architecture prevents locking this bug down.Write each realistic fix as an option. For each one give:
bench.py or size_diff.py when the changed code runs often or ships to a browser. A fix that trades speed or bytes for correctness says so with numbers.Recommend the option that fixes the cause at the smallest reach and cost. A workaround (a rounding step, a tolerance, a retry, a sleep, a special case for the reported input) is never the recommendation. List it only to say why not.
Fill in templates/diagnosis.md. Its Evidence part matches the Evidence line of a roadmap brief, so a fix node needs no new research.
| Verdict | Where it goes |
|---|---|
fix-small: clear cause, small fix | pr-author: a fix PR with the regression test, against the branch the policy gives for a fix |
fix-large: clear cause, large or risky fix | A roadmap fix node with a hard dependency on the diagnose node, or an issue when no roadmap runs, written with the issue-author skill. Ask the user before opening an issue. |
no-seam: no test can reach the real pattern | The fix as above, plus a refactor node or inbox entry for the seam |
vulnerability: reported, nothing written | security-fix, through the user only |
no-loop: nothing reproduces within the budget | The user, with what was tried and what to send |
not-a-bug: the code does what it should | The user, with the evidence. The report becomes a docs or feature question. |
wt.py remove. Keep .git/root-cause/<slug>/ until the fix merges.Symptom: cart subtotal is 1 cent low for 3 x $6.665 ("expected 1999, got 1998")
Loop: python3 .git/root-cause/subtotal/repro.py, tight (20/20 red, 0.4s)
Minimal: one line item, price 6.665, quantity 3
Hypotheses: 4 ranked, 3 ruled out; confirmed: float multiply before rounding (src/cart.ts:42, since a1b2c3d)
Seam: src/cart.test.ts, test ready
Options: integer cents (recommended: 3 call sites, no speed change, reverts alone) | round per line (changes totals users have seen)
Verdict: fix-small, next step pr-author fix/subtotal-cents -> main
Cleanup: 0 [RC-a4f2] logs left, probe worktrees removed
Write the diagnosis and all reports by the plain-writing rules if that skill is installed.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub lxsmnsyc/agent-skills --plugin agent-skills17 skills in this plugin
/changesetsWrite the changeset for a change in a repo that releases with changesets (a `.changeset/` folder exists). The bump level follows one question, whether the thing existed before: patch for changed behavior, minor for something new, major only with the maintainer's approval. Use this skill whenever finishing a change, opening a pull request or reviewing one in such a repo, even when nobody asks for a changeset, and when the user asks about bump levels or changelog entries./docs-siteMethod for planning, writing and maintaining a documentation site for a library, CLI, framework, API or app. Splits the site by what the reader needs (learn, do a task, understand, look up) into getting started, guides, concepts and reference, plus examples, troubleshooting, migration and a glossary. Gives each page type a fixed template, including the feature page (what it is, why, how it works, usage, options, limits, related) and the API reference entry. Covers navigation, code examples that run, keeping docs in step with the code, versioned docs and pages agents can read. Includes page templates, a checker script for page structure, links, orphan pages and code fences, and a review checklist. Use this skill whenever writing, restructuring, auditing or reviewing documentation, a docs site, a docs page, a README that has grown into docs, API reference, a getting started page, a migration guide or the docs part of the website/ folder, even if the user does not say "docs site". Load plain-writing with it./fewer-questionsDecide whether a question to the user is worth asking before asking it. Skip a question whose options give the answer away, such as one real option next to declines or weaker copies. Skip a question where "no" leaves nothing to do, such as "Should I proceed?" or "Is the plan ready?", and do the work the user asked for. Ask only when each answer leads to different work, or before an action that is hard to undo, reaches outside the machine or costs money. Includes an optional hook that blocks yes-or-no and proceed questions in AskUserQuestion. Use this skill whenever about to ask the user a question, call AskUserQuestion, offer options, or end a turn with "should I...?", "do you want me to...?" or "let me know if...", even if the user never says "questions"./goal-debateWeigh a goal against what it costs before anyone plans or builds it. A proponent agent proposes the idea and expands it, an opponent agent attacks its weak points and costs, and the orchestrator judges each claim with evidence until the two settle on the structure with the best value for its cost. Costs are weighed on three axes, device capability (storage, RAM, compute), time to deliver and token spend, plus any axis the plan needs. Prior art (papers, public repos, the lab's past attempts) counts as evidence, small capped proofs settle feasibility claims, and research goals end with a hypothesis and success threshold fixed before any run. Unknowns that cannot be measured go to the user as questions. It also weighs an existing roadmap that grows faster than it ships, and proposes which nodes to drop, park or merge. Use this skill when the user wants to evaluate, challenge, debate or sanity-check a goal, idea, proposal, ADR or roadmap, wants to cut scope, asks whether something is worth building or researching, whether it has been done before, or whether it is feasible on their machine, in their time or within a token budget, or before parallel-roadmap plans a large or costly goal, even if they never say "debate"./issue-authorWrite and open GitHub issues that a maintainer can act on, such as bug reports, feature requests and diagnosis handoffs, in the user's repo or someone else's. Searches open and closed issues and pull requests for duplicates first, follows the repo's own issue templates and labels, reproduces a bug on the latest release and on every release line the repo still maintains, and lists which lines it affects. Opens no issue for a bug that shows only in unmaintained versions, and none for a security problem, which goes to a private report or the security-fix skill instead. Use this skill whenever the user asks to open, file, write, draft or report an issue or a bug, when root-cause returns a fix-large verdict, or when pr-author finds a bug too large for a fix PR, even if they do not say "issue"./landing-pageRules for landing pages, homepages and marketing sites of any product, such as a library, CLI, web app, mobile app, API or physical product. The page shows a demo of the product or its effect, with an animated or interactive hero visual chosen from designs the author reviews. It sells the benefit and the difference from competitors instead of describing features. It keeps text short and lets visuals carry the page. It picks the selling points the visitor cares about, uses playful animation or interaction that shows what the product does, and shows who uses it when that proof is strong enough. Includes steps for each kind of product, a word count script and a review checklist. Use this skill whenever designing, writing, building or reviewing a landing page, product homepage, marketing site, the website/ folder of a repo, or a hero section, even if the user does not say "landing page". Load ui-style with it. This skill overrides only the ui-style rule against idle and first-paint animation. Every other ui-style rule still applies.Other plugins' skills for the same job