/agami-core:agami-eval [dataset-name]from agami-core
Runs a golden evaluation harness for a profile: regenerates SQL for each question in a dataset, executes against the warehouse, and scores results against confirmed answer keys. Reports failures first.
Ships in agami-core. 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.
None: SKILL.md is the whole skill.
You are running the golden evaluation harness. Goal: take a dataset of questions whose answers are already agreed, have the model answer each one again from today's semantic model, execute both statements, and report where the two disagree. A dataset is the profile's own regression suite — the run says whether the model still answers the questions this team already signed off on, and each disagreement is a concrete thing to fix (a drifted metric, a missing filter, a join that changed shape).
This skill orchestrates:
scripts/run_golden_eval.py, which generates, executes and scores every case.Spec for the deterministic half: scripts/run_golden_eval.py (dataset choice + schema rendering + the printed payload). The scoring itself is agami-core's.
shared/question-cards.md). The score and the failing questions are markdown tables in the chat (at most 15 rows, saying how many more); every decision is a card. The run's report page opens only when the person asks to look at the failures, served from localhost.shared/plan-mode-check.md. This skill needs Bash + Read + Write — refuse if locked in plan mode. DO NOT write a plan file. DO NOT call ExitPlanMode. Refusal text: "I can't run an eval in plan mode — every case executes live SQL and the run writes a report. Switch to Auto or Edit Automatically mode (Shift+Tab to cycle) and re-invoke me with the dataset name."<artifacts_dir>/local/credentials for the active profile. If missing, invoke /agami-connect to set up first; this skill needs a working DB connection.<artifacts_dir>/<profile>/datasource.yaml must exist. If not, invoke /agami-connect, unless AGAMI_PROFILE names a database with no model (shared/file-layout.md): then say so and stop. This skill needs an introspected model: the run hands the generator the model's own tables and columns.--list (Phase 1) before anything else. It reads no credentials and runs no query, so it is the cheap way to find out there is nothing to run.bash "${CLAUDE_PLUGIN_ROOT}/scripts/py" run_golden_eval.py --profile <profile> --list
The JSON names each dataset with its total, confirmed and unconfirmed counts, plus datasets_dir — the directory a dataset would live in — and any findings the reader raised while reading them. Three outcomes:
datasets_dir from the payload, i.e. <artifacts_dir>/<profile>/golden_datasets/<name>.yaml), and stop. Authoring one is not this skill's job — point at shared/golden-dataset-shape.md, which is the authority on every field. Carry its hard rule as you say so: never read another profile to learn the shape. A golden dataset is the business definitions and the answer key in one file, so globbing for a sibling's returns another tenant's questions together with the SQL that answers them. The reference has every field; a sibling profile is never the reference.AskUserQuestion, one option per dataset, each labeled with its confirmed / unconfirmed counts (orders — 14 confirmed, 2 unconfirmed) so the choice is informed by what can actually gate. If the user already named one in $ARGUMENTS, skip the question.A dataset with zero confirmed items gets one line before you run it: "<name> has no confirmed cases, so this run reports scores but its verdict rests on nothing. See shared/golden-dataset-shape.md for confirming an answer key." Then a card, header Run it?, "Run <name> anyway?": Run it anyway (a report with no gate is still a report) / Don't run. Skip the card when the person already asked for this dataset by name and knows.
If findings is non-empty, keep it: those are dataset-level breakages and they belong in Phase 3c.
bash "${CLAUDE_PLUGIN_ROOT}/scripts/py" run_golden_eval.py \
--profile <profile> --dataset <dataset> \
> "<artifacts_dir>/local/tmp/agami-eval-<ts>.json"
Then Read the file. The payload goes to a file rather than straight into the transcript because a run of forty cases is a large object and you need to look at parts of it more than once.
A run costs one model call plus one query per case, so tell the user what they are waiting for before it starts: "Running <dataset> — <N> cases, roughly <N> × 10–30s."
A run probes the generator once before the loop. One trivial question, and if the client cannot be started the run stops with exit 2 and says so — rather than spawning it once per case, failing identically each time, and presenting a wall of errors that reads like a catastrophic model regression. --skip-preflight refuses the probe, which is worth it only for a caller who already knows the client works and is counting tokens.
--timeout-s bounds a single generation (default 120). Raise it only if items are coming back with "the generator did not answer within the time this run allows".
--effort low|medium|high|xhigh|max sets how hard the generator reasons before answering; unset uses the client's own default. Most of what a question costs is reasoning the answer never shows, so a lower level is much cheaper — pass it when the user is short on tokens or asks for a quick run, and say which level ran when you report. The level is recorded in the run's JSON (effort), and two runs at different levels are not a comparison of the model: never present them side by side as one getting better or worse.
Two flags narrow the run, and naming both is refused because they are two ways of selecting from the same dataset. --tag <name> is repeatable and runs the cases carrying any of the tags given, matched exactly — Smoke and smoke are different tags. --rerun-failures runs only what this dataset's last run recorded under failures. Both are for the non-interactive path; reach for them here only if the user asks for a slice or a re-run by name.
The exit code is the contract, and you should read it before the payload. 0 every confirmed case passed · 1 a confirmed case failed · 2 no verdict could be produced. A 2 is never a model regression — report it as a broken harness and do not open the failures table.
The script emits items already ordered — failures, errors, unscored, unconfirmed, passes — and summary.sections counts the rows in each. Render them in the order received and use those counts; do not re-sort, re-group or recount.
Ran <dataset> on <profile>: <sections.failure> failed, <sections.error> errored, <sections.unscored> unscored, <sections.unconfirmed> unconfirmed, <sections.pass> passed — run completed: <yes | no>.
Each placeholder names its own key under summary.sections; completed is summary.completed. The keys are spelled out because the payload also carries top-level summary.failed and summary.errored and they are different numbers — an unconfirmed miss counts in failed and is rendered under 3e, so a run can report failed: 2 beside one failure row. A verdict is not "zero failures". gating_failures counts items that were scored, so a run in which every generation errored has zero of them and is not green — and a run that stopped partway reports only the cases it reached. Read completed, gating_failures and errored together, and if completed is false say so on this line and again below: "The run stopped partway — <N> cases were never attempted, so this is not a clean result."
### Failures
| Item | What went wrong | Gate |
|---|---|---|
| orders-paid-by-channel-2024 | 3 of 5 rows matched the answer key (accuracy 0.60) | — |
| orders-refunded-count | Right rows, but the statement never filtered on `status` | must_filter: status |
Show at most 15 rows; when there are more, say "Showing 15 of failures; <N−15> more in the report." Item is item_key. What went wrong is reason, with accuracy and the two row counts where they add something. Gate is the entry from gates that fired, or — when the item simply disagreed with its answer key.
Under the table, one line of interpretation per failure — the same job the receipt does in reconcile:
orders-refunded-count — the rows are right and the filter is missing, so the model reached the answer another way. That is the kind of failure that passes today and breaks on next quarter's data.
Two different things, and they must not share a table.
### Errors — the run could not produce an answer
| Item | What went wrong |
|---|---|
| products-count | The generator's answer did not carry a statement this run could read |
### Dataset findings — the file, not the answer
| Locator | Finding |
|---|---|
| orders.yaml[orders-last-quarter] | A relative question over a frozen answer key: the window slides, the SQL does not. |
A finding is not a scored failure. A rotted or unreadable case is broken, not wrong — nothing was judged, and counting it as a miss would blame the model for the dataset. The locator is <stem>.yaml[<case id>], which is what the author edits.
### Unscored — nothing could be compared
| Item | Why |
|---|---|
| orders-in-review | Both result sets came back empty, so there was nothing to compare |
Not a pass. An item is unscored when the comparator had nothing to work with — most often both sides returning no rows, typically because the question's window has outrun the data. The answer was never checked, so say that rather than letting a reader count it as agreement.
### Unconfirmed — reported, but they cannot gate
| Item | Score |
|---|---|
| payments-count | did not match the answer key (accuracy 0.00) |
These ran and they can never gate a run — nobody has confirmed their answer key, so failing a run on one would be gating on an unreviewed answer. Keep them under their own heading, after the failures, so a reader scanning for what broke never picks one up.
Most of them were also scored, but not all: an unconfirmed item can come back unscored like any other (both sides empty, say), and then accuracy is null rather than a number. Read status before you render a score — write "nothing could be compared" rather than the (accuracy 0.00) the template shows.
### Passed
12 cases reproduced their answer key: orders-count, customers-active, revenue-by-month, …
One compact line — the passes build the case, the failures drive the conversation.
Then, when anything did not pass (a failure, an error or an unscored case), call AskUserQuestion, one question, header Next step, "What next?":
No (Recommended): what to do about a failure is the person's call. Where AskUserQuestion is unavailable, ask the same as a short numbered list (shared/question-cards.md rule 7). When everything passed there is nothing to decide: say one line, "Say 'show the report' to see every case side by side.", and end the turn.
| Answer | Do |
|---|---|
| Look at the failures | Serve report (the .html the run just rendered) from localhost with bash "${CLAUDE_PLUGIN_ROOT}/scripts/py" serve_page.py "<report>" --minutes 30, run with run_in_background, and give the person the url from its first line, never a local file path. If report is empty the render did not land: say so and name artifact, the same run as JSON. Then the card again, without this option. |
| Fix one | A card with two questions. Header Case, "Which case?": the first failures in the order the run emitted them, up to 4 (item_key and its reason in a few words); "Other" takes any other item_key. Header Which side, "What is wrong?": agami's answer (the semantic model or the prompt examples need a fix) / The answer key (the case itself is wrong). |
| Done | End the turn. |
Fix one hands over and never writes from here. agami's answer: hand /agami-save-correction the case's question and its reason, and the generated statement read from artifact (handed over, never shown in chat); it finds the definition or the example to change and asks before any shared-model edit. The answer key: hand /agami-save-golden the case's question; its save door replaces the item only after showing the before and the after. Afterwards say "Run <dataset> again with only the failures to check the fix." and, on a yes, run Phase 2 with --rerun-failures. An item_key in "Other" that is not in this run, or words you cannot place, is said back in one line and the card asked again: never guessed.
<artifact> is artifact from the payload, the run as JSON for anyone who wants to grep it. Both files are where the answer key and the generated statement live. Handing over the page is the drill-down; reading either file aloud is not.
A run measures regression, not accuracy. Say so if anyone asks "how accurate is agami?" and reaches for this number.
Two reasons, and both are structural rather than fixable here. The generator in a run is handed the question and the model's context in one prompt, with every tool switched off and one attempt to answer — that isolation is what stops it reading the answer key, and it is the whole reason a score means anything. An agent answering the same question for real has get_datasource_schema, get_prompt_examples, execute_sql and list_datasources, and can look something up, try a statement and refine it. So a run scores a strictly weaker generator than the one that ships, and an item can fail here that production would get right on its second look.
And a golden dataset is not a random sample. It is the questions somebody would be embarrassed to get wrong, which is exactly what makes it useful and exactly what makes its pass rate unrepresentative. "12 of 15 passed" means those twelve still work. It does not mean 80%.
shared/golden-dataset-shape.md); route the user there.completed, gating_failures and errored together, never gating_failures alone.| Symptom | Action |
|---|---|
--list returns no datasets | One line: "This profile has no golden datasets yet — the first one goes in <datasets_dir>/<name>.yaml." Point at shared/golden-dataset-shape.md and stop. Don't write one. |
| The dataset has 0 confirmed items | Say the verdict will rest on nothing (Phase 1), then run if they want. Every case reports; none can gate. |
agami-eval: cannot run this profile — …no storage connection… | The preflight stop: the model declares no storage connection, so no dialect can be resolved and nothing can execute. Route to /agami-connect to finish the profile. Nothing ran; this is not a failing eval. |
agami-eval: cannot read the semantic model… / …does not parse… | The model is missing or broken, so the generator has no tables to write against. Route to /agami-connect to build or rebuild it. Nothing ran; this is not a failing eval, and don't try to repair the YAML from here. |
agami-eval: the verdicts are below, but…could not be written | The run finished and one of its two files did not land — usually a permissions problem on <artifacts_dir>/local/eval/<profile>/, which takes out both and prints this line twice. Report the verdicts normally, and point at whichever of report / artifact is non-empty rather than at an empty one. If both are empty, say there is no drill-down file for this run rather than pointing at a path that isn't there. |
agami-eval: the generator could not answer a trivial question… | The preflight. The claude client could not be started, so every case would have failed identically. Nothing ran and nothing was scored — this is a broken client, never a model regression. The client is looked for on PATH and then where it usually installs; if it lives somewhere else, set AGAMI_CLIENT to its full path. |
| Every item says "the generator command could not be started on this machine" | The same fault, reaching the loop rather than the preflight — possible only with --skip-preflight. Nothing was scored; report it as a broken run, not a red one. |
completed: false | The run stopped partway: the cases after the stop were never attempted and are absent from items. Say so on the summary line, and don't compare the counts to a previous run. Exit code is 2. |
agami-eval: no previous run of … to re-read | --rerun-failures with nothing to re-read. Run the dataset once first; it deliberately does not fall back to running everything. |
agami-eval: the last run … recorded no failures | Nothing to re-run, which is a clean 0. Say the previous run was green rather than reporting an empty run as a result. |
agami-eval: … no longer in <dataset> and were skipped | Cases were edited out between the two runs. Report how many were skipped so the smaller count is explained. |
| Credentials missing | The run fails at execution, not generation, so items come back scored-as-errors in bulk. Check <artifacts_dir>/local/credentials per Phase 0.2 and re-invoke /agami-connect if it's absent. |
What SKILL.md sets; muted values are Claude Code's defaults
Use when the user says 'run the evals', 'run the golden dataset', 'score the model against my golden questions', 'did anything regress?', 'how accurate is agami on my data?', or '/agami-eval <dataset>' — any ask for evidence that the semantic model still answers its agreed questions correctly. Requires agami-connect to have been run first (needs a semantic model + working credentials) and at least one dataset under `<artifacts_dir>/<profile>/golden_datasets/`. This skill reads and scores only; it never writes or edits a dataset.
Three short reads, in order
npx claudepluginhub agamiai/agami-core --plugin agami-core9 skills in this plugin
/agami-connectEnd-to-end database connection for agami: sets up credentials on first run (DB-type picker → writes <artifacts_dir>/local/credentials.example for the user to fill in), then introspects the live DB directly into the agami semantic model (subject areas, tables, columns, relationships with join cardinality, deep-table column groups, sensitive-column flags) under <artifacts_dir>/<profile>/. The structural model is built deterministically by the agami-core semantic_model package (catalog mode, or a probe-mode fallback when the catalog is locked down); the skill then layers LLM enrichment (descriptions, entities, metrics) and seeds EXPLAIN-validated NL→SQL examples. Every model write is gated by the semantic-model validator — no breaking model is ever persisted./agami-deployEARLY ACCESS (in testing) — usable today, but newer than the local single-player path; feedback welcome via a GitHub issue. Prepares a ready-to-run, self-hosted agami deploy bundle ON THE USER'S MACHINE so a team can stand up a shareable MCP server their Claude connects to. Conversationally gathers the hard-floor inputs (hostname, admin identity), auto-detects the local model, writes docker-compose.yml + Caddyfile + a filled agami.env (referencing the PUBLISHED image ghcr.io/agamiai/agami-core — no clone, no build), and stages the model artifacts. Generates the signing secret via deploy_preflight; the admin password is typed by the user into the file (never in chat). Then runs `docker compose up` if Docker is local, otherwise prints the exact VM steps + the shareable MCP URL. Username/password auth only on this paved path./agami-modelThe semantic model in the chat: what needs sign-off and the subject areas with their tables, then a card — review what needs sign-off (approve / reject the AI-proposed metrics, entities and guessed joins; Rule 1 — a query using an unsigned metric still answers but carries a warning until it's approved), hide tables or columns from queries, look up a table or metric, or show the full view (the model explorer page: browse with live search, edit descriptions/metrics/entities/joins, add metrics, edit datasource.md). Every change is applied through the curation engine and gated by the validator before it touches the YAML. (This skill absorbed the former `/agami-review`.)/agami-queryAnswers natural-language questions about the user's database. Loads the agami semantic model (subject areas, tables, columns, relationships with join cardinality, entities, metrics) and few-shot examples from <artifacts_dir>/<profile>/, generates SQL via the examples-first traversal (pick subject area → match examples → resolve entities/metrics → compound table context), executes it locally via the user's chosen tool (psql / mysql / snowsql / sqlite3 native CLI, DuckDB binary, or the Python driver `execute_sql.py` — which runs the scope gates and reports fan-trap/chasm-trap and aggregation findings on the receipt), returns results as a markdown table with optional CSV export, and renders Chart.js HTML charts on request. All execution is local — no data leaves the machine./agami-reconcileReconciles known (label, expected_value) numbers from an existing dashboard against agami's answers. Input can be a SCREENSHOT of a Metabase / Power BI / Tableau / Looker dashboard (Claude's vision extracts the pairs), a CSV, or numbers pasted inline — the user doesn't need to know which; they can just ask. For each pair, the skill generates a matching NL question, runs it through the active profile's semantic model, diffs actual vs expected, and surfaces matches in green and mismatches in red with drill-down receipts. The strongest onboarding demo for a skeptical data engineer — either we agree with their numbers (trust earned via evidence) or we surface a real definitional disagreement (trust earned via transparency)./agami-save-correctionSaves a user correction so future queries learn from it. Always appends a (question, corrected_sql) pair to the subject area's example library under <artifacts_dir>/<profile>/prompt_examples/<area>/. Additionally, classifies the correction and — when applicable — applies a surgical edit to the semantic model itself (relationship fix, column metadata, or new metric) via the curation engine. Every model edit is validated before write; the validator is the binding gate, and a failed validation reverts. Shows the user a model diff for approval before any model mutation.Other plugins' skills for the same job