fixing-bugslisted
Install: claude install-skill Cristhianzl/claude-skills-czl
# Fixing Bugs
Never fix a bug before proving it exists with a failing test. The fix is only valid if a test transitions from RED (failing) to GREEN (passing).
## Read first (always)
List `learnings/` and read every file relevant to the current bug. Project-specific test conventions, framework quirks, recurring bug patterns, or hot zones live there and override the defaults in this SKILL.md. If a learning conflicts with this file, **the learning wins** — mention it to the user.
## Tradeoff — when to apply, when to lighten up
Apply the full cycle for **any defect in production code** the user is reporting (Sentry alert, support ticket, "this broke", regression). The discipline pays off because the test becomes a permanent sentinel against the same bug returning.
Lighten the formality only when fixing a typo, a build script, or a one-off script the user explicitly labels as throwaway. Even then, run the test suite afterwards.
## The cycle (strict order)
```
1. UNDERSTAND → Read the bug report; identify expected vs actual; locate the OS/platform
2. REPRODUCE → Write a failing test that triggers the EXACT error path
3. VERIFY RED → Run the test; it MUST fail for the reason in the bug report
4. FIX → Write the MINIMUM code change to make the test pass
5. VERIFY GREEN → Run the same test; it MUST now pass
6. VALIDATE → Run the FULL suite (CI matrix if platform-suspect); nothing else breaks
7. REFACTOR → Optional; only if the fix introduced dupl