skill-architect
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Architect: The Authoritative Meta-Skill
Skill Architect:权威元技能
The unified authority for creating expert-level Agent Skills. Combines systematic workflow from skill-creator with domain expertise encoding from skill-coach.
创建专家级Agent Skills的统一权威工具。融合了skill-creator的系统化工作流程与skill-coach的领域专业知识编码能力。
Philosophy
核心理念
Great skills are progressive disclosure machines that encode real domain expertise (shibboleths), not just surface instructions. They activate precisely, teach efficiently, and make users productive immediately.
优秀的技能是渐进式披露机制,它们编码了真实的领域专业知识(Shibboleths),而非仅仅是表面指令。它们能精准激活、高效教学,让用户立刻投入生产。
When to Use This Skill
何时使用本技能
✅ Use for:
- Creating new skills from scratch
- Auditing/reviewing existing skills
- Improving activation rates
- Adding domain expertise
- Debugging why skills don't activate
- Encoding anti-patterns and shibboleths
- Building self-contained tools (scripts, MCPs, subagents)
❌ NOT for:
- General Claude Code features (slash commands, MCPs)
- Non-skill coding advice
- Debugging runtime errors (use domain-specific skills)
- Template generation without domain expertise
✅ 适用场景:
- 从零开始创建新技能
- 审核/评估现有技能
- 提升技能激活率
- 注入领域专业知识
- 调试技能无法激活的问题
- 编码反模式与Shibboleths
- 构建独立工具(脚本、MCP、子代理)
❌ 不适用场景:
- 通用Claude Code功能(斜杠命令、MCP)
- 非技能类编码建议
- 调试运行时错误(使用领域特定技能)
- 无领域专业知识支撑的模板生成
Quick Wins (Immediate Improvements)
快速优化(即时改进)
For existing skills, apply these in order:
- Add NOT clause → Prevent false activation
- Check line count → SKILL.md should be <500 lines
- Add 1-2 anti-patterns → Prevent common mistakes
- Remove dead files → Delete unreferenced scripts/references
- Test activation → Write queries that should/shouldn't trigger
Run validation:
bash
python scripts/validate_skill.py <path>
python scripts/check_self_contained.py <path>针对现有技能,按以下顺序应用优化:
- 添加NOT条款 → 防止误激活
- 检查行数 → SKILL.md应少于500行
- 添加1-2个反模式 → 避免常见错误
- 删除无用文件 → 删除未被引用的脚本/参考资料
- 测试激活效果 → 编写应触发/不应触发技能的查询语句
运行验证命令:
bash
python scripts/validate_skill.py <path>
python scripts/check_self_contained.py <path>What Makes a Great Skill
优秀技能的特质
Great skills have these 7 qualities:
- Activate precisely - Specific keywords + NOT clause
- Encode shibboleths - Expert knowledge that separates novice from expert
- Surface anti-patterns - "If you see X, that's wrong because Y, use Z"
- Capture temporal knowledge - "Pre-2024: X. 2024+: Y"
- Know their limits - "Use for A, B, C. NOT for D, E, F"
- Provide decision trees - Not templates, but "If X then A, if Y then B"
- Stay under 500 lines - Core in SKILL.md, deep dives in
/references
优秀的技能具备以下7个特质:
- 精准激活 - 特定关键词 + NOT条款
- 编码Shibboleths - 区分新手与专家的专业知识
- 明确反模式 - "如果遇到X,那是错误的,因为Y,应使用Z"
- 包含时间维度知识 - "2024年前:X。2024年后:Y"
- 清晰边界 - "适用于A、B、C。不适用于D、E、F"
- 提供决策树 - 而非模板,即"如果X则执行A,如果Y则执行B"
- 精简篇幅 - 核心内容在SKILL.md中,深入内容放在目录
/references
Progressive Disclosure Principle
渐进式披露原则
Skills use a three-level loading system:
| Level | Content | Size | When Loaded |
|---|---|---|---|
| 1. Metadata | | ~100 tokens | Always in context |
| 2. SKILL.md | Core instructions | <5k tokens | When skill triggers |
| 3. Resources | Scripts, references, assets | Unlimited | As Claude needs them |
Critical: Keep SKILL.md under 500 lines. Move details to .
/references技能采用三级加载体系:
| 层级 | 内容 | 大小 | 加载时机 |
|---|---|---|---|
| 1. 元数据 | | ~100 tokens | 始终处于上下文 |
| 2. SKILL.md | 核心指令 | <5k tokens | 技能触发时加载 |
| 3. 资源 | 脚本、参考资料、资产 | 无限制 | Claude需要时加载 |
关键要求:SKILL.md需控制在500行以内。将细节内容移至目录。
/referencesSkill Structure
技能结构
Mandatory
必备结构
your-skill/
└── SKILL.md # Core instructions (max 500 lines)your-skill/
└── SKILL.md # 核心指令(最多500行)Strongly Recommended (Self-Contained Skills)
强烈推荐(独立技能)
├── scripts/ # Working code - NOT templates
├── mcp-server/ # Custom MCP if external APIs needed
├── agents/ # Subagent definitions for orchestration
├── references/ # Deep dives on domain knowledge
└── CHANGELOG.md # Version historyPhilosophy: Skills with working tools are immediately useful.
├── scripts/ # 可运行代码 - 非模板
├── mcp-server/ # 如需调用外部API的自定义MCP
├── agents/ # 用于编排的子代理定义
├── references/ # 领域知识深度解析
└── CHANGELOG.md # 版本历史核心理念:具备可运行工具的技能能立即发挥作用。
SKILL.md Template
SKILL.md模板
markdown
---
name: your-skill-name
description: [What] [When] [Triggers]. NOT for [Exclusions].
allowed-tools: Read,Write # Minimal only
---markdown
---
name: your-skill-name
description: [功能] [场景] [触发关键词]。不适用于[排除场景]。
allowed-tools: Read,Write # 仅保留必要权限
---Skill Name
技能名称
[One sentence purpose]
[一句话描述用途]
When to Use
适用场景
✅ Use for: [A, B, C with specific keywords]
❌ NOT for: [D, E, F - be explicit]
✅ 适用于:[带特定关键词的A、B、C场景]
❌ 不适用于:[明确的D、E、F场景]
Core Instructions
核心指令
[Step-by-step decision trees, not templates]
[分步决策树,而非模板]
Common Anti-Patterns
常见反模式
[Pattern Name]
[模式名称]
Novice thinking: [Wrong assumption]
Reality: [Why it's wrong]
Correct approach: [Better way]
Timeline: [When this changed]
新手误区:[错误假设]
实际情况:[错误原因]
正确做法:[优化方案]
时间线:[变更时间]
References
参考资料
- - [When to consult]
/references/deep-dive.md
---- - [查阅场景]
/references/deep-dive.md
---Description Formula
描述公式
[What] [When] [Keywords] NOT for [Exclusions]
Examples:
❌ Bad: "Helps with images"
⚠️ Better: "Image processing with CLIP"
✅ Good: "CLIP semantic search. Use for image-text matching, zero-shot classification. Activate on 'CLIP', 'embeddings', 'similarity'. NOT for counting objects, spatial reasoning, or fine-grained classification."
[功能] [场景] [关键词] 不适用于[排除场景]
示例:
❌ 不佳:"帮助处理图片"
⚠️ 较好:"使用CLIP进行图像处理"
✅ 优秀:"CLIP语义搜索。适用于图文匹配、零样本分类。触发关键词为'CLIP'、'embeddings'、'similarity'。不适用于物体计数、空间推理或细粒度分类。"
Frontmatter Rules (CRITICAL)
前置元数据规则(至关重要)
Only these keys are allowed by Claude's skill marketplace:
| Key | Required | Purpose |
|---|---|---|
| ✅ | Lowercase-hyphenated identifier |
| ✅ | Activation keywords + NOT clause |
| ⚠️ | Comma-separated tool names |
| ❌ | e.g., "MIT" |
| ❌ | Custom key-value pairs |
Invalid keys that WILL FAIL upload:
yaml
undefinedClaude技能市场仅允许以下键:
| 键名 | 必填 | 用途 |
|---|---|---|
| ✅ | 小写连字符格式的标识符 |
| ✅ | 激活关键词 + NOT条款 |
| ⚠️ | 逗号分隔的工具名称 |
| ❌ | 例如:"MIT" |
| ❌ | 自定义键值对 |
会导致上传失败的无效键:
yaml
undefined❌ WRONG - These break skill upload
❌ 错误 - 这些会破坏技能上传
integrates_with: [...]
triggers: [...]
tools: Read,Write # Use 'allowed-tools' instead
outputs: [...]
coordinates_with: [...]
python_dependencies: [...]
**Move custom info to body** under appropriate headings.
---integrates_with: [...]
triggers: [...]
tools: Read,Write # 请使用'allowed-tools'替代
outputs: [...]
coordinates_with: [...]
python_dependencies: [...]
**将自定义信息移至正文**的对应章节下。
---The 6-Step Skill Creation Process
六步技能创建流程
Step 1: Understand with Concrete Examples
步骤1:通过具体示例明确需求
Skip only if usage patterns are already clear.
Ask:
- "What functionality should this skill support?"
- "Can you give examples of how it would be used?"
- "What would trigger this skill?"
Example queries (for an image-editor skill):
- "Remove red-eye from this image"
- "Rotate this photo 90 degrees"
- "Adjust brightness and contrast"
Conclude when you have 3-5 concrete examples.
仅当使用模式已清晰时可跳过此步骤。
需明确:
- "该技能应支持哪些功能?"
- "能否给出该技能的使用示例?"
- "哪些关键词会触发该技能?"
示例查询(针对图片编辑器技能):
- "移除这张图片中的红眼"
- "将这张照片旋转90度"
- "调整亮度和对比度"
收集3-5个具体示例后进入下一步。
Step 2: Plan Reusable Contents
步骤2:规划可复用内容
For each example, analyze:
- How to execute from scratch
- What scripts/references/assets would help with repeated execution
Example analyses:
| Skill | Example | Needs |
|---|---|---|
| pdf-editor | "Rotate this PDF" | |
| frontend-builder | "Build a todo app" | |
| big-query | "How many users logged in?" | |
| photo-expert | "Improve composition" | |
Shibboleths to encode:
- Domain-specific algorithms
- Common pitfalls and anti-patterns
- Temporal knowledge (what changed when)
- Framework evolution patterns
针对每个示例,分析:
- 如何从零开始执行
- 哪些脚本/参考资料/资产有助于重复执行
示例分析:
| 技能 | 示例 | 所需资源 |
|---|---|---|
| pdf-editor | "旋转此PDF" | |
| frontend-builder | "构建待办事项应用" | |
| big-query | "有多少用户登录了?" | |
| photo-expert | "优化构图" | |
需编码的Shibboleths:
- 领域特定算法
- 常见陷阱与反模式
- 时间维度知识(变更节点)
- 框架演进模式
Step 3: Initialize the Skill
步骤3:初始化技能
For new skills, run the init script:
bash
scripts/init_skill.py <skill-name> --path <output-directory>This creates:
- SKILL.md template with proper frontmatter
- Example ,
scripts/,references/directoriesassets/ - TODO placeholders to customize
For existing skills, skip to Step 4.
针对新技能,运行初始化脚本:
bash
scripts/init_skill.py <skill-name> --path <output-directory>该脚本会创建:
- 带正确前置元数据的SKILL.md模板
- 示例、
scripts/、references/目录assets/ - 待自定义的TODO占位符
针对现有技能,直接进入步骤4。
Step 4: Edit the Skill
步骤4:编辑技能
Write in Imperative/Infinitive Form
使用祈使/不定式格式
Use objective, instructional language:
- ✅ "To accomplish X, do Y"
- ✅ "When Z occurs, execute A"
- ❌ "You should do X"
- ❌ "If you need to do Z"
使用客观的指令性语言:
- ✅ "要完成X,执行Y"
- ✅ "当Z发生时,执行A"
- ❌ "你应该做X"
- ❌ "如果你需要做Z"
Start with Reusable Contents
优先实现可复用内容
Implement in this order:
- Scripts () - Working code for repeatable operations
scripts/ - References () - Domain knowledge, schemas, detailed guides
references/ - Assets () - Templates, boilerplate, files used in output
assets/
Delete example files that aren't needed.
按以下顺序实现:
- 脚本 () - 用于重复操作的可运行代码
scripts/ - 参考资料 () - 领域知识、架构、详细指南
references/ - 资产 () - 模板、样板代码、输出所需文件
assets/
删除不需要的示例文件。
Update SKILL.md
更新SKILL.md
Answer these questions:
- Purpose: What is this skill for? (1-2 sentences)
- When to use: Specific triggers and exclusions
- How to use: Reference all bundled resources so Claude knows they exist
- Anti-patterns: What mistakes do novices make?
- Temporal context: What changed and when?
回答以下问题:
- 用途: 该技能的用途是什么?(1-2句话)
- 适用场景: 具体触发条件与排除场景
- 使用方式: 引用所有捆绑资源,让Claude知晓其存在
- 反模式: 新手常犯哪些错误?
- 时间上下文: 哪些内容发生了变更,何时变更?
Step 5: Validate and Package
步骤5:验证与打包
bash
undefinedbash
undefinedValidate structure and content
验证结构与内容
python scripts/validate_skill.py <path>
python scripts/validate_skill.py <path>
Check self-contained tool completeness
检查独立工具的完整性
python scripts/check_self_contained.py <path>
python scripts/check_self_contained.py <path>
Package for distribution (validates first)
打包用于分发(先执行验证)
python scripts/package_skill.py <path/to/skill-folder>
Fix all ERRORS, then WARNINGS, then SUGGESTIONS.
---python scripts/package_skill.py <path/to/skill-folder>
先修复所有ERRORS,再处理WARNINGS,最后处理SUGGESTIONS。
---Step 6: Iterate
步骤6:迭代优化
After real-world use:
- Notice struggles or inefficiencies
- Identify how SKILL.md or bundled resources should improve
- Implement changes and test again
- Update CHANGELOG.md
Recursive self-improvement: Use this skill to improve skills.
经过实际使用后:
- 发现使用痛点或低效环节
- 确定SKILL.md或捆绑资源需改进的方向
- 实施变更并再次测试
- 更新CHANGELOG.md
递归自我优化: 使用本技能改进其他技能。
Encoding Shibboleths (Expert Knowledge)
编码Shibboleths(专业知识)
What Are Shibboleths?
什么是Shibboleths?
Knowledge that separates novices from experts - things LLMs get wrong because training data includes:
- Outdated patterns
- Oversimplified tutorials
- Cargo-culted code
区分新手与专家的知识——由于训练数据包含以下内容,LLM常在此类知识上出错:
- 过时模式
- 过度简化的教程
- 盲目复制的代码
Shibboleth Template
Shibboleths模板
markdown
undefinedmarkdown
undefinedAnti-Pattern: [Name]
反模式: [名称]
Novice thinking: "[Wrong assumption]"
Reality: [Fundamental reason it's wrong, with research/data]
Timeline:
- [Date range]: [Old approach] was common
- [Date]: [Change event]
- [Current]: [New approach]
What to use instead:
| Task | Tool | Why |
|---|---|---|
| [Use case] | [Correct tool] | [Reason] |
LLM mistake: [Why LLMs suggest old pattern]
How to detect: [Validation rule]
undefined新手误区: "[错误假设]"
实际情况: [错误的根本原因,附研究/数据]
时间线:
- 当前: [新方法]
替代方案:
| 任务 | 工具 | 原因 |
|---|---|---|
| [用例] | [正确工具] | [理由] |
LLM常见错误: [LLM为何推荐旧模式]
检测方式: [验证规则]
undefinedExample Shibboleths to Encode
可编码的Shibboleths示例
-
Framework Evolution
- React: Class components → Hooks → Server Components
- Next.js: Pages Router → App Router
- State management: Redux → Zustand/Jotai/React Query
-
Model Selection
- CLIP limitations (can't count, can't do spatial reasoning)
- Embedding model specialization (text vs code vs multi-lingual)
- Model versioning (ada-002 vs text-embedding-3-large)
-
Tool Architecture
- When to use MCP vs Scripts vs Subagents
- Premature abstraction anti-pattern
- Self-contained tool benefits
-
框架演进
- React: 类组件 → Hooks → Server Components
- Next.js: Pages Router → App Router
- 状态管理: Redux → Zustand/Jotai/React Query
-
模型选择
- CLIP的局限性(无法计数、无法进行空间推理)
- 嵌入模型的专业化(文本vs代码vs多语言)
- 模型版本控制(ada-002 vs text-embedding-3-large)
-
工具架构
- 何时使用MCP vs 脚本 vs 子代理
- 过早抽象反模式
- 独立工具的优势
Self-Contained Tools
独立工具
Decision Matrix
决策矩阵
| Need | Use |
|---|---|
| External API + auth | MCP Server |
| Multi-step workflow | Subagents |
| Repeatable operation | Scripts |
| Domain validation | Scripts |
| Templates/boilerplate | Assets |
| Deep reference docs | References |
| 需求 | 适用工具 |
|---|---|
| 带认证的外部API | MCP Server |
| 多步骤工作流 | 子代理 |
| 重复操作 | 脚本 |
| 领域验证 | 脚本 |
| 模板/样板代码 | 资产 |
| 深度参考文档 | 参考资料 |
Scripts
脚本
Requirements:
- Actually work (not templates or pseudocode)
- Minimal dependencies (prefer stdlib)
- Clear interface (CLI args or stdin/stdout)
- Error handling (graceful failures)
- README (how to install and run)
Example:
python
#!/usr/bin/env python3
"""
Domain Analyzer
Usage: python analyze.py <input>
Dependencies: pip install numpy
"""
import sys
def analyze(input_path):
# Import here for helpful error
try:
import numpy as np
except ImportError:
print("Install: pip install numpy")
sys.exit(1)
# Actual implementation
result = {"score": 0.85}
return result
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <input>")
sys.exit(1)
result = analyze(sys.argv[1])
for k, v in result.items():
print(f"{k}: {v}")要求:
- 可实际运行(非模板或伪代码)
- 依赖最少(优先使用标准库)
- 清晰的接口(CLI参数或标准输入输出)
- 错误处理(优雅失败)
- README(安装与运行说明)
示例:
python
#!/usr/bin/env python3
"""
Domain Analyzer
Usage: python analyze.py <input>
Dependencies: pip install numpy
"""
import sys
def analyze(input_path):
# 延迟导入以提供友好错误提示
try:
import numpy as np
except ImportError:
print("Install: pip install numpy")
sys.exit(1)
# 实际实现
result = {"score": 0.85}
return result
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <input>")
sys.exit(1)
result = analyze(sys.argv[1])
for k, v in result.items():
print(f"{k}: {v}")MCP Servers
MCP服务器
When to build:
- External API with authentication
- Stateful connections (WebSocket, database)
- Real-time data streams
- Security boundaries (credentials, OAuth)
Structure:
mcp-server/
├── src/index.ts # Server implementation
├── package.json # Dependencies
├── tsconfig.json # Config
└── README.md # Setup instructionsMinimal MCP template: See
/references/mcp-template.md构建场景:
- 带认证的外部API
- 有状态连接(WebSocket、数据库)
- 实时数据流
- 安全边界(凭证、OAuth)
结构:
mcp-server/
├── src/index.ts # 服务器实现
├── package.json # 依赖
├── tsconfig.json # 配置
└── README.md # 安装说明极简MCP模板: 查看
/references/mcp-template.mdSubagents
子代理
When to define:
- Multi-step workflows
- Different phases need different tool access
- Orchestration logic is complex
Definition format: See
/references/subagent-template.md定义场景:
- 多步骤工作流
- 不同阶段需不同工具权限
- 编排逻辑复杂
定义格式: 查看
/references/subagent-template.mdCommon Workflows
常见工作流
Create Skill from Expertise
基于专业知识创建技能
- Define scope: What expertise? Keywords? Exclusions?
- Write description with keywords and NOT clause
- Encode anti-patterns and shibboleths
- Add decision trees (not just instructions)
- Build working tools (scripts/MCP/subagents)
- Test activation thoroughly
- 定义范围:涵盖哪些专业知识?关键词?排除场景?
- 编写包含关键词与NOT条款的描述
- 编码反模式与Shibboleths
- 添加决策树(而非仅指令)
- 构建可运行工具(脚本/MCP/子代理)
- 全面测试激活效果
Debug Activation Issues
调试激活问题
Flowchart:
Skill not activating?
├── Check description has specific keywords
│ ├── NO → Add "Activate on: keyword1, keyword2"
│ └── YES → Query contains those keywords?
│ ├── NO → Add missing variations
│ └── YES → Conflicting NOT clause?
│ ├── YES → Narrow exclusions
│ └── NO → Check file structure
│ └── Wrong location → Move to .claude/skills/
Skill activating when it shouldn't?
├── Missing NOT clause?
│ ├── YES → Add "NOT for: exclusion1, exclusion2"
│ └── NO → NOT clause too narrow
│ └── Expand based on false positivesRun:
python scripts/test_activation.py <path>流程图:
技能无法激活?
├── 检查描述是否包含特定关键词
│ ├── 否 → 添加"触发关键词: keyword1, keyword2"
│ └── 是 → 查询是否包含这些关键词?
│ ├── 否 → 添加缺失的关键词变体
│ └── 是 → 存在冲突的NOT条款?
│ ├── 是 → 缩小排除范围
│ └── 否 → 检查文件结构
│ └── 位置错误 → 移至.claude/skills/
技能被误激活?
├── 是否缺失NOT条款?
│ ├── 是 → 添加"不适用于: exclusion1, exclusion2"
│ └── 否 → NOT条款范围过窄
│ └── 根据误激活案例扩展排除范围运行命令:
python scripts/test_activation.py <path>Improve Existing Skill
优化现有技能
- Run
python scripts/validate_skill.py <path> - Run
python scripts/check_self_contained.py <path> - Address ERRORS → WARNINGS → SUGGESTIONS
- Add missing shibboleths and anti-patterns
- Ensure <500 lines in SKILL.md
- Re-validate until clean
- Update CHANGELOG.md
- 运行
python scripts/validate_skill.py <path> - 运行
python scripts/check_self_contained.py <path> - 依次解决ERRORS → WARNINGS → SUGGESTIONS
- 添加缺失的Shibboleths与反模式
- 确保SKILL.md少于500行
- 重新验证直至无问题
- 更新CHANGELOG.md
Tool Permissions
工具权限
Guidelines:
- Read-only:
Read,Grep,Glob - File modifier:
Read,Write,Edit - Build integration:
Read,Write,Bash(npm:*,git:*) - ⚠️ Never: Unrestricted for untrusted skills
Bash
Principle: Least privilege - only grant what's needed.
指南:
- 只读权限:
Read,Grep,Glob - 文件修改权限:
Read,Write,Edit - 构建集成权限:
Read,Write,Bash(npm:*,git:*) - ⚠️ 严禁: 为不可信技能授予无限制权限
Bash
原则: 最小权限原则 - 仅授予必要权限。
Decision Trees
决策树
When to Create a NEW Skill?
何时创建新技能?
✅ Create when:
- Domain expertise not in existing skills
- Pattern repeats across 3+ projects
- Anti-patterns you want to prevent
- Shibboleths to encode
❌ Don't create when:
- One-time task → Just do it directly
- Existing skill could be extended → Improve that one
- No real expertise to encode → Not worth it
✅ 创建时机:
- 现有技能未涵盖的领域专业知识
- 模式在3个以上项目中重复出现
- 需预防的反模式
- 需编码的Shibboleths
❌ 不创建时机:
- 一次性任务 → 直接完成即可
- 现有技能可扩展 → 优化现有技能
- 无实际专业知识可编码 → 无创建价值
Skill vs Subagent vs MCP vs Script?
技能 vs 子代理 vs MCP vs 脚本?
| Type | Purpose | State | Auth | Example |
|---|---|---|---|---|
| Skill | Domain expertise, decision trees | None | None | react-server-components |
| Script | Repeatable operations | None | None | validate_skill.py |
| Subagent | Multi-step workflows | Session | Inherited | research-coordinator |
| MCP | External APIs, auth | Persistent | Required | github-mcp-server |
| 类型 | 用途 | 状态 | 认证 | 示例 |
|---|---|---|---|---|
| 技能 | 领域专业知识、决策树 | 无状态 | 无需 | react-server-components |
| 脚本 | 重复操作 | 无状态 | 无需 | validate_skill.py |
| 子代理 | 多步骤工作流 | 会话状态 | 继承 | research-coordinator |
| MCP | 外部API、认证 | 持久化状态 | 必填 | github-mcp-server |
Anti-Patterns to Avoid
需避免的反模式
1. Skill as Documentation Dump
1. 技能沦为文档 dump
❌ Wrong: 50-page tutorial in SKILL.md
✅ Right: Decision trees + anti-patterns in SKILL.md, details in
/references❌ 错误: SKILL.md中包含50页教程
✅ 正确: SKILL.md中保留决策树+反模式,详细内容放在
/references2. Missing "When NOT to Use"
2. 缺失"不适用于"场景
❌ Wrong:
✅ Right:
description: "Processes images using computer vision"description: "CLIP semantic search. NOT for generation, editing, OCR, counting."❌ 错误:
✅ 正确:
description: "使用计算机视觉处理图片"description: "CLIP语义搜索。不适用于生成、编辑、OCR、计数。"3. Phantom Tools
3. 虚假工具引用
❌ Wrong: SKILL.md references that doesn't exist
✅ Right: Only reference tools that exist and work
scripts/analyze.py❌ 错误: SKILL.md引用不存在的
✅ 正确: 仅引用存在且可运行的工具
scripts/analyze.py4. Template Soup
4. 模板堆砌
❌ Wrong: Scripts with comments
✅ Right: Ship working code or don't ship at all
# TODO: implement❌ 错误: 脚本中包含注释
✅ 正确: 要么交付可运行代码,要么不包含
# TODO: implement5. No Validation Script
5. 无验证脚本
❌ Wrong: Instructions with no way to check correctness
✅ Right: Include for pre-flight checks
scripts/validate.py❌ 错误: 指令无正确性检查方式
✅ 正确: 包含用于预检查
scripts/validate.py6. Overly Permissive Tools
6. 过度宽松的工具权限
❌ Wrong:
✅ Right:
allowed-tools: Bashallowed-tools: Bash(git:*,npm:run),Read,Write❌ 错误:
✅ 正确:
allowed-tools: Bashallowed-tools: Bash(git:*,npm:run),Read,Write7. Ignoring Temporal Knowledge
7. 忽略时间维度知识
❌ Wrong: "Use useEffect for componentDidMount"
✅ Right: "Pre-React 18: useEffect=didMount. React 18+: runs TWICE in dev. Use refs for run-once."
❌ 错误: "使用useEffect替代componentDidMount"
✅ 正确: "React 18前: useEffect=didMount。React 18后: 开发环境中会运行两次。使用refs实现仅运行一次的逻辑。"
Success Metrics
成功指标
| Metric | Target | How to Measure |
|---|---|---|
| Correct activation | >90% | Test queries that should trigger |
| False positive rate | <5% | Test queries that shouldn't trigger |
| Token usage | <5k | SKILL.md size + typical reference loads |
| Time to productive | <5 min | User can start working immediately |
| Anti-pattern prevention | >80% | Users avoid documented mistakes |
| 指标 | 目标 | 测量方式 |
|---|---|---|
| 正确激活率 | >90% | 测试应触发技能的查询 |
| 误激活率 | <5% | 测试不应触发技能的查询 |
| Token用量 | <5k | SKILL.md大小 + 典型参考资料加载量 |
| 上手时间 | <5分钟 | 用户可立即开始工作 |
| 反模式预防率 | >80% | 用户避免文档中记录的错误 |
Validation Checklist
验证清单
Before packaging a skill:
□ SKILL.md exists and is <500 lines
□ Frontmatter has name, description, allowed-tools
□ Description includes specific keywords
□ Description includes NOT clause for exclusions
□ At least 1 anti-pattern documented
□ All referenced scripts/tools actually exist
□ Scripts have clear installation instructions
□ Scripts handle errors gracefully
□ If MCP needed, server is complete and tested
□ If subagents needed, prompts are defined
□ CHANGELOG.md exists with version history
□ Validation scripts pass without errors打包技能前需检查:
□ SKILL.md存在且少于500行
□ 前置元数据包含name、description、allowed-tools
□ 描述包含特定关键词
□ 描述包含排除场景的NOT条款
□ 至少记录1个反模式
□ 所有引用的脚本/工具实际存在
□ 脚本包含清晰的安装说明
□ 脚本具备优雅的错误处理
□ 如需MCP,服务器已完成并测试
□ 如需子代理,已定义提示词
□ CHANGELOG.md存在且包含版本历史
□ 验证脚本运行无错误Reference Files
参考文件
For deep dives on specific topics:
| File | Contents |
|---|---|
| Shibboleths and case studies |
| Scripts, MCP, subagent patterns |
| Complete review guide |
| Quantitative evaluation (0-10) |
| Minimal MCP server starter |
| Agent definition format |
针对特定主题的深度解析:
| 文件 | 内容 |
|---|---|
| Shibboleths与案例研究 |
| 脚本、MCP、子代理模式 |
| 完整审核指南 |
| 量化评估标准(0-10分) |
| 极简MCP服务器模板 |
| 代理定义格式 |
Real-World Case Studies
实际案例研究
Case Study 1: Photo Expert Explosion
案例1:Photo Expert技能拆分
Problem: Single skill for ALL photo operations (800+ lines)
Symptoms: Activated on "photo" anywhere, wrong advice given
Root cause: "Everything Skill" anti-pattern
Resolution: Split into 5 focused skills (CLIP, composition, color theory, collage, event detection)
Lesson: One domain ≠ one skill. Split by expertise type.
问题: 单一技能涵盖所有图片操作(800+行)
症状: 只要出现"photo"就触发技能,给出错误建议
根本原因: "全能技能"反模式
解决方案: 拆分为5个聚焦技能(CLIP、构图、色彩理论、拼图、事件检测)
经验: 一个领域≠一个技能。需按专业知识类型拆分。
Case Study 2: The Phantom MCP
案例2:虚假MCP引用
Problem: SKILL.md referenced non-existent MCP server
Symptoms: Users ran commands that didn't exist
Root cause: Reference Illusion anti-pattern
Resolution: Added to CI
Lesson: Don't promise tools you don't deliver.
check_self_contained.py问题: SKILL.md引用不存在的MCP服务器
症状: 用户运行命令时失败
根本原因: "虚假引用"反模式
解决方案: 在CI中添加检查
经验: 不要承诺无法交付的工具。
check_self_contained.pyCase Study 3: The Time Bomb
案例3:过时时间知识
Problem: Temporal knowledge became stale (React hooks advice from 2023)
Symptoms: Skill became actively harmful in 2024
Root cause: Missing temporal markers
Resolution: Added "Pre-React 18 vs React 18+" sections
Lesson: Date your knowledge. Update quarterly.
问题: 技能中的React hooks建议停留在2023年
症状: 2024年该技能给出有害建议
根本原因: 缺失时间维度标记
解决方案: 添加"React 18前 vs React 18后"章节
经验: 为知识添加时间标记。每季度更新。
This Skill Guides
本技能可指导以下工作
- ✅ Skill creation from expertise
- ✅ Skill auditing and improvement
- ✅ Anti-pattern detection and prevention
- ✅ Progressive disclosure design
- ✅ Domain expertise encoding (shibboleths)
- ✅ Self-contained tool implementation
- ✅ Activation debugging and optimization
- ✅ Validation and packaging workflows
Use this skill to create skills that make users immediately productive.
- ✅ Agent Skill创建
- ✅ 技能审核与改进
- ✅ 反模式检测与预防
- ✅ 渐进式披露设计
- ✅ 领域专业知识编码(Shibboleths)
- ✅ 独立工具实现
- ✅ 激活调试与优化
- ✅ 验证与打包工作流
使用本技能创建能让用户立即投入生产的技能。