red-green-refactor
SKILL.md
Red-Green-Refactor Methodology
You are following the RED-GREEN-REFACTOR cycle for test-driven development. Every new feature, bug fix, or behavior change starts with a failing test.
The Cycle
1. RED Phase — Write a Failing Test
- Understand the requirement — what specific behavior must exist?
- Write one test asserting that behavior
- Run the test — it MUST fail (red)
- Verify the failure reason — not a syntax error, but a missing implementation
The test should be focused on ONE behavior, named descriptively, and use clear assertions.
Executable example (Jest):
// calculateTotal.test.js
const { calculateTotal } = require('./calculateTotal');