/retrospective
Run a session retrospective to analyze skill invocations, detect anti-patterns, and generate improvement recommendations.
Usage
/retrospective # Analyze current session
/retrospective --full # Full analysis with all details
/retrospective --export # Export analysis to file
/retrospective --project PILOT # Project-scoped analysis (ADR-159)
What This Command Does
- Extracts all skill invocations from the session
- Classifies outcomes (success, partial, failed)
- Detects anti-patterns (retries, confusion, incomplete)
- Calculates effectiveness scores per skill
- Generates prioritized improvement recommendations
- Updates skill-learnings.json for future sessions
When to Use
- At end of significant work sessions (30+ min)
- After skill failures or confusion
- During optimization sprints
- Before major deployments
Output Example
════════════════════════════════════════════════════════════════════
📊 SESSION RETROSPECTIVE ANALYSIS
════════════════════════════════════════════════════════════════════
Session: 2025-01-01-1430
Metrics:
- total_skill_invocations: 8
- successful_invocations: 6
- failed_invocations: 1
- overall_success_rate: 0.75
Skill Scores:
✅ git-workflow: 100%
✅ code-editor: 90%
⚠️ deployment: 50%
Anti-patterns Detected: 2
- excessive_retries: Multiple retries indicate unclear instructions
- context_confusion: Context confusion indicates poor skill scoping
Improvement Recommendations: 3
[high] deployment skill has 50% success rate
[medium] Add clearer examples to affected skills
════════════════════════════════════════════════════════════════════
Implementation
# The command runs the session-retrospective hook
python3 hooks/session-retrospective.py --manual --latest
Related Commands
| Command | Purpose |
|---|---|
/optimize-skills | View skill health dashboard |
/cx | Capture session context |
/cxq | Query past learnings |
Success Output
When retrospective completes successfully:
✅ COMMAND COMPLETE: /retrospective
Session: <session-id>
Skills analyzed: N
Success rate: X%
Recommendations: M
Learnings saved: skill-learnings.json
Completion Checklist
Before marking complete:
- Session data loaded
- Skill outcomes classified
- Anti-patterns detected
- Recommendations generated
- skill-learnings.json updated
Failure Indicators
This command has FAILED if:
- ❌ No session data available
- ❌ skill-learnings.json write failed
- ❌ Analysis script error
- ❌ Zero skills tracked in session
When NOT to Use
Do NOT use when:
- Session just started (no data yet)
- Only trivial interactions occurred
- Running in CI/CD (no session context)
Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Skip at session end | Lost learnings | Always run before exit |
| Ignore recommendations | Repeating mistakes | Review and apply fixes |
| Run too frequently | Incomplete data | Run at session end |
Principles
This command embodies:
- #9 Based on Facts - Uses actual invocation data
- #1 Recycle, Extend, Re-Use - Improves existing skills
- #10 Research When in Doubt - Analyzes patterns
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Status: Active Invocable: Yes