mxyhi/ok-skills✦ 精选0°

tdd

仓库创建 2026年2月2日最近提交 3 天前SkillHot 收录 20 天前
▸ 精选理由

强调通过公共接口编写集成风格测试,适合稳健开发流程。

这个 Skill 做什么

采用测试驱动开发流程,用测试先行指导功能实现并保证回归安全。

用红-绿-重构(red→green→refactor)的 TDD 循环来先写测试再实现功能,确保每次改动都有对应的回归保护。适合新特性开发或修复 bug 时想要测试优先、保持设计可维护性的场景。还会指导什么是好测试、哪些是反模式、测试放在哪儿以及如何做集成测试,帮助把测试留在代码库里。

▸ 展开 SKILL.md 英文原文

Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

开发编程测试驱动红绿重构集成测试通用
456
Stars
41
Forks
34
仓库内 Skill
+8
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/mxyhi/ok-skills/main/tdd/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/mxyhi/ok-skills/main/tdd/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Test-Driven Development

TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle — consult them before and during the loop, not after.

When exploring the codebase, read `CONTEXT.md` (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.

## What a good test is

Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification — "user can checkout wi
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有