skill-architect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill 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:
  1. Add NOT clause → Prevent false activation
  2. Check line count → SKILL.md should be <500 lines
  3. Add 1-2 anti-patterns → Prevent common mistakes
  4. Remove dead files → Delete unreferenced scripts/references
  5. 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>

针对现有技能,按以下顺序应用优化:
  1. 添加NOT条款 → 防止误激活
  2. 检查行数 → SKILL.md应少于500行
  3. 添加1-2个反模式 → 避免常见错误
  4. 删除无用文件 → 删除未被引用的脚本/参考资料
  5. 测试激活效果 → 编写应触发/不应触发技能的查询语句
运行验证命令:
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:
  1. Activate precisely - Specific keywords + NOT clause
  2. Encode shibboleths - Expert knowledge that separates novice from expert
  3. Surface anti-patterns - "If you see X, that's wrong because Y, use Z"
  4. Capture temporal knowledge - "Pre-2024: X. 2024+: Y"
  5. Know their limits - "Use for A, B, C. NOT for D, E, F"
  6. Provide decision trees - Not templates, but "If X then A, if Y then B"
  7. Stay under 500 lines - Core in SKILL.md, deep dives in
    /references

优秀的技能具备以下7个特质:
  1. 精准激活 - 特定关键词 + NOT条款
  2. 编码Shibboleths - 区分新手与专家的专业知识
  3. 明确反模式 - "如果遇到X,那是错误的,因为Y,应使用Z"
  4. 包含时间维度知识 - "2024年前:X。2024年后:Y"
  5. 清晰边界 - "适用于A、B、C。不适用于D、E、F"
  6. 提供决策树 - 而非模板,即"如果X则执行A,如果Y则执行B"
  7. 精简篇幅 - 核心内容在SKILL.md中,深入内容放在
    /references
    目录

Progressive Disclosure Principle

渐进式披露原则

Skills use a three-level loading system:
LevelContentSizeWhen Loaded
1. Metadata
name
+
description
~100 tokensAlways in context
2. SKILL.mdCore instructions<5k tokensWhen skill triggers
3. ResourcesScripts, references, assetsUnlimitedAs Claude needs them
Critical: Keep SKILL.md under 500 lines. Move details to
/references
.

技能采用三级加载体系:
层级内容大小加载时机
1. 元数据
name
+
description
~100 tokens始终处于上下文
2. SKILL.md核心指令<5k tokens技能触发时加载
3. 资源脚本、参考资料、资产无限制Claude需要时加载
关键要求:SKILL.md需控制在500行以内。将细节内容移至
/references
目录。

Skill 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 history
Philosophy: 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

参考资料

  • /references/deep-dive.md
    - [When to consult]

---
  • /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:
KeyRequiredPurpose
name
Lowercase-hyphenated identifier
description
Activation keywords + NOT clause
allowed-tools
⚠️Comma-separated tool names
license
e.g., "MIT"
metadata
Custom key-value pairs
Invalid keys that WILL FAIL upload:
yaml
undefined
Claude技能市场仅允许以下键:
键名必填用途
name
小写连字符格式的标识符
description
激活关键词 + NOT条款
allowed-tools
⚠️逗号分隔的工具名称
license
例如:"MIT"
metadata
自定义键值对
会导致上传失败的无效键:
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:
  1. How to execute from scratch
  2. What scripts/references/assets would help with repeated execution
Example analyses:
SkillExampleNeeds
pdf-editor"Rotate this PDF"
scripts/rotate_pdf.py
frontend-builder"Build a todo app"
assets/hello-world/
template
big-query"How many users logged in?"
references/schema.md
photo-expert"Improve composition"
scripts/analyze_composition.py
Shibboleths to encode:
  • Domain-specific algorithms
  • Common pitfalls and anti-patterns
  • Temporal knowledge (what changed when)
  • Framework evolution patterns

针对每个示例,分析:
  1. 如何从零开始执行
  2. 哪些脚本/参考资料/资产有助于重复执行
示例分析:
技能示例所需资源
pdf-editor"旋转此PDF"
scripts/rotate_pdf.py
frontend-builder"构建待办事项应用"
assets/hello-world/
模板
big-query"有多少用户登录了?"
references/schema.md
photo-expert"优化构图"
scripts/analyze_composition.py
需编码的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/
    ,
    assets/
    directories
  • 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:
  1. Scripts (
    scripts/
    ) - Working code for repeatable operations
  2. References (
    references/
    ) - Domain knowledge, schemas, detailed guides
  3. Assets (
    assets/
    ) - Templates, boilerplate, files used in output
Delete example files that aren't needed.
按以下顺序实现:
  1. 脚本 (
    scripts/
    ) - 用于重复操作的可运行代码
  2. 参考资料 (
    references/
    ) - 领域知识、架构、详细指南
  3. 资产 (
    assets/
    ) - 模板、样板代码、输出所需文件
删除不需要的示例文件

Update SKILL.md

更新SKILL.md

Answer these questions:
  1. Purpose: What is this skill for? (1-2 sentences)
  2. When to use: Specific triggers and exclusions
  3. How to use: Reference all bundled resources so Claude knows they exist
  4. Anti-patterns: What mistakes do novices make?
  5. Temporal context: What changed and when?

回答以下问题:
  1. 用途: 该技能的用途是什么?(1-2句话)
  2. 适用场景: 具体触发条件与排除场景
  3. 使用方式: 引用所有捆绑资源,让Claude知晓其存在
  4. 反模式: 新手常犯哪些错误?
  5. 时间上下文: 哪些内容发生了变更,何时变更?

Step 5: Validate and Package

步骤5:验证与打包

bash
undefined
bash
undefined

Validate 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:
  1. Notice struggles or inefficiencies
  2. Identify how SKILL.md or bundled resources should improve
  3. Implement changes and test again
  4. Update CHANGELOG.md
Recursive self-improvement: Use this skill to improve skills.

经过实际使用后:
  1. 发现使用痛点或低效环节
  2. 确定SKILL.md或捆绑资源需改进的方向
  3. 实施变更并再次测试
  4. 更新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
undefined
markdown
undefined

Anti-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:
TaskToolWhy
[Use case][Correct tool][Reason]
LLM mistake: [Why LLMs suggest old pattern] How to detect: [Validation rule]
undefined
新手误区: "[错误假设]"
实际情况: [错误的根本原因,附研究/数据]
时间线:
  • 当前: [新方法]
替代方案:
任务工具原因
[用例][正确工具][理由]
LLM常见错误: [LLM为何推荐旧模式] 检测方式: [验证规则]
undefined

Example Shibboleths to Encode

可编码的Shibboleths示例

  1. Framework Evolution
    • React: Class components → Hooks → Server Components
    • Next.js: Pages Router → App Router
    • State management: Redux → Zustand/Jotai/React Query
  2. 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)
  3. Tool Architecture
    • When to use MCP vs Scripts vs Subagents
    • Premature abstraction anti-pattern
    • Self-contained tool benefits

  1. 框架演进
    • React: 类组件 → Hooks → Server Components
    • Next.js: Pages Router → App Router
    • 状态管理: Redux → Zustand/Jotai/React Query
  2. 模型选择
    • CLIP的局限性(无法计数、无法进行空间推理)
    • 嵌入模型的专业化(文本vs代码vs多语言)
    • 模型版本控制(ada-002 vs text-embedding-3-large)
  3. 工具架构
    • 何时使用MCP vs 脚本 vs 子代理
    • 过早抽象反模式
    • 独立工具的优势

Self-Contained Tools

独立工具

Decision Matrix

决策矩阵

NeedUse
External API + authMCP Server
Multi-step workflowSubagents
Repeatable operationScripts
Domain validationScripts
Templates/boilerplateAssets
Deep reference docsReferences
需求适用工具
带认证的外部APIMCP Server
多步骤工作流子代理
重复操作脚本
领域验证脚本
模板/样板代码资产
深度参考文档参考资料

Scripts

脚本

Requirements:
  1. Actually work (not templates or pseudocode)
  2. Minimal dependencies (prefer stdlib)
  3. Clear interface (CLI args or stdin/stdout)
  4. Error handling (graceful failures)
  5. 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}")
要求:
  1. 可实际运行(非模板或伪代码)
  2. 依赖最少(优先使用标准库)
  3. 清晰的接口(CLI参数或标准输入输出)
  4. 错误处理(优雅失败)
  5. 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 instructions
Minimal 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.md

Subagents

子代理

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.md

Common Workflows

常见工作流

Create Skill from Expertise

基于专业知识创建技能

  1. Define scope: What expertise? Keywords? Exclusions?
  2. Write description with keywords and NOT clause
  3. Encode anti-patterns and shibboleths
  4. Add decision trees (not just instructions)
  5. Build working tools (scripts/MCP/subagents)
  6. Test activation thoroughly
  1. 定义范围:涵盖哪些专业知识?关键词?排除场景?
  2. 编写包含关键词与NOT条款的描述
  3. 编码反模式与Shibboleths
  4. 添加决策树(而非仅指令)
  5. 构建可运行工具(脚本/MCP/子代理)
  6. 全面测试激活效果

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 positives
Run:
python scripts/test_activation.py <path>
流程图:
技能无法激活?
├── 检查描述是否包含特定关键词
│   ├── 否 → 添加"触发关键词: keyword1, keyword2"
│   └── 是 → 查询是否包含这些关键词?
│       ├── 否 → 添加缺失的关键词变体
│       └── 是 → 存在冲突的NOT条款?
│           ├── 是 → 缩小排除范围
│           └── 否 → 检查文件结构
│               └── 位置错误 → 移至.claude/skills/

技能被误激活?
├── 是否缺失NOT条款?
│   ├── 是 → 添加"不适用于: exclusion1, exclusion2"
│   └── 否 → NOT条款范围过窄
│       └── 根据误激活案例扩展排除范围
运行命令:
python scripts/test_activation.py <path>

Improve Existing Skill

优化现有技能

  1. Run
    python scripts/validate_skill.py <path>
  2. Run
    python scripts/check_self_contained.py <path>
  3. Address ERRORS → WARNINGS → SUGGESTIONS
  4. Add missing shibboleths and anti-patterns
  5. Ensure <500 lines in SKILL.md
  6. Re-validate until clean
  7. Update CHANGELOG.md

  1. 运行
    python scripts/validate_skill.py <path>
  2. 运行
    python scripts/check_self_contained.py <path>
  3. 依次解决ERRORS → WARNINGS → SUGGESTIONS
  4. 添加缺失的Shibboleths与反模式
  5. 确保SKILL.md少于500行
  6. 重新验证直至无问题
  7. 更新CHANGELOG.md

Tool Permissions

工具权限

Guidelines:
  • Read-only:
    Read,Grep,Glob
  • File modifier:
    Read,Write,Edit
  • Build integration:
    Read,Write,Bash(npm:*,git:*)
  • ⚠️ Never: Unrestricted
    Bash
    for untrusted skills
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 脚本?

TypePurposeStateAuthExample
SkillDomain expertise, decision treesNoneNonereact-server-components
ScriptRepeatable operationsNoneNonevalidate_skill.py
SubagentMulti-step workflowsSessionInheritedresearch-coordinator
MCPExternal APIs, authPersistentRequiredgithub-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中保留决策树+反模式,详细内容放在
/references

2. Missing "When NOT to Use"

2. 缺失"不适用于"场景

Wrong:
description: "Processes images using computer vision"
Right:
description: "CLIP semantic search. NOT for generation, editing, OCR, counting."
错误:
description: "使用计算机视觉处理图片"
正确:
description: "CLIP语义搜索。不适用于生成、编辑、OCR、计数。"

3. Phantom Tools

3. 虚假工具引用

Wrong: SKILL.md references
scripts/analyze.py
that doesn't exist ✅ Right: Only reference tools that exist and work
错误: SKILL.md引用不存在的
scripts/analyze.py
正确: 仅引用存在且可运行的工具

4. Template Soup

4. 模板堆砌

Wrong: Scripts with
# TODO: implement
comments ✅ Right: Ship working code or don't ship at all
错误: 脚本中包含
# TODO: implement
注释 ✅ 正确: 要么交付可运行代码,要么不包含

5. No Validation Script

5. 无验证脚本

Wrong: Instructions with no way to check correctness ✅ Right: Include
scripts/validate.py
for pre-flight checks
错误: 指令无正确性检查方式 ✅ 正确: 包含
scripts/validate.py
用于预检查

6. Overly Permissive Tools

6. 过度宽松的工具权限

Wrong:
allowed-tools: Bash
Right:
allowed-tools: Bash(git:*,npm:run),Read,Write
错误:
allowed-tools: Bash
正确:
allowed-tools: Bash(git:*,npm:run),Read,Write

7. 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

成功指标

MetricTargetHow to Measure
Correct activation>90%Test queries that should trigger
False positive rate<5%Test queries that shouldn't trigger
Token usage<5kSKILL.md size + typical reference loads
Time to productive<5 minUser can start working immediately
Anti-pattern prevention>80%Users avoid documented mistakes

指标目标测量方式
正确激活率>90%测试应触发技能的查询
误激活率<5%测试不应触发技能的查询
Token用量<5kSKILL.md大小 + 典型参考资料加载量
上手时间<5分钟用户可立即开始工作
反模式预防率>80%用户避免文档中记录的错误

Validation Checklist

验证清单

Before packaging a skill:
□ SKILL.md exists and is &lt;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:
FileContents
references/antipatterns.md
Shibboleths and case studies
references/self-contained-tools.md
Scripts, MCP, subagent patterns
references/validation-checklist.md
Complete review guide
references/scoring-rubric.md
Quantitative evaluation (0-10)
references/mcp-template.md
Minimal MCP server starter
references/subagent-template.md
Agent definition format

针对特定主题的深度解析:
文件内容
references/antipatterns.md
Shibboleths与案例研究
references/self-contained-tools.md
脚本、MCP、子代理模式
references/validation-checklist.md
完整审核指南
references/scoring-rubric.md
量化评估标准(0-10分)
references/mcp-template.md
极简MCP服务器模板
references/subagent-template.md
代理定义格式

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
check_self_contained.py
to CI Lesson: Don't promise tools you don't deliver.
问题: SKILL.md引用不存在的MCP服务器 症状: 用户运行命令时失败 根本原因: "虚假引用"反模式 解决方案: 在CI中添加
check_self_contained.py
检查 经验: 不要承诺无法交付的工具。

Case 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)
  • ✅ 独立工具实现
  • ✅ 激活调试与优化
  • ✅ 验证与打包工作流
使用本技能创建能让用户立即投入生产的技能。