writing-evals

Generates evaluation suites, scorers, and flag schemas for the Axiom AI SDK.

9.4k|1.5k|Updated Jan 3, 2026
One-click install
npx skills add https://github.com/openclaw/clawhub --skill writing-evals
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-evals
Source: https://github.com/openclaw/clawhub/tree/main/.agents/skills/writing-evals
Command: npx skills add https://github.com/openclaw/clawhub --skill writing-evals

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires axiom, vitest, zod, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Testing non-deterministic AI features is hard: traditional unit tests cannot verify whether an LLM capability still behaves correctly after a change. This Skill scaffolds complete evaluation suites for the Axiom AI SDK so you can measure correctness, catch regressions, and monitor production quality.

Core Features & Use Cases

  • Eval Generation: Creates *.eval.ts files with typed scorers, test data, and task functions for classification, retrieval, structured output, and tool-use patterns.
  • Flag Schemas & Config: Generates createAppScope() with Zod schemas and axiom.config.ts so you can sweep models and parameters via CLI overrides.
  • Offline & Online Evals: Supports curated test collections with ground truth plus reference-free scoring on live production traffic with sampling.
  • Use Case: You built a support-ticket classifier. Ask the agent to write evals for it, and it reads your code, generates happy-path, adversarial, boundary, and negative test cases, wires up exact-match scorers, and validates the file before running npx axiom eval.

Quick Start

Ask the agent to write evals for your AI feature, for example: "Write evals for the categorize-messages function in src/support-agent.ts using the Axiom AI SDK."

Frequently Asked Questions about writing-evals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write evals for an LLM feature with the Axiom AI SDK?

Create a `.eval.ts` file that calls `Eval()` with a capability name, a data array of input/expected pairs, a task function invoking your AI code, and at least two scorers. Run it with `npx axiom eval` or `--debug` for local mode.

What scorer patterns should I use for classification vs retrieval evals?

Classification uses exact match scorers comparing output to expected labels, while retrieval uses set match scorers comparing returned item lists. Structured outputs use field-by-field comparison, and tool use checks expected tool names against actual calls.

Can I override model and temperature settings without changing eval code?

Yes, define a flag schema with `createAppScope()` and Zod, then override values from the CLI using `--flag.myCapability.model=gpt-4o-mini`. Every leaf field in the schema must have a `.default()` value, and union types are not supported.

What is the difference between offline and online evals in Axiom?

Offline evals run against curated test collections with expected ground truth before deployment. Online evals use `onlineEval` to score live production traffic with reference-free scorers, supporting per-scorer sampling rates and trace linking.

Why is my eval file not discovered by the axiom CLI?

The file must end in `.eval.ts` or `.eval.js` and match the `include` glob in `axiom.config.ts`, which defaults to `**/*.eval.{ts,js}`. Also verify the file contains an `Eval()` call with data, capability, task, and scorers properties.