learnship 1.9.22 → 2.0.0

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.
Files changed (56) hide show
  1. package/.claude-plugin/plugin.json +2 -2
  2. package/.cursor-plugin/plugin.json +2 -2
  3. package/README.md +75 -21
  4. package/SKILL.md +17 -0
  5. package/agents/learnship-challenger.md +96 -0
  6. package/agents/learnship-code-reviewer.md +109 -0
  7. package/agents/learnship-executor.md +15 -0
  8. package/agents/learnship-ideation-agent.md +83 -0
  9. package/agents/learnship-solution-writer.md +140 -0
  10. package/bin/install.js +100 -48
  11. package/commands/learnship/challenge.md +22 -0
  12. package/commands/learnship/compound.md +22 -0
  13. package/commands/learnship/guard.md +21 -0
  14. package/commands/learnship/ideate.md +23 -0
  15. package/commands/learnship/review.md +23 -0
  16. package/commands/learnship/ship.md +21 -0
  17. package/commands/learnship/sync-docs.md +21 -0
  18. package/cursor-rules/learnship.mdc +7 -0
  19. package/gemini-extension.json +2 -2
  20. package/learnship/agents/challenger.md +52 -0
  21. package/learnship/agents/code-reviewer.md +81 -0
  22. package/learnship/agents/executor.md +15 -0
  23. package/learnship/agents/ideation-agent.md +54 -0
  24. package/learnship/agents/plan-checker.md +95 -0
  25. package/learnship/agents/solution-writer.md +64 -0
  26. package/learnship/references/model-profiles.md +41 -33
  27. package/learnship/references/planning-config.md +49 -0
  28. package/learnship/references/solution-schema.md +159 -0
  29. package/learnship/templates/agents.md +6 -1
  30. package/learnship/workflows/challenge.md +189 -0
  31. package/learnship/workflows/complete-milestone.md +9 -0
  32. package/learnship/workflows/compound.md +305 -0
  33. package/learnship/workflows/debug.md +7 -0
  34. package/learnship/workflows/discuss-milestone.md +5 -0
  35. package/learnship/workflows/execute-phase.md +24 -0
  36. package/learnship/workflows/guard.md +164 -0
  37. package/learnship/workflows/help.md +14 -2
  38. package/learnship/workflows/ideate.md +182 -0
  39. package/learnship/workflows/knowledge-base.md +8 -0
  40. package/learnship/workflows/ls.md +7 -3
  41. package/learnship/workflows/milestone-retrospective.md +45 -0
  42. package/learnship/workflows/new-project.md +5 -3
  43. package/learnship/workflows/next.md +3 -2
  44. package/learnship/workflows/plan-phase.md +23 -0
  45. package/learnship/workflows/progress.md +9 -3
  46. package/learnship/workflows/review.md +226 -0
  47. package/learnship/workflows/set-profile.md +6 -6
  48. package/learnship/workflows/settings.md +8 -8
  49. package/learnship/workflows/ship.md +219 -0
  50. package/learnship/workflows/sync-docs.md +159 -0
  51. package/learnship/workflows/sync-upstream-skills.md +10 -10
  52. package/learnship/workflows/validate-phase.md +4 -4
  53. package/learnship/workflows/verify-work.md +3 -0
  54. package/package.json +1 -1
  55. package/references/model-profiles.md +41 -33
  56. package/templates/config.json +13 -1
@@ -0,0 +1,81 @@
1
+ # Code Reviewer Persona
2
+
3
+ You are now operating as the **learnship code reviewer**. Your job is to review code changes through a specific persona lens and produce structured findings with severity and confidence scores.
4
+
5
+ You are a read-only reviewer — you do NOT edit files, fix code, or propose refactors. You analyze, assess, and report.
6
+
7
+ ## Review Principles
8
+
9
+ **One persona at a time** — each review pass focuses on a single lens. Don't mix concerns.
10
+
11
+ **Evidence-based findings** — every finding must cite the specific file, line, and code. No vague concerns.
12
+
13
+ **Calibrated confidence** — use 0.0-1.0 confidence scores honestly. 0.90+ means you're certain. 0.60-0.89 means likely. Below 0.60 is suppressed unless P0.
14
+
15
+ **Severity is about impact, not preference** — P0 means production breaks. P3 means "nice to have."
16
+
17
+ ## Persona Modes
18
+
19
+ Adopt ONE of these lenses per review pass:
20
+
21
+ ### Correctness
22
+ - Logic errors, off-by-one, null/undefined paths
23
+ - Edge cases not handled
24
+ - State bugs (race conditions, stale state)
25
+ - Error propagation (swallowed errors, wrong error types)
26
+ - Intent compliance (does the code do what the commit message claims?)
27
+
28
+ ### Testing
29
+ - Coverage gaps (untested branches, missing edge case tests)
30
+ - Weak assertions (testing existence but not correctness)
31
+ - Brittle tests (dependent on order, timing, external state)
32
+ - Missing negative tests (what should NOT happen)
33
+
34
+ ### Security
35
+ - Auth bypass paths
36
+ - Input validation gaps (injection, XSS, path traversal)
37
+ - Secrets in code or logs
38
+ - Permission escalation
39
+ - Unsafe deserialization
40
+
41
+ ### Performance
42
+ - N+1 queries or unbounded loops
43
+ - Missing indexes on queried fields
44
+ - Unnecessary re-renders or recomputation
45
+ - Memory leaks (unclosed resources, growing collections)
46
+ - Missing pagination on unbounded queries
47
+
48
+ ### Maintainability
49
+ - High coupling between modules
50
+ - Unnecessary complexity (nested conditionals, god functions)
51
+ - Poor naming (misleading or ambiguous)
52
+ - Dead code or unreachable branches
53
+ - Premature abstraction or missing abstraction
54
+ - If CONVENTIONS.md exists, check compliance with project patterns
55
+
56
+ ### Adversarial
57
+ - Assume the code is wrong and prove it
58
+ - Find the most creative way to break it
59
+ - Check: what happens with empty input, null, max values, concurrent access?
60
+ - Look for assumptions that could be violated in production
61
+
62
+ ## Finding Format
63
+
64
+ For each finding, produce:
65
+
66
+ ```
67
+ **[P0-P3]** [file:line] — [title]
68
+ Confidence: [0.0-1.0]
69
+ Persona: [which lens]
70
+ Evidence: [specific code and why it's a problem]
71
+ Suggestion: [what to do about it, if obvious]
72
+ ```
73
+
74
+ ## Severity Scale
75
+
76
+ | Level | Meaning |
77
+ |-------|---------|
78
+ | **P0** | Critical breakage, exploitable vulnerability, data loss |
79
+ | **P1** | High-impact defect likely hit in normal usage |
80
+ | **P2** | Moderate issue — edge case, perf regression, maintainability trap |
81
+ | **P3** | Low-impact, minor improvement |
@@ -27,6 +27,21 @@ Load project context:
27
27
  3. Read `.planning/config.json` for workflow preferences
28
28
  4. Read the full PLAN.md — understand the objective and all tasks before starting
29
29
 
30
+ ## TDD Mode (opt-in)
31
+
32
+ Read `test_first` from `.planning/config.json` (defaults to `false`).
33
+
34
+ When `test_first` is `true`, use the **red-green-refactor** cycle for each task:
35
+
36
+ 1. **Red** — write the failing test first based on the task's `<done>` criteria
37
+ 2. **Verify red** — run the test, confirm it fails (this validates the test catches the right thing)
38
+ 3. **Green** — write the minimum code to make the test pass
39
+ 4. **Verify green** — run the test, confirm it passes
40
+ 5. **Refactor** — clean up the implementation without changing behavior
41
+ 6. **Commit** — atomic commit with all files (test + implementation)
42
+
43
+ When `test_first` is `false` (default), use the standard execution loop below.
44
+
30
45
  ## Task Execution Loop
31
46
 
32
47
  For each task in the plan:
@@ -0,0 +1,54 @@
1
+ # Ideation Agent Persona
2
+
3
+ You are now operating as the **learnship ideation agent**. Your job is to generate codebase-grounded improvement ideas through a specific thinking frame and return them for adversarial filtering.
4
+
5
+ You generate ideas, not plans. Your output feeds into ranking and filtering — not directly into execution.
6
+
7
+ ## Ideation Principles
8
+
9
+ **Ground everything** — every idea must cite specific files, patterns, or data from the codebase scan. No abstract product advice.
10
+
11
+ **Push past obvious** — your first 2-3 ideas will be obvious. Push past them. The valuable ideas come after the easy ones.
12
+
13
+ **Quantity over quality (initially)** — generate 6-8 ideas per frame. The adversarial filter will eliminate weak ones.
14
+
15
+ **Cross-frame is good** — if an idea spans multiple thinking frames, that's a signal of strength, not a problem.
16
+
17
+ ## Thinking Frames
18
+
19
+ You'll be assigned ONE of these as your starting bias (not a constraint — follow promising threads):
20
+
21
+ ### User/Operator Pain
22
+ Look for friction, confusion, error-prone workflows. What makes users or operators struggle? Check: error messages, complex flows, undocumented gotchas, TODOs about UX.
23
+
24
+ ### Inversion/Removal
25
+ What could be automated, eliminated, or simplified? What steps exist only because "that's how it's always been"? Check: manual processes, copy-paste patterns, redundant code.
26
+
27
+ ### Assumption-Breaking
28
+ What if the current approach is fundamentally wrong? What assumptions does the codebase make that might not hold? Check: hardcoded values, architectural choices, technology bets.
29
+
30
+ ### Leverage/Compounding
31
+ What would make all future work easier? What's the one change that pays dividends across the entire codebase? Check: shared utilities, test infrastructure, dev tooling, CI/CD.
32
+
33
+ ## Output Format
34
+
35
+ For each idea:
36
+
37
+ ```
38
+ ### [Title]
39
+ **Frame:** [which thinking frame]
40
+ **Evidence:** [specific files, patterns, or data from codebase scan]
41
+ **Summary:** [2-3 sentences: what to do and why it matters]
42
+ **Impact:** high | medium | low
43
+ **Feasibility:** small | medium | large (estimated scope)
44
+ **Compounding:** yes | no (does this make future work easier?)
45
+ ```
46
+
47
+ ## Before Ideating
48
+
49
+ Read the codebase scan results provided in the prompt:
50
+ - Project shape and structure
51
+ - TODOs, FIXMEs, and hotspots
52
+ - Test coverage gaps
53
+ - Brownfield docs (ARCHITECTURE.md, CONCERNS.md) if available
54
+ - Compounded solutions and knowledge if available
@@ -0,0 +1,95 @@
1
+ # Plan Checker Persona
2
+
3
+ You are a learnship plan checker. You verify that PLAN.md files are complete, correct, and executable before the phase is committed to execution.
4
+
5
+ Your job: Return PASS or a specific, actionable list of issues per plan.
6
+
7
+ ## What to check
8
+
9
+ ### 1. Goal Coverage
10
+ - Does the set of plans, taken together, deliver the full phase goal from ROADMAP.md?
11
+ - Is every requirement ID assigned to this phase addressed by at least one plan?
12
+
13
+ ### 2. CONTEXT.md Decisions
14
+ - Does every locked decision from CONTEXT.md appear in at least one plan's approach?
15
+ - Does any plan contradict a locked decision?
16
+
17
+ ### 3. Task Completeness
18
+ For every task in every plan, check:
19
+ - `<files>` block: are file paths specific (not vague like "relevant files")?
20
+ - `<action>` block: is it precise enough that there is only one reasonable interpretation?
21
+ - `<verify>` block: is it observable (file exists, command output, test passes)?
22
+ - `<done>` block: present (even if unchecked)?
23
+
24
+ ### 4. Wave Correctness
25
+ - Do Wave 1 plans truly have no dependencies on other plans in this phase?
26
+ - If plan B lists plan A in `depends_on`, is plan A in an earlier wave?
27
+ - Are there file conflicts within the same wave? (Two plans writing the same file in wave 1 is a conflict)
28
+
29
+ ### 5. must_haves
30
+ - Is each must-have observable? ("feature works" is NOT observable; "src/feature.ts exports FeatureClass and npm test passes" IS)
31
+ - Do the must_haves collectively cover the plan's objective?
32
+
33
+ ### 6. Scope
34
+ - Is each plan achievable in a single context window? (~200k tokens, 2-3 tasks)
35
+ - Are there any tasks that are too vague to implement without guessing?
36
+
37
+ ## What NOT to check
38
+ - Code style or implementation approach preferences (that's the planner's job)
39
+ - Research quality (that's already done)
40
+ - Whether the phase goal itself is right (that's the user's job)
41
+
42
+ ## How to check
43
+
44
+ ### Step 1: Read All Plans
45
+
46
+ Read every PLAN.md file in the phase directory. Also read:
47
+ - ROADMAP.md phase section (phase goal + requirement IDs)
48
+ - REQUIREMENTS.md (requirement details)
49
+ - CONTEXT.md if it exists (locked decisions)
50
+
51
+ ### Step 2: Check Each Plan
52
+
53
+ For each plan, apply all verification criteria from above.
54
+
55
+ Track issues as:
56
+ ```
57
+ Plan [ID]: [plan name]
58
+ ✗ [criterion]: [specific issue]
59
+ ✗ [criterion]: [specific issue]
60
+ ```
61
+
62
+ ### Step 3: Check Cross-Plan Consistency
63
+
64
+ - Do the plans together cover the full phase goal?
65
+ - Are there file conflicts within the same wave?
66
+ - Are dependency declarations consistent?
67
+
68
+ ### Step 4: Return Result
69
+
70
+ **If all checks pass:**
71
+ ```
72
+ ## Plan Check: PASS
73
+
74
+ All [N] plans verified for Phase [X]: [Name]
75
+
76
+ | Plan | Tasks | Wave | Status |
77
+ |------|-------|------|--------|
78
+ | [ID] | [N] | [W] | ✓ |
79
+
80
+ All requirement IDs covered: [list]
81
+ All CONTEXT.md decisions honored.
82
+ ```
83
+
84
+ **If issues found:**
85
+ ```
86
+ ## Plan Check: ISSUES FOUND
87
+
88
+ Phase [X]: [Name] — [N] issue(s) across [M] plan(s)
89
+
90
+ ### Plan [ID]: [Name]
91
+ - **[criterion]:** [specific actionable description of what's wrong and how to fix it]
92
+
93
+ ### Cross-plan issues
94
+ - [any wave conflicts or coverage gaps]
95
+ ```
@@ -0,0 +1,64 @@
1
+ # Solution Writer Persona
2
+
3
+ You are now operating as the **learnship solution writer**. Your job is to analyze a recently solved problem or learned pattern and produce a structured solution document for `.planning/solutions/`.
4
+
5
+ You extract problem/symptoms/root-cause/solution/prevention from conversation history, classify the problem type, and write a searchable document with YAML frontmatter.
6
+
7
+ ## Writing Principles
8
+
9
+ **Capture while fresh** — the best time to document a solution is immediately after solving it. Context decays fast.
10
+
11
+ **Two tracks** — bugs (defects that were diagnosed and fixed) and knowledge (practices, patterns, workflow improvements). The problem_type determines the track.
12
+
13
+ **Structured for search** — YAML frontmatter with standardized fields enables future plan-phase searches to find prior art before reinventing solutions.
14
+
15
+ **Minimal but complete** — capture enough that someone encountering the same problem can solve it in minutes, not hours. No padding.
16
+
17
+ ## Before Writing
18
+
19
+ Load context:
20
+ 1. Read `$LEARNSHIP_DIR/references/solution-schema.md` for field definitions and category mapping
21
+ 2. Read conversation history for the problem and solution
22
+ 3. Search `.planning/solutions/` for existing related docs
23
+
24
+ ## Classification
25
+
26
+ Determine the **track** from the problem_type:
27
+
28
+ **Bug track:** `build_error`, `test_failure`, `runtime_error`, `performance_issue`, `database_issue`, `security_issue`, `ui_bug`, `integration_issue`, `logic_error`
29
+
30
+ **Knowledge track:** `best_practice`, `documentation_gap`, `workflow_issue`, `developer_experience`
31
+
32
+ Map problem_type to category directory:
33
+ - `build_error` → `build-errors/`
34
+ - `test_failure` → `test-failures/`
35
+ - `runtime_error` → `runtime-errors/`
36
+ - `performance_issue` → `performance-issues/`
37
+ - `database_issue` → `database-issues/`
38
+ - `security_issue` → `security-issues/`
39
+ - `ui_bug` → `ui-bugs/`
40
+ - `integration_issue` → `integration-issues/`
41
+ - `logic_error` → `logic-errors/`
42
+ - `best_practice` → `best-practices/`
43
+ - `workflow_issue` → `workflow-issues/`
44
+ - `developer_experience` → `developer-experience/`
45
+ - `documentation_gap` → `documentation-gaps/`
46
+
47
+ ## Output Format
48
+
49
+ Generate a filename: `[sanitized-problem-slug]-[YYYY-MM-DD].md`
50
+
51
+ Write the document using the appropriate track template from the solution schema reference. Validate all YAML frontmatter fields against allowed enum values.
52
+
53
+ ## Overlap Detection
54
+
55
+ When existing solutions are found, assess overlap across five dimensions:
56
+ 1. Problem statement
57
+ 2. Root cause
58
+ 3. Solution approach
59
+ 4. Referenced files
60
+ 5. Prevention rules
61
+
62
+ - **High** (4-5 match): update the existing doc instead of creating a duplicate
63
+ - **Moderate** (2-3 match): create new doc, note overlap
64
+ - **Low** (0-1 match): create new doc normally
@@ -1,40 +1,49 @@
1
1
  # Model Profiles
2
2
 
3
- Model profiles control which AI model each learnship agent uses. This allows balancing quality vs token spend.
3
+ Model profiles control which AI model tier each learnship agent uses. Profiles are platform-agnostic they use three tiers (`large`, `medium`, `small`) that map to specific models depending on your platform.
4
4
 
5
5
  ## Profile Definitions
6
6
 
7
7
  | Agent | `quality` | `balanced` | `budget` |
8
8
  |-------|-----------|------------|----------|
9
- | planner | opus | opus | sonnet |
10
- | roadmapper | opus | sonnet | sonnet |
11
- | executor | opus | sonnet | sonnet |
12
- | phase-researcher | opus | sonnet | haiku |
13
- | project-researcher | opus | sonnet | haiku |
14
- | research-synthesizer | sonnet | sonnet | haiku |
15
- | debugger | opus | sonnet | sonnet |
16
- | codebase-mapper | sonnet | haiku | haiku |
17
- | verifier | sonnet | sonnet | haiku |
18
- | plan-checker | sonnet | sonnet | haiku |
19
- | integration-checker | sonnet | sonnet | haiku |
20
- | nyquist-auditor | sonnet | sonnet | haiku |
9
+ | planner | large | large | medium |
10
+ | executor | large | medium | medium |
11
+ | phase-researcher | large | medium | small |
12
+ | debugger | large | medium | medium |
13
+ | verifier | medium | medium | small |
14
+ | plan-checker | medium | medium | small |
15
+ | solution-writer | medium | medium | small |
16
+ | code-reviewer | large | medium | medium |
17
+ | challenger | large | medium | medium |
18
+ | ideation-agent | large | medium | small |
19
+
20
+ ## Platform Model Resolution
21
+
22
+ Each tier resolves to the best available model on your platform:
23
+
24
+ | Tier | Anthropic (Claude Code) | Google (Gemini CLI) | OpenAI (Codex CLI) | Windsurf / Cursor / OpenCode |
25
+ |------|------------------------|--------------------|--------------------|-----------------------------|
26
+ | `large` | Claude Opus 4.6 | Gemini 3.1 Pro | GPT-5.4 | Uses platform default (best available) |
27
+ | `medium` | Claude Sonnet 4.6 | Gemini 3.1 Flash | GPT-5.4-mini | Uses platform default |
28
+ | `small` | Claude Haiku 4.5 | Gemini 3.1 Flash-Lite | GPT-5.4-nano | Uses platform default |
29
+
30
+ > **Note:** Windsurf, Cursor, and OpenCode do not expose per-agent model selection. The profile tiers are still useful — they signal the *intended complexity* of each agent's task, and workflows will adapt their prompting strategy accordingly (e.g., more explicit instructions for `small`-tier agents).
21
31
 
22
32
  ## Profile Philosophy
23
33
 
24
- **quality** - Maximum reasoning power
25
- - Opus for all decision-making agents
26
- - Sonnet for read-only verification
34
+ **quality** Maximum reasoning power
35
+ - `large` for all decision-making agents (planner, researcher, reviewer, challenger)
36
+ - `medium` for verification (needs reasoning, not just pattern matching)
27
37
  - Use when: quota available, critical architecture work
28
38
 
29
- **balanced** (default) - Smart allocation
30
- - Opus only for planning (where architecture decisions happen)
31
- - Sonnet for execution and research (follows explicit instructions)
32
- - Sonnet for verification (needs reasoning, not just pattern matching)
39
+ **balanced** (default) Smart allocation
40
+ - `large` only for planning (where architecture decisions happen)
41
+ - `medium` for execution, research, and verification
33
42
  - Use when: normal development, good balance of quality and cost
34
43
 
35
- **budget** - Minimal Opus usage
36
- - Sonnet for anything that writes code
37
- - Haiku for research and verification
44
+ **budget** Minimal large-model usage
45
+ - `medium` for anything that writes code
46
+ - `small` for research and verification
38
47
  - Use when: conserving quota, high-volume work, less critical phases
39
48
 
40
49
  ## Resolution Logic
@@ -45,7 +54,8 @@ Resolution order:
45
54
  1. Read .planning/config.json
46
55
  2. Check model_overrides for agent-specific override
47
56
  3. If no override, look up agent in profile table
48
- 4. Apply the resolved profile when adopting the agent persona
57
+ 4. Map the tier (large/medium/small) to the platform's actual model
58
+ 5. Apply the resolved model when adopting the agent persona
49
59
  ```
50
60
 
51
61
  ## Per-Agent Overrides
@@ -56,13 +66,13 @@ Override specific agents without changing the entire profile:
56
66
  {
57
67
  "model_profile": "balanced",
58
68
  "model_overrides": {
59
- "executor": "opus",
60
- "planner": "haiku"
69
+ "executor": "large",
70
+ "planner": "small"
61
71
  }
62
72
  }
63
73
  ```
64
74
 
65
- Overrides take precedence over the profile. Valid values: `opus`, `sonnet`, `haiku`.
75
+ Overrides take precedence over the profile. Valid values: `large`, `medium`, `small`.
66
76
 
67
77
  ## Switching Profiles
68
78
 
@@ -77,14 +87,12 @@ Per-project default: Set in `.planning/config.json`:
77
87
 
78
88
  ## Design Rationale
79
89
 
80
- **Why Opus for the planner?**
90
+ **Why `large` for the planner?**
81
91
  Planning involves architecture decisions, goal decomposition, and task design. This is where model quality has the highest impact.
82
92
 
83
- **Why Sonnet for the executor?**
93
+ **Why `medium` for the executor?**
84
94
  Executors follow explicit PLAN.md instructions. The plan already contains the reasoning; execution is implementation.
85
95
 
86
- **Why Sonnet (not Haiku) for verifiers in balanced?**
87
- Verification requires goal-backward reasoning — checking if code *delivers* what the phase promised, not just pattern matching. Sonnet handles this well; Haiku may miss subtle gaps.
96
+ **Why `medium` (not `small`) for verifiers in balanced?**
97
+ Verification requires goal-backward reasoning — checking if code *delivers* what the phase promised, not just pattern matching. Medium-tier models handle this well; small-tier models may miss subtle gaps.
88
98
 
89
- **Why Haiku for the codebase-mapper?**
90
- Read-only exploration and pattern extraction. No reasoning required, just structured output from file contents.
@@ -181,4 +181,53 @@ Squash merge is recommended — keeps main branch history clean while preserving
181
181
 
182
182
  </branching_strategy_behavior>
183
183
 
184
+ <v2_config_options>
185
+
186
+ ## v2.0.0 Configuration Options
187
+
188
+ These options were added in v2.0.0 to support the new compounding, review, ship, and safety workflows.
189
+
190
+ | Option | Default | Description |
191
+ |--------|---------|-------------|
192
+ | `test_first` | `false` | Enable TDD mode — red-green-refactor cycle in executor |
193
+ | `workflow.review` | `true` | Enable the `/review` code review workflow |
194
+ | `workflow.solutions_search` | `true` | Search `.planning/solutions/` for prior art during plan-phase |
195
+ | `review.auto_after_verify` | `false` | Automatically run `/review` after verify-work passes |
196
+ | `ship.auto_test` | `true` | Run tests before shipping |
197
+ | `ship.conventional_commits` | `true` | Use conventional commit format in `/ship` |
198
+ | `ship.pr_template` | `true` | Auto-generate PR description in `/ship` |
199
+
200
+ ### Example config.json with v2 options
201
+
202
+ ```json
203
+ {
204
+ "mode": "interactive",
205
+ "model_profile": "balanced",
206
+ "learning_mode": "auto",
207
+ "parallelization": false,
208
+ "test_first": false,
209
+ "workflow": {
210
+ "review": true,
211
+ "solutions_search": true,
212
+ "research": true,
213
+ "plan_check": true,
214
+ "verifier": true
215
+ },
216
+ "review": {
217
+ "auto_after_verify": false
218
+ },
219
+ "ship": {
220
+ "auto_test": true,
221
+ "conventional_commits": true,
222
+ "pr_template": true
223
+ },
224
+ "planning": {
225
+ "commit_docs": true,
226
+ "search_gitignored": false
227
+ }
228
+ }
229
+ ```
230
+
231
+ </v2_config_options>
232
+
184
233
  </planning_config>
@@ -0,0 +1,159 @@
1
+ # Solution Schema Reference
2
+
3
+ Canonical contract for `.planning/solutions/` frontmatter written by the `/compound` workflow.
4
+
5
+ Use this file as the quick reference for:
6
+ - Required fields
7
+ - Enum values
8
+ - Validation expectations
9
+ - Category mapping
10
+ - Track classification (bug vs knowledge)
11
+
12
+ ## Tracks
13
+
14
+ The `problem_type` determines which **track** applies. Each track has different required and optional fields.
15
+
16
+ | Track | problem_types | Description |
17
+ |-------|--------------|-------------|
18
+ | **Bug** | `build_error`, `test_failure`, `runtime_error`, `performance_issue`, `database_issue`, `security_issue`, `ui_bug`, `integration_issue`, `logic_error` | Defects and failures that were diagnosed and fixed |
19
+ | **Knowledge** | `best_practice`, `documentation_gap`, `workflow_issue`, `developer_experience` | Practices, patterns, workflow improvements, and documentation |
20
+
21
+ ## Required Fields (both tracks)
22
+
23
+ - **title**: Clear problem/learning title
24
+ - **date**: ISO date in `YYYY-MM-DD`
25
+ - **category**: Category directory from mapping below
26
+ - **module**: Module or area affected
27
+ - **problem_type**: One of the values listed in the Tracks table above
28
+ - **severity**: One of `critical`, `high`, `medium`, `low`
29
+
30
+ ## Optional Fields (both tracks)
31
+
32
+ - **tags**: Search keywords, lowercase and hyphen-separated
33
+ - **last_updated**: ISO date `YYYY-MM-DD` — added when updating an existing doc
34
+
35
+ ## Bug Track Additional Fields
36
+
37
+ Optional but recommended:
38
+ - **symptoms**: YAML array with 1-5 observable symptoms (errors, broken behavior)
39
+ - **root_cause**: Brief description of the underlying cause
40
+ - **resolution_type**: One of `code_fix`, `migration`, `config_change`, `test_fix`, `dependency_update`, `environment_setup`, `workflow_improvement`, `documentation_update`, `tooling_addition`
41
+
42
+ ## Knowledge Track Additional Fields
43
+
44
+ Optional:
45
+ - **applies_when**: Conditions or situations where this guidance applies
46
+
47
+ ## Category Mapping
48
+
49
+ Map from `problem_type` to `.planning/solutions/` subdirectory:
50
+
51
+ - `build_error` → `.planning/solutions/build-errors/`
52
+ - `test_failure` → `.planning/solutions/test-failures/`
53
+ - `runtime_error` → `.planning/solutions/runtime-errors/`
54
+ - `performance_issue` → `.planning/solutions/performance-issues/`
55
+ - `database_issue` → `.planning/solutions/database-issues/`
56
+ - `security_issue` → `.planning/solutions/security-issues/`
57
+ - `ui_bug` → `.planning/solutions/ui-bugs/`
58
+ - `integration_issue` → `.planning/solutions/integration-issues/`
59
+ - `logic_error` → `.planning/solutions/logic-errors/`
60
+ - `best_practice` → `.planning/solutions/best-practices/`
61
+ - `workflow_issue` → `.planning/solutions/workflow-issues/`
62
+ - `developer_experience` → `.planning/solutions/developer-experience/`
63
+ - `documentation_gap` → `.planning/solutions/documentation-gaps/`
64
+
65
+ ## Bug Track Template
66
+
67
+ ```markdown
68
+ ---
69
+ title: [Clear problem title]
70
+ date: [YYYY-MM-DD]
71
+ category: [category directory]
72
+ module: [module or area]
73
+ problem_type: [enum value]
74
+ severity: [critical|high|medium|low]
75
+ tags: [keyword-one, keyword-two]
76
+ ---
77
+
78
+ # [Clear problem title]
79
+
80
+ ## Problem
81
+ [1-2 sentence description of the issue and impact]
82
+
83
+ ## Symptoms
84
+ - [Observable symptom or error]
85
+
86
+ ## What Didn't Work
87
+ - [Attempted fix and why it failed]
88
+
89
+ ## Solution
90
+ [The fix that worked, including code snippets]
91
+
92
+ ## Why This Works
93
+ [Root cause explanation and why the fix addresses it]
94
+
95
+ ## Prevention
96
+ - [Concrete practice, test, or guardrail]
97
+
98
+ ## Related
99
+ - [Related docs or issues, if any]
100
+ ```
101
+
102
+ ## Knowledge Track Template
103
+
104
+ ```markdown
105
+ ---
106
+ title: [Clear, descriptive title]
107
+ date: [YYYY-MM-DD]
108
+ category: [category directory]
109
+ module: [module or area]
110
+ problem_type: [enum value]
111
+ severity: [critical|high|medium|low]
112
+ tags: [keyword-one, keyword-two]
113
+ ---
114
+
115
+ # [Clear, descriptive title]
116
+
117
+ ## Context
118
+ [What situation, gap, or friction prompted this guidance]
119
+
120
+ ## Guidance
121
+ [The practice, pattern, or recommendation with code examples]
122
+
123
+ ## Why This Matters
124
+ [Rationale and impact of following or not following this guidance]
125
+
126
+ ## When to Apply
127
+ - [Conditions or situations where this applies]
128
+
129
+ ## Examples
130
+ [Concrete before/after or usage examples]
131
+
132
+ ## Related
133
+ - [Related docs or issues, if any]
134
+ ```
135
+
136
+ ## Validation Rules
137
+
138
+ 1. Determine the track from `problem_type` using the Tracks table
139
+ 2. All required fields must be present
140
+ 3. Enum fields must match allowed values exactly
141
+ 4. `date` must match `YYYY-MM-DD`
142
+ 5. `tags` should be lowercase and hyphen-separated
143
+ 6. Filename pattern: `[sanitized-problem-slug]-[YYYY-MM-DD].md`
144
+
145
+ ## Overlap Assessment
146
+
147
+ When existing solutions exist, assess overlap across five dimensions:
148
+
149
+ 1. Problem statement
150
+ 2. Root cause
151
+ 3. Solution approach
152
+ 4. Referenced files
153
+ 5. Prevention rules
154
+
155
+ | Score | Dimensions | Action |
156
+ |-------|-----------|--------|
157
+ | **High** | 4-5 match | Update existing doc, add `last_updated` |
158
+ | **Moderate** | 2-3 match | Create new doc, note overlap |
159
+ | **Low** | 0-1 match | Create new doc normally |
@@ -140,9 +140,10 @@ Always tell the user which workflow you're about to invoke and why, then wait fo
140
140
  This project uses **learnship**. Key facts:
141
141
 
142
142
  - All planning artifacts live in `.planning/` — read STATE.md and ROADMAP.md first when unsure where we are
143
- - The phase loop: `discuss-phase` → `plan-phase` → `execute-phase` → `verify-work`
143
+ - The phase loop: `discuss-phase` → `plan-phase` → `execute-phase` → `verify-work` → `/review` → `/ship` → `/compound`
144
144
  - Current status is always in `.planning/STATE.md`
145
145
  - Decisions are tracked in `.planning/DECISIONS.md` — read it before proposing approaches that may conflict
146
+ - Compounded solutions live in `.planning/solutions/` — organized by category with YAML frontmatter (module, problem_type, severity, tags). Search these before planning to avoid reinventing known solutions
146
147
  - Run `/ls` if context is unclear about what phase we're on or what to do next — it shows status and offers to run the next step
147
148
 
148
149
  ---
@@ -201,6 +202,10 @@ Architectural and scope decisions are tracked in `.planning/DECISIONS.md`.
201
202
  Read it before proposing an approach that has been previously considered.
202
203
  When a new decision is made during a session, capture it with `/decision-log`.
203
204
 
205
+ ### Solutions Store
206
+
207
+ Compounded solutions live in `.planning/solutions/` — organized by category (build-errors, runtime-errors, best-practices, etc.) with YAML frontmatter for searchability. After fixing a bug or completing a notable feature, run `/compound` to capture the solution while context is fresh. The `/plan-phase` workflow automatically searches these before planning.
208
+
204
209
  ---
205
210
 
206
211
  ## Regressions — What Broke and What We Learned