projecta-rrr 1.9.5 → 1.9.7

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.
@@ -323,6 +323,34 @@ Create context handoff when pausing work mid-phase.
323
323
 
324
324
  Usage: `/rrr:pause-work`
325
325
 
326
+ ### Verification
327
+
328
+ **`/rrr:verify-work [target] [--audit | --uat]`**
329
+ Validate built features through audit or interactive UAT.
330
+
331
+ **Two modes:**
332
+
333
+ | Flag | Behavior |
334
+ |------|----------|
335
+ | `--audit` (default) | Non-interactive audit. Checks PLAN/SUMMARY existence and git evidence. Produces audit report. Does NOT touch UAT files. |
336
+ | `--uat` | Interactive UAT. Creates/resumes UAT.md for manual testing with persistent state. |
337
+
338
+ **Target options:**
339
+ - Phase: `05`, `5`, `05-auth` — verify that phase
340
+ - Milestone: `v1.9` — verify all phases in milestone
341
+ - Empty — verify current milestone from STATE.md
342
+
343
+ **Examples:**
344
+ ```
345
+ /rrr:verify-work # Audit current milestone (default)
346
+ /rrr:verify-work --audit # Audit current milestone
347
+ /rrr:verify-work --audit 05 # Audit phase 05 only
348
+ /rrr:verify-work --audit v1.9 # Audit all phases in v1.9
349
+ /rrr:verify-work --uat 05 # Interactive UAT for phase 05
350
+ ```
351
+
352
+ **Audit output:** `.planning/artifacts/VERIFY_WORK_AUDIT.md`
353
+
326
354
  ### Debugging
327
355
 
328
356
  **`/rrr:debug [issue description]`**
@@ -236,6 +236,10 @@ Read its `<objective>` section.
236
236
 
237
237
  <sub>`/clear` first → fresh context window</sub>
238
238
 
239
+ <sub>Already did some of this work?
240
+ - `/rrr:verify-work --audit {phase}` — check implementation (non-interactive)
241
+ - `/rrr:verify-work --uat {phase}` — interactive UAT testing</sub>
242
+
239
243
  ---
240
244
  ```
241
245
 
@@ -305,7 +309,7 @@ UAT.md exists with gaps (diagnosed issues). User needs to plan fixes.
305
309
 
306
310
  **Also available:**
307
311
  - `/rrr:execute-plan [path]` — continue with other work first
308
- - `/rrr:verify-work {phase}` — run more UAT testing
312
+ - `/rrr:verify-work --uat {phase}` — interactive UAT testing
309
313
 
310
314
  ---
311
315
  ```
@@ -370,7 +374,7 @@ Full report: .planning/artifacts/VERIFY_WORK_AUDIT.md
370
374
  ---
371
375
 
372
376
  **Also available:**
373
- - `/rrr:verify-work {Z}` — user acceptance test before continuing
377
+ - `/rrr:verify-work --uat {Z}` — user acceptance test before continuing
374
378
  - `/rrr:verify-work --audit` — full implementation audit
375
379
  - `/rrr:discuss-phase {Z+1}` — gather context first
376
380
 
@@ -420,7 +424,7 @@ Full report: .planning/artifacts/VERIFY_WORK_AUDIT.md
420
424
 
421
425
  **Also available:**
422
426
  - `/rrr:verify-work --audit` — full implementation audit report
423
- - `/rrr:verify-work` — interactive user acceptance test
427
+ - `/rrr:verify-work --uat` — interactive user acceptance test
424
428
 
425
429
  ---
426
430
  ```
@@ -462,21 +466,14 @@ Ready to plan the next milestone.
462
466
 
463
467
  ## ▶ Next Up
464
468
 
465
- **Discuss Next Milestone** figure out what to build next
466
-
467
- `/rrr:discuss-milestone`
469
+ | Option | Command | What it does |
470
+ |--------|---------|--------------|
471
+ | **Audit completion** | `/rrr:verify-work --audit` | Check plan/summary + git evidence (no UAT) |
472
+ | **Interactive UAT** | `/rrr:verify-work --uat` | Manual testing with UAT.md files |
473
+ | **Plan next milestone** | `/rrr:discuss-milestone` | Figure out what to build next |
468
474
 
469
475
  <sub>`/clear` first → fresh context window</sub>
470
476
 
471
- ---
472
-
473
- **Next milestone flow:**
474
- 1. `/rrr:discuss-milestone` — thinking partner, creates context file
475
- 2. `/rrr:new-milestone` — update PROJECT.md with new goals
476
- 3. `/rrr:research-project` — (optional) research ecosystem
477
- 4. `/rrr:define-requirements` — scope what to build
478
- 5. `/rrr:create-roadmap` — plan how to build it
479
-
480
477
  ---
481
478
  ```
482
479
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rrr:verify-work
3
- description: Validate built features through conversational UAT
4
- argument-hint: "[phase number, e.g., '4'] [--audit]"
3
+ description: Validate built features through audit (default) or interactive UAT
4
+ argument-hint: "[target] [--audit | --uat]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
@@ -12,127 +12,300 @@ allowed-tools:
12
12
  ---
13
13
 
14
14
  <objective>
15
- Validate built features through conversational testing with persistent state.
15
+ Validate built features through **audit mode by default**, or interactive UAT with `--uat`.
16
16
 
17
- **Default mode:** Interactive UAT - one test at a time, plain text responses.
18
- **Audit mode (`--audit`):** Non-interactive implementation check - verifies plans have summaries and git evidence.
17
+ **Default behavior (no flags or --audit):** Non-interactive audit.
18
+ - Checks PLAN/SUMMARY existence and git evidence
19
+ - Produces audit report at `.planning/artifacts/VERIFY_WORK_AUDIT.md`
20
+ - **Does NOT touch any UAT-related files, workflows, or templates**
19
21
 
20
- Output:
21
- - Default: {phase}-UAT.md tracking all test results, gaps logged for /rrr:plan-phase --gaps
22
- - Audit: .planning/artifacts/VERIFY_WORK_AUDIT.md (no UAT files created)
22
+ **With --uat flag:** Interactive user acceptance testing.
23
+ - Creates/resumes UAT.md files for manual testing
24
+ - Loads workflow and template references
25
+
26
+ **Critical:** Audit mode must NEVER open, read, or create `*-UAT.md` files.
23
27
  </objective>
24
28
 
25
- <execution_context>
26
- @~/.claude/rrr/workflows/verify-work.md
27
- @~/.claude/rrr/templates/UAT.md
28
- </execution_context>
29
+ <arguments>
30
+ **Target (optional):**
31
+ - Phase number: `05`, `5`, `05-auth` → audit/test that phase only
32
+ - Milestone: `v1.9`, `v2.0` → audit all phases in that milestone
33
+ - Nothing → audit current milestone from STATE.md
34
+
35
+ **Flags:**
36
+ - `--audit` (or no flag) → Run non-interactive audit (DEFAULT)
37
+ - `--uat` → Run interactive UAT session (explicit opt-in)
38
+
39
+ **Examples:**
40
+ ```
41
+ /rrr:verify-work # Audit current milestone (default)
42
+ /rrr:verify-work --audit # Audit current milestone
43
+ /rrr:verify-work --audit 05 # Audit phase 05 only
44
+ /rrr:verify-work --audit v1.9 # Audit all phases in v1.9
45
+ /rrr:verify-work --uat 05 # Interactive UAT for phase 05
46
+ ```
47
+
48
+ **Audit output:** `.planning/artifacts/VERIFY_WORK_AUDIT.md`
49
+ </arguments>
50
+
51
+ <!-- ═══════════════════════════════════════════════════════════════════════════
52
+ MODE SELECTION - MUST EXECUTE FIRST BEFORE ANY OTHER SECTION
53
+ ═══════════════════════════════════════════════════════════════════════════ -->
54
+
55
+ <mode_selection>
56
+ ## CRITICAL: Parse mode FIRST
57
+
58
+ **Step 1: Parse arguments**
59
+
60
+ ```
61
+ hasAuditFlag = $ARGUMENTS contains "--audit"
62
+ hasUatFlag = $ARGUMENTS contains "--uat"
63
+ target = $ARGUMENTS with flags removed (e.g., "05", "v1.9", or empty)
64
+ ```
65
+
66
+ **Step 2: Route based on flags**
29
67
 
30
- <context>
31
- Phase: $ARGUMENTS (optional)
32
- - If provided: Test specific phase (e.g., "4")
33
- - If not provided: Check for active sessions or prompt for phase
68
+ | Condition | Action |
69
+ |-----------|--------|
70
+ | `--uat` present | Execute `<uat_mode>` below (loads workflow/template) |
71
+ | `--audit` present OR no flags | Execute `<audit_mode>` below (DEFAULT) |
34
72
 
35
- Flags:
36
- - `--audit` or `--implementation-only`: Non-interactive mode, check implementation status only
73
+ **If --uat is present:**
74
+ 1. Execute the `<uat_mode>` section below
75
+ 2. This loads the workflow file with template references
37
76
 
38
- @.planning/STATE.md
39
- @.planning/ROADMAP.md
40
- </context>
77
+ **If --audit is present OR no flags:**
78
+ 1. Execute the `<audit_mode>` section below (DEFAULT)
79
+ 2. This command file is COMPLETE for audit mode - NO @ references anywhere
80
+ 3. **EXIT IMMEDIATELY** after audit report
81
+ </mode_selection>
82
+
83
+ <!-- ═══════════════════════════════════════════════════════════════════════════
84
+ AUDIT MODE - DEFAULT BEHAVIOR, COMPLETELY SELF-CONTAINED
85
+ ═══════════════════════════════════════════════════════════════════════════ -->
41
86
 
42
87
  <audit_mode>
43
- **If --audit flag is present:**
88
+ ## Audit Mode (Non-Interactive, Self-Contained)
89
+
90
+ **HARD GUARANTEES:**
91
+ - Does NOT open, read, create, or modify any `*-UAT.md` files
92
+ - Does NOT load any workflow or template files (no @ references in this file)
93
+ - Does NOT ask user to manually test anything
94
+ - Produces ONE artifact: `.planning/artifacts/VERIFY_WORK_AUDIT.md`
44
95
 
45
- This mode runs a non-interactive implementation audit. It does NOT:
46
- - Create UAT files
47
- - Ask for manual verification
48
- - Present interactive tests
96
+ ---
49
97
 
50
- **Step 1: Determine scope**
98
+ ### Step 1: Determine Scope
51
99
 
52
- Parse $ARGUMENTS for phase number and --audit flag.
100
+ **Parse target from arguments (with flags removed):**
53
101
 
54
- | Arguments | Scope |
55
- |-----------|-------|
56
- | `--audit 4` or `4 --audit` | Audit phase 4 only |
57
- | `--audit` (no phase) | Check STATE.md for context |
102
+ | Target | Scope |
103
+ |--------|-------|
104
+ | Phase number (e.g., `05`, `5`, `05-auth`) | Audit that phase only |
105
+ | Milestone (e.g., `v1.9`) | Audit all phases in that milestone |
106
+ | Empty | Check STATE.md for context |
58
107
 
59
- **If no phase provided, read STATE.md:**
60
- - If active phase exists → audit that phase
61
- - If "Between milestones" or "Phase: N/A" → audit entire milestone (all phases)
108
+ **If no target provided:**
62
109
 
63
- **Step 2: Run verification script**
110
+ Read `.planning/STATE.md`:
111
+ - If `Phase:` has active value (not "N/A", not "Between milestones") → audit that phase
112
+ - If `Milestone: Between milestones` or `Phase: N/A` → audit entire current/last milestone
113
+
114
+ ---
115
+
116
+ ### Step 2: Gather Plan Inventory (Cross-Platform)
117
+
118
+ **IMPORTANT: Never glob for `*-UAT.md`. Only glob for `*-PLAN.md` and `*-SUMMARY.md`.**
119
+
120
+ **On any platform, use Glob tool:**
64
121
 
65
- ```bash
66
- node ~/.claude/rrr/scripts/verify-milestone.js --summary-only 2>/dev/null
122
+ ```
123
+ Glob pattern: ".planning/phases/${PHASE}*/*-PLAN.md"
67
124
  ```
68
125
 
69
- **If auditing single phase, filter output:**
70
- - Only show results for the specified phase
71
- - Still generate full artifact but highlight relevant section
126
+ For milestone scope, enumerate all phase directories first:
127
+ ```
128
+ Glob pattern: ".planning/phases/*"
129
+ ```
130
+ Then for each phase directory:
131
+ ```
132
+ Glob pattern: ".planning/phases/{phase-dir}/*-PLAN.md"
133
+ ```
72
134
 
73
- **Step 3: Output to artifact**
135
+ **Build inventory (deterministic order by phase number, then plan ID):**
74
136
 
75
- The script generates:
76
- - `.planning/artifacts/VERIFY_MILESTONE.md` → Copy/rename to `.planning/artifacts/VERIFY_WORK_AUDIT.md`
77
- - `.planning/artifacts/VERIFY_MILESTONE.json` Copy/rename to `.planning/artifacts/VERIFY_WORK_AUDIT.json`
137
+ ```
138
+ plans = []
139
+ for each PLAN.md found (sorted by path):
140
+ planId = extract from filename (e.g., "05-02")
141
+ planPath = full path
142
+ summaryPath = planPath.replace("-PLAN.md", "-SUMMARY.md")
78
143
 
79
- **Step 4: Display summary**
144
+ # Check SUMMARY existence using Read tool (returns error if missing)
145
+ summaryExists = try Read(summaryPath), catch = false
80
146
 
147
+ plans.push({ planId, planPath, summaryExists, summaryPath })
81
148
  ```
82
- ## Implementation Audit
83
149
 
84
- {Scope: Phase X | Entire Milestone}
150
+ **Sort plans by planId for deterministic output.**
85
151
 
86
- | Metric | Count |
87
- |--------|-------|
88
- | Done | {N} |
89
- | ⚠ Likely done (missing summary) | {N} |
90
- | Not done | {N} |
91
- | ? Suspicious | {N} |
152
+ ---
153
+
154
+ ### Step 3: Evidence Checks
155
+
156
+ **For each plan:**
157
+
158
+ 1. **PLAN exists?** → Always yes (we found it via glob)
159
+
160
+ 2. **SUMMARY exists?** → From inventory check above
161
+
162
+ 3. **Commit hash present?** → If SUMMARY exists:
163
+ - Read SUMMARY file content
164
+ - Search for git commit hash pattern: `/[a-f0-9]{7,40}/` (7-40 hex chars)
165
+ - Check frontmatter `commit:` field OR body text
166
+ - Mark as present if found, absent if not
167
+
168
+ 4. **Git evidence (lightweight, optional):**
169
+ ```bash
170
+ git log --oneline -5 -- ".planning/phases/${PHASE}*/" 2>/dev/null
171
+ ```
172
+ - If git unavailable or fails, skip gracefully
173
+ - This is supplementary info, not required
174
+
175
+ **State integrity check:**
176
+
177
+ Read `.planning/STATE.md`:
178
+ - Extract current `Phase:` value (e.g., "05" or "N/A")
179
+ - Extract current `Plan:` value if present
92
180
 
93
- {If gaps exist:}
94
- ### Gaps
181
+ Compare against plan inventory:
182
+ - Find highest phase number with SUMMARY files
183
+ - If SUMMARYs exist for phases beyond STATE's phase → "stale STATE detected"
95
184
 
96
- | Phase | Plan | Status | Action |
97
- |-------|------|--------|--------|
98
- | ... | ... | ... | ... |
185
+ ---
186
+
187
+ ### Step 4: Generate Audit Report
188
+
189
+ **Determine verdict:**
190
+ - ✅ Clean = All plans have SUMMARY with commit hash, STATE is consistent
191
+ - ⚠️ Gaps found = Any plan missing SUMMARY or commit hash
192
+
193
+ **Write to `.planning/artifacts/VERIFY_WORK_AUDIT.md`:**
194
+
195
+ ```markdown
196
+ # Verify Work Audit Report
197
+
198
+ *Generated: {ISO timestamp}*
199
+
200
+ ## Scope
201
+
202
+ **Target:** Phase {X} | Milestone {X} | Current Milestone
203
+ **Verdict:** ✅ Clean | ⚠️ Gaps found
204
+
205
+ ## Plan Status
206
+
207
+ | Plan | PLAN | SUMMARY | Commit Hash | Notes |
208
+ |------|------|---------|-------------|-------|
209
+ | 05-01 | ✓ | ✓ | ✓ abc1234 | — |
210
+ | 05-02 | ✓ | ✗ | — | Missing SUMMARY |
211
+ | 05-03 | ✓ | ✓ | ✗ | No commit hash in SUMMARY |
99
212
 
100
- Full report: .planning/artifacts/VERIFY_WORK_AUDIT.md
213
+ **Summary:** {N} plans checked, {done} complete, {gaps} gaps
101
214
 
102
- {If all done:}
103
- ✓ All plans verified. Ready for milestone completion.
215
+ ## State Integrity
216
+
217
+ {If stale detected:}
218
+ ⚠️ **Stale STATE detected**
219
+ STATE.md says Phase {X}, but SUMMARYs exist through Phase {Y}.
220
+ Recommended: Run `/rrr:progress` to update position.
221
+
222
+ {If consistent:}
223
+ ✓ STATE.md is consistent with plan inventory.
224
+
225
+ ## Recommended Next Steps
226
+
227
+ {If gaps - missing SUMMARY:}
228
+ - Execute missing plan: `/rrr:execute-plan {path-to-first-missing-plan}`
229
+ - Or if code is done, write SUMMARY manually
230
+
231
+ {If gaps - missing commit hash:}
232
+ - Update SUMMARY files with commit references
233
+
234
+ {If clean and between milestones:}
235
+ - `/rrr:complete-milestone` — Archive and prepare next
236
+ - `/rrr:discuss-milestone` — Plan what's next
237
+
238
+ {If clean and active milestone:}
239
+ - `/rrr:progress` — Continue to next phase
240
+ ```
241
+
242
+ **Ensure artifacts directory exists:**
243
+ ```bash
244
+ mkdir -p .planning/artifacts
104
245
  ```
105
246
 
106
- **Exit after audit - do not proceed to interactive UAT.**
247
+ ---
248
+
249
+ ### Step 5: Exit
250
+
251
+ **Print summary and EXIT. Do NOT proceed to UAT mode.**
252
+
253
+ ```
254
+ Audit complete. Report: .planning/artifacts/VERIFY_WORK_AUDIT.md
255
+
256
+ {verdict summary - 1 line}
257
+ ```
258
+
259
+ **STOP HERE. The command is complete.**
260
+
107
261
  </audit_mode>
108
262
 
109
- <process>
110
- 1. Check for active UAT sessions (resume or start new)
111
- 2. Find SUMMARY.md files for the phase
112
- 3. Extract testable deliverables (user-observable outcomes)
113
- 4. Create {phase}-UAT.md with test list
114
- 5. Present tests one at a time:
115
- - Show expected behavior
116
- - Wait for plain text response
117
- - "yes/y/next" = pass, anything else = issue (severity inferred)
118
- 6. Update UAT.md after each response
119
- 7. On completion: commit, present summary, offer next steps
120
- </process>
121
-
122
- <anti_patterns>
123
- - Don't use AskUserQuestion for test responses — plain text conversation
124
- - Don't ask severity — infer from description
125
- - Don't present full checklist upfront one test at a time
126
- - Don't run automated tests this is manual user validation
127
- - Don't fix issues during testing — log as gaps for /rrr:plan-phase --gaps
128
- </anti_patterns>
263
+ <!-- ═══════════════════════════════════════════════════════════════════════════
264
+ UAT MODE - ONLY LOADED WHEN --uat FLAG IS PRESENT
265
+ ═══════════════════════════════════════════════════════════════════════════ -->
266
+
267
+ <uat_mode>
268
+ ## UAT Mode (Interactive)
269
+
270
+ **This section is ONLY reached if `--uat` flag is present.**
271
+
272
+ **Load the workflow to run interactive UAT:**
273
+
274
+ Read the file at: `rrr/workflows/verify-work.md`
275
+
276
+ The workflow contains the full UAT process and will reference the UAT template internally.
277
+
278
+ **Expected workflow sections to follow:**
279
+ - check_active_session find_summaries extract_tests create_uat_file
280
+ - present_test process_response resume_from_file complete_session
281
+ </uat_mode>
282
+
283
+ <!-- ═══════════════════════════════════════════════════════════════════════════
284
+ EXCLUDED PATHS - APPLY TO ALL MODES
285
+ ═══════════════════════════════════════════════════════════════════════════ -->
286
+
287
+ <excluded_paths>
288
+ **Never scan or read these directories:**
289
+ - GSDWatcher/
290
+ - GSDWatcher/upstreams/
291
+ - GSDWatcher/reports/
292
+
293
+ All Glob/Grep/Read operations must exclude these paths.
294
+ </excluded_paths>
129
295
 
130
296
  <success_criteria>
131
- - [ ] UAT.md created with tests from SUMMARY.md
132
- - [ ] Tests presented one at a time with expected behavior
133
- - [ ] Plain text responses (no structured forms)
134
- - [ ] Severity inferred, never asked
135
- - [ ] Batched writes: on issue, every 5 passes, or completion
136
- - [ ] Committed on completion
137
- - [ ] Clear next steps based on results
138
- </success_criteria>
297
+ **Audit mode (default):**
298
+ - [ ] Mode selection happens FIRST, before any workflow/template load
299
+ - [ ] Does NOT glob/read any *-UAT.md files
300
+ - [ ] Does NOT load workflow or template files (no @ references in this file)
301
+ - [ ] Produces single artifact: .planning/artifacts/VERIFY_WORK_AUDIT.md
302
+ - [ ] Deterministic ordering (phase, then plan ID)
303
+ - [ ] Detects missing SUMMARYs and commit hashes
304
+ - [ ] Detects stale STATE
305
+ - [ ] Exits after printing report
306
+
307
+ **UAT mode (--uat):**
308
+ - [ ] Only reached when --uat flag is present
309
+ - [ ] Loads workflow and template
310
+ - [ ] Creates/resumes UAT.md with tests
311
+ </success_criteria>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projecta-rrr",
3
- "version": "1.9.5",
3
+ "version": "1.9.7",
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"
@@ -2,8 +2,37 @@
2
2
  Validate built features through conversational testing with persistent state. Creates UAT.md that tracks test progress, survives /clear, and feeds gaps into /rrr:plan-phase --gaps.
3
3
 
4
4
  User tests, Claude records. One test at a time. Plain text responses.
5
+
6
+ **This workflow is for UAT mode only (`--uat`).** Audit mode (`--audit`) is handled inline in the command file and does NOT load this workflow. Only run this workflow when the `--uat` flag is present.
5
7
  </purpose>
6
8
 
9
+ <!-- ═══════════════════════════════════════════════════════════════════════════
10
+ MODE GATE - FAILSAFE TO CATCH ACCIDENTAL AUDIT MODE LOADING
11
+ ═══════════════════════════════════════════════════════════════════════════ -->
12
+
13
+ <mode_gate>
14
+ ## FAILSAFE: Audit Mode Detection
15
+
16
+ **Check IMMEDIATELY before doing anything else:**
17
+
18
+ If `$ARGUMENTS` contains `--audit`:
19
+
20
+ ```
21
+ Audit mode detected — this workflow should not be loaded.
22
+ The command file commands/rrr/verify-work.md handles audit mode inline.
23
+ Only run this workflow when --uat flag is present.
24
+ ```
25
+
26
+ **STOP IMMEDIATELY. Do not proceed.**
27
+
28
+ This workflow should ONLY be loaded when `--uat` flag is present. If you see this message:
29
+ 1. The command file failed to properly route --uat to this workflow
30
+ 2. Do NOT continue with UAT steps
31
+ 3. Exit and report the issue
32
+
33
+ **If --uat is present (or no audit flag):** Continue to the next section.
34
+ </mode_gate>
35
+
7
36
  <philosophy>
8
37
  **Show expected, ask if reality matches.**
9
38