evaluating-ai-output
Skill2 starsChanged 3 months agoMITView on GitHub
Evaluate non-deterministic LLM/AI output with evals instead of one-shot "it worked" — define expected behavior first, measure pass@k / pass^k, and grade with code / model / human graders. Use when building or changing an AI/LLM feature, an agent, a prompt, a RAG pipeline, or a classifier, where a single good run is not proof of correctness. Complements writing-tests (deterministic logic) and developing-features-tdd.
In this repository19 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- api-designSkill
- building-frontend-uiSkill
- debugging-agent-runsSkill
- developing-featuresSkill
- developing-features-tddSkill
- documenting-featuresSkill
- ensuring-cross-platformSkill
- exploratory-testingSkill
- fixing-bugsSkill
- playwright-cliSkill
- reviewing-codeSkill
- running-agent-loopsSkill
- security-reviewSkill
- threat-modelingSkill
- validating-in-realitySkill
- writing-prdSkill
- writing-pull-requestsSkill
- writing-testsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Write the eval first: the inputs, what a good output looks like, and what must never happen.
- Distinctive: line 21
Run each case k times (LLM output varies) and report:
- Very specific: line 48
If you find a rubric that calibrates well, a recurring failure class, or a provider quirk, append a learnings/YYYY-MM-DD-slug.md (or use …
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Evaluating AI output
Code is deterministic; LLM output isn't. A feature that "worked once" can fail the next call on the same input. Evals are the unit tests of AI work — they measure how often and how well the output meets the bar, not just that it can.
Read first (always)
List learnings/ and read anything relevant — provider quirks, rubric calibration, and known-flaky cases for this project belong there.
Define expected behavior BEFORE you implement
Write the eval first: the inputs, what a good output looks like, and what must never happen. If you can't state how you'd grade it, you don't yet understand the feature.
Measure across repeated trials
Run each case k times (LLM output varies) and report:
- pass@k — at least one of k attempts succeeds. Measures capability ("can it do this at all?"). Typical target: pass@3 > 90%.
- pass^k — all k attempts succeed. Measures stability/reliability ("does it do this every time?"). Use for critical paths (auth, money, irreversible actions). pass^3 means 3 consecutive clean runs.
A feature can have high pass@k but low pass^k — impressive once, unreliable in production. Match the metric to the risk.
Three graders (use the cheapest that's trustworthy)
| Grader | How | Use for |
| Code-based | Deterministic check — regex/grep, schema/JSON validation, an assertion, a tool call that must appear | Anything machine-verifiable (format, presence, exact values). Always prefer this. |
| Model-based | A model scores the output 1–5 against a written rubric | Quality/judgment that code can't check (relevance, tone, reasoning). Calibrate the rubric on a few human-labeled examples. |
| Human | A person reviews, tagged risk LOW / MED / HIGH | High-stakes or ambiguous cases. Never fully automate security review — keep a human in the loop there. |
Build the eval set
Cover representative cases, adversarial/edge cases (the failure modes from your threat model — see skills/threat-modeling), and regression cases (every bug becomes a permanent eval). Keep a baseline (committed scores) and gate changes on "no regression vs. baseline". Store the eval set, the baseline, and run logs alongside the feature.
Boundary with the testing skills
- Deterministic logic (parsing, math, control flow around the model) →
skills/writing-tests/developing-features-tdd. Don't write an eval for what a unit test can assert. - Non-deterministic output quality (does the model's answer meet the bar, reliably) → here.
- For AI runtime resilience (timeouts, fallbacks, circuit breakers, kill switch), see
developing-features-tdd/references/ai-runtime.md.
Capture a learning
If you find a rubric that calibrates well, a recurring failure class, or a provider quirk, append a learnings/YYYY-MM-DD-slug.md (or use /learn).
See also
skills/writing-tests,skills/developing-features-tdd— deterministic coverage.skills/threat-modeling— abuse cases feed the adversarial eval set.skills/building-langflow-components— when the AI feature is a Langflow component.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

