google-agents-cli-eval
它能做什么
这项技能使用数据集、指标和 AI 评判者来指导 AI 智能体的评估。适合想衡量智能体回答质量并加以改进的开发者。
适用场景
- ✓当你想对你的 AI 智能体运行评估时。
- ✓当你需要为智能体编写测试用例数据集时。
- ✓当你想分析评估结果失败的原因并比较多次运行的时候。
技能链接
https://github.com/google/agents-cli/blob/main/skills/google-agents-cli-eval/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请用测试数据集评估我的智能体,然后告诉我失败的用例为什么会失败。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能会说明数据集格式、可用的指标,以及 AI 评判者如何为回答打分。它帮助智能体运行评估命令,然后读取结果,找出常见的失败原因。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Agent Evaluation Guide
Requires:
agents-cli(uv tool install google-agents-cli) — install uv first if needed.
Scaffolded project? If you used
/google-agents-cli-scaffold, dataset and a custom metric are already scaffolded intests/eval/(Python projects) oreval/(Go projects). For simplicity, this skill and its references use the Python directory layout; adjust accordingly if you've scaffolded a Go agent. You already haveagents-cli eval run(chainsgenerate+grade),tests/eval/datasets/, andtests/eval/eval_config.yaml. Start with executingeval runand iterate from there.
Reference Files
| File | Contents |
|---|---|
references/dataset_schema.md |
Canonical EvaluationDataset schema — all field types, JSON examples for single-turn / multi-turn / multi-agent, common mistakes |
references/metrics-guide.md |
Complete metrics reference — all built-in metrics, match types, custom metrics, judge model config |
references/user-simulation.md |
Dynamic conversation testing — eval dataset synthesize flags, what scenarios are, compatible metrics |
references/builtin-tools-eval.md |
google_search and model-internal tools — trajectory behavior, metric compatibility |
references/advanced-commands.md |
Opt-in commands: eval analyze, eval optimize, eval submit / eval results |
references/multimodal-eval.md |
Multimodal inputs — eval dataset schema, built-in metric limitations, custom evaluator pattern |
references/live-eval.md |
Live and voice agents — --mode adk_live, what gets graded, user-only turn authoring, the Live-model and region traps |
The Quality Flywheel
Improving agent quality is iterative. The 4 stages below describe the loop. Each stage has a Default path (you, the coding agent, do the work directly) and an Opt-in CLI command that delegates to the Eval Service in Gemini platform for better quality and scale.
1. Prepare Data
Default: Use or edit the scaffolded tests/eval/datasets/basic-dataset.json to define single-turn eval inputs. Start with 1–2 cases.
Opt-in (ADK projects): agents-cli eval dataset synthesize: user-simulate multi-turn datasets when you lack data; its output already includes traces, so Stage 2 collapses to agents-cli eval grade alone. See Eval Commands and references/user-simulation.md.
2. Run the Eval (always run)
Default: agents-cli eval run runs the agent over the dataset and grades the traces, writing results_<ts>.{json,html} to artifacts/grade_results/.
Decoupled form: eval generate then eval grade, for a custom traces location, re-grading without re-running the agent, or traces from synthesize (eval grade alone).
3. Analyze Failures
Default: Open the latest artifacts/grade_results/results_<ts>.html (or .json) and identify failed metrics — see What to fix when scores fail below for the fix table.
Opt-in: agents-cli eval analyze, LLM-based failure clustering; prefer when you have 10+ failing cases and want categorized failure modes. See references/advanced-commands.md.
4. Optimize & Code Fix
Default: Edit the agent — adjust prompts, tool descriptions, instructions, or eval dataset based on the failure analysis. See What to fix when scores fail below for the failure → fix mapping.
Opt-in (ADK projects): agents-cli eval optimize runs ADK GEPA prompt optimization against a target metric (see references/advanced-commands.md). Suitable for prompt-only failures. The optimized prompt appears in the command output; capture it and apply it to the agent. For the full per-iteration trace, set print_detailed_results: true in your optimization config file.
Long-running and expensive. GEPA optimization makes many LLM calls and can take a long time. Do not run it unless the user explicitly asks for prompt optimization. When you do run it, iterate as far as possible with manual fixes first, then run a single final
eval optimize— never loop on this command.
Running the loop
Iterate stages 2 → 3 → 4 → 2 (with synthesize, re-run Stage 1 each pass, then eval grade). After each fix, run agents-cli eval compare <prev_results>.json <new_results>.json to confirm the target metric improved without regressing others. Expect 5–10+ iterations per case before it passes, which is normal. Only after a case passes should you expand
常见问题
我需要特别的项目结构吗?
技能的示例使用 Python 项目结构,如果是 Go 项目,你可能需要做调整。
有哪些类型的指标?
技能提供一份指标指南,涵盖内置指标、匹配类型和自定义指标。
它能比较两次运行吗?
可以。描述中说明,它可以帮助比较评估结果。
详情
作者的原始描述
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding
repo: google/agents-cli
热度
- GitHub 星标
- 6.3k
- 排名
- #14370
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/27
评论
- …
同一仓库的更多技能
google-agents-cli-adk-code
6.3k帮你的智能体使用 Google ADK 为 AI 智能体编写代码,包括工具、回调、状态和编排模式。
google-agents-cli-deploy
6.3k帮你的智能体把 AI 智能体部署到 Google Cloud,涵盖 Agent Runtime、Cloud Run、GKE、密钥、CI/CD 和故障排查。
google-agents-cli-observability
6.3k帮你的智能体为已部署在 Google Cloud 上的 AI 智能体设置追踪、日志和监控,让你看到它在做什么。
google-agents-cli-publish
6.3k帮你的智能体把已部署的 AI 智能体注册到 Gemini,并在 Agent Registry 中管理已注册的智能体和 MCP 服务器。