Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

swain-update斯维因更新

Agent Skill

swain-update 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,812

周安装

116

GitHub Stars

2

下载量

919
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:swain-update(斯维因更新)
来源仓库:https://github.com/cristoslc/swain
仓库路径:skills/swain-update
安装命令:
npx skills add https://github.com/cristoslc/swain --skill swain-update
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/cristoslc/swain --skill swain-update

简介

用于查找、检索和筛选相关信息。

  • 适合根据关键词或任务场景快速定位候选结果。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装命令:npx skills add https://github.com/cristoslc/swain --skill swain-update。
  • 安装前建议确认权限范围和维护状态。

SKILL.md

Update Swain

Update the local installation of swain skills to the latest version, then reconcile governance configuration.

Step 1 — Detect current installation

Check whether .claude/skills/ contains any swain-* directories:

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.

Step 2 — Backup local modifications

Before overwriting skill directories, check for user modifications that should be preserved.

Detect modified files

Compare local skill files against the installed version's git origin:

# Create a temporary reference copy
tmp=$(mktemp -d)
git clone --depth 1 https://github.com/cristoslc/swain.git "$tmp/swain" 2>/dev/null

# Find locally modified files
modified_files=()
for skill_dir in .claude/skills/swain-*/; do
  skill_name=$(basename "$skill_dir")
  ref_dir="$tmp/swain/skills/$skill_name"
  [ -d "$ref_dir" ] || continue

  while IFS= read -r file; do
    rel="${file#$skill_dir}"
    ref_file="$ref_dir/$rel"
    if [ -f "$ref_file" ]; then
      if ! diff -q "$file" "$ref_file" >/dev/null 2>&1; then
        modified_files+=("$file")
      fi
    else
      # File exists locally but not in upstream — user-added file
      modified_files+=("$file")
    fi
  done < <(find "$skill_dir" -type f)
done

Backup modified files

If modified files are found:

  1. Create a backup directory: .agents/update-backup/<ISO-date>/
  2. Copy each modified file preserving directory structure
  3. Inform the user: "Found N locally modified files — backed up to .agents/update-backup/<date>/"
  4. List the modified files

If no modified files are found, skip and continue.

The reference clone from this step can be reused as the fallback source in Step 3.

Step 3 — Detect installed agent platforms

Before installing, detect which agent platforms are present on the system. This avoids creating dotfolder stubs for every supported platform (see GitHub issue #21).

Read the agent platform data from references/agent-platforms.json. Each entry in the agents array has a name (skills CLI identifier), an optional command (CLI binary), and a detection path (HOME config directory). A platform is detected if either check succeeds. Entries in always_include are added unconditionally.

SKILL_DIR="$(find . .claude skills -path '*/swain-update/references' -print -quit 2>/dev/null | sed 's|/references$||')"
detected_agents=()

# Always-include platforms (we're running inside claude-code)
for name in $(jq -r '.always_include[]' "$SKILL_DIR/references/agent-platforms.json"); do
  detected_agents+=("$name")
done

# Detect remaining platforms via command -v or HOME dotfolder
while IFS= read -r entry; do
  name=$(echo "$entry" | jq -r '.name')
  cmd=$(echo "$entry" | jq -r '.command // empty')
  det=$(echo "$entry" | jq -r '.detection // empty')

  # Skip always-include (already added)
  for ai in "${detected_agents[@]}"; do [[ "$ai" == "$name" ]] && continue 2; done

  found=false
  if [[ -n "$cmd" ]] && command -v "$cmd" &>/dev/null; then
    found=true
  fi
  if [[ -n "$det" ]] && ! $found; then
    det_expanded=$(echo "$det" | sed "s|~|$HOME|g")
    det_expanded=$(eval echo "$det_expanded" 2>/dev/null)
    [[ -d "$det_expanded" ]] && found=true
  fi

  $found && detected_agents+=("$name")
done < <(jq -c '.agents[]' "$SKILL_DIR/references/agent-platforms.json")

Build the -a flags from detected agents:

agent_flags=""
for agent in "${detected_agents[@]}"; do
  agent_flags="$agent_flags -a $agent"
done

Tell the user which platforms were detected:

Detected N agent platform(s): claude-code, codex, gemini-cli,...

Step 4 — Update via npx

Run the skills package manager with only the detected agents:

npx skills add cristoslc/swain $agent_flags -s '*' -y

This installs all skills (-s '*') for only the detected platforms, skipping confirmation (-y). No dotfolder stubs are created for platforms that aren't installed.

If npx fails (command not found, network error, or non-zero exit), fall back to a direct git clone:

tmp=$(mktemp -d)
git clone --depth 1 https://github.com/cristoslc/swain.git "$tmp/swain"
# Detect skill install location
INSTALL_DIR=$(find . -maxdepth 2 -name "swain-doctor" -type d -print -quit 2>/dev/null | sed 's|/swain-doctor$||')
INSTALL_DIR="${INSTALL_DIR:-.claude/skills}"
cp -r "$tmp/swain/skills/"* "$INSTALL_DIR/"
rm -rf "$tmp"

Step 5 — Reconcile governance

Invoke the swain-doctor skill. This validates governance rules, cleans up legacy skill directories (including any renamed in this release), validates .tickets/, and untracks any runtime files that leaked into git. The skill is idempotent, so running it after every update is always safe.

Step 6 — Restore guidance

If files were backed up in Step 2:

  1. List the backed-up files with their paths
  2. For each, explain the situation:

- User-added config files (e.g., config/yazi/yazi.toml): Suggest moving to .agents/config/<skill-name>/ or swain.settings.json where they'll survive future updates - Patched scripts: Show the diff between the backup and the new version. If the upstream version includes the fix, confirm the patch is no longer needed. If not, offer to re-apply the patch.

  1. Remind the user: "To avoid this in future, store customizations in .agents/config/ or swain.settings.json — these survive updates."

Step 7 — Report

Display the current release version (from the latest git tag):

release_tag=$(git tag --sort=-v:refname | head -1)
echo "swain ${release_tag:-(unreleased)}"

Then list the installed swain skill directories and extract each skill's version from its SKILL.md frontmatter:

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.

If backups were created in Step 2, also show: "Backed up N modified files to .agents/update-backup/<date>/. See Step 5 for restore guidance."

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.99%
按下载量换算322

Claude

30.04%
按下载量换算276

Cursor

20.33%
按下载量换算187

Gemini CLI

11.08%
按下载量换算102

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills