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-causesHow to use principle-fix-root-causes
- 1.When you encounter a bug, reproduce it consistently first
- 2.Ask "why" repeatedly to trace the symptom to its source
- 3.Resist the urge to add nil-checks or guards; instead fix what causes the nil
- 4.Search the codebase for the same pattern and fix all instances
- 5.If stuck, add logging and instrumentation to understand actual behavior
- 6.For restart-related failures, check and validate persistent state files before changing code
Use cases
- 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
- Backend developers
- Full-stack engineers
- DevOps engineers troubleshooting production issues
- Anyone maintaining legacy codebases with accumulated workarounds
principle-fix-root-causes FAQ
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.
Apply it whenever debugging. It's especially valuable for recurring bugs, restart failures, and code that has accumulated multiple workarounds.
Instrument the code with logging and read actual error messages rather than guessing. Add observability to understand the real behavior, then trace from there.
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.
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.
Related skills
More from cursor/plugins and the wider catalog.

principle-foundational-thinking
Design data structures and core types before writing logic to make downstream code obvious.

principle-guard-the-context-window
Manage finite context by routing bulk data to subagents and keeping summaries in the main thread.

principle-laziness-protocol
Bias toward deletion and minimal changes—apply when refactoring, evaluating diffs, or tempted by abstractions.

principle-make-operations-idempotent
Design operations to converge to correct state regardless of crashes, restarts, or retries.

principle-migrate-callers-then-delete-legacy-apis
Migrate callers and delete legacy APIs in one refactor wave instead of maintaining compatibility layers.

principle-minimize-reader-load
Reduce code complexity by minimizing reader cognitive load—collapse unnecessary layers and shrink mutable state.