swain-update

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Update 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
.claude/skills/
contains any
swain-*
directories:
bash
ls -d .claude/skills/swain-* 2>/dev/null
If 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/swain
If
npx
fails (command not found, network error, or non-zero exit), fall back to a direct git clone:
bash
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
npx
执行失败(命令未找到、网络错误或非零退出码),则回退至直接git克隆方式:
bash
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
AGENTS.md
, 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.
调用swain-config Skill。该工具会根据新版本Skill中的变更,检查
AGENTS.md
、上下文文件和治理规则是否需要更新。此Skill具备幂等性,因此每次更新后运行它都是安全的。

Step 4 — Report

步骤4 — 生成更新报告

List the installed swain skill directories and extract each skill's version from its
SKILL.md
frontmatter:
bash
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
Show the user the list and confirm the update is complete.
列出已安装的Swain Skill目录,并从每个Skill的
SKILL.md
前置内容中提取版本信息:
bash
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
向用户展示该列表,并确认更新已完成。