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
基于模型(LLM作为评判器)
judge:
- type: llm
prompt: |
Does this implementation correctly handle exponential backoff?
Check for: max retries, increasing delays, jitter.
最佳实践
- 从3-5个能代表实际工作负载的任务开始,而非简单示例
- 每个代理至少运行 3 次试验以捕捉变异性——代理的行为是非确定性的
- 在任务 YAML 文件中固定提交版本,以确保结果在数天/数周内可重现
- 每个任务至少包含一个确定性评判器(测试、构建)——LLM 评判器会引入噪声
- 在追踪通过率的同时也要关注成本——一个通过率为95%但成本高出10倍的代理可能并非最佳选择
- 对任务定义进行版本控制——它们是测试 fixture,请将其视为代码
链接
- 代码库: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
复制





首页
