Communityコーディング&開発github.com

評価

エージェントシステムの評価を構築する際に使用するスキルです。決定論的チェック、回帰テストスイート、多次元ルーブリック、品質ゲート、本番モニタリング、ベースライン比較、エージェントパイプラインの結果測定などをカバーします。

評価 とは?

このスキルは、従来のソフトウェアとは異なる方法でエージェントシステムを評価するためのフレームワークを提供します。エージェントの動的な意思決定、非決定的な動作、単一の正解が存在しないという特性に対応し、アウトカムベースの評価、多次元ルーブリックの設計、LLMジャッジと人間による評価の併用、決定論的バリデーションの優先など、実践的な手法を詳述しています。主にClaude Code、Codex、CursorなどのAIエージェントプラットフォームで開発されるシステムの品質保証に有用です。テストセットの設計から継続的な評価パイプラインの構築、生産モニタリングまでをカバーし、エージェントのパフォーマンスを体系的に測定・改善するための実装例(Pythonコード、YAML設定)も含んでいます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/tree/main/skills/evaluation

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

エージェントシステムの評価手法

エージェントシステムは、動的な意思決定を行い、実行間で非決定的であり、単一の正解を欠くことが多いため、従来のソフトウェアとは異なる方法で評価します。これらの特性を考慮し、実用的なフィードバックを提供し、回帰を見つけ、コンテキストエンジニアリングの選択が意図した効果を達成していることを検証する評価フレームワークを構築します。

アクティベートすべきタイミング

以下の場合にこのスキルをアクティベートします:

  • エージェントのパフォーマンスを体系的にテストする場合
  • コンテキストエンジニアリングの選択を検証する場合
  • 経時的な改善を測定する場合
  • デプロイ前に回帰を検出する場合
  • エージェントパイプラインの品質ゲートを構築する場合
  • 異なるエージェント設定を比較する場合
  • 本番システムを継続的に評価する場合

隣接する作業は他のスキルが担当するため、このスキルはアクティベートしないでください:

  • LLMジャッジ自体の設計、ペアワイズ比較、ジャッジのキャリブレーション、バイアス軽減:advanced-evaluation。
  • 自律制御サーフェス、新規性ゲート、ロールバック、PR承認境界の設計:harness-engineering。
  • 測定前の特定のコンテキスト障害モードのデバッグ:context-degradation。

コアコンセプト

エージェントは目標への有効な代替ルートを見つける可能性があるため、実行パスではなくアウトカムに焦点を当てて評価します。エージェントが特定の一連のステップに従ったかどうかではなく、適切なプロセスを通じて正しいアウトカムを達成したかどうかを判断します。

単一のスコアでは特定の次元における重大な障害が隠れてしまうため、単一スコアではなく多次元ルーブリックを使用します。事実の正確性、完全性、引用の正確性、ソースの品質、ツール効率を個別の次元として捉え、ユースケースに応じて重み付けします。

モデルによる評価は、決定論的チェックとルーブリックが安定した後にのみ使用します。作業の中心がジャッジプロンプト、ペアワイズ比較、キャリブレーション、バイアス軽減にある場合は、高度な評価に切り替えます。

成果物に機械でチェック可能な構造がある場合は、LLMによる判断の前に決定論的バリデーションを実行します。スキーマの妥当性、重複キー、ルーブリックの計算、マニフェストの同期、検索ステータス、必要なエビデンスパスは、評価者がトークンを消費したり主観的なスコアを返したりする前に、迅速に失敗する必要があります。

パフォーマンスドライバー

評価予算を設計する際には、ブラウジングエージェントの研究を適用します。トークン使用量、ツール呼び出し、モデルの選択が測定されるパフォーマンスのばらつきを支配する可能性があります(claim-evaluation-browsecomp-variance)。

要因説明される分散含意
トークン使用量主要なドライバーコストまたはコンテキスト品質が崩壊するまで、より多くの探索がパフォーマンスを向上させる可能性がある
ツール呼び出し数二次的なドライバーツールの使用が有効なエビデンスを取得する場合にのみ役立つ
モデルの選択二次的だが乗算的優れたモデルは、多くの場合トークンとツールをより効率的に使用する

評価を設計する際には、これらの含意に基づいて行動します:

  • 現実的なトークン予算を設定する:無制限のリソースではなく、本番環境に即したトークン制限でエージェントを評価します。
  • モデルアップグレードとトークン増加を比較する:優れたモデルは、より大きな予算を持つ弱いモデルよりもトークンを効率的に使用する可能性があります。
  • マルチエージェントアーキテクチャを検証する:追加のエージェントはトークンとツール呼び出しを追加します。シングルエージェントのベースラインと比較して評価します。

詳細トピック

評価の課題

非決定性と複数の有効パスへの対処

エージェントは目標に到達するためにまったく異なる有効なパスを取る可能性があるため、パスのばらつきを許容する評価を設計します。あるエージェントは3つのソースを検索する一方で、別のエージェントは10個を検索するかもしれません。どちらも正しい答えを生成する可能性があります。特定のステップをチェックすることは避けます。代わりに、アウトカム基準(正確性、完全性、品質)を定義し、それらに対してスコアを付け、実行パスは評価的ではなく情報として扱います。

コンテキスト依存の障害をテストする

エージェントの障害は、微妙な方法でコンテキストに依存することが多いため、複雑さのレベルと対話の長さにわたって評価します。エージェントは単純なクエリでは成功しても複雑なクエリでは失敗したり、あるツールセットではうまく機能しても別のツールセットでは機能しなかったり、コンテキストが蓄積されるにつれて拡張された対話の後にパフォーマンスが低下したりする可能性があります。これらのパターンを明らかにするために、単純、中程度、複雑、非常に複雑なテストケースを含めます。

複合品質次元を個別にスコアリングする

エージェントの品質を個別の次元(事実の正確性、完全性、首尾一貫性、ツール効率、プロセス品質)に分解し、各次元を独立してスコアリングします。なぜなら、エージェントは正確性では高スコアでも効率性では低スコアになる可能性があるからです。次に、ユースケースの優先順位に合わせて調整された加重平均を計算します。このアプローチにより、信号を平均化して見えなくするのではなく、どの次元を改善する必要があるかが明らかになります。

評価ルーブリックの設計

多次元ルーブリックの構築

主要な次元をカバーし、優れているから失敗までの記述レベルのルーブリックを定義します。以下のコア次元を含め、ユースケースごとに重みを調整します:

  • 事実の正確性:クレームがグラウンドトゥルースと一致する(知識タスクでは重く重み付け)
  • 完全性:出力が要求された側面をカバーする(研究タスクでは重く重み付け)
  • 引用の正確性:引用が主張されたソースと一致する(信頼が重要なコンテキストでは重み付け)
  • ソースの品質:適切な一次ソースを使用する(権威ある出力には重み付け)
  • ツール効率:適切なツールを妥当な回数使用する(コスト重視のシステムでは重み付け)

ルーブリックを数値スコアに変換する

次元の評価を数値スコア(0.0~1.0)にマッピングし、次元ごとの重みを適用し、加重全体スコアを計算します。ユースケースの要件に基づいて合格しきい値を設定します(通常は一般用途で0.7、ハイステークスアプリケーションで0.9)。個々の次元スコアを集約スコアとともに保存します。内訳がターゲットを絞った改善を促進するためです。

評価方法論

LLM-as-Judgeを大規模に使用する

LLMベースの評価プロンプトを構築します。これには以下を含めます:明確なタスクの説明、テスト対象のエージェント出力、利用可能な場合はグラウンドトゥルース、明示的なレベル説明を含む評価尺度、および推論を含む構造化された判断の要求。LLMジャッジは、大規模なテストセットに対して一貫性のあるスケーラブルな評価を提供します。自己強化バイアスを回避するために、評価対象のエージェントとは異なるモデルファミリーを使用します。

人間による評価で補完する

エッジケース、異常なクエリ、および本番トラフィックのランダムサンプルを人間のレビューアにルーティングします。人間は、自動評価が見逃す幻覚的な回答、システム障害、微妙なバイアスに気付くためです。人間のレビュー全体のパターンを追跡して体系的な問題を特定し、そのフィードバックを自動評価基準にフィードバックします。

ステートフルエージェントのための最終状態評価を適用する

永続的な状態(ファイル、データベース、設定)を変更するエージェントの場合、エージェントがどのようにそこに到達したかではなく、最終状態が期待と一致するかどうかを評価します。期待される最終状態アサーションを定義し、各テスト実行後にプログラムで検証します。

テストセットの設計

代表的なサンプルを選択する

初期開発時は、変更が劇的な影響を及ぼし、すぐに改善できる点が多いため、小さなサンプル(20~30ケース)から始めます。システムが成熟するにつれて、信頼性の高い信号を得るために50ケース以上に拡大します。実際の使用パターンからサンプリングし、既知のエッジケースを追加し、複雑さのレベル全体にわたるカバレッジを確保します。

複雑さで層別化する

簡単な例がスコアを不当に引き上げないように、複雑さのレベル全体にテストセットを構成します:

  • 単純:単一のツール呼び出し、事実の検索
  • 中程度:複数のツール呼び出し、比較ロジック
  • 複雑:多数のツール呼び出し、かなりのあいまいさ
  • 非常に複雑:拡張された対話、深い推論、合成

全体的なスコアとともに層ごとのスコアを報告し、エージェントが実際にどこで苦戦しているかを明らかにします。

コンテキストエンジニアリングの評価

コンテキスト戦略を体系的に検証する

同じテストセット上で異なるコンテキスト戦略を持つエージェントを実行し、品質スコア、トークン使用量、効率メトリクスを比較します。これにより、コンテキストエンジニアリングの影響を他の変数から分離し、逸話に基づく決定を防ぎます。

劣化テストを実行する

異なるコンテキストサイズでエージェントを実行することにより、コンテキストの劣化がパフォーマンスにどのように影響するかをテストします。コンテキストが問題になるパフォーマンスの崖を特定し、安全な動作限界を確立します。これらの限界をコンテキスト管理戦略にフィードバックします。

継続的評価

自動評価パイプラインを構築する

エージェントの変更時に評価が自動的に実行されるように、評価を開発ワークフローに統合します。結果を経時的に追跡し、バージョンを比較し、主要なメトリクスで後退するデプロイメントをブロックします。

本番品質を監視する

本番インタラクションをサンプリングし、継続的に評価します。品質が警告(合格率0.85)およびクリティカル(合格率0.70)のしきい値を下回った場合にアラートを設定します。時間枠にわたるトレンド分析を示すダッシュボードを維持し、緩やかな劣化を検出します。

実践的なガイダンス

評価フレームワークの構築

以下の順序に従って評価フレームワークを構築します。初期のステップをスキップすると、実際の品質を反映しない測定値になります。

  1. 評価コードを書く前に、ユースケースに関連する品質次元を定義します。後で選択される次元は、重要なものではなく、測定しやすいものを反映する傾向があるためです。
  2. 評価者(人間またはLLM)が一貫したスコアを生成できるように、明確で説明的なレベル定義を持つルーブリックを作成します。
  3. 実際の使用パターンとエッジケースからテストセットを構築し、複雑さで層別化し、信頼性の高い信号を得るために少なくとも50ケースを含めます。
  4. すべての重要な変更時に実行される自動評価パイプラインを実装します。
  5. 変更を行う前にベースラインメトリクスを確立し、既知のリファレンスに対して改善を測定できるようにします。
  6. すべての重要な変更に対して評価を実行し、ベースラインと比較します。
  7. 経時的なメトリクスをトレンド分析のために追跡します。緩やかな劣化は急激な低下よりも気付きにくいためです。
  8. 自動評価を定期的な人間によるレビューで補完します。
  9. 決定論的バリデーションの失敗と品質判断を分離し、無効な成果物が有利なLLMスコアによって不正に通過できないようにします。

評価の落とし穴を回避する

評価の信頼性を損なう一般的な失敗から保護します:

  • 特定のパスへのオーバーフィッティング:特定のステップではなくアウトカムを評価します。エージェントは新しい有効なパスを見つけるためです。
  • エッジケースの無視:複雑さの全スペクトラムをカバーする多様なテストシナリオを含めます。
  • 単一メトリクスへの固執:単一のスコアは次元固有の障害を隠すため、多次元ルーブリックを使用します。
  • コンテキスト効果の軽視:クリーンルーム条件ではなく、現実的なコンテキストサイズと履歴でテストします。
  • 人間による評価のスキップ:自動評価は、人間が確実にキャッチする微妙な問題を見逃します。

例

例1:単純な評価

def evaluate_agent_response(response, expected):
    rubric = load_rubric()
    scores = {}
    for dimension, config in rubric.items():
        scores[dimension] = assess_dimension(response, expected, dimension)
    overall = weighted_average(scores, config["weights"])
    return {"passed": overall >= 0.7, "scores": scores}

例2:テストセットの構造

包括的な評価を確実にするために、テストセットは複数の複雑さレベルにまたがる必要があります:

test_set = [
    {
        "name": "simple_lookup",
        "input": "What is the capital of France?",
        "expected": {"type": "fact", "answer": "Paris"},
        "complexity": "simple",
        "description": "Single tool call, factual lookup"
    },
    {
        "name": "medium_query",
        "input": "Compare the revenue of Apple and Microsoft last quarter",
        "complexity": "medium",
        "description": "Multiple tool calls, comparison logic"
    },
    {
        "name": "multi_step_reasoning",
        "input": "Analyze sales data from Q1-Q4 and create a summary report with trends",
        "complexity": "complex",
        "description": "Many tool calls, aggregation, analysis"
    },
    {
        "name": "research_synthesis",
        "input": "Research emerging AI technologies, evaluate their potential impact, and recommend adoption strategy",
        "complexity": "very_complex",
        "description": "Extended interaction, deep reasoning, synthesis"
    }
]

例3:モデル判断前の決定論的ゲート

def evaluate_pr_candidate(candidate):
    structure = run_validate_repo(candidate)
    if not structure.ok:
        return {"passed": False, "reason": "deterministic validation failed", "details": structure.errors}

    quality = run_rubric_eval(candidate)
    return {"passed": quality.overall >= 0.8, "scores": quality.dimensions}

例4:品質ゲートの次元

gate:
  deterministic:
    - schema_valid
    - required_files_present
    - no_duplicate_ids
  quality:
    factual_accuracy: min 0.85
    completeness: min 0.80
    source_traceability: min 0.90

ガイドライン

  1. 単一メトリクスではなく、多次元ルーブリックを使用する
  2. 特定の実行パスではなく、アウトカムを評価する
  3. 単純から複雑までの複雑さレベルをカバーする
  4. 現実的なコンテキストサイズと履歴でテストする
  5. リリース前だけでなく、継続的に評価を実行する
  6. LLM評価を人間によるレビューで補完する
  7. トレンド検出のために経時的にメトリクスを追跡する
  8. ユースケースに基づいて明確な合格/不合格のしきい値を設定する

注意点

  1. 特定のコードパスへの評価のオーバーフィッティング:テストは合格するが、エージェントはわずかな入力のバリエーションで失敗します。表面上のパターンではなく、アウトカムとセマンティクスに対して評価基準を記述し、定期的にテスト入力をローテーションします。
  2. LLMジャッジの自己強化バイアス:モデルは独立したジャッジよりも自身の出力を高く評価します。評価対象のモデルとは異なるモデルファミリーを評価ジャッジとして使用します。
  3. テストセットの汚染:評価例がトレーニングデータやプロンプトテンプレートに漏れ込み、スコアを水増しします。評価セットをバージョン管理し、プロンプトやファインチューニングで使用されるデータから分離して保持します。
  4. メトリクスのゲーミング:測定されているメトリクスの最適化は、実際の品質を向上させずに行われる可能性があります。これに対抗するために、評価基準の定期的な監査とローテーションを実施します。

[truncated for translation]

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

advanced-evaluation

This skill should be used for advanced LLM evaluation: LLM-as-judge systems, direct scoring, pairwise comparison, rubric calibration, evaluator bias mitigation, confidence scoring, and automated quality assessment.

bdi-mental-states

This skill should be used when modeling agent mental states with BDI concepts: beliefs, desires, intentions, RDF-to-belief transformations, rational agency traces, cognitive agents, BDI ontologies, and neuro-symbolic AI integration.

book-sft-pipeline

This skill should be used for book-to-SFT pipelines: ePub extraction, literary segmentation, author-voice dataset construction, style-transfer training, LoRA workflows, and model evaluation for voice replication.

comprehensive-research-agent

Ensure thorough validation, error recovery, and transparent reasoning in research tasks with multiple tool calls

context-compression

This skill should be used when long-running agent sessions need context compression, structured summarization, compaction, token-per-task optimization, or durable handoff summaries that preserve decisions, files, risks, and next actions.

context-degradation

This skill should be used for diagnosing and mitigating context degradation: lost-in-middle failures, context poisoning, context clash, context confusion, attention-pattern issues, and agent performance degradation caused by accumulated or conflicting context.

context-fundamentals

This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how attention mechanics work, the U-shaped attention curve, why context quality matters more than quantity, and the mental models needed to interpret every other context-engineering decision. Use this for conceptual explanation, onboarding, and background reading. Route operational work to the specialized skills: debugging attention failures goes to context-degradation, token-efficiency work goes to context-optimization, conversation summarization goes to context-compression, and project-shape decisions go to project-development.

context-optimization

This skill should be used for improving context efficiency: context budgeting, observation masking, prefix or KV-cache strategy, partitioning, token-cost reduction, retrieval scoping, and extending effective context capacity without lowering answer quality.

filesystem-context

This skill should be used when agent work needs file-backed context: durable scratchpads, tool-output offloading, just-in-time discovery, cross-agent handoff files, filesystem memory, or cleanup policies for context stored outside the prompt.

harness-engineering

This skill should be used when designing autonomous agent harnesses: research loops, evaluation scaffolds, locked and editable surfaces, durable logs, novelty gates, pruning, rollback, PR preparation, and human approval boundaries.

hosted-agents

This skill should be used when designing hosted or background agent infrastructure: sandboxed execution, remote coding environments, warm pools, session persistence, multiplayer collaboration, self-spawning agents, or Modal-style sandboxes.

latent-briefing

This skill should be used when the user asks to "share memory between agents", "KV cache compaction for multi-agent", "orchestrator worker context", "latent briefing", "reduce worker tokens", "cross-agent memory without summarization", or discusses Attention Matching compaction, recursive language models with workers, or token explosion in hierarchical agents.

long-horizon-prompting

This skill should be used when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration attacking a hard problem: pseudo-formal task briefs that define terms and an exact success predicate linguistically, enumerate non-counting outcomes, set persistence rules with explicit stop and return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry and blocked-route bookkeeping, and gate the return on adversarial audit. Route agent topology and coordination protocols to multi-agent-patterns, runtime control surfaces and loop governance to harness-engineering, evaluator and quality-gate construction to evaluation, judge design to advanced-evaluation, and compaction or memory mechanics to context-compression and memory-systems.

memory-systems

This skill should be used for persistent semantic memory in agent systems: cross-session knowledge retention, entity tracking, temporal validity, graph or vector retrieval, memory consolidation, and memory benchmark selection. Route file-backed scratchpads to filesystem-context, handoff summaries to context-compression, and token-efficiency tactics to context-optimization.

multi-agent-patterns

This skill should be used when designing multi-agent systems that need context isolation, supervisor or swarm coordination, explicit handoffs, parallel execution, or a decision on whether multiple agents are justified.

project-development

This skill should be used for project-level decisions about LLM-powered systems: whether an LLM is the right primitive for the task at hand, the shape of a multi-stage batch or agent pipeline, token and cost estimation, choosing between single-agent and multi-agent at the project level, structured output design for downstream parsing, and structuring agent-assisted iteration. Use this when the unit of work is a whole project or a multi-stage pipeline. Route individual tool design to tool-design and individual skill-loading or context-budget tactics to context-optimization.

self-improvement-loops

This skill should be used when the harness, scaffold, workflow, or optimizer itself is the optimization target: recursive self-improvement (RSI) loops, meta-harnesses, self-improving harnesses that mine their own failures and propose bounded edits, evolutionary or population-based search over agent scaffolds, acceptance gates for self-modifying systems, and agentic context evolution where the mechanism that produces context is versioned and evolved. Route governance of a single autonomous loop (locked surfaces, durable logs, rollback, novelty gates, approval boundaries) to harness-engineering, measurement and quality-gate design to evaluation, judge design to advanced-evaluation, and remote sandbox infrastructure to hosted-agents.

self-managed-context

This skill should be used when a model gets read-write control over its own live context window instead of a harness-scheduled compaction policy: the context exposed as an editable file the model rewrites with code tools, model-driven eviction and in-place updates, the harness invariants that keep self-editing safe (pinned prefix, edit gate, edit receipts, budget readouts, rollback on overflow), the prefix-cache cost of mid-context edits, and steering or training the model's own context-editing strategy. Route note content and fixed-threshold summarization to context-compression, cache-stable layout under harness control to context-optimization, file offloading to filesystem-context, and loop governance to self-improvement-loops.

tool-design

This skill should be used for the tool-interface layer of an agent system specifically: writing tool descriptions agents can route on, designing tool schemas and response formats, naming conventions, actionable error recovery messages, MCP server design, tool-set consolidation, and deciding when to add or remove an individual tool. Use this when the unit of work is a single tool or a set of tools. Route project-shape, pipeline architecture, and task-model-fit decisions to project-development; route deciding whether to introduce sub-agents to multi-agent-patterns.

関連スキル