SuperAPI AI 工具集

skillctx-sync

测试与质量

查看项目

更新于 10-15 22:39

技能介绍

用途:在更新 skillctx 仓库(如 resolve.py 修复 bug 或新增功能)后,把最新的 resolver 和 setup 块推送到所有已迁移技能。触发方式为用户说 skillctx-sync、update skillctx 或 sync skillctx。

前提:需要 Python 3.10+,且技能已安装并可被 agent host 发现。

工作流:先运行 python <skill-dir>/scripts/sync.py --help 确认脚本可用,并读取 skillctx 仓库根目录 pyproject.toml 获取当前版本号。接着执行 python <skill-dir>/scripts/sync.py scan <skills-dir> <current-version> 扫描已安装技能,输出 JSON,仅包含 SKILL.md 中含 <!-- skillctx:begin --> 的技能,状态分为 outdated 与 current。随后筛出 outdated 技能并向用户展示,等待确认(yes/select/cancel)。对每个获批技能执行 python <skill-dir>/scripts/sync.py update <skill-dir> <resolver-src> <current-version>,其中 resolver-src 为 skills/skillctx-ify/scripts/resolve.py。该脚本会复制 resolver 到 <skill-dir>/scripts/skillctx-resolve.py,替换 skillctx:begin 到 skillctx:end 之间的 setup 块,并更新 frontmatter 中 metadata.skillctx.version,最后报告更新结果与错误。

错误处理:找不到已迁移技能时报告 no skills using skillctx found;全部为最新时报告 all skills up to date;技能目录不可写则警告并跳过,末尾列出;缺少 <!-- skillctx:end --> 标记时警告 setup 块可能格式异常,跳过并列入人工复核清单。