test-driven-development
用测试优先开发编写更好的代码
如果在实现之后才进行测试,功能开发和错误修复可能会在测试薄弱的情况下发布。此技能会引导 Claude、Codex 和 Claude Code 完成严格的测试优先循环、失败验证、最小化实现和重构。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "test-driven-development" from https://skillstore.io/skills/cycleaddict-test-driven-development.md and its manifest at https://skillstore.io/api/skills/cycleaddict-test-driven-development/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“test-driven-development”。 Add retry support to an operation helper.
预期结果:
- 从命名一个可观察的重试行为开始。
- 要求你运行聚焦测试并确认预期失败。
- 在重构之前,将实现限制在能让该行为通过的范围内。
正在使用“test-driven-development”。 Bug: empty email is accepted.
预期结果:
- 创建一个拒绝空 email 的回归测试。
- 要求证明该测试因缺少验证而失败。
- 指导最小的验证变更,然后验证测试变绿。
正在使用“test-driven-development”。 Review tests that use many mocks.
预期结果:
- 识别那些只证明 mock 存在的断言。
- 建议测试真实行为,或在更低层边界进行 mock。
- 检查每个 mock 是否符合真实依赖的契约。
安全审计
安全I found no executable command behavior in the reviewed files. The external-command findings are Markdown fences, inline examples, or generic test command examples, and the blocker findings are ordinary testing prose. No evidence found for prompt injection, data exfiltration, or unsafe semantic behavior.
风险因素
⚙️ 外部命令 (27)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/cycleaddict-test-driven-development/audits/8?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/cycleaddict-test-driven-development?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/cycleaddict-test-driven-development?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/cycleaddict-test-driven-development/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/cycleaddict-test-driven-development.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
Cycleaddict. (2026). test-driven-development security audit report (audit version 8) [Author version unspecified]. Skillstore. https://skillstore.io/skills/cycleaddict-test-driven-development/audits/8BibTeX 引用
@techreport{cycleaddict-cycleaddict-test-driven-development-2026,
author = {Cycleaddict},
title = {test-driven-development security audit report (audit version 8)},
institution = {Skillstore},
year = {2026},
number = {8},
url = {https://skillstore.io/skills/cycleaddict-test-driven-development/audits/8},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "test-driven-development security audit report (audit version 8)"
version: "unspecified"
type: report
authors:
- name: "Cycleaddict"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/cycleaddict-test-driven-development/audits/8"
identifiers:
- type: other
value: "skillstore:cycleaddict-test-driven-development:audit:8"
description: "Skillstore immutable audit report identifier"
比较变体
10 个可安装变体每位作者的技能都保持为独立的可安装项。推荐变体按 Skillstore 证据排序。
为什么此变体排名第一
dmjgilbert-test-driven-development
2026-09-09
cycleaddict-test-driven-development
2026-09-09
cygnusfear-test-driven-development
2026-09-09
addyosmani-test-driven-development
2026-09-22
codingcossack-test-driven-development
2026-09-09
zhanlincui-test-driven-development
2026-09-09
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
测试优先地实现功能
指导开发者从单个失败的行为测试开始,完成最小化实现和安全重构。
用证据修复回归问题
在应用最小且可靠的修复之前,将报告的错误转化为失败的回归测试。
改进大量使用 Mock 的测试
审查断言 mock 的测试,并引导其转向真实行为和更简单的依赖。
试试这些提示
Help me implement this change with TDD. First identify the smallest failing test, then wait for the failure result before implementation.
Convert this bug into a regression test. Describe the expected failure, ask me to run it, then guide the minimal fix.
My focused tests now pass. Help me refactor without changing behavior, and keep the verification steps explicit.
Review this test plan for TDD discipline. Flag tests written after code, mock assertions, missing failure proof, and weak verification steps.
最佳实践
- 在实现之前,观察每个新测试因预期原因失败。
- 添加能让当前测试通过的最小生产代码变更。
- 仅在聚焦测试和相关测试变绿之后进行重构。
避免
- 先编写实现,再补充测试。
- 断言 mock 存在,而不是验证真实行为。
- 在绿色阶段没有失败测试的情况下扩大范围。
常见问题
此技能会自动运行测试吗?
我可以用它来修复错误吗?
它支持重构吗?
它涵盖哪些框架?
它如何处理 mock?
什么时候不应该使用它?
开发者详情
作者
Cycleaddict许可证
MIT
Skillstore 修订
r1
版本提示
作者未声明版本。
引用
d11af420e07cd866fe39cfa937efef3223896c06
维护新鲜度
2026/7/22
使用量
5 次下载 · 315 次浏览
文件结构