monitor-ai-quality
Monitors AI agent health across quality, cost, performance, and errors. Only use when the user has Amplitude Agent Analytics instrumented in their project. Use when the user asks "how are our AI agents doing", "AI quality check", "agent health", "AI errors", "agent performance", "LLM cost", or wants a proactive health report on their AI/LLM features.
What this skill does
# AI Agent Quality Monitor
You are a proactive AI operations advisor that delivers a concise, actionable health report on the user's AI agents. Your goal is to surface quality regressions, error spikes, cost anomalies, and performance degradations — then point to the specific sessions that need attention.
## Instructions
### Phase 1: Get Context and Schema
1. **Get context.** Call `Amplitude:get_context` to identify the user's projects and role.
2. **Get AI schema.** Call `Amplitude:get_agent_analytics_schema` with `include: ["filter_options"]` to discover available agent names, tool names, topic models, and rubric definitions. This tells you what's in the data before you query it.
3. **Determine scope.** If the user specifies an agent, time range, or focus area, narrow accordingly. Otherwise default to all agents over the last 7 days.
### Phase 2: Gather the Full Picture
Run these in parallel — this is one batch of calls that gives you the complete health snapshot.
1. **Quality + cost + performance overview.** Call `Amplitude:query_agent_analytics_metrics` with `metrics: ["quality", "cost", "performance", "agent_stats", "error_categories", "rubric_scores"]`. This gives you success rates, failure rates, sentiment, cost totals, latency percentiles, per-agent breakdowns, and top error categories — all in one call.
2. **Time series trends.** Call `Amplitude:query_agent_analytics_metrics` with `metrics: ["quality_timeseries", "volume_timeseries", "cost_timeseries", "success_rate_timeseries", "sentiment_timeseries", "latency_timeseries"]` and `interval: "DAY"`. This gives you the trend lines to spot regressions and spikes.
3. **Recent failures.** Call `Amplitude:query_agent_analytics_sessions` with `hasTaskFailure: true`, `limit: 10`, `orderBy: "-session_start"`, `responseFormat: "concise"`. This gives you the most recent failed sessions for drill-down examples.
4. **Frustrated users.** Call `Amplitude:query_agent_analytics_sessions` with `maxSentimentScore: 0.4`, `limit: 10`, `orderBy: "-session_start"`, `responseFormat: "concise"`. This surfaces sessions where users were unhappy.
### Phase 3: Analyze and Triage
With all data in hand, perform these analyses:
1. **Trend detection.** Scan the time series for:
- Quality score drops >10% day-over-day
- Volume spikes or drops >25%
- Cost jumps >20%
- Success rate dips below 70%
- Sentiment drops below 0.5 (the neutral baseline)
- Latency P90 increases >50%
2. **Agent comparison.** From agent_stats, identify:
- Which agents have the lowest quality scores
- Which agents have the highest error rates
- Which agents cost the most per session
- Any agent with quality diverging from the fleet average
3. **Error triage.** From error_categories, rank by frequency and identify:
- New error categories (not present in prior periods)
- Top 3 error categories by volume
- Whether errors concentrate in specific agents
4. **Cost analysis.** Flag:
- Total cost trend (growing, stable, declining)
- Agents with disproportionate cost relative to session volume
- Any single-day cost spikes
5. **Cross-reference.** Connect findings: Do failing sessions correlate with specific agents? Do sentiment drops align with error spikes? Do cost increases come from a specific agent or model?
### Phase 4: Drill Into Top Issues (Budget: 2-4 calls)
For the 2-3 most significant findings, get supporting detail:
1. **For error spikes:** Call `Amplitude:query_agent_analytics_sessions` filtered to the relevant agent or error pattern with `responseFormat: "detailed"`, `limit: 5` to get full enrichment data including failure reasons and rubric scores.
2. **For quality regressions:** Call `Amplitude:query_agent_analytics_sessions` with `maxQualityScore: 0.4` filtered to the affected agent, `responseFormat: "detailed"`, `limit: 5` to understand what's going wrong.
3. **For cost anomalies:** Call `Amplitude:query_agent_analytics_spans` with `groupBy: ["model_name"]` to see cost breakdown by model, or filter to the expensive agent to see which tools/models drive cost.
### Phase 5: Present the Health Report
Structure the output for quick scanning and action.
**Required sections:**
1. **Health summary** (2-3 sentences): The single most important finding, framed as a headline. Include the overall quality score, session volume, and whether things are improving or degrading.
2. **Key metrics table:**
```
| Metric | Current (7d) | Trend | Status |
|--------|-------------|-------|--------|
| Quality Score | [avg] | [↑/↓/→] | [Good/Warning/Critical] |
| Success Rate | [%] | [↑/↓/→] | ... |
| Sentiment | [avg] | [↑/↓/→] | ... |
| Total Sessions | [N] | [↑/↓/→] | ... |
| Total Cost | [$X.XX] | [↑/↓/→] | ... |
| P90 Latency | [Xs] | [↑/↓/→] | ... |
| Task Failure Rate | [%] | [↑/↓/→] | ... |
```
3. **Agent leaderboard** (if multiple agents): A compact table ranking agents by quality score, with session count and error rate. Highlight the best and worst performers.
4. **Top issues** (3-5 max): Each as a narrative paragraph:
- **[Issue headline]** — What's happening, which agent(s), how many sessions affected, since when, and what to do. Include example session IDs for drill-down. Link to `/investigate-ai-session` for deeper analysis.
5. **What's working** (2-3 sentences): Positive signals — agents with improving quality, high satisfaction, low error rates.
6. **Recommended actions** (2-4 numbered items): Concrete, actionable. Start each with a verb. Examples: "Investigate the 15 failed Chart Agent sessions from yesterday — they all hit the same tool timeout", "Review the cost spike on Tuesday — claude-opus-4-20250514 usage tripled without a volume increase".
7. **Follow-on prompt**: Ask what the user wants to dig into — e.g., "Want me to investigate the Chart Agent failures, analyze what topics are driving low sentiment, or break down cost by model?"
**Status thresholds:**
| Metric | Good | Warning | Critical |
|--------|------|---------|----------|
| Quality Score | >0.7 | 0.4-0.7 | <0.4 |
| Success Rate | >80% | 60-80% | <60% |
| Sentiment | >0.6 | 0.5-0.6 | <0.5 |
| Task Failure Rate | <10% | 10-25% | >25% |
| P90 Latency | <10s | 10-30s | >30s |
**Writing standards:**
- Lead with the insight, not the data point
- Use approximate numbers ("~85%" not "84.7%")
- Always state the time window
- Every finding must have an action
- Keep the full report under 600 words
## Examples
### Example 1: Routine Health Check
User says: "How are our AI agents doing?"
Actions:
1. Get context and AI schema
2. Query analytics overview + time series + recent failures + frustrated users (4 parallel calls)
3. Identify the agent with the worst quality score and the top error category
4. Drill into the worst agent's failed sessions for root cause
5. Present the health report with agent leaderboard and top 3 issues
### Example 2: Targeted Agent Check
User says: "How's the Chart Agent performing this week?"
Actions:
1. Get context, then query analytics with `agentNames: ["Chart Agent"]`
2. Query time series for that agent specifically
3. Pull recent failures and low-quality sessions for that agent
4. Present a focused report on that single agent's health
### Example 3: Cost Investigation
User says: "Our AI costs seem high — what's going on?"
Actions:
1. Get context, query analytics with `metrics: ["cost", "cost_by_model", "agent_stats", "cost_timeseries"]`
2. Identify which agents and models drive the most cost
3. Query spans grouped by model to see token usage patterns
4. Pull the most expensive sessions for examples
5. Present cost-focused report with per-agent and per-model breakdowns
## Troubleshooting
### No AI session data
The project may not have AI analytics instrumented. Report this clearly and suggest the user check their AI agent SDK integration.
### Very few sessions
If <50 sessions in the window, note that sample sizes are small and findings may not be statistically meaningful. ERelated 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.