499 lines
15 KiB
Markdown
499 lines
15 KiB
Markdown
---
|
|
name: workspace:improve
|
|
description: Analyze plugin and suggest improvements based on best practices and patterns
|
|
delegates-to: autonomous-agent:orchestrator
|
|
---
|
|
|
|
# Improve Plugin Command
|
|
|
|
## Command: `/workspace:improve`
|
|
|
|
Analyzes user interactions with the autonomous agent plugin and automatically generates structured improvement prompts for continuous plugin development. This command implements the key innovation of automatic learning by transforming user experiences into actionable development insights.
|
|
|
|
## Purpose
|
|
|
|
The `/improve-plugin` command serves as a bridge between user experiences and plugin evolution. It systematically analyzes how users interact with the plugin, identifies patterns, generates improvement suggestions, and stores them in a unified format that can drive continuous development.
|
|
|
|
## How It Works
|
|
|
|
### 1. Experience Data Collection
|
|
|
|
**Sources Analyzed**:
|
|
- **Pattern Database**: Task execution patterns and outcomes
|
|
- **Performance Metrics**: Quality scores, success rates, time efficiency
|
|
- **Usage Patterns**: Command frequency, skill utilization, agent delegation
|
|
- **Error Logs**: Common failures and recovery patterns
|
|
- **Feedback Traces**: Implicit feedback from task outcomes
|
|
- **Learning Evolution**: How performance has improved over time
|
|
|
|
### 2. Pattern Recognition
|
|
|
|
**Analysis Dimensions**:
|
|
- **Effectiveness Patterns**: Which approaches consistently succeed
|
|
- **Efficiency Patterns**: Time-to-resolution trends
|
|
- **Error Patterns**: Common failure modes and their contexts
|
|
- **Learning Patterns**: Skill acquisition and improvement rates
|
|
- **Usage Patterns**: Command popularity and feature utilization
|
|
- **Quality Patterns**: Factors influencing task quality scores
|
|
|
|
### 3. Improvement Prompt Generation
|
|
|
|
**Prompt Types Generated**:
|
|
- **Feature Enhancement**: New functionality suggestions based on usage gaps
|
|
- **Performance Optimization**: Speed and efficiency improvements
|
|
- **User Experience**: Workflow and interface improvements
|
|
- **Error Prevention**: Proactive measures to reduce common failures
|
|
- **Learning Enhancement**: Pattern recognition and knowledge transfer improvements
|
|
- **Integration Opportunities**: Ways to better connect components
|
|
|
|
### 4. Unified Storage System
|
|
|
|
**Storage Location**: `./improvements/unified-improvements.json`
|
|
|
|
**JSON Structure**:
|
|
```json
|
|
{
|
|
"analysis_id": "exp_analysis_2025_10_25_16_35_42",
|
|
"timestamp": "2025-10-25T16:35:42.123Z",
|
|
"model_used": "Claude Sonnet 4.5",
|
|
"analysis_scope": {
|
|
"timeframe": "last_30_days",
|
|
"data_sources": ["patterns", "performance", "usage", "errors"],
|
|
"total_patterns_analyzed": 47,
|
|
"performance_records_analyzed": 12,
|
|
"command_usage_analyzed": 89
|
|
},
|
|
"key_findings": {
|
|
"top_success_patterns": [
|
|
{
|
|
"pattern_type": "bug_fix",
|
|
"success_rate": 0.95,
|
|
"avg_quality_score": 92,
|
|
"common_approach": "systematic_error_analysis + pattern matching"
|
|
}
|
|
],
|
|
"improvement_opportunities": [
|
|
{
|
|
"area": "debugging_performance",
|
|
"current_score": 87,
|
|
"potential_improvement": 15,
|
|
"suggested_approach": "enhanced_error_pattern matching"
|
|
}
|
|
]
|
|
},
|
|
"improvement_prompts": [
|
|
{
|
|
"id": "improve_debugging_speed",
|
|
"priority": "high",
|
|
"category": "performance",
|
|
"prompt": "Based on analyzing 47 debugging tasks, implement pattern-based error detection that reduces average resolution time from 8.2 minutes to under 5 minutes. Focus on common error patterns: JavaScript ReferenceErrors, missing variables in destructuring, and API integration issues.",
|
|
"evidence": {
|
|
"sample_size": 47,
|
|
"current_performance": "8.2 min avg",
|
|
"target_performance": "<5 min avg",
|
|
"success_rate_impact": "Could improve from 87% to 95%"
|
|
}
|
|
}
|
|
],
|
|
"usage_insights": {
|
|
"most_used_commands": [
|
|
{"command": "/auto-analyze", "usage_count": 23, "success_rate": 0.91},
|
|
{"command": "/dashboard", "usage_count": 18, "success_rate": 1.0},
|
|
{"command": "/eval-debug", "usage_count": 12, "success_rate": 0.92}
|
|
],
|
|
"least_used_features": [
|
|
{"feature": "workspace organization", "usage_count": 3, "potential": "high"},
|
|
{"feature": "pattern validation", "usage_count": 5, "potential": "medium"}
|
|
]
|
|
},
|
|
"learning_trends": {
|
|
"quality_improvement_rate": "+0.8 points per week",
|
|
"speed_improvement_rate": "-12% time per task per week",
|
|
"pattern_utilization_efficiency": "+5% per week",
|
|
"areas_needing_attention": ["cross-project pattern transfer", "error prediction"]
|
|
},
|
|
"next_steps": {
|
|
"immediate_actions": [
|
|
"Implement debugging pattern database",
|
|
"Enhance error prediction capabilities",
|
|
"Create cross-project learning transfer"
|
|
],
|
|
"medium_term_goals": [
|
|
"Achieve 95% debugging success rate",
|
|
"Reduce average task time by 30%",
|
|
"Implement predictive error prevention"
|
|
],
|
|
"long_term_vision": [
|
|
"Autonomous error resolution",
|
|
"Self-optimizing performance",
|
|
"Continuous improvement without manual intervention"
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Basic Analysis
|
|
```bash
|
|
/improve-plugin
|
|
```
|
|
|
|
**Default Behavior**:
|
|
- Analyzes last 30 days of experience data
|
|
- Generates 3-5 high-priority improvement prompts
|
|
- Stores results in unified improvements file
|
|
- Provides summary in terminal
|
|
- Creates detailed analysis report
|
|
|
|
### Custom Timeframe
|
|
```bash
|
|
# Analyze last 7 days
|
|
/improve-plugin --days 7
|
|
|
|
# Analyze last 90 days
|
|
/improve-plugin --days 90
|
|
|
|
# Analyze since specific date
|
|
/improve-plugin --since 2025-09-01
|
|
```
|
|
|
|
### Specific Analysis Focus
|
|
```bash
|
|
# Focus on debugging performance
|
|
/improve-plugin --focus debugging
|
|
|
|
# Focus on quality improvements
|
|
/improve-plugin --focus quality
|
|
|
|
# Focus on speed/efficiency
|
|
/improve-plugin --focus efficiency
|
|
|
|
# Focus on user experience
|
|
/improve-plugin --focus ux
|
|
```
|
|
|
|
### Output Options
|
|
```bash
|
|
# Detailed JSON output
|
|
/improve-plugin --verbose
|
|
|
|
# Summary only
|
|
/improve-plugin --summary
|
|
|
|
# Save custom report location
|
|
/improve-plugin --output ./custom-improvements.json
|
|
|
|
# Generate actionable checklist
|
|
/improve-plugin --checklist
|
|
```
|
|
|
|
## Command Delegation
|
|
|
|
The `/improve-plugin` command delegates to the **learning-engine** agent for comprehensive pattern analysis:
|
|
|
|
### Learning-Engine Agent Responsibilities
|
|
|
|
1. **Experience Data Aggregation**
|
|
- Collect pattern database entries
|
|
- Analyze performance metrics
|
|
- Review command usage statistics
|
|
- Identify success/failure patterns
|
|
|
|
2. **Pattern Recognition**
|
|
- Detect recurring successful approaches
|
|
- Identify common failure modes
|
|
- Analyze learning progression
|
|
- Recognize optimization opportunities
|
|
|
|
3. **Improvement Generation**
|
|
- Create structured improvement prompts
|
|
- Prioritize by impact and feasibility
|
|
- Provide evidence-based recommendations
|
|
- Generate actionable next steps
|
|
|
|
4. **Learning Integration**
|
|
- Store analysis results in unified format
|
|
- Update effectiveness metrics
|
|
- Identify new patterns for future learning
|
|
- Track improvement implementation success
|
|
|
|
## Skills Utilized
|
|
|
|
### pattern-learning
|
|
- Recognize recurring successful patterns
|
|
- Identify knowledge transfer opportunities
|
|
- Analyze learning curve effectiveness
|
|
|
|
### code-analysis
|
|
- Analyze code quality improvement patterns
|
|
- Identify common code issues and their solutions
|
|
- Track refactoring effectiveness
|
|
|
|
### quality-standards
|
|
- Analyze quality score trends
|
|
- Identify quality improvement opportunities
|
|
- Track standards compliance patterns
|
|
|
|
### validation-standards
|
|
- Analyze error prevention effectiveness
|
|
- Identify validation pattern improvements
|
|
- Track proactive error detection
|
|
|
|
## Analysis Output
|
|
|
|
### Terminal Summary
|
|
|
|
```
|
|
🔍 PLUGIN IMPROVEMENT ANALYSIS COMPLETE
|
|
Timeframe: Last 30 days
|
|
Data Analyzed: 47 patterns, 89 command usages, 12 performance records
|
|
|
|
📊 KEY INSIGHTS:
|
|
* Average Quality Score: 88.7/100 (+3.2 vs previous period)
|
|
* Task Success Rate: 91% (+4% improvement)
|
|
* Average Resolution Time: 6.8 minutes (-18% improvement)
|
|
* Learning Velocity: Accelerating 🚀
|
|
|
|
🎯 TOP IMPROVEMENT OPPORTUNITIES:
|
|
1. Debugging Performance Optimization (High Priority)
|
|
- Current: 87% success rate, 8.2 min avg time
|
|
- Target: 95% success rate, <5 min avg time
|
|
|
|
2. Cross-Project Pattern Transfer (Medium Priority)
|
|
- Currently 12% transfer efficiency
|
|
- Target: 35% transfer efficiency
|
|
|
|
3. Error Prediction System (Medium Priority)
|
|
- Could prevent 23% of current failures
|
|
|
|
💾 IMPROVEMENTS STORED:
|
|
File: ./improvements/unified-improvements.json
|
|
Prompts Generated: 5
|
|
Priority: High (2), Medium (2), Low (1)
|
|
|
|
📈 LEARNING TRENDS:
|
|
Quality Score: +0.8 points/week
|
|
Speed Improvement: -12% time/week
|
|
Pattern Utilization: +5%/week
|
|
|
|
⏱ Analysis completed in 2.3 seconds
|
|
```
|
|
|
|
### Detailed Report File
|
|
|
|
**Location**: `.claude/data/reports/plugin-improvement-YYYY-MM-DD.md`
|
|
|
|
**Contents**:
|
|
- Complete analysis methodology
|
|
- Detailed pattern recognition results
|
|
- Comprehensive improvement prompts
|
|
- Usage statistics and trends
|
|
- Learning progression analysis
|
|
- Actionable implementation checklist
|
|
|
|
## Integration with Plugin Development
|
|
|
|
### Continuous Improvement Loop
|
|
|
|
1. **User Interaction** -> Plugin executes tasks
|
|
2. **Pattern Storage** -> Learning patterns captured
|
|
3. **Experience Analysis** -> `/improve-plugin` generates insights
|
|
4. **Improvement Implementation** -> Developers apply suggested improvements
|
|
5. **Performance Monitoring** -> Dashboard tracks impact
|
|
6. **Repeat** -> Continuous cycle of improvement
|
|
|
|
### Claude Code Integration
|
|
|
|
The unified improvements JSON file can be consumed by Claude Code to:
|
|
- Automatically suggest plugin improvements
|
|
- Prioritize development tasks based on user experience data
|
|
- Track the impact of implemented improvements
|
|
- Generate new feature ideas from usage patterns
|
|
|
|
### Example Improvement Implementation
|
|
|
|
```javascript
|
|
// Claude Code could read improvements.json and suggest:
|
|
// "Based on user experience analysis, implement debugging pattern database
|
|
// to reduce resolution time from 8.2 to <5 minutes"
|
|
```
|
|
|
|
## Data Sources Analyzed
|
|
|
|
### Pattern Database (`.claude-patterns/patterns.json`)
|
|
- Task execution patterns and outcomes
|
|
- Skill and agent effectiveness
|
|
- Quality score trends
|
|
- Learning progression data
|
|
|
|
### Performance Records (`.claude-patterns/enhanced_patterns.json`)
|
|
- Debugging performance metrics
|
|
- Quality improvement scores
|
|
- Time efficiency measurements
|
|
- Success rates by task type
|
|
|
|
### Command Usage Logs
|
|
- Command frequency and popularity
|
|
- Success rates by command
|
|
- Common usage patterns
|
|
- Feature utilization metrics
|
|
|
|
### Error Logs
|
|
- Common failure modes
|
|
- Error context analysis
|
|
- Recovery patterns
|
|
- Prevention opportunities
|
|
|
|
### Dashboard Analytics
|
|
- Real-time performance monitoring
|
|
- User interaction patterns
|
|
- Feature usage statistics
|
|
- System health trends
|
|
|
|
## Improvement Prompt Categories
|
|
|
|
### 1. Performance Optimization
|
|
- Faster task execution
|
|
- Better resource utilization
|
|
- Improved response times
|
|
- Enhanced efficiency metrics
|
|
|
|
### 2. Quality Enhancement
|
|
- Higher success rates
|
|
- Better error prevention
|
|
- Improved accuracy
|
|
- Enhanced reliability
|
|
|
|
### 3. User Experience
|
|
- Simplified workflows
|
|
- Better feedback systems
|
|
- More intuitive interfaces
|
|
- Enhanced discoverability
|
|
|
|
### 4. Feature Enhancement
|
|
- New functionality suggestions
|
|
- Expanded capabilities
|
|
- Better integration
|
|
- Enhanced automation
|
|
|
|
### 5. Error Prevention
|
|
- Proactive error detection
|
|
- Better validation systems
|
|
- Improved error messages
|
|
- Enhanced recovery mechanisms
|
|
|
|
### 6. Learning Enhancement
|
|
- Better pattern recognition
|
|
- Improved knowledge transfer
|
|
- Enhanced adaptation capabilities
|
|
- Smarter decision making
|
|
|
|
## Quality Assurance
|
|
|
|
### Validation Criteria
|
|
- **Data Completeness**: All relevant data sources analyzed
|
|
- **Pattern Accuracy**: Recognized patterns validated against actual outcomes
|
|
- **Prompt Quality**: Improvement prompts are actionable and evidence-based
|
|
- **Priority Accuracy**: High-impact improvements prioritized correctly
|
|
- **Format Consistency**: JSON structure follows unified schema
|
|
|
|
### Continuous Learning
|
|
- Analysis effectiveness is tracked and improved
|
|
- Prompt accuracy is measured against implementation results
|
|
- Pattern recognition is refined based on outcomes
|
|
- Learning algorithms are optimized continuously
|
|
|
|
## Examples of Generated Prompts
|
|
|
|
### Example 1: Debugging Performance
|
|
```json
|
|
{
|
|
"id": "debugging_pattern_database",
|
|
"priority": "high",
|
|
"category": "performance",
|
|
"prompt": "Implement a comprehensive debugging pattern database that stores successful debugging approaches and automatically suggests solutions for similar issues. Based on analysis of 47 debugging tasks, this could reduce average resolution time from 8.2 minutes to under 5 minutes and improve success rate from 87% to 95%.",
|
|
"evidence": {
|
|
"sample_size": 47,
|
|
"current_performance": "8.2 min avg, 87% success",
|
|
"target_performance": "<5 min avg, 95% success",
|
|
"confidence": "high"
|
|
}
|
|
}
|
|
```
|
|
|
|
### Example 2: Cross-Project Learning
|
|
```json
|
|
{
|
|
"id": "cross_project_pattern_transfer",
|
|
"priority": "medium",
|
|
"category": "learning",
|
|
"prompt": "Enhance the pattern learning system to transfer knowledge between different projects automatically. Current transfer efficiency is only 12%, but analysis shows potential for 35% efficiency by implementing context-aware pattern matching and project-agnostic skill identification.",
|
|
"evidence": {
|
|
"projects_analyzed": 8,
|
|
"current_efficiency": "12%",
|
|
"target_efficiency": "35%",
|
|
"implementation_complexity": "medium"
|
|
}
|
|
}
|
|
```
|
|
|
|
### Example 3: User Experience Enhancement
|
|
```json
|
|
{
|
|
"id": "predictive_error_prevention",
|
|
"priority": "medium",
|
|
"category": "ux",
|
|
"prompt": "Implement a predictive error prevention system that identifies potential issues before they occur based on pattern analysis. This could prevent 23% of current failures and improve overall user satisfaction by providing proactive guidance.",
|
|
"evidence": {
|
|
"failure_patterns_analyzed": 156,
|
|
"preventable_failures": "23%",
|
|
"implementation_approach": "pattern-based prediction",
|
|
"expected_impact": "high"
|
|
}
|
|
}
|
|
```
|
|
|
|
## Benefits
|
|
|
|
### For Users
|
|
- Continuous improvement based on actual usage patterns
|
|
- Proactive identification and resolution of pain points
|
|
- Enhanced performance and reliability over time
|
|
- Personalized optimization based on individual usage
|
|
|
|
### For Developers
|
|
- Data-driven development priorities
|
|
- Clear evidence-based improvement suggestions
|
|
- Understanding of real-world usage patterns
|
|
- Measurable impact of improvements
|
|
|
|
### For the Plugin
|
|
- Autonomous self-improvement capabilities
|
|
- Adaptive performance optimization
|
|
- Enhanced learning and pattern recognition
|
|
- Continuous evolution without manual intervention
|
|
|
|
## Implementation Notes
|
|
|
|
### Requirements
|
|
- Existing pattern database with sufficient history (minimum 10 tasks)
|
|
- Performance tracking system
|
|
- Command usage logging
|
|
- Access to learning patterns and metrics
|
|
|
|
### Limitations
|
|
- Requires minimum data volume for meaningful analysis
|
|
- Improvement prompts are suggestions, not guaranteed solutions
|
|
- Pattern recognition accuracy depends on data quality
|
|
- Implementation of improvements requires developer action
|
|
|
|
### Future Enhancements
|
|
- Real-time experience analysis
|
|
- Automatic improvement implementation
|
|
- Cross-plugin pattern sharing
|
|
- AI-driven improvement prioritization
|
|
|
|
---
|
|
|
|
This command represents a key innovation in autonomous plugin development, creating a continuous feedback loop where user experiences directly drive plugin evolution and improvement. |