TDD Methodology

TDD Methodology is a skill for Claude Code from hculap/better-code. It costs 85 tokens per session (1,603 once invoked), scanned A, original, MIT.

A coding method called test-driven development, or TDD, where you write a failing test, add the smallest code that passes it, and then clean up the code.

In plain words
What is it for?
Use it when adding behavior, writing unit tests first, creating regression tests, or refactoring code safely.
Why use it?
It reduces the risk of changing behavior without a test that proves what should happen. The method also keeps coding work in small, checkable steps.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the tdd-dev plugin — 1 skill, 5 commands, 1 agent, 3 hooks shipped together

Good fit Use it when adding behavior, writing unit tests first, creating regression tests, or refactoring code safely.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hculap/better-code/tdd-methodology
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 hculap/better-code --skill tdd-methodology
Clone the repo
git clone --depth 1 https://github.com/hculap/better-code

Made for: Claude Code.

Or install tdd-dev, the plugin that ships this one along with the rest of its 1 skill, 5 commands, 1 agent, 3 hooks.

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 Methodology

README.md
[![agentmods](https://agentmods.dev/badge/skills/hculap/better-code/tdd-methodology/github.svg)](https://agentmods.dev/skills/hculap/better-code/tdd-methodology)
Your own site
<a href="https://agentmods.dev/skills/hculap/better-code/tdd-methodology"><img src="https://agentmods.dev/badge/skills/hculap/better-code/tdd-methodology/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 TDD Methodology

Your own site · 80×15
<a href="https://agentmods.dev/skills/hculap/better-code/tdd-methodology"><img src="https://agentmods.dev/badge/skills/hculap/better-code/tdd-methodology.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,603 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.00085 $0.01603
Opus 5.5 $0.00034 $0.00641
Sonnet 5.5 $0.00017 $0.00321
Haiku 4.5 $0.00009 $0.00160

Measured 2mo ago against content hash efe0fc692705, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

TDD Methodology 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 2mo 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.

plugins/tdd-dev/skills/tdd-methodology/SKILL.md · 225 lines

How it starts

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

TDD Methodology

Transform coding behavior into strict Test-Driven Development practice. Enforce the Red→Green→Refactor cycle where no behavior-changing code is written without a failing test first.

Core Philosophy

TDD is not about testing—it is about design through tests. Tests drive the implementation, not the other way around.

The Iron Rules

  1. No production code without a failing test - Write a test that fails for the right reason before writing any implementation
  2. Minimal code to pass - Write only enough code to make the failing test pass, nothing more
  3. Refactor only when green - Clean up code only after all tests pass
  4. Small increments - Each cycle should be minutes, not hours

The Red→Green→Refactor Loop

┌─────────────────────────────────────────────────┐
│                                                 │
│   RED: Write a failing test                     │
│   ↓                                             │
│   GREEN: Write minimal code to pass             │
│   ↓                                             │
│   REFACTOR: Clean up while staying green        │
│   ↓                                             │
│   (repeat)                                      │
│                                                 │
└─────────────────────────────────────────────────┘

Strictness Modes

Strict Mode (Default)

Block any behavior-changing implementation without a failing test:

  • Refuse to write/edit source files until a failing test exists
  • Enforce test-first for every behavior change
  • No exceptions without explicit user override

Standard Mode

Warn and prompt for confirmation:

  • Alert when attempting to write code without a failing test
  • Ask: "No failing test exists. Proceed anyway? (yes/no)"
  • Log violations for awareness

Relaxed Mode

Coach and suggest without blocking:

  • Recommend writing tests first
  • Provide guidance on TDD approach
  • Allow user to proceed without tests

TDD Workflow Execution

Read the full file on GitHub · 225 lines

Files

What ships with it

4 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. 2mo ago First seen · 225 lines · 85 tokens per session scan A efe0fc692705

Subscribe to this mod's changes

TDD Methodology is a skill published in the GitHub repository hculap/better-code (2 stars, last pushed 21d ago), licensed MIT. It adds 85 tokens to every session and 1,603 once invoked, about $0.0003 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-08-31.

Related

Other skills, from other repositories

setup

Set up or update TDD Guard for the current project. Detects the test framework, installs or updates the matching reporter, and configures or migrates its configuration to match the current specification.

nizos/tdd-guard · 39 tokens

software-code-refactoring

Improve production code quality while preserving all existing test behavior. Commonly used for the Refactor phase of TDD red-green-refactor, but applicable to any codebase with tests. Use when production code works but needs cleanup — reducing duplication, improving naming, simplifying complexity, aligning with…

stencila/stencila · 102 tokens

testing-principles

Language-agnostic testing principles for choosing which tests a change needs, test quality, and proof ownership, with frontend and browser E2E implementation references. Use when writing tests, deciding test scope, or reviewing test quality.

shinpr/claude-code-workflows · 50 tokens

ring:running-dev-cycle

Running the backend dev cycle: implements every task in a rolling-wave plan.md (ring:writing-plans format) for a Go/TS service, driving specialist agents through Gate 0 implementation/TDD, Gate 8 parallel review, and Gate 9 validation per epic, elaborating later phases at each phase boundary. Use when starting or…

LerianStudio/ring · 122 tokens

ring:instrumenting-streaming-events

Instrumenting streaming events: wires lib-streaming event emission end-to-end into a Lerian Go service via a 13-gate cycle (catalog, Builder bootstrap, Emit sites, outbox, HTTP manifest, NoopEmitter fallback, integration and chaos tests), dispatching ring:backend-go under TDD. Consumes the validated…

LerianStudio/ring · 102 tokens

ring:implementing-tasks

Implementing a single planned task (Task N.M.T) end-to-end: selects the right backend agent by language and service type, drives one TDD RED->GREEN turn, then verifies coverage, lint, license headers, runtime, and delivery before handoff. Runs as Gate 0 before ring:reviewing-code. Use to drive ONE task inside an…

LerianStudio/ring · 103 tokens