Communitygithub.com

Agent Eval 技能

对编码智能体(Claude Code、Aider、Codex 等)进行头对头比较,针对自定义任务评估通过率、成本、时间和一致性指标。在挑选编码智能体,或在智能体配置变更后需要衡量实际的通过率、成本和时间而非主观印象时使用。

Agent Eval 技能 是什么?

Agent Eval 是一个轻量级 CLI 工具,用于在可复现的任务上对编码智能体进行头对头比较。它解决了“哪个编码智能体最好?”这一常见问题,通过系统化的方法替代仅凭主观感受的比较。该工具支持在您自己的代码库上评估 Claude Code、Aider、Codex 等智能体,并测量通过率、成本、时间和一致性等关键指标。其核心功能包括基于 YAML 的任务定义、通过 Git 工作树实现隔离运行、以及多种评判类型(代码测试、模式匹配和 LLM 评判)。Agent Eval 适合在新工具或模型采用前进行性能基准测试,或在智能体更新后运行回归检查,从而为团队提供数据驱动的智能体选择决策。它不需要 Docker,仅依赖 Git 工作树来确保每次运行的独立性和可复现性。

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Agent Eval 技能 是做什么的?

一个轻量级 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 工作树隔离

每次智能体运行都使用独立的 Git 工作树——无需 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 工作树
  2. 将提示交给智能体
  3. 运行评判标准
  4. 记录通过/失败、成本和时间

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: |
      这个实现是否正确处理了指数退避?
      检查:最大重试次数、递增延迟、抖动。

最佳实践

  • 从 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/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-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.

相关技能