bug-fix

Solid

Use this skill when the user wants to fix a bug -- a deviation between current behavior and intended behavior in code that already exists. Triggers on "fix bug", "fix this bug", "diagnose and fix", "investigate this regression", "this is broken". Do NOT use for new features (use `new-spec`) or for refactors that don't fix incorrect behavior.

Code & Development 14 stars 4 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 80/100

Stars 20%
39
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Skill: bug-fix Fix a defect in the smallest, most root-causing way. The discipline is universal: reproduce before fixing, write the failing test first, falsify rival hypotheses before asserting a cause, identify root vs symptom, close the coverage gap that let it through, minimum diff, commit body documents why. ## When to invoke Even a one-line fix benefits from walking this discipline; it forces the question "is this fixing the cause or hiding it?" For multi-file changes that go beyond fixing one defect — refactors, new features triggered by discovering the bug — stop and use `new-spec` instead. This skill is for bug fixes, not opportunistic restructuring. ## Procedure 1. **Reproduce first.** Don't write a fix until you have one of: a failing test, documented manual reproduction steps that fail reliably, or a captured error / stack trace / log signature. No reproduction = no fix; you might be fixing the wrong thing. 2. **Write the failing test (red).** It should pin the *observable contract being violated*, not the current implementation. Push back on these failure modes: - **Mock-shape assertion.** `expect(mock).toHaveBeenCalledWith(...)` when the observable contract is a returned value or state change. Test the contract, not the implementation. (See `quality-engineer`'s "mock-shape assertions" check.) - **Test passes for the wrong reason.** Run the test against the unfixed code; confirm it fails *because of* the bug, not ...

Details

Author
eugenelim
Repository
eugenelim/agent-ready-repo
Created
2 months ago
Last Updated
today
Language
Python
License
Apache-2.0

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category