Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Nikolahuang/nova-cli --skill test-driven-developmentgit clone --depth 1 https://github.com/Nikolahuang/nova-cliWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/nikolahuang/nova-cli/test-driven-development)<a href="https://agentmods.dev/skills/nikolahuang/nova-cli/test-driven-development"><img src="https://agentmods.dev/badge/skills/nikolahuang/nova-cli/test-driven-development/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/nikolahuang/nova-cli/test-driven-development"><img src="https://agentmods.dev/badge/skills/nikolahuang/nova-cli/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00046 | $0.00897 |
| Opus 5.5 | $0.00018 | $0.00359 |
| Sonnet 5.5 | $0.00009 | $0.00179 |
| Haiku 4.5 | $0.00005 | $0.00090 |
Grade A, and why
test-driven-development scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
测试驱动开发 (TDD)
概述
严格遵循 RED-GREEN-REFACTOR 循环。在写实现代码之前必须先写测试。
RED-GREEN-REFACTOR 循环
🔴 RED - 写失败的测试
- 写测试 - 描述期望行为
test('should calculate total with tax', () => {
const result = calculateTotal(100, 0.1);
expect(result).toBe(110);
});
- 运行测试 - 确认失败
npm test
# ❌ FAIL: calculateTotal is not defined
- 失败原因 - 理解为什么失败
- 函数不存在?
- 逻辑错误?
- 接口不匹配?
🟢 GREEN - 写最小实现
- 写最小代码 - 只让测试通过
export function calculateTotal(amount: number, tax: rate): number {
return amount * (1 + tax);
}
- 运行测试 - 确认通过
npm test
# ✓ PASS: should calculate total with tax
- 不要过度设计 - 只满足当前测试
🔵 REFACTOR - 改进代码
- 保持测试通过 - 重构时持续运行测试
- 消除重复 - DRY 原则
- 改进命名 - 更清晰的命名
- 优化结构 - 更好的组织
TDD 规则
必须遵守
- ✅ 只有测试失败时才写生产代码
- ✅ 只写刚好让测试通过的最小代码
- ✅ 每次重构前确保测试通过
禁止行为
- ❌ 先写实现后写测试
- ❌ 一次写多个测试
- ❌ 跳过失败的测试
测试类型
单元测试
- 测试单个函数或类
- 隔离依赖
- 快速执行
集成测试
- 测试组件交互
- 使用真实依赖
- 覆盖关键路径
端到端测试
- 测试完整流程
- 模拟用户行为
- 覆盖主要场景
测试反模式
不要这样做
- ❌ 测试实现细节
- ❌ 测试私有方法
- ❌ 过度 mock
- ❌ 测试覆盖率至上
应该这样做
- ✅ 测试行为,不测实现
- ✅ 测试公共接口
- ✅ 使用真实依赖
- ✅ 覆盖关键路径
示例工作流
### 任务: 添加用户验证功能
#### RED
1. 写测试 `user.test.ts`
- 测试有效邮箱格式
- 测试无效邮箱格式
2. 运行测试 → 失败 ✓
#### GREEN
1. 实现 `validateEmail()` 函数
2. 运行测试 → 通过 ✓
#### REFACTOR
1. 提取正则表达式常量
2. 添加类型定义
3. 运行测试 → 通过 ✓
#### COMMIT
git commit -m "feat: add email validation"
关键原则
- 测试优先 - 永远先写测试
- 小步前进 - 每次只写一个测试
- 快速反馈 - 测试要快
- 简单设计 - 只实现需要的
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 135 lines · 46 tokens per session scan A a708a44af736
test-driven-development is a skill published in the GitHub repository Nikolahuang/nova-cli (14 stars, last pushed 7mo ago), licensed MIT. It adds 46 tokens to every session and 897 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
test-driven-development compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| test-driven-developmentNikolahuang/nova-cli | Skill | 14 | 7mo ago | MIT | A | 46 | Claude Code, Codex |
| plugin-testzhinjs/zhin | Skill | 136 | today | MIT | A | 51 | Claude Code, Codex |
| test-driven-developmentDevelopersGlobal/ai-agent-skills | Skill | 221 | 8d ago | MIT | A | 32 | Claude Code, Codex |
| tdd-cyclemodimihir07/agentic-os | Skill | 230 | 11d ago | MIT | A | 14 | Claude Code, Codex |
| codingoyi77/1ai-skills | Skill | 19 | 2d ago | MIT | A | 54 | Claude Code |
| red-green-refactorrohitg00/skillkit | Skill | 1.6k | 6mo ago | Apache-2.0 | A | 90 | Claude Code, Codex |
| test-writingandreaswasita/copilot-agents-dojo | Skill | 56 | 2mo ago | MIT | A | 11 | Claude Code, Codex |