agentleFS
HaiTrieu0902HaiTrieu0902/agent-skills-kit/skills/llm-evaluation/SKILL.md

llm-evaluation

Skill0 starsChanged 8 months agoMITView on GitHub

How to evaluate LLM and agent systems — golden sets, offline/online evals, LLM-as-judge, regression in CI, and guardrails. Use when measuring or improving the quality, reliability, or cost of any LLM-backed feature.

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 2

    Distinctive

    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
  1. Distinctive:

    Use a strong model as judge.

    line 46
  2. Very specific:

    Run the golden set on every prompt/model/config change.

    line 50
  3. Distinctive:

    Check for injection, PII leakage, and out-of-policy content before returning.

    line 57

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

LLM Evaluation

You can't improve what you don't measure — and "it looked good in the demo" isn't measurement.

Overview

LLM outputs are non-deterministic and easy to regress silently. Evals turn "feels better" into evidence, and catch regressions before users do. Build the eval before you tune the prompt.

Build a Golden Set First

  • 20–100 real, representative input → expected-outcome pairs.
  • Include the hard cases: edge inputs, known past failures, adversarial/injection attempts.
  • Version it next to the code; grow it every time you find a new failure in production.

Offline vs Online

TypeWhenWhat it answers
OfflinePre-deploy, in CI"Did this change improve/regress the golden set?"
OnlineIn production"How is it doing on real, live traffic?"

Picking a Metric

Output kindMetric
Single correct answer (extraction, classification)Exact / set match, F1
Open-ended textRubric scoring (often LLM-as-judge) or human review
RAG answerFaithfulness + answer relevance (see rag-patterns)
Agent/tool useTask success rate, steps, tool-call correctness
All of the aboveLatency and cost per request — always track

LLM-as-Judge (use with care)

Powerful for open-ended outputs, but has known biases:

  • Give the judge an explicit rubric and ask for a score + justification.
  • Watch for position bias (order of A/B), verbosity bias (longer ≈ "better"), and self-preference.
  • Calibrate the judge against human labels on a sample before trusting it.
  • Use a strong model as judge; prefer pairwise comparison over absolute scores when possible.

Put It in CI

  1. Run the golden set on every prompt/model/config change.
  2. Fail the build on a regression beyond a threshold.
  3. Track score, latency, and cost over time — a quality win that triples cost is a trade, not a win.

Guardrails (runtime checks)

  • Validate structured output against its schema; retry or fall back on failure.
  • Check for injection, PII leakage, and out-of-policy content before returning.
  • Log inputs/outputs (with privacy controls) so production failures become new golden-set cases.

Anti-Patterns

❌✅
Eyeballing one exampleScore a versioned golden set
Trusting LLM-judge blindCalibrate against humans; control for bias
Optimizing quality onlyTrack quality and cost/latency together
Evals as a one-time gateContinuous evals in CI + online monitoring
Discarding prod failuresFeed every failure back into the golden set

Ship the eval with the feature. The golden set is the spec.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.