agent-evaluation
Testing and benchmarking LLM agents including behavioral testing, capability assessment, reliability metrics, and production monitoring—where even top agents achieve less than 50% on real-world benchmarks
What this skill does
# Agent Evaluation
Testing and benchmarking LLM agents including behavioral testing, capability assessment, reliability metrics, and production monitoring—where even top agents achieve less than 50% on real-world benchmarks
## Capabilities
- agent-testing
- benchmark-design
- capability-assessment
- reliability-metrics
- regression-testing
## Prerequisites
- Knowledge: Testing methodologies, Statistical analysis basics, LLM behavior patterns
- Skills_recommended: autonomous-agents, multi-agent-orchestration
- Required skills: testing-fundamentals, llm-fundamentals
## Scope
- Does_not_cover: Model training evaluation (loss, perplexity), Fairness and bias testing, User experience testing
- Boundaries: Focus is agent capability and reliability, Covers functional and behavioral testing
## Ecosystem
### Primary_tools
- AgentBench - Multi-environment benchmark for LLM agents (ICLR 2024)
- τ-bench (Tau-bench) - Sierra's real-world agent benchmark
- ToolEmu - Risky behavior detection for agent tool use
- Langsmith - LLM tracing and evaluation platform
### Alternatives
- Braintrust - When: Need production monitoring integration LLM evaluation and monitoring
- PromptFoo - When: Focus on prompt-level evaluation Prompt testing framework
### Deprecated
- Manual testing only
## Patterns
### Statistical Test Evaluation
Run tests multiple times and analyze result distributions
**When to use**: Evaluating stochastic agent behavior
interface TestResult {
testId: string;
runId: string;
passed: boolean;
score: number; // 0-1 for partial credit
latencyMs: number;
tokensUsed: number;
output: string;
expectedBehaviors: string[];
actualBehaviors: string[];
}
interface StatisticalAnalysis {
passRate: number;
confidence95: [number, number];
meanScore: number;
stdDevScore: number;
meanLatency: number;
p95Latency: number;
behaviorConsistency: number;
}
class StatisticalEvaluator {
private readonly minRuns = 10;
private readonly confidenceLevel = 0.95;
async evaluateAgent(
agent: Agent,
testSuite: TestCase[]
): Promise<EvaluationReport> {
const results: TestResult[] = [];
// Run each test multiple times
for (const test of testSuite) {
for (let run = 0; run < this.minRuns; run++) {
const result = await this.runTest(agent, test, run);
results.push(result);
}
}
// Analyze by test
const byTest = this.groupByTest(results);
const testAnalyses = new Map<string, StatisticalAnalysis>();
for (const [testId, testResults] of byTest) {
testAnalyses.set(testId, this.analyzeResults(testResults));
}
// Overall analysis
const overall = this.analyzeResults(results);
return {
overall,
byTest: testAnalyses,
concerns: this.identifyConcerns(testAnalyses),
recommendations: this.generateRecommendations(testAnalyses)
};
}
private analyzeResults(results: TestResult[]): StatisticalAnalysis {
const passes = results.filter(r => r.passed);
const passRate = passes.length / results.length;
// Calculate confidence interval for pass rate
const z = 1.96; // 95% confidence
const se = Math.sqrt((passRate * (1 - passRate)) / results.length);
const confidence95: [number, number] = [
Math.max(0, passRate - z * se),
Math.min(1, passRate + z * se)
];
const scores = results.map(r => r.score);
const latencies = results.map(r => r.latencyMs);
return {
passRate,
confidence95,
meanScore: this.mean(scores),
stdDevScore: this.stdDev(scores),
meanLatency: this.mean(latencies),
p95Latency: this.percentile(latencies, 95),
behaviorConsistency: this.calculateConsistency(results)
};
}
private calculateConsistency(results: TestResult[]): number {
// How consistent are the behaviors across runs?
if (results.length < 2) return 1;
const behaviorSets = results.map(r => new Set(r.actualBehaviors));
let consistencySum = 0;
let comparisons = 0;
for (let i = 0; i < behaviorSets.length; i++) {
for (let j = i + 1; j < behaviorSets.length; j++) {
const intersection = new Set(
[...behaviorSets[i]].filter(x => behaviorSets[j].has(x))
);
const union = new Set([...behaviorSets[i], ...behaviorSets[j]]);
consistencySum += intersection.size / union.size;
comparisons++;
}
}
return consistencySum / comparisons;
}
private identifyConcerns(analyses: Map<string, StatisticalAnalysis>): Concern[] {
const concerns: Concern[] = [];
for (const [testId, analysis] of analyses) {
if (analysis.passRate < 0.8) {
concerns.push({
testId,
type: 'low_pass_rate',
severity: analysis.passRate < 0.5 ? 'critical' : 'high',
message: `Pass rate ${(analysis.passRate * 100).toFixed(1)}% below threshold`
});
}
if (analysis.behaviorConsistency < 0.7) {
concerns.push({
testId,
type: 'inconsistent_behavior',
severity: 'high',
message: `Behavior consistency ${(analysis.behaviorConsistency * 100).toFixed(1)}% indicates unstable agent`
});
}
if (analysis.stdDevScore > 0.3) {
concerns.push({
testId,
type: 'high_variance',
severity: 'medium',
message: 'High score variance suggests unpredictable quality'
});
}
}
return concerns;
}
}
### Behavioral Contract Testing
Define and test agent behavioral invariants
**When to use**: Need to ensure agent stays within bounds
// Define behavioral contracts: what agent must/must not do
interface BehavioralContract {
name: string;
description: string;
mustBehaviors: BehaviorAssertion[];
mustNotBehaviors: BehaviorAssertion[];
contextual?: ConditionalBehavior[];
}
interface BehaviorAssertion {
behavior: string;
detector: (output: AgentOutput) => boolean;
severity: 'critical' | 'high' | 'medium' | 'low';
}
class BehavioralContractTester {
private contracts: BehavioralContract[] = [];
// Example contract for a customer service agent
defineCustomerServiceContract(): BehavioralContract {
return {
name: 'customer_service_agent',
description: 'Contract for customer service agent behavior',
mustBehaviors: [
{
behavior: 'responds_politely',
detector: (output) =>
!this.containsRudeLanguage(output.text),
severity: 'critical'
},
{
behavior: 'stays_on_topic',
detector: (output) =>
this.isRelevantToCustomerService(output.text),
severity: 'high'
},
{
behavior: 'acknowledges_issue',
detector: (output) =>
output.text.includes('understand') ||
output.text.includes('sorry to hear'),
severity: 'medium'
}
],
mustNotBehaviors: [
{
behavior: 'reveals_internal_info',
detector: (output) =>
this.containsInternalInfo(output.texRelated 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.