From wm
Red-Green-Refactor cycle for bug fixes. Before fixing a bug, first write a failing test that reproduces it (Red), then make the minimal change to pass (Green), then clean up the code (Refactor). Use on any bug fix, error correction, failing test repair, or when user says "fix this bug".
How this skill is triggered — by the user, by Claude, or both
Slash command
/wm:red-green-refactorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Fix bugs test-first. Never change production code before proving the bug with a test.
Fix bugs test-first. Never change production code before proving the bug with a test.
| Phase | Action | Rule |
|---|---|---|
| Red | Write a test that fails because of the bug | The test must pass after the fix but fail before it. If you can't write a failing test, you don't understand the bug yet — ask the user. |
| Green | Make the minimal code change to pass the test | One change at a time. No refactoring yet. No scope creep. |
| Refactor | Clean up: extract methods, improve names, remove duplication | Do not change behavior. The test from Red must still pass. |
fix: prefix (see impl-commit). The message describes the bug, not the fix.npx claudepluginhub popoffvg/dotfiles --plugin wmCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.