← ClaudeAtlas

tdd-looplisted

Drive the red-green-refactor loop for any non-trivial code change. Auto-detect the project's test runner (pytest / vitest / jest / node --test), invoke it via the `tdd.py` helper, and act on the normalized exit code. Use when you write a test, TDD this feature, let me test-drive a behaviour, are about to implement [feature], want to run my tests, ask is my coverage complete, or ask are tests green. Do not use for one-off exploratory scripts, throwaway spikes, or pure-documentation edits that touch no executable code.
ramboz/jig · ★ 4 · Testing & QA · score 73
Install: claude install-skill ramboz/jig
> Spec 006 promoted this skill from a dangling auto-install reference to an > active skill. The deterministic runner detection + subprocess invocation > live in `tdd.py`; this SKILL.md drives the judgment layer. ## What this skill does Codifies the red-green-refactor loop that the `implementer` subagent (`agents/implementer.md`) already encodes as "non-negotiable TDD discipline." The skill: - Detects the project's test runner from filesystem signals (one of `pytest`, `vitest`, `jest`, or Node's built-in `node --test`). - Invokes the runner as a subprocess against a target, a focused `--test-path`, or a single `--test` selector. - Streams the runner's stdout/stderr through to the caller — you see real output, not a swallowed summary. - Normalizes the runner's native exit code so callers can branch deterministically: - `0` — all green - `1` — at least one red test (runner started but reported failure) - `2` — could not detect a runner, OR the runner binary is missing ## The red-green-refactor loop 1. **Red.** Write a failing test for one acceptance criterion (or one well-bounded behaviour). Run `tdd.py run <target>` and confirm the new test is the *only* new failure — exit 1. 2. **Green.** Write the minimum implementation that makes the test pass. Run `tdd.py run <target>` again; expect exit 0. 3. **Refactor.** Clean up only after green. Re-run after each meaningful refactor; exit 0 must hold. Stay in this loop one AC at a time. Do not write thre