customaize-agent%3Acreate-skill by neolabhq/context-engineering-kit
npx skills add https://github.com/neolabhq/context-engineering-kit --skill customaize-agent:create-skill此命令为创建有效技能提供指导。
编写技能就是应用于过程文档的测试驱动开发。
个人技能存放在特定代理的目录中(Claude Code 为 ~/.claude/skills,Codex 为 ~/.codex/skills)
你编写测试用例(包含子代理的压力场景),观察它们失败(基线行为),编写技能(文档),观察测试通过(代理遵守),然后重构(堵住漏洞)。
核心原则: 如果你没有观察过代理在没有该技能时的失败情况,你就不知道这个技能是否教授了正确的东西。
必备背景: 在使用此技能之前,你必须理解测试驱动开发。该技能定义了基本的 RED-GREEN-REFACTOR 循环。本技能将 TDD 应用于文档编写。
官方指导: Anthropic 官方的技能创作最佳实践由 /customaize-agent:apply-anthropic-skill-best-practices 命令提供,它们增强了 customize-agent:prompt-engineering 技能。请同时使用该技能和本文档,因为它们不是互相复制,而是互为补充。本文档提供了额外的模式和指南,以补充本技能中聚焦于 TDD 的方法。
技能是模块化、自包含的包,通过提供专业知识、工作流程和工具来扩展 Claude 的能力。将它们视为特定领域或任务的“入职指南”——它们将 Claude 从一个通用代理转变为配备了任何模型都无法完全拥有的过程知识的专业代理。
技能 是经过验证的技术、模式或工具的参考指南。技能帮助未来的 Claude 实例找到并应用有效的方法。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
技能是: 可重用的技术、模式、工具、参考指南
技能不是: 关于你如何解决过一次问题的叙述
| TDD 概念 | 技能创建 |
|---|---|
| 测试用例 | 包含子代理的压力场景 |
| 生产代码 | 技能文档 (SKILL.md) |
| 测试失败 (RED) | 代理在没有技能的情况下违反规则(基线) |
| 测试通过 (GREEN) | 代理在技能存在时遵守规则 |
| 重构 | 在保持合规的同时堵住漏洞 |
| 先写测试 | 在编写技能之前运行基线场景 |
| 观察失败 | 记录代理使用的确切合理化理由 |
| 最小化代码 | 编写技能以解决那些特定的违规行为 |
| 观察通过 | 验证代理现在是否遵守 |
| 重构循环 | 发现新的合理化理由 → 堵住 → 重新验证 |
整个技能创建过程遵循 RED-GREEN-REFACTOR。
在以下情况创建:
不要为以下情况创建:
具有可遵循步骤的具体方法(condition-based-waiting, root-cause-tracing)
思考问题的方式(flatten-with-flags, test-invariants)
API 文档、语法指南、工具文档(office docs)
skills/
skill-name/
SKILL.md # 主参考文档(必需)
supporting-file.* # 仅在需要时
扁平命名空间 - 所有技能在一个可搜索的命名空间中
为以下内容使用单独文件:
保持内联:
每个技能都包含一个必需的 SKILL.md 文件和可选的捆绑资源:
skill-name/
├── SKILL.md (必需)
│ ├── YAML 前置元数据 (必需)
│ │ ├── name: (必需)
│ │ └── description: (必需)
│ └── Markdown 说明 (必需)
└── 捆绑资源 (可选)
├── scripts/ - 可执行代码 (Python/Bash/等)
├── references/ - 旨在根据需要加载到上下文中的文档
└── assets/ - 输出中使用的文件(模板、图标、字体等)
元数据质量: YAML 前置元数据中的 name 和 description 决定了 Claude 何时会使用该技能。要具体说明技能的作用以及何时使用它。使用第三人称(例如,“此技能应在...时使用”,而不是“在...时使用此技能”)。
前置元数据 (YAML):
仅支持两个字段:name 和 description
总计最多 1024 个字符
name:仅使用字母、数字和连字符(无括号、特殊字符)
description:第三人称,包含 BOTH 它做什么 AND 何时使用它
这是什么?用 1-2 句话说明核心原则。
[如果决策不明显,使用小型内联流程图]
包含症状和使用场景的要点列表 何时不使用
前后代码对比
用于扫描常见操作的表格或要点
简单模式的内联代码 大量参考或可重用工具的文件链接
出错的地方 + 修复方法
具体结果
scripts/)用于需要确定性可靠性或需要重复重写的任务的可执行代码(Python/Bash/等)。
scripts/rotate_pdf.pyreferences/)旨在根据需要加载到上下文中的文档和参考资料,以告知 Claude 的过程和思考。
references/finance.md,用于公司 NDA 模板的 references/mnda.md,用于公司政策的 references/policies.md,用于 API 规范的 references/api_docs.mdassets/)不打算加载到上下文中,而是在 Claude 产生的输出中使用的文件。
assets/logo.png,用于 PowerPoint 模板的 assets/slides.pptx,用于 HTML/React 样板代码的 assets/frontend-template/,用于字体的 assets/font.ttf技能使用三级加载系统来高效管理上下文:
*无限是因为脚本可以在不读入上下文窗口的情况下执行。
对可发现性至关重要: 未来的 Claude 需要能找到你的技能
目的: Claude 读取描述来决定为给定任务加载哪些技能。让它回答:“我现在应该读这个技能吗?”
格式: 以“Use when...”开头以聚焦于触发条件,然后解释它做什么
内容:
使用具体的触发条件、症状和表明此技能适用的情境
描述 问题(竞态条件、不一致行为)而不是 语言特定的症状(setTimeout, sleep)
保持触发条件与技术无关,除非技能本身是技术特定的
如果技能是技术特定的,在触发条件中明确说明
使用第三人称编写(注入到系统提示中)
description: For async testing
description: I can help you with async tests when they're flaky
description: Use when tests use setTimeout/sleep and are flaky
description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently - replaces arbitrary timeouts with condition polling for reliable async tests
description: Use when using React Router and handling authentication redirects - provides patterns for protected routes and auth state management
使用 Claude 会搜索的词语:
使用主动语态,动词优先:
creating-skills 而不是 skill-creationtesting-skills-with-subagents 而不是 subagent-skill-testing问题: 入门和经常被引用的技能会加载到每一次对话中。每个令牌都很重要。
目标词数:
技巧:
将细节移到工具帮助中:
# ❌ 差:在 SKILL.md 中记录所有标志
search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
# ✅ 好:引用 --help
search-conversations supports multiple modes and filters. Run --help for details.
使用交叉引用:
# ❌ 差:重复工作流程细节
When searching, dispatch subagent with template...
[20 lines of repeated instructions]
# ✅ 好:引用其他技能
Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
压缩示例:
# ❌ 差:冗长的示例 (42 词)
your human partner: "How did we handle authentication errors in React Router before?"
You: I'll search past conversations for React Router authentication patterns.
[Dispatch subagent with search query: "React Router authentication error handling 401"]
# ✅ 好:最小化示例 (20 词)
Partner: "How did we handle auth errors in React Router?"
You: Searching...
[Dispatch subagent → synthesis]
消除冗余:
验证:
wc -w skills/path/SKILL.md
# getting-started workflows: aim for <150 each
# Other frequently-loaded: aim for <200 total
根据你做什么或核心见解来命名:
condition-based-waiting > async-test-helpersusing-skills 而不是 skill-usageflatten-with-flags > data-structure-refactoringroot-cause-tracing > debugging-techniques动名词 (-ing) 适用于过程:
creating-skills, testing-skills, debugging-with-logs在编写引用其他技能的文档时:
仅使用技能名称,并带有明确的要求标记:
**REQUIRED SUB-SKILL:** Use superpowers:test-driven-development**REQUIRED BACKGROUND:** You MUST understand superpowers:systematic-debuggingSee skills/testing/test-driven-development (不清楚是否必需)@skills/testing/test-driven-development/SKILL.md (强制加载,消耗上下文)为什么不用 @ 链接: @ 语法会立即强制加载文件,在你需要它们之前就消耗了 200k+ 的上下文。
digraph when_flowchart {
"Need to show information?" [shape=diamond];
"Decision where I might go wrong?" [shape=diamond];
"Use markdown" [shape=box];
"Small inline flowchart" [shape=box];
"Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
"Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
"Decision where I might go wrong?" -> "Use markdown" [label="no"];
}
仅在以下情况使用流程图:
切勿在以下情况使用流程图:
有关 graphviz 样式规则,请参阅 graphviz-conventions.dot。
一个优秀的示例胜过许多平庸的示例
选择最相关的语言:
好的示例:
不要:
你很擅长移植——一个优秀的示例就足够了。
defense-in-depth/
SKILL.md # 所有内容内联
何时使用:所有内容都合适,不需要大量参考资料
condition-based-waiting/
SKILL.md # 概述 + 模式
example.ts # 可供适配的工作助手
何时使用:工具是可重用代码,不仅仅是叙述
pptx/
SKILL.md # 概述 + 工作流程
pptxgenjs.md # 600 行 API 参考
ooxml.md # 500 行 XML 结构
scripts/ # 可执行工具
何时使用:参考资料太大,无法内联
不同类型的技能需要不同的测试方法:
示例: TDD, verification-before-completion, designing-before-coding
测试方法:
成功标准: 代理在最大压力下遵循规则
示例: condition-based-waiting, root-cause-tracing, defensive-programming
测试方法:
成功标准: 代理成功将技术应用于新场景
示例: reducing-complexity, information-hiding concepts
测试方法:
成功标准: 代理正确识别何时/如何应用模式
示例: API 文档、命令参考、库指南
测试方法:
成功标准: 代理找到并正确应用参考信息
强制纪律的技能(如 TDD)需要能够抵抗合理化。代理很聪明,在压力下会寻找漏洞。
心理学说明: 理解为什么说服技巧有效,有助于你系统地应用它们。有关权威、承诺、稀缺性、社会认同和统一性原则的研究基础,请参阅 persuasion-principles.md (Cialdini, 2021; Meincke et al., 2025)。
不要仅仅陈述规则——禁止特定的变通方法:
无例外:
不要将其保留为“参考”
不要在编写测试时“调整”它
不要看它
删除意味着删除
</Good>尽早添加基本原则:
**违反规则的字面意思就是违反规则的精神。**
这切断了整个“我遵循的是精神”的合理化理由类别。
从基线测试中捕获合理化理由(见下面的测试部分)。代理提出的每一个借口都放入表中:
| 借口 | 现实 |
|--------|---------|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
让代理在合理化时容易进行自我检查:
## 红旗 - 停止并重新开始
- Code before test
- "I already manually tested it"
- "Tests after achieve the same purpose"
- "It's about spirit not ritual"
- "This is different because..."
**All of these mean: Delete code. Start over with TDD.**
添加到描述中:你即将违反规则时的症状:
description: use when implementing any feature or bugfix, before writing implementation code
遵循 TDD 循环:
在没有技能的情况下,使用子代理运行压力场景。记录确切行为:
这就是“观察测试失败”——你必须在编写技能之前看到代理自然的行为。
编写解决那些特定合理化理由的技能。不要为假设的情况添加额外内容。
使用技能运行相同的场景。代理现在应该遵守。
代理找到了新的合理化理由?添加明确的应对措施。重新测试直到无懈可击。
必需子技能: 使用 superpowers:testing-skills-with-subagents 获取完整的测试方法:
"In session 2025-10-03, we found empty projectDir caused..." 为什么不好: 太具体,不可重用
example-js.js, example-py.py, example-go.go 为什么不好: 质量平庸,维护负担重
step1 [label="import fs"];
step2 [label="read file"];
为什么不好: 无法复制粘贴,难以阅读
helper1, helper2, step3, pattern4 为什么不好: 标签应具有语义含义
在编写完任何技能后,你必须停止并完成部署过程。
不要:
下面的部署清单对每个技能都是强制性的。
部署未经测试的技能 = 部署未经测试的代码。这违反了质量标准。
重要:使用 TodoWrite 为下面的每个清单项创建待办事项。
RED 阶段 - 编写失败的测试:
GREEN 阶段 - 编写最小化技能:
REFACTOR 阶段 - 堵住漏洞:
质量检查:
部署:
未来的 Claude 如何找到你的技能:
为此流程优化 - 尽早并经常放置可搜索的术语。
创建技能就是过程文档的 TDD。
相同的铁律:没有失败的测试,就没有技能。相同的循环:RED (基线) → GREEN (编写技能) → REFACTOR (堵住漏洞)。相同的好处:更好的质量、更少的意外、无懈可击的结果。
如果你为代码遵循 TDD,那么也为技能遵循它。这是应用于文档编写的相同纪律。
要创建技能,请按顺序遵循“技能创建过程”,只有在有明确理由说明不适用时才跳过步骤。
仅当技能的使用模式已经清晰理解时才跳过此步骤。即使在使用现有技能时,它仍然有价值。
要创建有效的技能,请清楚地理解技能将如何使用的具体示例。这种理解可以来自直接的用户示例,也可以来自经过用户反馈验证的生成示例。
例如,在构建 image-editor 技能时,相关问题包括:
为了避免让用户不知所措,避免在单个消息中问太多问题。从最重要的问题开始,并根据需要跟进以获得更好的效果。
当对技能应支持的功能有清晰的认识时,结束此步骤。
要将具体示例转化为有效的技能,请通过以下方式分析每个示例:
示例:在构建 pdf-editor 技能来处理诸如“Help me rotate this PDF”之类的查询时,分析显示:
scripts/rotate_pdf.py 脚本将有助于存储在技能中示例:在设计 frontend-webapp-builder 技能来处理诸如“Build me a todo app”或“Build me a dashboard to track my steps”之类的查询时,分析显示:
assets/hello-world/ 模板将有助于存储在技能中示例:在构建 big-query 技能来处理诸如“How many users have logged in today?”之类的查询时,分析显示:
references/schema.md 文件将有助于存储在技能中要建立技能的内容,请分析每个具体示例,以创建要包含的可重用资源列表:脚本、参考资料和资产。
如果技能已存在且仅需要迭代,则跳过此步骤。
创建技能目录和必需的文件:
mkdir -p skills/<skill-name>SKILL.md:---
name: skill-name
description: Use when [triggering conditions] - [what the skill does]
---
# 技能名称
## 关键指南
[用 1-2 句话说明核心原则。每句以“You MUST ...”开头]
## 如何使用
[分步思考,使用问题分解等]
## 指南
[程序、模式]
## 示例
[如何使用技能的示例,包括代理输入和输出]
## 故障排除
[常见错误及如何避免]
## 资源
[脚本、参考资料、资产]
3. 仅在需要时添加资源子目录:
* scripts/ — 可重用的可执行代码
* references/ — 按需加载的文档
* assets/ — 输出中使用的文件(模板、图像)
在编辑(新生成的或现有的)技能时,请记住,该技能是为另一个 Claude 实例使用而创建的。专注于包含对 Claude 有益且非显而易见的信息。考虑哪些过程知识、领域特定细节或可重用资产将帮助另一个 Claude 实例更有效地执行这些任务。
要开始实现,请从上面识别的可重用资源开始:scripts/、references/ 和 assets/ 文件。请注意,此步骤可能需要用户输入。例如,在实现 brand-guidelines 技能时,用户可能需要提供要存储在 assets/ 中的品牌资产或模板,或要存储在 references/ 中的文档。
删除技能不需要的任何资源子目录。大多数技能只需要 SKILL.md。
写作风格: 使用 命令式/不定式形式(动词优先的说明)编写整个技能,而不是第二人称。使用客观的、指导性的语言(例如,“要完成 X,执行 Y”而不是“你应该做 X”或“如果你需要做 X”)。这为 AI 消费保持了一致性和清晰度。
要完成 SKILL.md,请回答以下问题:
在部署之前,验证技能是否符合要求:
name 和 description(总计最多 1024 字符)SKILL.md 存在于 skills/<skill-name>/SKILL.md测试技能后,用户可能会请求改进。这通常发生在使用技能后不久,对技能的表现有新鲜的了解。
迭代工作流程:
每周安装
243
仓库
GitHub 星标
708
首次出现
2026年2月19日
安装于
opencode236
codex235
github-copilot234
gemini-cli233
amp231
kimi-cli231
This command provides guidance for creating effective skills.
Writing skills IS Test-Driven Development applied to process documentation.
Personal skills live in agent-specific directories (~/.claude/skills for Claude Code, ~/.codex/skills for Codex)
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 Test-Driven Development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
Official guidance: The Anthropic's official skill authoring best practices provided at the /customaize-agent:apply-anthropic-skill-best-practices command, they enhance customize-agent:prompt-engineering skill. Use skill and the document, as they not copy but add to each other. These document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.
Skills are modular, self-contained packages that extend Claude's capabilities by providing specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific domains or tasks—they transform Claude from a general-purpose agent into a specialized agent equipped with procedural knowledge that no model can fully possess.
A skill is a reference guide for proven techniques, patterns, or tools. Skills help future Claude instances 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 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.
Create when:
Don't create for:
Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)
Way of thinking about problems (flatten-with-flags, test-invariants)
API docs, syntax guides, tool documentation (office docs)
skills/
skill-name/
SKILL.md # Main reference (required)
supporting-file.* # Only if needed
Flat namespace - all skills in one searchable namespace
Separate files for:
Keep inline:
Every skill consists of a required SKILL.md file and optional bundled resources:
skill-name/
├── SKILL.md (required)
│ ├── YAML frontmatter metadata (required)
│ │ ├── name: (required)
│ │ └── description: (required)
│ └── Markdown instructions (required)
└── Bundled Resources (optional)
├── scripts/ - Executable code (Python/Bash/etc.)
├── references/ - Documentation intended to be loaded into context as needed
└── assets/ - Files used in output (templates, icons, fonts, etc.)
Metadata Quality: The name and description in YAML frontmatter determine when Claude will use the skill. Be specific about what the skill does and when to use it. Use the third-person (e.g. "This skill should be used when..." instead of "Use this skill when...").
Frontmatter (YAML):
Only two fields supported: name and description
Max 1024 characters total
name: Use letters, numbers, and hyphens only (no parentheses, special chars)
description: Third-person, includes BOTH what it does AND when to use it
What is this? Core principle in 1-2 sentences.
[Small inline flowchart IF decision non-obvious]
Bullet list with SYMPTOMS and use cases When NOT to use
Before/after code comparison
Table or bullets for scanning common operations
scripts/)Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
scripts/rotate_pdf.py for PDF rotation tasksreferences/)Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.
references/finance.md for financial schemas, references/mnda.md for company NDA template, references/policies.md for company policies, references/api_docs.md for API specificationsassets/)Files not intended to be loaded into context, but rather used within the output Claude produces.
assets/logo.png for brand assets, assets/slides.pptx for PowerPoint templates, assets/frontend-template/ for HTML/React boilerplate, assets/font.ttf for typographySkills use a three-level loading system to manage context efficiently:
*Unlimited because scripts can be executed without reading into context window.
Critical for discovery: Future Claude needs to FIND your skill
Purpose: Claude reads description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"
Format: Start with "Use when..." to focus on triggering conditions, then explain what it does
Content:
Use concrete triggers, symptoms, and situations that signal this skill applies
Describe the problem (race conditions, inconsistent behavior) not language-specific symptoms (setTimeout, sleep)
Keep triggers technology-agnostic unless the skill itself is technology-specific
If skill is technology-specific, make that explicit in the trigger
Write in third person (injected into system prompt)
description: For async testing
description: I can help you with async tests when they're flaky
description: Use when tests use setTimeout/sleep and are flaky
description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently - replaces arbitrary timeouts with condition polling for reliable async tests
description: Use when using React Router and handling authentication redirects - provides patterns for protected routes and auth state management
Use words Claude would search for:
Use active voice, verb-first:
creating-skills not skill-creationtesting-skills-with-subagents not subagent-skill-testingProblem: getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.
Target word counts:
Techniques:
Move details to tool help:
# ❌ BAD: Document all flags in SKILL.md
search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
# ✅ GOOD: Reference --help
search-conversations supports multiple modes and filters. Run --help for details.
Use cross-references:
# ❌ BAD: Repeat workflow details
When searching, dispatch subagent with template...
[20 lines of repeated instructions]
# ✅ GOOD: Reference other skill
Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
Compress examples:
# ❌ BAD: Verbose example (42 words)
your human partner: "How did we handle authentication errors in React Router before?"
You: I'll search past conversations for React Router authentication patterns.
[Dispatch subagent with search query: "React Router authentication error handling 401"]
# ✅ GOOD: Minimal example (20 words)
Partner: "How did we handle auth errors in React Router?"
You: Searching...
[Dispatch subagent → synthesis]
Eliminate redundancy:
Verification:
wc -w skills/path/SKILL.md
# getting-started workflows: aim for <150 each
# Other frequently-loaded: aim for <200 total
Name by what you DO or core insight:
condition-based-waiting > async-test-helpersusing-skills not skill-usageflatten-with-flags > data-structure-refactoringroot-cause-tracing > debugging-techniquesGerunds (-ing) work well for processes:
creating-skills, testing-skills, debugging-with-logsWhen writing documentation that references other skills:
Use skill name only, with explicit requirement markers:
**REQUIRED SUB-SKILL:** Use superpowers:test-driven-development**REQUIRED BACKGROUND:** You MUST understand superpowers:systematic-debuggingSee skills/testing/test-driven-development (unclear if required)@skills/testing/test-driven-development/SKILL.md (force-loads, burns context)Why no @ links: @ syntax force-loads files immediately, consuming 200k+ context before you need them.
digraph when_flowchart {
"Need to show information?" [shape=diamond];
"Decision where I might go wrong?" [shape=diamond];
"Use markdown" [shape=box];
"Small inline flowchart" [shape=box];
"Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
"Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
"Decision where I might go wrong?" -> "Use markdown" [label="no"];
}
Use flowcharts ONLY for:
Never use flowcharts for:
See graphviz-conventions.dot for graphviz style rules.
One excellent example beats many mediocre ones
Choose most relevant language:
Good example:
Don't:
You're good at porting - one great example is enough.
defense-in-depth/
SKILL.md # Everything inline
When: All content fits, no heavy reference needed
condition-based-waiting/
SKILL.md # Overview + patterns
example.ts # Working helpers to adapt
When: Tool is reusable code, not just narrative
pptx/
SKILL.md # Overview + workflows
pptxgenjs.md # 600 lines API reference
ooxml.md # 500 lines XML structure
scripts/ # Executable tools
When: Reference material too large for inline
Different skill types need different test approaches:
Examples: TDD, verification-before-completion, designing-before-coding
Test with:
Success criteria: Agent follows rule under maximum pressure
Examples: condition-based-waiting, root-cause-tracing, defensive-programming
Test with:
Success criteria: Agent successfully applies technique to new scenario
Examples: reducing-complexity, information-hiding concepts
Test with:
Success criteria: Agent correctly identifies when/how to apply pattern
Examples: API documentation, command references, library guides
Test with:
Success criteria: Agent finds and correctly applies reference information
Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.
Psychology note: Understanding WHY persuasion techniques work helps you apply them systematically. See persuasion-principles.md for research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles.
Don't just state the rule - forbid specific workarounds:
No exceptions:
Don't keep it as "reference"
Don't "adapt" it while writing tests
Don't look at it
Delete means delete
</Good>Add foundational principle early:
**Violating the letter of the rules is violating the spirit of the rules.**
This cuts off entire class of "I'm following the spirit" rationalizations.
Capture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table:
| Excuse | Reality |
|--------|---------|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
Make it easy for agents to self-check when rationalizing:
## Red Flags - STOP and Start Over
- Code before test
- "I already manually tested it"
- "Tests after achieve the same purpose"
- "It's about spirit not ritual"
- "This is different because..."
**All of these mean: Delete code. Start over with TDD.**
Add to description: symptoms of when you're ABOUT to violate the rule:
description: use when implementing any feature or bugfix, before writing implementation code
Follow the TDD cycle:
Run pressure scenario with subagent WITHOUT the skill. Document exact behavior:
This is "watch the test fail" - you must see what agents naturally do before writing the skill.
Write skill that addresses those specific rationalizations. Don't add extra content for hypothetical cases.
Run same scenarios WITH skill. Agent should now comply.
Agent found new rationalization? Add explicit counter. Re-test until bulletproof.
REQUIRED SUB-SKILL: Use superpowers:testing-skills-with-subagents for the complete testing methodology:
"In session 2025-10-03, we found empty projectDir caused..." Why bad: Too specific, not reusable
example-js.js, example-py.py, example-go.go Why bad: Mediocre quality, maintenance burden
step1 [label="import fs"];
step2 [label="read file"];
Why bad: Can't copy-paste, hard to read
helper1, helper2, step3, pattern4 Why bad: Labels should have semantic meaning
After writing ANY skill, you MUST STOP and complete the deployment process.
Do NOT:
The deployment checklist below is MANDATORY for EACH skill.
Deploying untested skills = deploying untested code. It's a violation of quality standards.
IMPORTANT: Use TodoWrite to create todos for EACH checklist item below.
RED Phase - Write Failing Test:
GREEN Phase - Write Minimal Skill:
REFACTOR Phase - Close Loopholes:
Quality Checks:
Deployment:
How future Claude finds your skill:
Optimize for this flow - put searchable terms early and often.
Creating skills IS TDD for process documentation.
Same Iron Law: No skill without failing test first. Same cycle: RED (baseline) → GREEN (write skill) → REFACTOR (close loopholes). Same benefits: Better quality, fewer surprises, bulletproof results.
If you follow TDD for code, follow it for skills. It's the same discipline applied to documentation.
To create a skill, follow the "Skill Creation Process" in order, skipping steps only if there is a clear reason why they are not applicable.
Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.
To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
For example, when building an image-editor skill, relevant questions include:
To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.
Conclude this step when there is a clear sense of the functionality the skill should support.
To turn concrete examples into an effective skill, analyze each example by:
Example: When building a pdf-editor skill to handle queries like "Help me rotate this PDF," the analysis shows:
scripts/rotate_pdf.py script would be helpful to store in the skillExample: When designing a frontend-webapp-builder skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
assets/hello-world/ template containing the boilerplate HTML/React project files would be helpful to store in the skillExample: When building a big-query skill to handle queries like "How many users have logged in today?" the analysis shows:
references/schema.md file documenting the table schemas would be helpful to store in the skillTo establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
Skip this step if the skill already exists and only needs iteration.
Create the skill directory and required files:
mkdir -p skills/<skill-name>SKILL.md with YAML frontmatter:---
name: skill-name
description: Use when [triggering conditions] - [what the skill does]
---
# Skill Name
## Critical Guidlines
[Core principle in 1-2 sentences. Each start wit "You MUST ..."]
## How to Use
[Think in steps, use problem decomposition, etc.]
## Guide
[Procedures, patterns]
## Examples
[Examples of how to use the skill, include agent input and output]
## Troubleshooting
[Common mistakes and how to avoid them]
## Resources
[Scripts, references, assets]
3. Add resource subdirectories only if needed:
* scripts/ — reusable executable code
* references/ — documentation loaded on demand
* assets/ — files used in output (templates, images)
When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Focus on including information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.
To begin implementation, start with the reusable resources identified above: scripts/, references/, and assets/ files. Note that this step may require user input. For example, when implementing a brand-guidelines skill, the user may need to provide brand assets or templates to store in assets/, or documentation to store in references/.
Remove any resource subdirectories not needed for the skill. Most skills need only SKILL.md.
Writing Style: Write the entire skill using imperative/infinitive form (verb-first instructions), not second person. Use objective, instructional language (e.g., "To accomplish X, do Y" rather than "You should do X" or "If you need to do X"). This maintains consistency and clarity for AI consumption.
To complete SKILL.md, answer the following questions:
Before deploying, verify the skill meets requirements:
name and description (max 1024 chars total)SKILL.md exists at skills/<skill-name>/SKILL.mdAfter testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
Iteration workflow:
Weekly Installs
243
Repository
GitHub Stars
708
First Seen
Feb 19, 2026
Installed on
opencode236
codex235
github-copilot234
gemini-cli233
amp231
kimi-cli231
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
41,800 周安装
Inline code for simple patterns Link to file for heavy reference or reusable tools
What goes wrong + fixes
Concrete results