tdd-workflow

tdd-workflow is a skill for Claude Code, Codex from Luohaothu/everything-codex. It costs 50 tokens per session (2,633 once invoked), scanned A, original, MIT.

A workflow for test-driven development (TDD), where tests are written before code and cover individual functions, connected services, and complete user journeys. End-to-end tests check a whole feature as a user would use it.

In plain words
What is it for?
Use it when adding features, fixing bugs, refactoring code, creating API endpoints, or building components that need unit, integration, and browser-based tests.
Why use it?
It reduces regressions by checking normal, error, and edge cases during development. It also sets a target of at least 80% test coverage.

Skill for Claude CodeCodex

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

Good fit Use it when adding features, fixing bugs, refactoring code, creating API endpoints, or building components that need unit, integration, and browser-based tests.

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

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/luohaothu/everything-codex/tdd-workflow/github.svg)](https://agentmods.dev/skills/luohaothu/everything-codex/tdd-workflow)
Your own site
<a href="https://agentmods.dev/skills/luohaothu/everything-codex/tdd-workflow"><img src="https://agentmods.dev/badge/skills/luohaothu/everything-codex/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/luohaothu/everything-codex/tdd-workflow"><img src="https://agentmods.dev/badge/skills/luohaothu/everything-codex/tdd-workflow.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,633 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00050 $0.02633
Opus 5.5 $0.00020 $0.01053
Sonnet 5.5 $0.00010 $0.00527
Haiku 4.5 $0.00005 $0.00263

Measured 1mo ago against content hash 855a8ece98f8, 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 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.

docs/zh-CN/skills/tdd-workflow/SKILL.md · 440 lines

How it starts

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

测试驱动开发工作流

此技能确保所有代码开发遵循TDD原则,并具备全面的测试覆盖率。

何时激活

  • 编写新功能或功能
  • 修复错误或问题
  • 重构现有代码
  • 添加API端点
  • 创建新组件

核心原则

1. 测试优先于代码

始终先编写测试,然后实现代码以使测试通过。

2. 覆盖率要求

  • 最低80%覆盖率(单元 + 集成 + 端到端)
  • 覆盖所有边缘情况
  • 测试错误场景
  • 验证边界条件

3. 测试类型

单元测试
  • 单个函数和工具
  • 组件逻辑
  • 纯函数
  • 辅助函数和工具
集成测试
  • API端点
  • 数据库操作
  • 服务交互
  • 外部API调用
端到端测试 (Playwright)
  • 关键用户流程
  • 完整工作流
  • 浏览器自动化
  • UI交互

TDD 工作流步骤

步骤 1: 编写用户旅程

As a [role], I want to [action], so that [benefit]

Example:
As a user, I want to search for markets semantically,
so that I can find relevant markets even without exact keywords.

步骤 2: 生成测试用例

针对每个用户旅程,创建全面的测试用例:

describe('Semantic Search', () => {
  it('returns relevant markets for query', async () => {
    // Test implementation
  })

  it('handles empty query gracefully', async () => {
    // Test edge case
  })

  it('falls back to substring search when Redis unavailable', async () => {
    // Test fallback behavior
  })

  it('sorts results by similarity score', async () => {
    // Test sorting logic
  })
})

步骤 3: 运行测试(它们应该失败)

npm test
# Tests should fail - we haven't implemented yet

步骤 4: 实现代码

编写最少的代码以使测试通过:

// Implementation guided by tests
export async function searchMarkets(query: string) {
  // Implementation here
}

步骤 5: 再次运行测试

npm test
# Tests should now pass

步骤 6: 重构

在保持测试通过的同时提高代码质量:

  • 消除重复
  • 改进命名
  • 优化性能
  • 增强可读性

步骤 7: 验证覆盖率

npm run test:coverage
# Verify 80%+ coverage achieved

测试模式

单元测试模式 (Jest/Vitest)

import { render, screen, fireEvent } from '@testing-library/react'
import { Button } from './Button'

describe('Button Component', () => {
  it('renders with correct text', () => {
    render(<Button>Click me</Button>)
    expect(screen.getByText('Click me')).toBeInTheDocument()
  })

  it('calls onClick when clicked', () => {
    const handleClick = jest.fn()
    render(<Button onClick={handleClick}>Click</Button>)

    fireEvent.click(screen.getByRole('button'))

    expect(handleClick).toHaveBeenCalledTimes(1)
  })

  it('is disabled when disabled prop is true', () => {
    render(<Button disabled>Click</Button>)
    expect(screen.getByRole('button')).toBeDisabled()
  })
})

Read the full file on GitHub · 440 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. 1mo ago First seen · 440 lines · 50 tokens per session scan A 855a8ece98f8

Subscribe to this mod's changes

tdd-workflow is a skill published in the GitHub repository Luohaothu/everything-codex (25 stars, last pushed 2mo ago), licensed MIT. It adds 50 tokens to every session and 2,633 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-09-03.