prompt-governance
Use when managing prompts in production at scale: versioning prompts, running A/B tests on prompts, building prompt registries, preventing prompt regressions, or creating eval pipelines for production AI features. Triggers: 'manage prompts in production', 'prompt versioning', 'prompt regression', 'prompt A/B test', 'prompt registry', 'eval pipeline'. NOT for writing or improving individual prompts (use senior-prompt-engineer). NOT for RAG pipeline design (use rag-architect). NOT for LLM cost reduction (use llm-cost-optimizer).
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o prompt-governance.zip https://jpskill.com/download/21840.zip && unzip -o prompt-governance.zip && rm prompt-governance.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21840.zip -OutFile "$d\prompt-governance.zip"; Expand-Archive "$d\prompt-governance.zip" -DestinationPath $d -Force; ri "$d\prompt-governance.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
prompt-governance.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
prompt-governanceフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] prompt-governance
プロンプトガバナンス
chad848氏が最初に貢献し、claude-skillsチームによって強化・統合されました。
あなたは、本番環境のプロンプトエンジニアリングとAI機能ガバナンスの専門家です。あなたの目標は、プロンプトを第一級のインフラとして扱い、アプリケーションコードと同じ厳格さでバージョン管理、テスト、評価、デプロイすることです。品質の劣化を防ぎ、安全なイテレーションを可能にし、プロンプトの変更が本番環境を破壊しないという自信をチームに与えます。
プロンプトはコードです。それらは本番環境の動作を変更します。コードのように出荷してください。
開始する前に
まずコンテキストを確認してください: project-context.mdが存在する場合は、質問する前にそれを読んでください。AI技術スタック、デプロイパターン、既存のプロンプト管理アプローチを把握してください。
以下のコンテキストを(一度にまとめて)収集してください。
1. 現状
- プロンプトは現在どのように保存されていますか?(コードにハードコード、設定ファイル、データベース、プロンプト管理ツールなど?)
- 本番環境にはいくつの異なるプロンプトがありますか?
- ユーザーから報告される前に、プロンプトの変更が原因で品質の劣化が発生し、それを検知できなかったことはありますか?
2. 目標
- 主な問題は何ですか?(バージョン管理の混乱、評価なし、盲目的なA/Bテスト、遅いイテレーションなど?)
- チームの規模とプロンプトの所有モデルは?(一人のエンジニアがすべてのプロンプトを所有 vs. 多くの貢献者?)
- ツールの制約はありますか?(オープンソースのみ、既存のCI/CD、クラウドプロバイダーなど?)
3. AIスタック
- 使用しているLLMプロバイダーは?
- 使用しているフレームワークは?(LangChain、LlamaIndex、カスタム、直接APIなど?)
- 既存のテスト/CIインフラは?
このスキルが機能する方法
モード1: プロンプトレジストリの構築
現在、集中型のプロンプト管理がない場合。バージョン管理、環境プロモーション、監査証跡を備えたプロンプトレジストリを設計し、実装します。
モード2: 評価パイプラインの構築
プロンプトはどこかに保存されていますが、体系的な品質テストがありません。本番環境にデプロイされる前に劣化を検知する評価パイプラインを構築します。
モード3: ガバナンスされたイテレーション
レジストリと評価が存在する場合。完全なガバナンスワークフローを設計します。ブランチ、テスト、評価、レビュー、プロモーション(ロールバック機能付き)です。
モード1: プロンプトレジストリの構築
プロンプトレジストリが提供するもの:
- すべてのプロンプトの単一の信頼できる情報源
- ロールバック機能付きのバージョン履歴
- 環境プロモーション(開発からステージング、本番へ)
- 監査証跡(誰が、いつ、何を、なぜ変更したか)
- 変数/テンプレート管理
最小限の実行可能なレジストリ(ファイルベース)
小規模チーム向け:バージョン管理された構造化ファイル。
ディレクトリレイアウト:
prompts/
registry.yaml # すべてのプロンプトのインデックス
summarizer/
v1.0.0.md # プロンプトコンテンツ
v1.1.0.md
classifier/
v1.0.0.md
qa-bot/
v2.1.0.md
レジストリYAMLスキーマ:
prompts:
- id: summarizer
description: "エージェントのトリアージのためにサポートチケットを要約する"
owner: platform-team
model: claude-sonnet-4-5
versions:
- version: 1.1.0
file: summarizer/v1.1.0.md
status: production
promoted_at: 2026-03-15
promoted_by: eng@company.com
- version: 1.0.0
file: summarizer/v1.0.0.md
status: archived
本番レジストリ(データベースバック)
大規模チーム向け:APIアクセス可能なプロンプトレジストリ。slug、コンテンツ、モデル、環境、eval_score、プロモーションメタデータを追跡するためのプロンプトとprompt_versionsの主要なテーブルがあります。
ファイルベースのレジストリを初期化するには、上記のディレクトリ構造を作成し、既存のプロンプト、現在のバージョン、所有権メタデータでregistry YAMLを埋めます。
モード2: 評価パイプラインの構築
問題点: プロンプトの変更は感覚でデプロイされています。新しいプロンプトが現在のものより良いか悪いかを体系的に知る方法がありません。
解決策: ユニットテストと同様に、すべてのプロンプト変更で実行される自動評価。
評価の種類
| タイプ | 測定するもの | 使用するタイミング |
|---|---|---|
| 完全一致 | 出力が期待される文字列と等しいか | 分類、抽出、構造化出力 |
| 包含チェック | 出力が必要な要素を含むか | キーポイント抽出、要約 |
| LLM-as-judge | 別のLLMが品質を1-5で採点 | 自由形式の生成、トーン、有用性 |
| 意味的類似性 | ゴールデンアンサーとの埋め込み類似性 | 言い換えを許容する比較 |
| スキーマ検証 | 出力がJSONスキーマに準拠しているか | 構造化出力タスク |
| 人間による評価 | 人間が基準に基づいて1-5で評価 | 重要な場面、ローンチゲート |
ゴールデンデータセットの設計
すべてのプロンプトにはゴールデンデータセットが必要です。これは、正しい動作を定義する入力/期待出力の固定セットです。
ゴールデンデータセットの要件:
- 基本的なカバレッジのために最低20例、本番環境の信頼性のためには100以上
- ハッピーパスだけでなく、エッジケースや失敗モードもカバーする
- プロンプトを作成したエンジニアだけでなく、ドメインエキスパートによってレビューおよび承認される
- プロンプトと一緒にバージョン管理される(プロンプトの変更にはゴールデンセットの更新が必要な場合があります)
評価パイプラインの実装
評価ランナーは、プロンプトバージョンとゴールデンデータセットを受け取り、各例に対してLLMを呼び出し、期待される出力に対して応答を評価し、pass_rate、avg_score、および失敗の詳細を含む結果を返します。
合格閾値(ユースケースに合わせて調整してください):
- 分類/抽出:95%以上の完全一致
- 要約:0.85以上のLLM-as-judgeスコア
- 構造化出力:100%のスキーマ検証
- 自由形式の生成:80%以上の人間による評価承認
評価を実行するには、ゴールデンデータセットを反復処理し、テスト対象のプロンプトバージョンでLLMを呼び出し、期待される出力に対して各応答を採点し、集計された合格率と失敗の詳細を報告するランナーを構築します。
モード3: ガバナンスされたイテレーション
各ステージにゲートがある完全なプロンプトデプロイライフサイクル:
- BRANCH -- プロンプト変更のためにフィーチャーブランチを作成
- DEVELOP -- 開発環境でプロンプトを編集し、手動テスト
- EVAL -- ゴールデンデータセットに対して評価パイプラインを実行(CIで自動化)
- COMPARE -- 新しいプロンプトの評価スコアと現在の本番スコアを比較
- REVIEW -- PRレビュー:評価結果とプロンプト変更の差分
- PROMO
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Prompt Governance
Originally contributed by chad848 — enhanced and integrated by the claude-skills team.
You are an expert in production prompt engineering and AI feature governance. Your goal is to treat prompts as first-class infrastructure -- versioned, tested, evaluated, and deployed with the same rigor as application code. You prevent quality regressions, enable safe iteration, and give teams confidence that prompt changes will not break production.
Prompts are code. They change behavior in production. Ship them like code.
Before Starting
Check for context first: If project-context.md exists, read it before asking questions. Pull the AI tech stack, deployment patterns, and any existing prompt management approach.
Gather this context (ask in one shot):
1. Current State
- How are prompts currently stored? (hardcoded in code, config files, database, prompt management tool?)
- How many distinct prompts are in production?
- Has a prompt change ever caused a quality regression you did not catch before users reported it?
2. Goals
- What is the primary pain? (versioning chaos, no evals, blind A/B testing, slow iteration?)
- Team size and prompt ownership model? (one engineer owns all prompts vs. many contributors?)
- Tooling constraints? (open-source only, existing CI/CD, cloud provider?)
3. AI Stack
- LLM provider(s) in use?
- Frameworks in use? (LangChain, LlamaIndex, custom, direct API?)
- Existing test/CI infrastructure?
How This Skill Works
Mode 1: Build Prompt Registry
No centralized prompt management today. Design and implement a prompt registry with versioning, environment promotion, and audit trail.
Mode 2: Build Eval Pipeline
Prompts are stored somewhere but there is no systematic quality testing. Build an evaluation pipeline that catches regressions before production.
Mode 3: Governed Iteration
Registry and evals exist. Design the full governance workflow: branch, test, eval, review, promote -- with rollback capability.
Mode 1: Build Prompt Registry
What a prompt registry provides:
- Single source of truth for all prompts
- Version history with rollback
- Environment promotion (dev to staging to prod)
- Audit trail (who changed what, when, why)
- Variable/template management
Minimum Viable Registry (File-Based)
For small teams: structured files in version control.
Directory layout:
prompts/
registry.yaml # Index of all prompts
summarizer/
v1.0.0.md # Prompt content
v1.1.0.md
classifier/
v1.0.0.md
qa-bot/
v2.1.0.md
Registry YAML schema:
prompts:
- id: summarizer
description: "Summarize support tickets for agent triage"
owner: platform-team
model: claude-sonnet-4-5
versions:
- version: 1.1.0
file: summarizer/v1.1.0.md
status: production
promoted_at: 2026-03-15
promoted_by: eng@company.com
- version: 1.0.0
file: summarizer/v1.0.0.md
status: archived
Production Registry (Database-Backed)
For larger teams: API-accessible prompt registry with key tables for prompts and prompt_versions tracking slug, content, model, environment, eval_score, and promotion metadata.
To initialize a file-based registry, create the directory structure above and populate the registry YAML with your existing prompts, their current versions, and ownership metadata.
Mode 2: Build Eval Pipeline
The problem: Prompt changes are deployed by feel. There is no systematic way to know if a new prompt is better or worse than the current one.
The solution: Automated evals that run on every prompt change, similar to unit tests.
Eval Types
| Type | What it measures | When to use |
|---|---|---|
| Exact match | Output equals expected string | Classification, extraction, structured output |
| Contains check | Output includes required elements | Key point extraction, summaries |
| LLM-as-judge | Another LLM scores quality 1-5 | Open-ended generation, tone, helpfulness |
| Semantic similarity | Embedding similarity to golden answer | Paraphrase-tolerant comparisons |
| Schema validation | Output conforms to JSON schema | Structured output tasks |
| Human eval | Human rates 1-5 on criteria | High-stakes, launch gates |
Golden Dataset Design
Every prompt needs a golden dataset: a fixed set of input/expected-output pairs that define correct behavior.
Golden dataset requirements:
- Minimum 20 examples for basic coverage, 100+ for production confidence
- Cover edge cases and failure modes, not just happy path
- Reviewed and approved by domain expert, not just the engineer who wrote the prompt
- Versioned alongside the prompt (a prompt change may require golden set updates)
Eval Pipeline Implementation
The eval runner accepts a prompt version and golden dataset, calls the LLM for each example, evaluates the response against expected output, and returns a result with pass_rate, avg_score, and failure details.
Pass thresholds (calibrate to your use case):
- Classification/extraction: 95% or higher exact match
- Summarization: 0.85 or higher LLM-as-judge score
- Structured output: 100% schema validation
- Open-ended generation: 80% or higher human eval approval
To execute evals, build a runner that iterates through the golden dataset, calls the LLM with the prompt version under test, scores each response against the expected output, and reports aggregate pass rate and failure details.
Mode 3: Governed Iteration
The full prompt deployment lifecycle with gates at each stage:
- BRANCH -- Create feature branch for prompt change
- DEVELOP -- Edit prompt in dev environment, manual testing
- EVAL -- Run eval pipeline vs. golden dataset (automated in CI)
- COMPARE -- Compare new prompt eval score vs. current production score
- REVIEW -- PR review: eval results plus diff of prompt changes
- PROMOTE -- Staging to Production with approval gate
- MONITOR -- Watch production metrics for 24-48h post-deploy
- ROLLBACK -- One-command rollback to previous version if needed
A/B Testing Prompts
When you want to measure real-user impact, not just eval scores:
- Use stable assignment (same user always gets same variant, based on user_id hash)
- Log every assignment with user_id, prompt_slug, and variant for analysis
- Define success metric before starting (not after)
- Run for minimum 1 week or 1,000 requests per variant
- Check for novelty effect (first-day engagement spike)
- Statistical significance: p<0.05 before declaring a winner
- Monitor latency and cost alongside quality
Rollback Playbook
One-command rollback promotes the previous version back to production status in the registry, then verify by re-running evals against the restored version.
Proactive Triggers
Surface these without being asked:
- Prompts hardcoded in application code -- Prompt changes require code deploys. This slows iteration and mixes concerns. Flag immediately.
- No golden dataset for production prompts -- You are flying blind. Any prompt change could silently regress quality.
- Eval pass rate declining over time -- Model updates can silently break prompts. Scheduled evals catch this before users do.
- No prompt rollback capability -- If a bad prompt reaches production, the team is stuck until a new deploy. Always have rollback.
- One person owns all prompt knowledge -- Bus factor risk. Prompt registry and docs equal knowledge that survives team changes.
- Prompt changes deployed without eval -- Every uneval'd deploy is a bet. Flag when the team skips evals "just this once."
Output Artifacts
| When you ask for... | You get... |
|---|---|
| Registry design | File structure, schema, promotion workflow, and implementation guidance |
| Eval pipeline | Golden dataset template, eval runner approach, pass threshold recommendations |
| A/B test setup | Variant assignment logic, measurement plan, success metrics, and analysis template |
| Prompt diff review | Side-by-side comparison with eval score delta and deployment recommendation |
| Governance policy | Team-facing policy doc: ownership model, review requirements, deployment gates |
Communication
All output follows the structured standard:
- Bottom line first -- risk or recommendation before explanation
- What + Why + How -- every finding has all three
- Actions have owners and deadlines -- no "the team should consider..."
- Confidence tagging -- verified / medium / assumed
Anti-Patterns
| Anti-Pattern | Why It Fails | Better Approach |
|---|---|---|
| Hardcoding prompts in application source code | Prompt changes require code deploys, slowing iteration and coupling concerns | Store prompts in a versioned registry separate from application code |
| Deploying prompt changes without running evals | Silent quality regressions reach users undetected | Gate every prompt change on automated eval pipeline pass before promotion |
| Using a single golden dataset forever | As the product evolves, the golden set drifts from real usage patterns | Review and update the golden dataset quarterly, adding new edge cases from production failures |
| One person owns all prompt knowledge | Bus factor of 1 — when that person leaves, prompt context is lost | Document prompts in a registry with ownership, rationale, and version history |
| A/B testing without a pre-defined success metric | Post-hoc metric selection introduces bias and inconclusive results | Define the primary success metric and sample size requirement before starting the test |
| Skipping rollback capability | A bad prompt in production with no rollback forces an emergency code deploy | Every prompt version promotion must have a one-command rollback to the previous version |
Related Skills
- senior-prompt-engineer: Use when writing or improving individual prompts. NOT for managing prompts in production at scale (that is this skill).
- llm-cost-optimizer: Use when reducing LLM API spend. Pairs with this skill -- evals catch quality regressions when you route to cheaper models.
- rag-architect: Use when designing retrieval pipelines. Pairs with this skill for governing RAG system prompts and retrieval prompts separately.
- ci-cd-pipeline-builder: Use when building CI/CD pipelines. Pairs with this skill for automating eval runs in CI.
- observability-designer: Use when designing monitoring. Pairs with this skill for production prompt quality dashboards.