skill-update
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseskill-update
skill-update
Finds every skill installed on this machine, works out where each one came from, compares it with its upstream and updates what is outdated, with a backup first. The engine is (Python 3.9+, standard library; the network is only touched through ).
scripts/skill_update.pygitRun it as . The folder is the "Base directory" shown when this skill loads.
python3 "<this skill's folder>/scripts/skill_update.py" ...查找本机上安装的所有 skill,确定每个 skill 的来源,将其与上游版本进行比较,并先创建备份,再更新所有过时版本。核心程序为 (Python 3.9+,仅使用标准库;仅通过 访问网络)。
scripts/skill_update.pygit运行方式:。该文件夹就是加载此 skill 时显示的“Base directory”。
python3 "<this skill's folder>/scripts/skill_update.py" ...Workflow
工作流程
- Check (changes nothing): . A cold first run can take up to a minute.
check --json - Summarize for the user, in their language. Count what is outdated and list each outdated item with its name, source and size of change (). Call out separately:
changes- : the user edited that skill, and an update overwrites the edits after a backup.
modified: true - : a git clone with a setup script. A plain
setup_script: trueleaves it out (seeupdate). Offer to update it by name, and tell the user to run its setup script themselves.skipped[] - ,
blocked,error: say why, usingunknown. Do not retry in a loop.notes - : only a count; these have no upstream to compare with.
unmanaged
- Ask which to update (default: all outdated). Do not run until the user agrees.
update - Update: . Add
update --yes [names...]when the user wants their edits protected. Use--keep-modifiedfirst when they want a preview. Naming a skill is the only way to update a--dry-runclone.setup_script - Report (updated, unchanged, failed) and
resultswith each reason, plus theskipped[]and how to undo it:run_id. Relayrollback <run_id>: plugin changes need a restart, and new skill versions load in a new session.notes
- 检查(不会进行任何更改):。首次冷启动最长可能需要一分钟。
check --json - 向用户总结,使用用户所用的语言。统计过时项目的数量,并逐项列出每个过时项目的名称、来源和变更规模()。另外单独说明:
changes- :用户编辑过该 skill;更新时会在备份后覆盖这些修改。
modified: true - :这是一个带 setup script 的 git clone。普通
setup_script: true会跳过它(见update)。可询问用户是否按名称更新,并提醒用户自行运行其 setup script。skipped[] - 、
blocked、error:使用unknown说明原因。不要循环重试。notes - :仅统计数量;这些 skill 没有可比较的上游版本。
unmanaged
- 询问用户要更新哪些项目(默认更新全部过时项目)。在用户同意前,不要运行 。
update - 更新:。如果用户希望保护其修改,请添加
update --yes [names...]。如果用户希望先预览,请先使用--keep-modified。只有按名称指定 skill,才能更新--dry-runclone。setup_script - 报告 (updated、unchanged、failed)和
results中的各项原因,同时提供skipped[]及撤销方法:run_id。转达rollback <run_id>:plugin 变更需要重启,新的 skill 版本会在新会话中加载。notes
Rules
规则
- Never pass before the user approved the list.
--yes - Never run scripts that an updated skill ships (,
setup,install.sh). When a result mentions one, tell the user and let them decide.npm install - A source such as can be passed to
owner/repoandcheckto select everything from that source.update - A failure on one item never blocks the others; report it and move on.
- 在用户批准更新列表之前,绝不能传入 。
--yes - 绝不能运行更新后的 skill 所附带的脚本(、
setup、install.sh)。如果结果提到其中某个脚本,应告知用户,并由用户决定是否运行。npm install - 可将 这样的来源传给
owner/repo和check,以选择该来源下的全部项目。update - 单个项目的失败绝不能阻止其他项目;报告失败后继续处理。
Commands
命令
| Command | What it does |
|---|---|
| List what is outdated. |
| Apply updates. |
| Undo an update run. |
| Show which skill folders were found. |
Limit a run with , leave a skill out with , scan another folder with .
--only lock|git|plugin--ignore NAME--root DIR| 命令 | 作用 |
|---|---|
| 列出所有过时项目。 |
| 应用更新。当 skill 存在本地修改时,会拒绝 |
| 撤销一次更新运行。 |
| 显示已找到的 skill 文件夹。 |
可使用 限制本次运行范围,使用 排除某个 skill,使用 扫描其他文件夹。
--only lock|git|plugin--ignore NAME--root DIRJSON fields
JSON 字段
items[]namekindstatussourceagentslocationsmodifiedsetup_scriptchangesaddedmodifiedremovedfilesnotesupdateresults[]outcomeskipped[]namereasonrun_idnotesitems[]namekindstatussourceagentslocationsmodifiedsetup_scriptchangesaddedmodifiedremovedfilesnotesupdateresults[]outcomeskipped[]namereasonrun_idnotes