writing-evals
它能做什么
这项技能帮助开发者测试每次都可能给出不同答案的 AI 功能。适合希望在每次改动后确认 AI 功能是否仍然正常的团队。
适用场景
- ✓当你正在构建 AI 功能,并想要检查其答案的测试时。
- ✓当你需要使用相同的检查方法比较不同的 AI 模型或设置时。
- ✓当你想为 AI 项目设置 Axiom 评估文件时。
技能链接
https://github.com/openclaw/clawhub/blob/main/.agents/skills/writing-evals/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我的 AI 摘要功能编写评估测试,检查答案是否保持准确和简短。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会创建评估文件,其中包括测试用例、评分检查(每项检查只测试输出的一个特性),以及可用于尝试不同选项的设置。它会先检查已安装的 SDK 文档,使代码与你的版本相匹配。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Writing Evals
You write evaluations that prove AI capabilities work. Evals are the test suite for non-deterministic systems: they measure whether a capability still behaves correctly after every change.
Prerequisites
- Complete the Axiom AI SDK Quickstart (instrumentation + authentication)
Verify the SDK is installed:
ls node_modules/axiom/dist/
If not installed, install it using the project's package manager (e.g., pnpm add axiom).
Always check node_modules/axiom/dist/docs/ first for the correct API signatures, import paths, and patterns for the installed SDK version. The bundled docs are the source of truth — do not rely on the examples in this skill if they conflict.
Philosophy
- Evals are tests for AI. Every eval answers: "does this capability still work?"
- Scorers are assertions. Each scorer checks one property of the output.
- Flags are variables. Flag schemas let you sweep models, temperatures, strategies without code changes.
- Data drives coverage. Happy path, adversarial, boundary, and negative cases.
- Validate before running. Never guess import paths or types—use reference docs.
Axiom Terminology
| Term | Definition |
|---|---|
| Capability | A generative AI system that uses LLMs to perform a specific task. Ranges from single-turn model interactions → workflows → single-agent → multi-agent systems. |
| Collection | A curated set of reference records used for testing and evaluation of a capability. The data array in an eval file is a collection. |
| Collection Record | An individual input-output pair within a collection: { input, expected, metadata? }. |
| Ground Truth | The validated, expert-approved correct output for a given input. The expected field in a collection record. |
| Scorer | A function that evaluates a capability's output, returning a score. Two types: reference-based (compares output to expected ground truth) and reference-free (evaluates quality without expected values, e.g., toxicity, coherence). |
| Eval | The process of testing a capability against a collection using scorers. Three modes: offline (against curated test cases), online (against live production traffic), backtesting (against historical production traces). |
| Flag | A configuration parameter (model, temperature, strategy) that controls capability behavior without code changes. |
| Experiment | An evaluation run with a specific set of flag values. Compare experiments to find optimal configurations. |
How to Start
When the user asks you to write evals for an AI feature, read the code first. Do not ask questions — inspect the codebase and infer everything you can.
Step 1: Understand the feature
- Find the AI function — search for the function the user mentioned. Read it fully.
- Trace the inputs — what data goes in? A string prompt, structured object, conversation history?
- Trace the outputs — what comes back? A string, category label, structured object, agent result with tool calls?
- Identify the model call — which LLM/model is used? What parameters (temperature, maxTokens)?
- Check for existing evals — search for
*.eval.tsfiles. Don't duplicate what exists. - Check for app-scope — look for
createAppScope,flagSchema,axiom.config.ts.
Step 2: Determine eval type
Based on what you found:
| Output type | Eval type | Scorer pattern |
|---|---|---|
| String category/label | Classification | Exact match |
| Free-form text | Text quality | Contains keywords or LLM-as-judge |
| Array of items | Retrieval | Set match |
| Structured object | Structured output | Field-by-field match |
| Agent result with tool calls | Tool use | Tool name presence |
| Streaming text | Streaming | Exact match or contains (auto-concatenated) |
Step 3: Choose scorers
Every eval needs at least 2 scorers. Use this layering:
- Correctness scorer (required) — Does the output match expected? Pick from the eval type table above (exact match, set match, field match, etc.).
- Quality scorer (recommended) — Is the output well-formed? Check confidence thresholds, output length, format validity, or field completeness.
- Reference-free scorer (add for user-facing text) — Is the output coherent, relevant, non-toxic? Use LLM-as-judge or autoevals.
| Output
常见问题
AI 的评估测试是什么?
它会在设定的用例上运行 AI 功能并为答案评分,让你看到该功能是否仍然表现良好。
它需要 Axiom SDK 吗?
需要。这项技能是为 Axiom AI SDK 编写的,需要先安装该 SDK 以及快速入门的设置。
它包含哪些类型的用例?
这项技能涵盖常规路径、棘手情况、边界情况和负面情况。
详情
作者的原始描述
Scaffolds evaluation suites for the Axiom AI SDK. Generates eval files, scorers, flag schemas, and config from natural-language descriptions. Use when creating evals, writing scorers, setting up flag schemas, or configuring axiom.config.ts.
repo: openclaw/clawhub
热度
- GitHub 星标
- 9.5k
- 排名
- #12267
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
axiom-alerting
9.5k帮你的智能体通过 Axiom API 创建和管理监控器与通知路由,并检查告警是否按预期运行。
axiom-sre
9.5k帮你的智能体逐步调查生产事故和缺陷,在得出结论之前,用 Axiom 日志验证每一个猜测。
building-dashboards
9.5k帮你的智能体从仪表盘必须支持的决策出发,设计配有合适图表、查询和筛选器的 Axiom 仪表盘。
controlling-costs
9.5k帮你的智能体在 Axiom 中找出未被使用的数据,并构建用于追踪和削减日志成本的仪表盘与监控器。