
TDD loop
Runs a red-green-refactor test loop with auto-detected test runners and exit codes
TDD loop is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- Python
- Platforms
- Claude Code
- GitHub stars
- 6
- Last commit
- License
- MIT
- Listing updated
Similar skills
About TDD loop
This skill guides an agent through test-driven development: write one failing test for a single acceptance criterion, implement the minimum to pass it, then refactor while re-running the suite. It adds a discipline rule for pre-existing tests: when one goes red, the agent should first suspect its own change rather than weaken or skip the test.
A bundled Python helper, tdd.py, handles the mechanics. Its detect subcommand identifies the project's runner among pytest, vitest, jest and Node's built-in node --test, using filesystem signals and a fixed priority order. Its run subcommand executes the suite, optionally scoped to a file or a single test, streams output, and normalizes the result to exit 0 for green, 1 for red and 2 when tests could not run. Projects using other stacks can supply a .jig/test-command file that follows the same exit contract, with a companion reference document of recipes.
The skill expects Python 3 on the path and the project's own test tooling installed; live vitest, jest and node runs need dependencies and Node available, and pytest must be importable. A second helper, quality.py, produces a deterministic snapshot of test-quality signals from a diff for use in review.
When your agent uses it
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.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Runs Python scripts(see the files on GitHub)
- No network calls found in its scripts(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 4 files (62 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the jig plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add ramboz/jig
/plugin install jig@jigOr copy only this skill to ~/.claude/skills/tdd-loop:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/tdd-loop &&
cp -R "$tmp/hosts/claude/skills/tdd-loop" ~/.claude/skills/tdd-loop &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/tdd-loop inside it instead.
Copy the skill folder to ~/.agents/skills/tdd-loop to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/tdd-loop &&
cp -R "$tmp/hosts/claude/skills/tdd-loop" ~/.agents/skills/tdd-loop &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/tdd-loop inside it instead.
Copy the skill folder to ~/.cursor/skills/tdd-loop to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/tdd-loop &&
cp -R "$tmp/hosts/claude/skills/tdd-loop" ~/.cursor/skills/tdd-loop &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/tdd-loop inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/ramboz/jig.git --path hosts/claude/skills/tdd-loopOr copy the folder to ~/.gemini/skills/tdd-loop yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/tdd-loop:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ramboz/jig.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/tdd-loop &&
cp -R "$tmp/hosts/claude/skills/tdd-loop" ~/.copilot/skills/tdd-loop &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/tdd-loop inside it instead.
Get the folder:
git clone --depth 1 https://github.com/ramboz/jig.gitThen copy jig/hosts/claude/skills/tdd-loop into your agent's skills folder as tdd-loop. Agents that support SKILL.md read one folder per skill.
What it does
- Red-green-refactor workflow
- Guides the agent through writing a failing test, minimal implementation and safe refactoring one criterion at a time.
- Automatic runner detection
- Identifies pytest, vitest, jest or node --test from project files and applies a fixed priority.
- Normalized exit codes
- Maps every run to green, red or could-not-run so the agent can branch reliably.
- Focused test runs
- Runs a whole suite, a single test file or one named test through the same helper.
- Custom test command support
- Lets projects on other stacks define their own test command under the same exit contract.
- Protection of existing tests
- Tells the agent to treat a pre-existing failing test as a signal to investigate, not to weaken it.
- Test quality snapshot
- Includes a companion script that reports test-quality ratios from a diff for review.
Good for
- Test-drive a new function before implementing it
- Run the project's tests and report whether they are green
- Check whether a change broke an existing test
- Run only the tests in one file while iterating
- Set up a custom test command for a Gradle or Go project
TDD loop FAQ
What does the skill need to run?
Python 3 for the helper script, and the project's test runner installed. Live vitest and jest runs need node_modules, live node --test runs need Node on PATH, and pytest must be importable.
Which test frameworks are detected automatically?
pytest, vitest, jest and Node's built-in node --test. Other stacks such as Gradle, Maven, Go, Rust and .NET connect through a .jig/test-command file instead.
What do the exit codes mean?
0 means all tests passed, 1 means at least one test ran and failed, and 2 means the tests could not be run, for example because no runner was detected or a binary was missing.
Can TDD loop run only one test?
Yes. The run subcommand accepts a test path or a single test selector, with the selector format depending on the runner.
How do I install TDD loop in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/tdd-loop to use it in all your projects, or to .claude/skills/tdd-loop in one project. Or install the jig plugin, which includes it: /plugin marketplace add ramboz/jig, then /plugin install jig@jig.
Does TDD loop run scripts?
Yes. It runs Python scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use TDD loop?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to TDD loop?
The closest alternatives to TDD loop are TDD, TDD, Mt build, Django TDD and Develop.
Where this comes from
- Description: from the skill's own SKILL.md.
More from ramboz/jig

Walks an agent through diagnosing, proving and fixing a reported bug with a regression
- Open source
- 6 GitHub stars
- Developer tools

Runs a six-category ambiguity audit on a spec and asks up to five questions
- Open source
- 6 GitHub stars
- Developer tools

Runs a static lint pass on Python or Node projects and reports normalized findings
- Open source
- 6 GitHub stars
- Developer tools

Recommends the right contract artifact and validator for each external API surface
- Open source
- 6 GitHub stars
- Developer tools

Builds a standardized prompt for a fresh reviewer subagent to check work against its spec
- Open source
- 6 GitHub stars
- Developer tools

Persists session terms, learnings and lightweight decisions into a project memory layer
- Open source
- 6 GitHub stars
- Knowledge and memory





