Skip to main content
ClaudeWave
Skill822 estrellas del repoactualizado 5d ago

tdd

This Test Driven Development skill implements the red-green-refactor cycle for writing code. Use it when you need to write implementation code, add tests before fixing logic, or convert specific behaviors into regression tests. The skill writes a failing test first, makes minimal changes to pass it, then refactors while maintaining test coverage, advancing one thin slice at a time rather than bundling multiple behaviors together.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/Haohao-end/openagent /tmp/tdd && cp -r /tmp/tdd/api/internal/core/skills/catalog/tdd ~/.claude/skills/tdd
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

skill.md

# TDD

这是一个测试驱动开发技能,强调红绿重构。

## 适用场景

- 用户要我写实现代码
- 用户要我先补测试再修逻辑
- 用户要我把某条行为固定成回归测试

## 工作方式

1. 先写一个会失败的测试。
2. 只做最小修改让测试变绿。
3. 再重构,保持测试继续通过。
4. 一次只推进一个薄切片,不要把一大堆行为混在一起。

## 约束

- 不要先写大实现再补测试。
- 不要为了覆盖率写无意义测试。
- 测试必须尽量覆盖真实调用点,而不是实现细节。