diff --git a/.factory-plugin/marketplace.json b/.factory-plugin/marketplace.json index 4282159..87a7e25 100644 --- a/.factory-plugin/marketplace.json +++ b/.factory-plugin/marketplace.json @@ -53,6 +53,12 @@ "description": "Pull request lifecycle skills: create PRs with consistent conventions and follow up on them until merge-ready", "source": "./plugins/code-review", "category": "productivity" + }, + { + "name": "fix-root-causes", + "description": "Debugging guardrail: fix the fault where the system first went wrong, not where the symptom surfaced", + "source": "./plugins/fix-root-causes", + "category": "quality" } ] } diff --git a/README.md b/README.md index 9793470..ea4deaa 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,14 @@ Skills for continuous learning and improvement. Autonomous experiment loop for optimization research. Try an idea, measure it, keep what works, discard what doesn't, repeat. Works standalone or as a mission worker. +### fix-root-causes + +Debugging guardrail: trace each symptom back to the first place the system went wrong and fix it there. + +**Skills:** + +- `fix-root-causes` - Fix the fault, not the place where it surfaced + ## Plugin Structure Each plugin follows the Factory plugin format: diff --git a/plugins/fix-root-causes/.factory-plugin/plugin.json b/plugins/fix-root-causes/.factory-plugin/plugin.json new file mode 100644 index 0000000..e3bad21 --- /dev/null +++ b/plugins/fix-root-causes/.factory-plugin/plugin.json @@ -0,0 +1,8 @@ +{ + "name": "fix-root-causes", + "description": "Debugging guardrail: fix the fault where the system first went wrong, not where the symptom surfaced", + "author": { + "name": "yifu zuo", + "email": "yzuo.2019@gmail.com" + } +} diff --git a/plugins/fix-root-causes/README.md b/plugins/fix-root-causes/README.md new file mode 100644 index 0000000..7509609 --- /dev/null +++ b/plugins/fix-root-causes/README.md @@ -0,0 +1,9 @@ +# fix-root-causes + +Debugging guardrail: trace each symptom back to the first place the system went wrong and fix it there. + +**Skills:** + +- `fix-root-causes` - Fix the fault, not the place where it surfaced + +Adapted from the pstack skills by Lauren Tan ([cursor/plugins](https://github.com/cursor/plugins), MIT License), with Cursor-specific tooling removed and Droid conventions applied. diff --git a/plugins/fix-root-causes/skills/fix-root-causes/SKILL.md b/plugins/fix-root-causes/skills/fix-root-causes/SKILL.md new file mode 100644 index 0000000..3d223ab --- /dev/null +++ b/plugins/fix-root-causes/skills/fix-root-causes/SKILL.md @@ -0,0 +1,20 @@ +--- +name: 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." +--- + +# 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. diff --git a/skills/fix-root-causes b/skills/fix-root-causes new file mode 120000 index 0000000..277e29d --- /dev/null +++ b/skills/fix-root-causes @@ -0,0 +1 @@ +../plugins/fix-root-causes/skills/fix-root-causes \ No newline at end of file