test-driven-development
练习测试驱动开发
实现工作经常在没有测试证明行为的情况下发布。此技能会指导 Claude、Codex 和 Claude Code 遵循严格的测试优先开发。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "test-driven-development" from https://skillstore.io/skills/obra-test-driven-development.md and its manifest at https://skillstore.io/api/skills/obra-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”。 为失败操作实现重试行为。
预期结果:
助手会编写一个失败的重试测试,确认预期失败,添加最小重试逻辑,然后在所有测试通过后进行重构。
正在使用“test-driven-development”。 修复空邮箱提交被接受的问题。
预期结果:
助手会为空邮箱输入创建回归测试,验证当前失败,然后为该行为添加校验。
正在使用“test-driven-development”。 评审严重依赖 mock 的测试。
预期结果:
助手会标记关于 mock 元素的断言,建议测试真实行为,并建议仅在需要隔离时使用更低层级的 mock。
安全审计
安全All static findings are false positives caused by Markdown fences, inline examples, or ordinary testing guidance. I found no prompt injection, data exfiltration intent, reconnaissance behavior, or unsafe command construction in the reviewed files.
风险因素
⚙️ 外部命令 (27)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/obra-test-driven-development/audits/8?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/obra-test-driven-development?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/obra-test-driven-development?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/obra-test-driven-development/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/obra-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 引用
obra. (2026). test-driven-development security audit report (audit version 8) [Author version unspecified]. Skillstore. https://skillstore.io/skills/obra-test-driven-development/audits/8BibTeX 引用
@techreport{obra-obra-test-driven-development-2026,
author = {obra},
title = {test-driven-development security audit report (audit version 8)},
institution = {Skillstore},
year = {2026},
number = {8},
url = {https://skillstore.io/skills/obra-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: "obra"
date-released: "2026-07-05"
url: "https://skillstore.io/skills/obra-test-driven-development/audits/8"
identifiers:
- type: other
value: "skillstore:obra-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 评分
评分依据 证据置信度: 高你能构建什么
安全地构建功能
使用此技能定义一个预期行为,证明它会失败,然后实现能通过的最小变更。
修复回归问题
在编辑受影响的代码路径之前,先用失败的测试复现 bug。
改进测试纪律
在评审 AI 辅助的实现工作时,使用检查清单和反模式参考。
试试这些提示
对这个功能使用严格的 TDD:[feature]。先识别一个行为,编写失败的测试,验证失败,然后实现最小变更。
使用此 TDD 技能修复这个 bug:[bug]。在修改生产代码之前,创建一个能复现它的失败回归测试。
使用此技能重构 [area]。先确认或添加行为测试,在需要时验证它们会失败,然后在清理过程中保持所有测试为绿色。
根据严格 TDD 审核此实现计划。识别缺失的失败测试、mock 反模式,以及下一个最小且安全的应编写测试。
最佳实践
- 在修改生产代码之前,编写最小的失败测试。
- 验证每个失败都是预期的,并且由缺失行为导致。
- 仅在测试通过后重构,并保持输出干净。
避免
- 先编写实现代码,然后再添加测试。
- 测试 mock 行为,而不是真实的用户可见行为。
- 添加仅为支持测试而存在的生产方法。
常见问题
此技能有什么帮助?
它会自动运行测试吗?
哪些工具可以使用它?
它可以用于现有的未测试代码吗?
它允许 TDD 例外吗?
它处理哪些测试错误?
开发者详情
作者
obra许可证
MIT
Skillstore 修订
r1
版本提示
作者未声明版本。
引用
62e2a730c5cd74eab4c7164309d810de660fcea3
维护新鲜度
2026/7/20
使用量
9 次下载 · 373 次浏览
文件结构