learnship 1.9.24 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +2 -2
- package/.cursor-plugin/plugin.json +2 -2
- package/README.md +82 -25
- package/SKILL.md +17 -0
- package/agents/learnship-challenger.md +96 -0
- package/agents/learnship-code-reviewer.md +109 -0
- package/agents/learnship-executor.md +15 -0
- package/agents/learnship-ideation-agent.md +83 -0
- package/agents/learnship-solution-writer.md +140 -0
- package/bin/install.js +4 -0
- package/commands/learnship/challenge.md +22 -0
- package/commands/learnship/compound.md +22 -0
- package/commands/learnship/guard.md +21 -0
- package/commands/learnship/ideate.md +23 -0
- package/commands/learnship/review.md +23 -0
- package/commands/learnship/ship.md +21 -0
- package/commands/learnship/sync-docs.md +21 -0
- package/cursor-rules/learnship.mdc +7 -0
- package/gemini-extension.json +2 -2
- package/learnship/agents/challenger.md +52 -0
- package/learnship/agents/code-reviewer.md +81 -0
- package/learnship/agents/executor.md +15 -0
- package/learnship/agents/ideation-agent.md +54 -0
- package/learnship/agents/plan-checker.md +95 -0
- package/learnship/agents/solution-writer.md +64 -0
- package/learnship/references/model-profiles.md +41 -33
- package/learnship/references/planning-config.md +49 -0
- package/learnship/references/solution-schema.md +159 -0
- package/learnship/templates/agents.md +6 -1
- package/learnship/workflows/challenge.md +189 -0
- package/learnship/workflows/complete-milestone.md +9 -0
- package/learnship/workflows/compound.md +305 -0
- package/learnship/workflows/debug.md +7 -0
- package/learnship/workflows/discuss-milestone.md +5 -0
- package/learnship/workflows/execute-phase.md +24 -0
- package/learnship/workflows/guard.md +164 -0
- package/learnship/workflows/help.md +14 -2
- package/learnship/workflows/ideate.md +182 -0
- package/learnship/workflows/knowledge-base.md +8 -0
- package/learnship/workflows/ls.md +7 -3
- package/learnship/workflows/milestone-retrospective.md +45 -0
- package/learnship/workflows/next.md +3 -2
- package/learnship/workflows/plan-phase.md +23 -0
- package/learnship/workflows/progress.md +9 -3
- package/learnship/workflows/review.md +226 -0
- package/learnship/workflows/set-profile.md +6 -6
- package/learnship/workflows/settings.md +8 -8
- package/learnship/workflows/ship.md +219 -0
- package/learnship/workflows/sync-docs.md +159 -0
- package/learnship/workflows/validate-phase.md +4 -4
- package/learnship/workflows/verify-work.md +3 -0
- package/package.json +1 -1
- package/references/model-profiles.md +41 -33
- package/templates/config.json +13 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Codebase-grounded divergent thinking — discover what is worth working on
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Ideate
|
|
6
|
+
|
|
7
|
+
Codebase-grounded divergent ideation. Scans the actual codebase for hotspots, TODOs, test gaps, and friction points, then generates 15-25 improvement ideas across multiple thinking frames. Adversarial filter eliminates weak ideas. Presents top 5-7 ranked survivors.
|
|
8
|
+
|
|
9
|
+
**Usage:** `ideate` — open-ended ideation on the current project
|
|
10
|
+
**Usage:** `ideate [focus]` — focused ideation on a specific area, concept, or constraint
|
|
11
|
+
|
|
12
|
+
**Sequencing:** Run before `/new-project`, `/challenge`, or `/discuss-milestone` to discover what's worth building.
|
|
13
|
+
|
|
14
|
+
## Step 1: Scope
|
|
15
|
+
|
|
16
|
+
If a focus argument was provided, use it as the ideation lens.
|
|
17
|
+
If no argument, proceed with open-ended ideation.
|
|
18
|
+
|
|
19
|
+
Check for recent ideation work:
|
|
20
|
+
```bash
|
|
21
|
+
find .planning/ -name "*-ideation-*.md" -mtime -30 2>/dev/null
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If recent ideation exists, ask: "Found recent ideation work. Resume from it, or start fresh?"
|
|
25
|
+
|
|
26
|
+
## Step 2: Codebase Scan
|
|
27
|
+
|
|
28
|
+
Gather grounding context before generating ideas:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Project shape
|
|
32
|
+
cat AGENTS.md 2>/dev/null || cat CLAUDE.md 2>/dev/null || cat README.md 2>/dev/null
|
|
33
|
+
|
|
34
|
+
# TODOs and FIXMEs in codebase
|
|
35
|
+
grep -rn "TODO\|FIXME\|HACK\|XXX" --include="*.ts" --include="*.js" --include="*.py" --include="*.rb" --include="*.go" --include="*.rs" . 2>/dev/null | head -30
|
|
36
|
+
|
|
37
|
+
# Test coverage gaps (files without corresponding test files)
|
|
38
|
+
find . -name "*.ts" -not -name "*.test.*" -not -name "*.spec.*" -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null | head -20
|
|
39
|
+
|
|
40
|
+
# Recent git activity (hotspots)
|
|
41
|
+
git log --oneline -20 --format="%s" 2>/dev/null
|
|
42
|
+
git log --since="30 days ago" --format="" --name-only 2>/dev/null | sort | uniq -c | sort -rn | head -15
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Brownfield enhancement:** If `.planning/codebase/` exists, also read:
|
|
46
|
+
```bash
|
|
47
|
+
cat .planning/codebase/ARCHITECTURE.md 2>/dev/null
|
|
48
|
+
cat .planning/codebase/CONCERNS.md 2>/dev/null
|
|
49
|
+
cat .planning/codebase/TESTING.md 2>/dev/null
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Read compounded solutions and knowledge:
|
|
53
|
+
```bash
|
|
54
|
+
ls .planning/solutions/ 2>/dev/null
|
|
55
|
+
cat .planning/KNOWLEDGE.md 2>/dev/null
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Step 3: Divergent Ideation
|
|
59
|
+
|
|
60
|
+
Read `parallelization` from `.planning/config.json` (defaults to `false`).
|
|
61
|
+
|
|
62
|
+
**If `parallelization` is `true` (subagent mode):**
|
|
63
|
+
|
|
64
|
+
Spawn 3-4 ideation agents in parallel, each with a different thinking frame:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Task(
|
|
68
|
+
subagent_type="learnship-ideation-agent",
|
|
69
|
+
prompt="
|
|
70
|
+
<objective>
|
|
71
|
+
Generate 6-8 improvement ideas for this project using the [FRAME] lens.
|
|
72
|
+
Ground every idea in the codebase scan results — no abstract advice.
|
|
73
|
+
Return: title, summary, why_it_matters, evidence (specific files/patterns)
|
|
74
|
+
|
|
75
|
+
Frame: [one of the frames below]
|
|
76
|
+
Focus: [focus hint if provided]
|
|
77
|
+
</objective>
|
|
78
|
+
|
|
79
|
+
<context>
|
|
80
|
+
[codebase scan results]
|
|
81
|
+
[solutions and knowledge if available]
|
|
82
|
+
</context>
|
|
83
|
+
"
|
|
84
|
+
)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Thinking frames:**
|
|
88
|
+
1. **User/operator pain** — friction, confusion, error-prone workflows
|
|
89
|
+
2. **Inversion/removal** — what could be automated, eliminated, or simplified
|
|
90
|
+
3. **Assumption-breaking** — what if the current approach is wrong?
|
|
91
|
+
4. **Leverage/compounding** — what would make all future work easier?
|
|
92
|
+
|
|
93
|
+
**If `parallelization` is `false` (sequential mode):**
|
|
94
|
+
|
|
95
|
+
Using `@./agents/ideation-agent.md`, generate 15-25 ideas across all four frames sequentially.
|
|
96
|
+
|
|
97
|
+
## Step 4: Deduplicate & Filter
|
|
98
|
+
|
|
99
|
+
Merge ideas from all frames:
|
|
100
|
+
|
|
101
|
+
1. **Deduplicate** — merge ideas that describe the same improvement from different angles
|
|
102
|
+
2. **Adversarial filter** — for each idea, ask:
|
|
103
|
+
- Is this grounded in the actual codebase, or generic advice?
|
|
104
|
+
- Is this actionable within a reasonable scope?
|
|
105
|
+
- Does the evidence support the claimed impact?
|
|
106
|
+
- Would a senior engineer roll their eyes at this suggestion?
|
|
107
|
+
3. **Eliminate** weak ideas with explicit reasons
|
|
108
|
+
|
|
109
|
+
## Step 5: Rank Survivors
|
|
110
|
+
|
|
111
|
+
Rank the surviving ideas (target: 5-7) by:
|
|
112
|
+
|
|
113
|
+
| Factor | Weight |
|
|
114
|
+
|--------|--------|
|
|
115
|
+
| **Impact** — how much does this improve the project? | High |
|
|
116
|
+
| **Evidence** — how grounded is the idea in codebase data? | High |
|
|
117
|
+
| **Feasibility** — can this be done in a reasonable scope? | Medium |
|
|
118
|
+
| **Compounding** — does this make future work easier? | Medium |
|
|
119
|
+
|
|
120
|
+
## Step 6: Present Results
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
124
|
+
learnship ► IDEATION COMPLETE
|
|
125
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
126
|
+
|
|
127
|
+
Focus: [focus or "open-ended"]
|
|
128
|
+
Scanned: [N] files, [M] TODOs, [K] hotspots
|
|
129
|
+
Generated: [total] ideas → [filtered] eliminated → [survivors] survivors
|
|
130
|
+
|
|
131
|
+
## Top Ideas
|
|
132
|
+
|
|
133
|
+
### 1. [Title]
|
|
134
|
+
**Impact:** high | medium | low
|
|
135
|
+
**Evidence:** [specific files/patterns from codebase]
|
|
136
|
+
**Summary:** [2-3 sentences]
|
|
137
|
+
**Scope:** [estimated effort — small/medium/large]
|
|
138
|
+
|
|
139
|
+
### 2. [Title]
|
|
140
|
+
[...]
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
Eliminated ideas (with reasons):
|
|
145
|
+
- [idea]: [why eliminated]
|
|
146
|
+
[...]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Save the ideation artifact:
|
|
150
|
+
```bash
|
|
151
|
+
DATE=$(date +%Y%m%d)
|
|
152
|
+
node -e "require('fs').mkdirSync('.planning',{recursive:true})"
|
|
153
|
+
# Write ideation results to .planning/[DATE]-ideation-[slug].md
|
|
154
|
+
git add .planning/[DATE]-ideation-[slug].md
|
|
155
|
+
git commit -m "docs: ideation — [focus or 'open-ended'] ([N] survivors)"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Step 7: Route to Action
|
|
159
|
+
|
|
160
|
+
Present the "What's next?" options using the platform's blocking question tool:
|
|
161
|
+
|
|
162
|
+
- **Deep-dive an idea** → expand on the selected idea with more detail
|
|
163
|
+
- **Start a new project** → feed selected idea into `/new-project`
|
|
164
|
+
- **Add to current milestone** → feed into `/add-phase`
|
|
165
|
+
- **Challenge an idea** → run `/challenge [idea]` to stress-test it
|
|
166
|
+
- **Save and return later** → already saved to `.planning/`
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Learning Checkpoint
|
|
171
|
+
|
|
172
|
+
Read `learning_mode` from `.planning/config.json`.
|
|
173
|
+
|
|
174
|
+
**If `auto`:** After ideation, offer:
|
|
175
|
+
|
|
176
|
+
> 💡 **Learning moment:** Ideation is where divergent thinking gets practiced:
|
|
177
|
+
>
|
|
178
|
+
> `@agentic-learning brainstorm [top idea]` — Take the #1 idea and brainstorm collaboratively. Explore variations, edge cases, and alternative approaches.
|
|
179
|
+
>
|
|
180
|
+
> `@agentic-learning either-or [idea A] vs [idea B]` — Compare two competing ideas. Which is worth pursuing? Log the reasoning.
|
|
181
|
+
|
|
182
|
+
**If `manual`:** Add quietly: *"Tip: `@agentic-learning brainstorm [idea]` to explore the top idea collaboratively."*
|
|
@@ -32,6 +32,9 @@ find .planning/ -name "*-RESEARCH.md" | sort
|
|
|
32
32
|
|
|
33
33
|
# AGENTS.md regressions
|
|
34
34
|
grep -A 5 "### 20" AGENTS.md 2>/dev/null
|
|
35
|
+
|
|
36
|
+
# Compounded solutions
|
|
37
|
+
find .planning/solutions/ -name "*.md" -type f 2>/dev/null | sort
|
|
35
38
|
```
|
|
36
39
|
|
|
37
40
|
## Step 3: Extract Knowledge
|
|
@@ -53,6 +56,11 @@ From each source, extract structured knowledge items:
|
|
|
53
56
|
- "Don't Hand-Roll" entries → Knowledge item: `library`
|
|
54
57
|
- "Common Pitfalls" entries → Knowledge item: `pitfall`
|
|
55
58
|
|
|
59
|
+
**From compounded solutions (`.planning/solutions/`):**
|
|
60
|
+
- Bug track solutions → Knowledge item: `lesson` (root cause + prevention)
|
|
61
|
+
- Knowledge track solutions → Knowledge item: `pattern` or `anti-pattern`
|
|
62
|
+
- Read YAML frontmatter for classification (module, problem_type, severity, tags)
|
|
63
|
+
|
|
56
64
|
Deduplicate: if the same concept appears multiple times, merge into one entry with multiple `sources`.
|
|
57
65
|
|
|
58
66
|
## Step 4: Write / Update KNOWLEDGE.md
|
|
@@ -119,10 +119,14 @@ Determine the next action (same logic as `progress`):
|
|
|
119
119
|
5. **Plans = 0, no CONTEXT.md** → needs discussion
|
|
120
120
|
- Next: `discuss-phase [X]`
|
|
121
121
|
|
|
122
|
-
6. **All plans have summaries,
|
|
122
|
+
6. **All plans have summaries, UAT not done** → verify before moving on
|
|
123
|
+
- Next: `verify-work [X]`
|
|
124
|
+
|
|
125
|
+
7. **All plans have summaries, UAT passed, more phases remain** → move forward
|
|
123
126
|
- Next: `discuss-phase [X+1]`
|
|
127
|
+
- Suggest: `/review` → `/ship` → `/compound` before starting next phase
|
|
124
128
|
|
|
125
|
-
|
|
129
|
+
8. **All phases done** → ready to ship
|
|
126
130
|
- Next: `audit-milestone`
|
|
127
131
|
|
|
128
132
|
Display clearly, then **ask**:
|
|
@@ -142,4 +146,4 @@ If the user says yes (or "go", "do it", "run it", "proceed") — immediately inv
|
|
|
142
146
|
|
|
143
147
|
- `/ls` is an alias for the status + routing logic in `progress`. Use either.
|
|
144
148
|
- For full auto-pilot (no prompt), use `/next` instead.
|
|
145
|
-
- To see all
|
|
149
|
+
- To see all 49 available commands: `/help`
|
|
@@ -67,6 +67,51 @@ Ask each question and wait for a real answer before moving to the next. These ar
|
|
|
67
67
|
**Question 5: What should carry forward?**
|
|
68
68
|
"Any patterns, decisions, or lessons from this milestone that should explicitly inform the next one? What goes into the decision register?"
|
|
69
69
|
|
|
70
|
+
## Step 2b: Quantitative Summary
|
|
71
|
+
|
|
72
|
+
Gather data-driven metrics for this milestone:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Commits per phase
|
|
76
|
+
for dir in .planning/phases/*/; do
|
|
77
|
+
PHASE=$(basename "$dir")
|
|
78
|
+
COUNT=$(git log --oneline --all -- "$dir" 2>/dev/null | wc -l | tr -d ' ')
|
|
79
|
+
echo "$PHASE: $COUNT commits"
|
|
80
|
+
done
|
|
81
|
+
|
|
82
|
+
# Total LOC changed
|
|
83
|
+
git log --oneline --format="" --numstat $(git log --all --oneline .planning/ 2>/dev/null | tail -1 | cut -d' ' -f1)..HEAD 2>/dev/null | awk '{add+=$1; del+=$2} END {print "+" add " -" del " lines"}'
|
|
84
|
+
|
|
85
|
+
# Test file ratio
|
|
86
|
+
TOTAL_FILES=$(find . -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.rb" -o -name "*.go" 2>/dev/null | grep -v node_modules | grep -v .git | wc -l | tr -d ' ')
|
|
87
|
+
TEST_FILES=$(find . -name "*.test.*" -o -name "*.spec.*" -o -name "*_test.*" 2>/dev/null | grep -v node_modules | grep -v .git | wc -l | tr -d ' ')
|
|
88
|
+
echo "Test ratio: $TEST_FILES test files / $TOTAL_FILES total files"
|
|
89
|
+
|
|
90
|
+
# Debug sessions count
|
|
91
|
+
DEBUG_COUNT=$(ls .planning/debug/resolved/ 2>/dev/null | wc -l | tr -d ' ')
|
|
92
|
+
echo "Debug sessions resolved: $DEBUG_COUNT"
|
|
93
|
+
|
|
94
|
+
# Velocity (days from first to last commit in milestone)
|
|
95
|
+
FIRST_DATE=$(git log --reverse --format="%ai" .planning/ 2>/dev/null | head -1 | cut -d' ' -f1)
|
|
96
|
+
LAST_DATE=$(git log --format="%ai" .planning/ 2>/dev/null | head -1 | cut -d' ' -f1)
|
|
97
|
+
echo "Duration: $FIRST_DATE to $LAST_DATE"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Present the quantitative summary before the qualitative questions:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
## Quantitative Summary
|
|
104
|
+
|
|
105
|
+
| Metric | Value |
|
|
106
|
+
|--------|-------|
|
|
107
|
+
| Phases completed | [N] |
|
|
108
|
+
| Total commits | [N] |
|
|
109
|
+
| LOC changed | +[N] / -[N] |
|
|
110
|
+
| Test file ratio | [N]% |
|
|
111
|
+
| Debug sessions | [N] |
|
|
112
|
+
| Duration | [N] days |
|
|
113
|
+
```
|
|
114
|
+
|
|
70
115
|
## Step 3: Synthesize Themes
|
|
71
116
|
|
|
72
117
|
After all five answers, synthesize the key themes:
|
|
@@ -67,7 +67,8 @@ Evaluate in order:
|
|
|
67
67
|
| Plans exist, summaries < plans | `execute-phase [X]` |
|
|
68
68
|
| Plans = 0, CONTEXT.md exists | `plan-phase [X]` |
|
|
69
69
|
| Plans = 0, no CONTEXT.md | `discuss-phase [X]` |
|
|
70
|
-
| All summaries complete,
|
|
70
|
+
| All summaries complete, UAT not done | `verify-work [X]` |
|
|
71
|
+
| All summaries complete, UAT passed, more phases remain | `discuss-phase [X+1]` |
|
|
71
72
|
| All phases complete | `audit-milestone` |
|
|
72
73
|
|
|
73
74
|
---
|
|
@@ -97,4 +98,4 @@ If no — show `/ls` output so the user can choose manually.
|
|
|
97
98
|
|
|
98
99
|
- `/next` always confirms before acting (never fully silent).
|
|
99
100
|
- For status-only with manual choice, use `/ls` instead.
|
|
100
|
-
- To see all available commands: `/help`
|
|
101
|
+
- To see all 49 available commands: `/help`
|
|
@@ -53,6 +53,29 @@ Ask: "No CONTEXT.md found for Phase [X]. Plans will use research and requirement
|
|
|
53
53
|
|
|
54
54
|
**If CONTEXT.md exists:** Load it and confirm: "Using phase context from: [path]"
|
|
55
55
|
|
|
56
|
+
## Step 2b: Search Solutions for Prior Art
|
|
57
|
+
|
|
58
|
+
**Skip if:** `workflow.solutions_search` is `false` in config (defaults to `true`).
|
|
59
|
+
|
|
60
|
+
Search `.planning/solutions/` for prior art matching this phase's keywords:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Check if solutions directory exists
|
|
64
|
+
ls .planning/solutions/ 2>/dev/null
|
|
65
|
+
|
|
66
|
+
# Search for matching solutions by phase keywords
|
|
67
|
+
grep -ril "[phase_keyword1]\|[phase_keyword2]\|[phase_keyword3]" .planning/solutions/ 2>/dev/null
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If matches found, read the frontmatter (first 30 lines) of each match. Surface relevant prior solutions to the planner:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
Solutions prior art found:
|
|
74
|
+
- .planning/solutions/[category]/[file].md — [title] (relevant: [why])
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
These solutions provide context for planning — the planner should reference them to avoid reinventing known solutions.
|
|
78
|
+
|
|
56
79
|
## Step 3: Research Phase
|
|
57
80
|
|
|
58
81
|
**Skip if:** `--skip-research` flag, or `workflow.research` is `false` in config, or RESEARCH.md already exists (unless `--research` flag forces re-research).
|
|
@@ -101,9 +101,15 @@ Context: [✓ CONTEXT.md exists | — not yet]
|
|
|
101
101
|
- If CONTEXT.md exists: `▶ Next: plan-phase [X]`
|
|
102
102
|
- If no CONTEXT.md: `▶ Next: discuss-phase [X]` (recommended) or `plan-phase [X]`
|
|
103
103
|
|
|
104
|
-
5. **Summaries = plans AND plans > 0** →
|
|
105
|
-
-
|
|
106
|
-
|
|
104
|
+
5. **Summaries = plans AND plans > 0, UAT not done** → verify first
|
|
105
|
+
- `▶ Next: verify-work [X]`
|
|
106
|
+
|
|
107
|
+
6. **Summaries = plans, UAT passed, more phases remain** → move forward
|
|
108
|
+
- `▶ Next: discuss-phase [X+1]`
|
|
109
|
+
- Suggest: `/review` → `/ship` → `/compound` before starting next phase
|
|
110
|
+
|
|
111
|
+
7. **All phases done** → ready to ship
|
|
112
|
+
- `▶ Next: audit-milestone`
|
|
107
113
|
|
|
108
114
|
After presenting the recommended next step, ask:
|
|
109
115
|
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Multi-persona code review — correctness, testing, security, performance, maintainability
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Review
|
|
6
|
+
|
|
7
|
+
Multi-persona code review that examines changes through six lenses: correctness, testing, security, performance, maintainability, and adversarial. Produces a severity-ranked findings report with confidence scores.
|
|
8
|
+
|
|
9
|
+
**Usage:** `review` — review current branch changes
|
|
10
|
+
**Usage:** `review [mode]` — modes: `interactive` (default), `report-only`, `autofix`
|
|
11
|
+
|
|
12
|
+
**Sequencing:** Run after `verify-work` (spec compliance) and before `/ship` (deploy pipeline).
|
|
13
|
+
|
|
14
|
+
## Step 1: Determine Scope
|
|
15
|
+
|
|
16
|
+
Compute the diff:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Detect base branch
|
|
20
|
+
BASE_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||')
|
|
21
|
+
[ -z "$BASE_BRANCH" ] && BASE_BRANCH="main"
|
|
22
|
+
|
|
23
|
+
# Get current branch
|
|
24
|
+
CURRENT=$(git rev-parse --abbrev-ref HEAD)
|
|
25
|
+
|
|
26
|
+
# Compute diff
|
|
27
|
+
git fetch origin "$BASE_BRANCH" --quiet 2>/dev/null
|
|
28
|
+
BASE=$(git merge-base "origin/$BASE_BRANCH" HEAD 2>/dev/null || echo "origin/$BASE_BRANCH")
|
|
29
|
+
echo "FILES:" && git diff --name-only $BASE
|
|
30
|
+
echo "DIFF:" && git diff -U10 $BASE
|
|
31
|
+
echo "STATS:" && git diff --stat $BASE
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If no diff found: "Nothing to review — no changes against $BASE_BRANCH." Stop.
|
|
35
|
+
|
|
36
|
+
## Step 2: Discover Intent
|
|
37
|
+
|
|
38
|
+
Understand what the change is trying to accomplish:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
echo "BRANCH:" && git rev-parse --abbrev-ref HEAD
|
|
42
|
+
echo "COMMITS:" && git log --oneline ${BASE}..HEAD
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Combined with conversation context and any SUMMARY.md files from the current phase, write a 2-3 line intent summary:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Intent: [what the changes are trying to accomplish]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Step 3: Select Personas
|
|
52
|
+
|
|
53
|
+
Read the diff and file list. Select which review personas to activate:
|
|
54
|
+
|
|
55
|
+
**Always-on (every review):**
|
|
56
|
+
|
|
57
|
+
| Persona | Focus |
|
|
58
|
+
|---------|-------|
|
|
59
|
+
| **correctness** | Logic errors, edge cases, state bugs, error propagation |
|
|
60
|
+
| **testing** | Coverage gaps, weak assertions, brittle tests |
|
|
61
|
+
| **maintainability** | Coupling, complexity, naming, dead code, abstraction debt |
|
|
62
|
+
|
|
63
|
+
**Conditional (selected per diff):**
|
|
64
|
+
|
|
65
|
+
| Persona | Select when diff touches... |
|
|
66
|
+
|---------|---------------------------|
|
|
67
|
+
| **security** | Auth, public endpoints, user input, permissions, secrets |
|
|
68
|
+
| **performance** | DB queries, data transforms, caching, async, loops |
|
|
69
|
+
| **adversarial** | Diff ≥50 changed non-test lines, or auth/payments/data mutations |
|
|
70
|
+
|
|
71
|
+
**Brownfield enhancement:** If `.planning/codebase/CONVENTIONS.md` exists, the maintainability persona reads it for project-specific patterns.
|
|
72
|
+
|
|
73
|
+
Announce the review team:
|
|
74
|
+
```
|
|
75
|
+
Review team:
|
|
76
|
+
- correctness (always)
|
|
77
|
+
- testing (always)
|
|
78
|
+
- maintainability (always)
|
|
79
|
+
- security — [justification if selected]
|
|
80
|
+
- performance — [justification if selected]
|
|
81
|
+
- adversarial — [justification if selected]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Step 4: Run Review
|
|
85
|
+
|
|
86
|
+
Read `parallelization` from `.planning/config.json` (defaults to `false`).
|
|
87
|
+
|
|
88
|
+
**If `parallelization` is `true` (subagent mode — Claude Code, OpenCode, Codex):**
|
|
89
|
+
|
|
90
|
+
Spawn a dedicated code-reviewer agent for each selected persona:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
Task(
|
|
94
|
+
subagent_type="learnship-code-reviewer",
|
|
95
|
+
prompt="
|
|
96
|
+
<objective>
|
|
97
|
+
Review the following diff as the [PERSONA] reviewer.
|
|
98
|
+
Focus: [persona-specific focus areas]
|
|
99
|
+
Return findings as structured text with severity (P0-P3) and confidence (0.0-1.0).
|
|
100
|
+
Do NOT edit any files. Read-only review.
|
|
101
|
+
</objective>
|
|
102
|
+
|
|
103
|
+
<context>
|
|
104
|
+
Intent: [intent summary]
|
|
105
|
+
Files: [file list]
|
|
106
|
+
Diff: [diff content]
|
|
107
|
+
[If maintainability + CONVENTIONS.md exists: include conventions]
|
|
108
|
+
</context>
|
|
109
|
+
"
|
|
110
|
+
)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Wait for all personas to complete.
|
|
114
|
+
|
|
115
|
+
**If `parallelization` is `false` (sequential mode):**
|
|
116
|
+
|
|
117
|
+
Using `@./agents/code-reviewer.md` as your review persona, run each selected persona sequentially. For each persona:
|
|
118
|
+
|
|
119
|
+
1. Adopt the persona's focus lens
|
|
120
|
+
2. Read the diff through that lens
|
|
121
|
+
3. Record findings with severity and confidence
|
|
122
|
+
|
|
123
|
+
## Step 5: Merge & Deduplicate Findings
|
|
124
|
+
|
|
125
|
+
Combine findings from all personas:
|
|
126
|
+
|
|
127
|
+
1. **Confidence gate** — suppress findings below 0.60 confidence. Exception: P0 findings at 0.50+ survive.
|
|
128
|
+
2. **Deduplicate** — when multiple personas flag the same issue (same file + nearby lines + similar title), merge: keep highest severity, keep highest confidence, note which personas flagged it.
|
|
129
|
+
3. **Cross-persona agreement** — when 2+ personas flag the same issue, boost confidence by 0.10 (capped at 1.0).
|
|
130
|
+
4. **Sort** — order by severity (P0 first) → confidence (descending) → file path → line number.
|
|
131
|
+
|
|
132
|
+
## Step 6: Present Report
|
|
133
|
+
|
|
134
|
+
### Severity Scale
|
|
135
|
+
|
|
136
|
+
| Level | Meaning | Action |
|
|
137
|
+
|-------|---------|--------|
|
|
138
|
+
| **P0** | Critical breakage, exploitable vulnerability, data loss | Must fix before merge |
|
|
139
|
+
| **P1** | High-impact defect likely hit in normal usage | Should fix |
|
|
140
|
+
| **P2** | Moderate issue — edge case, perf regression, maintainability trap | Fix if straightforward |
|
|
141
|
+
| **P3** | Low-impact, minor improvement | Discretion |
|
|
142
|
+
|
|
143
|
+
Display:
|
|
144
|
+
```
|
|
145
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
146
|
+
learnship ► CODE REVIEW COMPLETE
|
|
147
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
148
|
+
|
|
149
|
+
Intent: [intent summary]
|
|
150
|
+
Reviewers: [list]
|
|
151
|
+
Mode: [interactive | report-only | autofix]
|
|
152
|
+
|
|
153
|
+
## Findings
|
|
154
|
+
|
|
155
|
+
### P0 — Critical
|
|
156
|
+
| # | File | Issue | Reviewer(s) | Confidence |
|
|
157
|
+
|---|------|-------|-------------|------------|
|
|
158
|
+
| 1 | [file:line] | [issue] | [personas] | [0.XX] |
|
|
159
|
+
|
|
160
|
+
### P1 — High
|
|
161
|
+
[table or "None"]
|
|
162
|
+
|
|
163
|
+
### P2 — Moderate
|
|
164
|
+
[table or "None"]
|
|
165
|
+
|
|
166
|
+
### P3 — Low
|
|
167
|
+
[table or "None"]
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Verdict
|
|
172
|
+
|
|
173
|
+
[PASS — no P0/P1 findings]
|
|
174
|
+
[PASS WITH CONCERNS — P1 findings present but manageable]
|
|
175
|
+
[FAIL — P0 findings must be resolved before merge]
|
|
176
|
+
|
|
177
|
+
Total: [N] findings ([P0 count] critical, [P1 count] high, [P2 count] moderate, [P3 count] low)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Step 7: Handle Mode
|
|
181
|
+
|
|
182
|
+
**Interactive (default):**
|
|
183
|
+
For each P0/P1 finding, ask: "Fix this now, or defer?"
|
|
184
|
+
- **Fix now** → apply the fix, commit
|
|
185
|
+
- **Defer** → note in report
|
|
186
|
+
|
|
187
|
+
**Report-only:**
|
|
188
|
+
Display the report. No edits, no commits. Stop.
|
|
189
|
+
|
|
190
|
+
**Autofix:**
|
|
191
|
+
Apply fixes for P0/P1 findings automatically where the fix is deterministic and safe. Commit each fix:
|
|
192
|
+
```bash
|
|
193
|
+
git add [files]
|
|
194
|
+
git commit -m "fix([scope]): [description from finding]"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Step 8: Suggest Next Steps
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
▶ Next steps:
|
|
201
|
+
- /ship — run the ship pipeline (test → lint → commit → push → PR)
|
|
202
|
+
- /compound — capture any notable patterns from the review
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Config Options
|
|
208
|
+
|
|
209
|
+
- `"workflow.review": true` — enable/disable the review workflow
|
|
210
|
+
- `"review.auto_after_verify": false` — automatically run review after verify-work passes
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Learning Checkpoint
|
|
215
|
+
|
|
216
|
+
Read `learning_mode` from `.planning/config.json`.
|
|
217
|
+
|
|
218
|
+
**If `auto`:** After review, offer:
|
|
219
|
+
|
|
220
|
+
> 💡 **Learning moment:** Code review is one of the highest-signal learning activities:
|
|
221
|
+
>
|
|
222
|
+
> `@agentic-learning learn [finding domain]` — Active retrieval on the concept behind the most significant finding. Why did it happen? How would you catch it earlier?
|
|
223
|
+
>
|
|
224
|
+
> `@agentic-learning quiz [codebase area]` — Test your understanding of the code area that had the most findings. Gaps in recall predict future bugs.
|
|
225
|
+
|
|
226
|
+
**If `manual`:** Add quietly: *"Tip: `@agentic-learning learn [domain]` to turn review findings into lasting patterns."*
|
|
@@ -15,9 +15,9 @@ If no argument provided:
|
|
|
15
15
|
Usage: set-profile [profile]
|
|
16
16
|
|
|
17
17
|
Profiles:
|
|
18
|
-
quality —
|
|
19
|
-
balanced —
|
|
20
|
-
budget —
|
|
18
|
+
quality — large-tier models for all agents (highest quality, highest cost)
|
|
19
|
+
balanced — large for planning, medium for execution (recommended)
|
|
20
|
+
budget — medium for writing, small for research/verification (lowest cost)
|
|
21
21
|
|
|
22
22
|
Current profile: [read from .planning/config.json]
|
|
23
23
|
```
|
|
@@ -70,9 +70,9 @@ git commit -m "chore(config): set model profile to [profile]"
|
|
|
70
70
|
```
|
|
71
71
|
Profile updated: [old] → [profile]
|
|
72
72
|
|
|
73
|
-
[quality] —
|
|
74
|
-
[balanced] —
|
|
75
|
-
[budget] —
|
|
73
|
+
[quality] — Large-tier agents for all tasks. Use for production milestones.
|
|
74
|
+
[balanced] — Large for planning, medium for execution. Best default.
|
|
75
|
+
[budget] — Medium/small tier. Use for prototyping or exploration.
|
|
76
76
|
|
|
77
77
|
Takes effect immediately on the next workflow run.
|
|
78
78
|
```
|
|
@@ -30,7 +30,7 @@ cp templates/config.json .planning/config.json 2>/dev/null || cat > .planning/co
|
|
|
30
30
|
"research": true,
|
|
31
31
|
"plan_check": true,
|
|
32
32
|
"verifier": true,
|
|
33
|
-
"
|
|
33
|
+
"validation": true
|
|
34
34
|
},
|
|
35
35
|
"git": {
|
|
36
36
|
"branching_strategy": "none",
|
|
@@ -67,7 +67,7 @@ Current configuration:
|
|
|
67
67
|
[5] Research agent: [on/off]
|
|
68
68
|
[6] Plan check agent: [on/off]
|
|
69
69
|
[7] Verifier agent: [on/off]
|
|
70
|
-
[8]
|
|
70
|
+
[8] Test validation: [on/off]
|
|
71
71
|
[9] Git branching: [current] (none | phase | milestone)
|
|
72
72
|
[10] Commit docs: [on/off]
|
|
73
73
|
|
|
@@ -102,9 +102,9 @@ Current: [current]. New value?
|
|
|
102
102
|
**[3] Model profile:**
|
|
103
103
|
```
|
|
104
104
|
Model profile controls which model tier each agent uses:
|
|
105
|
-
- quality:
|
|
106
|
-
- balanced:
|
|
107
|
-
- budget:
|
|
105
|
+
- quality: large-tier for all decision-making agents (highest cost, best results)
|
|
106
|
+
- balanced: large for planning, medium for execution (default — good balance)
|
|
107
|
+
- budget: medium for writing code, small for research/verification (lowest cost)
|
|
108
108
|
|
|
109
109
|
Current: [current]. New value?
|
|
110
110
|
```
|
|
@@ -127,9 +127,9 @@ Current: [current]. New value?
|
|
|
127
127
|
Current: [current]. New value? (on/off)
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
**[8]
|
|
130
|
+
**[8] Test validation:**
|
|
131
131
|
```
|
|
132
|
-
|
|
132
|
+
Test validation maps automated test coverage to requirements during plan-phase.
|
|
133
133
|
- on: plans include automated verify commands per task (recommended)
|
|
134
134
|
- off: skip validation research (good for rapid prototyping)
|
|
135
135
|
|
|
@@ -174,7 +174,7 @@ cat > .planning/config.json << EOF
|
|
|
174
174
|
"research": [true/false],
|
|
175
175
|
"plan_check": [true/false],
|
|
176
176
|
"verifier": [true/false],
|
|
177
|
-
"
|
|
177
|
+
"validation": [true/false]
|
|
178
178
|
},
|
|
179
179
|
"git": {
|
|
180
180
|
"branching_strategy": "[value]",
|