用途 Update Nexus 用于从上游 Nexus 仓库同步系统文件,同时保护用户数据。它适用于需要将本地 Nexus 系统更新到最新版本的场景,触发方式为用户说出“update nexus”“sync nexus”“get nexus updates”“check for updates”“upgrade”等指令。整个过程预计耗时 1-2 分钟。
主要能力 该技能会更新以下系统文件:00-system/ 目录(核心框架、技能、文档)、CLAUDE.md(入口点)、README.md(项目说明)。同时,它会保护以下用户文件夹,绝不触碰:01-memory/(目标、学习记录、配置)、02-projects/(项目)、03-skills/(自定义技能)、04-workspace/(文件)、.env 与 .claude/(密钥与设置)。
使用方式 工作流程分为五步。第一步,检查更新:运行 python 00-system/core/nexus-loader.py --check-update,解析 JSON 响应。若 checked 为 false 且带错误,则显示错误并优雅退出;若 update_available 为 false,则显示“Already up-to-date!”并退出;若 update_available 为 true,则继续。第二步,展示变更:向用户显示当前版本、新版本、待更新文件列表(最多 20 个)以及受保护文件夹。第三步,确认:询问“Proceed with update? (yes/no)”,若否,则退出并显示“Update cancelled”;若是,则继续。第四步,执行同步:运行 python 00-system/core/nexus-loader.py --sync --force,解析 JSON 响应。若 success 为 false,则显示错误并建议修复;若 success 为 true,则继续。第五步,显示结果:展示版本变化、已更新路径、备份路径,并提示提交命令 git add . && git commit -m "Update Nexus to v{upstream_version}"。
错误处理 技能内置了常见错误的用户提示:“Not a git repository”对应“This folder isn't a git repo. Initialize with: git init”;“Could not reach upstream”对应“Can't connect to GitHub. Check your internet connection.”;“Uncommitted changes detected”对应“You have uncommitted changes. Commit them first:\n git add . && git commit -m 'Save changes'”;“Could not read upstream version”对应“The upstream repo might not be set up correctly. Check the URL in user-config.yaml”。
高级用法 支持干跑模式,预览变更而不实际应用:python 00-system/core/nexus-loader.py --sync --dry-run。这会显示将会发生的变化,但不做任何修改。
注意事项 同步前,当前系统文件会备份到 .sync-backup/{timestamp}/。用户数据文件夹永远不会出现在同步路径中,因此无法被触碰。上游远程仓库在首次使用时自动添加(命名为“upstream”),默认 URL 为 https://github.com/beamanalytica/Nexus-v4.git,可在 user-config.yaml 中覆盖。