harness/plugins/work-manager/common/skills/red-green-refactor/SKILL.md
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".
npx skillsauth add popoffvg/dotfiles red-green-refactorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.tools
Improve a whole CLAUDE.local.md — the private, per-project rules captured from user corrections. Wraps each conditional rule in a <task-relevant> block so it only surfaces for matching work, merges duplicates, generalizes one-off facts, drops stale entries, and routes raw project facts to engram. Use when the user says "improve claude.local", "clean up the local rules", "claude.local is bloated", or after the Stop hook has appended many rules.
testing
WM pipeline and conventions shared across all phases. Agents must read this before spec, impl, or verify work.
development
One entry point for spec writing, implementation, and bug fixing. Default is new (write spec → grill loop → produce notes → author TODO bodies). Other subcommands: verify (audit), revise (sync to shipped), prototype (settle a decision), code-map (diagram), impl (execute one TODO), fix (analyze cause, correct thoughts, fix behavior), help (this page). Invoke as /code <subcommand>.
tools
One entry point for all testing work. Use when the user wants to design a test strategy (pairwise tiering across unit/integration/manual), enumerate scenarios + a coverage matrix before implementation, audit/score an existing test set for missed cases, apply black-box techniques (equivalence partitioning, boundary values, decision tables, state transition, state-combination), write BDD Given/When/Then scenarios, drive a feature/bug-fix spec-before-code (TDD), test a harness plugin in isolation, or run the verify phase where the user reviews an implementation. Invoke as `/test-suite <subcommand>`.