com um clique
conversation-analysis
// Cost-optimized conversation analysis using regex pre-filtering and focused LLM analysis for problematic conversations
// Cost-optimized conversation analysis using regex pre-filtering and focused LLM analysis for problematic conversations
| name | conversation-analysis |
| description | Cost-optimized conversation analysis using regex pre-filtering and focused LLM analysis for problematic conversations |
| argument-hint | question about your conversations or "analyze recent" |
| allowed-tools | ["Bash(git-ai:*)","Read","Glob","Task"] |
This skill analyzes your Bob AI assistant conversation history with a cost-optimized approach:
The script automatically detects:
Each conversation gets a score based on:
Default threshold: 30 - Only conversations scoring ≥30 are sent to LLM.
LLM analyzes ONLY what regex cannot determine:
Removed criteria (regex handles these):
First, see which conversations have problems:
ts-node skills/conversation-analysis/analyze-conversations.ts --limit 20 --show-scores
This shows problem scores for all conversations without LLM analysis.
Run analysis with automatic filtering:
# Default: analyzes conversations with score >= 30
ts-node skills/conversation-analysis/analyze-conversations.ts --limit 20
# Custom threshold
ts-node skills/conversation-analysis/analyze-conversations.ts --limit 20 --min-score 50
# Analyze all (override filtering)
ts-node skills/conversation-analysis/analyze-conversations.ts --limit 10 --all
The script outputs a focused prompt for LLM analysis. Send it to your LLM to get:
| Command | Purpose |
|---|---|
--show-scores | Display problem scores without LLM analysis |
--min-score <n> | Set minimum score threshold (default: 30) |
--all | Analyze all conversations (override filtering) |
--limit <n> | Number of recent conversations to check (default: 10) |
--days <n> | Only check conversations from last N days |
--question <text> | Custom question for LLM analysis |
| User mentions | Command to use |
|---|---|
| "recent" or nothing specified | --limit 10 |
| "last week" | --days 7 |
| "last month" | --days 30 |
| "all my conversations" | --limit 50 or higher |
| Specific issue | --question "Why do I get X error?" |
User asks: "What issues have I been having recently?"
# Step 1: Check scores
ts-node skills/conversation-analysis/analyze-conversations.ts --limit 20 --show-scores
# Step 2: Analyze problematic ones
ts-node skills/conversation-analysis/analyze-conversations.ts --limit 20
The script will:
User asks: "Why did I have so many errors last week?"
ts-node skills/conversation-analysis/analyze-conversations.ts --days 7 --min-score 40
This analyzes only conversations from last 7 days with score >= 40.
User asks: "Are my conversations getting better?"
# Recent conversations
ts-node skills/conversation-analysis/analyze-conversations.ts --days 7 --show-scores
# Older conversations
ts-node skills/conversation-analysis/analyze-conversations.ts --days 30 --show-scores
Compare average scores between periods.
--min-score to focus on severe issues or catch more problems--days helps identify trends over time--all for comprehensive analysis of successful patterns--question to guide LLM analysisThe LLM will receive a focused prompt and should return:
{
"conversations": [
{
"task_id": "...",
"root_cause": "Brief explanation of why problems occurred",
"user_intent": "What user was trying to achieve",
"solution_quality": "good|adequate|poor",
"key_lesson": "Main takeaway from this conversation"
}
],
"aggregate_insights": {
"common_root_causes": ["cause1", "cause2"],
"recurring_patterns": ["pattern1", "pattern2"],
"improvement_areas": ["area1", "area2"]
},
"recommendations": [
{
"priority": "high|medium|low",
"recommendation": "Specific actionable advice",
"rationale": "Why this will help"
}
]
}
Present this to the user in a readable format:
# Conversation Analysis Results
## Summary
- Total conversations checked: N
- Problematic conversations (score >= 30): M
- Conversations analyzed by LLM: M
## Problem Score Distribution
- High severity (70-100): X conversations
- Medium severity (40-69): Y conversations
- Low severity (30-39): Z conversations
## Root Causes Identified
1. **Cause 1** (occurred in N conversations)
- Description
- Example task IDs
2. **Cause 2** (occurred in M conversations)
- Description
- Example task IDs
## Key Recommendations
1. **[Priority]** Recommendation
- Rationale
- Expected impact
## Trends
- Average problem score: X
- Most common issue: Y
- Improvement areas: Z
| Metric | Before Optimization | After Optimization | Savings |
|---|---|---|---|
| Conversations sent to LLM | 10 | 2-3 | 70-80% |
| Prompt size (tokens) | ~2000/conv | ~1200/conv | 40% |
| Analysis criteria | 8 | 4 | 50% |
| Total cost reduction | - | - | 80-90% |
--show-scores to monitor conversation quality over time--min-score threshold based on your needs