tdd

tdd is a skill for Codex from PANYUXIN6/pyx-skills. It costs 82 tokens per session (637 once invoked), scanned A, original, MIT.

A test-first development workflow known as TDD, where you write a failing test, implement the needed behavior, then improve the code.

In plain words
What is it for?
Use it for explicit TDD, test-first, red-green-refactor work, or when a regression test must be written before fixing a bug.
Why use it?
It keeps implementation tied to confirmed requirements and provides evidence that a bug or missing behavior is fixed.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it for explicit TDD, test-first, red-green-refactor work, or when a regression test must be written before fixing a bug.

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

Made for: 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/panyuxin6/pyx-skills/tdd/github.svg)](https://agentmods.dev/skills/panyuxin6/pyx-skills/tdd)
Your own site
<a href="https://agentmods.dev/skills/panyuxin6/pyx-skills/tdd"><img src="https://agentmods.dev/badge/skills/panyuxin6/pyx-skills/tdd/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/panyuxin6/pyx-skills/tdd"><img src="https://agentmods.dev/badge/skills/panyuxin6/pyx-skills/tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 637 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.00082 $0.00637
Opus 5.5 $0.00033 $0.00255
Sonnet 5.5 $0.00016 $0.00127
Haiku 4.5 $0.00008 $0.00064

Measured 1mo ago against content hash 356e91163ac1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

tdd/SKILL.md · 42 lines

What it actually says

让测试先行地实现功能

负责已确认行为、失败证据、实现和局部重构之间的顺序。使用 testing-guidelines 选择并验证测试证据;本技能只负责测试优先的开发循环。

在 RED 前确定行为

从需求、契约、验收标准、不变量或已确认的回归问题开始。进入循环前,先解决会实质改变公开行为或用户可见行为的歧义。不要让测试凭空创造新需求。

每个连贯切片按以下顺序推进:

需求 -> 验收标准 -> 测试用例 -> RED -> GREEN -> REFACTOR

保持 TDD 关卡

  • 观察到有意义的 RED。 在实现前运行所选证据;只有目标行为确实缺失或已损坏时,才接受该失败。构建、夹具、导入和环境失败都属于准备失败。
  • 实现合理的 GREEN。 仅添加当前切片需要的生产行为,同时保持现有架构和契约。不要为了最快通过而牺牲可维护性或正确性。
  • 局部重构。 只改进当前实现已有理由支持的部分,保持所有相关证据为绿,并避免无关清理或大范围重设计。

使用连贯的纵向切片

对每个尚未完成的行为:

  1. 用 testing-guidelines 为该行为选择最小且可信的证据。
  2. 添加证据并观察到有效的失败。
  3. 只实现该切片所需的内容。
  4. 运行聚焦证据并保持通过。
  5. 只有能改进当前切片时才重构,然后再次验证通过。

一个切片是一项连贯的行为或契约,不一定只对应一个测试函数。完成一个切片后再开始独立行为,确保每次失败和通过都有清晰原因。

无法产生真实 RED 的情况

对于特征测试或保持行为不变的重构,目标行为可能已经存在,因此真实失败既不安全也不可行。说明替代证据,保留当前行为,不要为了模仿 TDD 顺序而制造没有意义的失败。

只有未解决的权限、公开行为,或为了可测试性而进行的重大架构调整会实质改变实现时,才询问用户。普通的执行顺序、接缝和局部重构无需额外审批。

Files

What ships with it

1 file 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. 1mo ago Changed · +16 tokens per session 356e91163ac1
  2. 2mo ago First seen · 42 lines · 66 tokens per session scan A 04a1c4aacc7e

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository PANYUXIN6/pyx-skills (8 stars, last pushed 17d ago), licensed MIT. It adds 82 tokens to every session and 637 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

tdd compared with skills from other repositories

tdd next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tddPANYUXIN6/pyx-skillsSkill817d agoMITA82Codex
engram-testing-coverageGentleman-Programming/engramSkill7.8kyesterdayMITA25Claude Code, Codex
principle-test-behavior-not-implementationmichael-denyer/pstack-claudeSkill4.1kyesterdayMITA50Claude Code
tddcodewithmukesh/dotnet-claude-kitSkill8052d agoMITA81Claude Code
nw-ddd-eventsourcingnWave-ai/nWaveSkill631yesterdayMITA38Claude Code
nw-fp-clojurenWave-ai/nWaveSkill631yesterdayMITA25Claude Code
nw-leanux-methodologynWave-ai/nWaveSkill631yesterdayMITA37Claude Code