From greymatter
Guides implementation of features and bug fixes using the red-green-refactor TDD cycle: write failing test first, minimal code to pass, then refactor.
How this skill is triggered — by the user, by Claude, or both
Slash command
/greymatter:test-driven-developmentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Write the test. Watch it fail. Write minimal code to pass.
Write the test. Watch it fail. Write minimal code to pass.
Core principle: if you didn't watch the test fail, you don't know if it tests the right thing.
Iron law: no production code without a failing test first.
One minimal test of the behavior you want. Concrete inputs and expected outputs.
A test that errors with "function not defined" is correct red. A test that errors with "module not found" or a typo is broken — fix it before proceeding. A test that passes immediately is not testing the new behavior — fix the test.
Smallest implementation that makes the test pass. Resist abstractions. If returning a hardcoded value passes the test, return the hardcoded value — the next test will force generalization.
Tests stay green. Rename for clarity, extract obvious duplication, remove dead code. No behavior changes.
One test at a time. New behavior → new test → red → green → refactor.
"Skip TDD just this once" is a rationalization. Stop.
npx claudepluginhub advenire-consulting/greymatter --plugin greymatterEnforces strict Test-Driven Development (TDD): write failing test first for features, bug fixes, refactors before any production code.
Enforces strict Test-Driven Development (TDD): write failing tests first, verify failure, add minimal passing code, refactor for features, bugfixes, refactors.
Enforces strict TDD: write minimal failing test first for features/bugfixes/refactors, verify failure, add minimal passing code, refactor while green. Prevents untested code.