root-cause
Finds and fixes the actual cause of a bug instead of patching the symptom at the place it was reported. Use when debugging an error, a failing test, a crash, or wrong output, and when a bug report names one caller, page, or input. Traces the failure back to where the bad state originates and fixes it once there.
- License 许可
- MIT
- 所属仓库
- Xnadir/vetted
- 最近更新
- 2026-10-30
- Stars
- ★ 5
- Forks
- 8
01 前言 Front Matter
- name
- root-cause
- license
- MIT
- description
- Finds and fixes the actual cause of a bug instead of patching the symptom at the place it was reported. Use when debugging an error, a failing test, a crash, or wrong output, and when a bug report names one caller, page, or input. Traces the failure back to where the bad state originates and fixes it once there.
03 SKILL.md 正文
Root cause
A bug report describes where the failure showed up, which is rarely where it started. Patching the reported spot makes that one symptom disappear while the cause keeps producing others, often in callers nobody has reported yet.
Loop
- Reproduce first. Get the failure to happen on demand: a failing test, a command, a specific input. If you can't reproduce it, say so and gather more information before changing code. A fix you can't reproduce is a guess.
- Trace backwards. From the point of failure, follow the bad value to where it was produced. Ask "where did this value come from?" until you reach the first place where the state was already wrong.
- Check the blast radius. Search for every other caller or path through the faulty code. If three callers share one broken function, the fix belongs in the function, not in the caller that happened to be reported.
- Fix at the source. Make the change where the bad state originates. Prefer one guard in the shared function over one guard per caller.
- Prove it. Re-run the reproduction and show that it now passes. Where the project has tests, add one that fails without the fix.
Hypotheses, not hunches
When the cause isn't obvious, write down your hypothesis and the observation that would confirm or refute it, then make that observation (a log line, a debugger step, a narrower test). Change one thing at a time.
If two fixes in a row haven't worked, stop editing. Re-read the error from scratch and list the assumptions you've been making; one of them is wrong.
Patching the symptom is sometimes right
Sometimes the source is out of reach, such as a third-party library or another team's service. Then patch at the boundary, and say explicitly that it's a workaround, where the real cause lives, and what a proper fix would need.
04 同仓库更多 Skills
prove-it
Separates what was checked from what was only written before a coding task is reported as done. Use when finishing a code change, bug fix, or refactor, and before saying anything is fixed, working, passing, or complete. Pairs each claim with the command and output that backs it, and lists what was not verified.
handoff
Writes a handoff note that lets a fresh agent session or a teammate resume the current task without re-reading the conversation. Use when the user asks for a handoff, summary for later, or context dump, or before ending a long session, switching machines, or clearing context mid-task.
grill
Interviews the user about an under-specified feature, project, or plan before any code is written, one decision at a time with a recommended answer for each. Use when the user asks to be grilled, interviewed, or questioned about requirements, a plan, or a design before building.
bug-hunt-review
Reviews code or a diff for real defects, meaning inputs or states that produce wrong results, crashes, data loss, or security holes, and reports each with a concrete failure scenario. Use when asked to review code, a pull request, a diff, or a change before merge. Leaves out style nitpicks unless asked.
surgical
Keeps code changes to the smallest diff that fully solves the request. Use when editing existing code to fix a bug, add a feature, or respond to review, especially in files with unrelated code nearby. Prevents drive-by refactors, reformatting, renames, and "while I'm here" cleanups that make diffs hard to review.
stdlib-first
Solves small programming problems with the language's standard library, platform features, or already-installed packages before adding a new dependency. Use when writing code that could pull in a package (dates, deep clone, UUIDs, HTTP, arg parsing, formatting, validation), or when the user asks which library to use.