update

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Update

更新

Paths:
${CLAUDE_SKILL_DIR}
means the folder containing this SKILL.md, and
${CLAUDE_PLUGIN_ROOT}
the plugin folder two levels above it.
Every question goes in the question box: the AskUserQuestion tool (2-4 options, recommended first). Only in an agent without it, ask numbered questions in text.
U="${CLAUDE_SKILL_DIR}/scripts/update.py"
. Run it with
python3
on Mac and Linux,
py
on Windows. Add
--repo <folder>
when the user's clone is not the folder Claude Code runs in.
Never push, never force-push, never delete a branch, never stash or reset the user's uncommitted work. Pushing to their fork happens only when they ask for it.
路径:
${CLAUDE_SKILL_DIR}
表示包含此 SKILL.md 的文件夹,
${CLAUDE_PLUGIN_ROOT}
表示其上两级的 plugin 文件夹。
所有问题都要通过 question box 提出:使用 AskUserQuestion 工具(提供 2-4 个选项,并将推荐项放在首位)。只有在不具备该工具的 agent 中,才用文本提出编号问题。
U="${CLAUDE_SKILL_DIR}/scripts/update.py"
。在 Mac 和 Linux 上使用
python3
运行,在 Windows 上使用
py
运行。 如果用户的 clone 不是 Claude Code 运行所在的文件夹,请添加
--repo <folder>
。
绝不能 push、force-push、delete branch,也绝不能 stash 或 reset 用户未提交的工作。 只有用户明确要求时,才能 push 到他们的 fork。

1. Which install

1. 判断安装方式

bash
python3 "$U" where
  • marketplace: run
    python3 "$U" market
    . It runs
    claude plugin marketplace update nextwork
    , then
    claude plugin update
    for
    ai-editor@nextwork
    and
    creator-teardown@nextwork
    itself. Then tell them to type
    /reload-plugins
    . If it fails, say the lines it prints instead. Their styles, skills and settings live in their own folder and survive (docs/customise.md). Stop here.
  • plain clone: say the three fork steps it prints. Stop here.
  • a fork, run outside its clone: ask for the folder of their clone, then use
    --repo
    .
  • fork, upstream missing: ask "Add nextwork-projects/ai-video-editor-cooked as
    upstream
    so updates can come from it?" (Yes, add it (Recommended) / No). On yes:
    python3 "$U" add-upstream
    .
bash
python3 "$U" where
  • marketplace:运行
    python3 "$U" market
    。它会先执行
    claude plugin marketplace update nextwork
    ,随后为
    ai-editor@nextwork
    和
    creator-teardown@nextwork
    本身执行
    claude plugin update
    。然后告诉用户输入
    /reload-plugins
    。如果失败,则转述它打印的内容。他们的 styles、skills 和 settings 位于各自的文件夹中,不会受到影响(docs/customise.md)。到此停止。
  • 普通 clone:按其输出告知三个 fork 步骤。到此停止。
  • 在 clone 目录之外运行的 fork:询问用户其 clone 所在的文件夹,然后使用
    --repo
    。
  • fork 缺少 upstream:询问“是否将 nextwork-projects/ai-video-editor-cooked 添加为
    upstream
    ,以便从中获取更新?”(是,添加(推荐) / 否)。如果用户同意,运行
    python3 "$U" add-upstream
    。

2. Check

2. 检查

bash
python3 "$U" check
Tell the user in a few lines: how many new commits, the CHANGELOG lines they bring (plain words, the ones they would notice), and which of their changed files the update also touches. Then ask Update now (Recommended) / Not now.
bash
python3 "$U" check
用几行告知用户:有多少个 new commits、这些 commits 带来的 CHANGELOG 条目(用直白语言说明用户会注意到的内容),以及此次更新还修改了用户哪些 changed files。然后询问 立即更新(推荐) / 暂不更新。

3. Merge

3. 合并

bash
python3 "$U" merge
  • Exit 2, uncommitted changes: show what it printed. Ask Commit them as "my changes" (Recommended) / I'll handle it myself. Commit only on a yes, then merge again. Never stash.
  • Exit 0: go to step 4.
  • Exit 3, conflicts: resolve them file by file. For each file, keep the user's change and take upstream's fix, and say what you did in one line ("captions.tsx: kept your font, took the new safe-zone fix"). When the two really clash and the choice is theirs (both changed the same setting to different values), ask in the question box with each side as an option, theirs first. Then
    git add
    each file and
    git commit --no-edit
    .
The backup branch is
before-update-<date>
; say its name once.
bash
python3 "$U" merge
  • 退出码 2,存在未提交的更改:显示脚本打印的内容。询问 提交为“my changes”(推荐) / 我自己处理。只有用户同意后才提交,然后再次执行 merge。绝不能 stash。
  • 退出码 0:进入第 4 步。
  • 退出码 3,存在冲突:逐个文件解决冲突。对于每个文件,保留用户的更改并采用 upstream 的修复,然后用一行说明所做操作(“captions.tsx:保留你的字体,采用新的 safe-zone 修复”)。如果双方确实冲突,且应由用户决定(双方都将同一个 setting 改成了不同值),则在 question box 中提问,将双方的方案分别列为选项,并将用户的方案放在首位。然后对每个文件执行
    git add
    ,再执行
    git commit --no-edit
    。
备份 branch 名为
before-update-<date>
;只需告知一次该名称。

4. Verify

4. 验证

bash
python3 "$U" verify
It runs
tests/check_plugins.py
and
tests/demos.sh
. Pass: tell them to type
/reload-plugins
(and, if they installed from their fork on GitHub, that pushing to it and
/plugin marketplace update nextwork
brings it there, when they want). Fail: show the failing checks and ask Fix them (Recommended) / Go back to before the update. Going back:
bash
python3 "$U" rollback
It aborts an unfinished merge or moves the branch back to the backup. No branch is deleted.
bash
python3 "$U" verify
它会运行
tests/check_plugins.py
和
tests/demos.sh
。验证通过时,告诉用户输入
/reload-plugins
(如果用户通过 GitHub 上的 fork 安装,还要说明:在用户需要时,将更改 push 到该 fork,然后执行
/plugin marketplace update nextwork
,即可将更新同步过去)。验证失败时:显示失败的 checks,并询问 修复(推荐) / 返回更新前状态。回退方式如下:
bash
python3 "$U" rollback
它会中止尚未完成的 merge,或将 branch 移回备份状态。不会删除任何 branch。