tdd

tdd is a skill for Claude Code, Codex from astordu/qoderharness. It costs 53 tokens per session (874 once invoked), scanned A, original, MIT.

A test-driven development workflow, commonly called TDD, where you write a failing test, add the smallest code that makes it pass, and then repeat. Tests check behavior through a public interface rather than private implementation details.

In plain words
What is it for?
Use it to build features or fix bugs one behavior at a time, agree where behavior will be tested, write independent expectations, and keep the tests as a readable description of the requirements.
Why use it?
It keeps tests focused on what users need and makes them more likely to survive code changes. It also avoids writing large batches of tests for behavior that has not yet been understood.

Skill for Claude CodeCodex

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/astordu/qoderharness/tdd
Any agent
npx skills add astordu/qoderharness --skill tdd
Clone the repo
git clone --depth 1 https://github.com/astordu/qoderharness

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 tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/astordu/qoderharness/tdd.svg)](https://agentmods.dev/skills/astordu/qoderharness/tdd)
Your own site
<a href="https://agentmods.dev/skills/astordu/qoderharness/tdd"><img src="https://agentmods.dev/badge/skills/astordu/qoderharness/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 874 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.00053 $0.00874
Opus 5 $0.00026 $0.00437
Sonnet 5 $0.00011 $0.00175
Haiku 4.5 $0.00005 $0.00087

Measured 4d ago against content hash 5fbf7ac7e229, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tdd 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 4d 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.

.qoder/skills/tdd/SKILL.md · 37 lines

What it actually says

测试驱动开发(Test-Driven Development)

TDD 就是 红 → 绿 的循环。这个技能是那份让循环产出值得保留的测试的参考:什么才是好测试、测试放在哪里、有哪些反模式、以及循环的规则。每一节都适用于每一个循环——在循环之前和之中查阅它们,而不是之后。

在探索代码库时,阅读 CONTEXT.md(如果存在),使测试名称和接口词汇与项目的领域语言一致,并尊重你所触及区域内的 ADR。

什么才是好测试

测试通过公共接口验证行为,而不是实现细节。代码可以彻底改变;测试不应随之改变。一个好测试读起来像一份规格说明——"user can checkout with valid cart(用户可以用有效购物车结账)"就精确地告诉你存在什么能力——并且因为不在意内部结构而能在重构中存活。

示例见 tests.md,mock 指南见 mocking.md

接缝(Seam)——测试放在哪里

接缝(seam) 是你在其上进行测试的公共边界:在这个接口上,你观察行为而不伸手进入内部。测试活在接缝处,永不针对内部实现。

只在预先约定好的接缝处测试。 在写任何测试之前,先写下待测的接缝并与用户确认。任何测试都不在未经确认的接缝处编写。你无法测试一切——事先约定好接缝,正是让测试精力落在关键路径和复杂逻辑上、而非每一个边界情形的方式。

问:“公共接口是什么,我们应该在哪些接缝上测试?”

反模式

  • 与实现耦合——mock 内部协作者、测试私有方法,或通过旁路信道验证(查询数据库而不是使用接口)。破绽:当你重构时测试挂了,但行为并没有变。
  • 同义反复(Tautological)——断言以代码计算的同样方式重新计算了期望值(expect(add(a, b)).toBe(a + b)、一份以同样方式手工推导出的快照、一个断言等于自身的常量),于是它按构造即成立、永远不可能与代码产生分歧。期望值必须来自一个独立的真值来源——一个已知正确的字面量、一个手工推演过的例子、规格说明。
  • 横向切片——先写完所有测试,再写完所有实现。批量测试验证的是 想象中 的行为:你测的是事物的 形状 而非面向用户的行为,测试对真实改动变得迟钝,而且你在理解实现之前就把测试结构定死了。改为按 纵向切片 工作——一个测试 → 一个实现 → 重复,每个测试都是一颗 曳光弹(tracer bullet),回应上一个循环所教给你的东西。

循环的规则

  • 先红后绿。 先写会失败的测试,然后只写刚好足以让它通过的代码。不要预判未来的测试,也不要添加投机性的功能。
  • 一次一个切片。 每个循环一个接缝、一个测试、一个最小实现。
  • 重构不属于循环。 它属于审查阶段(见 code-review 技能),而非 红 → 绿 的实现循环。
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. 4d ago First seen · 37 lines · 53 tokens per session scan A 5fbf7ac7e229

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository astordu/qoderharness (21 stars, last pushed 8d ago), licensed MIT. It adds 53 tokens to every session and 874 once invoked, about $0.0003 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

tdd

Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

GreyDGL/PentestGPT · 33 tokens

test-first-bugs

Enforces a test-driven bug-fixing workflow. Use when a user reports a bug, failing code, an error, or asks to fix something.

jamditis/claude-skills-journalism · 35 tokens

tdd

Test-driven development (TDD) process used when writing code. Use whenever you are adding any new code, unless the user explicitly asks to skip TDD or the code is exploratory/spike.

lexler/skill-factory · 42 tokens

growing-outside-in-systems

Drive feature development using Outside-In TDD with Hexagonal Architecture. Design emerges through inline code, in-memory fakes, interface extraction, and deferred I/O. Use when building features, writing tests, or structuring backend services. Triggers on: TDD, outside-in, hexagonal, ports and adapters, emergent…

lexler/skill-factory · 122 tokens

plan-create

Create structured implementation plans for autonomous TDD development. Use for new features, multi-file changes, or anything requiring multiple steps or tests. Triggers on aspirational openers ("let's build", "let's start building", "I want to make", "I want an app that", "help me build"), capability lists ("users…

markshust/hcf · 171 tokens

red-green-refactor

Guides the red-green-refactor TDD workflow: write a failing test first, implement the minimum code to make it pass, then refactor while keeping tests green. Use when a user asks to practice TDD, write tests first, follow red-green-refactor, do test-driven development, write failing tests before code, or phrases like…

rohitg00/skillkit · 90 tokens