ralphctl-test-driven-developmentlisted
Install: claude install-skill lukas-grigis/ralphctl
# Test-Driven Development
> Concept from [Addy Osmani — "Test-Driven Development"](https://github.com/addyosmani/agent-skills)
> (agent-skills, MIT). Adapted for ralphctl's execute phase.
Write a failing test before writing the code that makes it pass. For bug fixes, reproduce the bug with a
test before attempting a fix. Tests are proof — "seems right" is not done. A codebase with good tests is an
AI agent's superpower; a codebase without tests is a liability.
## When this applies
- **Execute** — any new logic, bug fix, or behavioural change. Follow the RED→GREEN→REFACTOR cycle for each
unit of work. Run the project's narrow check after each step; emit `<task-complete>` once the task's
acceptance criteria are met. The harness runs the post-task verify gate — you do not own that verdict.
**When NOT to use:** Pure configuration changes, documentation updates, or static content changes with no
behavioural impact.
## The TDD Cycle
```
RED GREEN REFACTOR
Write a test Write minimal code Clean up the
that fails ──→ to make it pass ──→ implementation ──→ (repeat)
│ │ │
▼ ▼ ▼
Test FAILS Test PASSES Tests still PASS
```
### Step 1: RED — Write a Failing Test
Write the test first. It must fail. A test that passes immediately proves nothing.
```typescript
// RED: This test fails because createTask doesn't exist yet
describe('Tas