Skip to content
Agentmart
Submit a tool

tdd

通过测试优先的逐行为循环实现功能或修复缺陷。用户要求 TDD、red-green-refactor 或测试优先时使用;纯文档、生成物和探索原型不自动进入该流程。

Skill by iZiTTMarvin

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/izittmarvin-tdd

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

通过测试优先的逐行为循环实现功能或修复缺陷。用户要求 TDD、red-green-refactor 或测试优先时使用;纯文档、生成物和探索原型不自动进入该流程。

Use cases: testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/tdd

What's inside

Skill name
tdd
Description
通过测试优先的逐行为循环实现功能或修复缺陷。用户要求 TDD、red-green-refactor 或测试优先时使用;纯文档、生成物和探索原型不自动进入该流程。
License
MIT
Instructions
24 lines in SKILL.md · view on GitHub

Files (4)

  • SKILL.md
  • openai.yaml · agents/
  • mocking.md
  • tests.md

SKILL.md (first lines)

# 测试驱动开发

先读需求、相关测试、公共接口和项目规则;已有 CONTEXT 或 ADR 时遵循其领域语言与约束。自行选择最窄且可信的测试边界,优先复用现有测试。只有预期行为或公共契约存在实质分歧时才询问用户,不要求用户逐次批准测试层级。

## 红、绿、重构

1. **红**:针对下一项可观察行为写或扩展一条测试,运行并确认它因预期原因失败。环境错误或无关失败不算红灯。
2. **绿**:实现当前行为,运行该测试和最近的相关测试,保留正常路径。
3. **重构**:在绿色保护下消除本次产生的重复和不清晰结构,不改变行为。然后进入下一项行为。

一次推进一个行为,避免先批量写完所有测试再实现。测试运行次数不设配额,验证成本与变更风险相称。纯重构先确认现有保护为绿;保护不足时增加刻画当前行为的测试,不故意制造不存在的失败需求。

## 测试质量

- 通过调用方使用的接口观察结果,内部重命名或重组不应让行为测试失效。
- 期望值来自规格、已知示例或独立推导,不能复制生产算法计算答案。
- 断言必须能发现其声明保护的行为被破坏;只有非空、类型正确或未崩溃通常不够。
- 新提取的 helper 不自动需要独立测试;不要为了测试暴露私有实现或重复已有行为保护。

需要具体测试示例时读 [tests.md](tests.md);涉及替代依赖或 Mock 时读 [mocking.md](mocking.md)。接口本身需要重新设计时,可使用已安装的 `codebase-design`;未安装时沿项目现有边界完成测试设计,不阻塞本次实现。

完成时报告保护了哪些行为、观察到的红绿证据和相关验证结果。保留有效测试;只有确认覆盖等价且旧测试失去独立保护价值时才删除。无法运行时说明原因,不声称完成了红绿验证。

From iZiTTMarvin/agent-skills-zh, MIT.

More from iZiTTMarvin/agent-skills-zh

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Sep 9, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from iZiTTMarvin

Cite this page

tdd skill. Agent Mart. https://agentmart.dev/skills/izittmarvin-tdd (last updated 2026-10-24)