.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)を行いません。そうした判断は人間が意図的に行うべき決定であり、別途対応します。
claude-sonnet-4-20250514)が期限切れになっている指定した範囲内のすべての .prompt ファイルを探します。デフォルト範囲はプロジェクトの src/ ツリーです。ユーザーは 1 つのワークフロー単位に絞り込むことも可能です。
各ファイルについて、YAML 形式のメタデータ(最初の --- 区切り線で囲まれた部分)を読み込み、provider: と model: を取り出します。
既存モデルをファミリーグループに振り分けます。ファミリーはアップグレード後も変わりません。
| パターン | ファミリー |
|---|---|
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 |
パターンに一致しないモデルが見つかった場合、そのファイルをスキップし、警告をログに記録します。推測で処理してはいけません。
各プロンプトについて、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 の手動対応手順を示してから終了してください。
ファイルごとに、現在のモデルと解決済みの「最新版」を比較するレポートを作成します:
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 や非対話型環境ではドライラン(実際には書き込まない試行)をデフォルトにします。
承認されたファイルについて、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:、およびメッセージ本体は手をつけません。日付付きコメントを同時に更新することで、「いつ現在の」という慣例の一貫性が保たれます。更新しないと、新しいモデルと古い日付が混在することになります。
一括処理後:
npm run output:worker:build)。Output SDK はビルド時にプロンプトモデル ID を検証しません。不正な ID は初回実行時にのみ検出されます。スモークテスト(基本動作確認)が利用可能なら、アップグレードされたファミリーごとに少なくとも 1 つのワークフローを実行してください。
output-dev-prompt-file を使ってください。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 のみを対象としています。response.cost の total: null が表示される場合があります。models.dev が最新化されるまでの間です。ランタイムの呼び出しは正常に動作します。output-dev-model-selection — このスキルが参照する規範的なスナップショットと選定ルールoutput-dev-prompt-file — .prompt ファイルの構造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.
claude-sonnet-4-20250514) have aged outFind every .prompt file under the target scope. Default scope is the project's src/ tree; the user may scope to a single workflow.
For each file, read the YAML frontmatter (between the first pair of --- lines) and pull out provider: and model:.
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.
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.
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.
For each confirmed file, edit only the YAML frontmatter:
model: line with the resolved latest ID.# 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.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.
After the batch:
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.
output-dev-prompt-file.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.response.cost may be incomplete with total: null for the brand-new model until models.dev catches up. The runtime call still works.output-dev-model-selection — canonical snapshot + selection rules this skill consumesoutput-dev-prompt-file — .prompt file structure原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。