agent-eval
affaan-m/ECC
針對可重複執行的任務,以通過率、成本、時間及一致性等指標,對編碼工具進行直接比較。
...展開全部代理評估技能
一款輕量級的命令列工具,用於在可重現的任務上對編碼代理進行一對一比較。每項「哪個編碼代理最優秀?」的比較都是在 vibes 上執行的——本工具將其系統化。
何時啟用
- 在您的自有程式碼庫上比較程式碼生成代理程式(Claude Code、Aider、Codex 等)
- 在採用新工具或模型前,評估代理程式效能
- 當代理程式更新其模型或工具時執行回歸測試
- 為團隊提供基於數據的代理選型決策
安裝
注意:請在審閱原始碼後,從其儲存庫安裝 agent-eval。
核心概念
YAML 任務定義
以聲明式方式定義任務。每個任務皆需指定執行內容、涉及的檔案,以及成功與否的判斷標準:
name: add-retry-logic
description: Add exponential backoff retry to the HTTP client
repo: ./my-project
files:
- src/http_client.py
prompt: |
Add retry logic with exponential backoff to all HTTP requests.
Max 3 retries. Initial delay 1s, max delay 30s.
judge:
- type: pytest
command: pytest tests/test_http_client.py -v
- type: grep
pattern: "exponential_backoff|retry"
files: src/http_client.py
commit: "abc1234" # pin to specific commit for reproducibility
Git 工作樹隔離
每次代理執行皆擁有專屬的 Git 工作樹——無需 Docker。此設計提供可重現性的隔離機制,確保各代理不會相互干擾,亦不會損毀基礎儲存庫。
收集的指標
| 指標 | 測量項目 |
|---|---|
| 通過率 | 代理程式產生的程式碼是否通過評分系統的檢驗? |
| 成本 | 每項任務的 API 消耗(如有) |
| 時間 | 完成任務所需的實際秒數 |
| 一致性 | 重複執行時的通過率(例如:3/3 = 100%) |
工作流程
1. 定義任務
建立一個 tasks/ 包含 YAML 檔案的目錄,每個任務一個檔案:
mkdir tasks
# Write task definitions (see template above)
2. 執行代理程式
針對您的任務執行代理程式:
agent-eval run --task tasks/add-retry-logic.yaml --agent claude-code --agent aider --runs 3
每次執行時:
- 從指定的提交建立一個全新的 Git 工作樹
- 將提示符交給代理程式
- 執行評分標準
- 記錄通過/失敗、成本及耗時
3. 比較結果
產生比較報告:
agent-eval report --format table
Task: add-retry-logic (3 runs each)
┌──────────────┬───────────┬────────┬────────┬─────────────┐
│ Agent │ Pass Rate │ Cost │ Time │ Consistency │
├──────────────┼───────────┼────────┼────────┼─────────────┤
│ 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
模型導向(以大型語言模型作為評審)
judge:
- type: llm
prompt: |
Does this implementation correctly handle exponential backoff?
Check for: max retries, increasing delays, jitter.
最佳實務
- 從 3 至 5 個能代表實際工作負載的任務開始,而非簡單示例
- 針對每個代理執行至少 3 次試驗以捕捉變異性 — 代理的運作是非確定性的
- 在任務的 YAML 檔案中固定提交版本,以確保結果在數天/數週內可重現
- 每個任務應包含至少一個確定性評分器(測試、建置)—— LLM 評分器會增加雜訊
- 同時追蹤成本與通過率 — 成本高出 10 倍但通過率達 95% 的代理程式,未必是正確的選擇
- 為任務定義建立版本控制 — 它們是測試固定裝置,請將其視為程式碼
連結
- 儲存庫:github.com/joaquinhuigomez/agent-eval
---
name: agent-eval
description: Compare coding agents head-to-head on reproducible tasks with pass rate, cost, time, and consistency metrics.
---
# Agent Eval Skill
A lightweight CLI tool for comparing coding agents head-to-head on reproducible tasks. Every "which coding agent is best?" comparison runs on vibes — this tool systematizes it.
## When to Activate
- Comparing coding agents (Claude Code, Aider, Codex, etc.) on your own codebase
- Measuring agent performance before adopting a new tool or model
- Running regression checks when an agent updates its model or tooling
- Producing data-backed agent selection decisions for a team
## Installation
> **Note:** Install agent-eval from its repository after reviewing the source.
## Core Concepts
### YAML Task Definitions
Define tasks declaratively. Each task specifies what to do, which files to touch, and how to judge success:
```yaml
name: add-retry-logic
description: Add exponential backoff retry to the HTTP client
repo: ./my-project
files:
- src/http_client.py
prompt: |
Add retry logic with exponential backoff to all HTTP requests.
Max 3 retries. Initial delay 1s, max delay 30s.
judge:
- type: pytest
command: pytest tests/test_http_client.py -v
- type: grep
pattern: "exponential_backoff|retry"
files: src/http_client.py
commit: "abc1234" # pin to specific commit for reproducibility
```
### Git Worktree Isolation
Each agent run gets its own git worktree — no Docker required. This provides reproducibility isolation so agents cannot interfere with each other or corrupt the base repo.
### Metrics Collected
| Metric | What It Measures |
|--------|-----------------|
| Pass rate | Did the agent produce code that passes the judge? |
| Cost | API spend per task (when available) |
| Time | Wall-clock seconds to completion |
| Consistency | Pass rate across repeated runs (e.g., 3/3 = 100%) |
## Workflow
### 1. Define Tasks
Create a `tasks/` directory with YAML files, one per task:
```bash
mkdir tasks
# Write task definitions (see template above)
```
### 2. Run Agents
Execute agents against your tasks:
```bash
agent-eval run --task tasks/add-retry-logic.yaml --agent claude-code --agent aider --runs 3
```
Each run:
1. Creates a fresh git worktree from the specified commit
2. Hands the prompt to the agent
3. Runs the judge criteria
4. Records pass/fail, cost, and time
### 3. Compare Results
Generate a comparison report:
```bash
agent-eval report --format table
```
```
Task: add-retry-logic (3 runs each)
┌──────────────┬───────────┬────────┬────────┬─────────────┐
│ Agent │ Pass Rate │ Cost │ Time │ Consistency │
├──────────────┼───────────┼────────┼────────┼─────────────┤
│ claude-code │ 3/3 │ $0.12 │ 45s │ 100% │
│ aider │ 2/3 │ $0.08 │ 38s │ 67% │
└──────────────┴───────────┴────────┴────────┴─────────────┘
```
## Judge Types
### Code-Based (deterministic)
```yaml
judge:
- type: pytest
command: pytest tests/ -v
- type: command
command: npm run build
```
### Pattern-Based
```yaml
judge:
- type: grep
pattern: "class.*Retry"
files: src/**/*.py
```
### Model-Based (LLM-as-judge)
```yaml
judge:
- type: llm
prompt: |
Does this implementation correctly handle exponential backoff?
Check for: max retries, increasing delays, jitter.
```
## Best Practices
- **Start with 3-5 tasks** that represent your real workload, not toy examples
- **Run at least 3 trials** per agent to capture variance — agents are non-deterministic
- **Pin the commit** in your task YAML so results are reproducible across days/weeks
- **Include at least one deterministic judge** (tests, build) per task — LLM judges add noise
- **Track cost alongside pass rate** — a 95% agent at 10x the cost may not be the right choice
- **Version your task definitions** — they are test fixtures, treat them as code
## Links
- Repository: [github.com/joaquinhuigomez/agent-eval](https://github.com/joaquinhuigomez/agent-eval)
所有檔案
1 個檔案安裝 agent-eval
請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/affaan-m/ECC/tree/main/skills/agent-eval # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
