• 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 ファイルを調べ、各モデルをプロバイダー(API提供者)とファミリー(モデルの世代・グレード)で分類したうえで、output-dev-model-selection のスナップショット(時点での最新情報)を参照して最新の安定版モデルを探し、model: の行を書き直します。プロバイダーとファミリーのグレードは変わりません。Haikuはそのままhaiku、Anthropicはそのままanthropicです。

このスキルは意図的に プロバイダーの切り替えやグレードの上げ下げ(たとえばHaiku → Sonnet)を行いません 。そうした判断は人間が個別に決める必要があります。

使用する場合

  • 定期的な更新: 「すべてのプロンプトモデルを最新版に更新したい」
  • フレームワークの更新から時間が経った場合: 日付が入ったバージョン指定(例: claude-sonnet-4-20250514)が古くなっている
  • CLIツールで新しいプロジェクトを作成した直後: テンプレートの初期値をすべて最新版に更新したい

処理の流れ

ステップ1 — ファイルを探す

指定範囲内のすべての .prompt ファイルを見つけます。デフォルトはプロジェクトの src/ ディレクトリですが、ユーザーが単一のワークフローに限定することもできます。

ステップ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          ✓ 既に最新です

レポート全体を表示してください。ファイルを書き込む前に、ユーザーの明示的な確認を待ってください。 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:、maxTokens:、providerOptions:、メッセージ本文は変更しません。

同じ編集内に日付コメントを更新することで、「アップグレード時点」の慣例が一貫します。これがないと、アップグレードされたプロンプトは新しいモデル名に古い日付が付きっぱなしになります。

ステップ7 — 検証

一括処理後:

  • 数個のファイルを確認して、YAMLのヘッダーとメッセージ本文が正しく残っているか見ます。
  • ワーカーをリビルドして、新しいモデル文字列が反映されるようにします(npm run output:worker:build)。

Output SDKはプロンプトのモデルIDをビルド時に検証しません。無効なIDは初回実行時に初めて見つかります。スモークテスト(動作確認テスト)があれば、アップグレードした各ファミリーごとに少なくとも1つのワークフローを実行してください。

注意点

  • 同じファミリー内のみ。 このスキルはSonnet → Opus、Anthropic → OpenAIへの切り替えを行いません。グレードやプロバイダーを変更したい場合は、プロンプトを手で編集するか、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のみをリストアップしています。
  • models.dev の料金情報の遅延。 アップグレード後も、ブランド新しいモデルについて、models.dev が追いつくまで calculateLLMCallCost が total: null を返すことがあります。ランタイムの呼び出しは動作します。

関連項目

  • 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:, 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, calculateLLMCallCost may return 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 による自動翻訳です。