.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 ファイルを調べ、各モデルをプロバイダー(API提供者)とファミリー(モデルの世代・グレード)で分類したうえで、output-dev-model-selection のスナップショット(時点での最新情報)を参照して最新の安定版モデルを探し、model: の行を書き直します。プロバイダーとファミリーのグレードは変わりません。Haikuはそのままhaiku、Anthropicはそのままanthropicです。
このスキルは意図的に プロバイダーの切り替えやグレードの上げ下げ(たとえばHaiku → Sonnet)を行いません 。そうした判断は人間が個別に決める必要があります。
claude-sonnet-4-20250514)が古くなっている指定範囲内のすべての .prompt ファイルを見つけます。デフォルトはプロジェクトの src/ ディレクトリですが、ユーザーが単一のワークフローに限定することもできます。
各ファイルで、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 ✓ 既に最新です
レポート全体を表示してください。ファイルを書き込む前に、ユーザーの明示的な確認を待ってください。 CI(自動テスト)や非対話的な環境では、デフォルトでドライラン(実際には変更しない)にします。
確認されたファイルごとに、YAMLヘッダーのみを編集します:
model: の行を解決済みの最新IDで置き換えます。# current as of YYYY-MM-DD … というコメント(output-dev-prompt-file の例やCLIスカッフォルドで使われる慣例)があれば、日付を今日の日付(date +%Y-%m-%d)に更新します。current as of の直後の文字列で該当行を特定し、日付だけを書き直し、その後のテキストはそのままにします。provider:、temperature:、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ゲートウェイは直接プロバイダーのIDのみをリストアップしています。calculateLLMCallCost が total: null を返すことがあります。ランタイムの呼び出しは動作します。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:, 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.calculateLLMCallCost may return 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 による自動翻訳です。