Skills for Real Engineers. Straight from my .agents directory.
principle-fix-root-causes
Agent skill frombacknotprop/pstack
Apply when debugging. Trace each symptom back to the first place the system went wrong and fix it there. A guard is a fix only when the state it handles is legitimate.
How to install principle-fix-root-causes
npx skills add backnotprop/pstack# or add only this skill to Claude Code: copy the folder
skills/principle-fix-root-causes/
# into
~/.claude/skills/principle-fix-root-causes/ (all projects)
.claude/skills/principle-fix-root-causes/ (one project)
1# Fix Root Causes23When debugging, fix the fault, not the place where it surfaced. The symptom is where a wrong state became visible. The root cause is the first place the system did something it should not do, or failed to handle a state it should handle.45**Why:** A symptom fix hides the evidence and leaves the fault free to surface somewhere else. Each one makes the system harder to reason about, because the code now carries a workaround for a bug that nobody named.67**Pattern:**8- Reproduce first.9- Ask "why" at each step until the answer is a wrong decision in the code, not a consequence of an earlier one.10- When stuck, instrument. Read the actual error and the actual state. Do not guess.11- Ask whether the state that triggered the symptom is legitimate. If the system may be in that state, the code that broke on it is the root cause, and handling the state there is the fix. If the state should never exist, a check where it broke hides the bug. Find what produced the state. Guards, retries, swallowed errors, clamped values, and discarded state are the usual ways to hide a bug.12- When something fails only after a restart, suspect persisted state first: config files, caches, lock files, serialized state.13- Check for the pattern, not just the instance. Find every place with the same fault and fix them all.14- If a workaround needs a paragraph-long comment to justify it, the code is wrong. Fix the code, not the comment.15…
Excerpt shown under the repository's MIT license.
More skills in pstack
Similar skill repositories
An agentic skills framework & software development methodology that works.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Production-grade engineering skills for AI coding agents.
The open-source app everyone uses to manage agents at work
