Claude Skill

principle-fix-root-causes

Apply when debugging. Trace each symptom to its root cause and fix it there; reproduce first, ask why until you reach it, resist nil-check guards that silence crashes.

LLM Mart · 0 points · 1 views 0 listing impressions 0 install-command copies
Download michael-denyer-pstack-claude-plugins_pstack_skills_principle-fix-root-causes-356c6e0.zip · 0 KB

Install

skills CLI npx skills add https://github.com/michael-denyer/pstack-claude/tree/main/plugins/pstack/skills/principle-fix-root-causes
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install michael-denyer-pstack-claude@llmmart
Git git clone https://github.com/michael-denyer/pstack-claude.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole michael-denyer/pstack-claude collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Fix Root Causes

When 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.

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.

Pattern:

  • Reproduce first.
  • Ask "why" at each step until the answer is a wrong decision in the code, not a consequence of an earlier one.
  • When stuck, instrument. Read the actual error and the actual state. Do not guess.
  • 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.
  • When something fails only after a restart, suspect persisted state first: config files, caches, lock files, serialized state.
  • Check for the pattern, not just the instance. Find every place with the same fault and fix them all.
  • If a workaround needs a paragraph-long comment to justify it, the code is wrong. Fix the code, not the comment.
  • If the deciding fact took a deep dig to find, propose the cheap, always-on signal that would have shown it at first look.
Files (pstack-claude)
  • SKILL.md 1.8 KB
    ---
    name: principle-fix-root-causes
    description: "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."
    user-invocable: false
    ---
    
    # Fix Root Causes
    
    When 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.
    
    **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.
    
    **Pattern:**
    - Reproduce first.
    - Ask "why" at each step until the answer is a wrong decision in the code, not a consequence of an earlier one.
    - When stuck, instrument. Read the actual error and the actual state. Do not guess.
    - 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.
    - When something fails only after a restart, suspect persisted state first: config files, caches, lock files, serialized state.
    - Check for the pattern, not just the instance. Find every place with the same fault and fix them all.
    - If a workaround needs a paragraph-long comment to justify it, the code is wrong. Fix the code, not the comment.
    - If the deciding fact took a deep dig to find, propose the cheap, always-on signal that would have shown it at first look.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.