/improve-components - Component Quality Improvement
Orchestrates the systematic improvement of CODITECT framework components based on retrospective data, quality standards, and usage patterns.
Usage
/improve-components # Full improvement cycle
/improve-components --analyze # Analysis only (no changes)
/improve-components --report # Generate report only
/improve-components --priority P0 # Only critical priority
/improve-components --type skill # Only skills
/improve-components --component <name> # Single component
/improve-components --dry-run # Preview changes
Options
| Option | Description |
|---|---|
--analyze | Run analysis phase only, no modifications |
--report | Generate improvement report |
--priority P0|P1|P2 | Filter by priority level |
--type agent|skill|command|hook | Filter by component type |
--component <name> | Target specific component |
--dry-run | Show what would be changed |
--batch <n> | Process n components per run |
--auto-commit | Commit changes after improvement |
System Prompt
EXECUTION DIRECTIVE:
When the user invokes /improve-components, you MUST:
-
Load Retrospective Data
python3 hooks/session-retrospective.py --analyze-skills -
Identify Low-Scoring Components
python3 scripts/skill-pattern-analyzer.py --recommendations -
Run Analysis Phase
/agent component-analyzer "Analyze components with <70% success rate" -
Apply Enhancements (unless --analyze)
/agent component-enhancer "Apply improvements based on analysis" -
Validate and Report
python3 scripts/component-indexer.py
python3 scripts/update-component-counts.py
Improvement Phases
Phase 1: Discovery
# Get current skill scores
cat context-storage/skill-learnings.json | python3 -c "
import json, sys
d = json.load(sys.stdin)
for skill, data in d.get('skill_history', {}).items():
rate = data.get('success_rate', 0)
if rate < 0.7:
print(f'{skill}: {rate*100:.0f}%')
"
Phase 2: Analysis
For each low-scoring component:
- Load component file
- Check against SKILL-QUALITY-STANDARD.md
- Identify missing sections
- Calculate quality score
- Generate recommendations
Phase 3: Enhancement
For each component needing improvement:
- Add missing Success Output section
- Add missing Completion Checklist
- Add When NOT to Use section
- Add Anti-Patterns table
- Add Principles footer
Phase 4: Validation
# Re-classify all improved components
for f in <improved-files>; do
python3 scripts/moe_classifier/classify.py "$f" --update-frontmatter
done
# Re-index
python3 scripts/component-indexer.py
# Update counts
python3 scripts/update-component-counts.py
Phase 5: Reporting
Generate summary with:
- Components analyzed
- Components improved
- Before/after scores
- Remaining gaps
- Next cycle recommendations
Example Output
============================================================
CODITECT Component Improvement Cycle
============================================================
Phase 1: Discovery
Retrospective data loaded: 100 sessions
Low-scoring components identified: 25
Phase 2: Analysis
Analyzing: how.md → 49% (Grade F)
Analyzing: classify.md → 48% (Grade F)
Analyzing: work-next.md → 49% (Grade F)
...
Analysis complete: 25 components
Phase 3: Enhancement
Enhancing: how.md
+ Added Success Output section
+ Added Completion Checklist
+ Added When NOT to Use
→ New score: 72% (Grade C)
Enhancing: classify.md
+ Added Success Output section
+ Added Anti-Patterns table
→ New score: 71% (Grade C)
...
Enhancement complete: 18 components improved
Phase 4: Validation
✓ MoE classification updated: 18/18
✓ Markdown lint passed: 18/18
✓ Component index updated
Phase 5: Report
============================================================
✅ IMPROVEMENT CYCLE COMPLETE
Summary:
Components analyzed: 25
Components improved: 18
Components skipped: 7 (already compliant)
Score Changes:
Average before: 52%
Average after: 74%
Average gain: +22%
Top Improvements:
how.md: 49% → 72% (+23%)
classify.md: 48% → 71% (+23%)
work-next.md: 49% → 68% (+19%)
Remaining P0: 0
Remaining P1: 4
Next cycle recommended: 7 days
============================================================
Completion Checklist
Before marking complete:
- Retrospective data loaded
- Low-scoring components identified
- Analysis completed for all targets
- Enhancements applied (or --analyze mode)
- Validation passed
- Report generated
Success Output
✅ IMPROVEMENT CYCLE COMPLETE: /improve-components
Cycle: 2026-01-03
Duration: 15 minutes
Components: 18 improved / 25 analyzed
Average score improvement: +22%
All P0 issues resolved: Yes
Failure Indicators
This command has FAILED if:
- ❌ Retrospective data not available
- ❌ No components identified for improvement
- ❌ Enhancement phase errors
- ❌ Validation failures
When to Use
Use when:
- After retrospective shows low scores
- Before major releases
- Weekly maintenance cycle
- After adding new quality standards
Do NOT use when:
- During active sprint
- When components are being modified
- Without retrospective data
Related Components
| Component | Purpose |
|---|---|
component-analyzer | Analyzes quality |
component-enhancer | Applies improvements |
component-improvement skill | Full methodology |
SKILL-QUALITY-STANDARD.md | Quality requirements |
/optimize-skills | View skill health |
/retrospective | Generate retrospective |
Principles
This command embodies:
- #1 Recycle, Extend, Re-Use - Improves existing components
- #9 Based on Facts - Uses retrospective metrics
- #10 Research When in Doubt - Follows quality standard
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Version: 1.0.0 | Created: 2026-01-03 | Author: CODITECT Team