/oxy:oxy-evalsfrom oxy
Use when writing, running, or acting on evals for an Oxy agent — `.test.yml` files that run an `.agentic.yml` agent and score its answers with an LLM judge — and when the agent's answers are wrong. Triggers: "add a test", "write a test case", "write evals", "test this agent", "evaluate my agent", "bootstrap an eval suite", "fill in expected answers", "run the tests"; and the repair side: "tests are failing", "this test is flaky", "the agent's answer is wrong", "the answer should be X but the agent says Y", "debug this eval", "make this test pass", or pasted `oxyc evals run --output-json` output (or an older `oxy test --output-json` file) or a prompt/response pair to diagnose. Drafts expected answers from observed runs, then diagnoses failures and repairs the agent's semantic model, context and instructions — never the test.
Ships in oxy. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
An Oxy eval is a .test.yml file: a list of prompts, each with the answer a correct agent
gives. oxyc evals run has the Oxy deployment run the target agent on every prompt several
times and ask an LLM judge whether each answer carries the expected facts.
Drafting the tests and repairing the agent are one loop:
expected answers from evidence.The hard rule: the expected answer is the specification. Never weaken a test to make it
pass. Don't loosen expected to match what the agent said, delete or skip a failing case, or
rewrite a prompt to dodge the failure. If a test itself is wrong (a bad expected value, an
ambiguous prompt), say so, show the evidence, and let the user decide. That's a different
change from a repair, and you don't make it silently.
Reference docs (field tables, CI usage): https://www.oxygen-hq.com/docs/guide/build/test-evaluate/testing
.agentic.yml agents. The eval engine rejects any other target, including classic
.agent.yml agents (that runtime was removed). Inline tests: blocks inside agent or
automation files are gone too. A .test.yml file is the only entry point.expected, and the
agent's answer. It doesn't see the SQL, the tool calls, or the rows.expect: block (see "Behaviour checks" below):
whether the agent asked a clarifying question, drew a chart, hit a pre-aggregation, which
source its answer's query came from, and which tools it called. These are read from the
run's events, not judged. tool: <name> on a case is shorthand for expect.tools: [<name>]..test.yml formatname: Sales performance # optional display name
target: agents/sales.agentic.yml # path from the project root; see "target" below
settings:
runs: 3 # times each case runs (default 3)
concurrency: 5 # agent runs in flight at once (default 5)
judge_model: judge # a model `name:` from config.yml (default: first model there)
cases:
- name: total-revenue-2025 # optional, but always add it: it makes --case usable
prompt: What was total revenue across all stores in 2025?
expected: Total revenue across all stores in 2025 was approximately $6.7 billion.
tags: [revenue, critical]
Rules the parser enforces:
settings, each case). A typo such as
judge-model: or expects: makes the file fail to parse. Run it by path and
oxyc evals run exits 6 with Failed to deserialize test config …. Run with no file
and a broken file is skipped silently. It just isn't in the run, with no error. A file
that isn't valid YAML, or has no cases: list, isn't compiled at all, so by path it answers
exit 5 (not in the served revision), as if it had never been pushed. After pushing a test
file, run it by path once.prompt is required, and so is expected unless the case has an expect: block (or
tool:): such a case can be graded on its behaviour alone. Everything else is optional.target is resolved from the project root (the directory holding config.yml). If you
omit it, it's inferred from the filename, in the same directory: sales.agentic.test.yml
targets sales.agentic.yml beside it. Tests kept in a separate tests/ folder must set
target explicitly.judge_model names a model by its name: under models: in config.yml. It isn't a
vendor model ID. If you leave it out, the judge is the first model listed in
config.yml. An unknown name fails the run before any judging (LLM model '<name>' could not be resolved from project config). Google/Gemini models can't be used. Prefer a judge from a
different model family than the agent's, to avoid self-preference bias.expect:)An optional per-case block. Every field is optional; a case fails when any field it sets is
unmet, and the record names each unmet one in unmet_expectations (and at the end of cot).
cases:
- name: ambiguous-region
prompt: What were sales in the region?
expect:
asks_user: true # the run must stop on a clarifying question
- name: weekly-revenue-chart
prompt: Chart weekly revenue for November 2025
expected: A weekly revenue series for November 2025
expect:
chart: true # a chart was drawn (a plain table does not count)
preagg: true # a successful query was served from a pre-aggregation
query_source: semantic # the answer's query: semantic | llm | vendor | verified_sql
tools: [query] # tools that must be called, by the runtime's own names
expect: and no expected is not judged. It passes on its expectations
alone.asks_user: true makes a clarifying question a graded outcome: the question becomes the
record's actual_output, the answer text is not judged, and the case passes. A run that
answers instead fails. Without it, a question is still a run error.semantic_only with no views, a database with no read-only connection) runs on
the older FSM runtime instead, and runtime: fsm in the .agentic.yml pins it there;
each record's runtime (react or fsm) says which one ran. Tool names differ between the
two, so prefer the flags to tools: when a case must hold for both.observed object, met or not; check it when
writing an expectation.Naming and placement: <agent-stem>.<topic>.test.yml (for example
sales.performance.test.yml) in the folder the project already uses for tests. With no file,
oxyc evals run runs every *.test.yml the workspace compiled, except under hidden
(dot-prefixed) directories and target/, node_modules/, dist/ or build/.
timezone: (UTC when unset). The expected answer for a relative prompt goes stale
the next month. Write "November 2025", not "last month".agentic pipeline asked a clarifying question: …), which counts as a FAIL. An ambiguous
prompt shows up as a run error, not as a wrong answer. The exception is a case written to
test exactly that, with expect: {asks_user: true}.name:), with a short stable slug.When the right answer isn't known yet, scaffold the cases with a placeholder and fill it in from evidence:
expected: "DRAFT: to be synthesized from repeated runs."
A placeholder case's verdict means nothing, because the judge has no facts to check. Never
report a suite as passing while any DRAFT: remains in it.
expectedexpected is what the judge checks the answer against. The judge's instruction is to PASS an
answer that contains the core factual content of expected. It ignores formatting,
phrasing, and level of detail, and it allows extra correct information. So write the facts
that must be present, and nothing that may legitimately vary.
expected is an answer, not a grading instruction.~, "about", "roughly") unless an exact value is reliably stable.
The judge compares facts, and a cent-level total invites false failures.Good: Total revenue across all locations in 2025 is approximately $6.7 billion.
Good: The top 5 items by first-week engagements in February 2026: #1 had ~25K engagements
and #5 had ~10K. Each entry gives the title, channel and engagement count.
Good: Regional plan attainment can't be calculated because targets are set at the company
level only. A correct answer says so and offers company-level attainment instead.
Bad: The response should explain total revenue across all stores. (grading instruction)
Bad: Total revenue is $6,737,218,004.32. (false precision)
Bad: Sum of store__weekly_sales across all store__store_id values. (schema names)
Bad: Store A $73.3M, Store B $275M, Store C $402K, … (exhaustive list)
More worked examples, and the evidence rules for each kind of question: references/writing-expected.md.
Evals run on the Oxy deployment, on its worker fleet, with oxyc evals run (install with
npm i -g @oxy-hq/cli, sign in with oxyc login). The deployment runs the test files and
agents the workspace has compiled: its served revision, what was pushed, not the files in
your checkout. Push a new or edited .test.yml (and the agent change it tests) first; a test
file the deployment has not compiled answers exit 5. The file argument is the test file's
path in the workspace, from the project root (the directory holding config.yml), and
target is resolved from the project root too.
oxyc evals run tests/sales.performance.test.yml --workspace <id> # one file: wait, summarise
oxyc evals run tests/sales.performance.test.yml --workspace <id> --case total-revenue-2025 --output-json
oxyc evals run tests/sales.performance.test.yml --workspace <id> --case 0 --output-json # by 0-based index
oxyc evals run tests/sales.performance.test.yml --workspace <id> --tag critical --output-json
oxyc evals run --workspace <id> # every compiled *.test.yml
oxyc evals run --workspace <id> --min-accuracy 0.8 # CI gate, exit 9 below
oxyc evals run <file> --workspace <id> --detach # print the run id
oxyc evals wait <run-id> --workspace <id> --json # results on stdout
--case takes a 0-based index, a case name, or the exact prompt. It requires a file. With
--tag as well, a case must match both. If two cases share a name, the first one runs.--tag takes one tag.--output-json [file] writes the full results document to the file you name or, with none,
to the test file's path (relative to your current directory) with .yml replaced by
.results.json (tests/sales.performance.test.results.json). With no file argument it
writes test-results.json. --json prints the same document to stdout instead of the
summary.--regrade <results.json> grades a results file's recorded answers again, without running
the agent. It needs the test file the results came from, and can't be combined with
--case or --tag. Each run is held to the expect: checks of the test-file case with
the same prompt, read from the test file as it is now; a recorded clarifying question its
case no longer expects is a run error, as on a fresh run.--min-accuracy compares per-file scores. --threshold-mode average (the default)
checks the mean across files, and all checks every file. It doesn't check individual
cases.1 the run failed, was cancelled or timed out, 4 not signed in or not a
member of the workspace, 5 not found (or not compiled yet), 6 the test file does not
parse or --case matched nothing, 7 retryable (or --wait <seconds> ran out; the run
goes on), 9 below --min-accuracy.runs times through the full agent, plus one judge call per run,
with concurrency runs against the warehouse at once. When you iterate, run one case.The summary names each file's score and the prompts that failed. For the rest, read the
results document (--output-json, or --json) and group its records by prompt:
| A case's runs | Meaning |
|---|---|
every run PASS | passing |
some runs PASS | flaky. The answer is unstable, which is a real defect |
no run PASS | failing |
The file's Correctness score is the mean over every case × run. Each run scores 1 (PASS) or 0 (FAIL). There's no partial credit.
In the JSON, each run is a record with prompt, expected, actual_output, cot (the
judge's full response), choice (PASS/FAIL) and score. The JSON doesn't include the
SQL or the tool calls. Three things to check first:
actual_output starting with [ERROR] is a run that never produced an answer: a
clarifying question, max iterations exceeded, a connector failure, a timeout. Its error
text is also in the top-level errors array. Errored runs are appended at the end of
records, not next to their case, so group records by prompt.cot that argues PASS while choice is FAIL is usually a judge parse problem, not
an agent bug. See the judge category in the diagnosis reference.The full schema, jq recipes, and how to see what the agent actually queried:
references/results-json.md.
--output-json. Re-run if a run failed on a transient error. Up to three runs in total is
reasonable.actual_output across every run and classify it:| Class | Evidence | What to write |
|---|---|---|
stable | 2+ runs agree on the business facts | a full expected, numbers approximated |
stable_but_partial | ranking or direction agrees, values vary | the ranking plus 2–3 anchors |
flaky | runs disagree materially | only the facts that agree. Flag the rest for repair |
ambiguous | runs answer different readings of the prompt | propose a sharper prompt to the user |
cannot_answer_as_asked | runs consistently decline, with a valid reason | encode the reason and the alternative offered |
likely_unsupported | no run finds the data | leave a narrowed DRAFT: note. This is a gap to report |
expected just because
it was stable. A consistently wrong agent is a repair, not a spec.## Eval drafting summary
File: tests/sales.performance.test.yml Cases: 9 Drafted: 6 Partial: 2 Flaky: 1
| Case | Class | Notes |
| total-revenue-2025 | stable | 3/3 runs agree, ~$6.7B |
| top-items-feb-2026 | stable_but_partial | ranking stable; values vary |
Follow-up: <cases to repair, prompts to sharpen, data gaps>
When a case fails or is flaky, the agent is the thing under repair. The test stays fixed,
apart from mechanical edits such as adding a missing name:.
oxyc evals run <file> --workspace <id> --case <name> --output-json
Read every run of that case: expected, actual_output, cot, choice.
The results JSON has only the final answer. To see the path, run the same prompt on its own and read the events:
oxyc agentic run <path/to/agent.agentic.yml> -q "<the case's prompt>" --json --workspace <id>
This runs the deployed agent, as the evals do, and streams the run's events as JSON lines. Look at
query_executed: its query, its rows, its row_count and its source. rows is only a
preview (a react run sends the first 10; row_count is the full count), so judge a result's
size by row_count, not by counting rows. source is semantic (compiled
by the semantic model), llm (SQL the model wrote), verified_sql (a Verified Query), or
vendor. Also look at analytics_validation_failed, the checks that bounced the agent. If
the project exports traces to Oxy's observability, the run's trace shows the same steps.
| Category | Typical evidence | Fix lives in |
|---|---|---|
| A. Semantic model gap: a grouping or dimension is missing | many queries, raw rows, the agent aggregates in prose | a dimension on the view |
| B. Missing or unfindable measure | source: llm where a measure should have answered, or arithmetic done in the answer | a measure, or its name and description |
| C. Instructions vague or misdirecting | wrong interpretation, varying definitions across runs | instructions: or a .md context doc |
| D. Canonical answer exists as SQL | the same question keeps producing different SQL | a Verified Query |
E. Validation rejects a correct result (runtime: fsm only) | analytics_validation_failed loops, max iterations exceeded | validation: |
| F. Judge false negative | cot agrees with the expected answer, choice is FAIL | report it. Don't touch the agent |
| G. Prompt underspecified | clarifying-question errors, different readings across runs | report it, and propose a sharper prompt |
| H. Data unavailable | no view or table holds it | report it. Don't fake support |
Symptoms, evidence, and a worked fix for each: references/diagnosis.md.
.agentic.yml agent, in this order.view.yml / .topic.yml matched by the agent's context: globs):
add the missing measure or dimension, or fix an aggregation or an entity. The agent's
catalog search matches a measure's name, its description and its view name. It
doesn't read synonyms:, so the words users ask with belong in the description. A view
that no context: glob matches doesn't exist as far as the agent is concerned.context: globs, relative to the workspace root):
.md docs go into the prompts for clarifying the question and writing the answer.
Use them for business definitions: the fiscal calendar, what "active customer" means,
which of two similar measures to use..sql file with a /* oxy: … */ comment block at the top that
carries a description:. When the agent's search matches its file name or description,
the SQL runs verbatim, with no SQL generation. A .sql file without that block is
only a style example for SQL generation, and is never run as an answer.instructions: reaches every LLM call. The default (react)
runtime ignores states.<state>.instructions:, so put every rule at the top level.
Write general rules ("revenue means net of refunds", "rank by units unless asked
otherwise"). Never put the expected answer, or a number from it, into instructions.runtime: fsm only; react ignores it): the validation: block replaces the 15 default rules rather than
adjusting them. To switch off or retune one rule, list every rule that should still run.
An empty validation: {} disables them all.Make the smallest fix that generalizes. If the same logical gap exists in several views, fix all of them. Preserve the file's existing style. Explain the root cause alongside the edit.
Evals read the workspace's served revision, so a repair counts only once it is pushed and compiled. Check the files you edited, push them to the branch the workspace serves, wait for the deployment to compile it, then re-run:
oxyc validate --file agents/sales.agentic.yml
oxyc validate --file semantics/views/orders.view.yml
oxyc evals run <file> --workspace <id> --case <name> --output-json # after the push compiled
A run started before the compile finished scores the previous revision. oxyc compile <branch> --wait checks that a branch compiles before you merge it, but its staging revision
is never served, so evals don't see it.
One pass isn't proof. A case needs runs/runs on at least two rounds. Then run the
whole file to catch regressions in other cases. If the repair doesn't hold after three
diagnose-edit-validate cycles, stop and report what you know.
## Repair summary
Case: tests/sales.performance.test.yml › top-items-feb-2026
Root cause: B — the measure existed, but its description never said "engagements"
Changed: semantics/views/posts.view.yml (description of total_engagements)
Validation: round 1 3/3 · round 2 3/3 · full file 9/9 cases
Notes: <judge observations, remaining risks, anything left for the user>
expected, delete or skip a case, or reword a prompt to make a failure go away.DRAFT: note is honest, an invented number isn't.expected examples
by question type, and the evidence rules.jq
recipes, and how the judge's verdict is parsed.oxy-semantic-modeling skill, for view, measure and entity craft when the repair is in
the semantic model.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
9 skills in this plugin
/oxy-agentsUse when creating, editing, reviewing or debugging an Oxy agent, a `.agentic.yml` file that answers questions from the semantic model by clarifying, specifying, solving (SQL), executing and interpreting. Triggers include "create an analytics agent", "my agent picks the wrong metric", "my solving instructions are ignored", "react ignores config keys", "ignored_keys", "the agent never uses my verified query", "the agent can't see a database", "which tools can a state call", "set thinking, effort, budget_tokens or extended thinking", "per-state model or max_retries", "validation rules", "Cube or Looker semantic_engine", "analytics vs app-builder agent", "`.agent.yml` or `.agentic.yml`", and validating, running (`oxyc agentic run`) or testing (`oxyc evals run`) an agent. Not for writing the semantic model itself (views, topics) or automations./oxy-airway-pipelinesUse when writing, reviewing, or debugging an Oxy Airway ELT pipeline (`.airway.yml`) — sources, the `kind` values Oxy actually wires, credentials, reset, rewind and retry — or when one misbehaves: "unsupported source kind", a pipeline that parses then fails at run time, credentials that do not resolve, a *pipeline* run landing `completed_with_errors` (an *automation* run with that status is `oxy-automations`), a schema that will not change, missing history after a backfill, or duplicate rows. Carries the traps the published pipeline reference does not.npx claudepluginhub oxy-hq/skills --plugin oxy