writing-skills
它能做什么
它说明如何为 AI 智能体创建或编辑技能,并在依赖它之前确认其有效。它适合构建或改进智能体技能的人。
适用场景
- ✓你想为智能体从零开始创建一项新技能的时候。
- ✓你需要编辑已有技能,并确认它仍然有效的时候。
- ✓你想在部署技能之前,先检查它是否有效的时候。
技能链接
https://github.com/obra/superpowers/blob/main/skills/writing-skills/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想为我的 AI 助手编写一项新技能,并想确认它真的有效。”
每周 5 个新技能,1 分钟读完。
工作原理
它把每项技能都当作一个测试。智能体先观察在没有该技能的情况下任务是如何失败的,然后编写技能,最后确认智能体会遵循它。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Writing Skills
Overview
Writing skills IS Test-Driven Development applied to process documentation.
Personal skills live in your runtime's skills directory (~/.claude/skills/ on Claude Code) — see codex-tools.md or gemini-tools.md for the path on those runtimes. Codex, Copilot CLI, and Gemini CLI all also recognize ~/.agents/skills/ as a cross-runtime alias.
You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
Core principle: If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.
REQUIRED BACKGROUND: You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
Official guidance: For Anthropic's official skill authoring best practices, see references/anthropic-best-practices.md. This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.
What is a Skill?
A skill is a reference guide for proven techniques, patterns, or tools. Skills help future agents find and apply effective approaches.
Skills are: Reusable techniques, patterns, tools, reference guides
Skills are NOT: Narratives about how you solved a problem once
TDD Mapping for Skills
| TDD Concept | Skill Creation |
|---|---|
| Test case | Pressure scenario with subagent |
| Production code | Skill document (SKILL.md) |
| Test fails (RED) | Agent violates rule without skill (baseline) |
| Test passes (GREEN) | Agent complies with skill present |
| Refactor | Close loopholes while maintaining compliance |
| Write test first | Run baseline scenario BEFORE writing skill |
| Watch it fail | Document exact rationalizations agent uses |
| Minimal code | Write skill addressing those specific violations |
| Watch it pass | Verify agent now complies |
| Refactor cycle | Find new rationalizations → plug → re-verify |
The entire skill creation process follows RED-GREEN-REFACTOR.
When to Create a Skill
Create when:
- Technique wasn't intuitively obvious to you
- You'd reference this again across projects
- Pattern applies broadly (not project-specific)
- Others would benefit
Don't create for:
- One-off solutions
- Standard practices well-documented elsewhere
- Project-specific conventions (put in your instructions file)
- Mechanical constraints (if it's enforceable with regex/validation, automate it—save documentation for judgment calls)
Skill Types
Technique
Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)
Pattern
Way of thinking about problems (flatten-with-flags, test-invariants)
Reference
API docs, syntax guides, tool documentation (office docs)
Directory Structure
skills/
skill-name/
SKILL.md # Main reference (required)
supporting-file.* # Only if needed
Flat namespace - all skills in one searchable namespace
Separate files for:
- Heavy reference (100+ lines) - API docs, comprehensive syntax
- Reusable tools - Scripts, utilities, templates
Keep inline:
- Principles and concepts
- Code patterns (< 50 lines)
- Everything else
Writing SKILL.md
A skill's description says only when to use it: triggering conditions and
symptoms, starting with "Use when...". It never summarizes the skill's
workflow, because an agent that reads a workflow summary follows it instead
of reading the skill.
When you write or change a skill's frontmatter, name or description, or need to cut its size, read references/discovery.md: the SKILL.md template, description and keyword guidance, naming, token budgets, and cross-referencing other skills.
Flowcharts
When you add or change a flowchart in a skill, read references/flowcharts.md first: when a flowchart earns its place, the graphviz conventions, and how to render one.
Code Examples
One excellent example beats many mediocre ones
Choose most relevant language:
- Testing techniques → TypeScript/JavaScript
- System debugging → Shell/Python
- Data processing → Python
常见问题
使用这项技能需要懂编程吗?
不一定。技能本质上是纯文字说明,因此这项技能是为能够写出清楚步骤的人编写的。
这项技能会说明如何测试技能吗?
会。它要求你在有技能和没有技能的情况下分别运行智能体,并在完成前比较结果。
个人技能应当保存在哪里?
技能说明个人技能应放在运行环境的技能文件夹中,例如 Claude Code 设置下的技能文件夹。
详情
作者的原始描述
Use when creating new skills, editing existing skills, or verifying skills work before deployment
repo: obra/superpowers
热度
- GitHub 星标
- 311k
- 排名
- #99
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
brainstorming
311k帮你的智能体在构建任何新东西之前,先通过有针对性的问题和清晰的方案,弄清楚你真正想要什么。
executing-plans
311k帮你的智能体在当前会话中,按步骤执行已写好的实施计划,每一步完成后先测试,再进入下一步。
finishing-a-development-branch
311k帮你的智能体收尾已完成的代码:先运行测试,再提供合并、发起拉取请求或保留分支等清晰选项。
receiving-code-review
311k帮你的智能体认真评估代码审阅意见,在改动任何内容之前,先对照代码逐条核实。