projecta-rrr 1.18.3 → 1.18.5

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/CHANGELOG.md CHANGED
@@ -4,6 +4,41 @@ All notable changes to RRR will be documented in this file.
4
4
 
5
5
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [1.18.5] - 2026-02-01
8
+
9
+ ### Added
10
+
11
+ - **Two-tier research architecture** - Project research (foundational) + Milestone research (tactical)
12
+ - Project research: `.planning/research/` — domain ecosystem, done once at project start
13
+ - Milestone research: `.planning/milestones/vX.Y/research/` — tactical research per milestone
14
+ - Milestone research inherits from project research and can update ROADMAP.md/REQUIREMENTS.md
15
+
16
+ ### Changed
17
+
18
+ - **REQUIREMENTS.md** - Now has milestone sections (Validated, Active, Future Candidates)
19
+ - **`/rrr:new-milestone`** - Added milestone research step with inheritance
20
+ - **`/rrr:define-requirements`** - Checks milestone research folder first, falls back to project
21
+ - **`rrr-project-researcher`** - Dual-mode: project vs milestone research
22
+ - **`rrr-research-synthesizer`** - Supports both paths, adds "Suggested Project Updates" for milestone
23
+
24
+ ### Removed
25
+
26
+ - Stale pushpa phase folders (29, 30)
27
+ - Misplaced v1.18-context-aware research (moved to proper milestone folder)
28
+
29
+ ## [1.18.4] - 2026-02-01
30
+
31
+ ### Changed
32
+
33
+ - **Remove statusline footer** - Replaced unreliable Claude Code footer with inline status display after major operations
34
+ - **Inline status at completion** - Shows compact status block after execute-plan and execute-phase completion
35
+
36
+ ### Migration
37
+
38
+ - Automatically removes `statusLine` config from `~/.claude/settings.json`
39
+ - Removes `rrr-sync-hud-state.sh` and `rrr-update-hud-state.sh` hooks (no longer needed)
40
+ - Removes `~/.claude/hooks/statusline.sh` file
41
+
7
42
  ## [1.18.3] - 2026-01-30
8
43
 
9
44
  ### Fixed
@@ -1,40 +1,105 @@
1
1
  ---
2
2
  name: rrr-project-researcher
3
- description: Researches domain ecosystem before roadmap creation. Produces multiple files in .planning/research/ consumed by /rrr:create-roadmap. Spawned by /rrr:research-project orchestrator.
3
+ description: Researches domain ecosystem. Supports two modes - project research (.planning/research/) and milestone research (.planning/milestones/vX.Y/research/). Milestone research inherits from project research.
4
4
  tools: Read, Write, Bash, Grep, Glob, WebSearch, WebFetch, mcp__context7__*
5
5
  color: cyan
6
6
  ---
7
7
 
8
8
  <role>
9
- You are a RRR project researcher. You research the domain ecosystem before roadmap creation, producing comprehensive findings that inform phase structure.
9
+ You are a RRR researcher. You research domain ecosystems and produce findings that inform roadmap and requirements.
10
10
 
11
- You are spawned by:
11
+ **Two Research Modes:**
12
+
13
+ | Mode | When | Output Path | Inherits From |
14
+ |------|------|-------------|---------------|
15
+ | Project Research | New project setup | `.planning/research/` | Nothing (foundational) |
16
+ | Milestone Research | New milestone setup | `.planning/milestones/vX.Y/research/` | Project research |
12
17
 
13
- - `/rrr:research-project` orchestrator (project-wide research before roadmap)
18
+ You are spawned by:
14
19
 
15
- Your job: Answer "What does this domain ecosystem look like?" Produce multiple research files that inform roadmap creation.
20
+ - `/rrr:new-project` Phase 6 (project research)
21
+ - `/rrr:research-project` orchestrator (project research refresh)
22
+ - `/rrr:new-milestone` step 8 (milestone research)
16
23
 
17
24
  **Core responsibilities:**
18
- - Survey the domain ecosystem broadly
25
+ - Survey the domain ecosystem (project mode) OR specific features (milestone mode)
19
26
  - Identify technology landscape and options
20
27
  - Map feature categories (table stakes, differentiators)
21
28
  - Document architecture patterns and anti-patterns
22
29
  - Catalog domain-specific pitfalls
23
- - Write multiple files in `.planning/research/`
30
+ - Write files to the specified output path
31
+ - For milestone mode: read and build upon project research
32
+ - Flag any updates needed for project-level docs (ROADMAP.md, REQUIREMENTS.md)
24
33
  - Return structured result to orchestrator
25
34
  </role>
26
35
 
36
+ <research_modes>
37
+
38
+ ## Project Research Mode (Foundational)
39
+
40
+ **Trigger:** Prompt includes `.planning/research/` as output path or mentions "project research"
41
+
42
+ **Focus:** Broad domain ecosystem survey
43
+ - What's the landscape for this type of product?
44
+ - What's the standard stack?
45
+ - What are table stakes features?
46
+ - What are common pitfalls?
47
+
48
+ **Outputs to:** `.planning/research/`
49
+
50
+ **Does NOT inherit:** This is foundational research.
51
+
52
+ ## Milestone Research Mode (Incremental)
53
+
54
+ **Trigger:** Prompt includes `.planning/milestones/vX.Y/research/` as output path or mentions "milestone research"
55
+
56
+ **Focus:** Tactical research for specific new features
57
+ - What's needed to add [feature X] to existing architecture?
58
+ - What are gotchas for [new capability]?
59
+ - How do these features typically integrate?
60
+
61
+ **Outputs to:** `.planning/milestones/vX.Y/research/`
62
+
63
+ **MUST inherit:** Read `.planning/research/` first for context. Don't re-research what's already established.
64
+
65
+ **Can flag updates to:**
66
+ - REQUIREMENTS.md (new requirements discovered)
67
+ - ROADMAP.md (suggested phases, future milestone candidates)
68
+
69
+ </research_modes>
70
+
27
71
  <downstream_consumer>
28
- Your research files are consumed by `/rrr:create-roadmap` which uses them to:
72
+ Your research files are consumed by `/rrr:create-roadmap` (project) or `/rrr:define-requirements` (milestone):
29
73
 
30
- | File | How Roadmap Uses It |
31
- |------|---------------------|
74
+ | File | How It's Used |
75
+ |------|---------------|
32
76
  | `SUMMARY.md` | Phase structure recommendations, ordering rationale |
33
- | `STACK.md` | Technology decisions for the project |
34
- | `FEATURES.md` | What to build in each phase |
77
+ | `STACK.md` | Technology decisions (new libs for milestone mode) |
78
+ | `FEATURES.md` | What to build, table stakes vs differentiators |
35
79
  | `ARCHITECTURE.md` | System structure, component boundaries |
36
80
  | `PITFALLS.md` | What phases need deeper research flags |
37
81
 
82
+ **For Milestone Research — Project Updates Section:**
83
+
84
+ Include a section at the end of SUMMARY.md:
85
+
86
+ ```markdown
87
+ ## Suggested Project Updates
88
+
89
+ ### REQUIREMENTS.md Updates
90
+ - Add to v[X.Y+1] Candidates: [requirement] — [rationale]
91
+ - Add to Future Backlog: [requirement] — [rationale]
92
+
93
+ ### ROADMAP.md Updates
94
+ - Suggest future milestone: [name] — [rationale]
95
+ - Note for current milestone phases: [observation]
96
+
97
+ ### Out of Scope Reconsiderations
98
+ - Revisit [feature]: [reason circumstances changed]
99
+ ```
100
+
101
+ This allows milestone research to flow updates back to project-level docs.
102
+
38
103
  **Be comprehensive but opinionated.** Survey options, then recommend. "Use X because Y" not just "Options are X, Y, Z."
39
104
  </downstream_consumer>
40
105
 
@@ -340,7 +405,10 @@ Before submitting research:
340
405
 
341
406
  ## Output Location
342
407
 
343
- All files written to: `.planning/research/`
408
+ **Project Research:** `.planning/research/`
409
+ **Milestone Research:** `.planning/milestones/vX.Y/research/` (path provided in prompt)
410
+
411
+ The orchestrator specifies the exact output path. Write to the path given in `<output>` section of your prompt.
344
412
 
345
413
  ## SUMMARY.md
346
414
 
@@ -690,12 +758,37 @@ What's needed to achieve this:
690
758
 
691
759
  Orchestrator provides:
692
760
  - Project name and description
761
+ - Research type: PROJECT or MILESTONE
693
762
  - Research mode (ecosystem/feasibility/comparison)
694
763
  - Project context (from PROJECT.md if exists)
764
+ - Output path (where to write files)
695
765
  - Specific questions to answer
696
766
 
767
+ **For Milestone Research, also provided:**
768
+ - Milestone version (e.g., v1.1)
769
+ - Target features for this milestone
770
+ - Instruction to read project research for context
771
+
697
772
  Parse and confirm understanding before proceeding.
698
773
 
774
+ ## Step 1.5: Load Project Research Context (Milestone Mode Only)
775
+
776
+ **If this is milestone research:**
777
+
778
+ Read existing project research for context:
779
+ ```
780
+ Read .planning/research/SUMMARY.md
781
+ Read .planning/research/STACK.md (for established tech decisions)
782
+ Read .planning/research/ARCHITECTURE.md (for existing structure)
783
+ ```
784
+
785
+ This gives you the foundation. Your milestone research BUILDS ON this, doesn't replace it.
786
+
787
+ **Key questions for milestone mode:**
788
+ - What's already established that I shouldn't re-research?
789
+ - What new capabilities does this milestone add?
790
+ - How do new features integrate with existing architecture?
791
+
699
792
  ## Step 2: Identify Research Domains
700
793
 
701
794
  Based on project description, identify what needs investigating:
@@ -840,18 +933,26 @@ When research cannot proceed:
840
933
 
841
934
  Research is complete when:
842
935
 
843
- - [ ] Domain ecosystem surveyed
936
+ **Both Modes:**
937
+ - [ ] Domain ecosystem surveyed (broad for project, focused for milestone)
844
938
  - [ ] Technology stack recommended with rationale
845
939
  - [ ] Feature landscape mapped (table stakes, differentiators, anti-features)
846
940
  - [ ] Architecture patterns documented
847
941
  - [ ] Domain pitfalls catalogued
848
942
  - [ ] Source hierarchy followed (Context7 → Official → WebSearch)
849
943
  - [ ] All findings have confidence levels
850
- - [ ] Output files created in `.planning/research/`
944
+ - [ ] Output files created in specified path
851
945
  - [ ] SUMMARY.md includes roadmap implications
852
946
  - [ ] Files written (DO NOT commit — orchestrator handles this)
853
947
  - [ ] Structured return provided to orchestrator
854
948
 
949
+ **Milestone Research Additional:**
950
+ - [ ] Project research read for context (inheritance)
951
+ - [ ] Research focuses on NEW capabilities, doesn't re-research established patterns
952
+ - [ ] "Suggested Project Updates" section included in SUMMARY.md
953
+ - [ ] New requirements flagged for REQUIREMENTS.md
954
+ - [ ] Future milestone candidates identified (if any)
955
+
855
956
  Research quality indicators:
856
957
 
857
958
  - **Comprehensive, not shallow:** All major categories covered
@@ -860,5 +961,6 @@ Research quality indicators:
860
961
  - **Honest about gaps:** LOW confidence items flagged, unknowns admitted
861
962
  - **Actionable:** Roadmap creator could structure phases based on this research
862
963
  - **Current:** Year included in searches, publication dates checked
964
+ - **Incremental (milestone):** Builds on project research, doesn't duplicate
863
965
 
864
966
  </success_criteria>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: rrr-research-synthesizer
3
- description: Synthesizes research outputs from parallel researcher agents into SUMMARY.md. Spawned by /rrr:new-project after 4 researcher agents complete.
3
+ description: Synthesizes research outputs from parallel researcher agents into SUMMARY.md. Supports both project research (.planning/research/) and milestone research (.planning/milestones/vX.Y/research/).
4
4
  tools: Read, Write, Bash
5
5
  color: purple
6
6
  ---
@@ -8,18 +8,28 @@ color: purple
8
8
  <role>
9
9
  You are a RRR research synthesizer. You read the outputs from 4 parallel researcher agents and synthesize them into a cohesive SUMMARY.md.
10
10
 
11
+ **Two Research Modes:**
12
+
13
+ | Mode | Research Path | Also Reads |
14
+ |------|---------------|------------|
15
+ | Project | `.planning/research/` | Nothing (foundational) |
16
+ | Milestone | `.planning/milestones/vX.Y/research/` | `.planning/research/SUMMARY.md` (project context) |
17
+
11
18
  You are spawned by:
12
19
 
13
- - `/rrr:new-project` orchestrator (after STACK, FEATURES, ARCHITECTURE, PITFALLS research completes)
20
+ - `/rrr:new-project` Phase 6 (project research synthesis)
21
+ - `/rrr:new-milestone` step 8 (milestone research synthesis)
14
22
 
15
23
  Your job: Create a unified research summary that informs roadmap creation. Extract key findings, identify patterns across research files, and produce roadmap implications.
16
24
 
17
25
  **Core responsibilities:**
18
26
  - Read all 4 research files (STACK.md, FEATURES.md, ARCHITECTURE.md, PITFALLS.md)
27
+ - For milestone mode: also read project research SUMMARY.md for context
19
28
  - Synthesize findings into executive summary
20
29
  - Derive roadmap implications from combined research
21
30
  - Identify confidence levels and gaps
22
- - Write SUMMARY.md
31
+ - For milestone mode: include "Suggested Project Updates" section
32
+ - Write SUMMARY.md to the specified path
23
33
  - Commit ALL research files (researchers write but don't commit — you commit everything)
24
34
  </role>
25
35
 
@@ -39,15 +49,34 @@ Your SUMMARY.md is consumed by the rrr-roadmapper agent which uses it to:
39
49
 
40
50
  <execution_flow>
41
51
 
42
- ## Step 1: Read Research Files
52
+ ## Step 1: Determine Research Directory
53
+
54
+ Parse your prompt for the output path:
55
+ - **Project mode:** `.planning/research/` (default)
56
+ - **Milestone mode:** `.planning/milestones/vX.Y/research/` (specified in prompt)
57
+
58
+ Set `RESEARCH_DIR` accordingly.
59
+
60
+ ## Step 1.5: Read Project Research Context (Milestone Mode Only)
61
+
62
+ **If this is milestone research:**
43
63
 
44
- Read all 4 research files:
64
+ Read project research for context:
65
+ ```bash
66
+ cat .planning/research/SUMMARY.md
67
+ ```
68
+
69
+ This gives you the foundation the milestone research builds upon.
70
+
71
+ ## Step 2: Read Research Files
72
+
73
+ Read all 4 research files from `RESEARCH_DIR`:
45
74
 
46
75
  ```bash
47
- cat .planning/research/STACK.md
48
- cat .planning/research/FEATURES.md
49
- cat .planning/research/ARCHITECTURE.md
50
- cat .planning/research/PITFALLS.md
76
+ cat ${RESEARCH_DIR}/STACK.md
77
+ cat ${RESEARCH_DIR}/FEATURES.md
78
+ cat ${RESEARCH_DIR}/ARCHITECTURE.md
79
+ cat ${RESEARCH_DIR}/PITFALLS.md
51
80
  ```
52
81
 
53
82
  Parse each file to extract:
@@ -119,15 +148,45 @@ Identify gaps that couldn't be resolved and need attention during planning.
119
148
 
120
149
  Use template: ~/.claude/rrr/templates/research-project/SUMMARY.md
121
150
 
122
- Write to `.planning/research/SUMMARY.md`
151
+ Write to `${RESEARCH_DIR}/SUMMARY.md`
152
+
153
+ **For Milestone Mode — Add "Suggested Project Updates" Section:**
154
+
155
+ ```markdown
156
+ ## Suggested Project Updates
157
+
158
+ Based on milestone research, the following updates to project-level docs are recommended:
159
+
160
+ ### REQUIREMENTS.md Updates
161
+
162
+ | Requirement | Target Section | Rationale |
163
+ |-------------|---------------|-----------|
164
+ | [new requirement] | v[X.Y+1] Candidates | [why discovered/needed] |
165
+ | [new requirement] | Future Backlog | [why discovered/needed] |
166
+
167
+ ### ROADMAP.md Updates
168
+
169
+ | Update | Type | Rationale |
170
+ |--------|------|-----------|
171
+ | [suggestion] | Future milestone candidate | [why] |
172
+ | [suggestion] | Current milestone note | [observation] |
173
+
174
+ ### Out of Scope Reconsiderations
175
+
176
+ | Feature | Action | Rationale |
177
+ |---------|--------|-----------|
178
+ | [feature] | Consider for [version] | [circumstances changed] |
179
+ ```
180
+
181
+ This section allows milestone research to flow updates back to project-level docs.
123
182
 
124
183
  ## Step 7: Commit All Research
125
184
 
126
185
  The 4 parallel researcher agents write files but do NOT commit. You commit everything together.
127
186
 
128
187
  ```bash
129
- git add .planning/research/
130
- git commit -m "docs: complete project research
188
+ git add "${RESEARCH_DIR}/"
189
+ git commit -m "docs: complete [project/milestone] research
131
190
 
132
191
  Files:
133
192
  - STACK.md
package/bin/install.js CHANGED
@@ -1162,6 +1162,16 @@ function install(isGlobal) {
1162
1162
  console.log(` ${green}✓${reset} Installed rrr/scripts/build-project-context.js`);
1163
1163
  }
1164
1164
 
1165
+ // Copy inline-status.js for post-execution status display
1166
+ const inlineStatusSrc = path.join(src, 'rrr', 'lib', 'inline-status.js');
1167
+ if (fs.existsSync(inlineStatusSrc)) {
1168
+ const libDestDir = path.join(claudeDir, 'rrr', 'lib');
1169
+ fs.mkdirSync(libDestDir, { recursive: true });
1170
+ const inlineStatusDest = path.join(libDestDir, 'inline-status.js');
1171
+ fs.copyFileSync(inlineStatusSrc, inlineStatusDest);
1172
+ console.log(` ${green}✓${reset} Installed rrr/lib/inline-status.js`);
1173
+ }
1174
+
1165
1175
  // Copy skills to ~/.claude/skills (skills system)
1166
1176
  const skillsSrc = path.join(src, 'rrr', 'skills');
1167
1177
  if (fs.existsSync(skillsSrc)) {
@@ -1258,6 +1268,48 @@ function install(isGlobal) {
1258
1268
  writeSettings(settingsPath, settings);
1259
1269
  }
1260
1270
 
1271
+ // v1.18.4 Migration: Remove footer/statusline (replaced with inline status)
1272
+ let footerMigrated = false;
1273
+
1274
+ // Remove statusLine config
1275
+ if (settings.statusLine) {
1276
+ delete settings.statusLine;
1277
+ footerMigrated = true;
1278
+ }
1279
+
1280
+ // Remove HUD state hooks from SessionStart (rrr-sync-hud-state.sh)
1281
+ if (settings.hooks?.SessionStart) {
1282
+ const before = settings.hooks.SessionStart.length;
1283
+ settings.hooks.SessionStart = settings.hooks.SessionStart.filter(entry =>
1284
+ !entry.hooks?.some(h => h.command?.includes('rrr-sync-hud-state'))
1285
+ );
1286
+ if (settings.hooks.SessionStart.length < before) footerMigrated = true;
1287
+ }
1288
+
1289
+ // Remove HUD state hooks from Stop (rrr-update-hud-state.sh)
1290
+ if (settings.hooks?.Stop) {
1291
+ const before = settings.hooks.Stop.length;
1292
+ settings.hooks.Stop = settings.hooks.Stop.filter(entry =>
1293
+ !entry.hooks?.some(h => h.command?.includes('rrr-update-hud-state'))
1294
+ );
1295
+ if (settings.hooks.Stop.length < before) footerMigrated = true;
1296
+ }
1297
+
1298
+ // Delete old hook files
1299
+ const oldHookFiles = ['statusline.sh', 'rrr-sync-hud-state.sh', 'rrr-update-hud-state.sh'];
1300
+ for (const file of oldHookFiles) {
1301
+ const hookPath = path.join(claudeDir, 'hooks', file);
1302
+ if (fs.existsSync(hookPath)) {
1303
+ fs.unlinkSync(hookPath);
1304
+ footerMigrated = true;
1305
+ }
1306
+ }
1307
+
1308
+ if (footerMigrated) {
1309
+ writeSettings(settingsPath, settings);
1310
+ console.log(` ${green}✓${reset} Migrated: removed footer/statusline (replaced with inline status)`);
1311
+ }
1312
+
1261
1313
  // Copy hooks (check bash availability on Windows first)
1262
1314
  const hooksSrc = path.join(src, 'hooks');
1263
1315
  let bashStatus = { available: true }; // Assume available on non-Windows
@@ -1775,18 +1827,10 @@ function printDoctorSummary(claudeDir, settings, localDirName, isGlobal) {
1775
1827
  */
1776
1828
  function finishInstall(settingsPath, settings, statuslineCommand, notifyCommand, claudeDir, shouldInstallStatusline, shouldInstallNotify, localDirName, isGlobal, bashAvailable = true) {
1777
1829
  // Only configure statusline if hook file exists AND bash is available
1778
- if (shouldInstallStatusline && bashAvailable) {
1779
- if (hookFileExists(claudeDir, 'statusline.sh')) {
1780
- settings.statusLine = {
1781
- type: 'command',
1782
- command: statuslineCommand
1783
- };
1784
- console.log(` ${green}✓${reset} Configured statusline`);
1785
- } else {
1786
- console.log(` ${yellow}⚠${reset} Skipped statusline (hook file not found)`);
1787
- }
1788
- } else if (shouldInstallStatusline && !bashAvailable) {
1789
- console.log(` ${yellow}⚠${reset} Skipped statusline (bash not available)`);
1830
+ // v1.18.4: Statusline removed - replaced with inline status display
1831
+ // The migration code in install() already removes any existing statusLine config
1832
+ if (shouldInstallStatusline) {
1833
+ // No-op: statusline is deprecated, inline status is shown after execute-plan/execute-phase
1790
1834
  }
1791
1835
 
1792
1836
  // Only configure notify hook if hook file exists AND bash is available
@@ -1882,58 +1926,13 @@ function finishInstall(settingsPath, settings, statuslineCommand, notifyCommand,
1882
1926
 
1883
1927
  /**
1884
1928
  * Handle statusline configuration with optional prompt
1929
+ * v1.18.4: Statusline is deprecated - replaced with inline status display
1930
+ * This function now just calls back with false (don't install statusline)
1885
1931
  */
1886
1932
  function handleStatusline(settings, isInteractive, callback) {
1887
- const hasExisting = settings.statusLine != null;
1888
-
1889
- // No existing statusline - just install it
1890
- if (!hasExisting) {
1891
- callback(true);
1892
- return;
1893
- }
1894
-
1895
- // Has existing and --force-statusline flag
1896
- if (forceStatusline) {
1897
- callback(true);
1898
- return;
1899
- }
1900
-
1901
- // Has existing, non-interactive mode - skip
1902
- if (!isInteractive) {
1903
- console.log(` ${yellow}⚠${reset} Skipping statusline (already configured)`);
1904
- console.log(` Use ${cyan}--force-statusline${reset} to replace\n`);
1905
- callback(false);
1906
- return;
1907
- }
1908
-
1909
- // Has existing, interactive mode - prompt user
1910
- const existingCmd = settings.statusLine.command || settings.statusLine.url || '(custom)';
1911
-
1912
- const rl = readline.createInterface({
1913
- input: process.stdin,
1914
- output: process.stdout
1915
- });
1916
-
1917
- console.log(`
1918
- ${yellow}⚠${reset} Existing statusline detected
1919
-
1920
- Your current statusline:
1921
- ${dim}command: ${existingCmd}${reset}
1922
-
1923
- RRR includes a statusline showing:
1924
- • Model name
1925
- • Current task (from todo list)
1926
- • Context window usage (color-coded)
1927
-
1928
- ${cyan}1${reset}) Keep existing
1929
- ${cyan}2${reset}) Replace with RRR statusline
1930
- `);
1931
-
1932
- rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
1933
- rl.close();
1934
- const choice = answer.trim() || '1';
1935
- callback(choice === '2');
1936
- });
1933
+ // v1.18.4: Statusline removed - inline status shown after execute-plan/execute-phase instead
1934
+ // Migration code in install() removes any existing statusLine config
1935
+ callback(false);
1937
1936
  }
1938
1937
 
1939
1938
  /**
@@ -43,8 +43,11 @@ Output: `.planning/REQUIREMENTS.md`
43
43
 
44
44
  <context>
45
45
  @.planning/PROJECT.md
46
- @.planning/research/FEATURES.md (if exists)
47
- @.planning/research/SUMMARY.md (if exists)
46
+ @.planning/STATE.md (to detect active milestone)
47
+
48
+ **Research context (priority order):**
49
+ 1. `.planning/milestones/vX.Y/research/` (milestone-specific)
50
+ 2. `.planning/research/` (project-level fallback)
48
51
  </context>
49
52
 
50
53
  <process>
@@ -54,11 +57,29 @@ Output: `.planning/REQUIREMENTS.md`
54
57
  # Verify project exists
55
58
  [ -f .planning/PROJECT.md ] || { echo "ERROR: No PROJECT.md found. Run /rrr:new-project first."; exit 1; }
56
59
 
57
- # Check for research
58
- [ -f .planning/research/FEATURES.md ] && echo "HAS_RESEARCH" || echo "NO_RESEARCH"
60
+ # Detect active milestone from STATE.md
61
+ ACTIVE_MILESTONE=""
62
+ if [ -f .planning/STATE.md ]; then
63
+ ACTIVE_MILESTONE=$(grep -oE "Milestone:\\s*v[0-9]+\\.[0-9]+" .planning/STATE.md | grep -oE "v[0-9]+\\.[0-9]+")
64
+ fi
65
+
66
+ # Check for research (milestone-specific first, then project-level)
67
+ RESEARCH_DIR=""
68
+ if [ -n "$ACTIVE_MILESTONE" ] && [ -f ".planning/milestones/${ACTIVE_MILESTONE}/research/FEATURES.md" ]; then
69
+ RESEARCH_DIR=".planning/milestones/${ACTIVE_MILESTONE}/research"
70
+ echo "HAS_MILESTONE_RESEARCH: $ACTIVE_MILESTONE"
71
+ elif [ -f .planning/research/FEATURES.md ]; then
72
+ RESEARCH_DIR=".planning/research"
73
+ echo "HAS_PROJECT_RESEARCH"
74
+ else
75
+ echo "NO_RESEARCH"
76
+ fi
59
77
 
60
78
  # Check if requirements already exist
61
79
  [ -f .planning/REQUIREMENTS.md ] && echo "REQUIREMENTS_EXISTS" || echo "NO_REQUIREMENTS"
80
+
81
+ echo "ACTIVE_MILESTONE=${ACTIVE_MILESTONE}"
82
+ echo "RESEARCH_DIR=${RESEARCH_DIR}"
62
83
  ```
63
84
  </step>
64
85
 
@@ -79,13 +100,19 @@ If "Replace": Continue with workflow
79
100
  </step>
80
101
 
81
102
  <step name="execute">
82
- **If HAS_RESEARCH:**
103
+ **If HAS_MILESTONE_RESEARCH or HAS_PROJECT_RESEARCH:**
83
104
  Follow the define-requirements.md workflow:
84
- - Load research features from FEATURES.md
105
+ - Load research features from `${RESEARCH_DIR}/FEATURES.md`
106
+ - Also read `${RESEARCH_DIR}/SUMMARY.md` for "Suggested Project Updates" (if milestone research)
85
107
  - Present features by category
86
- - Ask user to scope each category (v1 / v2 / out of scope)
108
+ - Ask user to scope each category (current milestone / future milestone / out of scope)
87
109
  - Capture any additions research missed
88
- - Generate REQUIREMENTS.md with checkable list
110
+ - Generate/update REQUIREMENTS.md with milestone-specific section
111
+
112
+ **For milestone research mode:**
113
+ - Requirements go into the ACTIVE milestone section (e.g., "## v1.1 — [Name] (Active)")
114
+ - Check "Suggested Project Updates" from research for pre-populated candidates
115
+ - Future milestone candidates go to "Future Milestones" section
89
116
 
90
117
  **If NO_RESEARCH:**
91
118
  Gather requirements through questioning:
@@ -93,8 +120,8 @@ Gather requirements through questioning:
93
120
  - Ask: "What are the main things users need to be able to do?"
94
121
  - For each capability mentioned, probe for specifics
95
122
  - Group into categories (Authentication, Content, etc.)
96
- - For each category, ask what's v1 vs v2 vs out of scope
97
- - Generate REQUIREMENTS.md with checkable list
123
+ - For each category, ask what's current milestone vs future vs out of scope
124
+ - Generate/update REQUIREMENTS.md with milestone-specific section
98
125
 
99
126
  Same output format either way — the difference is source (research vs conversation).
100
127
  </step>