eval-and-quality-gates
БесплатноБез исполняемых скриптовНе проверенEvaluation strategies and quality gates for LLM systems. LLM-as-judge implementation, prompt regression testing, structural and semantic validation pipelines…
от crouton-labs★ 25 звёзд на GitHubОб этом скилле
Evaluation and Quality Gates
LLM outputs are probabilistic. The same prompt produces different outputs across runs. Traditional test assertions — exact equality, deterministic return values — break almost immediately. This creates a gap most teams fill with the wrong things: vanity metrics, under-specified judges, and evaluation frameworks bought before the basics work.
This skill covers what actually works, ranked by when to use it, and what to skip.
For implementation patterns and code, see reference.md.
The Three-Layer Hierarchy
Build validation from cheap and deterministic to expensive and probabilistic. Each layer catches different failures.
Layer 1 — Structural (deterministic, fast, no LLM calls): Schema validation, regex, length bounds, required fields, JSON syntax, SQL syntax. These should run in milliseconds and have zero false positives. If an output fails structural validation, don't bother with semantic or quality checks.
Layer 2 — Semantic (model-assisted, moderate cost): NLI-based entailment for faithfulness, embedding cosine similarity, fuzzy matching. This layer checks whether outputs mean the right thing, not just whether they look right.
Layer 3 — Quality (LLM-graded, highest cost): LLM-as-judge with rubrics for subjective dimensions: tone, completeness, helpfulness. Run this last, on outputs that pass layers 1 and 2.
The ordering matters. Most production failures are structural or semantic. Running a quality judge on outputs with broken JSON is waste.
LLM-as-Judge
The method works. GPT-4 achieves over 80% agreement with human experts on MT-Bench (Zheng et al., 2023, NeurIPS), exceeding human-human agreement of 81%. But the headline number hides important caveats.
Biases to account for:
- Position bias: Claude-v1 was biased toward the first position 75% of the time; GPT-4 is better but still shows ~30% bias. Mitigate by running each pairwise comparison twice with swapped order.
- Verbosity bias: 91% of judges fail verbosity attacks (longer = rated better). GPT-4 fails at 8.7%, still not zero. Explicitly instruct the judge to evaluate quality, not length.
- Self-enhancement bias: Claude-v1 rated its own outputs 25% higher than competitors'. Use a different model as judge than the model generating outputs — this eliminates self-enhancement bias completely.
When LLM-as-judge works:
- STEM and humanities tasks: 70-76% win rate in pairwise comparisons
- Factuality checking on clear domains: 84-85% accuracy
- Binary pass/fail with rubrics: >90% human agreement achievable (Hamel Husain's Honeycomb case study, 3 iterations)
When it doesn't:
- Creative writing: LLMs pass creativity tests 3-10x less often than human writers
- Hallucination detection: best models achieve only 58.5% accuracy on HaluEval
- Fine-grained relevance ("highly relevant" vs "perfectly relevant"): 30-50% accuracy
- Complex reasoning tasks: requires 70B+ parameter models; smaller models are brittle
Implementation rule: Use binary pass/fail, not Likert scales. Multi-point scales (1-5) produce noisy, unactionable data — annotators and judges don't agree on what "3" means. Binary forces clarity and enables precision/recall measurement. Hamel Husain: "people don't know what to do with a 3 or 4."
Prompt Regression Testing
Treat prompts as versioned assets. A prompt change is a code change — it should go through CI, run against a golden test set, and fail the build if quality drops.
The four-component pipeline:
- Version control: Store prompts in dedicated files, not embedded strings. Track in git.
- Golden set: Start with ~30 real production examples covering happy paths, edge cases, and known failures. Expand until no new failure modes emerge. Production traces are the best source.
- Assertion suite: Layer from cheap to expensive (structural → content → semantic → quality). Not every test needs an LLM judge.
- CI gate: Run on every PR that touches prompts or system prompt logic. Fail on regressions.
The most common anti-pattern: jumping to LLM-based evaluation before building basic assertions. String matching and schema validation catch 60-70% of real failures and cost nothing.
Metrics That Are Theater
These metrics appear in papers and dashboards but don't correlate with what matters:
- BLEU: "Poor correlation with human judgements" — used in 95+ papers despite this evidence. Bottom of WMT22/WMT23 leaderboards for translation.
- ROUGE: Can't capture factuality or faithfulness. 62.6% of papers using it provided no implementation details.
- Perplexity as quality proxy: Measures model confidence, not output quality. Low perplexity ≠ good output.
- Generic vector/n-gram similarity: For classification tasks, positive and negative instance distributions overlap too much to be useful (Eugene Yan).
- Likert scales (1-5): Subjective, inconsistent across raters, actionable on neither 3 nor 4.
If
Установить eval-and-quality-gates в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл eval-and-quality-gates?
Evaluation strategies and quality gates for LLM systems. LLM-as-judge implementation, prompt regression testing, structural and semantic validation pipelines, production monitoring, guardrails, and metrics that actually work. Use when building evals, setting up CI quality gates, testing prompts, measuring output quality, detecting regressions, or adding safety guardrails to AI applications.
Как установить скилл eval-and-quality-gates?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл eval-and-quality-gates запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub