/piv-speckit:learn [--last=N] [--review=path]from piv-speckit
Analyzes code review artifacts to extract structured data, identify recurring patterns, and generate learning insights with improvement suggestions.
Ships in piv-speckit. Installing the plugin adds it to Claude Code.
Full methodology:
$CLAUDE_PLUGIN_ROOT/.claude-plugin/reference/skills-full/adaptive-learning-full.md
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?"
What the command file sets; muted values are Claude Code's defaults
code-review, learning, insights, pattern-analysis, improvement
7-day visitors to each command page
npx claudepluginhub galando/piv-speckit --plugin piv-speckit14 commands in this plugin
/implement-fixImplement Fix: Execute RCA SolutionImplement fix from Root Cause Analysis/rcaRoot Cause Analysis (RCA)Root Cause Analysis for GitHub issues, Jira tickets, or direct bug descriptions/executeExecute: Implement from PlanExecute implementation from tasks.md or single plan file/plan-featurePlan a New FeatureCreate comprehensive feature plan with split spec artifacts (spec, plan, tasks)/primePrime: Refresh Project Context (Optional)Manually refresh codebase context (optional — plan-feature auto-primes)/create-prdCreate PRD: Generate Product Requirements DocumentCreate a Product Requirements Document from conversationOther plugins' commands for the same job