跳到主内容
智客 ZICQ

技能库 智客分类:开发工程 test-driven-development Claude CodeCursorCodex

测试驱动开发

实现功能或修 bug 之前先写失败测试,再写最小实现并重构。

244121 安装量

官方网址:Superpowers

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

官方 description 把触发条件写在最前:写实现代码之前先走红-绿-重构。正文三节与规范逐步披露一致。

何时用

实现功能或修 bug、尚未写实现代码时。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Test-Driven Development、Write a failing test、Minimal implementation、Refactor。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Use when implementing any feature or bugfix, before writing implementation code. Write a failing test first, then the minimal code to pass, then refactor.

Test-Driven DevelopmentWrite a failing testMinimal implementationRefactor

· 许可:MIT

来源分类:GitHub skill skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
test-driven-development
description
Use when implementing any feature or bugfix, before writing implementation code. Write a failing test first, then the minimal code to pass, then refactor.
许可
MIT
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「test-driven-development」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-seed-code-01-%E6%B5%8B%E8%AF%95%E9%A9%B1%E5%8A%A8%E5%BC%80%E5%8F%91.html
请存为 .cursor/skills/test-driven-development/SKILL.md 或 .claude/skills/test-driven-development/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/obra/superpowers/tree/main/skills/test-driven-development' --list

npx skills add 'https://github.com/obra/superpowers/tree/main/skills/test-driven-development' --skill 'test-driven-development'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版

name: test-driven-development description: Use when implementing any feature or bugfix, before writing implementation code. Write a failing test first, then the minimal code to pass, then refactor. license: MIT

Test-Driven Development

Write a failing test

Do not start with production code. Name the behavior, run the test, confirm it fails.

Minimal implementation

Write only enough code to make the test pass.

Refactor

Clean the design only after green. Keep tests green.

相关技能

开发工程

吉图布Github

使用`gh' CLI与 GitHub 进行互动。 使用`gh问题 ' 、`gh pr ' 、`gh run ' 和`gh api'处理问题、公关、CI运行和高级询问.

开发工程

精英长期记忆Elite Longterm Memory

Cursor, Claude, ChatGPT & Copilot的终极AI代理内存系统. WAL协议+向量搜索+git-notes+云备份. 永远不要失去背景。 维比编码准备好了.

开发工程

答覆流量Answeroverflow

通过Answer Overflow搜索索引的Discord社区讨论. 寻找只存在于Discord对话中的编码问题、库问题和社区QQA的解决方案.

开发工程

Git 基本内容Git Essentials

基本内容 Git 命令和工作流程用于版本控制,分支,以及协作.