Analyze code review outputs to extract learnings and identify improvement opportunities
From piv-speckitnpx claudepluginhub plipowczan/claude-piv-skeleton --plugin piv-speckit[--last=N] [--review=path]commands/validation//learnAnalyzes current session for reusable patterns (error fixes, debugging, workarounds) and drafts Markdown skill file for user-confirmed save to ~/.claude/skills/learned/.
/learnAutonomously scouts codebase, learns structure, generates or updates documentation with validation-fix loops.
/learnAnalyzes current session for reusable patterns (error fixes, debugging, workarounds) and drafts Markdown skill file for user-confirmed save to ~/.claude/skills/learned/.
/learnToggles learning mode in vibe sessions to enable/disable educational micro-explanations after each step. Accepts 'on', 'off', or no argument to toggle.
/learnDisplays Claude Code best practices guide on sessions, memory, modes, shortcuts, worktrees, and prompting. Supports <topic> for specifics and 'save' to capture session lessons.
/learnRecords lessons learned from input, errors, sessions, or git history; tags patterns; suggests automations like commands/skills; updates CLAUDE.md. Also supports list, edit, remove.
Analyze code review artifacts to:
.claude/agents/reviews//piv-speckit:code-review)| Argument | Description | Example |
|---|---|---|
--last=N | Analyze last N reviews (default: all) | --last=5 |
--review=path | Analyze specific review | --review=.claude/agents/reviews/code-review-feature-x.md |
# Find all review artifacts
ls -la .claude/agents/reviews/*.md
List all available reviews and their dates.
For each review artifact, extract:
From ## Issues Found section:
From ## Detailed Analysis section:
From ## Positive Findings section:
From ## Recommendations section:
From ## Project Standards Compliance section:
Metadata:
Recurring Issues:
Anti-Patterns:
Good Patterns:
Create artifact at: .claude/agents/learning/insights/learning-insights-{timestamp}.md
Structure:
# Learning Insights: {Date Range}
**Date:** {ISO timestamp}
**Reviews Analyzed:** {count}
**Date Range:** {earliest} to {latest}
## Executive Summary
Analyzed {X} code reviews. Found {Y} total issues across {Z} categories.
{N} recurring issues identified as improvement candidates.
## Issues Summary
### By Severity
| Severity | Count | % of Total |
|----------|-------|------------|
| Critical | X | Y% |
| High | X | Y% |
| Medium | X | Y% |
| Low | X | Y% |
### By Category
| Category | Count | Recurring |
|----------|-------|-----------|
| Logic Errors | X | Y |
| Security | X | Y |
| Performance | X | Y |
| Code Quality | X | Y |
## Recurring Issues (Improvement Candidates)
### 1. {Issue Title}
- **Occurrences:** {N} times in {reviews}
- **Category:** {category}
- **Severity:** {severity}
- **Description:** {description}
- **Improvement Opportunity:** {what to add to rules/validation}
### 2. {Issue Title}
...
## Anti-Patterns Discovered
### 1. {Anti-Pattern Name}
- **Found in:** {reviews}
- **Description:** {what the bad pattern is}
- **Impact:** {why it's bad}
- **Prevention:** {how to prevent in rules/skills}
## Good Patterns Found
### 1. {Pattern Name}
- **Found in:** {reviews}
- **Description:** {what worked well}
- **Encourage:** {how to encourage in rules}
## Improvement Suggestions
Based on this analysis, consider:
1. **Rule Update:** Add {anti-pattern} to `.claude/rules/{file}.md`
- Priority: {priority}
- Rationale: {why}
2. **Validation Addition:** Add check for {issue} to validation pipeline
- Priority: {priority}
- Rationale: {why}
3. **Skill Enhancement:** Enhance {skill} to detect {pattern}
- Priority: {priority}
- Rationale: {why}
## Next Steps
- Run `/piv-speckit:suggest-improvement "{suggestion}"` to create improvement artifact
- Review and approve suggestions before applying
- Track effectiveness in learning metrics
Update .claude/agents/learning/learning-metrics.md with:
Output to user:
## Learning Analysis Complete
**Reviews Analyzed:** {N}
**Total Issues Found:** {X}
**Recurring Issues:** {Y} (improvement candidates)
**New Suggestions:** {Z}
**Learning Insights:** `.claude/agents/learning/insights/learning-insights-{timestamp}.md`
**Metrics Updated:** `.claude/agents/learning/learning-metrics.md`
**Next Steps:**
- Review learning insights for accuracy
- Run `/piv-speckit:suggest-improvement` for high-priority items
- Track learning effectiveness over time
Artifacts Created:
.claude/agents/learning/insights/learning-insights-{timestamp}.md - Detailed learning insightsArtifacts Updated:
.claude/agents/learning/learning-metrics.md - Aggregate metrics# Analyze all reviews
/piv-speckit:learn
# Analyze last 5 reviews only
/piv-speckit:learn --last=5
# Analyze specific review
/piv-speckit:learn --review=.claude/agents/reviews/code-review-feature-x.md
--last=5 to analyze recent trendsThis command can be automatically suggested after /piv-speckit:code-review completes.
The adaptive-learning skill will prompt: "Run learning analysis to capture insights?"