sync-skills
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOverview
概述
Discovers all skills in , then updates two files to stay in sync:
dotfiles/.claude/skills/- -- the
dotfiles/.claude/CLAUDE.mdsection## Skills - -- the
dotfiles/hal_dotfiles.jsonentries for skill directoriescopies
Finally runs to deploy changes.
hal sync扫描目录下的所有技能,然后更新两个文件以保持同步:
dotfiles/.claude/skills/- ——
dotfiles/.claude/CLAUDE.md章节## Skills - —— 技能目录对应的
dotfiles/hal_dotfiles.json条目copies
最后运行以部署变更。
hal syncInstructions
操作步骤
-
Find the project root: Use Glob to locate. The project root is the repo containing
dotfiles/.claude/skills/*/SKILL.md.dotfiles/ -
Read each SKILL.md frontmatter: For every skill found, extractand
namefrom the YAML frontmatter.description -
Update:
dotfiles/.claude/CLAUDE.md- Find the section (starts with
## Skillsheading).## Skills - Replace everything from up to the next
## Skillsheading (or end of file) with a regenerated list.## - Include all discovered skills.
- Format each entry as: /name` -- description`
- \ - Sort entries alphabetically by name.
- Keep a blank line after the heading and after the last entry.
- Find the
-
Update:
dotfiles/hal_dotfiles.json- Read the current file and parse the array.
copies - Replace all entries with entries for each discovered skill directory (regardless of
.claude/skills/*).user-invocable - Format each entry as:
{"dest": "{{HOME}}/.claude/skills/<name>/", "src": ".claude/skills/<name>/"} - Sort skill entries alphabetically by name.
- Preserve all non-skill entries in (and the entire
copiesarray) exactly as-is.links
- Read the current file and parse the
-
Runto deploy the updated files.
hal sync -
Report what changed: list any skills added or removed from each file.
-
定位项目根目录:使用Glob匹配文件。项目根目录是包含
dotfiles/.claude/skills/*/SKILL.md的代码仓库。dotfiles/ -
读取每个SKILL.md的前置元数据:对于找到的每个技能,从YAML前置元数据中提取和
name字段。description -
更新:
dotfiles/.claude/CLAUDE.md- 找到章节(以
## Skills标题开头)。## Skills - 将到下一个
## Skills标题(或文件末尾)之间的所有内容替换为重新生成的技能列表。## - 包含所有已发现的技能。
- 每个条目的格式为:/name` -- 描述`
- \ - 按名称字母顺序排序条目。
- 标题后和最后一个条目后保留空行。
- 找到
-
更新:
dotfiles/hal_dotfiles.json- 读取当前文件并解析数组。
copies - 将所有条目替换为每个已发现技能目录对应的条目(无论是否支持
.claude/skills/*)。user-invocable - 每个条目的格式为:
{"dest": "{{HOME}}/.claude/skills/<name>/", "src": ".claude/skills/<name>/"} - 按名称字母顺序排序技能条目。
- 完全保留数组中的所有非技能条目以及整个
copies数组不变。links
- 读取当前文件并解析
-
**运行**以部署更新后的文件。
hal sync -
报告变更内容:列出每个文件中添加或移除的技能。