skill-model-updater

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Your Task

你的任务

Command: $ARGUMENTS
Based on the command:
  1. check - Discover current models, scan all skills, report status
  2. update - Update outdated models to current versions
  3. update --dry-run - Show what would be updated without making changes

命令:$ARGUMENTS
根据命令执行以下操作:
  1. check(检查) - 发现当前模型,扫描所有Skill,报告状态
  2. update(更新) - 将过时模型更新为当前版本
  3. update --dry-run(预更新) - 显示将要进行的更改,但不实际修改文件

Skill Model Updater

Skill模型更新工具

You maintain model currency across all skill files, ensuring skills use the latest Claude models.

你需要维护所有Skill文件中的模型版本,确保技能使用最新的Claude模型。

Step 1: Discover Current Models

步骤1:发现当前模型

Before checking or updating skills, you MUST first discover current model IDs.
在检查或更新技能之前,必须先发现当前的模型ID。

Discovery Method

发现方法

  1. Search for current Anthropic models:
    WebSearch: "Anthropic Claude model IDs 2025" OR "Claude API models list current"
  2. Fetch official documentation:
    WebFetch: https://docs.anthropic.com/en/docs/about-claude/models
  3. Extract current model IDs for each tier:
    • Opus (most capable) - Look for
      claude-opus-*
      or
      claude-*-opus-*
    • Sonnet (balanced) - Look for
      claude-sonnet-*
      or
      claude-*-sonnet-*
    • Haiku (fast) - Look for
      claude-haiku-*
      or
      claude-*-haiku-*
  4. Identify the latest version of each tier by date suffix (e.g.,
    20250514
    >
    20250114
    )
  1. 搜索当前Anthropic模型:
    WebSearch: "Anthropic Claude model IDs 2025" OR "Claude API models list current"
  2. 获取官方文档:
    WebFetch: https://docs.anthropic.com/en/docs/about-claude/models
  3. 提取各层级的当前模型ID:
    • Opus(能力最强) - 查找包含
      claude-opus-*
      claude-*-opus-*
      的模型
    • Sonnet(平衡型) - 查找包含
      claude-sonnet-*
      claude-*-sonnet-*
      的模型
    • Haiku(快速型) - 查找包含
      claude-haiku-*
      claude-*-haiku-*
      的模型
  4. 通过日期后缀识别各层级的最新版本(例如:
    20250514
    >
    20250114

Expected Output Format

预期输出格式

After discovery, report:
CURRENT CLAUDE MODELS (discovered)
==================================
Source: docs.anthropic.com/en/docs/about-claude/models
Date checked: [today's date]

Opus:   claude-opus-4-5-20251101
Sonnet: claude-sonnet-4-5-20250929
Haiku:  claude-haiku-4-5-20251001
Shorthand aliases (always valid, resolve to current):
  • opus
    → current opus model
  • sonnet
    → current sonnet model
  • haiku
    → current haiku model

完成发现后,按以下格式报告:
CURRENT CLAUDE MODELS (discovered)
==================================
来源: docs.anthropic.com/en/docs/about-claude/models
检查日期: [今日日期]

Opus:   claude-opus-4-5-20251101
Sonnet: claude-sonnet-4-5-20250929
Haiku:  claude-haiku-4-5-20251001
简写别名(始终有效,会解析为当前最新模型):
  • opus
    → 当前Opus模型
  • sonnet
    → 当前Sonnet模型
  • haiku
    → 当前Haiku模型

Workflow

工作流程

Check Mode

检查模式

bash
/skill-model-updater check
  1. Discover current models (Step 1 above) - WebSearch/WebFetch Anthropic docs
  2. Glob for all
    skills/*/SKILL.md
    files
  3. Extract
    model:
    field from YAML frontmatter
  4. Compare against discovered current models
  5. Check CLAUDE.md - Scan
    ${CLAUDE_PLUGIN_ROOT}/CLAUDE.md
    for
    Co-Authored-By: Claude
    lines and verify model name is current
  6. Report status for each skill and CLAUDE.md
Output format:
SKILL MODEL AUDIT
=================

Current Models (discovered from docs.anthropic.com):
- Opus: claude-opus-4-5-20251101
- Sonnet: claude-sonnet-4-5-20250929
- Haiku: claude-haiku-4-5-20251001

Skill Status:
✓ lyric-writer: claude-opus-4-5-20251101 (current)
✓ researcher: claude-sonnet-4-5-20250929 (current)
⚠ album-art-director: claude-sonnet-4-20250114 (outdated → claude-sonnet-4-5-20250929)
✓ import-audio: claude-haiku-4-5-20251001 (current)

Summary: 19/20 skills current, 1 needs update
bash
/skill-model-updater check
  1. 发现当前模型(上述步骤1)- 通过WebSearch/WebFetch获取Anthropic文档
  2. 遍历所有
    skills/*/SKILL.md
    文件
  3. 从YAML前置元数据中提取
    model:
    字段
  4. 与发现的当前模型进行对比
  5. 检查CLAUDE.md - 扫描
    ${CLAUDE_PLUGIN_ROOT}/CLAUDE.md
    中包含
    Co-Authored-By: Claude
    的行,验证模型名称是否为当前最新版本
  6. 报告每个Skill和CLAUDE.md的状态
输出格式:
SKILL MODEL AUDIT
=================

当前模型(从docs.anthropic.com发现):
- Opus: claude-opus-4-5-20251101
- Sonnet: claude-sonnet-4-5-20250929
- Haiku: claude-haiku-4-5-20251001

Skill状态:
✓ lyric-writer: claude-opus-4-5-20251101 (当前最新)
✓ researcher: claude-sonnet-4-5-20250929 (当前最新)
⚠ album-art-director: claude-sonnet-4-20250114 (过时 → claude-sonnet-4-5-20250929)
✓ import-audio: claude-haiku-4-5-20251001 (当前最新)

摘要: 20个Skill中有19个为最新版本,1个需要更新

Update Mode

更新模式

bash
/skill-model-updater update
  1. Discover current models (Step 1 above)
  2. Run check to identify outdated skills
  3. For each outdated skill:
    • Read the SKILL.md file
    • Update the
      model:
      field to discovered current version
    • Preserve the skill's tier (don't change opus to sonnet)
  4. Update CLAUDE.md - If
    Co-Authored-By
    line in
    ${CLAUDE_PLUGIN_ROOT}/CLAUDE.md
    references an outdated model name, update it to current
  5. Report changes made
Output format:
SKILL MODEL UPDATE
==================

Models discovered from docs.anthropic.com:
- Opus: claude-opus-4-5-20251101
- Sonnet: claude-sonnet-4-5-20250929
- Haiku: claude-haiku-4-5-20251001

Updated 1 skill:
- album-art-director: claude-sonnet-4-20250114 → claude-sonnet-4-5-20250929

All skills now current.
bash
/skill-model-updater update
  1. 发现当前模型(上述步骤1)
  2. 执行检查以识别过时的Skill
  3. 针对每个过时的Skill:
    • 读取SKILL.md文件
    • model:
      字段更新为发现的当前最新版本
    • 保留Skill的层级(不将Opus改为Sonnet)
  4. 更新CLAUDE.md - 如果
    ${CLAUDE_PLUGIN_ROOT}/CLAUDE.md
    中的
    Co-Authored-By
    行引用了过时的模型名称,将其更新为当前最新版本
  5. 报告已完成的更改
输出格式:
SKILL MODEL UPDATE
==================

从docs.anthropic.com发现的模型:
- Opus: claude-opus-4-5-20251101
- Sonnet: claude-sonnet-4-5-20250929
- Haiku: claude-haiku-4-5-20251001

已更新1个Skill:
- album-art-director: claude-sonnet-4-20250114 → claude-sonnet-4-5-20250929

所有Skill现已更新至最新版本。

Dry Run Mode

预更新模式

bash
/skill-model-updater update --dry-run
Same as update but only reports what would change without editing files.

bash
/skill-model-updater update --dry-run
与更新模式操作相同,但仅报告将要进行的更改,不会编辑文件。

Model Detection Logic

模型检测逻辑

Identifying Outdated Models

识别过时模型

A model is outdated if:
  1. It's an older version of a current model family (e.g.,
    claude-sonnet-4-20250114
    vs
    claude-sonnet-4-5-20250929
    )
  2. It's a deprecated model (e.g.,
    claude-3-opus-20240229
    )
满足以下条件则模型视为过时:
  1. 属于当前模型系列的旧版本(例如:
    claude-sonnet-4-20250114
    对比
    claude-sonnet-4-5-20250929
  2. 已被弃用的模型(例如:
    claude-3-opus-20240229

Tier Detection (Auto)

自动层级检测

Detect tier from the skill's existing
model:
field - no hardcoded tier list needed:
  • If model contains
    opus
    → update to current opus
  • If model contains
    sonnet
    → update to current sonnet
  • If model contains
    haiku
    → update to current haiku
  • If model is shorthand (
    opus
    ,
    sonnet
    ,
    haiku
    ) → leave as-is (always resolves to current)
This preserves deliberate tier assignments without maintaining a separate mapping.

从Skill现有的
model:
字段中检测层级 - 无需硬编码层级列表:
  • 如果模型名称包含
    opus
    → 更新为当前最新Opus模型
  • 如果模型名称包含
    sonnet
    → 更新为当前最新Sonnet模型
  • 如果模型名称包含
    haiku
    → 更新为当前最新Haiku模型
  • 如果模型是简写形式(
    opus
    ,
    sonnet
    ,
    haiku
    )→ 保持不变(始终解析为当前最新版本)
这种方式无需维护单独的映射表,即可保留预先指定的层级分配。

When New Models Release

新模型发布时的操作

This skill discovers models automatically and detects tiers from existing assignments.
When Anthropic releases new models:
  1. Run check -
    /skill-model-updater check
    will discover new models automatically
  2. Review changes - Verify discovered models are correct
  3. Run update -
    /skill-model-updater update
    to propagate changes
Note: Tier assignments are documented in
${CLAUDE_PLUGIN_ROOT}/reference/model-strategy.md
. This skill preserves existing tiers - it only updates version numbers.

本Skill会自动发现模型,并从现有分配中检测层级。
当Anthropic发布新模型时:
  1. 执行检查 -
    /skill-model-updater check
    会自动发现新模型
  2. 审核更改 - 验证发现的模型是否正确
  3. 执行更新 -
    /skill-model-updater update
    以同步所有更改
注意:层级分配记录在
${CLAUDE_PLUGIN_ROOT}/reference/model-strategy.md
中。本Skill仅更新版本号,会保留现有的层级分配。

Example: Full Update Cycle

示例:完整更新流程

markdown
User: "New Claude models released, update skills"

1. Run check (discovers models automatically):
   /skill-model-updater check

   Output:
   - Discovered from docs.anthropic.com: Opus 4.5, Sonnet 4, Haiku 3.5
   - 3 skills using outdated sonnet (20250114 → 20250514)
   - 1 skill using deprecated opus (claude-3-opus → claude-opus-4-5)

2. Run dry-run:
   /skill-model-updater update --dry-run

   Output shows proposed changes

3. Run update:
   /skill-model-updater update

   Output confirms 4 skills updated

4. Verify:
   /skill-model-updater check

   Output: All 21 skills current

markdown
用户:"新的Claude模型已发布,更新所有Skill"

1. 执行检查(自动发现模型):
   /skill-model-updater check

   输出:
   - 从docs.anthropic.com发现:Opus 4.5, Sonnet 4, Haiku 3.5
   - 3个Skill使用过时的Sonnet模型(20250114 → 20250514)
   - 1个Skill使用已弃用的Opus模型(claude-3-opus → claude-opus-4-5)

2. 执行预更新:
   /skill-model-updater update --dry-run

   输出显示拟进行的更改

3. 执行更新:
   /skill-model-updater update

   输出确认已更新4个Skill

4. 验证:
   /skill-model-updater check

   输出:全部21个Skill均为当前最新版本

Error Handling

错误处理

Missing Model Field

缺少Model字段

If a SKILL.md has no
model:
field:
  • Report as "⚠ [skill]: No model specified"
  • Do not add one automatically (requires manual decision)
如果SKILL.md中没有
model:
字段:
  • 报告为"⚠ [skill]: 未指定模型"
  • 不会自动添加(需要手动决策)

Unknown Model

未知模型

If a SKILL.md has an unrecognized model:
  • Report as "? [skill]: Unknown model '[model-id]'"
  • Do not update (requires manual review)
如果SKILL.md中包含无法识别的模型:
  • 报告为"? [skill]: 未知模型 '[model-id]'"
  • 不会进行更新(需要手动审核)

Invalid YAML

YAML格式无效

If a SKILL.md has malformed frontmatter:
  • Report as "✗ [skill]: Invalid YAML frontmatter"
  • Do not attempt to update

如果SKILL.md的前置元数据格式错误:
  • 报告为"✗ [skill]: YAML前置元数据格式无效"
  • 不会尝试进行更新

Scope

适用范围

This skill updates model references in:
  1. All
    skills/*/SKILL.md
    files
    - The
    model:
    field in YAML frontmatter
  2. CLAUDE.md
    - The
    Co-Authored-By: Claude [Model] <noreply@anthropic.com>
    line in the versioning section
Both locations must stay in sync with the latest Claude model names.

本Skill会更新以下位置的模型引用:
  1. 所有
    skills/*/SKILL.md
    文件
    - YAML前置元数据中的
    model:
    字段
  2. CLAUDE.md
    - 版本控制部分中包含
    Co-Authored-By: Claude [Model] <noreply@anthropic.com>
    的行
这两个位置的模型名称必须与最新的Claude模型名称保持同步。

Remember

注意事项

  • Check before update - Always know what will change
  • Tiers are auto-detected - Skill reads existing model field to determine tier (opus/sonnet/haiku)
  • Shorthand is safe -
    opus
    ,
    sonnet
    ,
    haiku
    always resolve to current versions
  • Tier rationale - See
    ${CLAUDE_PLUGIN_ROOT}/reference/model-strategy.md
    for why each skill uses its tier
  • CLAUDE.md co-author line - Must reflect the current top-tier model name used for commits
  • 更新前先检查 - 始终明确将要进行的更改
  • 层级自动检测 - Skill会读取现有模型字段来确定层级(opus/sonnet/haiku)
  • 简写形式安全可靠 -
    opus
    ,
    sonnet
    ,
    haiku
    始终解析为当前最新版本
  • 层级分配依据 - 各Skill使用对应层级的原因请参考
    ${CLAUDE_PLUGIN_ROOT}/reference/model-strategy.md
  • CLAUDE.md中的合著者行 - 必须反映提交时使用的当前最高层级模型名称