Create Skill
Guide the user through creating a new skill from scratch.
Core Philosophy
A skill should define behavior, not just store documentation.
- - A good skill tells the agent when to use it
- A good skill tells the agent what tools to use
- A good skill defines the workflow (in what order)
- A good skill specifies the expected output
- A good skill knows its constraints
Static documentation has little value - the agent can fetch that itself. The skill's value is in encoding the behavior pattern.
Interaction Rules
Input Style
- - Always present choices as numbered options (1, 2, 3...).
- Never ask the user to type full words like "quick" or "full".
- Accept the number, the option text, or common abbreviations.
Question Rhythm
- - Ask ONE question at a time.
- Wait for the user's answer before asking the next question.
- Never dump multiple questions in a single message.
Communication Style
- - Never add self-explanatory filler text.
- Never explain what you are going to do before doing it.
- Keep all prompts as concise as possible.
- Use the same terse style as a real CLI tool.
Workflow
Follow these steps in order:
- 1. Prompt for mode selection (1 or 2).
- Prompt for skill purpose (the task it solves).
- Prompt for trigger conditions (when to use).
- Prompt for required tools.
- Prompt for workflow steps.
- Prompt for expected output.
- Prompt for constraints.
- Prompt for install location.
- Prompt for skill name.
- (Optional) Fetch and analyze documentation.
- Show summary.
- Show preview.
- Prompt for confirmation.
- Write files.
- Show completion with next steps.
Step 1: Mode Selection
Output exactly:
CODEBLOCK0
- - Default to 1 (Quick) if user just presses Enter.
- If user enters invalid option, re-prompt.
Step 2: Skill Purpose
Ask:
CODEBLOCK1
Accept any natural language answer. Extract the core task.
Examples:
- - "Deploy a static blog to GitHub Pages"
- "Convert images to different formats"
- "Query and analyze database schemas"
Step 3: Trigger Conditions
After purpose, ask:
CODEBLOCK2
If user chooses 2 or 3, ask for the specific trigger details.
Step 4: Required Tools
After trigger, ask:
CODEBLOCK3
If user chooses 2 or 3, ask:
- - "Which CLI commands? (comma separated)"
- "Which APIs? (describe the service)"
Step 5: Workflow
After tools, ask:
CODEBLOCK4
If user chooses 1, ask them to describe each step.
If user chooses 2, proceed to Step 10 (fetch documentation).
If user chooses 3, present common patterns:
- - "init → configure → run"
- "check prerequisites → setup → execute → verify"
- "collect input → process → output"
Step 6: Expected Output
After workflow, ask:
CODEBLOCK5
Ask for specific output format details.
Step 7: Constraints
After output, ask:
CODEBLOCK6
If user chooses 2-5, gather the constraint details.
Step 8: Install Location
After constraints, ask:
CODEBLOCK7
Step 9: Skill Name
After install location, ask:
CODEBLOCK8
- - Propose a name based on the skill purpose if user is unsure.
- Validate format (lowercase, digits, hyphens only).
Step 10: Fetch and Analyze Documentation (Optional)
If user chose to generate workflow from documentation in Step 5:
CODEBLOCK9
After getting the source:
- - Fetch the documentation
- Analyze and extract:
- Installation commands
- CLI usage and options
- Configuration parameters
- Common workflows
- Best practices
- Limitations
- - Generate behavior from the analysis:
- When to trigger
- What tools to use
- Step-by-step workflow
- Expected output format
- Constraints
Do NOT just copy the documentation. Transform it into behavioral instructions.
Step 11: Summary
After all inputs are collected, show:
CODEBLOCK10
Step 12: Preview
Generate the SKILL.md and show key sections:
- - Trigger conditions
- Tools required
- Workflow steps
- Output format
Step 13: Confirmation
Ask:
CODEBLOCK11
Step 14: Write Files
If confirmed:
- - Create the skill directory.
- Write SKILL.md with full behavioral instructions.
- Write README.md.
- If directory exists, stop and ask.
Step 15: Completion
Show:
CODEBLOCK12
Full Guidance Mode
Full mode adds more detail at each step:
After purpose:
- - "Target users? (optional)"
- "What problem does it solve? (detailed)"
After trigger:
- - "Exact trigger phrases?"
- "Any negative triggers (when NOT to use)?"
After tools:
- - "Specific command versions?"
- "Any setup required?"
After workflow:
- - "Error handling?"
- "Rollback steps?"
After output:
- - "Output format examples?"
- "Where to save files?"
After constraints:
- - "Known issues?"
- "Alternative approaches?"
Writing Rules
SKILL.md Structure
A good SKILL.md should have:
CODEBLOCK13
Key Principles
- - Write behavior, not documentation
- Be specific about tool usage
- Define clear workflow steps
- Specify exact output format
- Include constraints and boundaries
Generated Skill Quality
The generated skill should be self-contained:
- - Agent should know when to use it without asking
- Agent should know what tools to call
- Agent should know the exact workflow
- Agent should know the expected output
If the agent still needs to search the web or figure out the workflow, the skill is not complete.
Language
- - Use English by default.
- If user clearly uses another language, switch to that language.
创建技能
引导用户从零开始创建一个新技能。
核心理念
技能应定义行为,而不仅仅是存储文档。
- - 好的技能告诉智能体何时使用它
- 好的技能告诉智能体使用什么工具
- 好的技能定义工作流程(按什么顺序)
- 好的技能指定预期输出
- 好的技能了解其约束条件
静态文档价值不大——智能体可以自行获取。技能的价值在于编码行为模式。
交互规则
输入风格
- - 始终以编号选项(1, 2, 3...)呈现选择。
- 切勿要求用户输入完整单词,如quick或full。
- 接受数字、选项文本或常见缩写。
提问节奏
- - 一次只问一个问题。
- 等待用户回答后再问下一个问题。
- 切勿在一条消息中抛出多个问题。
沟通风格
- - 不要添加不言自明的填充文本。
- 不要在做某事之前解释你要做什么。
- 所有提示尽可能简洁。
- 使用与真实CLI工具相同的简洁风格。
工作流程
按顺序执行以下步骤:
- 1. 提示选择模式(1或2)。
- 提示技能目的(它解决的任务)。
- 提示触发条件(何时使用)。
- 提示所需工具。
- 提示工作流程步骤。
- 提示预期输出。
- 提示约束条件。
- 提示安装位置。
- 提示技能名称。
- (可选)获取并分析文档。
- 显示摘要。
- 显示预览。
- 提示确认。
- 写入文件。
- 显示完成及后续步骤。
步骤1:模式选择
精确输出:
创建一个新技能。
1) 快速引导
2) 完整引导
选择 [1]:
- - 如果用户直接按回车,默认为1(快速)。
- 如果用户输入无效选项,重新提示。
步骤2:技能目的
询问:
这个技能解决什么任务?
接受任何自然语言回答。提取核心任务。
示例:
- - 将静态博客部署到GitHub Pages
- 将图像转换为不同格式
- 查询和分析数据库模式
步骤3:触发条件
在目的之后,询问:
智能体何时应该使用这个技能?
1) 用户明确要求
2) 当用户提到特定关键词时
3) 当满足某些条件时
4) 不确定/稍后定义
选择 [1]:
如果用户选择2或3,询问具体的触发细节。
步骤4:所需工具
在触发条件之后,询问:
这个技能需要什么工具?
1) 仅内置工具
2) 外部CLI命令
3) API调用
4) 以上组合
选择 [1]:
如果用户选择2或3,询问:
- - 哪些CLI命令?(逗号分隔)
- 哪些API?(描述服务)
步骤5:工作流程
在工具之后,询问:
工作流程是什么?(按顺序描述)
1) 我逐步描述
2) 从文档生成
3) 使用常见模式
选择 [1]:
如果用户选择1,要求他们描述每个步骤。
如果用户选择2,进入步骤10(获取文档)。
如果用户选择3,呈现常见模式:
- - 初始化 → 配置 → 运行
- 检查先决条件 → 设置 → 执行 → 验证
- 收集输入 → 处理 → 输出
步骤6:预期输出
在工作流程之后,询问:
这个技能应该产生什么?
1) 文件(配置、代码等)
2) 命令输出
3) API响应
4) 组合
选择 [1]:
询问具体的输出格式细节。
步骤7:约束条件
在输出之后,询问:
有什么约束条件吗?
1) 无约束
2) 操作系统限制
3) 所需环境变量
4) 配置要求
5) 我来指定
选择 [1]:
如果用户选择2-5,收集约束细节。
步骤8:安装位置
在约束条件之后,询问:
安装在哪里?
1) 当前工作区
2) 共享(所有项目)
选择 [1]:
步骤9:技能名称
在安装位置之后,询问:
技能名称(小写,连字符分隔):
- - 如果用户不确定,根据技能目的建议一个名称。
- 验证格式(仅限小写、数字、连字符)。
步骤10:获取并分析文档(可选)
如果用户在步骤5中选择从文档生成工作流程:
文档在哪里?
1) 输入URL
2) GitHub仓库
3) 本地路径
获取来源后:
- 安装命令
- CLI用法和选项
- 配置参数
- 常见工作流程
- 最佳实践
- 限制
- 何时触发
- 使用什么工具
- 逐步工作流程
- 预期输出格式
- 约束条件
不要仅仅复制文档。将其转化为行为指令。
步骤11:摘要
收集所有输入后,显示:
技能:<名称>
任务:<目的>
触发条件:<触发条件>
工具:<工具列表>
工作流程:
1. <步骤1>
2. <步骤2>
...
输出:<预期输出>
约束条件:<约束条件>
位置:<工作区|共享>
继续?[y/n]:
步骤12:预览
生成SKILL.md并显示关键部分:
步骤13:确认
询问:
写入文件?[y/n]:
步骤14:写入文件
如果确认:
- - 创建技能目录。
- 写入包含完整行为指令的SKILL.md。
- 写入README.md。
- 如果目录已存在,停止并询问。
步骤15:完成
显示:
已创建:<路径>
激活方式:
- - 重启智能体,或
- 运行:refresh skills
测试方式:
完成。
完整引导模式
完整模式在每个步骤添加更多细节:
在目的之后:
在触发条件之后:
- - 确切的触发短语?
- 任何负面触发条件(何时不使用)?
在工具之后:
在工作流程之后:
在输出之后:
在约束条件之后:
编写规则
SKILL.md结构
好的SKILL.md应包含:
markdown
name: <技能名称>
description: <简要描述>
<技能名称>
何时使用
所需工具
工作流程
- 1. 步骤一 - 做什么
- 步骤二 - 做什么
- ...
输出
约束条件
示例
使用场景示例
关键原则
- - 编写行为,而非文档
- 具体说明工具用法
- 定义清晰的工作流程步骤
- 指定确切的输出格式
- 包含约束和边界
生成技能质量
生成的技能应是自包含的:
- - 智能体应无需询问就知道何时使用
- 智能体应知道调用什么工具
- 智能体应知道确切的工作流程
- 智能体应知道预期的输出
如果智能体仍需要搜索网络或弄清楚工作流程,则技能不完整。
语言
- - 默认使用英语。
- 如果用户明确使用其他语言,切换到该语言。