• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialdevelopment

output-dev-upgrade-prompt-models

プラグイン
outputai
ソース
GitHub で見る ↗
説明

.prompt ファイル全体にわたって、モデルフィールド(AI言語モデルの指定部分)を、各プロンプトの既存ファミリーの最新版へ一括アップグレードします。 次のような場合に使用: - プロンプトで指定されているモデルが古い世代になっている場合(例:sonnet-4 → sonnet-4-6) - フレームワークの更新から長期間が経過している場合 - 定期的にモデルの鮮度を保つ運用の一環として 注記: 同じファミリー内でのアップグレードのみが対象で、プロバイダーやグレード(提供企業やサービスレベル)が変更されることはありません。

原文を表示

Bulk-upgrade the model field across .prompt files to the latest version of each prompt's existing family. Use when prompt models have drifted (eg sonnet-4 → sonnet-4-6), after a long pause between framework updates, or as part of a periodic model-freshness pass. Within-family only — never changes provider or tier.

ユースケース
  • プロンプトで指定されているモデルが古い世代になっている場合
  • フレームワークの更新から長期間が経過している場合
  • 定期的にモデルの鮮度を保つ運用の一環として
本文(日本語訳)

プロンプト内でモデルをアップグレード

プロジェクト内(または指定した部分木配下)のすべての .prompt ファイルを走査し、各モデルをプロバイダー(提供元)+ファミリー(等級区分)でグループ化します。その後、output-dev-model-selection のスナップショット(保存されたデータ)を参照して、そのグループ内の最新安定版モデルを調べ、model: の行を書き直します。プロバイダーとファミリーは保持されます。つまり、Haiku はそのまま Haiku に、Anthropic はそのまま Anthropic のままです。

このスキルは、プロバイダーの変更やレベルの引き上げ(例:Haiku → Sonnet)を行いません。そうした判断は人間が意図的に行うべき決定であり、別途対応します。

使用場面

  • 定期的な更新:「すべてのプロンプトモデルを最新版に更新したい」
  • フレームワークの更新が長期間なかった場合。古いスナップショット ID(例:claude-sonnet-4-20250514)が期限切れになっている
  • CLI スキャフォルダー(雛形)で新規プロジェクトを作成した直後。すべてのテンプレートデフォルトを現在の最新版に更新したい

処理フロー

ステップ 1 — 検索

指定した範囲内のすべての .prompt ファイルを探します。デフォルト範囲はプロジェクトの src/ ツリーです。ユーザーは 1 つのワークフロー単位に絞り込むことも可能です。

ステップ 2 — 現在のモデルを解析

各ファイルについて、YAML 形式のメタデータ(最初の --- 区切り線で囲まれた部分)を読み込み、provider: と model: を取り出します。

ステップ 3 — ファミリーを分類

既存モデルをファミリーグループに振り分けます。ファミリーはアップグレード後も変わりません。

パターン ファミリー
claude-opus-* anthropic-opus
claude-sonnet-* anthropic-sonnet
claude-haiku-* anthropic-haiku
gpt-*-pro openai-pro
gpt-*-mini openai-mini
gpt-*-nano openai-nano
gpt-N.M(接尾辞なし) openai-default
gemini-*-flash-lite* google-flash-lite
gemini-*-flash* google-flash
gemini-*-pro* google-pro

パターンに一致しないモデルが見つかった場合、そのファイルをスキップし、警告をログに記録します。推測で処理してはいけません。

ステップ 4 — ファミリー内の最新版を検索

各プロンプトについて、output-dev-model-selection に従って、同じファミリー内の最新安定版モデルを探します。スナップショットを取得し、そのフィルタルール(プレビュー版・アルファ版・ベータ版をスキップ、バージョン指定なしの別名を優先)を適用して、選定された id をプロンプトファイル形式に変換します。

このファミリー → スナップショットキー+ id の正規表現マップを使い、既存の等級に検索を限定します:

ファミリー スナップショットキー id 正規表現
anthropic-opus anthropic claude-opus-
anthropic-sonnet anthropic claude-sonnet-
anthropic-haiku anthropic claude-haiku-
openai-pro openai -pro$
openai-default openai ^openai/gpt-[0-9.]+$
openai-mini openai -mini$
openai-nano openai -nano$
google-pro google -pro(-flash を除く)
google-flash google -flash$|-flash-[0-9]
google-flash-lite google -flash-lite

ファミリーに安定版が存在しない場合(プレリリース版のみ入手可能)、ユーザーに通知してそのファイルをスキップします。推測したり別のファミリーに下げたりしてはいけません。

スナップショット取得失敗時は確実にエラーを出す。 スナップショット取得自体が失敗した場合(ネットワーク遮断、API 仕様変更、curl や jq が未インストール等)、ステップ 5 の前に処理を中止します。空のスナップショットのまま処理を続け、「アップグレード不要」と報告してはいけません。それは嘘になります。ユーザーにスナップショット取得失敗を告げ、output-dev-model-selection の手動対応手順を示してから終了してください。

ステップ 5 — 差分確認と承認

ファイルごとに、現在のモデルと解決済みの「最新版」を比較するレポートを作成します:

src/workflows/foo/prompts/bar@v1.prompt   claude-sonnet-4-20250514  →  claude-sonnet-4-6
src/workflows/foo/prompts/baz@v1.prompt   claude-haiku-4-5          ✓ already latest

レポート全体を表示します。ファイル書き込み前に、ユーザーの明示的な承認を待つ。 CI や非対話型環境ではドライラン(実際には書き込まない試行)をデフォルトにします。

ステップ 6 — 編集

承認されたファイルについて、YAML メタデータ部分のみを編集します:

  • model: の行を解決済み最新 ID で置き換える
  • # current as of YYYY-MM-DD … というコメント(output-dev-prompt-file の例や CLI スキャフォルダーで使われている慣例)があれば、日付を今日の日付(date +%Y-%m-%d)に更新します。コメントを current as of という文字列で照合し、日付部分だけを書き直します。後ろのテキストはそのまま残します。
  • provider:、temperature:、maxOutputTokens:(または廃止予定の maxTokens:)、providerOptions:、およびメッセージ本体は手をつけません。

日付付きコメントを同時に更新することで、「いつ現在の」という慣例の一貫性が保たれます。更新しないと、新しいモデルと古い日付が混在することになります。

ステップ 7 — 検証

一括処理後:

  • いくつかのファイルをスポットチェックして、YAML メタデータの区切り線とメッセージ本体が正常に残っているか確認します。
  • ワーカーをリビルドして、新しいモデル文字列を有効にします(npm run output:worker:build)。

Output SDK はビルド時にプロンプトモデル ID を検証しません。不正な ID は初回実行時にのみ検出されます。スモークテスト(基本動作確認)が利用可能なら、アップグレードされたファミリーごとに少なくとも 1 つのワークフローを実行してください。

注意点

  • 同じファミリー内だけ。 このスキルは Sonnet → Opus へのアップグレードや Anthropic → OpenAI への切り替えを行いません。等級やプロバイダーを変更するには、プロンプトを手動編集するか output-dev-prompt-file を使ってください。
  • 日付付き ID は置き換わる。 claude-sonnet-4-20250514 のようなピン留めは、バージョン指定なしの別名 claude-sonnet-4-6 に変わります。そのピン留めが再現性のために重要な場合、ユーザーに通知してそのファイルをスキップしてください。
  • @vertex と bedrock ネームスペース接尾辞。 claude-sonnet-4-20250514@vertex や anthropic.claude-sonnet-4-20250514-v1:0 のようなモデルは手動でアップグレードする必要があります。AI Gateway の一覧は直接プロバイダー ID のみを対象としています。
  • models.dev の価格情報更新の遅延。 アップグレード後でも、新しいモデルについて response.cost の total: null が表示される場合があります。models.dev が最新化されるまでの間です。ランタイムの呼び出しは正常に動作します。

関連項目

  • output-dev-model-selection — このスキルが参照する規範的なスナップショットと選定ルール
  • output-dev-prompt-file — .prompt ファイルの構造
原文(English)を表示

Upgrade Prompt Models In-Place

Walks every .prompt file in a project (or scoped subtree), classifies each model into its provider+family bucket, looks up the latest stable model in that bucket via the output-dev-model-selection snapshot, and rewrites the model: line. Provider and family tier are preserved — a Haiku stays a Haiku, an Anthropic stays an Anthropic.

This skill explicitly does not swap providers or escalate tiers (eg Haiku → Sonnet). Those are deliberate human decisions handled separately.

When to invoke

  • A periodic refresh: "upgrade all my prompt models to the latest"
  • After a long break between framework updates, where dated snapshot IDs (eg claude-sonnet-4-20250514) have aged out
  • Right after creating a new project from the CLI scaffolder, to pull every templated default forward to the current best

Workflow

Step 1 — Discover

Find every .prompt file under the target scope. Default scope is the project's src/ tree; the user may scope to a single workflow.

Step 2 — Parse current model

For each file, read the YAML frontmatter (between the first pair of --- lines) and pull out provider: and model:.

Step 3 — Classify family

Match the existing model into a family bucket. Family is preserved across the upgrade.

Pattern Family
claude-opus-* anthropic-opus
claude-sonnet-* anthropic-sonnet
claude-haiku-* anthropic-haiku
gpt-*-pro openai-pro
gpt-*-mini openai-mini
gpt-*-nano openai-nano
gpt-N.M (no suffix) openai-default
gemini-*-flash-lite* google-flash-lite
gemini-*-flash* google-flash
gemini-*-pro* google-pro

If a model doesn't match any pattern, skip the file and log a warning. Do not guess.

Step 4 — Look up latest in family

For each prompt, find the latest stable model in the same family by following output-dev-model-selection — fetch its snapshot, apply its filter rules (skip preview/alpha/beta, prefer unversioned aliases), and translate the chosen id to prompt-file form.

Use this family → snapshot-key + id regex map to pin the lookup to the existing tier:

Family Snapshot key id regex
anthropic-opus anthropic claude-opus-
anthropic-sonnet anthropic claude-sonnet-
anthropic-haiku anthropic claude-haiku-
openai-pro openai -pro$
openai-default openai ^openai/gpt-[0-9.]+$
openai-mini openai -mini$
openai-nano openai -nano$
google-pro google -pro (excluding -flash)
google-flash google -flash$|-flash-[0-9]
google-flash-lite google -flash-lite

If no stable match exists for a family (only pre-release entries available), surface that to the user and skip the file rather than guessing or downgrading to a different family.

Bail loudly on a failed snapshot. If the snapshot fetch itself returned nothing — network down, gateway shape changed, curl or jq missing — abort the run before Step 5. Do not continue with an empty snapshot and report "no upgrades needed", because that lies: the prompts weren't actually checked. Tell the user the snapshot fetch failed, point them at the manual-fallback steps in output-dev-model-selection, and exit.

Step 5 — Diff & confirm

Build a per-file report comparing the current model to the resolved latest:

src/workflows/foo/prompts/bar@v1.prompt   claude-sonnet-4-20250514  →  claude-sonnet-4-6
src/workflows/foo/prompts/baz@v1.prompt   claude-haiku-4-5          ✓ already latest

Print the full report. Wait for explicit user confirmation before writing. In CI / non-interactive contexts, default to dry-run.

Step 6 — Edit

For each confirmed file, edit only the YAML frontmatter:

  • Replace the model: line with the resolved latest ID.
  • If a # current as of YYYY-MM-DD … comment is present (the convention used in output-dev-prompt-file examples and CLI scaffolds), update its date to today's (date +%Y-%m-%d). Match the comment by the literal current as of prefix and only rewrite the date — leave the trailing text intact.
  • Leave provider:, temperature:, maxOutputTokens: (or deprecated maxTokens:), providerOptions:, and the message body untouched.

Refreshing the dated comment in the same edit keeps the "as of" convention coherent — without it, an upgraded prompt would have a fresh model paired with a stale date.

Step 7 — Verify

After the batch:

  • Spot-check a handful of files to confirm the YAML still has a frontmatter delimiter and message body.
  • Rebuild the worker so the new model strings take effect (npm run output:worker:build).

The Output SDK doesn't validate prompt model IDs at build time — invalid IDs only surface at first run. If smoke-tests are available, run at least one workflow per upgraded family.

Caveats

  • Within-family only. This skill never upgrades Sonnet → Opus, never swaps Anthropic for OpenAI. To change tier or provider, edit prompts manually or use output-dev-prompt-file.
  • Dated snapshots get bumped. A pin like claude-sonnet-4-20250514 becomes the unversioned alias claude-sonnet-4-6. If the pin was load-bearing for reproducibility, surface that and skip the file.
  • @vertex and bedrock namespace suffixes. Models like claude-sonnet-4-20250514@vertex or anthropic.claude-sonnet-4-20250514-v1:0 need manual upgrade. The AI Gateway listing covers direct provider IDs only.
  • Models.dev pricing lag. Even after the upgrade, response.cost may be incomplete with total: null for the brand-new model until models.dev catches up. The runtime call still works.

See also

  • output-dev-model-selection — canonical snapshot + selection rules this skill consumes
  • output-dev-prompt-file — .prompt file structure

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。