projecta-rrr 1.15.13 → 1.16.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/agents/rrr-integration-checker.md +3 -1
  3. package/agents/rrr-phase-researcher.md +4 -3
  4. package/agents/rrr-plan-checker.md +3 -2
  5. package/agents/rrr-planner.md +6 -4
  6. package/agents/rrr-roadmapper.md +3 -3
  7. package/bin/install.js +70 -1
  8. package/commands/rrr/add-phase.md +5 -4
  9. package/commands/rrr/audit-milestone.md +7 -6
  10. package/commands/rrr/create-roadmap.md +1 -1
  11. package/commands/rrr/execute-phase.md +2 -2
  12. package/commands/rrr/execute-plan.md +2 -2
  13. package/commands/rrr/fix-visual-failure.md +21 -1
  14. package/commands/rrr/help.md +47 -5
  15. package/commands/rrr/insert-phase.md +5 -4
  16. package/commands/rrr/new-milestone.md +66 -0
  17. package/commands/rrr/new-project.md +2 -2
  18. package/commands/rrr/pause-work.md +3 -3
  19. package/commands/rrr/plan-milestone-gaps.md +3 -1
  20. package/commands/rrr/plan-phase.md +7 -7
  21. package/commands/rrr/progress.md +9 -0
  22. package/commands/rrr/remove-phase.md +17 -11
  23. package/commands/rrr/research-phase.md +7 -5
  24. package/docs/SCOPE-CACHE-VERIFICATION.md +1 -1
  25. package/docs/vitest-browser-ai.md +323 -0
  26. package/package.json +3 -2
  27. package/rrr/lib/uat/__tests__/cdp-browser.test.js +361 -0
  28. package/rrr/lib/uat/__tests__/v1.16-browser-integration.test.js +548 -0
  29. package/rrr/lib/uat/browser.js +315 -0
  30. package/rrr/lib/uat/cdp-browser.js +629 -0
  31. package/rrr/lib/uat/e2e-nike-demo.test.js +303 -0
  32. package/rrr/lib/uat/examples/vitest-browser-example.test.ts +286 -0
  33. package/rrr/lib/uat/vitest-browser-ai.js +518 -0
  34. package/rrr/lib/uat/vitest-helpers.js +530 -0
  35. package/rrr/lib/uat/vitest-plugin.js +376 -0
  36. package/rrr/lib/uat/zeroshot-validator.js +265 -19
  37. package/rrr/lib/uat/zeroshot-validator.test.js +313 -0
  38. package/rrr/references/continuation-format.md +3 -3
  39. package/rrr/references/git-integration.md +3 -3
  40. package/rrr/references/questioning.md +28 -0
  41. package/rrr/templates/UAT.md +1 -1
  42. package/rrr/templates/continue-here.md +1 -1
  43. package/rrr/templates/discovery.md +2 -2
  44. package/rrr/templates/patches.md +3 -0
  45. package/rrr/templates/phase-prompt.md +2 -2
  46. package/rrr/templates/planner-subagent-prompt.md +6 -6
  47. package/rrr/templates/research-subagent-prompt.md +1 -1
  48. package/rrr/templates/research.md +2 -2
  49. package/rrr/templates/review-checklist.md +1 -1
  50. package/rrr/templates/user-setup.md +1 -1
  51. package/rrr/templates/verification-report.md +1 -1
  52. package/rrr/workflows/complete-milestone.md +14 -5
  53. package/rrr/workflows/create-roadmap.md +4 -2
  54. package/rrr/workflows/diagnose-issues.md +64 -1
  55. package/rrr/workflows/discovery-phase.md +4 -4
  56. package/rrr/workflows/drift-guard.md +592 -0
  57. package/rrr/workflows/execute-phase.md +1 -1
  58. package/rrr/workflows/execute-plan.md +26 -24
  59. package/rrr/workflows/refresh-scope-cache.md +2 -2
  60. package/rrr/workflows/resume-project.md +7 -5
  61. package/rrr/workflows/transition.md +5 -4
  62. package/rrr/workflows/verify-work.md +57 -5
  63. package/scripts/pushpa-jarvis.sh +9 -6
package/CHANGELOG.md CHANGED
@@ -4,6 +4,53 @@ 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.16.1] - 2026-01-27
8
+
9
+ ### Fixed
10
+ - **Missing scripts in npm install** - All user-facing scripts now copied to target project
11
+ - Added: `pushpa-jarvis.sh`, `browser-uat.sh`, `scaffold-e2e.sh`, `chrome-visual-check.sh`, `index-sessions.sh`
12
+ - Added npm scripts: `pushpa:jarvis`, `browser:uat`, `scaffold:e2e`, `chrome:visual`, `sessions:index`
13
+ - Scripts copied alongside existing `pushpa-mode.sh`, `mcp-setup.sh`, `visual-proof.sh`
14
+ - **pushpa-jarvis.sh bug fixes**
15
+ - Fixed `verify_phase()` using wrong variable (`$ph` instead of `$phase`)
16
+ - Fixed `phase_has_summary()` to search both active phases and milestone archives
17
+
18
+ ## [1.16.0] - 2026-01-26
19
+
20
+ ### Added
21
+ - **AI QA Engineer mode** - Autonomous testing persona for exploratory browser testing
22
+ - Uses Playwright MCP for browser control + MiniMax for vision analysis
23
+ - Black-box testing: can only interact through browser, no source code access
24
+ - Tests edge cases: empty inputs, long text, special chars, rapid clicks
25
+ - Cost: ~$0.001 per validation (50-100x cheaper than agent-browse)
26
+
27
+ - **CDP browser adapter** - Fast screenshot capture via Chrome DevTools Protocol
28
+ - Auto-launches Chrome with remote debugging port
29
+ - Preferred method over Playwright for non-interactive operations
30
+ - Method priority: cdp > minimax > playwright-mcp > api > cli
31
+
32
+ - **Vitest Browser AI integration** - AI visual analysis on every test
33
+ - Plugin with afterEach hooks for automatic screenshot capture
34
+ - Helper functions: `expectVisual()`, `describeScreen()`, `waitForVisual()`
35
+ - Documentation and example tests included
36
+
37
+ - **minimax-agent-browse package** - Drop-in replacement for agent-browse
38
+ - Uses local CDP instead of Browserbase (no cloud dependency)
39
+ - MiniMax vision API instead of Anthropic (50-100x cheaper)
40
+ - CLI: `npx minimax-agent-browse "go to google.com and search for cats"`
41
+ - Agent loop: screenshot → analyze → action → repeat
42
+
43
+ - **User-facing browser API** - `rrr/lib/uat/browser.js` for project consumption
44
+ - `getStatus()`, `takeScreenshot()`, `getScreenshotPath()`
45
+ - Abstracts CDP/Playwright implementation details
46
+
47
+ - **Visual failure integration** - `discover_visual_artifacts` step in diagnose-issues
48
+ - Finds Playwright logs, diff images, UAT screenshots
49
+ - Categorizes failures: Page Load, Screenshot Diff, Timeout, etc.
50
+
51
+ ### Changed
52
+ - **Deprecated /rrr:fix-visual-failure** - Functionality now in diagnose-issues workflow
53
+
7
54
  ## [1.15.13] - 2026-01-25
8
55
 
9
56
  ### Added
@@ -57,7 +57,9 @@ For each phase, extract what it provides and what it should consume.
57
57
 
58
58
  ```bash
59
59
  # Key exports from each phase
60
- for summary in .planning/phases/*/*-SUMMARY.md; do
60
+ # Use milestone-aware paths
61
+ PHASE_BASE=$(get_phase_base_dir)
62
+ for summary in "$PHASE_BASE"/*/*-SUMMARY.md; do
61
63
  echo "=== $summary ==="
62
64
  grep -A 10 "Key Files\|Exports\|Provides" "$summary" 2>/dev/null
63
65
  done
@@ -295,7 +295,7 @@ Before submitting research:
295
295
 
296
296
  ## RESEARCH.md Structure
297
297
 
298
- **Location:** `.planning/phases/XX-name/{phase}-RESEARCH.md`
298
+ **Location:** `.planning/milestones/vX.Y/phases/XX-name/{phase}-RESEARCH.md`
299
299
 
300
300
  ```markdown
301
301
  # Phase [X]: [Name] - Research
@@ -444,7 +444,8 @@ Orchestrator provides:
444
444
  **Load phase context (MANDATORY):**
445
445
 
446
446
  ```bash
447
- PHASE_DIR=$(ls -d .planning/phases/${PHASE}-* 2>/dev/null | head -1)
447
+ # Use phase-paths library for milestone-aware resolution
448
+ PHASE_DIR=$(get_phase_dir "${PHASE}")
448
449
 
449
450
  # Read CONTEXT.md if exists (from /rrr:discuss-phase)
450
451
  cat "${PHASE_DIR}"/*-CONTEXT.md 2>/dev/null
@@ -520,7 +521,7 @@ Use the output format template. Populate all sections with verified findings.
520
521
 
521
522
  Write to: `${PHASE_DIR}/${PHASE}-RESEARCH.md`
522
523
 
523
- Where `PHASE_DIR` is the full path (e.g., `.planning/phases/01-foundation`)
524
+ Where `PHASE_DIR` is the full path (e.g., `.planning/milestones/v1.0/phases/01-foundation`)
524
525
 
525
526
  ## Step 6: Commit Research
526
527
 
@@ -244,8 +244,9 @@ issue:
244
244
  Gather verification context from the phase directory and project state.
245
245
 
246
246
  ```bash
247
- # Phase directory (provided in prompt)
248
- PHASE_DIR=".planning/phases/${PHASE_ARG}"
247
+ # Phase directory (provided in prompt) - use phase-paths library
248
+ # Searches: .planning/milestones/vX.Y/phases/NN-* (new) → .planning/phases/NN-* (legacy)
249
+ PHASE_DIR=$(get_phase_dir "${PHASE_ARG}")
249
250
 
250
251
  # List all PLAN.md files
251
252
  ls "$PHASE_DIR"/*-PLAN.md 2>/dev/null
@@ -1152,8 +1152,8 @@ git commit -m "fix(${PHASE}): revise plans based on checker feedback"
1152
1152
 
1153
1153
  ### Files Updated
1154
1154
 
1155
- - .planning/phases/16-xxx/16-01-PLAN.md
1156
- - .planning/phases/16-xxx/16-02-PLAN.md
1155
+ - .planning/milestones/vX.Y/phases/16-xxx/16-01-PLAN.md
1156
+ - .planning/milestones/vX.Y/phases/16-xxx/16-02-PLAN.md
1157
1157
 
1158
1158
  {If any issues NOT addressed:}
1159
1159
 
@@ -1204,7 +1204,9 @@ Check roadmap and existing phases:
1204
1204
 
1205
1205
  ```bash
1206
1206
  cat .planning/ROADMAP.md
1207
- ls .planning/phases/
1207
+ # Use milestone-aware path
1208
+ PHASE_BASE=$(get_phase_base_dir)
1209
+ ls "$PHASE_BASE"/
1208
1210
  ```
1209
1211
 
1210
1212
  If multiple phases available, ask which one to plan. If obvious (first incomplete phase), proceed.
@@ -1223,7 +1225,7 @@ Apply discovery level protocol (see discovery_levels section).
1223
1225
 
1224
1226
  1. Scan all summary frontmatter (first ~25 lines):
1225
1227
  ```bash
1226
- for f in .planning/phases/*/*-SUMMARY.md; do
1228
+ for f in "$PHASE_BASE"/*/*-SUMMARY.md; do
1227
1229
  sed -n '1,/^---$/p; /^---$/q' "$f" | head -30
1228
1230
  done
1229
1231
  ```
@@ -570,9 +570,9 @@ When files are written and returning to orchestrator:
570
570
  **Files written:**
571
571
  - .planning/ROADMAP.md
572
572
  - .planning/STATE.md
573
- - .planning/phases/01-{phase-name}/
574
- - .planning/phases/02-{phase-name}/
575
- - ... (all phases zero-padded)
573
+ - .planning/milestones/vX.Y/phases/01-{phase-name}/
574
+ - .planning/milestones/vX.Y/phases/02-{phase-name}/
575
+ - ... (all phases zero-padded under milestone)
576
576
 
577
577
  **Updated:**
578
578
  - .planning/REQUIREMENTS.md (traceability section)
package/bin/install.js CHANGED
@@ -505,7 +505,16 @@ function installScripts(targetDir) {
505
505
 
506
506
  const installed = [];
507
507
  const skipped = [];
508
- const scripts = ['pushpa-mode.sh', 'mcp-setup.sh', 'visual-proof.sh'];
508
+ const scripts = [
509
+ 'pushpa-mode.sh',
510
+ 'pushpa-jarvis.sh',
511
+ 'mcp-setup.sh',
512
+ 'visual-proof.sh',
513
+ 'browser-uat.sh',
514
+ 'scaffold-e2e.sh',
515
+ 'chrome-visual-check.sh',
516
+ 'index-sessions.sh'
517
+ ];
509
518
 
510
519
  for (const script of scripts) {
511
520
  const srcFile = path.join(srcScriptsDir, script);
@@ -598,6 +607,66 @@ function addNpmScripts(targetDir, installedScripts, bashAvailable = true) {
598
607
  }
599
608
  }
600
609
 
610
+ // Add pushpa:jarvis script if pushpa-jarvis.sh was installed
611
+ if (installedScripts.includes('pushpa-jarvis.sh') || fs.existsSync(path.join(targetDir, 'scripts', 'pushpa-jarvis.sh'))) {
612
+ if (pkgJson.scripts['pushpa:jarvis']) {
613
+ skipped.push('pushpa:jarvis');
614
+ console.log(` ${yellow}⚠${reset} Skipped npm script "pushpa:jarvis" (already exists)`);
615
+ } else {
616
+ pkgJson.scripts['pushpa:jarvis'] = 'bash scripts/pushpa-jarvis.sh';
617
+ added.push('pushpa:jarvis');
618
+ console.log(` ${green}✓${reset} Added npm script "pushpa:jarvis"`);
619
+ }
620
+ }
621
+
622
+ // Add browser:uat script if browser-uat.sh was installed
623
+ if (installedScripts.includes('browser-uat.sh') || fs.existsSync(path.join(targetDir, 'scripts', 'browser-uat.sh'))) {
624
+ if (pkgJson.scripts['browser:uat']) {
625
+ skipped.push('browser:uat');
626
+ console.log(` ${yellow}⚠${reset} Skipped npm script "browser:uat" (already exists)`);
627
+ } else {
628
+ pkgJson.scripts['browser:uat'] = 'bash scripts/browser-uat.sh';
629
+ added.push('browser:uat');
630
+ console.log(` ${green}✓${reset} Added npm script "browser:uat"`);
631
+ }
632
+ }
633
+
634
+ // Add scaffold:e2e script if scaffold-e2e.sh was installed
635
+ if (installedScripts.includes('scaffold-e2e.sh') || fs.existsSync(path.join(targetDir, 'scripts', 'scaffold-e2e.sh'))) {
636
+ if (pkgJson.scripts['scaffold:e2e']) {
637
+ skipped.push('scaffold:e2e');
638
+ console.log(` ${yellow}⚠${reset} Skipped npm script "scaffold:e2e" (already exists)`);
639
+ } else {
640
+ pkgJson.scripts['scaffold:e2e'] = 'bash scripts/scaffold-e2e.sh';
641
+ added.push('scaffold:e2e');
642
+ console.log(` ${green}✓${reset} Added npm script "scaffold:e2e"`);
643
+ }
644
+ }
645
+
646
+ // Add chrome:visual script if chrome-visual-check.sh was installed
647
+ if (installedScripts.includes('chrome-visual-check.sh') || fs.existsSync(path.join(targetDir, 'scripts', 'chrome-visual-check.sh'))) {
648
+ if (pkgJson.scripts['chrome:visual']) {
649
+ skipped.push('chrome:visual');
650
+ console.log(` ${yellow}⚠${reset} Skipped npm script "chrome:visual" (already exists)`);
651
+ } else {
652
+ pkgJson.scripts['chrome:visual'] = 'bash scripts/chrome-visual-check.sh';
653
+ added.push('chrome:visual');
654
+ console.log(` ${green}✓${reset} Added npm script "chrome:visual"`);
655
+ }
656
+ }
657
+
658
+ // Add sessions:index script if index-sessions.sh was installed
659
+ if (installedScripts.includes('index-sessions.sh') || fs.existsSync(path.join(targetDir, 'scripts', 'index-sessions.sh'))) {
660
+ if (pkgJson.scripts['sessions:index']) {
661
+ skipped.push('sessions:index');
662
+ console.log(` ${yellow}⚠${reset} Skipped npm script "sessions:index" (already exists)`);
663
+ } else {
664
+ pkgJson.scripts['sessions:index'] = 'bash scripts/index-sessions.sh';
665
+ added.push('sessions:index');
666
+ console.log(` ${green}✓${reset} Added npm script "sessions:index"`);
667
+ }
668
+ }
669
+
601
670
  // Write back if we added anything
602
671
  if (added.length > 0) {
603
672
  fs.writeFileSync(pkgPath, JSON.stringify(pkgJson, null, 2) + '\n');
@@ -111,11 +111,12 @@ Before creating any phase, validate:
111
111
 
112
112
  2. **Check for orphan phases:**
113
113
 
114
- Count phases in `.planning/phases/` that are not assigned to any milestone in ROADMAP.md.
114
+ Count phases in the active milestone that are not assigned in ROADMAP.md.
115
115
 
116
116
  ```bash
117
- # List phase directories
118
- PHASE_DIRS=$(ls -d .planning/phases/*/ 2>/dev/null | wc -l)
117
+ # List phase directories (check both new and legacy locations)
118
+ PHASE_BASE=$(get_phase_base_dir)
119
+ PHASE_DIRS=$(ls -d "$PHASE_BASE"/*/ 2>/dev/null | wc -l)
119
120
 
120
121
  # Count phases in ROADMAP.md (look for "### Phase N:")
121
122
  ROADMAP_PHASES=$(grep -c "^### Phase" .planning/ROADMAP.md 2>/dev/null || echo "0")
@@ -358,7 +359,7 @@ Phase addition is complete when:
358
359
 
359
360
  - [ ] Active milestone exists before allowing phase creation
360
361
  - [ ] No orphan phases exist before allowing phase creation
361
- - [ ] Phase directory created: `.planning/phases/{NN}-{slug}/`
362
+ - [ ] Phase directory created in MILESTONE: `.planning/milestones/v{X.Y}/phases/{NN}-{slug}/`
362
363
  - [ ] Roadmap updated with new phase entry
363
364
  - [ ] STATE.md updated with roadmap evolution note
364
365
  - [ ] New phase appears at end of current milestone
@@ -33,8 +33,8 @@ Version: $ARGUMENTS (optional — defaults to current milestone)
33
33
  @.planning/config.json (if exists)
34
34
 
35
35
  **Completed Work:**
36
- Glob: .planning/phases/*/*-SUMMARY.md
37
- Glob: .planning/phases/*/*-VERIFICATION.md
36
+ Glob: .planning/milestones/vX.Y/phases/*/*-SUMMARY.md
37
+ Glob: .planning/milestones/vX.Y/phases/*/*-VERIFICATION.md
38
38
  </context>
39
39
 
40
40
  <process>
@@ -42,8 +42,9 @@ Glob: .planning/phases/*/*-VERIFICATION.md
42
42
  ## 1. Determine Milestone Scope
43
43
 
44
44
  ```bash
45
- # Get phases in milestone
46
- ls -d .planning/phases/*/ | sort -V
45
+ # Get phases in milestone - use milestone-aware path
46
+ PHASE_BASE=$(get_phase_base_dir)
47
+ ls -d "$PHASE_BASE"/*/ | sort -V
47
48
  ```
48
49
 
49
50
  - Parse version from arguments or detect current from ROADMAP.md
@@ -56,8 +57,8 @@ ls -d .planning/phases/*/ | sort -V
56
57
  For each phase directory, read the VERIFICATION.md:
57
58
 
58
59
  ```bash
59
- cat .planning/phases/01-*/*-VERIFICATION.md
60
- cat .planning/phases/02-*/*-VERIFICATION.md
60
+ cat "$PHASE_BASE"/01-*/*-VERIFICATION.md
61
+ cat "$PHASE_BASE"/02-*/*-VERIFICATION.md
61
62
  # etc.
62
63
  ```
63
64
 
@@ -130,7 +130,7 @@ Roadmap created:
130
130
  <output>
131
131
  - `.planning/ROADMAP.md`
132
132
  - `.planning/STATE.md`
133
- - `.planning/phases/XX-name/` directories
133
+ - `.planning/milestones/vX.Y/phases/XX-name/` directories
134
134
  </output>
135
135
 
136
136
  <success_criteria>
@@ -341,7 +341,7 @@ All phase goals verified ✓
341
341
  **Phase {Z}: {Name}**
342
342
 
343
343
  Score: {N}/{M} must-haves verified
344
- Report: `.planning/phases/{phase_dir}/{phase}-VERIFICATION.md`
344
+ Report: `{phase_dir}/{phase}-VERIFICATION.md`
345
345
 
346
346
  ### What's Missing
347
347
 
@@ -360,7 +360,7 @@ Report: `.planning/phases/{phase_dir}/{phase}-VERIFICATION.md`
360
360
  ───────────────────────────────────────────────────────────────
361
361
 
362
362
  **Also available:**
363
- - `cat .planning/phases/{phase_dir}/{phase}-VERIFICATION.md` — see full report
363
+ - `cat {phase_dir}/{phase}-VERIFICATION.md` — see full report
364
364
  - `/rrr:verify-work {Z}` — manual testing before planning
365
365
 
366
366
  ───────────────────────────────────────────────────────────────
@@ -144,7 +144,7 @@ Plan path: $ARGUMENTS
144
144
  Generated via `--summary-only` flag after preflight confirmed all deliverables present.
145
145
  ```
146
146
 
147
- 4. Write to: `.planning/phases/{phase}/{plan_id}-SUMMARY.md`
147
+ 4. Write to: `.planning/milestones/vX.Y/phases/{phase}/{plan_id}-SUMMARY.md`
148
148
 
149
149
  5. Update STATE.md to reflect completion
150
150
 
@@ -153,7 +153,7 @@ Plan path: $ARGUMENTS
153
153
  ✓ SUMMARY.md generated (summary-only mode)
154
154
 
155
155
  Plan: {plan_id}
156
- Path: .planning/phases/{phase}/{plan_id}-SUMMARY.md
156
+ Path: .planning/milestones/vX.Y/phases/{phase}/{plan_id}-SUMMARY.md
157
157
 
158
158
  No execution performed — existing work documented.
159
159
  ```
@@ -1,10 +1,30 @@
1
1
  ---
2
2
  name: rrr:fix-visual-failure
3
3
  description: Analyze visual proof failures and suggest fixes
4
+ deprecated: true
4
5
  ---
5
6
 
7
+ <!--
8
+ DEPRECATED: This command is now integrated into /rrr:verify-work --uat
9
+
10
+ The diagnose-issues workflow (called after UAT finds gaps) now includes
11
+ visual artifact discovery and failure categorization. This provides:
12
+ - Automatic discovery of Playwright logs, diff images, UAT screenshots
13
+ - Failure type categorization (Page Load, Screenshot Diff, Timeout, etc.)
14
+ - Enriched context for debug agents investigating gaps
15
+
16
+ For visual testing workflows, use:
17
+ - `/rrr:verify-work --uat` — runs UAT, diagnoses failures inline
18
+ - `/rrr:debug` — for standalone debugging of specific issues
19
+
20
+ Deprecated: 2026-01-25
21
+ -->
22
+
6
23
  <objective>
7
- Analyze the most recent visual proof failure and provide diagnosis with targeted fix suggestions.
24
+ **DEPRECATED:** Use `/rrr:verify-work --uat` instead.
25
+
26
+ This command analyzed visual proof failures. Its functionality is now
27
+ integrated into the diagnose-issues workflow called by verify-work --uat.
8
28
  </objective>
9
29
 
10
30
  <behavior>
@@ -220,13 +220,13 @@ Usage: `/rrr:list-phase-assumptions 3`
220
220
  **`/rrr:plan-phase <number>`**
221
221
  Create detailed execution plan for a specific phase.
222
222
 
223
- - Generates `.planning/phases/XX-phase-name/XX-YY-PLAN.md`
223
+ - Generates `.planning/milestones/v{X.Y}/phases/XX-phase-name/XX-YY-PLAN.md`
224
224
  - Breaks phase into concrete, actionable tasks
225
225
  - Includes verification criteria and success measures
226
226
  - Multiple plans per phase supported (XX-01, XX-02, etc.)
227
227
 
228
228
  Usage: `/rrr:plan-phase 1`
229
- Result: Creates `.planning/phases/01-foundation/01-01-PLAN.md`
229
+ Result: Creates `.planning/milestones/v1.0/phases/01-foundation/01-01-PLAN.md`
230
230
 
231
231
  ### Execution
232
232
 
@@ -238,7 +238,7 @@ Execute a single PLAN.md file.
238
238
  - Updates STATE.md with accumulated context
239
239
  - Use for interactive execution with checkpoints
240
240
 
241
- Usage: `/rrr:execute-plan .planning/phases/01-foundation/01-01-PLAN.md`
241
+ Usage: `/rrr:execute-plan .planning/milestones/v1.0/phases/01-foundation/01-01-PLAN.md`
242
242
 
243
243
  **`/rrr:execute-phase <phase-number>`**
244
244
  Execute all unexecuted plans in a phase with parallel background agents.
@@ -777,7 +777,7 @@ verification:
777
777
  **Reviewing HITL phases after Pushpa:**
778
778
  ```
779
779
  /rrr:progress # Shows pending HITL phases
780
- /rrr:execute-plan .planning/phases/05-deploy/05-03-PLAN.md # Execute interactively
780
+ /rrr:execute-plan .planning/milestones/v1.0/phases/05-deploy/05-03-PLAN.md # Execute interactively
781
781
  ```
782
782
 
783
783
  **Verification Ladder**
@@ -1000,7 +1000,7 @@ FRONTEND_IMPACT=true bash scripts/browser-uat.sh
1000
1000
  ```
1001
1001
  /rrr:insert-phase 5 "Critical security fix"
1002
1002
  /rrr:plan-phase 5.1
1003
- /rrr:execute-plan .planning/phases/05.1-critical-security-fix/05.1-01-PLAN.md
1003
+ /rrr:execute-plan .planning/milestones/v1.0/phases/05.1-critical-security-fix/05.1-01-PLAN.md
1004
1004
  ```
1005
1005
 
1006
1006
  **Completing a milestone:**
@@ -1181,6 +1181,48 @@ bash scripts/vendor-droid-tings-skills.sh --list # See available
1181
1181
  DROID_TINGS_ALLOWLIST="axolotl,unsloth" bash scripts/vendor-droid-tings-skills.sh
1182
1182
  ```
1183
1183
 
1184
+ ## Drift Prevention
1185
+
1186
+ **Core Principle:** If it's not part of a plan, it doesn't get worked on. All work must be tracked.
1187
+
1188
+ RRR includes a Drift Guard that activates when:
1189
+ 1. `.planning/STATE.md` exists (RRR is initialized)
1190
+ 2. You request code changes (add, fix, update, create, implement, etc.)
1191
+ 3. There's no active plan context
1192
+
1193
+ **What happens:** Claude detects you're "between phases" and asks how to proceed:
1194
+
1195
+ | Project State | What Drift Guard Asks |
1196
+ |---------------|----------------------|
1197
+ | **mid_plan** | Resume incomplete plan or start something new? |
1198
+ | **mid_phase** | Is this part of an existing plan, urgent insert, or new work? Work must attach to a PLAN.md. |
1199
+ | **post_milestone** | Small fix (patch), medium feature (add phase), or large work (new milestone)? |
1200
+ | **between_milestones** | Start new milestone, hotfix previous, or capture as TODO? |
1201
+ | **between_phases** | Part of next phase, urgent fix for previous, or new scope? |
1202
+ | **pre_planning** | Plan the phase first, discuss context, or create quick single-task plan? |
1203
+
1204
+ **Routing options:**
1205
+ - **Add to existing plan** — Route to `/rrr:execute-plan`
1206
+ - **Insert hotfix** — Route to `/rrr:insert-phase` (creates decimal phase like 5.1)
1207
+ - **Add new plan** — Route to `/rrr:plan-phase` with `--add`
1208
+ - **Capture as TODO** — Route to `/rrr:add-todo`
1209
+ - **Override (proceed anyway)** — Logged to STATE.md for accountability
1210
+
1211
+ **Small changes:** For typo fixes and tiny adjustments, you can proceed with an override. These are logged but don't require full plan overhead.
1212
+
1213
+ **Why this matters:**
1214
+ - Prevents work from falling through the cracks
1215
+ - Ensures all changes are traceable to requirements
1216
+ - Makes `/rrr:progress` accurate
1217
+ - Enables proper milestone completion tracking
1218
+
1219
+ **Check your drift guard status:**
1220
+ ```
1221
+ /rrr:progress
1222
+ ```
1223
+
1224
+ Shows current state and whether drift protection is active.
1225
+
1184
1226
  ## Getting Help
1185
1227
 
1186
1228
  - Read `.planning/PROJECT.md` for project vision
@@ -117,11 +117,12 @@ Before creating any phase, validate:
117
117
 
118
118
  2. **Check for orphan phases:**
119
119
 
120
- Count phases in `.planning/phases/` that are not assigned to any milestone in ROADMAP.md.
120
+ Count phases in the active milestone that are not assigned in ROADMAP.md.
121
121
 
122
122
  ```bash
123
- # List phase directories
124
- PHASE_DIRS=$(ls -d .planning/phases/*/ 2>/dev/null | wc -l)
123
+ # List phase directories (check both new and legacy locations)
124
+ PHASE_BASE=$(get_phase_base_dir)
125
+ PHASE_DIRS=$(ls -d "$PHASE_BASE"/*/ 2>/dev/null | wc -l)
125
126
 
126
127
  # Count phases in ROADMAP.md (look for "### Phase N:")
127
128
  ROADMAP_PHASES=$(grep -c "^### Phase" .planning/ROADMAP.md 2>/dev/null || echo "0")
@@ -361,7 +362,7 @@ Phase insertion is complete when:
361
362
 
362
363
  - [ ] Active milestone exists before allowing phase creation
363
364
  - [ ] No orphan phases exist before allowing phase creation
364
- - [ ] Phase directory created: `.planning/phases/{N.M}-{slug}/`
365
+ - [ ] Phase directory created in MILESTONE: `.planning/milestones/v{X.Y}/phases/{N.M}-{slug}/`
365
366
  - [ ] Roadmap updated with new phase entry (includes "(INSERTED)" marker)
366
367
  - [ ] Phase inserted in correct position (after target phase, before next integer phase)
367
368
  - [ ] STATE.md updated with roadmap evolution note
@@ -43,6 +43,71 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
43
43
  - Read STATE.md (pending todos, blockers)
44
44
  - Check for MILESTONE-CONTEXT.md (from /rrr:discuss-milestone)
45
45
 
46
+ 1.1. **Close patches from previous milestone:**
47
+
48
+ Check if the previous milestone has any patches that need to be closed.
49
+
50
+ ```bash
51
+ # Find the most recent milestone folder
52
+ PREV_MILESTONE=$(ls -d .planning/milestones/v*/ 2>/dev/null | sort -V | tail -1 | xargs basename)
53
+ echo "Previous milestone: $PREV_MILESTONE"
54
+
55
+ # Check if PATCHES.md exists and has actual patch entries (not just template)
56
+ PATCHES_FILE=".planning/milestones/${PREV_MILESTONE}/PATCHES.md"
57
+ if [ -f "$PATCHES_FILE" ]; then
58
+ # Check if it has actual patch entries (## v*.* - pattern)
59
+ PATCH_COUNT=$(grep -c "^## v[0-9]" "$PATCHES_FILE" 2>/dev/null || echo "0")
60
+ echo "Patches found: $PATCH_COUNT"
61
+ fi
62
+ ```
63
+
64
+ **If patches exist (PATCH_COUNT > 0):**
65
+
66
+ Present patch summary and close them:
67
+
68
+ ```
69
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
70
+ CLOSING PATCHES FROM {PREV_MILESTONE}
71
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
72
+
73
+ The following patches were shipped for {PREV_MILESTONE}:
74
+
75
+ {List patch titles from PATCHES.md}
76
+
77
+ These will be marked as CLOSED since we're starting a new milestone.
78
+ ```
79
+
80
+ Update the PATCHES.md file header:
81
+
82
+ ```bash
83
+ # Add CLOSED status header to PATCHES.md
84
+ # Insert after the first line (title)
85
+ ```
86
+
87
+ Change the file to add a status header:
88
+
89
+ ```markdown
90
+ # v{X.Y} Patch Releases
91
+
92
+ **Status:** ✅ CLOSED (superseded by v{NEW_VERSION})
93
+ **Patches shipped:** {PATCH_COUNT}
94
+ **Closed:** {TODAY}
95
+
96
+ ---
97
+
98
+ [rest of file unchanged]
99
+ ```
100
+
101
+ Commit the closure:
102
+
103
+ ```bash
104
+ git add "$PATCHES_FILE"
105
+ git commit -m "docs: close v${PREV_MILESTONE} patches (starting v{NEW_VERSION})"
106
+ ```
107
+
108
+ **If no patches (PATCH_COUNT = 0 or file doesn't exist):**
109
+ - Skip silently, continue to step 1.5
110
+
46
111
  1.5. **Version consistency check (MANDATORY):**
47
112
 
48
113
  Before writing any milestone files, verify version consistency.
@@ -212,6 +277,7 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
212
277
  </process>
213
278
 
214
279
  <success_criteria>
280
+ - Previous milestone patches closed (if any existed)
215
281
  - PROJECT.md updated with Current Milestone section
216
282
  - Active requirements reflect new milestone goals
217
283
  - STATE.md reset for new milestone
@@ -63,7 +63,7 @@ This is the most leveraged moment in any project. Deep questioning here means be
63
63
  - `.planning/REQUIREMENTS.md` — scoped requirements
64
64
  - `.planning/ROADMAP.md` — phase structure
65
65
  - `.planning/STATE.md` — project memory
66
- - `.planning/phases/` — phase directories
66
+ - `.planning/milestones/v{X.Y}/phases/` — phase directories (under each milestone)
67
67
 
68
68
  **After this command:** Run `/rrr:plan-phase 1` to start execution.
69
69
 
@@ -1576,7 +1576,7 @@ Configure Claude Code with MCP servers for your selected stack:
1576
1576
  - `.planning/REQUIREMENTS.md`
1577
1577
  - `.planning/ROADMAP.md`
1578
1578
  - `.planning/STATE.md`
1579
- - `.planning/phases/XX-name/` directories
1579
+ - `.planning/milestones/vX.Y/phases/XX-name/` directories
1580
1580
 
1581
1581
  </output>
1582
1582
 
@@ -38,7 +38,7 @@ Ask user for clarifications if needed.
38
38
  </step>
39
39
 
40
40
  <step name="write">
41
- **Write handoff to `.planning/phases/XX-name/.continue-here.md`:**
41
+ **Write handoff to `.planning/milestones/vX.Y/phases/XX-name/.continue-here.md`:**
42
42
 
43
43
  ```markdown
44
44
  ---
@@ -91,14 +91,14 @@ Be specific enough for a fresh Claude to understand immediately.
91
91
 
92
92
  <step name="commit">
93
93
  ```bash
94
- git add .planning/phases/*/.continue-here.md
94
+ git add .planning/milestones/**/phases/*/.continue-here.md
95
95
  git commit -m "wip: [phase-name] paused at task [X]/[Y]"
96
96
  ```
97
97
  </step>
98
98
 
99
99
  <step name="confirm">
100
100
  ```
101
- ✓ Handoff created: .planning/phases/[XX-name]/.continue-here.md
101
+ ✓ Handoff created: .planning/milestones/vX.Y/phases/[XX-name]/.continue-here.md
102
102
 
103
103
  Current state:
104
104
 
@@ -95,7 +95,9 @@ Gap: Flow "View dashboard" broken at data fetch
95
95
 
96
96
  Find highest existing phase:
97
97
  ```bash
98
- ls -d .planning/phases/*/ | sort -V | tail -1
98
+ # Use milestone-aware path
99
+ PHASE_BASE=$(get_phase_base_dir)
100
+ ls -d "$PHASE_BASE"/*/ | sort -V | tail -1
99
101
  ```
100
102
 
101
103
  New phases continue from there: