performance-tracking
Track agent, skill, and model performance metrics for optimization. Use when measuring agent success rates, tracking model latency, analyzing routing effectiveness, or optimizing cost-per-task. Trigger keywords - "performance", "metrics", "tracking", "success rate", "agent performance", "model latency", "cost tracking", "optimization", "routing metrics".
What this skill does
# Performance Tracking
**Version:** 1.0.0
**Purpose:** Track agent, skill, and model performance metrics for continuous optimization
**Status:** Production Ready
## Overview
Performance tracking transforms workflows from "fire and forget" to **data-driven optimization systems**. By measuring what actually works, you can route tasks more effectively, identify failing patterns early, and reduce costs.
This skill provides battle-tested patterns for:
- **Agent success tracking** (completion rates, confidence scores, task type affinity)
- **Skill effectiveness** (activation counts, success correlation, usage patterns)
- **Model performance** (latency, cost, quality, provider comparison)
- **Routing optimization** (tier distribution, routing accuracy, cost efficiency)
- **Historical analysis** (trend detection, degradation alerts, pattern discovery)
Performance tracking enables **continuous improvement** by providing the data needed to make informed decisions about agent selection, model choice, and workflow routing.
### Why Track Performance
**Optimize Routing:**
- Identify which agents excel at specific task types
- Route complex tasks to high-confidence agents
- Avoid agents with low success rates for critical work
**Identify Failing Agents:**
- Detect agents with <70% success rate
- Alert when agent performance degrades
- Replace or retrain underperforming agents
**Reduce Costs:**
- Find cost-effective model alternatives
- Identify expensive agents with low success rates
- Optimize tier thresholds based on actual performance
**Improve Quality:**
- Track correlation between confidence scores and success
- Identify patterns in successful implementations
- Learn which models produce best results for task types
### What We Track
**Agent Metrics:**
- Total runs, success/failure counts
- Average confidence scores
- Task type distribution
- Last used timestamp
- Individual execution history
**Skill Metrics:**
- Activation counts per skill
- Last activation timestamps
- Success correlation (when skill active, what's success rate?)
- Co-activation patterns
**Model Metrics:**
- Total runs, success/failure counts
- Average latency (response time)
- Total cost (cumulative spend)
- Cost per successful task
- Last used timestamp
**Routing Metrics:**
- Tier distribution (how often each tier selected)
- Routing accuracy (did tier match complexity?)
- Cost efficiency (tier1 vs tier4 cost ratio)
- Decision history with outcomes
### Integration with task-complexity-router
The performance tracker provides critical feedback to the task-complexity-router:
```
Routing Feedback Loop:
1. Router selects tier based on complexity
→ task-complexity-router analyzes task
→ Routes to tier2 (medium complexity)
2. Agent executes task
→ Records: tier=2, agent=ui-developer, result=success
3. Performance tracker updates metrics
→ tier2 usage +1
→ ui-developer success +1
→ Confidence in tier2 routing increases
4. Future routing decisions informed by history
→ Router sees tier2 has 85% success rate
→ Router sees ui-developer excels at UI tasks
→ Router confidently routes similar tasks to tier2
```
---
## Metrics Schema
### JSON Structure (Version 1.0.0)
Store performance metrics in `.claude/agent-performance.json`:
```json
{
"schemaVersion": "1.0.0",
"lastUpdated": "2026-01-28T15:30:00Z",
"agents": {
"ui-developer": {
"totalRuns": 42,
"successCount": 38,
"failureCount": 4,
"avgConfidence": 0.85,
"lastUsed": "2026-01-28T15:30:00Z",
"taskTypes": {
"implement-component": 15,
"fix-styling": 12,
"refactor-ui": 8,
"review-code": 7
},
"history": [
{
"timestamp": "2026-01-28T15:30:00Z",
"taskType": "implement-component",
"result": "success",
"confidence": 0.90,
"duration": 45000,
"tier": 2,
"model": "claude-sonnet-4-5-20250929"
},
{
"timestamp": "2026-01-28T14:20:00Z",
"taskType": "fix-styling",
"result": "success",
"confidence": 0.85,
"duration": 30000,
"tier": 1,
"model": "claude-sonnet-4-5-20250929"
}
]
},
"backend-developer": {
"totalRuns": 28,
"successCount": 25,
"failureCount": 3,
"avgConfidence": 0.88,
"lastUsed": "2026-01-28T14:00:00Z",
"taskTypes": {
"implement-api": 12,
"fix-bug": 8,
"database-migration": 5,
"write-tests": 3
},
"history": []
}
},
"skills": {
"multi-model-validation": {
"activations": 15,
"lastActivated": "2026-01-28T15:00:00Z",
"successCorrelation": 0.92,
"coActivations": {
"quality-gates": 12,
"error-recovery": 8
}
},
"task-complexity-router": {
"activations": 68,
"lastActivated": "2026-01-28T15:30:00Z",
"successCorrelation": 0.85,
"coActivations": {
"multi-agent-coordination": 45,
"hierarchical-coordinator": 30
}
}
},
"models": {
"claude-sonnet-4-5-20250929": {
"totalRuns": 120,
"successCount": 108,
"failureCount": 12,
"avgLatency": 2500,
"totalCost": 0.45,
"lastUsed": "2026-01-28T15:30:00Z",
"taskTypePerformance": {
"code-review": { "success": 25, "failure": 2 },
"implementation": { "success": 40, "failure": 5 },
"testing": { "success": 20, "failure": 3 }
}
},
"x-ai/grok-code-fast-1": {
"totalRuns": 35,
"successCount": 30,
"failureCount": 5,
"avgLatency": 1800,
"totalCost": 0.08,
"lastUsed": "2026-01-28T13:00:00Z",
"taskTypePerformance": {
"code-review": { "success": 18, "failure": 2 },
"implementation": { "success": 12, "failure": 3 }
}
}
},
"routing": {
"tierDistribution": {
"tier1": 45,
"tier2": 30,
"tier3": 15,
"tier4": 8
},
"decisions": [
{
"timestamp": "2026-01-28T15:30:00Z",
"taskType": "implement-component",
"complexity": "medium",
"selectedTier": 2,
"agent": "ui-developer",
"result": "success",
"cost": 0.003
},
{
"timestamp": "2026-01-28T14:20:00Z",
"taskType": "fix-styling",
"complexity": "low",
"selectedTier": 1,
"agent": "ui-developer",
"result": "success",
"cost": 0.001
}
]
}
}
```
### Schema Field Definitions
**Agent Metrics:**
- `totalRuns`: Total task executions
- `successCount`: Tasks completed successfully
- `failureCount`: Tasks that failed or required retry
- `avgConfidence`: Rolling average of agent confidence scores (0.0-1.0)
- `lastUsed`: ISO-8601 timestamp of last execution
- `taskTypes`: Distribution of task types (understand agent specialization)
- `history`: Array of recent executions (max 100 entries, FIFO)
**Skill Metrics:**
- `activations`: Total times skill was triggered
- `lastActivated`: ISO-8601 timestamp
- `successCorrelation`: Success rate when this skill is active (0.0-1.0)
- `coActivations`: Skills frequently activated together (detect patterns)
**Model Metrics:**
- `totalRuns`: Total executions
- `successCount`/`failureCount`: Outcome tracking
- `avgLatency`: Average response time in milliseconds
- `totalCost`: Cumulative spend in USD
- `lastUsed`: ISO-8601 timestamp
- `taskTypePerformance`: Success/failure breakdown by task type
**Routing Metrics:**
- `tierDistribution`: Count of tasks routed to each tier
- `decisions`: Array of routing decisions with outcomes (max 100, FIFO)
---
## Tracking Patterns
### Pattern 1: Capturing Agent Performance
**After Agent Completes Task:**
```
Execution Flow:
1. Agent executes task
Task: ui-developer
Input: "Implement login form component"
Result: Success
Confidence: 0.90
Duration: 45 seconds
Tier: 2
Model: claudeRelated 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.