Skill — Agent Evaluation Framework (End-to-End Agent Performance Measurement)
When this skill activates
When measuring agent performance, designing agent benchmarks, tracking quality
regressions, or comparing agent configurations. Use for any scenario where you
need to answer: "Is this agent good enough?" or "Did this change make the agent
better or worse?"
Core principle: Multi-dimensional quality — agent quality is not a single number.
A fast agent that's wrong is worse than a slow agent that's right. A cheap agent
that hallucinates is worse than an expensive agent that's accurate. Measure ALL
dimensions that matter.
Mandatory actions when this skill is active
Metric Taxonomy
Core agent metrics (measure ALL of these):
Correctness metrics:
- Task completion rate: % of tasks completed successfully (end-to-end)
- First-attempt success rate: % completed without retry or correction
- Factual accuracy: % of claims that are verifiable and correct
- Instruction adherence: % of explicit instructions followed correctly
Efficiency metrics:
- Cost per task: total API spend / successful completions
- Tokens per task: input + output tokens consumed
- Time per task: wall-clock time from task start to completion
- Tool calls per task: number of tool invocations (fewer = more efficient)
Quality metrics:
- Reasoning quality score: rubric-based assessment of reasoning chain
- Tool selection accuracy: % of tool calls that were appropriate
- Output quality score: rubric-based assessment of final output
- Hallucination rate: % of outputs containing ungrounded claims
Safety metrics:
- Harmful output rate: % of outputs flagged by safety classifiers
- Permission violation rate: % of actions exceeding authorized scope
- Information leakage rate: % of outputs exposing sensitive data
Composite quality score:
Agent Quality Score = weighted combination:
- Correctness (40%): task_completion * 0.25 + first_attempt * 0.15
- Quality (30%): reasoning_quality * 0.15 + output_quality * 0.15
- Efficiency (20%): normalized(1/cost) * 0.10 + normalized(1/time) * 0.10
- Safety (10%): (1 - harmful_rate) * 0.05 + (1 - violation_rate) * 0.05
Weights are defaults — adjust per use case (safety-critical → increase safety weight)
Benchmark Design
Evaluation dataset structure:
.mindforge/evals/agent-benchmark/
├── config.json # benchmark metadata and thresholds
├── tasks/
│ ├── easy/ # baseline tasks (should be ~100% success)
│ │ ├── task-001.json
│ │ └── task-002.json
│ ├── medium/ # standard tasks (target: 80%+ success)
│ │ ├── task-010.json
│ │ └── task-011.json
│ └── hard/ # stretch tasks (target: 50%+ success)
│ ├── task-020.json
│ └── task-021.json
├── rubrics/
│ ├── correctness.md # how to grade correctness
│ ├── reasoning.md # how to grade reasoning quality
│ └── output.md # how to grade output quality
└── results/
└── results.jsonl # append-only results log
Task definition format:
{
"task_id": "task-001",
"difficulty": "easy",
"category": "code-generation",
"description": "Write a function that reverses a string",
"input": "Create a TypeScript function reverseString(s: string): string",
"expected_behavior": [
"Returns reversed string",
"Handles empty string",
"Handles unicode correctly"
],
"verification": {
"type": "code",
"test_cases": [
{"input": "hello", "expected": "olleh"},
{"input": "", "expected": ""},
{"input": "abc", "expected": "cba"}
]
},
"metadata": {
"tools_available": ["Read", "Write", "Bash"],
"time_limit_seconds": 120,
"cost_limit_usd": 0.50
}
}
Rules:
- Minimum 30 tasks per benchmark (10 easy, 15 medium, 5 hard)
- Tasks must be representative of real usage patterns
- Include both deterministic tasks (one right answer) and generative tasks (rubric-graded)
- Each task has explicit success criteria (not vague "good output")
- Stratify by difficulty to detect capability thresholds
Running Benchmarks
Execution protocol:
For each task in benchmark:
1. Initialize fresh agent context (no contamination between tasks)
2. Provide task input + available tools
3. Record: start_time, all tool calls, all outputs, end_time
4. Grade output against verification criteria
5. Log full result to results.jsonl
Run N times per task (N >= 3) to measure variance:
- Report mean and standard deviation per metric
- Flag high-variance tasks (inconsistent agent behavior)
- Use same random seed where possible for reproducibility
Result logging:
{
"run_id": "uuid",
"timestamp": "ISO-8601",
"task_id": "task-001",
"agent_config": {"model": "claude-sonnet", "temperature": 0.0},
"metrics": {
"completed": true,
"first_attempt": true,
"time_seconds": 15.3,
"cost_usd": 0.012,
"tokens_used": {"input": 1200, "output": 450},
"tool_calls": 3,
"reasoning_quality": 4,
"output_quality": 5
},
"grading": {
"method": "code",
"pass": true,
"evidence": "All 3 test cases passed"
}
}
Regression Detection
Regression detection algorithm:
Compare current run vs baseline:
RED (regression detected — blocks deployment):
- Task completion rate drops > 5%
- Any previously-passing easy task now fails
- Cost per task increases > 50%
- Safety metric degrades at all
YELLOW (warning — investigate before deploying):
- Task completion rate drops 2-5%
- Medium/hard task pass rate drops > 10%
- Time per task increases > 30%
- New failure modes appear
GREEN (no regression):
- All metrics within 2% of baseline
- No new failure modes
- Cost/time stable or improved
Rules:
- ALWAYS compare to a pinned baseline (not just previous run)
- Run regression suite before any agent config change ships
- Regression in EASY tasks is more alarming than regression in HARD tasks
- Store baseline with agent version (update baseline when intentionally accepting changes)
Cost Efficiency Analysis
Quality-per-dollar assessment:
Cost Efficiency Ratio = quality_score / cost_per_task
Comparison framework:
- Agent A: quality=0.92, cost=$0.05/task → efficiency=18.4
- Agent B: quality=0.88, cost=$0.01/task → efficiency=88.0
Decision: Agent B is 4.8x more cost-efficient.
Choose A only if the 4% quality gap causes real user-visible failures.
Rules:
- A cheaper model that achieves 95% of the quality at 20% of the cost is usually better
- Factor in retry cost (low first-attempt rate = hidden cost multiplier)
- Include tool call costs in total cost (API calls, compute)
- Report cost efficiency alongside raw quality (both matter)
Self-check before task completion
Before marking a task done when this skill was active:
1---2name: agent-evaluation-framework3description: Skill — Agent Evaluation Framework (End-to-End Agent Performance Measurement)4---56# Skill — Agent Evaluation Framework (End-to-End Agent Performance Measurement)78## When this skill activates9When measuring agent performance, designing agent benchmarks, tracking quality10regressions, or comparing agent configurations. Use for any scenario where you11need to answer: "Is this agent good enough?" or "Did this change make the agent12better or worse?"1314Core principle: **Multi-dimensional quality** — agent quality is not a single number.15A fast agent that's wrong is worse than a slow agent that's right. A cheap agent16that hallucinates is worse than an expensive agent that's accurate. Measure ALL17dimensions that matter.1819## Mandatory actions when this skill is active2021### Metric Taxonomy22231. **Core agent metrics (measure ALL of these):**24 ```25 Correctness metrics:26 - Task completion rate: % of tasks completed successfully (end-to-end)27 - First-attempt success rate: % completed without retry or correction28 - Factual accuracy: % of claims that are verifiable and correct29 - Instruction adherence: % of explicit instructions followed correctly3031 Efficiency metrics:32 - Cost per task: total API spend / successful completions33 - Tokens per task: input + output tokens consumed34 - Time per task: wall-clock time from task start to completion35 - Tool calls per task: number of tool invocations (fewer = more efficient)3637 Quality metrics:38 - Reasoning quality score: rubric-based assessment of reasoning chain39 - Tool selection accuracy: % of tool calls that were appropriate40 - Output quality score: rubric-based assessment of final output41 - Hallucination rate: % of outputs containing ungrounded claims4243 Safety metrics:44 - Harmful output rate: % of outputs flagged by safety classifiers45 - Permission violation rate: % of actions exceeding authorized scope46 - Information leakage rate: % of outputs exposing sensitive data47 ```48492. **Composite quality score:**50 ```51 Agent Quality Score = weighted combination:52 - Correctness (40%): task_completion * 0.25 + first_attempt * 0.1553 - Quality (30%): reasoning_quality * 0.15 + output_quality * 0.1554 - Efficiency (20%): normalized(1/cost) * 0.10 + normalized(1/time) * 0.1055 - Safety (10%): (1 - harmful_rate) * 0.05 + (1 - violation_rate) * 0.055657 Weights are defaults — adjust per use case (safety-critical → increase safety weight)58 ```5960### Benchmark Design61623. **Evaluation dataset structure:**63 ```64 .mindforge/evals/agent-benchmark/65 ├── config.json # benchmark metadata and thresholds66 ├── tasks/67 │ ├── easy/ # baseline tasks (should be ~100% success)68 │ │ ├── task-001.json69 │ │ └── task-002.json70 │ ├── medium/ # standard tasks (target: 80%+ success)71 │ │ ├── task-010.json72 │ │ └── task-011.json73 │ └── hard/ # stretch tasks (target: 50%+ success)74 │ ├── task-020.json75 │ └── task-021.json76 ├── rubrics/77 │ ├── correctness.md # how to grade correctness78 │ ├── reasoning.md # how to grade reasoning quality79 │ └── output.md # how to grade output quality80 └── results/81 └── results.jsonl # append-only results log82 ```83844. **Task definition format:**85 ```json86 {87 "task_id": "task-001",88 "difficulty": "easy",89 "category": "code-generation",90 "description": "Write a function that reverses a string",91 "input": "Create a TypeScript function reverseString(s: string): string",92 "expected_behavior": [93 "Returns reversed string",94 "Handles empty string",95 "Handles unicode correctly"96 ],97 "verification": {98 "type": "code",99 "test_cases": [100 {"input": "hello", "expected": "olleh"},101 {"input": "", "expected": ""},102 {"input": "abc", "expected": "cba"}103 ]104 },105 "metadata": {106 "tools_available": ["Read", "Write", "Bash"],107 "time_limit_seconds": 120,108 "cost_limit_usd": 0.50109 }110 }111 ```112113 Rules:114 - Minimum 30 tasks per benchmark (10 easy, 15 medium, 5 hard)115 - Tasks must be representative of real usage patterns116 - Include both deterministic tasks (one right answer) and generative tasks (rubric-graded)117 - Each task has explicit success criteria (not vague "good output")118 - Stratify by difficulty to detect capability thresholds119120### Running Benchmarks1211225. **Execution protocol:**123 ```124 For each task in benchmark:125 1. Initialize fresh agent context (no contamination between tasks)126 2. Provide task input + available tools127 3. Record: start_time, all tool calls, all outputs, end_time128 4. Grade output against verification criteria129 5. Log full result to results.jsonl130131 Run N times per task (N >= 3) to measure variance:132 - Report mean and standard deviation per metric133 - Flag high-variance tasks (inconsistent agent behavior)134 - Use same random seed where possible for reproducibility135 ```1361376. **Result logging:**138 ```json139 {140 "run_id": "uuid",141 "timestamp": "ISO-8601",142 "task_id": "task-001",143 "agent_config": {"model": "claude-sonnet", "temperature": 0.0},144 "metrics": {145 "completed": true,146 "first_attempt": true,147 "time_seconds": 15.3,148 "cost_usd": 0.012,149 "tokens_used": {"input": 1200, "output": 450},150 "tool_calls": 3,151 "reasoning_quality": 4,152 "output_quality": 5153 },154 "grading": {155 "method": "code",156 "pass": true,157 "evidence": "All 3 test cases passed"158 }159 }160 ```161162### Regression Detection1631647. **Regression detection algorithm:**165 ```166 Compare current run vs baseline:167168 RED (regression detected — blocks deployment):169 - Task completion rate drops > 5%170 - Any previously-passing easy task now fails171 - Cost per task increases > 50%172 - Safety metric degrades at all173174 YELLOW (warning — investigate before deploying):175 - Task completion rate drops 2-5%176 - Medium/hard task pass rate drops > 10%177 - Time per task increases > 30%178 - New failure modes appear179180 GREEN (no regression):181 - All metrics within 2% of baseline182 - No new failure modes183 - Cost/time stable or improved184 ```185186 Rules:187 - ALWAYS compare to a pinned baseline (not just previous run)188 - Run regression suite before any agent config change ships189 - Regression in EASY tasks is more alarming than regression in HARD tasks190 - Store baseline with agent version (update baseline when intentionally accepting changes)191192### Cost Efficiency Analysis1931948. **Quality-per-dollar assessment:**195 ```196 Cost Efficiency Ratio = quality_score / cost_per_task197198 Comparison framework:199 - Agent A: quality=0.92, cost=$0.05/task → efficiency=18.4200 - Agent B: quality=0.88, cost=$0.01/task → efficiency=88.0201202 Decision: Agent B is 4.8x more cost-efficient.203 Choose A only if the 4% quality gap causes real user-visible failures.204 ```205206 Rules:207 - A cheaper model that achieves 95% of the quality at 20% of the cost is usually better208 - Factor in retry cost (low first-attempt rate = hidden cost multiplier)209 - Include tool call costs in total cost (API calls, compute)210 - Report cost efficiency alongside raw quality (both matter)211212## Self-check before task completion213214Before marking a task done when this skill was active:215216- [ ] Did I define metrics across all four dimensions (correctness, quality, efficiency, safety)?217- [ ] Is the benchmark stratified by difficulty (easy/medium/hard)?218- [ ] Did I run multiple times (N >= 3) to measure variance?219- [ ] Is there a pinned baseline for regression detection?220- [ ] Are regression thresholds defined (RED/YELLOW/GREEN)?221- [ ] Did I report cost efficiency (quality/cost ratio), not just raw quality?222- [ ] Are easy-task failures treated as more alarming than hard-task failures?223- [ ] Are results appended to results.jsonl (never overwritten)?