tdd-workflow

tdd-workflow is a skill for Claude Code, Codex from laonayan/tdd-mcp-server. It costs 45 tokens per session (620 once invoked), scanned A, original, MIT.

A test-driven development workflow using RED-GREEN-REFACTOR: write a failing test, make it pass with the smallest change, then improve the code without changing its behaviour.

In plain words
What is it for?
Planning test cases, implementing features in small steps, checking edge and error cases, and showing command results as evidence.
Why use it?
It prevents untested implementations and requires actual test output instead of unsupported claims that the code works.

Skill for Claude CodeCodex

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

Good fit Planning test cases, implementing features in small steps, checking edge and error cases, and showing command results as evidence.

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

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-workflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/laonayan/tdd-mcp-server/tdd-workflow/github.svg)](https://agentmods.dev/skills/laonayan/tdd-mcp-server/tdd-workflow)
Your own site
<a href="https://agentmods.dev/skills/laonayan/tdd-mcp-server/tdd-workflow"><img src="https://agentmods.dev/badge/skills/laonayan/tdd-mcp-server/tdd-workflow/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-workflow

Your own site · 80×15
<a href="https://agentmods.dev/skills/laonayan/tdd-mcp-server/tdd-workflow"><img src="https://agentmods.dev/badge/skills/laonayan/tdd-mcp-server/tdd-workflow.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 620 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.00045 $0.00620
Opus 5.5 $0.00018 $0.00248
Sonnet 5.5 $0.00009 $0.00124
Haiku 4.5 $0.00005 $0.00062

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

Security

Grade A, and why

tdd-workflow 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.

skills/tdd-workflow/SKILL.md · 64 lines

What it actually says

TDD 工作流:{{FEATURE_DESCRIPTION}}

项目配置

  • 编程语言: {{LANGUAGE}}
  • 测试框架: {{TEST_FRAMEWORK}}
  • 复杂度: {{COMPLEXITY_LEVEL}}

纪律总纲(Evidence over Claims)

  1. 每一步必须有真实证据:测试输出、命令退出码、覆盖率数字——而不是"应该没问题"
  2. 先看测试失败,再写实现:没见过 RED 的测试不可信
  3. 最小实现:只写让测试通过所需的最少代码
  4. 实现先于测试编写的代码应删除重来

Phase 1: RED — 写失败的测试 🔴

1.1 分析需求

  • 识别主要功能与输入/输出
  • 列出边界条件与错误场景
  • 定义验收标准

1.2 设计测试策略

  • 简单功能:单元测试 + happy path 优先
  • 中等复杂度:补集成测试与错误处理
  • 复杂功能:加 e2e 与性能基线

1.3 编写并运行测试

npm test -- --watch  # 或对应框架命令

必须确认测试失败,并记录失败信息(这是 RED 证据)。

Phase 2: GREEN — 最小实现 🟢

  • 只写让失败测试通过所需的代码
  • 不做提前优化、不加未要求的功能
  • 运行测试确认全部通过(GREEN 证据)
  • 提交:git commit -m "feat: ... (RED->GREEN)"

Phase 3: REFACTOR — 重构 ♻️

  • 消除重复、提升可读性,不改变行为
  • 每次重构后重新运行测试确认仍绿
  • 重构中测试变红 = 立即停下修复或回滚

常见反模式(禁止)

反模式 正确做法
测试和实现一起写 先写测试看它失败
实现写完再补测试 删掉实现,从 RED 开始
断言写死返回值不看真实输出 先跑起来观察实际行为
"测试通过了"但没贴输出 展示命令输出与退出码

下一循环

回到 Phase 1 处理下一个最小增量。保持每轮 2-5 分钟粒度。

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 · 64 lines · 45 tokens per session scan A d4a6eb65379b

Subscribe to this mod's changes

tdd-workflow is a skill published in the GitHub repository laonayan/tdd-mcp-server (2 stars, last pushed yesterday), licensed MIT. It adds 45 tokens to every session and 620 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-11-12.

Related

tdd-workflow compared with skills from other repositories

tdd-workflow next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tdd-workflowlaonayan/tdd-mcp-serverSkill2yesterdayMITA45Claude Code, Codex
engram-testing-coverageGentleman-Programming/engramSkill8.2k2d agoMITA25Claude Code, Codex
principle-test-behavior-not-implementationmichael-denyer/pstack-claudeSkill4.4k3d agoMITA50Claude Code
nw-ddd-eventsourcingnWave-ai/nWaveSkill635yesterdayMITA38Claude Code
nw-fp-clojurenWave-ai/nWaveSkill635yesterdayMITA25Claude Code
nw-leanux-methodologynWave-ai/nWaveSkill635yesterdayMITA37Claude Code
tddcodewithmukesh/dotnet-claude-kitSkill83612d agoMITA81Claude Code