Skill Creator
A meta-skill for creating, improving, and validating skills in the FlagOS skills repository.
Overview
This skill guides you through the full lifecycle of skill development:
- 1. Create — scaffold a new skill from template, interview the user, write SKILL.md
- Improve — analyze an existing skill, identify weaknesses, iterate with test cases
- Validate — check structure, frontmatter, references, and conventions compliance
Usage
CODEBLOCK0
Execution
Step 0: Parse arguments and determine mode
Extract from user input:
- -
{{skill_name}} — optional skill name (hyphen-case) - INLINECODE1 — one of:
create, improve, validate, eval, or interactive (default)
If no mode is specified, ask the user:
What would you like to do?
- 1. Create a new skill from scratch
- Improve an existing skill
- Validate a skill's structure and conventions
- Run test cases against a skill
-> Tell user: Confirm the mode and skill name.
Mode 1: Create a New Skill
Step 1: Capture intent
Start by understanding what the user wants to build. If the current conversation already contains a workflow the user wants to capture (e.g., "turn this into a skill"), extract answers from the conversation history first.
Key questions to clarify:
- 1. What should this skill enable the agent to do?
- When should this skill trigger? (user phrases, contexts, file types)
- What's the expected output or end state?
- Does the skill need scripts, reference docs, or asset files?
- What tools does the skill need access to?
Adapt your communication style to the user — don't assume coding jargon familiarity. Pay attention to context cues.
-> Tell user: Summarize the captured intent and confirm before proceeding.
Step 2: Initialize the skill directory
Run the init script to scaffold the skill:
CODEBLOCK1
Where:
- -
{{skill_root}} = absolute path to this skill-creator-flagos's directory - INLINECODE8 = path to the
skills/ directory (usually the parent of {{skill_root}})
The script creates the directory with SKILL.md template, LICENSE.txt, and optional subdirectories.
-> Tell user: Show the created directory structure.
Step 3: Write the SKILL.md
Based on the user interview, fill in these components:
Frontmatter (YAML)
| Field | Required | Guidelines |
|---|
| INLINECODE11 | Yes | Lowercase + hyphens, must match directory name, max 64 chars |
| INLINECODE12 |
Yes | 1-2 sentences: what it does AND when to trigger. Be specific and slightly "pushy" — err on the side of triggering too often rather than too rarely |
|
argument-hint | Recommended | Show expected arguments |
|
user-invokable | Recommended |
true if invokable via
/skill-name |
|
compatibility | Optional | Environment requirements |
|
metadata | Recommended | version, author, category, tags |
|
allowed-tools | Recommended | Space-separated tool list with patterns |
Body (Markdown)
Follow the structure documented in references/writing-guide.md. At minimum include:
- - Overview — what problem this solves, when to activate
- Prerequisites — environment requirements
- Execution steps — numbered steps with
**-> Tell user** progress markers - Examples — at least 2-3 realistic usage examples
- Troubleshooting — common problems and fixes
Read references/writing-guide.md for detailed patterns on progressive disclosure, output formats, domain organization, and writing style.
Step 4: Add supporting resources
Based on the skill's needs, create:
- -
scripts/ — executable code for deterministic/repetitive tasks references/ — detailed docs loaded into context as neededassets/ — files used in output (templates, icons, etc.)
Rules:
- - Every script/reference must be documented in SKILL.md with usage instructions
- Scripts should have execute permissions (
chmod +x) - Keep SKILL.md under 500 lines; move detailed content to INLINECODE27
- For reference files >300 lines, include a table of contents
Step 5: Validate
Run validation to check conventions compliance:
CODEBLOCK2
Fix any reported issues. See Troubleshooting section below.
-> Tell user: Report validation results. On failure, diagnose and fix.
Step 6: Write README files
Create README.md (English) and optionally README_zh.md (Chinese) following the pattern in existing skills. The README should cover:
- - Overview / problem statement
- Usage instructions
- Directory structure
- File descriptions
- Examples
- Installation instructions
-> Tell user: Skill creation complete. Present the final directory tree and summary.
Mode 2: Improve an Existing Skill
Step 1: Analyze the current skill
Read the existing SKILL.md and all supporting files. Identify:
- - Unclear or missing trigger conditions in the description
- Missing examples or edge cases
- Steps that lack progress reporting (
**-> Tell user**) - Overly long SKILL.md that should be split into references
- Missing troubleshooting entries
- Scripts without documentation
-> Tell user: Present findings and proposed improvements.
Step 2: Draft test prompts
Create 2-3 realistic test prompts — things a real user would say. Share them with the user for confirmation.
Save to evals/evals.json:
CODEBLOCK3
See references/schemas.md for the full schema.
Step 3: Iterate
For each round:
- 1. Apply improvements to SKILL.md and supporting files
- Re-run validation
- Review against test prompts (mentally or by spawning test runs)
- Collect user feedback
- Repeat until satisfied
-> Tell user: Report changes made in each iteration.
Mode 3: Validate
Run the validation script:
CODEBLOCK4
The script checks:
- - SKILL.md exists and has valid YAML frontmatter
- Required fields (
name, description) are present - INLINECODE35 matches directory name, follows naming conventions
- INLINECODE36 length within limits
- Body has sufficient content (>100 chars)
- Referenced files in
scripts/ and references/ actually exist - Scripts have execute permissions
- No hardcoded paths or credentials
-> Tell user: Report all findings with severity (error/warning).
Mode 4: Run Evals
If evals/evals.json exists, run the test prompts against the skill:
CODEBLOCK5
This generates a report showing which assertions passed/failed for each test case.
-> Tell user: Present results and suggest improvements.
Placeholders
| Placeholder | How to derive |
|---|
| INLINECODE40 | From user input, normalized to hyphen-case |
| INLINECODE41 |
Absolute path to this skill-creator-flagos's directory |
|
{{repo_root}} | Absolute path to the repository root (parent of
skills/) |
|
{{skills_dir}} | Path to the
skills/ directory containing all skills |
Examples
Example 1: Create a new skill from scratch
CODEBLOCK6
Example 2: Improve an existing skill
CODEBLOCK7
Example 3: Validate all skills
CODEBLOCK8
Example 4: Turn a conversation workflow into a skill
CODEBLOCK9
Troubleshooting
| Problem | Cause | Fix |
|---|
| INLINECODE46 | Frontmatter name differs from folder name | Ensure they are identical |
| INLINECODE48 |
Description too long | Move details to the body; keep description to 1-2 sentences |
|
SKILL.md body is too short | Insufficient instructions | Add overview, steps, examples, troubleshooting |
|
Missing required field |
name or
description absent in frontmatter | Add the missing field |
|
name must be lowercase+hyphens | Invalid characters in name | Use only
a-z,
0-9,
- |
| Skill doesn't trigger | Description too narrow or vague | Make description more specific and slightly aggressive about triggering |
| Referenced file not found | Script or reference listed in SKILL.md but not on disk | Create the file or remove the reference |
技能创建器
用于在FlagOS技能仓库中创建、改进和验证技能的元技能。
概述
本技能引导您完成技能开发的完整生命周期:
- 1. 创建 — 从模板搭建新技能框架,访谈用户,编写SKILL.md
- 改进 — 分析现有技能,识别薄弱环节,通过测试用例迭代优化
- 验证 — 检查结构、前置元数据、引用和规范合规性
使用方法
/skill-creator-flagos # 交互模式 — 询问您想做什么
/skill-creator-flagosmy-new-skill --init # 搭建新技能框架
/skill-creator-flagosmy-skill --validate # 验证现有技能
/skill-creator-flagosmy-skill --eval # 对技能运行测试提示
执行流程
步骤0:解析参数并确定模式
从用户输入中提取:
- - {{skill_name}} — 可选的技能名称(连字符格式)
- {{mode}} — 模式之一:create、improve、validate、eval 或 interactive(默认)
如果未指定模式,询问用户:
您想做什么?
- 1. 从头创建新技能
- 改进现有技能
- 验证技能的结构和规范
- 对技能运行测试用例
-> 告知用户:确认模式和技能名称。
模式1:创建新技能
步骤1:捕获意图
首先了解用户想要构建什么。如果当前对话已包含用户想要捕获的工作流程(例如将其转化为技能),请先从对话历史中提取答案。
需要澄清的关键问题:
- 1. 这个技能应该让代理能够做什么?
- 这个技能应该在什么情况下触发?(用户短语、上下文、文件类型)
- 预期的输出或最终状态是什么?
- 技能是否需要脚本、参考文档或资源文件?
- 技能需要访问哪些工具?
根据用户调整沟通风格——不要假设用户熟悉编程术语。注意上下文线索。
-> 告知用户:总结捕获的意图并在继续前确认。
步骤2:初始化技能目录
运行初始化脚本搭建技能框架:
bash
python3 {{skillroot}}/scripts/initskill.py {{skillname}} --path {{skillsdir}} [--resources scripts,references,assets]
其中:
- - {{skillroot}} = 此skill-creator-flagos目录的绝对路径
- {{skillsdir}} = skills/目录的路径(通常是{{skill_root}}的父目录)
该脚本创建包含SKILL.md模板、LICENSE.txt和可选子目录的目录。
-> 告知用户:显示创建的目录结构。
步骤3:编写SKILL.md
基于用户访谈,填写以下组件:
前置元数据(YAML)
| 字段 | 必需 | 指南 |
|---|
| name | 是 | 小写+连字符,必须与目录名匹配,最多64个字符 |
| description |
是 | 1-2句话:做什么以及何时触发。要具体且略带推动性——宁可触发过于频繁也不要过于稀少 |
| argument-hint | 推荐 | 显示预期的参数 |
| user-invokable | 推荐 | 如果可通过/skill-name调用则为true |
| compatibility | 可选 | 环境要求 |
| metadata | 推荐 | 版本、作者、类别、标签 |
| allowed-tools | 推荐 | 带模式匹配的空格分隔工具列表 |
正文(Markdown)
遵循references/writing-guide.md中记录的结构。至少包括:
- - 概述 — 解决什么问题,何时激活
- 前提条件 — 环境要求
- 执行步骤 — 带-> 告知用户进度标记的编号步骤
- 示例 — 至少2-3个真实使用示例
- 故障排除 — 常见问题及解决方法
阅读references/writing-guide.md了解渐进式披露、输出格式、领域组织和写作风格的详细模式。
步骤4:添加支持资源
根据技能需求,创建:
- - scripts/ — 用于确定性/重复性任务的可执行代码
- references/ — 根据需要加载到上下文中的详细文档
- assets/ — 输出中使用的文件(模板、图标等)
规则:
- - 每个脚本/参考文档必须在SKILL.md中记录使用说明
- 脚本应具有执行权限(chmod +x)
- 保持SKILL.md在500行以内;将详细内容移至references/
- 对于超过300行的参考文件,包含目录
步骤5:验证
运行验证以检查规范合规性:
bash
python3 {{reporoot}}/scripts/validateskills.py {{skillsdir}}/{{skillname}}
修复任何报告的问题。请参阅下面的故障排除部分。
-> 告知用户:报告验证结果。失败时,诊断并修复。
步骤6:编写README文件
按照现有技能的模式创建README.md(英文)和可选的README_zh.md(中文)。README应涵盖:
- - 概述/问题陈述
- 使用说明
- 目录结构
- 文件描述
- 示例
- 安装说明
-> 告知用户:技能创建完成。呈现最终的目录树和摘要。
模式2:改进现有技能
步骤1:分析当前技能
阅读现有的SKILL.md和所有支持文件。识别:
- - 描述中不清晰或缺失的触发条件
- 缺失的示例或边界情况
- 缺少进度报告的步骤(-> 告知用户)
- 过长应拆分为参考文档的SKILL.md
- 缺失的故障排除条目
- 没有文档的脚本
-> 告知用户:呈现发现的问题和拟议的改进。
步骤2:起草测试提示
创建2-3个真实的测试提示——真实用户可能会说的话。与用户分享以确认。
保存到evals/evals.json:
json
{
skillname: {{skillname}},
evals: [
{
id: 1,
prompt: 用户的任务提示,
expected_output: 预期结果的描述,
assertions: [输出包含X, 步骤Y已执行]
}
]
}
完整模式请参阅references/schemas.md。
步骤3:迭代
每轮:
- 1. 对SKILL.md和支持文件应用改进
- 重新运行验证
- 对照测试提示进行审查(心理上或通过启动测试运行)
- 收集用户反馈
- 重复直到满意
-> 告知用户:报告每轮迭代所做的更改。
模式3:验证
运行验证脚本:
bash
python3 {{reporoot}}/scripts/validateskills.py {{skillsdir}}/{{skillname}}
脚本检查:
- - SKILL.md存在且具有有效的YAML前置元数据
- 必需字段(name、description)存在
- name与目录名匹配,遵循命名规范
- description长度在限制范围内
- 正文有足够内容(>100个字符)
- scripts/和references/中引用的文件实际存在
- 脚本具有执行权限
- 没有硬编码的路径或凭据
-> 告知用户:报告所有发现,标明严重程度(错误/警告)。
模式4:运行评估
如果evals/evals.json存在,对技能运行测试提示:
bash
python3 {{skillroot}}/scripts/runeval.py {{skillsdir}}/{{skillname}}
这将生成一个报告,显示每个测试用例的断言通过/失败情况。
-> 告知用户:呈现结果并建议改进。
占位符
| 占位符 | 如何获取 |
|---|
| {{skillname}} | 从用户输入中提取,规范化为连字符格式 |
| {{skillroot}} |
此skill-creator-flagos目录的绝对路径 |
| {{repo_root}} | 仓库根目录的绝对路径(skills/的父目录) |
| {{skills_dir}} | 包含所有技能的skills/目录路径 |
示例
示例1:从头创建新技能
用户说:/skill-creator-flagospreflight-check --init
操作:
1. 解析 → skill_name=preflight-check, mode=create
2. 访谈用户了解preflight-check应该做什么
3. 运行init_skill.py搭建目录框架
4. 编写包含部署验证工作流程的SKILL.md
5. 添加scripts/checkgpu.sh、scripts/checkenv.py
6. 验证并修复任何问题
7. 编写README.md
结果:完整的