[AI][Fix #25] 为 version_manager.py 补上 SKILL.md 所调用的 backup action#30
Open
josephmqiu wants to merge 1 commit into
Open
[AI][Fix #25] 为 version_manager.py 补上 SKILL.md 所调用的 backup action#30josephmqiu wants to merge 1 commit into
josephmqiu wants to merge 1 commit into
Conversation
SKILL.md's evolution flow (zh line 318 / en line 587) invokes
'version_manager.py --action backup' before applying updates, but the
action was never implemented (argparse choices only had
list/rollback/cleanup), so the archive step always exited with code 2
and rollback had nothing to restore.
Implements backup(): reads the current version from meta.json, copies
SKILL.md/memories.md/persona.md into versions/{current_version}/, and
reports what was archived. Mirrors the archive logic already present in
skill_writer.update_skill().
Fixes perkfly#25
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qxv8G25EYkYzQyY6FdJ6qH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
🤖 AI 声明:本 PR 由 AI 模型 Claude Fable 5(Anthropic,运行于 Claude Code)编写并在本地测试,经 @josephmqiu 授权提交。
Fixes #25
问题
SKILL.md 的「进化模式:追加文件」流程(中文版第 318 行 / 英文版第 587 行)在更新前调用:
python3 ${CLAUDE_SKILL_DIR}/tools/version_manager.py --action backup --slug {slug} --base-dir ./exes但
version_manager.py的 argparse choices 只有list / rollback / cleanup,backupaction 从未实现——存档步骤每次都以退出码 2 失败,versions/目录里没有任何东西可供 rollback 恢复。改动
backup():从meta.json读取当前版本号,把SKILL.md/memories.md/persona.md复制到versions/{current_version}/,并输出实际存档的文件列表(与skill_writer.update_skill()已有的存档逻辑保持一致)"backup",main()增加对应分发;meta.json缺失时报错并以退出码 1 退出不改动任何现有 action 的行为。
本地测试
backup → list → rollback 全链路首次可以跑通。
🤖 Generated with Claude Code
https://claude.ai/code/session_01Qxv8G25EYkYzQyY6FdJ6qH