principle-fix-root-causes
WHEN debugging a reproducible defect or distinguishing competing causes; NOT for removing legitimate guards or widening authorized scope; repairs the evidenced cause and rechecks the failure.
- License 许可
- MIT
- 所属仓库
- mintuz/skills
- 最近更新
- 2026-11-10
- Stars
- ★ 35
- Forks
- 7
01 前言 Front Matter
- name
- principle-fix-root-causes
- description
- WHEN debugging a reproducible defect or distinguishing competing causes; NOT for removing legitimate guards or widening authorized scope; repairs the evidenced cause and rechecks the failure.
03 SKILL.md 正文
Fix root causes
Fix the mechanism that produces the failure, not just the surface that exposes it.
- Reproduce the failure and capture the actual error, state and execution path. Separate observations from hypotheses; use bounded instrumentation when the decisive fact is missing.
- Trace the symptom to its owning state or contract. Compare plausible causes with an experiment that distinguishes them. A restart failure makes persisted state worth inspecting; clearing a disposable fixture is evidence, not proof or permission to delete user data.
- Apply the narrow repair within the authorized scope. Preserve guards that enforce valid contracts or handle legitimate absent/error states. A guard that only hides a broken invariant needs a causal repair, not blanket removal of defensive code.
- Search for the same mechanism and affected callers. Fix owned instances when authorized; report broader findings separately. Preserve data and unrelated work.
- Leave a regression check that exposes the cause, then repeat the original failing sequence and relevant caller/lifecycle cases. If diagnosis required a deep search, propose a cheap signal that would reveal this failure earlier.
Distinct from: principle-attack-the-premise (two or more fixes sharing an assumption have failed), principle-capture-the-baseline (recording the pre-change state before a change), principle-prove-it-works (claiming a result is fixed or working).
Done: evidence explains the failure and the repair survives the original check, or the unresolved cause and next discriminating observation are explicit. Never label a workaround or static check as runtime proof.
04 同仓库更多 Skills
xstate
WHEN React state changes in response to an external answer — async submit, in-flight or loading flags, retries, cancellation, polling, optimistic updates, stale responses — or to an interaction with an interruptible middle, such as a drag or a gesture; or WHEN building, reviewing, testing, or visualising XState 5 actors and @xstate/react integrations; NOT for a value one event sets completely, such as a text draft, a focus flag, or a plain open and closed toggle; models typed lifecycles and renders legal Mermaid stateDiagram-v2 charts.
web-design
WHEN refining UI layout, typography, color, or polish; NOT code implementation; provides concise principles for intentional, legible design.
tailwind
WHEN building design systems or component libraries with Tailwind CSS; covers design tokens, CVA patterns and dark mode.
refactoring
WHEN you need a plan to refactor, restructure, or clean up working code and the test result is known, either green or a recorded failing set; NOT for new feature delivery or any behavior change; reversible-baseline safety with prioritized improvements.
react
WHEN building or changing React components, pages, hooks, effects, or apps, including edits to existing components; NOT for test code (react-testing) or styling (css, tailwind); enforces scalable architecture, state management, API layer, performance patterns.
react-testing
WHEN testing React components/hooks/context with React Testing Library; NOT e2e; covers renderHook, providers, forms, and anti-patterns.