swain-update
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUpdate Swain
更新Swain
Update the local installation of swain skills to the latest version, then reconcile governance configuration.
将本地安装的Swain Skills更新至最新版本,随后协调治理配置。
Step 1 — Detect current installation
步骤1 — 检测当前安装情况
Check whether contains any directories:
.claude/skills/swain-*bash
ls -d .claude/skills/swain-* 2>/dev/nullIf no swain skill directories are found, inform the user this appears to be a fresh install rather than an update, then continue anyway — the steps below work for both cases.
检查目录下是否存在任何目录:
.claude/skills/swain-*bash
ls -d .claude/skills/swain-* 2>/dev/null如果未找到任何Swain Skill目录,告知用户这看起来像是全新安装而非更新,不过仍继续执行后续步骤——以下步骤对两种情况均适用。
Step 2 — Update via npx
步骤2 — 通过npx更新
Run the skills package manager to pull the latest swain skills:
bash
npx skills add cristoslc/swainIf fails (command not found, network error, or non-zero exit), fall back to a direct git clone:
npxbash
tmp=$(mktemp -d)
git clone --depth 1 https://github.com/cristoslc/swain.git "$tmp/swain"
cp -r "$tmp/swain/skills/"* .claude/skills/
rm -rf "$tmp"运行skills包管理器拉取最新的Swain Skills:
bash
npx skills add cristoslc/swain若执行失败(命令未找到、网络错误或非零退出码),则回退至直接git克隆方式:
npxbash
tmp=$(mktemp -d)
git clone --depth 1 https://github.com/cristoslc/swain.git "$tmp/swain"
cp -r "$tmp/swain/skills/"* .claude/skills/
rm -rf "$tmp"Step 3 — Reconcile governance
步骤3 — 协调治理配置
Invoke the swain-config skill. This checks whether , context files, and governance rules need updating based on any changes in the new skill versions. The skill is idempotent, so running it after every update is always safe.
AGENTS.md调用swain-config Skill。该工具会根据新版本Skill中的变更,检查、上下文文件和治理规则是否需要更新。此Skill具备幂等性,因此每次更新后运行它都是安全的。
AGENTS.mdStep 4 — Report
步骤4 — 生成更新报告
List the installed swain skill directories and extract each skill's version from its frontmatter:
SKILL.mdbash
for skill in .claude/skills/swain-*/SKILL.md; do
name=$(grep '^name:' "$skill" | head -1 | sed 's/name: *//')
version=$(grep 'version:' "$skill" | head -1 | sed 's/.*version: *//')
echo " $name v$version"
doneShow the user the list and confirm the update is complete.
列出已安装的Swain Skill目录,并从每个Skill的前置内容中提取版本信息:
SKILL.mdbash
for skill in .claude/skills/swain-*/SKILL.md; do
name=$(grep '^name:' "$skill" | head -1 | sed 's/name: *//')
version=$(grep 'version:' "$skill" | head -1 | sed 's/.*version: *//')
echo " $name v$version"
done向用户展示该列表,并确认更新已完成。