test-driven-development SKILL.md skillA

test-driven-development from jnmetacode/superpowers-zh is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add jnmetacode/superpowers-zh/test-driven-development@v1.0.0

Pins v1.0.0 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
jnmetacode/superpowers-zh
Path
skills/test-driven-development/SKILL.md
Versions recorded
4
Latest version
v1.0.0, committed Sep 26, 2026
First version recorded
Mar 20, 2026
Size
10,095 bytes
Repository stars
8,348
License
MIT

在实现任何功能或修复 bug 时使用,在编写实现代码之前.

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# 测试驱动开发(TDD)

## 概述

先写测试。看它失败。写最少的代码让它通过。

**核心原则:** 如果你没有看到测试失败,你就不知道它是否测试了正确的东西。

**违反规则的字面意思就是违反规则的精神。**

## 何时使用

**始终使用:**
- 新功能
- Bug 修复
- 重构
- 行为变更

**例外(需询问你的人类伙伴):**
- 一次性原型
- 生成的代码
- 配置文件

想着"就这一次跳过 TDD"?停下来。那是在给自己找借口。

## 铁律

```
没有失败的测试,就不写生产代码
```

先写了代码再写测试?删掉它。从头来过。

**没有例外:**
- 不要保留作为"参考"
- 不要在写测试时"改编"它
- 不要看它
- 删除就是删除

从测试出发,重新实现。句号。

## 红-绿-重构

```dot
digraph tdd_cycle {
    rankdir=LR;
    red [label="红灯\n编写失败的测试", shape=box, style=filled, fillcolor="#ffcccc"];
    verify_red [label="验证正确失败", shape=diamond];
    green [label="绿灯\n最少代码", shape=box, style=filled, fillcolor="#ccffcc"];
    verify_green [label="验证通过\n全部绿灯", shape=diamond];
    refactor [label="重构\n清理代码", shape=box, style=filled, fillcolor="#ccccff"];
    next [label="下一个", shape=ellipse];

    red -> verify_red;
    verify_red -> green [label="是"];
    verify_red -> red [label="错误的\n失败"];
    green -> verify_green;
    verify_green -> refactor [label="是"];
    verify_green -> green [label="否"];
    refactor -> verify_green [label="保持\n绿灯"];
    verify_green -> next;
    next -> red;
}
```

### 红灯 - 编写失败的测试

写一个最小的测试来展示期望行为。

<Good>
```typescript
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add jnmetacode/superpowers-zh/test-driven-development@sha256:ba1e4f5d2ebc7d45

The line at the top of this page pins the label v1.0.0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_adsckqblkcve6mhs.svg)](https://markdownregistry.com/a/art_adsckqblkcve6mhs)

4 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 4 versions of this file, between Mar 20, 2026 and Sep 26, 2026, about one every 63 days.

versioncommittedcommitsizeaudit
v1.0.0 latest2026-09-26 40b0d4f 10,095 BA view · diff
v1.0.02026-08-07 2b1ced6 9,482 BA view · diff
v1.0.02026-06-16 952fc29 10,294 BA view · diff
git:20260320.80bc1002026-03-20 80bc100 10,211 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (10095 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

jnmetacode/superpowers-zh · 8,348 stars · license MIT · pushed 2026-10-19 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_adsckqblkcve6mhs
GET https://markdownregistry.com/api/v1/resolve?ref=jnmetacode/superpowers-zh/test-driven-development
GET https://markdownregistry.com/api/v1/blob/ba1e4f5d2ebc7d45f0abdbe1b852d3463ea0593eb621942dd0b45427ee9db378

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from jnmetacode/superpowers-zh

AGENTS.md AGENTS.md file
jnmetacode/superpowers-zh · AGENTS.md
git:20260510.a9e02b5 · audit B · 8,348 stars
CLAUDE.md CLAUDE.md file
jnmetacode/superpowers-zh · CLAUDE.md
git:20260907.3437ce2 · audit A · 8,348 stars
brainstorming SKILL.md skill
jnmetacode/superpowers-zh · skills/brainstorming/SKILL.md · 在任何创造性工作之前必须使用此技能——创建功能、构建组件、添加功能、修改行为,或筹划任何新东西,无论是软件还是软件之外(一场分享、一门生意、一次装修)。
v1.0.0 · audit A · 8,348 stars
chinese-code-review SKILL.md skill
jnmetacode/superpowers-zh · skills/chinese-code-review/SKILL.md · 中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。
v1.0.0 · audit A · 8,348 stars
chinese-commit-conventions SKILL.md skill
jnmetacode/superpowers-zh · skills/chinese-commit-conventions/SKILL.md · 中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog…
v1.0.0 · audit A · 8,348 stars
chinese-documentation SKILL.md skill
jnmetacode/superpowers-zh · skills/chinese-documentation/SKILL.md · 中文文档排版参考——中英文空格、全半角标点、术语保留、链接格式、中文文案排版指北约定。仅在用户显式 /chinese-documentation 时调用,不要根据上下文自动触发。
v1.0.0 · audit A · 8,348 stars
chinese-git-workflow SKILL.md skill
jnmetacode/superpowers-zh · skills/chinese-git-workflow/SKILL.md · 国内 Git 平台配置参考——Gitee、Coding.net、极狐 GitLab、CNB 的 SSH/HTTPS/凭据/CI 接入差异与镜像同步配置。仅在用户显式 /chinese-git-workflow…
v1.0.0 · audit A · 8,348 stars
diagnosing-superpowers SKILL.md skill
jnmetacode/superpowers-zh · skills/diagnosing-superpowers/SKILL.md · 当一次 superpowers 会话出了问题、你的人类伙伴想知道原因时使用——重复劳动、无视计划、磕磕绊绊、结果质量差、某个技能没触发、"太慢了"、"为什么这么贵"、"它到底在干什么"——或者想给 superpowers 维护者整理一份…
v1.0.0 · audit A · 8,348 stars
dispatching-parallel-agents SKILL.md skill
jnmetacode/superpowers-zh · skills/dispatching-parallel-agents/SKILL.md · 当面对 2 个以上可以独立进行、无共享状态或顺序依赖的任务时使用
v1.0.0 · audit A · 8,348 stars
executing-plans SKILL.md skill
jnmetacode/superpowers-zh · skills/executing-plans/SKILL.md · 当你要在当前会话里亲自担任实现者执行一份实现计划时使用——你的人类伙伴选择了内联执行,或者没有可用的子智能体工具
v1.0.0 · audit A · 8,348 stars
finishing-a-development-branch SKILL.md skill
jnmetacode/superpowers-zh · skills/finishing-a-development-branch/SKILL.md · 当实现完成、所有测试通过、需要决定如何集成这份工作时使用
v1.0.0 · audit A · 8,348 stars
mcp-builder SKILL.md skill
jnmetacode/superpowers-zh · skills/mcp-builder/SKILL.md · 在构建 MCP 服务器或 MCP 工具时使用 —— 系统化的生产级 MCP 构建方法论,覆盖工具设计、错误处理、传输层选择与测试,让 AI 助手连接外部能力
v1.0.0 · audit A · 8,348 stars

Every file in jnmetacode/superpowers-zh

Other files named test-driven-development

test-driven-development SKILL.md skill
obra/superpowers · skills/test-driven-development/SKILL.md · Use when implementing any feature or bugfix, before writing implementation code
git:20260919.5bf4e78 · audit A · 302,424 stars
test-driven-development SKILL.md skill
addyosmani/agent-skills · skills/test-driven-development/SKILL.md · Drives development with tests using the red-green-refactor loop. Use when implementing any logic, fixing any bug, or…
git:20261011.7c47146 · audit A · 109,013 stars
test-driven-development SKILL.md skill
mvschwarz/openrig · skills/_canonical/process/test-driven-development/SKILL.md · Use when implementing any feature or bugfix, before writing implementation code
git:20260907.6271b26 · audit A · 7,989 stars
test-driven-development SKILL.md skill
mvschwarz/openrig · packages/daemon/specs/agents/shared/skills/process/test-driven-development/SKILL.md · Use when implementing any feature or bugfix, before writing implementation code
git:20260907.6271b26 · audit A · 7,989 stars
test-driven-development SKILL.md skill
cbrock84/headcount · plugins/technology/skills/test-driven-development/SKILL.md · Drives implementation by writing a failing test first, then the smallest code that passes it. Use this before writing…
git:20260901.aa45383 · audit A · 2,076 stars
test-driven-development SKILL.md skill
a5c-ai/babysitter · library/methodologies/superpowers/skills/test-driven-development/SKILL.md · Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle.
git:20260601.da7723a · audit A · 1,862 stars
test-driven-development SKILL.md skill
a5c-ai/babysitter · library/methodologies/rpikit/skills/test-driven-development/SKILL.md · Test-first development practice where test specifications are written before production code, integrated into plan…
git:20260601.da7723a · audit A · 1,862 stars
test-driven-development SKILL.md skill
a5c-ai/babysitter · library/methodologies/cc10x/skills/test-driven-development/SKILL.md · Strict RED-GREEN-REFACTOR cycle enforcement. Tests are never skipped or deferred. Run mode only, never watch mode. Exit…
git:20260601.da7723a · audit A · 1,862 stars

Browse by kind, by grade A, or by owner.