learnship 2.1.2 → 2.2.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 (45) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.cursor-plugin/plugin.json +1 -1
  3. package/README.md +172 -155
  4. package/SKILL.md +22 -1
  5. package/bin/install.js +305 -3
  6. package/commands/learnship/diagnose-issues.md +1 -0
  7. package/commands/learnship/discuss-phase.md +1 -0
  8. package/commands/learnship/ideate.md +1 -0
  9. package/commands/learnship/list-phase-assumptions.md +1 -0
  10. package/commands/learnship/quick.md +1 -0
  11. package/commands/learnship/research-phase.md +1 -0
  12. package/commands/learnship/secure-phase.md +1 -0
  13. package/commands/learnship/validate-phase.md +2 -0
  14. package/commands/learnship/verify-work.md +1 -0
  15. package/cursor-rules/learnship.mdc +13 -3
  16. package/gemini-extension.json +1 -1
  17. package/hooks/learnship-context-monitor.js +120 -0
  18. package/hooks/learnship-prompt-guard.js +75 -0
  19. package/hooks/learnship-session-state.js +136 -0
  20. package/hooks/learnship-statusline.js +179 -0
  21. package/learnship/contexts/dev.md +21 -0
  22. package/learnship/contexts/research.md +22 -0
  23. package/learnship/contexts/review.md +22 -0
  24. package/learnship/templates/research-project/ARCHITECTURE.md +140 -0
  25. package/learnship/templates/research-project/FEATURES.md +130 -0
  26. package/learnship/templates/research-project/PITFALLS.md +102 -0
  27. package/learnship/templates/research-project/STACK.md +105 -0
  28. package/learnship/templates/research-project/SUMMARY.md +111 -0
  29. package/learnship/workflows/challenge.md +16 -4
  30. package/learnship/workflows/debug.md +30 -6
  31. package/learnship/workflows/diagnose-issues.md +14 -1
  32. package/learnship/workflows/discuss-milestone.md +15 -1
  33. package/learnship/workflows/discuss-phase.md +83 -10
  34. package/learnship/workflows/ideate.md +25 -5
  35. package/learnship/workflows/list-phase-assumptions.md +12 -5
  36. package/learnship/workflows/new-milestone.md +12 -6
  37. package/learnship/workflows/new-project.md +200 -73
  38. package/learnship/workflows/quick.md +18 -4
  39. package/learnship/workflows/research-phase.md +43 -8
  40. package/learnship/workflows/secure-phase.md +57 -15
  41. package/learnship/workflows/settings.md +142 -142
  42. package/learnship/workflows/validate-phase.md +39 -12
  43. package/learnship/workflows/verify-work.md +27 -0
  44. package/package.json +1 -1
  45. package/templates/config.json +1 -0
@@ -74,14 +74,34 @@ a problem you're trying to solve, or something you're not sure about yet.
74
74
  **Mid-conversation research offer (after 2-3 exchanges):**
75
75
 
76
76
  If the conversation surfaces factual questions, technology comparisons, or unknowns:
77
- ```
78
- This touches on [specific question]. Want me to do a quick research pass before we continue?
79
- This would take ~30 seconds and might surface useful context.
80
77
 
81
- [Yes, research this] / [No, let's keep exploring]
78
+ ```
79
+ AskUserQuestion([
80
+ {
81
+ header: "Research Opportunity",
82
+ question: "This touches on [specific question]. Want me to do a quick research pass before we continue?",
83
+ multiSelect: false,
84
+ options: [
85
+ { label: "Yes, research this", description: "~30 seconds — may surface useful context" },
86
+ { label: "No, keep exploring", description: "Continue the conversation without research" }
87
+ ]
88
+ }
89
+ ])
82
90
  ```
83
91
 
84
- If yes and parallelization is enabled, spawn a research agent. Otherwise do an inline research pass. Share findings and continue.
92
+ If yes: read `parallelization` from `.planning/config.json`. If `parallelization.enabled` is true, spawn a researcher agent:
93
+ ```
94
+ Task(
95
+ subagent_type="learnship-researcher",
96
+ prompt="
97
+ <objective>
98
+ Quick research pass on: [specific question].
99
+ Search web, scan codebase for relevant patterns, and return a concise summary of findings.
100
+ </objective>
101
+ "
102
+ )
103
+ ```
104
+ If parallelization is false, use `@./agents/researcher.md` as inline persona for a quick research pass. Share findings and continue.
85
105
 
86
106
  **Crystallize outputs (after 3-6 exchanges):**
87
107
 
@@ -105,11 +105,18 @@ Assumptions validated. Ready to plan.
105
105
  ## Step 5: Offer Next Steps
106
106
 
107
107
  ```
108
- What's next?
109
-
110
- 1. discuss-phase [N] — you answer my questions to build CONTEXT.md
111
- 2. plan-phase [N] create plans now (assumptions noted above apply)
112
- 3. Re-examine — I'll analyze again with your corrections
108
+ AskUserQuestion([
109
+ {
110
+ header: "Next Step",
111
+ question: "What would you like to do with these assumptions?",
112
+ multiSelect: false,
113
+ options: [
114
+ { label: "Discuss Phase", description: "Run discuss-phase [N] — you answer my questions to build CONTEXT.md" },
115
+ { label: "Plan Now", description: "Run plan-phase [N] — create plans now (assumptions noted above apply)" },
116
+ { label: "Re-examine", description: "Analyze again with your corrections" }
117
+ ]
118
+ }
119
+ ])
113
120
  ```
114
121
 
115
122
  Note: Any corrections discussed here are not automatically captured. Run `discuss-phase [N]` to write them to a CONTEXT.md that planners will read.
@@ -32,14 +32,20 @@ Pending todos carried forward:
32
32
  Ask openly: **"What do you want to build in this milestone?"**
33
33
 
34
34
  If a milestone scope was already discussed (look for `.planning/MILESTONE-CONTEXT.md`), load it and confirm:
35
- ```
36
- I found a milestone context file from a prior discussion:
37
- [summary of scope]
38
35
 
39
- Use this as the starting point?
40
36
  ```
41
- - **Yes** → proceed with it
42
- - **No / Start fresh** → ask from scratch
37
+ AskUserQuestion([
38
+ {
39
+ header: "Prior Context Found",
40
+ question: "I found a milestone context file from a prior discussion. Use it as the starting point?",
41
+ multiSelect: false,
42
+ options: [
43
+ { label: "Yes", description: "Proceed with the scope from the prior discussion" },
44
+ { label: "Start fresh", description: "Discard prior context and ask from scratch" }
45
+ ]
46
+ }
47
+ ])
48
+ ```
43
49
 
44
50
  Follow the thread. When you have enough to write clear goals, ask for confirmation before continuing.
45
51
 
@@ -6,6 +6,8 @@ description: Initialize a new project — questioning → research → requireme
6
6
 
7
7
  Initialize a new project with full context gathering, optional research, requirements scoping, and roadmap creation. This is the most leveraged moment in any project — deep questioning now means better plans, better execution, better outcomes.
8
8
 
9
+ > **Platform note:** When this workflow shows structured question blocks, use your platform's interactive question tool to present them (the tool that lets users pick from predefined options). If no such tool is available, present each question as a numbered text list with descriptions and ask the user to reply with their choice number or label.
10
+
9
11
  > **This workflow has 9 mandatory steps. You must complete every step in order. Do not skip, defer, or abbreviate any step. Check each one off as you complete it:**
10
12
  >
11
13
  > - [ ] Step 1 — Setup & codebase check
@@ -80,70 +82,151 @@ Note the tech stack, key directories, and any README content internally. Use thi
80
82
 
81
83
  ## Step 2: Configuration
82
84
 
83
- Ask the user the following questions to configure the project. Ask them in a conversational way not all at once, but grouped naturally.
84
-
85
- **Group A — Working style:**
86
-
87
- Ask: "How do you want to work?"
88
- - **YOLO** (recommended) — Auto-approve steps, just execute
89
- - **Interactive** — Confirm at each step
90
-
91
- Ask: "How finely should scope be sliced into phases?"
92
- - **Coarse** (recommended) — Fewer, broader phases (3-5 phases, 1-3 plans each)
93
- - **Standard** — Balanced phase size (5-8 phases, 3-5 plans each)
94
- - **Fine** — Many focused phases (8-12 phases, 5-10 plans each)
95
-
96
- **Group B — Learning mode:**
97
-
98
- Ask: "How should the learning partner (agentic-learning) work during this project?"
99
- - **Auto** (recommended) — I'll offer relevant learning actions at natural checkpoints (after planning, after execution, etc.)
100
- - **Manual** — I'll only activate when you explicitly invoke `@agentic-learning`
85
+ Present configuration questions using structured question rounds. Use your platform's interactive question tool, or numbered text lists if unavailable.
101
86
 
102
- **Group CModel profile:**
87
+ **Round 1Core settings (4 questions):**
103
88
 
104
- Ask: "Which model quality tier do you want?"
105
- - **Quality** — Large-tier models for all decision-making agents (highest cost, best results)
106
- - **Balanced** (recommended) — Large for planning, medium for execution
107
- - **Budget** — Medium for code, small for research/verification (lowest cost)
108
-
109
- **Group D — Development style:**
110
-
111
- Ask: "Test-first (TDD) mode?"
112
- - **No** (recommended) Write tests alongside implementation
113
- - **Yes** — Enforce red-green-refactor: write failing test first, verify red, implement, verify green
114
-
115
- **Group E — Workflow agents (these add quality but cost tokens/time):**
116
-
117
- Ask: "Which workflow agents and quality steps should be enabled?"
118
- - **Research** (recommended) — Investigate domain before planning each phase
119
- - **Plan Check** (recommended) — Verify plans achieve their goals before execution
120
- - **Verifier** (recommended) Confirm deliverables match phase goals after execution
121
- - **Review** (recommended) Multi-persona code review after verification
122
- - **Solutions Search** (recommended) Search prior solutions for reusable patterns during planning
89
+ ```
90
+ AskUserQuestion([
91
+ {
92
+ header: "Working Style",
93
+ question: "How do you want to work?",
94
+ multiSelect: false,
95
+ options: [
96
+ { label: "YOLO (Recommended)", description: "Auto-approve steps, just execute" },
97
+ { label: "Interactive", description: "Confirm at each step" }
98
+ ]
99
+ },
100
+ {
101
+ header: "Granularity",
102
+ question: "How finely should scope be sliced into phases?",
103
+ multiSelect: false,
104
+ options: [
105
+ { label: "Coarse (Recommended)", description: "Fewer, broader phases (3-5 phases, 1-3 plans each)" },
106
+ { label: "Standard", description: "Balanced phase size (5-8 phases, 3-5 plans each)" },
107
+ { label: "Fine", description: "Many focused phases (8-12 phases, 5-10 plans each)" }
108
+ ]
109
+ },
110
+ {
111
+ header: "Learning Partner",
112
+ question: "How should agentic-learning work during this project?",
113
+ multiSelect: false,
114
+ options: [
115
+ { label: "Auto (Recommended)", description: "Offer learning actions at natural checkpoints (after planning, execution, etc.)" },
116
+ { label: "Manual", description: "Only activate when you explicitly invoke @agentic-learning" }
117
+ ]
118
+ },
119
+ {
120
+ header: "AI Models",
121
+ question: "Which model quality tier for planning agents?",
122
+ multiSelect: false,
123
+ options: [
124
+ { label: "Balanced (Recommended)", description: "Large for planning, medium for execution — good quality/cost ratio" },
125
+ { label: "Quality", description: "Large-tier models for all agents (highest cost, best results)" },
126
+ { label: "Budget", description: "Medium for code, small for research/verification (lowest cost)" }
127
+ ]
128
+ }
129
+ ])
130
+ ```
123
131
 
124
- Ask: "Auto-trigger review after verify-work passes?"
125
- - **No** (recommended) — Run `/review` manually when ready
126
- - **Yes** — Automatically start review after verification succeeds
132
+ **Round 2 Workflow agents (5 questions):**
127
133
 
128
- **Group F — Ship pipeline defaults:**
134
+ ```
135
+ AskUserQuestion([
136
+ {
137
+ header: "Research",
138
+ question: "Research domain before planning each phase? (adds tokens/time)",
139
+ multiSelect: false,
140
+ options: [
141
+ { label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
142
+ { label: "No", description: "Plan directly from requirements" }
143
+ ]
144
+ },
145
+ {
146
+ header: "Plan Check",
147
+ question: "Verify plans will achieve their goals? (adds tokens/time)",
148
+ multiSelect: false,
149
+ options: [
150
+ { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
151
+ { label: "No", description: "Execute plans without verification" }
152
+ ]
153
+ },
154
+ {
155
+ header: "Verifier",
156
+ question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
157
+ multiSelect: false,
158
+ options: [
159
+ { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
160
+ { label: "No", description: "Trust execution, skip verification" }
161
+ ]
162
+ },
163
+ {
164
+ header: "Review",
165
+ question: "Multi-persona code review after verification?",
166
+ multiSelect: false,
167
+ options: [
168
+ { label: "Yes (Recommended)", description: "Correctness, security, performance, maintainability review" },
169
+ { label: "No", description: "Skip code review" }
170
+ ]
171
+ },
172
+ {
173
+ header: "Solutions Search",
174
+ question: "Search prior solutions for reusable patterns during planning?",
175
+ multiSelect: false,
176
+ options: [
177
+ { label: "Yes (Recommended)", description: "Check .planning/solutions/ for relevant past fixes" },
178
+ { label: "No", description: "Plan without searching prior solutions" }
179
+ ]
180
+ }
181
+ ])
182
+ ```
129
183
 
130
- Ask: "Ship pipeline preferences?"
131
- - **Auto-test before shipping** (recommended: yes) — Run tests before every ship
132
- - **Conventional commits** (recommended: yes) — Use `feat:`, `fix:`, `docs:` commit prefixes
133
- - **Auto-generate PR description** (recommended: yes) — Create PR body from commit messages
184
+ **Round 3 Pipeline & git (4 questions):**
134
185
 
135
- **Group G — Parallel execution:**
186
+ ```
187
+ AskUserQuestion([
188
+ {
189
+ header: "TDD",
190
+ question: "Test-first (TDD) mode?",
191
+ multiSelect: false,
192
+ options: [
193
+ { label: "No (Recommended)", description: "Write tests alongside implementation" },
194
+ { label: "Yes", description: "Red-green-refactor: write failing test first, implement, verify green" }
195
+ ]
196
+ },
197
+ {
198
+ header: "Ship Pipeline",
199
+ question: "Ship pipeline preferences?",
200
+ multiSelect: true,
201
+ options: [
202
+ { label: "Auto-test before shipping (Recommended)", description: "Run tests before every ship" },
203
+ { label: "Conventional commits (Recommended)", description: "Use feat:, fix:, docs: commit prefixes" },
204
+ { label: "Auto-generate PR description (Recommended)", description: "Create PR body from commit messages" }
205
+ ]
206
+ },
207
+ {
208
+ header: "Git Tracking",
209
+ question: "Commit planning docs to git?",
210
+ multiSelect: false,
211
+ options: [
212
+ { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
213
+ { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
214
+ ]
215
+ },
216
+ {
217
+ header: "Commit Mode",
218
+ question: "When should learnship commit files to git?",
219
+ multiSelect: false,
220
+ options: [
221
+ { label: "Automatically (Recommended)", description: "Commit after each workflow step completes" },
222
+ { label: "Manually", description: "You commit when ready; skip all git commit steps" }
223
+ ]
224
+ }
225
+ ])
226
+ ```
136
227
 
137
228
  <!-- LEARNSHIP_PARALLEL_BLOCK -->
138
229
 
139
- Ask: "Commit planning docs to git?"
140
- - **Yes** (recommended) — Planning docs tracked in version control
141
- - **No** — Keep `.planning/` local-only
142
-
143
- Ask: "When should learnship commit files to git?"
144
- - **Automatically** (recommended) — Commit after each workflow step completes (config, requirements, roadmap, AGENTS.md)
145
- - **Manually** — I'll commit when I say so; skip all git commit steps
146
-
147
230
  Create `.planning/config.json` with all settings:
148
231
 
149
232
  ```json
@@ -311,24 +394,26 @@ git add .planning/PROJECT.md && git commit -m "docs: initialize project"
311
394
 
312
395
  > **🔴 MANDATORY USER CHOICE — You must ask this question and wait for a reply. You are NOT allowed to decide this yourself.**
313
396
 
314
- Display this question to the user exactly as written:
397
+ Display the research decision banner, then present the choice using a structured question:
315
398
 
316
399
  ```
317
400
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
318
401
  learnship ► RESEARCH DECISION
319
402
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
403
+ ```
320
404
 
321
- Before I write the requirements — do you want me to
322
- research the domain ecosystem first?
323
-
324
- 1. Research first (recommended)
325
- Discover standard stacks, expected features,
326
- architecture patterns, common pitfalls
327
-
328
- 2. Skip research
329
- Go straight to requirements
330
-
331
- Reply 1 or 2.
405
+ ```
406
+ AskUserQuestion([
407
+ {
408
+ header: "Research",
409
+ question: "Before I write the requirements — do you want me to research the domain ecosystem first?",
410
+ multiSelect: false,
411
+ options: [
412
+ { label: "Research first (Recommended)", description: "Discover standard stacks, expected features, architecture patterns, common pitfalls — writes 5 research files" },
413
+ { label: "Skip research", description: "Go straight to requirements" }
414
+ ]
415
+ }
416
+ ])
332
417
  ```
333
418
 
334
419
  > � **HARD GATE — This is a user decision. You MUST wait for the user to reply.**
@@ -378,10 +463,52 @@ node -e "require('fs').mkdirSync('.planning/research',{recursive:true})"
378
463
 
379
464
  > 🛑 Did the mkdir command run? If not, run it now before continuing.
380
465
 
381
- **Step 5b Write all 5 files.** Create each file one at a time using your file write tool. Each file is a separate write operation. Do NOT combine files. Do NOT skip files.
466
+ Read `parallelization` from `.planning/config.json` (defaults to `false`).
467
+
468
+ **If `parallelization.enabled` is `true` (subagent mode — Claude Code, OpenCode, Codex):**
469
+
470
+ Spawn a dedicated researcher agent with the project context:
471
+ ```
472
+ Task(
473
+ subagent_type="learnship-researcher",
474
+ prompt="
475
+ <objective>
476
+ Write 5 research files for a new project into .planning/research/.
477
+ Before writing each file, read the corresponding template from @./templates/research-project/ for the expected structure.
478
+
479
+ Files to write:
480
+ 1. STACK.md — Must have: ## Recommended Stack, ## Alternatives Considered, ## What NOT to Use, ## Versions
481
+ 2. FEATURES.md — Must have: ## Table Stakes, ## Differentiators, ## Anti-Features
482
+ 3. ARCHITECTURE.md — Must have: ## Component Boundaries, ## Data Flow, ## Build Order, ## Integration Points
483
+ 4. PITFALLS.md — Must have: ## Common Mistakes, ## Warning Signs, ## Prevention Strategies
484
+ 5. SUMMARY.md — Must have: ## Recommended Stack, ## Table Stakes Features, ## Key Architecture Decisions, ## Top Pitfalls
485
+
486
+ After writing all 5 files, run the verification command to confirm all files exist with required sections.
487
+ Return: confirmation that all 5 files pass verification.
488
+ </objective>
489
+
490
+ <files_to_read>
491
+ - .planning/PROJECT.md (project description and goals)
492
+ - @./templates/research-project/STACK.md (template for STACK.md)
493
+ - @./templates/research-project/FEATURES.md (template for FEATURES.md)
494
+ - @./templates/research-project/ARCHITECTURE.md (template for ARCHITECTURE.md)
495
+ - @./templates/research-project/PITFALLS.md (template for PITFALLS.md)
496
+ - @./templates/research-project/SUMMARY.md (template for SUMMARY.md)
497
+ </files_to_read>
498
+ "
499
+ )
500
+ ```
501
+
502
+ Wait for the agent to complete, then proceed to Step 5c (verification) to confirm files were written correctly.
503
+
504
+ **If `parallelization.enabled` is `false` (sequential mode):**
505
+
506
+ Using `@./agents/researcher.md` as your research persona:
507
+
508
+ **Step 5b — Write all 5 files.** Create each file one at a time using your file write tool. Each file is a separate write operation. Do NOT combine files. Do NOT skip files. **Before writing each file, read the corresponding template** from `@./templates/research-project/` to understand the expected structure.
382
509
 
383
510
  **File 1 of 5 — Write `.planning/research/STACK.md` to disk now.**
384
- Research the standard tech stack for this domain and write the results to this file. The file MUST contain these exact `##` headers:
511
+ First, read the template at `@./templates/research-project/STACK.md` for the expected structure. Then research the standard tech stack for this domain and write the results to this file. Use the template as your structural guide. The file MUST contain these exact `##` headers:
385
512
  - `## Recommended Stack`
386
513
  - `## Alternatives Considered`
387
514
  - `## What NOT to Use` (with reasons)
@@ -390,26 +517,26 @@ Research the standard tech stack for this domain and write the results to this f
390
517
  > 🛑 STOP. Confirm: did you write `.planning/research/STACK.md` to the filesystem? If you only thought about the stack but did not create the file, go back and create it now.
391
518
 
392
519
  **File 2 of 5 — Write `.planning/research/FEATURES.md` to disk now.**
393
- Research what features users expect in this domain. Write the results to this file. The file MUST contain these exact `##` headers:
520
+ First, read the template at `@./templates/research-project/FEATURES.md` for the expected structure. Then research what features users expect in this domain. Write the results to this file. Use the template as your structural guide. The file MUST contain these exact `##` headers:
394
521
  - `## Table Stakes` (must-haves)
395
522
  - `## Differentiators` (nice-to-haves)
396
523
  - `## Anti-Features` (what to avoid)
397
524
 
398
525
  **File 3 of 5 — Write `.planning/research/ARCHITECTURE.md` to disk now.**
399
- Research how systems in this domain are typically structured. Write the results to this file. The file MUST contain these exact `##` headers:
526
+ First, read the template at `@./templates/research-project/ARCHITECTURE.md` for the expected structure. Then research how systems in this domain are typically structured. Write the results to this file. Use the template as your structural guide. The file MUST contain these exact `##` headers:
400
527
  - `## Component Boundaries`
401
528
  - `## Data Flow`
402
529
  - `## Build Order` (suggested sequence)
403
530
  - `## Integration Points`
404
531
 
405
532
  **File 4 of 5 — Write `.planning/research/PITFALLS.md` to disk now.**
406
- Research common mistakes and prevention strategies. Write the results to this file. The file MUST contain these exact `##` headers:
533
+ First, read the template at `@./templates/research-project/PITFALLS.md` for the expected structure. Then research common mistakes and prevention strategies. Write the results to this file. Use the template as your structural guide. The file MUST contain these exact `##` headers:
407
534
  - `## Common Mistakes`
408
535
  - `## Warning Signs`
409
536
  - `## Prevention Strategies`
410
537
 
411
538
  **File 5 of 5 — Write `.planning/research/SUMMARY.md` to disk now.**
412
- Synthesize the 4 files above into a summary. Write the results to this file. The file MUST contain these exact `##` headers:
539
+ First, read the template at `@./templates/research-project/SUMMARY.md` for the expected structure. Then synthesize the 4 files above into a summary. Write the results to this file. Use the template as your structural guide. The file MUST contain these exact `##` headers:
413
540
  - `## Recommended Stack`
414
541
  - `## Table Stakes Features`
415
542
  - `## Key Architecture Decisions`
@@ -73,13 +73,27 @@ Report: "Creating quick task ${NEXT_NUM}: ${DESCRIPTION}"
73
73
 
74
74
  Analyze `DESCRIPTION` to identify 2-4 gray areas — implementation decisions that would change the outcome.
75
75
 
76
- Present them for selection (multi-select):
77
- - Each area is a concrete decision point (not generic)
78
- - Include an "All clear — skip discussion" option
76
+ Present them for selection using a structured multi-select question:
77
+
78
+ ```
79
+ AskUserQuestion([
80
+ {
81
+ header: "Gray Areas",
82
+ question: "Which areas need clarification? (select all that apply)",
83
+ multiSelect: true,
84
+ options: [
85
+ { label: "[Area 1]", description: "[Concrete decision point]" },
86
+ { label: "[Area 2]", description: "[Concrete decision point]" },
87
+ { label: "[Area 3]", description: "[Concrete decision point]" },
88
+ { label: "All clear — skip discussion", description: "No gray areas need clarification" }
89
+ ]
90
+ }
91
+ ])
92
+ ```
79
93
 
80
94
  If "All clear" → skip to Step 4.
81
95
 
82
- For each selected area, ask 1-2 focused questions with concrete options. Max 2 questions per area — keep it lightweight.
96
+ For each selected area, ask 1-2 focused questions with concrete options using structured questions. Max 2 questions per area — keep it lightweight.
83
97
 
84
98
  Write `CONTEXT.md` to the task directory:
85
99
 
@@ -30,16 +30,21 @@ ls ".planning/phases/"*"/"*"-RESEARCH.md" 2>/dev/null | grep "^[N]-\|/[N][^0-9]"
30
30
  ```
31
31
 
32
32
  If RESEARCH.md already exists for this phase:
33
- ```
34
- Research already exists: .planning/phases/[phase-dir]/[N]-RESEARCH.md
35
33
 
36
- Options:
37
- 1. View existing research
38
- 2. Re-run and overwrite
39
- 3. Skip — use existing
40
34
  ```
41
-
42
- Wait for choice.
35
+ AskUserQuestion([
36
+ {
37
+ header: "Existing Research",
38
+ question: "Research already exists for this phase. What do you want to do?",
39
+ multiSelect: false,
40
+ options: [
41
+ { label: "View existing", description: "Show current research, then decide" },
42
+ { label: "Re-run and overwrite", description: "Discard existing research and re-run" },
43
+ { label: "Skip", description: "Use existing research as-is" }
44
+ ]
45
+ }
46
+ ])
47
+ ```
43
48
 
44
49
  ## Step 3: Load Context
45
50
 
@@ -65,6 +70,36 @@ If CONTEXT.md exists, read it — user decisions shape what to research.
65
70
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
66
71
  ```
67
72
 
73
+ Read `parallelization` from `.planning/config.json` (defaults to `false`).
74
+
75
+ **If `parallelization.enabled` is `true` (subagent mode — Claude Code, OpenCode, Codex):**
76
+
77
+ Spawn a dedicated researcher agent:
78
+ ```
79
+ Task(
80
+ subagent_type="learnship-researcher",
81
+ prompt="
82
+ <objective>
83
+ Research phase [N] for this project. Read the phase goal from ROADMAP.md,
84
+ requirements from REQUIREMENTS.md, and any CONTEXT.md decisions.
85
+ Write [padded_phase]-RESEARCH.md with Don't Hand-Roll, Common Pitfalls,
86
+ Existing Patterns, and Recommended Approach sections.
87
+ Follow the researcher persona at @./agents/researcher.md.
88
+ </objective>
89
+
90
+ <files_to_read>
91
+ - .planning/ROADMAP.md
92
+ - .planning/REQUIREMENTS.md
93
+ - .planning/STATE.md
94
+ - .planning/phases/[padded_phase]-[slug]/[padded_phase]-CONTEXT.md (if exists)
95
+ - @./agents/researcher.md (persona)
96
+ </files_to_read>
97
+ "
98
+ )
99
+ ```
100
+
101
+ **If `parallelization.enabled` is `false` (sequential mode):**
102
+
68
103
  Using `@./agents/researcher.md` as your research persona in **phase research mode**:
69
104
 
70
105
  Read all loaded context, then investigate how to implement this phase. Write `.planning/phases/[padded_phase]-[slug]/[padded_phase]-RESEARCH.md` with two sections:
@@ -75,30 +75,72 @@ Classify each threat:
75
75
 
76
76
  If all threats are CLOSED: skip to Step 6.
77
77
 
78
- If open threats exist, present them:
78
+ If open threats exist, present them with a structured question:
79
79
 
80
+ Display the threat table first, then:
81
+
82
+ ```
83
+ AskUserQuestion([
84
+ {
85
+ header: "Open Threats",
86
+ question: "[N] open threat(s) found. How do you want to handle them?",
87
+ multiSelect: false,
88
+ options: [
89
+ { label: "Verify all", description: "Investigate and resolve each open threat against the codebase" },
90
+ { label: "Accept all", description: "Document all as accepted risks with rationale" },
91
+ { label: "Review individually", description: "Decide per threat: verify, accept, or skip" }
92
+ ]
93
+ }
94
+ ])
80
95
  ```
81
- Open Threats ([N]):
82
96
 
83
- | ID | Category | Component | Description |
84
- |----|----------|-----------|-------------|
85
- | T-03-01 | Info Disclosure | api/auth.ts | JWT secret in environment without validation |
97
+ ## Step 5: Resolve Open Threats
86
98
 
87
- Options:
88
- 1. Verify all open threats — investigate and resolve
89
- 2. Accept all open — document as accepted risks
90
- 3. Review individually — decide per threat
91
- ```
99
+ Read `parallelization` from `.planning/config.json` (defaults to `false`).
92
100
 
93
- Wait for user response.
101
+ **For "Verify all":**
94
102
 
95
- ## Step 5: Resolve Open Threats
103
+ **If `parallelization.enabled` is `true`:**
104
+ ```
105
+ Task(
106
+ subagent_type="learnship-security-auditor",
107
+ prompt="
108
+ <objective>
109
+ Verify all open threats in the threat register for phase [N].
110
+ Check each threat against the actual codebase. Update status to
111
+ CLOSED if mitigation found, or document what's missing.
112
+ Follow the security auditor persona at @./agents/security-auditor.md.
113
+ </objective>
114
+
115
+ <files_to_read>
116
+ - [phase SECURITY.md or threat register]
117
+ - @./agents/security-auditor.md (persona)
118
+ </files_to_read>
119
+ "
120
+ )
121
+ ```
122
+
123
+ **If `parallelization.enabled` is `false`:**
124
+ Using `@./agents/security-auditor.md`, check each open threat against the codebase. Update status based on findings.
96
125
 
97
- For option 1 (verify all): Using `@./agents/verifier.md`, check each open threat against the codebase. Update status based on findings.
126
+ **For "Accept all":** Add each to the Accepted Risks Log with user's rationale.
98
127
 
99
- For option 2 (accept all): Add each to the Accepted Risks Log with user's rationale.
128
+ **For "Review individually":** Present each threat one at a time:
100
129
 
101
- For option 3 (individual): Present each threat one at a time with options: Verify / Accept / Skip.
130
+ ```
131
+ AskUserQuestion([
132
+ {
133
+ header: "Threat [ID]",
134
+ question: "[Category]: [Description] in [Component]",
135
+ multiSelect: false,
136
+ options: [
137
+ { label: "Verify", description: "Investigate this threat against the codebase" },
138
+ { label: "Accept", description: "Document as accepted risk" },
139
+ { label: "Skip", description: "Leave open for now" }
140
+ ]
141
+ }
142
+ ])
143
+ ```
102
144
 
103
145
  ## Step 6: Write SECURITY.md
104
146