tdd-loop

tdd-loop is a skill for Claude Code, Codex from ramboz/jig. It costs 125 tokens per session (2,697 once invoked), scanned A, original, MIT.

A coding workflow that uses TDD, or test-driven development: write a failing test, make it pass, then improve the code.

In plain words
What is it for?
It is for detecting a project’s test runner, running focused or full tests through a helper script, confirming the new failure, and guiding implementation and refactoring.
Why use it?
It provides a repeatable way to connect each code change to an expected behavior and reports test results with consistent exit codes.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the jig plugin — 20 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ramboz/jig/tdd-loop
Any agent
npx skills add ramboz/jig --skill tdd-loop
Clone the repo
git clone --depth 1 https://github.com/ramboz/jig

Made for: Claude Code, Codex.

Or install jig, the plugin that ships this one along with the rest of its 20 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tdd-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/ramboz/jig/tdd-loop.svg)](https://agentmods.dev/skills/ramboz/jig/tdd-loop)
Your own site
<a href="https://agentmods.dev/skills/ramboz/jig/tdd-loop"><img src="https://agentmods.dev/badge/skills/ramboz/jig/tdd-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,697 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00125 $0.02697
Opus 5 $0.00063 $0.01349
Sonnet 5 $0.00025 $0.00539
Haiku 4.5 $0.00013 $0.00270

Measured today against content hash b27746b44d23, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tdd-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

The scan reads SKILL.md. This mod also ships 2 executable files (quality.py, tdd.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

hosts/claude/skills/tdd-loop/SKILL.md · 206 lines

How it starts

The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 three tests and then three implementations — the loop's value is the tight feedback cycle.

When a test you did NOT just write goes red

The Green step above is about the new failing test you wrote for this AC — making it pass is the work. A pre-existing test going red is the opposite signal: it is a guard reporting that your change touched something load-bearing. The reflex to "make it green" is wrong here, and an agent is very good at satisfying it — deleting the assertion, loosening the expectation, or marking the test skipped all turn the light green while removing the protection.

Read the full file on GitHub · 206 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +14 lines b27746b44d23
  2. 3d ago First seen · 192 lines · 125 tokens per session scan A 7e754c47e208

Subscribe to this mod's changes

tdd-loop is a skill published in the GitHub repository ramboz/jig (6 stars, last pushed 3d ago), licensed MIT. It adds 125 tokens to every session and 2,697 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

motherduck-build-cfa-app

Design a MotherDuck-backed customer-facing analytics app. Use for embedded analytics, multi-tenant SaaS reporting, or product analytics for external users -- whenever the decision depends on per-customer isolation, backend routing, service-account boundaries, read scaling, or Hypertenancy-style patterns.

motherduckdb/agent-skills · 63 tokens

motherduck-build-dashboard

Build a live MotherDuck dashboard as a Dive. Use when composing one shareable KPI, trend, and breakdown story over existing MotherDuck data, especially when the result should stay a saved workspace artifact rather than a full application.

motherduckdb/agent-skills · 50 tokens

motherduck-build-data-pipeline

Design an end-to-end MotherDuck data pipeline. Use for ETL/ELT workflows -- choosing raw, staging, and analytics boundaries, bulk ingestion paths, transformation sequencing, dlt/dbt integration, publication targets, or whether DuckLake is actually required.

motherduckdb/agent-skills · 59 tokens

motherduck-connect

Connect to MotherDuck from any application. Use when setting up database connectivity via the Postgres endpoint (recommended), pgduckdb, native DuckDB API, or JDBC. Covers connection strings, authentication, SSL, and environment variable configuration.

motherduckdb/agent-skills · 52 tokens

motherduck-create-dive

Create, edit, manage, share, or embed MotherDuck Dives — live React + SQL dashboards, charts, and data apps saved in the workspace. Use for any dashboard, chart, KPI display, or data visualization over MotherDuck data, and for Dive authoring mechanics such as getdiveguide, useSQLQuery, local preview, version history…

motherduckdb/agent-skills · 95 tokens

motherduck-create-flight

Create, schedule, run, and debug MotherDuck Flights — Python jobs that run on MotherDuck compute. Use whenever someone wants to create a flight, schedule a Python script or recurring job on MotherDuck, set up scheduled ingestion from Postgres, dlt sources, S3, BigQuery, Snowflake, or APIs, refresh aggregates or…

motherduckdb/agent-skills · 106 tokens