Skill Refiner
Finds every skill in the workspace, audits each against skill-creator requirements, and fixes non-compliant ones.
Workflow
Step 1 — Discover all skills
CODEBLOCK0
This searches the entire workspace for SKILL.md files (not just skills/). Skills created without following skill-creator conventions may end up anywhere.
Step 2 — Audit each skill
CODEBLOCK1
Returns JSON with:
- -
issues — blocking problems that must be fixed - INLINECODE3 — advisory improvements
- INLINECODE4 — true only when issues is empty
Run this on every path returned by Step 1. Batch example:
CODEBLOCK2
Step 3 — Report findings
Summarize results in a table:
| Skill | Location | Issues | Warnings | Status |
|---|
| my-skill | skills/my-skill | 0 | 1 | ⚠️ |
| bad-skill |
temp/bad-skill | 2 | 0 | ❌ |
Step 4 — Fix non-compliant skills
For each skill with issues, fix in this order:
- 1. Missing/malformed frontmatter — Add or correct the
--- block with name and description only - Extra frontmatter fields — Remove any fields other than
name and INLINECODE9 - Weak description — Rewrite to include: what the skill does + trigger conditions ("Use when...")
- Extraneous files — Delete README.md, INSTALLATION_GUIDE.md, CHANGELOG.md, etc.
- Wrong location — If a skill is outside
skills/, move it to INLINECODE11 - Naming violations — Rename directory to lowercase-hyphen-case
For warnings (advisory):
- - Long SKILL.md (>500 lines): extract detailed content into
references/ files and link from SKILL.md - Unlinked references: add links in SKILL.md body
- Weak description: improve trigger language
Step 5 — Validate fixes
Re-run audit_skill.py on each fixed skill to confirm "compliant": true.
Optionally package with:
CODEBLOCK3
Compliance Checklist
A compliant skill must have:
- - [ ]
SKILL.md at the root of a named directory - [ ] YAML frontmatter with exactly
name and description (no other fields) - [ ]
description includes what the skill does AND when to trigger it - [ ] Directory name: lowercase letters, digits, hyphens only; ≤64 chars
- [ ] No extraneous files (README.md, CHANGELOG.md, etc.)
- [ ] Resources only in
scripts/, references/, or INLINECODE21 - [ ] All
references/ files linked from SKILL.md body - [ ] SKILL.md body ≤500 lines (split into references/ if longer)
技能精炼器
在工作区中查找每个技能,对照技能创建者要求进行审核,并修复不合规的技能。
工作流程
步骤 1 — 发现所有技能
bash
bash scripts/findskills.sh [workspacedir]
这会搜索整个工作区中的 SKILL.md 文件(不仅仅是 skills/ 目录)。未遵循技能创建者规范创建的技能可能出现在任何位置。
步骤 2 — 审核每个技能
bash
python3 scripts/audit_skill.py
返回 JSON 格式结果,包含:
- - issues — 必须修复的阻塞性问题
- warnings — 建议性改进
- compliant — 仅当 issues 为空时为 true
对步骤 1 返回的每个路径运行此命令。批量示例:
bash
bash scripts/find_skills.sh | while read dir; do
python3 scripts/audit_skill.py $dir
done
步骤 3 — 报告发现
以表格形式汇总结果:
| 技能 | 位置 | 问题 | 警告 | 状态 |
|---|
| my-skill | skills/my-skill | 0 | 1 | ⚠️ |
| bad-skill |
temp/bad-skill | 2 | 0 | ❌ |
步骤 4 — 修复不合规的技能
对于每个存在问题的技能,按以下顺序修复:
- 1. 缺少/格式错误的前置元数据 — 添加或修正仅包含 name 和 description 的 --- 代码块
- 多余的前置元数据字段 — 删除除 name 和 description 之外的任何字段
- 描述不充分 — 重写以包含:技能功能 + 触发条件(当...时使用)
- 无关文件 — 删除 README.md、INSTALLATION_GUIDE.md、CHANGELOG.md 等文件
- 位置错误 — 如果技能在 skills/ 之外,将其移动到 ~/.openclaw/workspace/skills//
- 命名违规 — 将目录重命名为小写连字符格式
对于警告(建议性):
- - SKILL.md 过长(>500行):将详细内容提取到 references/ 文件中,并从 SKILL.md 链接
- 未链接的参考资料:在 SKILL.md 正文中添加链接
- 描述不充分:改进触发语言
步骤 5 — 验证修复
在每个已修复的技能上重新运行 audit_skill.py,确认 compliant: true。
可选打包方式:
bash
python3 /opt/homebrew/lib/nodemodules/openclaw/skills/skill-creator/scripts/packageskill.py
合规检查清单
合规技能必须满足:
- - [ ] 在命名目录的根目录下有 SKILL.md 文件
- [ ] YAML 前置元数据仅包含 name 和 description(无其他字段)
- [ ] description 包含技能功能以及触发时机
- [ ] 目录名称:仅限小写字母、数字、连字符;不超过64个字符
- [ ] 无无关文件(README.md、CHANGELOG.md 等)
- [ ] 资源仅位于 scripts/、references/ 或 assets/ 中
- [ ] 所有 references/ 文件已从 SKILL.md 正文链接
- [ ] SKILL.md 正文不超过500行(如果过长,拆分到 references/ 中)