PluginBench
Skill
Pass
Audit score 90

principle-fix-root-causes

cursor/plugins

Trace bugs to root causes instead of patching symptoms during debugging.

What is principle-fix-root-causes?

A debugging principle that emphasizes finding and fixing the underlying cause of each bug rather than adding defensive guards or workarounds. Apply this when troubleshooting to reduce technical debt and make systems easier to reason about.

  • Reproduce the issue first before attempting fixes
  • Use iterative "why" questioning to identify root causes
  • Avoid nil-checks and guards that mask crashes
  • Check for patterns across the codebase, not just individual instances
  • Instrument code with logging when stuck rather than guessing
  • Suspect stale persistent state (config, cache, locks) in restart-related bugs

How to install principle-fix-root-causes

npx skills add https://github.com/cursor/plugins --skill principle-fix-root-causes
Claude Code
Cursor
Windsurf
Cline

How to use principle-fix-root-causes

  1. 1.When you encounter a bug, reproduce it consistently first
  2. 2.Ask "why" repeatedly to trace the symptom to its source
  3. 3.Resist the urge to add nil-checks or guards; instead fix what causes the nil
  4. 4.Search the codebase for the same pattern and fix all instances
  5. 5.If stuck, add logging and instrumentation to understand actual behavior
  6. 6.For restart-related failures, check and validate persistent state files before changing code

Use cases

Good for
  • Debugging a crash that keeps recurring despite multiple defensive checks
  • Investigating why an application behaves differently after restart
  • Tracing a symptom through multiple layers to find where it originates
  • Refactoring code that has accumulated many workarounds and comments
  • Identifying systematic issues by finding the same bug pattern in multiple places
Who it's for
  • Backend developers
  • Full-stack engineers
  • DevOps engineers troubleshooting production issues
  • Anyone maintaining legacy codebases with accumulated workarounds

principle-fix-root-causes FAQ

What's the difference between a symptom fix and a root-cause fix?

A symptom fix (like a nil-check guard) silences the crash but leaves the underlying problem. A root-cause fix addresses why the nil exists in the first place, eliminating the problem entirely.

When should I use this principle?

Apply it whenever debugging. It's especially valuable for recurring bugs, restart failures, and code that has accumulated multiple workarounds.

What if I can't find the root cause?

Instrument the code with logging and read actual error messages rather than guessing. Add observability to understand the real behavior, then trace from there.

Should I always fix every instance of a pattern?

Yes. Once you identify a pattern causing the bug, grep for it across the codebase and fix all instances to prevent the same issue elsewhere.

How do I handle restart-related bugs?

Suspect stale persistent state first: clear config files, caches, lock files, or serialized state. If that restores behavior, the fix is state validation, not code changes.

Full instructions (SKILL.md)

Source of truth, from cursor/plugins.


name: principle-fix-root-causes description: "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." disable-model-invocation: true

Fix Root Causes

When debugging, do not fix symptoms. Trace every problem to its root cause and fix it there.

Why: Symptom fixes accumulate. Each workaround makes the system harder to reason about, and the real bug remains. Root-cause fixes are slower upfront but reduce total debugging time.

Pattern:

  • Reproduce first
  • Ask "why" until you hit the root cause
  • Do not add guards (adding a nil check to silence a crash is a symptom fix)
  • If a workaround needs a paragraph-long comment to justify it, the code is wrong (fix the code, not the comment)
  • Check for the pattern, not just the instance (grep for the same pattern, fix all instances)
  • When stuck, instrument. Don't guess (add logging, read the actual error)

Restart bugs: suspect state before code

When something "fails after restart," suspect stale persistent state first: config files, caches, lock files, serialized state. If clearing a state file restores behavior, prioritize state validation as the fix.