projecta-rrr 1.16.6 → 1.16.8

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,70 @@ 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.8] - 2026-01-28
8
+
9
+ ### Added
10
+
11
+ - **Install-Time Project Context** (`scripts/build-project-context.js`) - Builds comprehensive project memory at install/upgrade:
12
+ - Enumerates all milestones and phases with status
13
+ - Analyzes git history for project evolution narrative
14
+ - Stores context in `.planning/rrr-project-context.json`
15
+ - Auto-rebuilds on RRR upgrade
16
+
17
+ - **Enhanced HUD with Drift Detection** (`scripts/rrr-hud.js`) - Bulletproof drift detection:
18
+ - Prominent red "DRIFT DETECTED" warning with stale plan counts
19
+ - Context signals (files changed without active plan)
20
+ - Changed file tracking with code file detection
21
+ - Actionable numbered guidance: verify-work, complete plans, or pause-work
22
+ - Robust error handling for all git/file operations
23
+
24
+ - **HUD Integration** - Added visual HUD display to 9 commands:
25
+ - Tier 1: progress, execute-plan, verify-work, execute-phase, plan-phase
26
+ - Tier 2: complete-milestone, resume-work, check-todos
27
+ - Tier 3: debug, new-milestone, pause-work
28
+
29
+ ### Changed
30
+
31
+ - **bin/install.js** - Runs context builder after install for any project with `.planning/`
32
+
33
+ - **hooks/rrr-check-update.sh** - Rebuilds project context when RRR upgrade detected
34
+
35
+ ## [1.16.7] - 2026-01-28
36
+
37
+ ### Added
38
+ - **Memory System** (`rrr/lib/memory-store.js`) - Central library for tracking:
39
+ - Command history with intent extraction
40
+ - Current user intent persistence
41
+ - Decision log with rationale
42
+ - Drift detection (context drift, stale plans, decision conflicts)
43
+
44
+ - **Visual HUD** (`scripts/rrr-hud.js`) - ASCII progress display showing:
45
+ - Milestone progress bar with percentage
46
+ - Per-phase completion status
47
+ - Drift status (green/yellow/red)
48
+ - Current intent from memory
49
+
50
+ - **Proactive Guidance** (`scripts/rrr-memory/state-detector.js`) - State-aware suggestions:
51
+ - 4D state analysis (project, milestone, phase, action)
52
+ - `guidanceFor(command)` for 17 command scenarios
53
+ - Orphan phase detection and migration guidance
54
+
55
+ - **Memory-Enriched Preflight** (`scripts/handoff-preflight.js`) - Drift detection on handoff
56
+
57
+ ### Changed
58
+ - **Phase path resolution** (`rrr/lib/phase-paths.md`) - Fixed bug where phases were created outside milestones when no `:construction:` marker existed. Now errors if `.planning/milestones/` exists but no active milestone detected.
59
+
60
+ - **execute-plan** - Tracks intent before execution for drift detection
61
+
62
+ - **verify-work** - Shows memory context during verification
63
+
64
+ - **add-phase / insert-phase** - Validates no orphan phases exist before allowing new phase creation
65
+
66
+ - **Duplicate prevention** (`bin/install.js`, `scripts/doctor-rrr.js`) - Auto-cleans old quarantine directories (>7 days) to prevent duplicate command scanning
67
+
68
+ ### Fixed
69
+ - **Duplicate commands** - 282 command references reduced to 41 by cleaning old quarantines
70
+
7
71
  ## [1.16.6] - 2026-01-28
8
72
 
9
73
  ### Added
package/bin/install.js CHANGED
@@ -11,7 +11,8 @@ const {
11
11
  detectAndQuarantineDuplicates,
12
12
  writeInstallInfo,
13
13
  getCurrentVersion,
14
- getCanonicalRoots
14
+ getCanonicalRoots,
15
+ cleanOldQuarantines
15
16
  } = require('../rrr/lib/install-roots');
16
17
 
17
18
  /**
@@ -909,6 +910,49 @@ function install(isGlobal) {
909
910
  console.log(` ${green}✓${reset} Installed rrr/scripts/test-install-smoke.js`);
910
911
  }
911
912
 
913
+ // PATCH-01: Copy handoff-preflight.js to ~/.claude/rrr/scripts/
914
+ // Memory-enriched preflight for drift detection
915
+ const handoffSrc = path.join(src, 'scripts', 'handoff-preflight.js');
916
+ if (fs.existsSync(handoffSrc)) {
917
+ const scriptsDestDir = path.join(claudeDir, 'rrr', 'scripts');
918
+ fs.mkdirSync(scriptsDestDir, { recursive: true });
919
+ const handoffDest = path.join(scriptsDestDir, 'handoff-preflight.js');
920
+ fs.copyFileSync(handoffSrc, handoffDest);
921
+ console.log(` ${green}✓${reset} Installed rrr/scripts/handoff-preflight.js`);
922
+ }
923
+
924
+ // PATCH-01: Copy rrr-hud.js to ~/.claude/rrr/scripts/
925
+ // Visual HUD for project state display
926
+ const hudSrc = path.join(src, 'scripts', 'rrr-hud.js');
927
+ if (fs.existsSync(hudSrc)) {
928
+ const scriptsDestDir = path.join(claudeDir, 'rrr', 'scripts');
929
+ fs.mkdirSync(scriptsDestDir, { recursive: true });
930
+ const hudDest = path.join(scriptsDestDir, 'rrr-hud.js');
931
+ fs.copyFileSync(hudSrc, hudDest);
932
+ console.log(` ${green}✓${reset} Installed rrr/scripts/rrr-hud.js`);
933
+ }
934
+
935
+ // PATCH-01: Copy rrr-memory/ directory to ~/.claude/rrr/scripts/
936
+ // Memory store and state detector for proactive guidance
937
+ const rrrMemorySrc = path.join(src, 'scripts', 'rrr-memory');
938
+ if (fs.existsSync(rrrMemorySrc)) {
939
+ const scriptsDestDir = path.join(claudeDir, 'rrr', 'scripts');
940
+ const rrrMemoryDest = path.join(scriptsDestDir, 'rrr-memory');
941
+ copyWithPathReplacement(rrrMemorySrc, rrrMemoryDest, pathPrefix);
942
+ console.log(` ${green}✓${reset} Installed rrr/scripts/rrr-memory/`);
943
+ }
944
+
945
+ // PATCH-01: Copy build-project-context.js to ~/.claude/rrr/scripts/
946
+ // Builds project memory (milestones, phases, git history) at install/upgrade
947
+ const projectContextSrc = path.join(src, 'scripts', 'build-project-context.js');
948
+ if (fs.existsSync(projectContextSrc)) {
949
+ const scriptsDestDir = path.join(claudeDir, 'rrr', 'scripts');
950
+ fs.mkdirSync(scriptsDestDir, { recursive: true });
951
+ const projectContextDest = path.join(scriptsDestDir, 'build-project-context.js');
952
+ fs.copyFileSync(projectContextSrc, projectContextDest);
953
+ console.log(` ${green}✓${reset} Installed rrr/scripts/build-project-context.js`);
954
+ }
955
+
912
956
  // Copy skills to ~/.claude/skills (skills system)
913
957
  const skillsSrc = path.join(src, 'rrr', 'skills');
914
958
  if (fs.existsSync(skillsSrc)) {
@@ -963,6 +1007,15 @@ function install(isGlobal) {
963
1007
  if (quarantineResult.quarantined.length > 0) {
964
1008
  console.log(` ${green}✓${reset} Quarantined ${quarantineResult.quarantined.length} legacy/duplicate root(s)`);
965
1009
  }
1010
+
1011
+ // Clean up old quarantine directories (>7 days) to prevent duplicate command scanning
1012
+ console.log(` ${green}✓${reset} Cleaning old quarantine directories...`);
1013
+ const cleanupResult = cleanOldQuarantines({
1014
+ configDir: explicitConfigDir || process.env.CLAUDE_CONFIG_DIR
1015
+ });
1016
+ if (cleanupResult.cleaned.length > 0) {
1017
+ console.log(` ${green}✓${reset} Cleaned ${cleanupResult.cleaned.length} old quarantine folder(s)`);
1018
+ }
966
1019
  }
967
1020
 
968
1021
  // Register rrr-search MCP server and run semantic migration
@@ -1205,6 +1258,27 @@ function install(isGlobal) {
1205
1258
  // Silent fail - cleanup is optional, don't block install
1206
1259
  }
1207
1260
  }
1261
+
1262
+ // PATCH-01: Build project context (milestones, phases, git history)
1263
+ // This creates a persistent memory of project structure for HUD and decisions
1264
+ // Runs once, AFTER all project-specific setup, for any project with .planning
1265
+ const projectContextScript = path.join(src, 'scripts', 'build-project-context.js');
1266
+ if (fs.existsSync(projectContextScript)) {
1267
+ try {
1268
+ const { buildProjectContext } = require(projectContextScript);
1269
+ const planningDir = path.join(projectDir, '.planning');
1270
+ if (fs.existsSync(planningDir)) {
1271
+ const context = buildProjectContext();
1272
+ if (context) {
1273
+ console.log(` ${green}✓${reset} Built project context (${context.stats.totalMilestones} milestones, ${context.stats.totalPlans} plans)`);
1274
+ } else {
1275
+ console.log(` ${green}✓${reset} Project context up to date`);
1276
+ }
1277
+ }
1278
+ } catch (e) {
1279
+ // Silent fail - context building is optional
1280
+ }
1281
+ }
1208
1282
  }
1209
1283
 
1210
1284
  return { settingsPath, settings, statuslineCommand, notifyCommand, claudeDir, localDirName, isGlobal, bashAvailable: bashStatus.available };
@@ -33,6 +33,7 @@ Purpose: Add planned work discovered during execution that belongs at the end of
33
33
  @.planning/STATE.md
34
34
  @rrr/lib/phase-paths.md
35
35
  @rrr/lib/milestone-utils.md
36
+ @rrr/lib/memory-store.js
36
37
  </execution_context>
37
38
 
38
39
  <process>
@@ -68,6 +69,50 @@ Example: /rrr:add-phase Add authentication system
68
69
  Exit.
69
70
  </step>
70
71
 
72
+ <step name="check_orphan_phases_memory">
73
+ **Check for orphan phases using state-detector (PATCH-01 enhancement)**
74
+
75
+ Before creating phases, check if there are orphan phases that need migration:
76
+
77
+ ```bash
78
+ # Check for orphan phases
79
+ node -e "
80
+ const { StateDetector } = require(process.env.HOME + '/.claude/rrr/scripts/rrr-memory/state-detector');
81
+ const detector = new StateDetector();
82
+ const state = detector.detectPhaseState('.planning');
83
+ const milestone = detector.detectMilestoneState('.planning');
84
+
85
+ if (milestone === 'NO_MILESTONE' && state !== 'NO_PHASES') {
86
+ console.log('HAS_ORPHAN_PHASES=true');
87
+ console.log('RUN: /rrr:new-milestone or /rrr:migrate-phases');
88
+ }
89
+ " 2>/dev/null
90
+ ```
91
+
92
+ If `HAS_ORPHAN_PHASES=true` is output, show guidance and exit (unless --force).
93
+
94
+ **If orphan phases detected:**
95
+
96
+ ```
97
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
98
+ ⚠ ORPHAN PHASES DETECTED
99
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
100
+
101
+ Found phases not assigned to any milestone.
102
+ New phases cannot be created until orphans are assigned.
103
+
104
+ To migrate orphan phases:
105
+ 1. /rrr:new-milestone - Create milestone for orphan phases
106
+ 2. /rrr:migrate-phases - Assign phases to milestone
107
+
108
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109
+ ```
110
+
111
+ Exit command.
112
+
113
+ **If no orphans or --force:** Continue to validate_milestone_first step.
114
+ </step>
115
+
71
116
  <step name="validate_milestone_first">
72
117
  **MILESTONE-FIRST ENFORCEMENT (v1.11 breaking change)**
73
118
 
@@ -23,6 +23,11 @@ Enables reviewing captured ideas and deciding what to work on next.
23
23
 
24
24
  <process>
25
25
 
26
+ **Show HUD (first)**
27
+ ```bash
28
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
29
+ ```
30
+
26
31
  <step name="check_exist">
27
32
  ```bash
28
33
  TODO_COUNT=$(ls .planning/todos/pending/*.md 2>/dev/null | wc -l | tr -d ' ')
@@ -37,6 +37,11 @@ Output: Milestone archived (roadmap + requirements), PROJECT.md evolved, git tag
37
37
 
38
38
  <process>
39
39
 
40
+ **Show HUD (first)**
41
+ ```bash
42
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
43
+ ```
44
+
40
45
  **Follow complete-milestone.md workflow:**
41
46
 
42
47
  0. **Check for audit:**
@@ -28,6 +28,11 @@ ls .planning/debug/*.md 2>/dev/null | grep -v resolved | head -5
28
28
 
29
29
  <process>
30
30
 
31
+ **Show HUD (first)**
32
+ ```bash
33
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
34
+ ```
35
+
31
36
  ## 1. Check Active Sessions
32
37
 
33
38
  If active sessions exist AND no $ARGUMENTS:
@@ -38,11 +38,12 @@ Phase: $ARGUMENTS
38
38
 
39
39
  <process>
40
40
 
41
- 0. **Refresh Scope Cache (first)**
41
+ 0. **Show HUD and refresh cache (first)**
42
42
  ```bash
43
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
43
44
  node ~/.claude/rrr/scripts/refresh-scope-cache.js 2>/dev/null || echo "Cache refresh skipped"
44
45
  ```
45
- Cross-platform: works in PowerShell on Windows. Path resolved to installed location.
46
+ Cross-platform: works in PowerShell on Windows. Shows visual project state before execution.
46
47
 
47
48
  1. **Validate phase exists**
48
49
  - Use `find_phase_dir()` from phase-paths library to locate phase directory:
@@ -36,15 +36,54 @@ Plan path: $ARGUMENTS
36
36
 
37
37
  @.planning/STATE.md
38
38
  @.planning/config.json (if exists)
39
+ @rrr/lib/memory-store.js
39
40
  </context>
40
41
 
41
42
  <process>
42
43
 
43
- 0. **Refresh Scope Cache (first)**
44
+ 0. **Refresh Scope Cache and HUD (first)**
44
45
  ```bash
45
46
  node ~/.claude/rrr/scripts/refresh-scope-cache.js 2>/dev/null || echo "Cache refresh skipped"
47
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
46
48
  ```
47
49
  Cross-platform: works in PowerShell on Windows. Path resolved to installed location.
50
+ Shows visual project state before execution.
51
+
52
+ 0. **Track command in memory (before execution)**
53
+ Parse the plan to extract intent from frontmatter and context, then track this execution:
54
+
55
+ ```bash
56
+ # Extract plan ID and objective for intent tracking
57
+ PLAN_ID=$(basename "$ARGUMENTS" | sed 's/-PLAN\.md$//')
58
+ PLAN_DIR=$(dirname "$ARGUMENTS")
59
+ PHASE_DIR=$(basename "$PLAN_DIR")
60
+
61
+ # Get intent from plan frontmatter (try files_modified, then title)
62
+ INTENT=""
63
+ if [ -f "$ARGUMENTS" ]; then
64
+ INTENT=$(grep -E "^files_modified:" "$ARGUMENTS" 2>/dev/null | head -1 | sed 's/files_modified: *\[*\]*/Intent from plan/' || \
65
+ grep -E "^title:" "$ARGUMENTS" 2>/dev/null | head -1 | sed 's/title: *//' || \
66
+ echo "Executing plan $PLAN_ID")
67
+ fi
68
+
69
+ # Track in memory (if memory-store.js is available)
70
+ node -e "
71
+ const { initMemory, trackCommand } = require(process.env.HOME + '/.claude/rrr/lib/memory-store');
72
+ (async () => {
73
+ try {
74
+ const memory = await initMemory();
75
+ await trackCommand(memory, {
76
+ command: '/rrr:execute-plan',
77
+ target: '$PLAN_ID',
78
+ intent: '$INTENT',
79
+ files: []
80
+ });
81
+ } catch (e) {
82
+ // Memory tracking is optional
83
+ }
84
+ })();
85
+ " 2>/dev/null || echo "[MEMORY] Tracking skipped"
86
+ ```
48
87
 
49
88
  0.5. **Scope Check (validate plan is in scope)**
50
89
 
@@ -23,6 +23,7 @@ Purpose: Handle urgent work discovered during execution without renumbering enti
23
23
  @.planning/STATE.md
24
24
  @rrr/lib/phase-paths.md
25
25
  @rrr/lib/milestone-utils.md
26
+ @rrr/lib/memory-store.js
26
27
  </execution_context>
27
28
 
28
29
  <process>
@@ -74,6 +75,50 @@ fi
74
75
 
75
76
  </step>
76
77
 
78
+ <step name="check_orphan_phases_memory">
79
+ **Check for orphan phases using state-detector (PATCH-01 enhancement)**
80
+
81
+ Same validation as add-phase - check for orphan phases before allowing new insert:
82
+
83
+ ```bash
84
+ # Check for orphan phases
85
+ node -e "
86
+ const { StateDetector } = require(process.env.HOME + '/.claude/rrr/scripts/rrr-memory/state-detector');
87
+ const detector = new StateDetector();
88
+ const state = detector.detectPhaseState('.planning');
89
+ const milestone = detector.detectMilestoneState('.planning');
90
+
91
+ if (milestone === 'NO_MILESTONE' && state !== 'NO_PHASES') {
92
+ console.log('HAS_ORPHAN_PHASES=true');
93
+ console.log('RUN: /rrr:new-milestone or /rrr:migrate-phases');
94
+ }
95
+ " 2>/dev/null
96
+ ```
97
+
98
+ If `HAS_ORPHAN_PHASES=true`, show guidance and exit (unless --force).
99
+
100
+ **If orphan phases detected:**
101
+
102
+ ```
103
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
+ ⚠ ORPHAN PHASES DETECTED
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+
107
+ Found phases not assigned to any milestone.
108
+ Inserting new phase not allowed until orphans are assigned.
109
+
110
+ To migrate orphan phases:
111
+ 1. /rrr:new-milestone - Create milestone for orphan phases
112
+ 2. /rrr:migrate-phases - Assign phases to milestone
113
+
114
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
115
+ ```
116
+
117
+ Exit command.
118
+
119
+ **If no orphans or --force:** Continue to validate_milestone_first step.
120
+ </step>
121
+
77
122
  <step name="validate_milestone_first">
78
123
  **MILESTONE-FIRST ENFORCEMENT (v1.11 breaking change)**
79
124
 
@@ -37,6 +37,11 @@ Milestone name: $ARGUMENTS (optional - will prompt if not provided)
37
37
 
38
38
  <process>
39
39
 
40
+ **Show HUD (first)**
41
+ ```bash
42
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
43
+ ```
44
+
40
45
  1. **Load context:**
41
46
  - Read PROJECT.md (existing project, Validated requirements, decisions)
42
47
  - Read MILESTONES.md (what shipped previously)
@@ -19,6 +19,11 @@ Enables seamless resumption in fresh session with full context restoration.
19
19
 
20
20
  <process>
21
21
 
22
+ **Show HUD (first)**
23
+ ```bash
24
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
25
+ ```
26
+
22
27
  <step name="detect">
23
28
  Find current phase directory from most recently modified files.
24
29
  </step>
@@ -71,6 +71,13 @@ Use Glob tool with both structures:
71
71
 
72
72
  <process>
73
73
 
74
+ 0. **Show HUD and refresh cache (first)**
75
+ ```bash
76
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
77
+ node ~/.claude/rrr/scripts/refresh-scope-cache.js 2>/dev/null || echo "Cache refresh skipped"
78
+ ```
79
+ Cross-platform: works in PowerShell on Windows. Shows visual context before planning.
80
+
74
81
  ## 1. Validate Environment (Cross-Platform)
75
82
 
76
83
  **Step 1: Check .planning/ exists via STATE.md**
@@ -24,19 +24,20 @@ Provides situational awareness before continuing work.
24
24
  <process>
25
25
 
26
26
  <step name="refresh_cache">
27
- **Refresh Scope Cache (first, before any reads):**
27
+ **Refresh Scope Cache and HUD (first, before any reads):**
28
28
 
29
29
  **On macOS/Linux:**
30
30
  ```bash
31
31
  node ~/.claude/rrr/scripts/refresh-scope-cache.js 2>/dev/null || echo "Cache refresh skipped"
32
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
32
33
  ```
33
34
 
34
35
  **On Windows (Platform: win32):**
35
- Same command works in PowerShell. If Node unavailable, skip silently.
36
+ Same commands work in PowerShell. If Node unavailable, skip silently.
36
37
 
37
- **Note:** Path is resolved to installed location (e.g., `$HOME/.claude/` or `./.claude/`).
38
+ **Note:** Paths resolve to installed location (e.g., `$HOME/.claude/` or `./.claude/`).
38
39
 
39
- This ensures SCOPE_CACHE.md is current before displaying status.
40
+ This ensures SCOPE_CACHE.md is current and shows visual HUD before displaying status.
40
41
  </step>
41
42
 
42
43
  <step name="verify">
@@ -27,13 +27,14 @@ Routes to the resume-project workflow which handles:
27
27
 
28
28
  <process>
29
29
 
30
- **0. Refresh Scope Cache (first)**
30
+ **0. Show HUD and refresh cache (first)**
31
31
 
32
32
  ```bash
33
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
33
34
  node ~/.claude/rrr/scripts/refresh-scope-cache.js 2>/dev/null || echo "Cache refresh skipped"
34
35
  ```
35
36
 
36
- Cross-platform: works in PowerShell on Windows. Path resolved to installed location.
37
+ Cross-platform: works in PowerShell on Windows. Shows visual project state on resume.
37
38
 
38
39
  **Follow the resume-project workflow** from `@~/.claude/rrr/workflows/resume-project.md`.
39
40
 
@@ -71,8 +71,20 @@ Validate built features through **audit mode by default**, or interactive UAT wi
71
71
 
72
72
  <execution_context>
73
73
  @rrr/lib/phase-paths.md
74
+ @rrr/lib/memory-store.js
74
75
  </execution_context>
75
76
 
77
+ <process>
78
+
79
+ 0. **Show HUD and refresh cache (first)**
80
+ ```bash
81
+ node ~/.claude/rrr/scripts/rrr-hud.js 2>/dev/null || echo "HUD skipped"
82
+ node ~/.claude/rrr/scripts/refresh-scope-cache.js 2>/dev/null || echo "Cache refresh skipped"
83
+ ```
84
+ Cross-platform: works in PowerShell on Windows. Shows visual project state and drift before verification.
85
+
86
+ </process>
87
+
76
88
  <!-- ═══════════════════════════════════════════════════════════════════════════
77
89
  MODE SELECTION - MUST EXECUTE FIRST BEFORE ANY OTHER SECTION
78
90
  ═══════════════════════════════════════════════════════════════════════════ -->
@@ -140,6 +152,41 @@ For manual testing, use: /rrr:verify-work --uat [phase]
140
152
 
141
153
  ---
142
154
 
155
+ ### Step 0.5: Show Memory Context (PATCH-01 enhancement)
156
+
157
+ Display current intent and recent commands to provide context during verification:
158
+
159
+ ```bash
160
+ # Show memory context if available
161
+ node -e "
162
+ const { initMemory, getSummary } = require(process.env.HOME + '/.claude/rrr/lib/memory-store');
163
+ (async () => {
164
+ try {
165
+ const memory = await initMemory();
166
+ const summary = await getSummary(memory);
167
+ console.log('');
168
+ console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
169
+ console.log(' RRR ► MEMORY CONTEXT');
170
+ console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
171
+ console.log('Intent:', summary.currentIntent || '(no intent tracked)');
172
+ console.log('Recent:', summary.recentCommands.slice(0, 2).map(c =>
173
+ c.cmd + (c.target ? '(' + c.target + ')' : '')
174
+ ).join(' → ') || 'none');
175
+ if (summary.drift && summary.drift.drifting) {
176
+ console.log('Drift:', summary.drift.message);
177
+ }
178
+ console.log('───────────────────────────────────────────────────────');
179
+ } catch (e) {
180
+ // Memory not available, skip silently
181
+ }
182
+ })();
183
+ " 2>/dev/null || true
184
+ ```
185
+
186
+ This helps verify-work understand what the user was working on.
187
+
188
+ ---
189
+
143
190
  ### Step 1: Determine Scope
144
191
 
145
192
  **Parse target from arguments (with flags removed):**
@@ -7,10 +7,14 @@
7
7
  # Graceful degradation: if npm is not available, exit silently
8
8
  command -v npm >/dev/null 2>&1 || exit 0
9
9
 
10
+ # Graceful degradation: if jq is not available, exit silently
11
+ command -v jq >/dev/null 2>&1 || exit 0
12
+
10
13
  # Catch any errors and exit gracefully (non-blocking hook)
11
14
  set +e
12
15
 
13
16
  CACHE_FILE="$HOME/.claude/cache/rrr-update-check.json"
17
+ CONTEXT_FILE=".planning/rrr-project-context.json"
14
18
  mkdir -p "$HOME/.claude/cache"
15
19
 
16
20
  # Run check in background (non-blocking)
@@ -18,11 +22,22 @@ mkdir -p "$HOME/.claude/cache"
18
22
  installed=$(cat "$HOME/.claude/rrr/VERSION" 2>/dev/null || echo "0.0.0")
19
23
  latest=$(npm view projecta-rrr version 2>/dev/null)
20
24
 
25
+ update_available=false
21
26
  if [[ -n "$latest" && "$installed" != "$latest" ]]; then
27
+ update_available=true
28
+ fi
29
+
30
+ if [[ "$update_available" == "true" ]]; then
22
31
  echo "{\"update_available\":true,\"installed\":\"$installed\",\"latest\":\"$latest\",\"checked\":$(date +%s)}" > "$CACHE_FILE"
23
32
  else
24
33
  echo "{\"update_available\":false,\"installed\":\"$installed\",\"latest\":\"${latest:-unknown}\",\"checked\":$(date +%s)}" > "$CACHE_FILE"
25
34
  fi
35
+
36
+ # If upgrade available, rebuild project context in background
37
+ # This ensures new RRR capabilities get fresh context data
38
+ if [[ "$update_available" == "true" ]] && [[ -f "scripts/build-project-context.js" ]]; then
39
+ node scripts/build-project-context.js 2>/dev/null &
40
+ fi
26
41
  ) &
27
42
 
28
43
  exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projecta-rrr",
3
- "version": "1.16.6",
3
+ "version": "1.16.8",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code by Projecta.ai",
5
5
  "bin": {
6
6
  "projecta-rrr": "bin/install.js"
@@ -22,7 +22,10 @@
22
22
  "sessions:index": "bash scripts/index-sessions.sh",
23
23
  "sessions:status": "bash scripts/index-sessions.sh --status",
24
24
  "semantic:verify": "bash scripts/verify-semantic-search.sh",
25
- "prepublish:check": "node scripts/prepublish-check.js"
25
+ "prepublish:check": "node scripts/prepublish-check.js",
26
+ "browser:uat": "bash scripts/browser-uat.sh",
27
+ "scaffold:e2e": "bash scripts/scaffold-e2e.sh",
28
+ "chrome:visual": "bash scripts/chrome-visual-check.sh"
26
29
  },
27
30
  "files": [
28
31
  "bin",