Communitygithub.com

agent-self-evaluation

複雑なタスク完了後、エージェントが自身の出力を5軸(正確性、完全性、明確性、実行可能性、簡潔性)で自己評価します。具体的な証拠に基づいた1〜5のスコアカードと改善提案を生成します。

agent-self-evaluation とは?

このスキルは、AIエージェント(Claude Code、Cursor、Codexなど)が非自明なタスクを完了した後、自身の出力を構造化された5軸ルーブリックで評価するためのものです。合格/不合格のゲートではなく、意図的な内省ステップとして機能し、欠落や過信を見つけ出し、ユーザーが指摘する前に改善点を表面化します。具体的には、3ファイル以上・50行以上のコード作成、マルチステップワークフローの完了、3回以上の試行を要したデバッグ、設計ドキュメントの作成などの状況で起動します。各軸に対して1〜5のスコアを割り当て、4以下のスコアには具体的な根拠を明示する「エビデンスルール」に従います。最終的に、5軸の平均スコアと1〜3の具体的な改善点を含む評価レポートを生成し、スコアが3以下の軸があれば即座に修正可能なものは修正し、そうでなければ再実行による改善見込みを明示します。このスキルは自己満足的な評価を防ぎ、客観的な自己改善を促進します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/agent-self-evaluation

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

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

ドキュメント

エージェント自己評価

複雑なタスクを完了した後、エージェントは一時停止し、構造化された5軸の評価基準に基づいて自身の出力を評価します。これは合格/不合格のゲートではありません。ユーザーが指摘する前に、見落としを発見し、過信にフラグを立て、改善点を明らかにするための意図的な内省ステップです。

有効化のタイミング

  • 3ファイル以上、または50行以上にわたるコードを記述した後
  • マルチステップのワークフロー(実装 → テスト → レビュー)を完了した後
  • 3回以上の試行を伴うデバッグセッションの後
  • 設計ドキュメント、アーキテクチャ上の決定、または文章による分析を作成した後
  • ユーザーが「それはどれくらい良かった?」や「自分を評価して」と尋ねたとき
  • 任意のセッションのStopフックの終了時(設定されている場合。references/hook-integration.mdを参照)

コアコンセプト

5つの評価軸

軸質問捕捉する内容
正確性事実、主張、出力は正しいか?幻覚、間違ったAPI名、誤った構文、虚偽の記述
完全性ユーザーが依頼したすべてを網羅しているか?見落とされたエッジケース、未処理のエラーパス、忘れられた要件、スキップされたサブタスク
明確性説明は理解しやすく、構造化されているか?わかりにくい説明、定義なしの専門用語、不足しているコンテキスト、とりとめのない話
実行可能性ユーザーは出力に基づいてすぐに行動できるか?曖昧な提案、不足している手順、「あなたはXすべき」という方法の提示なし、検証パスがない
簡潔性必要最小限の単語/トークンを使用したか?冗長性、過剰説明、ユーザーの質問を逐語的に繰り返す、不要なコンテンツ

スコアリングスケール

5 — 卓越: 合理的な改善の余地なし
4 — 良好: 軽微な些細な点のみ、実質的な欠陥なし
3 — 妥当: リクエストを満たしているが、少なくとも1つの軸で顕著な弱点あり
2 — 弱い: ユーザビリティや正確性に影響を与える明確な欠陥がある
1 — 不良: リクエストを根本的に満たしていない、または重大なエラーを含む

エビデンスルール

5未満のスコアには、特定のエビデンスを必ず引用する必要があります。スコア3の場合、「改善の余地あり」と言うだけでは不十分です。何が不足しているか、何が間違っているかを正確に述べなければなりません。モットーは次のとおりです。「ギャップを示せ。名前を挙げるだけではダメだ。」

ワークフロー

ステップ1: 原材料を収集する

評価するものを集めます。

- 元のユーザーリクエスト(会話から読み返す)
- 最終的な応答/出力(成果物)
- 正確性を検証するツールの出力(テスト結果、終了コード、lint出力)
- タスク中に受け取ったユーザーフィードバック(訂正、「やり直し」、「それは間違っている」など)

ステップ2: 各軸を独立してスコアリングする

5つの軸を1つずつ処理します。各軸について:

  1. 軸の質問を読む
  2. 出力内のエビデンス(またはエビデンスの欠如)を見つける
  3. 1〜5のスコアを割り当てる
  4. スコアが5未満の場合、ギャップを引用した1文の改善ノートを書く

先に頭の中でスコアを平均してから逆算しないでください。各軸を新しい気持ちでスコアリングしてください。

ステップ3: 評価レポートを作成する

templates/evaluation-report.mdのテンプレートを使用します。レポートには以下を含める必要があります。

- 1行の要約
- 5軸のスコアカード(軸ごとのスコア+エビデンス)
- 全体スコア(単純平均、小数点第1位に四捨五入)
- 影響度順にランク付けされた1〜3の具体的な改善点
- 自己チェック:「ユーザーはこの評価に同意するだろうか?」

ステップ4: 改善を適用する

いずれかの軸が3以下の場合:

  1. 何を異なる方法で行うかを述べる
  2. ギャップが30秒未満で修正可能な場合(リンク切れ、不明瞭な表現など)、今すぐ修正する
  3. ギャップに手直しが必要な場合、明示的にフラグを立てる:「この軸は[理由]のため[スコア]でした。[具体的な修正]で再実行すれば、おそらく[スコア]に上がるでしょう。」

コード例

例: 良い評価(スコア4+)

タスク: HTTPクライアントにリトライロジックを追加

スコアカード:
  正確性:    5 — すべてのAPI呼び出しが正しい。確認済み: リトライは
                  指数バックオフを使用。幻覚的なメソッドはなし。
  完全性: 4 — ハッピーパス + 3つのエラーケースをカバー。不足:
                  ハングした接続のタイムアウト処理。
  明確性:      5 — コードコメントがバックオフの計算式を説明。
                  PR説明がこの動機となったインシデントにリンク。
  実行可能性:5 — 単一マージ。フォローアップタスクなし。テスト合格。
  簡潔性:  4 — 合計47行。リトライループをヘルパーに抽出して
                  約8行削減できる。

全体: 4.6 — 1つのギャップ(タイムアウト処理)。マージ前に修正。

例: 弱い評価(スコア2-3)

タスク: HTTPクライアントにリトライロジックを追加

スコアカード:
  正確性:    2 — urllib3を使用したが、これは当社の
                  httpxベースのコードベースと一致しない。間違ったライブラリ。
  完全性: 3 — GETでは動作。POST/PUTは未処理(ユーザーは
                  「すべてのHTTPリクエスト」と述べた)。
  明確性:      4 — コードは読みやすい。適切な変数名。
  実行可能性:2 — 「テストを追加」と述べたが、テストファイルは作成されていない。
                  ユーザーはマージ前にテストを書く必要がある。
  簡潔性:  3 — 120行。リトライ設定が1つの共有RetryConfigオブジェクトではなく
                  3か所で重複している。

全体: 2.8 — 間違ったライブラリを使用。httpxでの書き直しが必要。
  まず正確性を修正(httpxに切り替え)、次にすべてのHTTPメソッドに
  拡張し、その後設定を統合する。

アンチパターン

「すべてが5」

失敗: 正確性:    5 — すべて良好。
   完全性: 5 — すべて網羅。
   明確性:      5 — 明確。

エビデンスが引用されていない。これは自己満足であり、評価ではありません。本当の5には、改善すべき点がないことを証明する必要があります。

スコープクリープに対する過度の減点

失敗: 完全性: 2 — WebSocket接続や
   gRPCストリーミングを処理しなかった(ユーザーはこれらを要求していない)

追加で構築できたかもしれないものではなく、ユーザーが実際に要求したものにのみ照らして評価します。

評価を使用した再論議

失敗: 「前に言ったように、このアプローチは間違っています。スコア: 1」

評価は提供された出力に関するものであり、すでに行われた設計上の決定を再議論することではありません。アプローチが間違っていた場合、それは納品前に把握されるべきでした。

個人的な好みと客観的な欠陥の混同

失敗: 「スコア: 3。Pythonデコレータが好きではありません。」

「好きではない」はエビデンスではありません。具体的な可読性、テスタビリティ、または正確性の懸念を引用するか、スコアを4+のままにしてください。

ベストプラクティス

  • プロセスではなく、出力を評価する。 ユーザーが気にするのは、あなたが何回のイテレーションを踏んだかではなく、何を提供したかです。
  • 弱い軸につき1つの改善点。 1つの軸に5つのことを列挙しないでください。最も影響の大きいギャップを選んでください。
  • 改善点をユーザーへの影響に関連付ける。 「エラー処理がないと、ユーザーのAPI呼び出しが静かにクラッシュする」は「エラー処理を追加する」よりも優れています。
  • 「修正された」状態を具体的に示す。 「リトライ用に設定されたhttpxトランスポートで再実行する」は「ライブラリの問題を修正する」よりも優れています。
  • ツールの出力をエビデンスとして使用する。 テストが合格したなら、それを引用してください。lintがクリーンなら、それを引用してください。推測しないでください。証明をgrepしてください。
  • ギャップが見つからない場合は、もっと努力する。 5つの軸すべてで完璧なスコアを得ることは稀です。自問してください:「もし自分がユーザーだったら、この出力のどこにイライラするだろうか?」

関連スキル

  • agent-eval — ベンチマークタスクにおける異なるコーディングエージェントの直接比較
  • verification-loop — 期待される結果に対する出力の体系的な検証
  • security-review — セキュリティに焦点を当てたコードレビューチェックリスト

Individual skills in this repo

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

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

関連スキル