test-driven-development

test-driven-development is a skill for Claude Code, Codex from damianvtran/local-operator. It costs 48 tokens per session (598 once invoked), scanned A, original, MIT.

A test-first coding method that writes a failing test before production code, then makes it pass and improves the code. TDD means test-driven development.

In plain words
What is it for?
Use it when adding behaviour, fixing a defect, or writing tests. It guides the red-green-refactor cycle: fail, pass, then clean up.
Why use it?
It prevents code from being built on unverified assumptions and turns bugs into lasting regression tests. It also discourages tests that pass for the wrong reason.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding behaviour, fixing a defect, or writing tests. It guides the red-green-refactor cycle: fail, pass, then clean up.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/damianvtran/local-operator/test-driven-development
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.

Any agent
npx skills add damianvtran/local-operator --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/damianvtran/local-operator

Made for: Claude Code, Codex.

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 test-driven-development

README.md
[![agentmods](https://agentmods.dev/badge/skills/damianvtran/local-operator/test-driven-development/github.svg)](https://agentmods.dev/skills/damianvtran/local-operator/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/damianvtran/local-operator/test-driven-development"><img src="https://agentmods.dev/badge/skills/damianvtran/local-operator/test-driven-development/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-driven-development

Your own site · 80×15
<a href="https://agentmods.dev/skills/damianvtran/local-operator/test-driven-development"><img src="https://agentmods.dev/badge/skills/damianvtran/local-operator/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 598 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00048 $0.00598
Opus 5.5 $0.00019 $0.00239
Sonnet 5.5 $0.00010 $0.00120
Haiku 4.5 $0.00005 $0.00060

Measured 5d ago against content hash 516707d441ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-driven-development 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 5d ago.

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.

local_operator/skills/builtin/test-driven-development/SKILL.md · 47 lines

How it starts

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

Test-driven development

Iron law: no production code without a failing test that demands it.

The cycle

  1. RED: write the smallest test for the next bit of behaviour. Run it. Read the failure and confirm it fails for the reason you intended (your assertion), not an import error, a typo, or a missing fixture. A test that fails for the wrong reason proves nothing.
  2. GREEN: write the least production code that passes. Run the test again. Nothing more than the test asks for.
  3. REFACTOR: improve names and structure while all tests stay green. Run them again.

Then the next slice. Cycles are minutes, not hours; commit-sized.

Bugs: reproduce first

  • Turn the bug into a failing test before touching the fix. Watch it fail, fix, watch it pass.
  • If you cannot express the bug as a failing test, you do not understand it yet; switch to skill://systematic-debugging.
  • Keep the repro test after the fix as the regression test. A bug fix without a test that dies when the bug returns is incomplete.

Already wrote the code? Delete it

Code written before its tests is untrusted: nothing was ever observed failing, and its behaviour was never pinned. Delete and re-derive from the tests. Adapting pre-test code to pass tests keeps the untested behaviour hidden inside.

Exception: throwaway exploration deleted before the work starts. Spikes inform; they do not ship.

Anti-patterns

Anti-pattern Why it fails Instead
Mock-heavy tests that assert on the mock Tests the mock; passes while the real component is broken Prefer the real object; fake only at system boundaries; assert the outcome
Assertion-free tests ("it runs") Passes always; proves nothing Assert the observable outcome
Implementation-detail tests (private calls, call order) Break on any refactor; resist change Test behaviour through the public seam
Coverage chasing Volume without discrimination One test per behaviour and per edge
Tests written after, never seen red Cannot distinguish a test from a tautology Run new tests before the code; confirm red
Skipped or xfailed tests left behind Silent coverage hole Fix or delete; never skip quietly

Read the full file on GitHub · 47 lines

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. 5d ago First seen · 47 lines · 48 tokens per session scan A 516707d441ae

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository damianvtran/local-operator (218 stars, last pushed today), licensed MIT. It adds 48 tokens to every session and 598 once invoked, about $0.0002 per session on Opus 5.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-10-11.

Related

Other skills, from other repositories

agent-eval

Use when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual recall) or agent trajectories (tool correctness, completion), or picking an eval framework. NOT building the agent loop, tools or RAG…

ericrisco/rsc-harness · 79 tokens

test-writing

Write tests that catch real regressions — behavior-focused, minimal mocking, edge cases chosen from the code's actual branches. Use when adding tests for new code or backfilling tests for a fix.

jnMetaCode/skillet · 43 tokens

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle with test-first approach.

raphaelmansuy/edgecrab · 33 tokens

resolve-author-fix

Find the root cause, implement a focused fix, and prove behavior with targeted tests and recordings.

omnigent-ai/omnigent · 24 tokens

implement

Use when an approved plan and task list exist and it is time to turn them into working, tested code — the SDD phase after analyze and before verify. Enforces TDD: a failing test comes before the code that makes it pass, one task at a time, appended to a progress ledger that survives compaction. Delegates test tooling…

ericrisco/rsc-harness · 123 tokens

building-agents

Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…

ericrisco/rsc-harness · 85 tokens