test-driven-development

test-driven-development is a skill for Claude Code, Codex from ravila4/claude-adhd-skills. It costs 39 tokens per session (1,032 once invoked), scanned A, original, MIT.

A test-driven development guide. TDD means writing a failing test first, adding the smallest code that passes it, and then cleaning up the result.

In plain words
What is it for?
Use it when implementing features or bug fixes involving validation, transformations, state changes, error handling, business rules, or algorithms.
Why use it?
It helps catch logic errors early while avoiding unnecessary tests for simple data structures, configuration, or thin wrappers.

Skill for Claude CodeCodex

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

Good fit Use it when implementing features or bug fixes involving validation, transformations, state changes, error handling, business rules, or algorithms.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ravila4/claude-adhd-skills/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 ravila4/claude-adhd-skills --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/ravila4/claude-adhd-skills

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/ravila4/claude-adhd-skills/test-driven-development.svg)](https://agentmods.dev/skills/ravila4/claude-adhd-skills/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/ravila4/claude-adhd-skills/test-driven-development"><img src="https://agentmods.dev/badge/skills/ravila4/claude-adhd-skills/test-driven-development.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,032 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.00039 $0.01032
Opus 5 $0.00019 $0.00516
Sonnet 5 $0.00008 $0.00206
Haiku 4.5 $0.00004 $0.00103

Measured 8d ago against content hash ee77a11244c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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.

skills/test-driven-development/SKILL.md · 146 lines

How it starts

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

Test-Driven Development (TDD)

The Two Gates

Before writing any code, pass it through two gates:

  1. The Logic Gate — Triage. Does this piece contain logic?
  2. The Iron Rule — For everything that passes the Logic Gate, strict TDD applies.
flowchart TD
    A[New code to write] --> B[Decompose into pieces]
    B --> C{{"Logic Gate: Does this piece contain logic?"}}
    C -->|"Conditionals, transformations, validation, state changes, error handling"| D["Iron Rule: TDD"]
    C -->|"Dataclasses, config, thin wrappers, type aliases, formatting"| E[Write directly]
    D --> F["RED: Write failing test"]
    F --> G["GREEN: Minimal implementation"]
    G --> H["REFACTOR: Clean up"]
    H --> I{More pieces?}
    E --> I
    I -->|Yes| C
    I -->|No| J[Done]

Gate 1: The Logic Gate

Decompose the work into its constituent pieces. For each piece, ask: does this contain logic?

Passes the Logic Gate (requires TDD):

  • Conditionals and branching
  • Data transformations and computations
  • Validation and parsing
  • State management and transitions
  • Error handling with recovery logic
  • Business rules and domain logic
  • Algorithm implementations

Does NOT pass the Logic Gate (write directly):

  • Dataclasses, NamedTuples, TypedDicts (pure data declarations)
  • Type aliases and protocol definitions
  • Configuration and constants
  • Thin wrappers that only delegate (no branching, no transformation)
  • Plot formatting and visual styling
  • Boilerplate (__init__.py, module-level setup)
  • String templates and static content

When in doubt: If you can't point to a conditional, transformation, or state change, it probably doesn't pass the Logic Gate.

Triage Output

Before writing code, briefly identify what passes and what doesn't:

  • "These pieces contain logic and need TDD: X, Y"
  • "These are declarations/glue and can be written directly: Z"

Gate 2: The Iron Rule

For code that passes the Logic Gate: never write logic without a preceding failing test.

Read the full file on GitHub · 146 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. 8d ago First seen · 146 lines · 39 tokens per session scan A ee77a11244c9

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository ravila4/claude-adhd-skills (147 stars, last pushed 6mo ago), licensed MIT. It adds 39 tokens to every session and 1,032 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

test-driven-development

Drives development with tests. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality.

addyosmani/agent-skills · 50 tokens

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code.

obra/superpowers · 17 tokens

writing-skills

A guide for creating and testing reusable instructions for AI agents, called skills. It applies test-driven development, or TDD—the practice of writing tests before implementation—to instruction documents.

jnMetaCode/superpowers-zh · 23 tokens

test-driven-development

Test-driven development, or TDD, is a way to build software by writing a test that fails, adding the smallest code that makes it pass, and then cleaning up the code. These instructions require that process for features, bug fixes, refactors, and behavior changes.

jnMetaCode/superpowers-zh · 20 tokens

skillshare-implement-feature

Implement a feature from a spec file or description using TDD workflow. Use this skill whenever the user asks to: add a new CLI command, implement a feature from a spec, build new functionality, add a flag, create a new internal package, or write Go code for skillshare. This skill enforces test-first development…

runkids/skillshare · 114 tokens

old-coder

Evidence-first development — surround the implementation with an executable spec and a gauntlet of constraints (tests, types, coverage, mutation) so line-by-line review becomes optional. Use when the user explicitly asks for high-assurance or evidence-first work ("reliable", "TDD", "prove it works", "I won't read the…

AmazingAng/old-coder · 116 tokens