Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计通过

llm-as-a-judgeLLM AS A judge 命令行

Agent Skill

llm-as-a-judge 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

245

周安装

10

GitHub Stars

8

下载量

78
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:llm-as-a-judge(LLM AS A judge 命令行)
来源仓库:https://github.com/maragudk/evals-skills
仓库路径:skills/llm-as-a-judge
安装命令:
npx skills add https://github.com/maragudk/evals-skills --skill llm-as-a-judge
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/maragudk/evals-skills --skill llm-as-a-judge

简介

llm-as-a-judge 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 它可辅助梳理项目结构、依赖关系和协作流程,帮助 Agent 快速定位关键信息。
  • 通过 npx skills add 命令从指定仓库安装,具体用法请参考原始 README。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

LLM-as-a-Judge

Build reliable automated evaluators that use an LLM to judge the outputs of another LLM pipeline. Each judge targets a single, binary (Pass/Fail) failure mode identified during error analysis.

When to Use LLM-as-Judge vs. Code

Choose the right evaluator type for each failure mode:

Use code-based evaluators when the failure is objective and deterministic:

  • JSON/SQL syntax validity, regex/string matching, structural constraints, execution errors, logical checks.
  • These are fast, cheap, deterministic, and interpretable.

Use LLM-as-Judge when the failure requires interpretation or nuance:

  • Tone appropriateness, summary faithfulness, response helpfulness, explanation clarity, creative quality.
  • These require a separate LLM (distinct from the application) to judge outputs.

Each failure mode gets its own dedicated evaluator. Never combine multiple criteria into a single judge prompt—this introduces ambiguity and makes diagnosis harder.

The Full Workflow

1. Write Prompt Template
2. Split Labeled Data (Train / Dev / Test)
3. Iteratively Refine Prompt (measure TPR/TNR on Dev)
4. Estimate & Correct Success Rate (on Test + Unlabeled)

Step 1: Write the Judge Prompt

A well-structured judge prompt has four essential components. Read references/prompt-template.md for a complete annotated example.

1. Clear Task and Evaluation Criterion

Focus on ONE well-scoped failure mode. Vague tasks lead to unreliable judgments.

  • ❌ "Is this email good?"
  • ✅ "Is the tone appropriate for a luxury buyer persona?"

2. Precise Pass/Fail Definitions

Define what counts as Pass (failure absent) and Fail (failure present), grounded in the failure descriptions from error analysis. Be specific about boundary conditions.

3. Few-Shot Examples

Include labeled examples that clearly Pass and clearly Fail. These calibrate the judge's decision boundary. Best drawn from human-labeled traces.

  • Use clear-cut cases, not edge cases, for initial examples.
  • For binary judgments, include at least one Pass and one Fail example.
  • If using finer-grained scales (e.g., 1–3 severity), include examples for every point on the scale.

4. Structured Output Format

The judge responds in a consistent, machine-readable format:

{
  "reasoning": "1-2 sentence explanation for the decision.",
  "answer": "Pass"
}

The reasoning field comes first—this induces chain-of-thought before the verdict, improving accuracy.


Step 2: Split Labeled Data

Designing a judge resembles training a classifier, except "training" happens through prompt engineering. Split your human-labeled traces into three disjoint sets:

SetPurposeTypical Allocation
TrainingPool of candidates for few-shot examples in the prompt10–20%
DevIteratively refine the prompt; measure agreement with human labels40–45%
TestFinal, unbiased measurement of judge accuracy (TPR/TNR)40–45%

Key rules:

  • Dev examples must never appear in the prompt. This ensures generalization measurement.
  • Test examples are held out until the prompt is finalized. Never look at them during development.
  • In-context learning typically saturates after 1–8 well-chosen examples. Allocate more data to evaluation.
  • Both Dev and Test should contain enough Pass and Fail examples—ideally 30–50 of each.
  • Reusing examples across splits leads to overfitting and inflated accuracy.

If you have ~100 labeled traces (50 Pass, 50 Fail), a reasonable split: 10 training, 40 dev, 50 test.


Step 3: Iteratively Refine the Prompt

This is the core loop. Think of it as tuning a classifier, but by revising text instead of adjusting parameters.

The Refinement Loop

  1. Write a baseline prompt using the four components above, with a few examples from the Training set.
  2. Run the judge on the Dev set. Compare each judgment to human ground truth.
  3. Measure agreement using TPR and TNR:

- TPR = (actual Passes correctly judged Pass) / (total actual Passes) - TNR = (actual Fails correctly judged Fail) / (total actual Fails)

  1. Inspect disagreements. Review false passes (judge said Pass, human said Fail) and false fails. Identify ambiguous criteria or missing edge cases.
  2. Refine the prompt: Clarify Pass/Fail definitions, swap in better few-shot examples from Training, add representative edge cases.
  3. Repeat until TPR and TNR stabilize at acceptable levels.

Why TPR and TNR (Not Precision/Recall)

The end goal is estimating the true pass rate of the pipeline. A judge can only mis-estimate this in two ways: missing real Passes (lowers the observed rate) or passing real Fails (inflates it). TPR and TNR capture these two error modes directly.

When to Stop

Stop when TPR and TNR reach satisfactory levels (typically >90%). Missing a real failure may be costlier than flagging a false one—adjust thresholds to your application's risk tolerance.

If Alignment Stalls

  • Use a more capable LLM — a larger model may resolve subtle errors.
  • Decompose the criterion — break a complex failure into smaller, atomic checks.
  • Improve labeled data — add diverse, high-quality examples, especially edge cases.
  • Verify label quality — sometimes the issue is inconsistent or incorrect human labels.

Manual iteration is recommended before automation (e.g., DSPy). It builds intuition about both the failure mode and the judge's behavior. Writing the prompt forces you to externalize your specification.


Step 4: Estimate True Success Rates

After finalizing the prompt, freeze it and run on the Test set to get TPR and TNR. Then use the judge on unlabeled production traces with bias correction.

Read references/success-rate-estimation.md for the full procedure, formula, Python code, and confidence interval calculation.

Quick Reference

  1. Measure judge accuracy on Test set → TPR, TNR
  2. Observe raw success rate on unlabeled data → p_obs = k/m
  3. Correct for bias using Rogan-Gladen formula: θ̂ = (p_obs + TNR - 1) / (TPR + TNR - 1) [clipped to 0,1]
  4. Bootstrap confidence interval — resample Test set labels B times, recompute corrected rate each time, take 2.5th/97.5th percentiles.

If TPR + TNR - 1 ≈ 0, the judge is no better than random chance and correction is invalid.

Key Insight

Improving TPR (the judge's ability to identify true successes) narrows the confidence interval the most. Judge errors mainly inflate uncertainty rather than shifting the corrected estimate.


Common Pitfalls

  1. Omitting examples from the prompt. Without concrete examples, the judge lacks grounding. This is the most common mistake.
  2. Evaluating multiple criteria in a single prompt. Break complex metrics into narrower, specific prompts for better alignment and diagnosability.
  3. Skipping alignment validation. Don't assume the judge "just works." Domain-specific criteria require prompt refinement and human-labeled validation.
  4. Overfitting to labeled traces. If few-shot examples also appear in the evaluation set, TPR/TNR will be inflated. Any trace used in the prompt must be excluded from Dev and Test.
  5. Never revisiting the judge. Production data drifts, new failure modes emerge, and LLM updates shift behavior. Periodically re-validate.
  6. Not pinning the judge model version. In CI pipelines, pin the exact model version (e.g., claude-sonnet-4-5-20250929) to prevent results from fluctuating due to unannounced updates.

Long-Document Considerations

When judging outputs from long-document pipelines:

  • Don't feed the full document into the judge — use only the relevant portion (e.g., the source paragraph a summary came from).
  • Consider chunk-level evaluation with aggregated per-chunk judgments.
  • Make rubrics especially clear about what "correct" means since the judge won't see the full context.

CI Integration

For continuous integration, build a golden dataset of curated input examples with reference outputs. On each pipeline change:

  1. Run all golden inputs through the pipeline.
  2. Evaluate outputs with your suite of automated evaluators (code-based + LLM-as-Judge).
  3. Pin the judge model version to prevent CI flicker.
  4. Include examples covering core features, known failure modes, and edge cases.

This catches regressions but does not predict overall production accuracy — its purpose is stability as the pipeline evolves.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.35%
按下载量换算30

Claude

27.99%
按下载量换算22

Cursor

18.49%
按下载量换算14

Gemini CLI

9.24%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills