Communitygithub.com

agent-eval

在自定义任务上对编码智能体(Claude Code、Aider、Codex 等)进行头对头比较,提供通过率、成本、时间和一致性指标。适用于在选择编码智能体时,或当智能体设置变更需要衡量通过率、成本和时间而非仅凭感觉时使用。

agent-eval 是什么?

Agent Eval 是一款轻量级 CLI 工具,用于在可重复任务上对编码智能体进行头对头比较。它解决了“哪个编码智能体最好”这一主观判断问题,通过系统化的方法收集客观数据。该工具支持 Claude Code、Aider、Codex 等多种编码智能体,允许用户在自己的代码库上定义 YAML 格式的任务,包括提示词、操作文件和评判标准。它采用 Git Worktree 隔离机制,无需 Docker 即可确保每次运行的独立性和可重复性。Agent Eval 会收集通过率、API 成本、执行时间和一致性等关键指标,并生成清晰的表格报告,帮助团队基于数据而非感觉做出智能体选型决策。用户还可以使用 pytest、grep 甚至 LLM 作为评判器,灵活定义任务成功标准。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/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 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
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 评判器会引入噪音
  • 将成本与通过率一起跟踪——一个通过率 95% 但成本是 10 倍的智能体可能不是最佳选择
  • 对你的任务定义进行版本管理——它们是测试夹具,应像代码一样对待

链接

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

相关技能