example-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseExample Skill
示例技能
Purpose: This skill exists to demonstrate the Skills-as-Containers pattern introduced in PAI v1.2.0. Use it as a template for creating your own skills.
用途: 本技能用于展示PAI v1.2.0中引入的Skills-as-Containers模式。你可以将其作为创建自有技能的模板。
Architecture Overview
架构概述
Skills in PAI v1.2.0 are organized as self-contained containers with:
PAI v1.2.0中的技能以独立容器的形式组织,包含以下部分:
Core Components
核心组件
- SKILL.md - Core skill definition with routing logic (you're reading it now!)
- workflows/ - Specific task workflows for discrete operations
- assets/ - Templates, references, and helper files
- SKILL.md - 包含路由逻辑的核心技能定义(你现在正在阅读的就是这个文件!)
- workflows/ - 用于独立操作的特定任务工作流
- assets/ - 模板、参考资料和辅助文件
Progressive Disclosure
渐进式加载机制
- Metadata (always loaded) - Name, description, triggers
- Instructions (loaded when triggered) - This SKILL.md content
- Resources (loaded as needed) - Individual workflow and asset files
- 元数据(始终加载)- 名称、描述、触发词
- 说明文档(触发时加载)- 本SKILL.md的内容
- 资源文件(按需加载)- 单个工作流和资源文件
Included Workflows
包含的工作流
This skill includes three example workflows demonstrating different complexity levels:
本技能包含三个示例工作流,展示了不同的复杂程度:
1. simple-task.md
1. simple-task.md
Purpose: Basic single-step workflow
Trigger: User says "simple example", "basic task"
Demonstrates: Minimal workflow structure
用途: 基础单步骤工作流
触发词: 用户说出“简单示例”、“基础任务”
展示内容: 极简工作流结构
2. complex-task.md
2. complex-task.md
Purpose: Multi-step workflow with dependencies
Trigger: User says "complex example", "multi-step task"
Demonstrates: Structured workflow with validation
用途: 带依赖关系的多步骤工作流
触发词: 用户说出“复杂示例”、“多步骤任务”
展示内容: 带验证机制的结构化工作流
3. parallel-task.md
3. parallel-task.md
Purpose: Agent orchestration for parallel execution
Trigger: User says "parallel example", "parallel task"
Demonstrates: Multi-agent coordination pattern
用途: 用于并行执行的Agent编排
触发词: 用户说出“并行示例”、“并行任务”
展示内容: 多Agent协作模式
Routing Logic
路由逻辑
Natural language automatically routes to the right workflow:
User Intent → Skill Activation → Workflow Selection → Execution
Example Flow:
"Show me a simple example"
↓ (matches trigger)
example-skill loads
↓ (analyzes intent: "simple")
simple-task.md selected
↓
Workflow executes自然语言会自动路由到对应的工作流:
用户意图 → 技能激活 → 工作流选择 → 执行
示例流程:
"给我看一个简单示例"
↓(匹配触发词)
example-skill 加载
↓(分析意图:“简单”)
选择simple-task.md
↓
工作流执行Assets
资源文件
This skill includes example assets in the directory:
assets/- - Example template file
template.md - - Example reference material
reference.md
These demonstrate how to organize supporting resources.
本技能在目录中包含示例资源文件:
assets/- - 示例模板文件
template.md - - 示例参考资料
reference.md
这些文件展示了如何组织辅助资源。
Usage Examples
使用示例
Basic Usage
基础用法
User: "Show me a simple example"
→ Loads example-skill
→ Executes simple-task.md workflow
→ Returns basic workflow demonstration用户:“给我看一个简单示例”
→ 加载example-skill
→ 执行simple-task.md工作流
→ 返回基础工作流演示Complex Usage
复杂用法
User: "I need a complex multi-step example"
→ Loads example-skill
→ Executes complex-task.md workflow
→ Returns structured multi-step demonstration用户:“我需要一个复杂的多步骤示例”
→ 加载example-skill
→ 执行complex-task.md工作流
→ 返回结构化多步骤演示Parallel Usage
并行用法
User: "How do I parallelize work?"
→ Loads example-skill
→ Executes parallel-task.md workflow
→ Returns agent orchestration demonstration用户:“我如何并行处理工作?”
→ 加载example-skill
→ 执行parallel-task.md工作流
→ 返回Agent编排演示Creating Your Own Skill
创建自有技能
Use this skill as a template:
-
Copy the structure:bash
cp -r ~/.claude/skills/example-skill ~/.claude/skills/your-skill-name -
Update SKILL.md:
- Change name and description in frontmatter
- Update trigger phrases
- Replace example content with your skill's purpose
-
Create workflows:
- Add workflow files in workflows/ directory
- Each workflow = one specific task
- Name workflows descriptively
-
Add assets (optional):
- Templates, references, helper scripts
- Keep organized in assets/ directory
-
Test activation:
- Test trigger phrases
- Verify workflow routing
- Ensure natural language works
将本技能作为模板使用:
-
复制结构:bash
cp -r ~/.claude/skills/example-skill ~/.claude/skills/your-skill-name -
更新SKILL.md:
- 修改YAML前置元数据中的名称和描述
- 更新触发词
- 用自有技能的用途替换示例内容
-
创建工作流:
- 在workflows/目录中添加工作流文件
- 每个工作流对应一个特定任务
- 给工作流起描述性的名称
-
添加资源文件(可选):
- 模板、参考资料、辅助脚本
- 统一组织在assets/目录中
-
测试激活:
- 测试触发词
- 验证工作流路由
- 确保自然语言功能正常
Best Practices
最佳实践
Skill Organization
技能组织
- ✅ One skill per domain/topic area
- ✅ Multiple workflows within a skill
- ✅ Clear trigger phrases
- ❌ Don't create skills for one-off tasks
- ❌ Don't duplicate knowledge across skills
- ✅ 每个技能对应一个领域/主题
- ✅ 一个技能内包含多个工作流
- ✅ 使用清晰的触发词
- ❌ 不要为一次性任务创建技能
- ❌ 不要在多个技能间重复知识
Workflow Design
工作流设计
- ✅ Self-contained with clear steps
- ✅ Focused on ONE specific task
- ✅ Include trigger phrases
- ❌ Don't make workflows too granular
- ❌ Don't duplicate skill context
- ✅ 独立封装且步骤清晰
- ✅ 专注于单个特定任务
- ✅ 包含触发词
- ❌ 不要让工作流过于细碎
- ❌ 不要重复技能上下文
Natural Language Routing
自然语言路由
- ✅ Use descriptive trigger phrases
- ✅ Test with variations
- ✅ Think like a user
- ❌ Don't require exact phrase matching
- ❌ Don't make users memorize commands
- ✅ 使用描述性的触发词
- ✅ 测试不同的表述方式
- ✅ 站在用户的角度思考
- ❌ 不要要求完全匹配短语
- ❌ 不要让用户记住命令
Technical Details
技术细节
File Structure
文件结构
example-skill/
├── SKILL.md # This file (core definition)
├── workflows/ # Specific task workflows
│ ├── simple-task.md
│ ├── complex-task.md
│ └── parallel-task.md
├── assets/ # Supporting resources
│ ├── template.md
│ └── reference.md
└── README.md # Overview documentationexample-skill/
├── SKILL.md # 本文件(核心定义)
├── workflows/ # 特定任务工作流
│ ├── simple-task.md
│ ├── complex-task.md
│ └── parallel-task.md
├── assets/ # 辅助资源
│ ├── template.md
│ └── reference.md
└── README.md # 概述文档Loading Behavior
加载行为
- Skill metadata always loaded (YAML frontmatter)
- SKILL.md body loaded when skill activates
- Individual workflows loaded when selected
- Assets loaded when referenced
- 技能元数据始终加载(YAML前置元数据)
- 技能激活时加载SKILL.md主体内容
- 选择工作流时加载对应的单个工作流
- 引用资源文件时加载对应文件
Integration Points
集成点
- Natural Language: Trigger phrases activate skill
- Other Skills: Can reference this skill's workflows
- Agents: Can invoke specific workflows
- Commands: Can route to this skill's workflows
- 自然语言: 触发词激活技能
- 其他技能: 可以引用本技能的工作流
- Agents: 可以调用特定工作流
- 命令: 可以路由到本技能的工作流
Documentation
文档
- Architecture: See
~/Projects/PAI/docs/ARCHITECTURE.md - Migration Guide: See
~/Projects/PAI/docs/MIGRATION.md - Skill Development: See
~/.claude/skills/create-skill/
- 架构: 查看
~/Projects/PAI/docs/ARCHITECTURE.md - 迁移指南: 查看
~/Projects/PAI/docs/MIGRATION.md - 技能开发: 查看
~/.claude/skills/create-skill/
References
参考资料
- Anthropic Skills: https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview
- PAI Repository: https://github.com/danielmiessler/Personal_AI_Infrastructure
- v1.2.0 Changes: Skills-as-Containers migration completed 2025-10-31
This is a template skill - customize it for your needs!
- Anthropic Skills: https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview
- PAI仓库: https://github.com/danielmiessler/Personal_AI_Infrastructure
- v1.2.0变更: Skills-as-Containers迁移于2025-10-31完成
这是一个模板技能 - 根据你的需求进行自定义!