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 echoVic/boss-skill --skill tddgit clone --depth 1 https://github.com/echoVic/boss-skillWrote 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/echovic/boss-skill/tdd)<a href="https://agentmods.dev/skills/echovic/boss-skill/tdd"><img src="https://agentmods.dev/badge/skills/echovic/boss-skill/tdd/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/echovic/boss-skill/tdd"><img src="https://agentmods.dev/badge/skills/echovic/boss-skill/tdd.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.00032 | $0.01356 |
| Opus 5.5 | $0.00013 | $0.00542 |
| Sonnet 5.5 | $0.00006 | $0.00271 |
| Haiku 4.5 | $0.00003 | $0.00136 |
Grade A, and why
shared/tdd 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.
测试驱动开发(TDD)
核心铁律
没有失败的测试,就不写生产代码。
如果先写了实现代码,必须删除,从测试重新开始。不保留"参考",不"边写测试边改"。
适用场景
必须使用 TDD:
- 新功能实现
- Bug 修复
- 代码重构
- 任何行为变更
例外(需用户明确同意):
- 一次性原型代码
- 纯配置文件
- 自动生成的代码
Red-Green-Refactor 循环
🔴 RED — 写失败测试
为一个行为写最小测试:
- 一个测试只测一件事(名称里有 "and" 就拆开)
- 名称描述行为,而非实现(
rejects empty email而非test1) - 用真实代码,除非依赖外部服务才 mock
- 展示你期望的 API 长什么样
// ✅ 好:测试真实行为
test('rejects empty email', () => {
expect(validateEmail('')).toBe(false);
});
// ❌ 坏:测试 mock 而非代码
test('email works', () => {
const mock = jest.fn();
mock('');
expect(mock).toHaveBeenCalled();
});
验证 RED — 必须看到它失败
这一步不可跳过。 运行测试,确认:
# 前端
npx jest path/to/test.test.ts
# 后端
npm test -- path/to/test.test.ts
确认三件事:
- 测试失败(不是通过)
- 失败原因是功能缺失(不是拼写错误、导入错误)
- 失败信息符合预期
如果测试直接通过 → 你在测已有行为,测试写错了,修正它。 如果测试报错(error) → 修复错误(如导入路径),重跑直到它正确失败。
🟢 GREEN — 写最小实现
写刚好让测试通过的最少代码:
- 不添加测试未要求的功能
- 不重构、不"顺便优化"
- 不提前抽象
// ✅ 好:刚好通过
function validateEmail(email: string): boolean {
return email.trim().length > 0;
}
// ❌ 坏:过度工程
function validateEmail(
email: string,
options?: { allowPlus?: boolean; domainWhitelist?: string[] },
): boolean {
// YAGNI
}
验证 GREEN — 必须看到它通过
运行测试,确认:
- 新测试通过
- 所有已有测试仍然通过
- 输出干净(无报错、无意外警告)
如果新测试失败 → 修代码,不修测试。 如果其他测试失败 → 立即修复。
🔵 REFACTOR — 重构(仅在 GREEN 之后)
测试全绿后才允许重构:
- 消除重复
- 改善命名
- 提取辅助函数
- 不新增行为
重构后必须重新跑全部测试,保持全绿。
循环
下一个行为 → 回到 RED。
Bug 修复 TDD
修复 bug 时,先写一个复现 bug 的失败测试:
1. 写测试复现 bug → 确认失败(RED)
2. 修复代码 → 确认通过(GREEN)
3. 这个测试就是回归保护
禁止在没有复现测试的情况下修复 bug。
验证清单
标记任务完成前,逐项确认:
- 每个新增函数/方法都有对应测试
- 每个测试都先看到它失败(RED 已验证)
- 失败原因是功能缺失,而非拼写/导入错误
- 实现代码是让测试通过的最小集
- 全部测试通过
- 测试用真实代码(仅在不可避免时 mock)
- 边界条件和错误路径已覆盖
任何一项打不了勾 → 你跳过了 TDD,回到 RED 重新开始。
常见借口与回应
| 借口 | 回应 |
|---|---|
| "太简单了不用测" | 简单代码也会坏,测试只要 30 秒 |
| "我之后补测试" | 事后写的测试一跑就过,证明不了任何事 |
| "我手动测过了" | 手动测试无记录、不可复跑、容易漏 |
| "已经写了代码,删了浪费" | 沉没成本。保留未验证的代码才是技术债 |
| "TDD 太慢" | TDD 比事后调试快,省的是未来的时间 |
| "这个不一样因为..." | 没有例外。删代码,从测试开始。 |
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.
- today First seen · 177 lines · 32 tokens per session scan A 07d15ff1e813
shared/tdd is a skill published in the GitHub repository echoVic/boss-skill (544 stars, last pushed today), licensed MIT. It adds 32 tokens to every session and 1,356 once invoked, about $0.0001 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-10-28.
Other skills, from other repositories
test-driven-development
Drives development with tests using the red-green-refactor loop. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality. Use when asked to add tests to a function, fix a bug…
workflow-patterns
Use this skill when implementing tasks according to Conductor's TDD workflow, handling phase checkpoints, managing git commits for tasks, or understanding the verification protocol.
writing-skills
A guide for creating and testing reusable instructions for AI agents, called skills. It applies test-driven development, or TDD—the practice of writing tests before implementation—to instruction documents.
test-driven-development
Test-driven development, or TDD, is a way to build software by writing a test that fails, adding the smallest code that makes it pass, and then cleaning up the code. These instructions require that process for features, bug fixes, refactors, and behavior changes.
writing-evals
Scaffolds evaluation suites for the Axiom AI SDK. Generates eval files, scorers, flag schemas, and config from natural-language descriptions. Use when creating evals, writing scorers, setting up flag schemas, or configuring axiom.config.ts.
kiro-impl
Implement approved tasks using TDD with subagent dispatch. Runs all pending tasks autonomously or selected tasks manually.