Communitygithub.com

agent-eval

可比較多個程式碼代理(如 Claude Code、Aider、Codex 等)在自訂任務上的表現,提供通過率、成本、時間與一致性等量化指標。適合在選擇代理或調整代理設定時,追求客觀數據而非主觀感受時使用。

agent-eval 是什麼?

Agent Eval Skill 是一款輕量級 CLI 工具,專為在可重現的程式碼任務上進行頭對頭(head-to-head)的編碼代理比較而設計。它透過 YAML 定義任務、使用 Git Worktree 進行環境隔離,並收集通過率、API 成本、執行時間與多次運行的一致性等關鍵指標,幫助開發團隊從主觀感受轉向數據驅動的代理選擇。此工具支援 Claude Code、Aider、Codex 等多種熱門編碼代理,並提供多種評判類型,包括基於 pytest 或 npm build 的確定性檢查、grep 模式比對,以及 LLM 作為評審的彈性評估。使用者需要先從其 GitHub 倉庫安裝(不支援 npm 或 pip 直接安裝),然後建立任務 YAML 檔案、執行代理比較,最後產生表格化報告。最佳實踐建議從 3-5 個真實工作負載任務開始,每個代理至少運行 3 次以掌握變異性,並將任務定義視為測試代碼進行版本管理。

相容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/agent-eval

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Agent Eval Skill

一個輕量級 CLI 工具,用於在可重現的任務上對編碼代理進行頭對頭比較。每個「哪個編碼代理最好?」的比較都依賴主觀感覺——這款工具將其系統化。

何時啟用

  • 在你的程式碼庫上比較編碼代理(Claude Code、Aider、Codex 等)
  • 在採用新工具或模型前,衡量代理效能
  • 當代理更新模型或工具時,執行回歸檢查
  • 為團隊提供數據支持的代理選擇決策

安裝

注意: 請在檢視原始碼後,從其倉庫安裝 agent-eval。

核心概念

YAML 任務定義

宣告式定義任務。每個任務指定要做什麼、要觸及哪些檔案,以及如何判斷成功:

name: add-retry-logic
description: 為 HTTP 客戶端加入指數退避重試邏輯
repo: ./my-project
files:
  - src/http_client.py
prompt: |
  為所有 HTTP 請求加入指數退避重試邏輯。
  最多重試 3 次。初始延遲 1 秒,最大延遲 30 秒。
judge:
  - type: pytest
    command: pytest tests/test_http_client.py -v
  - type: grep
    pattern: "exponential_backoff|retry"
    files: src/http_client.py
commit: "abc1234"  # 鎖定特定提交以確保可重現性

Git Worktree 隔離

每個代理執行都會獲得自己的 Git Worktree——不需要 Docker。這提供了可重現的隔離性,使代理之間無法互相干擾或破壞基礎倉庫。

收集的指標

指標測量內容
通過率代理產生的程式碼是否通過評判?
成本每個任務的 API 花費(若有)
時間完成任務的實際秒數
一致性多次運行中的通過率(如 3/3 = 100%)

工作流程

1. 定義任務

建立一個 tasks/ 目錄,內含 YAML 檔案,每個檔案一個任務:

mkdir tasks
# 撰寫任務定義(參見上方範本)

2. 執行代理

針對你的任務執行代理:

agent-eval run --task tasks/add-retry-logic.yaml --agent claude-code --agent aider --runs 3

每次執行:

  1. 從指定的提交建立一個全新的 Git Worktree
  2. 將提示傳遞給代理
  3. 執行評判標準
  4. 記錄通過/失敗、成本和時間

3. 比較結果

生成比較報告:

agent-eval report --format table
任務:add-retry-logic(每個代理執行 3 次)
┌──────────────┬───────────┬────────┬────────┬─────────────┐
│ 代理         │ 通過率    │ 成本   │ 時間   │ 一致性      │
├──────────────┼───────────┼────────┼────────┼─────────────┤
│ claude-code  │ 3/3       │ $0.12  │ 45s    │ 100%        │
│ aider        │ 2/3       │ $0.08  │ 38s    │  67%        │
└──────────────┴───────────┴────────┴────────┴─────────────┘

評判類型

程式碼型(確定性)

judge:
  - type: pytest
    command: pytest tests/ -v
  - type: command
    command: npm run build

模式比對型

judge:
  - type: grep
    pattern: "class.*Retry"
    files: src/**/*.py

模型型(LLM 作為評審)

judge:
  - type: llm
    prompt: |
      這個實作是否正確處理了指數退避?
      檢查:最大重試次數、遞增延遲、抖動。

最佳實踐

  • 從 3-5 個任務開始,這些任務應代表你的真實工作負載,而非玩具範例
  • 每個代理至少執行 3 次試驗 以掌握變異性——代理是非確定性的
  • 在任務 YAML 中鎖定提交,使結果在數天/數週內可重現
  • 每個任務至少包含一個確定性評判(測試、建置)——LLM 評判會引入雜訊
  • 同時追蹤成本與通過率——一個花費 10 倍成本但達到 95% 通過率的代理可能不是最佳選擇
  • 對你的任務定義進行版本管理——它們是測試裝置,應視為程式碼對待

連結

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/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

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-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.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

api-connector-builder

Build a new API connector or provider by matching the target repo

相關技能