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 agentmods add skills/nikolahuang/nova-cli/test-driven-developmentnpx skills add Nikolahuang/nova-cli --skill test-driven-developmentgit clone --depth 1 https://github.com/Nikolahuang/nova-cliWhat 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 | $0.00046 | $0.00897 |
| Opus 5 | $0.00023 | $0.00449 |
| Sonnet 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 2d 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.
- 2d 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 4mo ago), licensed MIT. It adds 46 tokens to every session and 897 once invoked, about $0.0002 per session on Opus 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.
Other skills, from other repositories
test-driven-development
TDD: enforce RED-GREEN-REFACTOR, tests before code.
plugin-test
为 Zhin.js 插件编写和运行测试(Plugin Runtime)。Use when asked to write tests, add test coverage, or verify defineCommand / definePlugin behavior. 引导编写符合 Runtime 的 Vitest 测试。.
red-green-refactor
Guides the red-green-refactor TDD workflow: write a failing test first, implement the minimum code to make it pass, then refactor while keeping tests green. Use when a user asks to practice TDD, write tests first, follow red-green-refactor, do test-driven development, write failing tests before code, or phrases like…
autobot-test
Testing guidelines for Autobot with AAA pattern and Crystal spec best practices.
tdd-cycle
Red-Green-Refactor test-driven development cycle.
coding
Use when five specialized coding agents (linter, perf, refactor, security, test) that enforce quality gates across the development lifecycle. From lint enforcement through performance profiling, refactoring, security auditing, and test coverage. Use when working with coding agents.