agentleFS
wenxuecwenxuec/llm-judge/SKILL.md

llm-judge

Skill1 starsChanged 7 months agoMITView on GitHub

Design and scaffold LLM-as-judge evaluations for agentic systems and LLM applications. Walks the user through rubric design, judge prompt construction, bias mitigation, and runnable Python harness generation. Use when the user wants to evaluate an agent, build an eval suite, add regression tests for an LLM system, design a judge for quality/safety/ compliance, or audit an existing eval setup.

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. existential-birds/beagle★ 91same name
    2. cdgutierrez6/claude-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these phases in order.

    line 48
  2. Very specific:

    Use AskUserQuestion if the user has not already given you:

    line 53
  3. Distinctive:

    Only proceed when these four are answered.

    line 64
  4. Distinctive:

    5-point Likert: use for quality, coherence, tone.

    line 76
  5. Very specific:

    Write the finalised rubric to ./evals/rubric.md in the user's project.

    line 86
  6. Distinctive:

    Every judge prompt must include:

    line 91
  7. Distinctive:

    Do not reveal which model produced the output.

    line 102
  8. Very specific:

    Read docs/biases.md and flag any bias risk specific to this eval (e.g.

    line 105
  9. Very specific:

    Do not hard-code API keys.

    line 120
  10. Distinctive:

    Document which mode is active and why in the rubric.

    line 139
  11. Distinctive:

    Run the judges on those examples.

    line 164
  12. Distinctive:

    If agreement is low (<0.6 kappa, <0.7 Spearman), iterate on the prompt or anchors.

    line 166
  13. Distinctive:

    Do NOT run the harness yourself unless the user asks.

    line 183
  14. Very specific:

    Environment state: if the agent acts on external state (DB, filesystem, API), checkpoint the state before and after and include a …

    line 195
  15. Distinctive:

    Does not fine-tune judges.

    line 200
  16. Very specific:

    Does not commit to a specific vendor framework.

    line 202
  17. Distinctive:

    Does not replace human evaluation.

    line 204

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

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

llm-judge

What this skill does

Guides the user through building a rigorous LLM-as-judge evaluation for an agent or LLM application. Produces:

  1. A rubric with explicit, measurable criteria.
  2. Judge prompts per criterion, with bias-mitigation built in.
  3. A runnable Python harness that executes the judges against a dataset and emits structured JSON for regression tracking.
  4. A calibration plan against a small human-labeled set.

The skill is framework-agnostic. The generated harness uses only the anthropic (or openai) SDK by default. Notes on DeepEval and Inspect AI are included in docs/ for users who want to graduate to a heavier toolkit.

When to invoke

Invoke when the user says anything like:

  • "evaluate this agent"
  • "build an eval" / "set up evaluation" / "write regression tests for this LLM system"
  • "LLM as a judge" / "how do I grade these outputs"
  • "audit my eval" / "review this evaluation setup"
  • "design a rubric for <agent>"

Workflow

Follow these phases in order. Do not skip. Each phase should produce concrete artefacts in the user's working directory.

Phase 1 — Scope the eval (ask before building)

Use AskUserQuestion if the user has not already given you:

  1. What is being evaluated? A single-turn chatbot, a multi-step agent with tool use, a RAG system, a planner, or a specific workflow.
  2. What does "good" look like? Task success, safety, compliance, efficiency, tone, factuality, tool-use correctness. The user should name 2–5 things they care about.
  3. What ground truth is available? Gold answers, reference trajectories, human labels, or nothing (pure LLM judgment).
  4. What is the deployment context? Research prototype, production pipeline, regulated industry (healthcare, finance, legal). This determines rigour level.

Only proceed when these four are answered. If the user says "just build something", propose defaults and confirm.

Phase 2 — Design the rubric

Load templates/rubric.md and adapt it to the user's context. For each criterion:

  • Name it (one noun phrase, e.g. "Tool-call correctness").
  • Define it operationally. What exactly does the judge check.
  • Choose a scoring type:
    • Binary (pass/fail): use for safety, compliance, hard constraints.
    • 3-point (fail/partial/pass): use for task success.
    • 5-point Likert: use for quality, coherence, tone. Use sparingly because it's noisy.
  • List the failure modes the criterion is meant to catch.
  • Decide if the criterion is step-level (evaluated at each agent step) or trajectory-level (evaluated on the whole run).

For agents, always include at least:

  • A task-success criterion (trajectory-level).
  • A tool-use-correctness criterion (step-level, optional if no tools).
  • A safety/compliance criterion (binary, trajectory-level).

Write the finalised rubric to ./evals/rubric.md in the user's project.

Phase 3 — Draft judge prompts

For each criterion, draft a judge prompt using templates/judge-prompt.md as the base. Every judge prompt must include:

  1. Role line: "You are a rigorous evaluator of [criterion]."
  2. Definition: restate what the criterion means, in judge-facing language.
  3. Scoring scale: explicit scale with anchors for each point.
  4. Input schema: what the judge will see (input, output, and for agents, the trajectory).
  5. Bias controls:
    • Force structured JSON output.
    • Require rationale BEFORE the score (chain-of-thought ordering).
    • For pairwise judging: instruct the judge to ignore position and length.
    • Do not reveal which model produced the output.
  6. Output schema: strict JSON with rationale (string) and score (typed per scale).

Read docs/biases.md and flag any bias risk specific to this eval (e.g. if outputs are going to be long, verbosity bias is a concern).

Save judge prompts as separate files in ./evals/judges/<criterion>.md.

Phase 4 — Generate the harness

Copy templates/harness.py to ./evals/run_eval.py. Customise:

  • The dataset loader (point it at the user's data).
  • The judges list (one entry per criterion, each referencing a prompt file).
  • The system-under-test adapter (a function that takes an input and returns an output/trajectory — the user fills this in if they haven't given you the agent code).
  • The output path for the JSON results.

Do not hard-code API keys. Read them from environment variables. Remind the user to set ANTHROPIC_API_KEY or OPENAI_API_KEY.

Phase 4b — Step attribution

For agent evals, scoring steps in isolation is not enough: the user also wants to know which steps caused the final outcome. Copy templates/attribution.md to ./evals/judges/attribution.md and set ATTRIBUTION_PROMPT_PATH in the harness.

Two modes are supported:

  • blame (default): one extra judge call per trajectory per criterion. The judge reads the trajectory and the final verdict, then assigns a weight in [-1.0, 1.0] per step plus a critical_step index. Cheap, soft — correlation not causation.
  • counterfactual: for each step N, re-run the agent from step N with the step masked/modified, and measure how much the final score changes. The delta IS the causal influence. Rigorous but expensive, and requires the user's agent to support resume_from_step. Opt-in.

Document which mode is active and why in the rubric.

Phase 4c — Incremental / automatic re-eval

The harness caches verdicts by (example_hash, rubric_hash):

  • example_hash covers id + input + reference.
  • rubric_hash covers judge_model + every judge prompt + attribution prompt.

Consequences:

  • Adding a new example → only that example runs.
  • Editing a judge prompt → rubric_hash changes → everything re-runs against the new judge.
  • Nothing stale ever ships: the cache key is content-addressed, not name-based.

templates/watch.py is a dependency-free polling watcher that re-invokes run_eval.py whenever the dataset or judge prompts change. Copy it to ./evals/watch.py and run either python watch.py --once (one-shot) or python watch.py --interval 10 (continuous). This is the "automatic" layer: drop a new example into the dataset file and the next cycle evaluates it without touching anything else.

Phase 5 — Calibration plan

Explain the calibration loop:

  1. The user should hand-label 20–50 examples with the rubric.
  2. Run the judges on those examples.
  3. Compute per-criterion agreement (Cohen's kappa for categorical, Spearman for ordinal).
  4. If agreement is low (<0.6 kappa, <0.7 Spearman), iterate on the prompt or anchors.
  5. Re-check whenever the judge model changes or the rubric is updated.

Generate ./evals/calibrate.py that takes a CSV of human labels and the judge output JSON and prints per-criterion agreement.

Phase 6 — Report back

Summarise in plain language:

  • What was evaluated.
  • What rubric you proposed.
  • What bias risks you flagged.
  • What files you created.
  • What the user needs to do next (fill in the system adapter, add the dataset, run calibration).

Do NOT run the harness yourself unless the user asks. The harness will call paid APIs.

Agentic system extensions

For evaluating agents specifically, additionally:

  • Trajectory representation: serialise the agent run as a list of steps, each with role, content, tool_calls, tool_results. The judge sees this structured trace.
  • Step-level vs trajectory-level: step-level judges score individual tool calls or reasoning steps; trajectory-level judges score the whole run. Use both.
  • Cost/efficiency metrics: track step count, token count, tool-call count, wall-clock time. These are not LLM-judged — compute them programmatically.
  • Environment state: if the agent acts on external state (DB, filesystem, API), checkpoint the state before and after and include a state_diff criterion.

What this skill does NOT do (by design)

  • Does not fine-tune judges. Use Prometheus-style fine-tuned judges only when LLM-as-judge with a strong base model has been shown insufficient.
  • Does not commit to a specific vendor framework. If the user wants DeepEval or Inspect AI, read docs/patterns.md and point them there.
  • Does not replace human evaluation. The calibration step is mandatory for any production use.

References

  • Zheng et al. 2023, "Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena" — established position/verbosity/self-enhancement biases.
  • Liu et al. 2023, "G-Eval: NLG Evaluation using GPT-4 with Better Human Alignment" — chain-of-thought + form-filling judge pattern.
  • Yao et al. 2024, "τ-bench: A Benchmark for Tool-Agent-User Interaction" — agent eval benchmark design.
  • Anthropic Evals cookbook, UK AISI Inspect documentation, OpenAI Evals repo.

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.