build-eval
Write rigorous evals for LLM agents, multi-agent systems, skills, MCP servers, and prompts. Use when: building test suites, measuring agent effectiveness, evaluating coordination, or choosing eval frameworks. Covers: DeepEval, Braintrust, RAGAS, precision/recall, F1, task completion, pass@k, iterative metrics, multi-agent coordination.
What this skill does
# Eval-1337
Write evals that measure what matters. Not vanity metrics.
The key to success is **measuring performance and iterating** (Anthropic 2026).
## The Core Problem
```python
# This tells you NOTHING
activation_rate = 100% # Activates on every prompt = useless
```
Single metrics lie. You need to measure BOTH failure modes.
## Three Grader Types
| Type | Examples | Use When |
|------|----------|----------|
| **Code-based** | String match, regex, test suites, outcome verification | Deterministic checks (speed, objectivity) |
| **Model-based** | LLM rubric scoring, pairwise comparison, multi-judge | Open-ended tasks (flexibility, nuance) |
| **Human** | Expert review, crowdsourced judgment, spot-check | Gold standard (expensive, slow) |
**Code-based first:** Prefer deterministic graders; use model-based for flexibility; apply partial credit for multi-component tasks. "Grade what the agent produced, not the path it took" (Anthropic 2026).
## Match Eval to Agent Type
| Agent Type | Primary Grader | Key Metrics | Benchmark |
|------------|----------------|-------------|-----------|
| **Coding** | Code (test suites) | Tests pass, no regressions | SWE-bench Verified |
| **Conversational** | Multi (state + transcript + rubric) | Resolution, turn limits, tone | τ2-Bench |
| **Research** | Model (groundedness, coverage) | Claim support, source quality | Custom |
| **Computer Use** | Code (screenshot, state inspection) | GUI state, file system | WebArena, OSWorld |
| **Skills** | Code (activation) + Model (methodology) | F1 + adherence rubric | Custom |
| **Multi-Agent** | Multi (milestones + coordination) | Task score, handoff success | MultiAgentBench |
| **Pipeline** | Per-stage + handoffs + end-to-end | Stage success, bottleneck | Custom |
## Non-Determinism Metrics
LLMs are stochastic. Run 5+ trials per task.
| Metric | Formula | Use When |
|--------|---------|----------|
| **pass@k** | P(≥1 success in k trials) | One success is enough |
| **pass^k** | P(all k trials succeed) | Reliability-critical |
**Example:** 75% per-trial success → pass@3 ≈ 98%, pass^3 ≈ 42%.
Use pass@k for exploration; pass^k for production reliability.
## Iterative Metrics (Ralph Pattern)
Traditional pass@k treats trials as independent. Iterative eval uses failures as feedback:
| Metric | Formula | Question |
|--------|---------|----------|
| **pass@k (iterative)** | Success within k retries with feedback | Can it recover? |
| **iterations_to_pass** | Retries until success | Learning speed |
| **recovery_rate** | (pass@k - pass@1) / (1 - pass@1) | % failures that recover |
| **feedback_sensitivity** | Δscore per iteration | Does guidance help? |
**Use case:** Agent has 60% pass@1. Is that its ceiling, or can it do better with feedback?
```
Iterative eval result:
├── pass@1: 60% (baseline)
├── pass@3: 91% (with retry + feedback)
└── recovery_rate: 78% → Deploy with retry loop, not better prompts
```
## Multi-Agent Metrics
Single-agent metrics miss coordination failures:
| Metric | Formula | Measures |
|--------|---------|----------|
| **Task Score** | Σ(milestone × weight) | Goal achievement |
| **Handoff Success** | Completed / expected | Task transfers work? |
| **Comm Efficiency** | Useful messages / total | Signal vs noise |
| **Role Adherence** | On-role actions / total | Staying specialized? |
| **ToM Score** | Passed scenarios / total | Theory of mind |
## Match Metric to Target
| Target | What to Measure | Metric | Framework |
|--------|-----------------|--------|-----------|
| **Agents** | Task completion | pass@k / accuracy | DeepEval |
| **Agents** | Tool usage | ToolCorrectnessMetric | DeepEval |
| **Skills** | Activation (L1) | Precision/Recall/F1 | Custom |
| **Skills** | Methodology (L2) | LLM rubric | DeepEval GEval |
| **MCP Servers** | Tool calls | ToolCallAccuracy | RAGAS |
| **MCP Servers** | Reliability | MCPGauge 4-dim | Custom |
| **Prompts** | Output quality | LLM-as-judge | Braintrust |
| **Any** | Traces | Span analysis | Phoenix (local) |
| **Any** | Behavioral | Bloom scenarios | Anthropic Bloom |
## Building Evals: The Roadmap
From Anthropic's agent evaluation guide (2026):
```
Step 0: Start early with 20-50 tasks from actual failures
Step 1: Write unambiguous tasks (pass expert test)
Step 2: Build balanced problem sets (positive AND negative)
Step 3: Robust harness with clean environments per trial
Step 4: Thoughtful grader design (deterministic preferred)
Step 5: Read transcripts (verify graders, understand failures)
Step 6: Monitor saturation (100% → only tracks regressions)
Step 7: Maintain as living artifact (dedicated ownership)
```
## Common Pitfalls
| Trap | Fix |
|------|-----|
| Single test run | **5+ runs** - stochastic outputs |
| One-sided test set | **Balance positive/negative** - prevents overfitting |
| Measuring recall only | **Add precision** - high recall + low precision = noise |
| "Forced eval" inflation | **Realistic conditions** - forced mode inflates scores |
| No ground truth | **Label expectations** - must_trigger, should_not |
| Grader too rigid | **Accept valid variations** - grade outcome, not path |
| Shared state between runs | **Isolate environments** - leftover files cause correlation |
| Bypass vulnerabilities | **Design to require solving** - agents exploit loopholes |
| Eval saturation | **Expand difficulty** - high pass rates mask improvements |
## Classification Metrics (F1)
Use when you have TWO failure modes:
```
ACTUAL
Yes No
+-----------+-----------+
EXPECTED Yes | TP | FN |
| Correct | Missed |
+-----------+-----------+
No | FP | TN |
| Noise | Correct |
+-----------+-----------+
Precision = TP / (TP + FP) "when it fires, is it right?"
Recall = TP / (TP + FN) "when it should fire, does it?"
F1 = 2×(P×R)/(P+R) "balanced score"
```
## Labeled Test Cases
```json
{"input": "What crate for CLI args?", "expectation": "must_trigger"}
{"input": "Write a haiku", "expectation": "should_not_trigger"}
{"input": "Explain ownership", "expectation": "acceptable"}
```
| Label | Meaning | Measures |
|-------|---------|----------|
| must_trigger | Should definitely fire | Recall (misses) |
| should_not_trigger | Must not fire | Precision (noise) |
| acceptable | Either outcome fine | Excluded |
## Defense in Depth (Swiss Cheese)
No single eval method catches everything. Layer them:
| Method | Speed | Coverage | Best For |
|--------|-------|----------|----------|
| Automated evals | Fast | Narrow | Regression prevention |
| Production monitoring | Real-time | Broad | Real behavior |
| A/B testing | Days/weeks | Statistical | Outcome measurement |
| Manual transcript review | Slow | Deep | Building intuition |
| Human studies | Very slow | Gold-standard | Subjective quality |
Use multiple methods; each layer catches what others miss.
## Framework Decision
| Situation | Use | Why |
|-----------|-----|-----|
| Python agent evals | **DeepEval** | TaskCompletionMetric, ToolCorrectness |
| TypeScript/Node | **Braintrust** | Identical Python/TS API |
| RAG pipelines | **RAGAS** | ToolCallF1, context metrics |
| Skill activation | **Custom** | Precision/recall with labeled expectations |
| Behavioral evals | **Bloom** | Automated scenario generation |
| Infrastructure | **Harbor, Promptfoo** | Containerized, YAML-based |
## Quick Reference
```
AGENTS
Coding: Test suites (SWE-bench pattern)
Conversational: Multi-grader (state + transcript + rubric)
Research: LLM groundedness + coverage
Metrics: pass@k (exploration), pass^k (reliability)
MULTI-AGENT
Task: Milestone-weighted task score
Coordination: Handoff success, comm efficiency
Roles: Role adherence, work duplication
Advanced: Theory of Mind (ToM) scenarios
PIPELINE (Sequential A → B → CRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.