tdd

SkillDev tools

Strict test-driven development. Triggers when the user asks for TDD, writing tests first, test-driven development, or RED-GREEN-REFACTOR.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the tdd skill

What this skill tells your AI

The instructions your AI receives, as published by iceymoss/go-hichat-api in .claude/skills/tdd/SKILL.md and read by ahel’s review.

严格测试驱动开发。按 RED -> GREEN -> REFACTOR 循环,禁止先写实现再补测试。

流程

1. RED — 先写失败的测试

  • 根据需求写一个测试,运行确认它失败
  • 测试必须明确断言预期行为
  • 如果测试直接通过了,说明测试写得不对,重写

2. GREEN — 写最少的代码让测试通过

  • 只写刚好让测试通过的实现,不要多写
  • 运行 go test ./... 确认通过
  • 不要在这一步优化或重构

3. REFACTOR — 重构(测试必须保持通过)

  • 消除重复,改善命名,简化逻辑
  • 每次重构后立即跑测试
  • 测试不通过就回退

4. COMMIT — 提交这个循环

  • 一个 RED-GREEN-REFACTOR 循环 = 一个 commit
  • commit message 说明这个循环实现了什么行为

规则

  • 绝对不能先写实现再补测试
  • 每个循环只关注一个行为
  • 测试命名: Test_功能_场景_预期结果
  • 使用 table-driven tests 组织多个用例
  • 遵守 CLAUDE.md 的所有规则(三数据库兼容、common.Marshal 等)
  • 前端测试参考现有测试模式

Signals

GitHub stars
41
Forks
9
Last commit
Aug 2026
Advanced
Catalog kind
skill
Gateway key
tdd-iceymoss
Source
github.com/iceymoss/go-hichat-api