@hanzlaa/rcode 3.6.8 → 3.6.14

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 (41) hide show
  1. package/cli/generate-command-skills.cjs +5 -12
  2. package/package.json +1 -1
  3. package/rihal/bin/rihal-tools.cjs +25 -24
  4. package/rihal/commands/execute-milestone.md +2 -2
  5. package/rihal/commands/plan-milestone.md +2 -2
  6. package/rihal/commands/scaffold-milestone.md +2 -2
  7. package/rihal/references/continuation-format.md +5 -6
  8. package/rihal/references/research-synthesis-playbook.md +1 -1
  9. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-06-phase-stubs.md +1 -1
  10. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-10-complete.md +1 -1
  11. package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +2 -0
  12. package/rihal/workflows/analyze-dependencies.md +4 -4
  13. package/rihal/workflows/audit-fix.md +3 -3
  14. package/rihal/workflows/audit-milestone.md +12 -11
  15. package/rihal/workflows/audit-worktrees.md +163 -0
  16. package/rihal/workflows/audit.md +18 -3
  17. package/rihal/workflows/correct-course.md +3 -3
  18. package/rihal/workflows/create-architecture.md +3 -3
  19. package/rihal/workflows/create-epics-and-stories.md +3 -3
  20. package/rihal/workflows/discuss-phase-power.md +1 -1
  21. package/rihal/workflows/document-project.md +3 -3
  22. package/rihal/workflows/edit-prd.md +3 -3
  23. package/rihal/workflows/execute-milestone.md +3 -3
  24. package/rihal/workflows/execute-sprint.md +1 -1
  25. package/rihal/workflows/execute-waves.md +27 -2
  26. package/rihal/workflows/forensics.md +3 -3
  27. package/rihal/workflows/health.md +23 -8
  28. package/rihal/workflows/help.md +0 -1
  29. package/rihal/workflows/new-project-roadmap.md +2 -2
  30. package/rihal/workflows/plan-research-validation.md +2 -2
  31. package/rihal/workflows/plan.md +7 -7
  32. package/rihal/workflows/retrospective.md +3 -3
  33. package/rihal/workflows/review-adversarial.md +8 -6
  34. package/rihal/workflows/review.md +2 -2
  35. package/rihal/workflows/scaffold-project.md +3 -3
  36. package/rihal/workflows/secure-phase.md +4 -4
  37. package/rihal/workflows/session-report.md +1 -1
  38. package/rihal/workflows/status.md +6 -10
  39. package/rihal/workflows/validate-prd.md +3 -3
  40. package/rihal/workflows/verify-phase.md +3 -3
  41. package/rihal/workflows/workstream.md +3 -3
@@ -40,18 +40,11 @@ const path = require('path');
40
40
  * functional). Power users running niche commands like /rihal-prfaq or
41
41
  * /rihal-ui-phase still get them — they just don't show up in the sidebar.
42
42
  */
43
- const SIDEBAR_COMMANDS = new Set([
44
- // Navigation & status (the daily check-in)
45
- 'do', 'status', 'next',
46
- // Core lifecycle (the workflow loop)
47
- 'plan', 'execute', 'ship',
48
- // Strategic
49
- 'council',
50
- // Quality gate
51
- 'audit', 'verify-phase',
52
- // Utility
53
- 'note',
54
- ]);
43
+ // Empty sidebar stubs with user-invocable:false block direct /rihal-* invocation
44
+ // in Claude Code 2.x. Commands in .claude/commands/ already appear in slash autocomplete.
45
+ // The VS Code sidebar also shows commands directly in CC 2.x, so stubs are redundant.
46
+ // Issue #710: sidebar stubs caused "can only be invoked by Claude" error for users.
47
+ const SIDEBAR_COMMANDS = new Set([]);
55
48
 
56
49
  function parseFrontmatter(text) {
57
50
  if (!text.startsWith('---\n')) return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzlaa/rcode",
3
- "version": "3.6.8",
3
+ "version": "3.6.14",
4
4
  "description": "rcode — the AI team that never forgets. Persistent memory, specialist agents, and slash commands for AI IDEs. Works in Claude Code, Cursor, Gemini, VS Code, and Antigravity.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
@@ -6070,7 +6070,7 @@ function cmdProgress(args) {
6070
6070
  return insights;
6071
6071
  }
6072
6072
 
6073
- function deriveRoutes(state, roadmapPhases, diskByNum) {
6073
+ function deriveRoutes(state, roadmapPhases, diskByNum, insights) {
6074
6074
  const routes = [];
6075
6075
  const statePhases = (state && (state.state?.phases || state.phases)) || [];
6076
6076
 
@@ -6092,26 +6092,18 @@ function cmdProgress(args) {
6092
6092
  }).slice(0, 3);
6093
6093
  for (const p of pendingExec) {
6094
6094
  const k = phaseKey(p);
6095
- routes.push({
6096
- letter: 'A',
6097
- label: `Execute phase ${k} — unfinished plans`,
6098
- command: `/rihal-execute ${k}`,
6099
- });
6095
+ routes.push({ letter: 'A', label: '', command: `/rihal-execute ${k}` });
6100
6096
  }
6101
6097
 
6102
6098
  // Route B — phases with research but no plans
6103
6099
  const researchOnly = Object.entries(diskByNum)
6104
6100
  .filter(([num, d]) => d.has_research && d.plan_count === 0)
6105
6101
  .slice(0, 3);
6106
- for (const [num, d] of researchOnly) {
6107
- routes.push({
6108
- letter: 'B',
6109
- label: `Plan phase ${num} — researched, awaiting plan`,
6110
- command: `/rihal-plan-phase ${num}`,
6111
- });
6102
+ for (const [num] of researchOnly) {
6103
+ routes.push({ letter: 'B', label: '', command: `/rihal-plan ${num}` });
6112
6104
  }
6113
6105
 
6114
- // Route B' — in-progress phases without plans (the user is actively working but no SPRINT.md exists yet)
6106
+ // Route B' — in-progress phases without plans
6115
6107
  const inProgressNoPlan = statePhases
6116
6108
  .filter(p => (p.status === 'in_progress' || p.status === 'in-progress'))
6117
6109
  .filter(p => {
@@ -6121,24 +6113,32 @@ function cmdProgress(args) {
6121
6113
  .slice(0, 2);
6122
6114
  for (const p of inProgressNoPlan) {
6123
6115
  const k = phaseKey(p);
6124
- routes.push({
6125
- letter: 'B',
6126
- label: `Plan phase ${k} — in progress without SPRINT.md`,
6127
- command: `/rihal-plan ${k}`,
6128
- });
6116
+ routes.push({ letter: 'B', label: '', command: `/rihal-plan ${k}` });
6129
6117
  }
6130
6118
 
6131
6119
  // Route C — close out milestone if everything seems done
6132
6120
  const allDone = statePhases.length > 0 && statePhases.every(p => p.status === 'complete' || p.completed);
6133
6121
  if (allDone) {
6134
- routes.push({ letter: 'C', label: 'Audit current milestone', command: '/rihal-audit-milestone' });
6135
- routes.push({ letter: 'C', label: 'Complete current milestone', command: '/rihal-complete-milestone' });
6122
+ // Count unverified phases (complete but no VERIFICATION.md on disk)
6123
+ const unverifiedCount = statePhases.filter(p => {
6124
+ const disk = diskByNum[phaseKey(p)];
6125
+ return (p.status === 'complete' || p.completed) && disk && !disk.has_verification;
6126
+ }).length;
6127
+ const hasDrift = (insights || []).some(i => i.kind === 'roadmap-drift' || (i.message && i.message.includes('ROADMAP')));
6128
+ const auditArgs = [];
6129
+ if (unverifiedCount > 0) auditArgs.push(String(unverifiedCount));
6130
+ if (hasDrift) auditArgs.push('--fix-drift');
6131
+ const auditCmd = auditArgs.length > 0
6132
+ ? `/rihal-audit-milestone ${auditArgs.join(' ')}`
6133
+ : '/rihal-audit-milestone';
6134
+ routes.push({ letter: 'C', label: '', command: auditCmd });
6135
+ routes.push({ letter: 'C', label: '', command: '/rihal-complete-milestone' });
6136
6136
  }
6137
6137
 
6138
6138
  // Fallback — nothing obvious: offer status
6139
6139
  if (routes.length === 0) {
6140
- routes.push({ letter: 'A', label: 'Check progress detail', command: '/rihal-progress' });
6141
- routes.push({ letter: 'B', label: 'Start a council on what to do next', command: '/rihal-council' });
6140
+ routes.push({ letter: 'A', label: '', command: '/rihal-progress' });
6141
+ routes.push({ letter: 'B', label: '', command: '/rihal-council' });
6142
6142
  }
6143
6143
 
6144
6144
  return routes;
@@ -6208,14 +6208,15 @@ function cmdProgress(args) {
6208
6208
  }
6209
6209
 
6210
6210
  if (sub === 'routes') {
6211
- return { ok: true, routes: deriveRoutes(state, roadmapPhases, diskByNum) };
6211
+ const routeInsights = detectInsights(state, roadmapPhases, diskByNum);
6212
+ return { ok: true, routes: deriveRoutes(state, roadmapPhases, diskByNum, routeInsights) };
6212
6213
  }
6213
6214
 
6214
6215
  // sub === 'init' (default) — full snapshot
6215
6216
  const currentPhase = state && state.current_phase;
6216
6217
  const insights = detectInsights(state, roadmapPhases, diskByNum);
6217
6218
  enforceStrictGate(insights);
6218
- const routes = deriveRoutes(state, roadmapPhases, diskByNum);
6219
+ const routes = deriveRoutes(state, roadmapPhases, diskByNum, insights);
6219
6220
  const { weighted: weightedCompleted, pct: weightedPct } = computeWeightedProgress(statePhases, diskByNum);
6220
6221
 
6221
6222
  return {
@@ -10,9 +10,9 @@ Execute all phases in the current milestone in dependency order, with verify gat
10
10
  </objective>
11
11
 
12
12
  <execution_context>
13
- @.rihal/workflows/execute-milestone.md
13
+ @rihal/workflows/execute-milestone.md
14
14
  </execution_context>
15
15
 
16
16
  <process>
17
- Execute the execute-milestone workflow from @.rihal/workflows/execute-milestone.md end-to-end.
17
+ Execute the execute-milestone workflow from @rihal/workflows/execute-milestone.md end-to-end.
18
18
  </process>
@@ -10,9 +10,9 @@ Plan all phases for a milestone using parallel dependency-wave execution. Group
10
10
  </objective>
11
11
 
12
12
  <execution_context>
13
- @.rihal/workflows/plan-milestone.md
13
+ @rihal/workflows/plan-milestone.md
14
14
  </execution_context>
15
15
 
16
16
  <process>
17
- Execute the plan-milestone workflow from @.rihal/workflows/plan-milestone.md end-to-end.
17
+ Execute the plan-milestone workflow from @rihal/workflows/plan-milestone.md end-to-end.
18
18
  </process>
@@ -10,9 +10,9 @@ Execute scaffold-milestone workflow
10
10
  </objective>
11
11
 
12
12
  <execution_context>
13
- @.rihal/workflows/scaffold-milestone.md
13
+ @rihal/workflows/scaffold-milestone.md
14
14
  </execution_context>
15
15
 
16
16
  <process>
17
- Execute the scaffold-milestone workflow from @.rihal/workflows/scaffold-milestone.md end-to-end.
17
+ Execute the scaffold-milestone workflow from @rihal/workflows/scaffold-milestone.md end-to-end.
18
18
  </process>
@@ -52,7 +52,6 @@ Standard format for presenting next steps after completing a command or workflow
52
52
 
53
53
  **Also available:**
54
54
  - Review plan before executing
55
- - `/rihal-list-phase-assumptions 2` — check assumptions
56
55
 
57
56
  ---
58
57
  ```
@@ -91,7 +90,7 @@ Add note that this is the last plan and what comes after:
91
90
 
92
91
  **Phase 2: Authentication** — JWT login flow with refresh tokens
93
92
 
94
- `/rihal-plan-phase 2`
93
+ `/rihal-plan 2`
95
94
 
96
95
  <sub>`/clear` first → fresh context window</sub>
97
96
 
@@ -120,7 +119,7 @@ Show completion status before next action:
120
119
 
121
120
  **Phase 3: Core Features** — User dashboard, settings, and data export
122
121
 
123
- `/rihal-plan-phase 3`
122
+ `/rihal-plan 3`
124
123
 
125
124
  <sub>`/clear` first → fresh context window</sub>
126
125
 
@@ -145,7 +144,7 @@ When there's no clear primary action:
145
144
 
146
145
  **Phase 3: Core Features** — User dashboard, settings, and data export
147
146
 
148
- **To plan directly:** `/rihal-plan-phase 3`
147
+ **To plan directly:** `/rihal-plan 3`
149
148
 
150
149
  **To discuss context first:** `/rihal-discuss-phase 3`
151
150
 
@@ -222,7 +221,7 @@ User has no idea what 02-03 is about.
222
221
  ### Don't: Missing /clear explanation
223
222
 
224
223
  ```
225
- `/rihal-plan-phase 3`
224
+ `/rihal-plan 3`
226
225
 
227
226
  Run /clear first.
228
227
  ```
@@ -242,7 +241,7 @@ Sounds like an afterthought. Use "Also available:" instead.
242
241
 
243
242
  ```
244
243
  ```
245
- /rihal-plan-phase 3
244
+ /rihal-plan 3
246
245
  ```
247
246
  ```
248
247
 
@@ -70,7 +70,7 @@ This is the most important section. Based on combined research:
70
70
  - Which pitfalls it must avoid
71
71
 
72
72
  **Add research flags:**
73
- - Which phases likely need `/rihal-research` during planning?
73
+ - Which phases likely need `/rihal-research-phase` during planning?
74
74
  - Which phases have well-documented patterns (skip research)?
75
75
 
76
76
  ## Step 5: Assess Confidence
@@ -9,7 +9,7 @@ For each milestone, list the phases it contains as **stubs** (number + name + on
9
9
  ## MANDATORY RULES
10
10
 
11
11
  - 🛑 Phase numbers follow Rihal's NN convention (01, 02, ..., 99, then 999.x for parking lot).
12
- - 🛑 Do NOT generate plan content here. That's `/rihal-plan-phase`.
12
+ - 🛑 Do NOT generate plan content here. That's `/rihal-plan`.
13
13
  - 🛑 Each phase has one-sentence goal, max.
14
14
  - ⏸️ HALT at menu.
15
15
 
@@ -42,7 +42,7 @@ What's next?
42
42
  → /rihal-create-epics-and-stories
43
43
 
44
44
  [B] Plan the first phase in detail
45
- → /rihal-plan-phase 01
45
+ → /rihal-plan 01
46
46
 
47
47
  [C] Review the roadmap with the team
48
48
  → /rihal-council "Is this roadmap realistic?"
@@ -44,6 +44,8 @@ If you have not completed Phase 1, you cannot propose a fix. "It seems to work"
44
44
 
45
45
  Debugging is investigation, not pattern-matching. Each iteration narrows the problem space — never widens it. The skill enforces a written hypothesis, an experiment that distinguishes "yes" from "no", and a captured observation. Random fixes are not allowed — the bug must be understood before the fix is written.
46
46
 
47
+ ## Workflow
48
+
47
49
  ## Phase 1 — Root Cause Investigation
48
50
 
49
51
  **BEFORE attempting ANY fix:**
@@ -1,7 +1,7 @@
1
1
  # Workflow: rihal-analyze-dependencies
2
2
 
3
3
  <purpose>
4
- Analyze ROADMAP.md phases for dependency relationships before execution. Detect file overlap between phases, semantic API/data-flow dependencies, and suggest `Depends on` entries to prevent merge conflicts during parallel execution by `/rihal-manager`.
4
+ Analyze ROADMAP.md phases for dependency relationships before execution. Detect file overlap between phases, semantic API/data-flow dependencies, and suggest `Depends on` entries to prevent merge conflicts during parallel execution.
5
5
  </purpose>
6
6
 
7
7
 
@@ -119,7 +119,7 @@ When writing:
119
119
  - Preserve all other phase content unchanged
120
120
  - Do not reorder phases
121
121
 
122
- After applying: "ROADMAP.md updated. Run `/rihal-manager` to execute phases in the correct order."
122
+ After applying: "ROADMAP.md updated. Run `/rihal-execute-milestone` to execute phases in the correct order."
123
123
 
124
124
  ## Success Criteria
125
125
 
@@ -140,5 +140,5 @@ After applying: "ROADMAP.md updated. Run `/rihal-manager` to execute phases in t
140
140
  ## ▶ Next Up
141
141
 
142
142
  - **Circular deps found:** Fix dependency cycle, then re-run analysis
143
- - **Ready to execute:** `/rihal-execute {phase}` — run with dependency awareness
144
- - **Review roadmap:** `/rihal-progress` — see full project state
143
+ - /rihal-execute {phase}
144
+ - /rihal-progress
@@ -199,6 +199,6 @@ If arguments are invalid, missing files, or subagent fails:
199
199
 
200
200
  ## ▶ Next Up
201
201
 
202
- - **Fixes applied:** `/rihal-verify-phase {phase}` — re-verify after fixes
203
- - **More issues:** `/rihal-audit {phase}` — run audit again to confirm
204
- - **All clean:** `/rihal-progress` — check project state
202
+ - /rihal-verify-phase {phase}
203
+ - /rihal-audit {phase}
204
+ - /rihal-progress
@@ -4,22 +4,23 @@
4
4
  Cross-phase audit of milestone completion. Reads all SUMMARY.md files from completed phases, compares their outcomes to the original ROADMAP goals, flags gaps, and generates an audit report showing completion percentage and decision traceability.
5
5
  </purpose>
6
6
 
7
- ## Step 0 — Usage check
7
+ ## Step 0 — Parse arguments
8
8
 
9
- If `$ARGUMENTS` contains only `--help` or `-h`:
9
+ Parse `$ARGUMENTS`:
10
+ - `--help` or `-h` → print usage and stop:
11
+ ```
12
+ /rihal-audit-milestone [<unverified-count>] [--fix-drift] [--strict] [--report]
13
+ ```
14
+ - A bare integer (e.g. `28`) → `HINT_UNVERIFIED_COUNT = 28` (pre-computed by rihal-status for display; use as expected minimum in the scan)
15
+ - `--fix-drift` → `FIX_DRIFT = true` (after audit, suggest the drift sync command)
16
+ - `--strict` → `STRICT = true`
17
+ - `--report` → `WRITE_REPORT = true`
10
18
 
19
+ If `HINT_UNVERIFIED_COUNT` is set, print at the top of the audit output:
11
20
  ```
12
- /rihal-audit-milestone [--strict] [--report]
21
+ ℹ Expecting ~{HINT_UNVERIFIED_COUNT} phases to verify (from rihal-status)
13
22
  ```
14
23
 
15
- **Examples:**
16
- ```
17
- /rihal-audit-milestone
18
- /rihal-audit-milestone --strict --report
19
- ```
20
-
21
- STOP — do not proceed.
22
-
23
24
  ## Step 1 — Locate milestone context
24
25
 
25
26
  Determine the active milestone. Check:
@@ -0,0 +1,163 @@
1
+ # Workflow: audit-worktrees
2
+
3
+ <purpose>
4
+ Scan for orphaned executor worktrees and branches left behind by rihal-execute.
5
+ Reports each orphan with its age, merge status, and safe-to-delete verdict.
6
+ With --prune, deletes confirmed-safe orphans automatically.
7
+ </purpose>
8
+
9
+ ## Step 0 — Parse arguments
10
+
11
+ - `--prune` → `PRUNE=true` — delete safe orphans after reporting
12
+ - `--help` or `-h` → print usage and stop:
13
+ ```
14
+ /rihal-audit worktrees [--prune]
15
+ ```
16
+
17
+ ## Step 1 — Scan for orphaned worktrees
18
+
19
+ Executor agents use branches prefixed `worktree-agent-`. Find all such branches
20
+ and worktrees still present in the repo:
21
+
22
+ ```bash
23
+ # Active worktrees with executor branches
24
+ git worktree list --porcelain \
25
+ | awk 'BEGIN{p=""} /^worktree /{p=$2} /^branch /{if($2~/refs\/heads\/worktree-agent-/) print p"\t"$2}' \
26
+ > /tmp/rihal-active-wts.txt
27
+
28
+ # Local branches with executor prefix (includes detached/removed worktrees)
29
+ git branch --list 'worktree-agent-*' --format='%(refname:short)' \
30
+ > /tmp/rihal-orphan-br.txt
31
+
32
+ ACTIVE_WT_COUNT=$(wc -l < /tmp/rihal-active-wts.txt)
33
+ ORPHAN_BR_COUNT=$(wc -l < /tmp/rihal-orphan-br.txt)
34
+ TOTAL=$((ACTIVE_WT_COUNT + ORPHAN_BR_COUNT))
35
+ ```
36
+
37
+ If `TOTAL` is 0:
38
+
39
+ ```
40
+ ✓ No orphaned executor worktrees or branches found.
41
+ ```
42
+
43
+ Stop.
44
+
45
+ ## Step 2 — For each orphan, gather intelligence
46
+
47
+ For each entry (worktree or branch), run:
48
+
49
+ ```bash
50
+ # Is it merged into the current branch?
51
+ MERGED=$(git branch --merged HEAD --list '<branch>' 2>/dev/null | grep -c '<branch>')
52
+
53
+ # When was the last commit on this branch?
54
+ LAST_COMMIT=$(git log -1 --format="%ar %s" '<branch>' 2>/dev/null || echo "unknown")
55
+
56
+ # How many commits does it have that are NOT on HEAD?
57
+ AHEAD=$(git rev-list HEAD..'<branch>' --count 2>/dev/null || echo "?")
58
+ ```
59
+
60
+ Build a report table:
61
+
62
+ ```
63
+ RIHAL ► WORKTREE AUDIT
64
+ ══════════════════════════════════════════════════════════
65
+
66
+ Orphaned executor artifacts: {TOTAL}
67
+
68
+ Branch Merged Ahead Last commit
69
+ ────────────────────────────── ────── ───── ──────────────────────
70
+ worktree-agent-abc123 YES 0 3 days ago feat: add auth
71
+ worktree-agent-def456 NO 2 1 hour ago wip: migrations
72
+ ...
73
+
74
+ Active worktrees still pointing to executor branches:
75
+ .claude/worktrees/agent-abc123 → worktree-agent-abc123
76
+ ...
77
+ ```
78
+
79
+ ## Step 3 — Classify each orphan
80
+
81
+ For each branch/worktree:
82
+
83
+ - **SAFE** → `MERGED=YES` AND `AHEAD=0` — all commits are on HEAD, nothing to lose
84
+ - **STALE** → `MERGED=YES` AND `AHEAD>0` — commits are ahead but branch is in merged list (rebased/squash-merged); verify before deleting
85
+ - **UNMERGED** → `MERGED=NO` — DO NOT auto-delete; show explicitly and warn
86
+
87
+ Print classification next to each entry.
88
+
89
+ ## Step 4 — Report summary
90
+
91
+ ```
92
+ Summary:
93
+ SAFE to delete: {N} (merged, 0 ahead)
94
+ STALE (check first): {N} (merged but ahead — may be rebase/squash)
95
+ UNMERGED (keep): {N} (not merged — manual review required)
96
+
97
+ To prune SAFE orphans: /rihal-audit worktrees --prune
98
+ To inspect UNMERGED: git log HEAD..<branch> --oneline
99
+ ```
100
+
101
+ If `PRUNE=false`, stop here.
102
+
103
+ ## Step 5 — Prune (only when --prune passed)
104
+
105
+ Delete SAFE entries only. Never touch STALE or UNMERGED.
106
+
107
+ For each SAFE branch:
108
+
109
+ ```bash
110
+ # Remove the worktree if it still exists
111
+ WT_PATH=$(awk -F'\t' '$2=="refs/heads/<branch>"{print $1}' /tmp/rihal-active-wts.txt)
112
+ if [ -n "$WT_PATH" ] && [ -d "$WT_PATH" ]; then
113
+ git worktree remove "$WT_PATH" --force 2>/dev/null \
114
+ && echo " ✓ removed worktree: $WT_PATH" \
115
+ || echo " ⚠ could not remove worktree: $WT_PATH"
116
+ fi
117
+
118
+ # Delete the branch
119
+ git branch -D '<branch>' 2>/dev/null \
120
+ && echo " ✓ deleted branch: <branch>" \
121
+ || echo " ⚠ could not delete branch: <branch>"
122
+ ```
123
+
124
+ After all deletes, re-run Step 1 scan and confirm `TOTAL=0` for SAFE entries.
125
+
126
+ Print final report:
127
+
128
+ ```
129
+ Pruned: {N} safe orphans removed
130
+ Kept: {N} unmerged branches (manual review required)
131
+
132
+ ✓ Worktree cleanup complete
133
+ ```
134
+
135
+ ## Step 6 — Post-audit health note
136
+
137
+ If any UNMERGED branches remain, print:
138
+
139
+ ```
140
+ ⚠ {N} unmerged executor branch(es) still present.
141
+ These have commits NOT on your current branch.
142
+ Inspect before deleting:
143
+
144
+ git log HEAD..worktree-agent-<id> --oneline
145
+ git show worktree-agent-<id>:<file> # inspect specific file
146
+
147
+ To delete after manual review:
148
+ git worktree remove .claude/worktrees/<id> --force
149
+ git branch -D worktree-agent-<id>
150
+ ```
151
+
152
+ ## Success Criteria
153
+
154
+ - [ ] All `worktree-agent-*` branches and worktrees found and reported
155
+ - [ ] Each classified as SAFE / STALE / UNMERGED based on actual merge status
156
+ - [ ] `--prune` deletes only SAFE entries, never UNMERGED
157
+ - [ ] Post-prune confirmation scan verifies cleanup succeeded
158
+ - [ ] Non-executor worktrees (feature branches, manual worktrees) are never touched
159
+
160
+ ## On Error
161
+
162
+ - `git worktree list` fails → print `git not available or not a repo` and stop
163
+ - `git branch -D` fails on a branch → skip it, note it in the report, continue
@@ -26,6 +26,7 @@ If `$ARGUMENTS` contains `--help` or `-h`:
26
26
  /rihal-audit fix # → /rihal-audit-fix
27
27
  /rihal-audit work # → /rihal-verify-work
28
28
  /rihal-audit lens [<1-15> | all] # → /rihal-lens-audit (15-lens methodology)
29
+ /rihal-audit worktrees [--prune] # → scan + report orphaned executor worktrees/branches
29
30
  ```
30
31
 
31
32
  **Examples:**
@@ -48,7 +49,7 @@ DISCUSS=$($TOOL config-get workflow.discuss_mode 2>/dev/null || echo "adaptive")
48
49
  ```
49
50
 
50
51
  Parse `$ARGUMENTS`:
51
- - First word ∈ {plans, phase, milestone, uat, code, fix, work, lens} → set `$TARGET`, drop it from args, jump to Step 4.
52
+ - First word ∈ {plans, phase, milestone, uat, code, fix, work, lens, worktrees} → set `$TARGET`, drop it from args, jump to Step 4.
52
53
  - Empty or unrecognised → continue to Step 2.
53
54
 
54
55
  ## Step 2 — Detect project state
@@ -70,9 +71,20 @@ as `(no data — skip)`.
70
71
 
71
72
  ## Step 3 — Ask user (guided mode only)
72
73
 
74
+ Also probe for orphaned executor worktrees (add to context for Step 3 menu):
75
+
76
+ ```bash
77
+ ORPHAN_WTS=$(git worktree list --porcelain \
78
+ | awk '/^branch /{if($2 ~ /refs\/heads\/worktree-agent-/) print $2}' \
79
+ | wc -l)
80
+ ORPHAN_BR=$(git branch --list 'worktree-agent-*' 2>/dev/null | wc -l)
81
+ ORPHANS=$((ORPHAN_WTS + ORPHAN_BR))
82
+ ```
83
+
73
84
  If `$MODE` is `yolo`, skip this step and pick the most relevant target
74
- automatically (priority: `work` if dirty branch, else `plans` if PLANS>0
75
- and SUMMARIES<PLANS, else `milestone` if SUMMARIES>0, else `code`).
85
+ automatically (priority: `worktrees` if ORPHANS>0, else `work` if dirty
86
+ branch, else `plans` if PLANS>0 and SUMMARIES<PLANS, else `milestone` if
87
+ SUMMARIES>0, else `code`).
76
88
 
77
89
  Otherwise call AskUserQuestion:
78
90
 
@@ -89,6 +101,7 @@ Options:
89
101
  6. auto-fix — audit then auto-fix findings (uses #1–5 output)
90
102
  7. work — verify current branch / WIP ({ON_BRANCH}, dirty={DIRTY})
91
103
  8. lens — 15-lens methodology audit (security, perf, tests…)
104
+ 9. worktrees — orphaned executor worktrees/branches ({ORPHANS} found)
92
105
  0. cancel
93
106
  ```
94
107
 
@@ -110,6 +123,7 @@ sub-workflow.
110
123
  | fix | a prior audit report exists OR a prior `--report` artefact | `No audit findings yet. Run /rihal-audit first.` |
111
124
  | work | inside a git worktree | `Not in a git repo.` |
112
125
  | lens | `rihal/` or `.rihal/` directory exists | `No rihal source found. Run: npx @hanzlaa/rcode install .` |
126
+ | worktrees | git repo exists | `Not in a git repo.` |
113
127
 
114
128
  For `milestone` specifically, check the **graceful-degrade** condition
115
129
  (closes #234 audit-milestone halt):
@@ -153,6 +167,7 @@ Run the target's slash command, forwarding remaining args:
153
167
  | lens | `/rihal-lens-audit $REST_ARGS` |
154
168
  | fix | `/rihal-audit-fix $REST_ARGS` |
155
169
  | work | `/rihal-verify-work $REST_ARGS` |
170
+ | worktrees | execute `@.rihal/workflows/audit-worktrees.md` inline |
156
171
 
157
172
  ## Step 6 — Closing summary
158
173
 
@@ -191,6 +191,6 @@ Run remediation with:
191
191
 
192
192
  ## ▶ Next Up
193
193
 
194
- - **Course corrected:** `/rihal-execute {phase}` — resume execution with updated direction
195
- - **Plan needs updating:** `/rihal-plan {phase}` — re-plan affected phase
196
- - **Check project state:** `/rihal-progress` — verify deviation was contained
194
+ - /rihal-execute {phase}
195
+ - /rihal-plan {phase}
196
+ - /rihal-progress
@@ -26,6 +26,6 @@ Skill not installed — run: npx @hanzlaa/rcode install
26
26
 
27
27
  ## ▶ Next Up
28
28
 
29
- - **Architecture created:** `/rihal-plan {phase}` — break it into executable plans
30
- - **Review with team:** `/rihal-council {architecture-question}` — debate the design
31
- - **PRD needed first:** `/rihal-create-prd` — define requirements before architecture
29
+ - /rihal-plan {phase}
30
+ - /rihal-council {architecture-question}
31
+ - /rihal-create-prd
@@ -374,6 +374,6 @@ If arguments are invalid, missing files, or subagent fails:
374
374
 
375
375
  ## ▶ Next Up
376
376
 
377
- - **Stories created:** `/rihal-sprint-planning` — schedule capacity-gated sprint
378
- - **Review stories:** `/rihal-dev-story {story-id}` — implement a specific story
379
- - **Back to PRD:** `/rihal-edit-prd` — revise if epics revealed scope gaps
377
+ - /rihal-sprint-planning
378
+ - /rihal-dev-story {story-id}
379
+ - /rihal-edit-prd
@@ -294,7 +294,7 @@ CONTEXT.md written: {phase_dir}/{padded_phase}-CONTEXT.md
294
294
  Decisions captured: {answered}
295
295
  Deferred: {remaining}
296
296
 
297
- Next step: /rihal-plan-phase {N}
297
+ Next step: /rihal-plan {N}
298
298
  ```
299
299
  </step>
300
300
 
@@ -181,6 +181,6 @@ If .rihal/DOCS-AUDIT.md exists, check for missing/stale docs:
181
181
 
182
182
  ## ▶ Next Up
183
183
 
184
- - **Documentation updated:** `/rihal-progress` — see current project state
185
- - **Proceed to planning:** `/rihal-plan {phase}` — create executable plans
186
- - **Review with council:** `/rihal-council {question}` — debate approach
184
+ - /rihal-progress
185
+ - /rihal-plan {phase}
186
+ - /rihal-council {question}
@@ -26,6 +26,6 @@ Skill not installed — run: npx @hanzlaa/rcode install
26
26
 
27
27
  ## ▶ Next Up
28
28
 
29
- - **PRD updated:** `/rihal-validate-prd` — check completeness after changes
30
- - **Ready to plan:** `/rihal-create-milestone` — build milestone roadmap from PRD
31
- - **Review epics:** `/rihal-create-epics-and-stories` — update stories if scope changed
29
+ - /rihal-validate-prd
30
+ - /rihal-create-milestone
31
+ - /rihal-create-epics-and-stories
@@ -1,6 +1,6 @@
1
1
  <purpose>
2
2
  Execute all phases in the current milestone in dependency order, with verify gates between waves. Closes #738.
3
- Reads the ROADMAP.md to determine phase ordering, executes each phase via /rihal-execute, runs /rihal-verify after each, and surfaces blockers before advancing.
3
+ Reads the ROADMAP.md to determine phase ordering, executes each phase via /rihal-execute, runs /rihal-verify-phase after each, and surfaces blockers before advancing.
4
4
  </purpose>
5
5
 
6
6
  <required_reading>
@@ -89,10 +89,10 @@ Spawn `rihal-verifier` for the phase. On `FAIL` or `PARTIAL`:
89
89
  ⚠ Verify gate: Phase {N} — {FAIL|PARTIAL}
90
90
 
91
91
  Gap count: {N}
92
- Recommendation: Run /rihal-sprint-plan {N} --gaps to close before advancing.
92
+ Recommendation: Run /rihal-plan {N} --gaps to close before advancing.
93
93
 
94
94
  Options:
95
- 1. Close gaps now (spawn /rihal-sprint-plan --gaps) [Recommended]
95
+ 1. Close gaps now (spawn /rihal-plan --gaps) [Recommended]
96
96
  2. Advance anyway (log gap, continue to next phase)
97
97
  3. Abort milestone execution
98
98
  ```
@@ -582,7 +582,7 @@ If `USER_SETUP_CREATED=true`: display `⚠️ USER SETUP REQUIRED` with path + e
582
582
  | Condition | Route | Action |
583
583
  |-----------|-------|--------|
584
584
  | summaries < plans | **A: More plans** | Find next PLAN without SUMMARY. Yolo: auto-continue. Interactive: show next plan, suggest `/rihal-execute {phase}` + `/rihal-verify-work`. STOP here. |
585
- | summaries = plans, current < highest phase | **B: Phase done** | Show completion, suggest `/rihal-plan-phase {Z+1}` + `/rihal-verify-work {Z}` + `/rihal-discuss-phase {Z+1}` |
585
+ | summaries = plans, current < highest phase | **B: Phase done** | Show completion, suggest `/rihal-plan {Z+1}` + `/rihal-verify-work {Z}` + `/rihal-discuss-phase {Z+1}` |
586
586
  | summaries = plans, current = highest phase | **C: Milestone done** | Show banner, suggest `/rihal-complete-milestone` + `/rihal-verify-work` + `/rihal-add-phase` |
587
587
 
588
588
  All routes: `/clear` first for fresh context.
@@ -280,8 +280,13 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
280
280
  When executor agents ran in worktree isolation, their commits land on temporary branches in separate working trees. After the wave completes, merge these changes back and clean up:
281
281
 
282
282
  ```bash
283
- # List worktrees created by this wave's agents
284
- WORKTREES=$(git worktree list --porcelain | grep "^worktree " | grep -v "$(pwd)$" | sed 's/^worktree //')
283
+ # IMPORTANT: only touch worktrees whose branch starts with "worktree-agent-".
284
+ # Claude Code's EnterWorktree names all auto-created branches with this prefix.
285
+ # A broad "all non-primary worktrees" grep is dangerous — it would also pick up
286
+ # manually-created worktrees (feature branches, other milestone workspaces, etc.)
287
+ # and either corrupt or delete work that wasn't part of this execution.
288
+ WORKTREES=$(git worktree list --porcelain \
289
+ | awk '/^worktree /{path=$2} /^branch /{if($2 ~ /refs\/heads\/worktree-agent-/) print path}')
285
290
 
286
291
  for WT in $WORKTREES; do
287
292
  # Get the branch name for this worktree
@@ -358,6 +363,26 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
358
363
 
359
364
  **If no worktrees found:** Skip silently — agents may have been spawned without worktree isolation.
360
365
 
366
+ **Post-cleanup verification (mandatory):** After the loop, confirm no `worktree-agent-*` worktrees or branches remain:
367
+
368
+ ```bash
369
+ LEFTOVER_WT=$(git worktree list --porcelain \
370
+ | awk '/^branch /{if($2 ~ /refs\/heads\/worktree-agent-/) print $2}')
371
+ LEFTOVER_BR=$(git branch --list 'worktree-agent-*' 2>/dev/null)
372
+
373
+ if [ -n "$LEFTOVER_WT" ] || [ -n "$LEFTOVER_BR" ]; then
374
+ echo "⚠ WORKTREE LEAK: leftover executor artifacts detected after cleanup:"
375
+ [ -n "$LEFTOVER_WT" ] && echo " Worktrees: $LEFTOVER_WT"
376
+ [ -n "$LEFTOVER_BR" ] && echo " Branches: $LEFTOVER_BR"
377
+ echo " Run: /rihal-audit worktrees to inspect and prune"
378
+ else
379
+ echo "✓ Worktree cleanup verified — no executor artifacts remain"
380
+ fi
381
+ ```
382
+
383
+ Do NOT silently skip this check. If leaks are found, surface them — the user's next
384
+ `/rihal-status` should not show surprise worktrees from a previous execution.
385
+
361
386
  5.6. **Post-wave shared artifact update (worktree mode only):**
362
387
 
363
388
  When executor agents ran with `isolation="worktree"`, they skipped STATE.md and ROADMAP.md updates to avoid last-merge-wins overwrites. The orchestrator is the single writer for these files. After worktrees are merged back, update shared artifacts once:
@@ -204,6 +204,6 @@ If arguments are invalid, missing files, or subagent fails:
204
204
 
205
205
  After reviewing the diagnostic report, pick your recovery path:
206
206
 
207
- - **Phase stuck mid-execution:** `/rihal-resume-work`
208
- - **Phase planned but not executed:** `/rihal-execute {phase-number}`
209
- - **No incomplete work found:** `/rihal-progress` — view current state
207
+ - /rihal-resume-work
208
+ - /rihal-execute {phase-number}
209
+ - /rihal-progress
@@ -203,29 +203,44 @@ print(len(phantom))
203
203
  If 0 phantoms: `✓ PASS — no phantom-complete phases detected`
204
204
  If any: `⚠ WARN — {N} phantom-complete phase(s) detected. Run: /rihal-audit to inspect`
205
205
 
206
+ **Check 10 — no orphaned executor worktrees or branches**
207
+
208
+ ```bash
209
+ ORPHAN_WTS=$(git worktree list --porcelain \
210
+ | awk '/^branch /{if($2 ~ /refs\/heads\/worktree-agent-/) print $2}' \
211
+ | wc -l 2>/dev/null || echo 0)
212
+ ORPHAN_BR=$(git branch --list 'worktree-agent-*' 2>/dev/null | wc -l || echo 0)
213
+ ORPHANS=$((ORPHAN_WTS + ORPHAN_BR))
214
+ echo "$ORPHANS"
215
+ ```
216
+
217
+ If `ORPHANS` is 0: `✓ PASS — no orphaned executor worktrees or branches`
218
+ If `ORPHANS > 0`: `⚠ WARN — ${ORPHANS} orphaned worktree-agent-* artifact(s) from a previous /rihal-execute. Run: /rihal-audit worktrees --prune`
219
+
206
220
  ---
207
221
 
208
222
  ## Step 7 — Count results and print final summary
209
223
 
210
224
  **Action:** Count all pass/fail/warn results and display overall status.
211
225
 
212
- Total: `{N}/9 checks passed`
226
+ Total: `{N}/10 checks passed`
213
227
 
214
- If all 9 pass:
228
+ If all 10 pass:
215
229
  ```
216
230
  ✓ All systems nominal — rihal is healthy
217
231
  ```
218
232
 
219
- If fewer than 9 pass:
233
+ If fewer than 10 pass:
220
234
  ```
221
- ⚠ {N}/9 checks passed — {M} issue(s) found
235
+ ⚠ {N}/10 checks passed — {M} issue(s) found
222
236
  Run: /rihal-update to repair installation issues
223
237
  Run: /rihal-status for project-state issues
238
+ Run: /rihal-audit worktrees --prune to clean orphaned executor artifacts
224
239
  ```
225
240
 
226
241
  ## Success Criteria
227
242
 
228
- - [ ] All 9 checks executed (skip state checks if no state.json)
243
+ - [ ] All 10 checks executed (skip state checks if no state.json)
229
244
  - [ ] Each check result printed clearly
230
245
  - [ ] Final summary shows pass/fail count
231
246
  - [ ] Repair instructions shown if any checks fail
@@ -238,6 +253,6 @@ Run: /rihal-status for project-state issues
238
253
 
239
254
  ## ▶ Next Up
240
255
 
241
- - **Issues found:** `/rihal-forensics` — deep diagnostic on specific failures
242
- - **Ready to continue:** `/rihal-do` — interactive router guides next step
243
- - **Fix specific phase:** `/rihal-correct-course {phase}` — targeted correction
256
+ - /rihal-forensics
257
+ - /rihal-do
258
+ - /rihal-correct-course {phase}
@@ -269,7 +269,6 @@ init → new-project → plan → execute → next → status → ship
269
269
  | `/rihal-autonomous` | Run remaining phases autonomously — plan → execute → verify cycles. |
270
270
  | `/rihal-research-phase <n>` | Standalone research (usually use `/rihal-plan` instead). |
271
271
  | `/rihal-analyze-dependencies` | Suggest "Depends on" entries for ROADMAP.md. |
272
- | `/rihal-list-phase-assumptions <n>` | Surface agent's intended approach before planning. |
273
272
  | `/rihal-profile-user` | Classify developer on 4 dimensions, produce profile artifact. |
274
273
  | `/rihal-dashboard` | Start the Diwan view-only dashboard (port 7717). |
275
274
  | `/rihal-health` | 6-point health check of the Rihal installation. |
@@ -367,7 +367,7 @@ PHASE1_HAS_UI=$(echo "$PHASE1_SECTION" | grep -qi "UI hint.*yes" && echo "true"
367
367
 
368
368
  **Also available:**
369
369
  - /rihal-ui-phase 1 — generate UI design contract (recommended for frontend phases)
370
- - /rihal-plan-phase 1 — skip discussion, plan directly
370
+ - /rihal-plan 1 — skip discussion, plan directly
371
371
 
372
372
  ───────────────────────────────────────────────────────────────
373
373
  ```
@@ -388,7 +388,7 @@ PHASE1_HAS_UI=$(echo "$PHASE1_SECTION" | grep -qi "UI hint.*yes" && echo "true"
388
388
  ---
389
389
 
390
390
  **Also available:**
391
- - /rihal-plan-phase 1 — skip discussion, plan directly
391
+ - /rihal-plan 1 — skip discussion, plan directly
392
392
 
393
393
  ───────────────────────────────────────────────────────────────
394
394
  ```
@@ -232,7 +232,7 @@ If `TEXT_MODE` is true, present as a plain-text numbered list:
232
232
  ```
233
233
  Phase {N} has frontend indicators but no UI-SPEC.md. Generate a design contract before planning?
234
234
 
235
- 1. Generate UI-SPEC first — Run /rihal-ui-phase {N} then re-run /rihal-sprint-plan {N}
235
+ 1. Generate UI-SPEC first — Run /rihal-ui-phase {N} then re-run /rihal-plan {N}
236
236
  2. Continue without UI-SPEC
237
237
  3. Not a frontend phase
238
238
 
@@ -243,7 +243,7 @@ Otherwise use AskUserQuestion:
243
243
  - header: "UI Design Contract"
244
244
  - question: "Phase {N} has frontend indicators but no UI-SPEC.md. Generate a design contract before planning?"
245
245
  - options:
246
- - "Generate UI-SPEC first" → Display: "Run `/rihal-ui-phase {N} ${Rihal_WS}` then re-run `/rihal-sprint-plan {N} ${Rihal_WS}`". Exit workflow.
246
+ - "Generate UI-SPEC first" → Display: "Run `/rihal-ui-phase {N} ${Rihal_WS}` then re-run `/rihal-plan {N} ${Rihal_WS}`". Exit workflow.
247
247
  - "Continue without UI-SPEC" → Continue to step 6.
248
248
  - "Not a frontend phase" → Continue to step 6.
249
249
 
@@ -174,7 +174,7 @@ No REVIEWS.md found for Phase {N}. Run reviews first:
174
174
 
175
175
  /rihal-review --phase {N}
176
176
 
177
- Then re-run /rihal-sprint-plan {N} --reviews
177
+ Then re-run /rihal-plan {N} --reviews
178
178
  ```
179
179
  Exit workflow.
180
180
 
@@ -322,7 +322,7 @@ If "Run discuss-phase first":
322
322
  does not work correctly in nested subcontexts (#1009). Instead, display the command
323
323
  and exit so the user runs it as a top-level command:
324
324
  ```
325
- Run this command first, then re-run /rihal-sprint-plan {X} ${Rihal_WS}:
325
+ Run this command first, then re-run /rihal-plan {X} ${Rihal_WS}:
326
326
 
327
327
  /rihal-discuss-phase {X} ${Rihal_WS}
328
328
  ```
@@ -443,7 +443,7 @@ VALIDATION_EXISTS=$(ls "${PHASE_DIR}"/*-VALIDATION.md 2>/dev/null | head -1)
443
443
  ```
444
444
 
445
445
  If missing and Nyquist is still enabled/applicable — ask user:
446
- 1. Re-run: `/rihal-sprint-plan {PHASE} --research ${Rihal_WS}`
446
+ 1. Re-run: `/rihal-plan {PHASE} --research ${Rihal_WS}`
447
447
  2. Disable Nyquist with the exact command:
448
448
  `node ".rihal/bin/rihal-tools.cjs" config-set workflow.nyquist_validation false`
449
449
  3. Continue anyway (plans fail Dimension 8)
@@ -935,9 +935,9 @@ Verification: {Passed | Passed with override | Skipped}
935
935
 
936
936
  **Also available:**
937
937
  - cat .planning/phases/{phase-dir}/*-SPRINT.md — review plans
938
- - /rihal-sprint-plan {X} --research — re-research first
938
+ - /rihal-plan {X} --research — re-research first
939
939
  - /rihal-review --phase {X} --all — peer review plans with external AIs
940
- - /rihal-sprint-plan {X} --reviews — replan incorporating review feedback
940
+ - /rihal-plan {X} --reviews — replan incorporating review feedback
941
941
 
942
942
  ───────────────────────────────────────────────────────────────
943
943
  </offer_next>
@@ -958,11 +958,11 @@ stdio deadlocks with MCP servers — see Claude Code issue anthropics/claude-cod
958
958
  Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\tasks\*" -ErrorAction SilentlyContinue
959
959
  ```
960
960
  4. **Reduce MCP server count:** Temporarily disable non-essential MCP servers in settings.json
961
- 5. **Retry:** Restart Claude Code and run `/rihal-sprint-plan` again
961
+ 5. **Retry:** Restart Claude Code and run `/rihal-plan` again
962
962
 
963
963
  If freezes persist, try `--skip-research` to reduce the agent chain from 3 to 2 agents:
964
964
  ```
965
- /rihal-sprint-plan N --skip-research
965
+ /rihal-plan N --skip-research
966
966
  ```
967
967
  </windows_troubleshooting>
968
968
 
@@ -26,6 +26,6 @@ Skill not installed — run: npx @hanzlaa/rcode install
26
26
 
27
27
  ## ▶ Next Up
28
28
 
29
- - **Retrospective complete:** `/rihal-new-milestone` — start the next milestone
30
- - **Review project state:** `/rihal-progress` — see current roadmap position
31
- - **Archive milestone:** `/rihal-complete-milestone` — if not already done
29
+ - /rihal-new-milestone
30
+ - /rihal-progress
31
+ - /rihal-complete-milestone
@@ -10,15 +10,17 @@ Assume an adversarial/hostile perspective and audit code for weaknesses: SQL inj
10
10
  If `$ARGUMENTS` is empty or contains only `--help` or `-h`:
11
11
 
12
12
  ```
13
- /rihal-review-adversarial <argument-here>
13
+ /rihal-code-review --attack
14
14
  ```
15
15
 
16
16
  **Examples:**
17
17
  ```
18
- /rihal-review-adversarial example 1
19
- /rihal-review-adversarial example 2
18
+ /rihal-code-review --attack
19
+ /rihal-code-review --attack --scope auth/
20
20
  ```
21
21
 
22
+ Note: This workflow is invoked internally by `/rihal-code-review --attack`. There is no standalone `/rihal-review-adversarial` command.
23
+
22
24
  STOP — do not proceed.
23
25
 
24
26
  <available_agent_types>
@@ -187,6 +189,6 @@ Critical findings filed as blocking AC. High findings as optional tasks.
187
189
 
188
190
  ## ▶ Next Up
189
191
 
190
- - **Vulnerabilities found:** Address security findings, re-run `/rihal-review-adversarial`
191
- - **Clean report:** `/rihal-verify-phase {phase}` — full verification
192
- - **Ship:** `/rihal-ship {phase}` — package the phase
192
+ - **Vulnerabilities found:** Address security findings, re-run `/rihal-code-review --attack`
193
+ - /rihal-verify-phase {phase}
194
+ - /rihal-ship {phase}
@@ -283,5 +283,5 @@ Clean up temp files.
283
283
  ## ▶ Next Up
284
284
 
285
285
  - **Issues found:** Fix identified problems, then re-run `/rihal-review`
286
- - **Review passed:** `/rihal-ship {phase}` — package phase for shipping
287
- - **Security concern:** `/rihal-secure-phase {phase}` — targeted security review
286
+ - /rihal-ship {phase}
287
+ - /rihal-secure-phase {phase}
@@ -26,6 +26,6 @@ Skill not installed — run: npx @hanzlaa/rcode install
26
26
 
27
27
  ## ▶ Next Up
28
28
 
29
- - **Project scaffolded:** `/rihal-create-prd` — define what you're building
30
- - **Already have requirements:** `/rihal-create-milestone` — jump straight to roadmap
31
- - **Quick start:** `/rihal-do` — interactive router shows your next best step
29
+ - /rihal-create-prd
30
+ - /rihal-create-milestone
31
+ - /rihal-do
@@ -106,7 +106,7 @@ Call AskUserQuestion with threat table and options:
106
106
 
107
107
  ```
108
108
  Task(
109
- prompt="Read .rihal/agents/rihal-security-auditor.md for instructions.\n\n" +
109
+ prompt="Read $HOME/.claude/agents/rihal-security-auditor.md for instructions.\n\n" +
110
110
  "<files_to_read>{PLAN, SUMMARY, impl files, SECURITY.md}</files_to_read>" +
111
111
  "<threat_register>{threat register}</threat_register>" +
112
112
  "<config>asvs_level: {SECURITY_ASVS}, block_on: {SECURITY_BLOCK_ON}</config>" +
@@ -165,7 +165,7 @@ node ".rihal/bin/rihal-tools.cjs" commit "docs(phase-${PHASE}): add/update secur
165
165
  ```
166
166
  Rihal > PHASE {N} THREAT-SECURE
167
167
  threats_open: 0 — all threats have dispositions.
168
- ▶ /rihal-validate {N} validate test coverage
168
+ ▶ /rihal-validate-phase {N} validate test coverage
169
169
  ▶ /rihal-verify-work {N} run UAT
170
170
  ```
171
171
 
@@ -205,5 +205,5 @@ If arguments are invalid, missing files, or subagent fails:
205
205
  ## ▶ Next Up
206
206
 
207
207
  - **Issues found:** Address security findings, then re-run `/rihal-secure-phase {phase}`
208
- - **Clean report:** `/rihal-verify-phase {phase}` — run full verification
209
- - **Continue execution:** `/rihal-execute {next-phase}` — proceed to next phase
208
+ - /rihal-verify-phase {phase}
209
+ - /rihal-execute {next-phase}
@@ -212,7 +212,7 @@ Write `.planning/SESSION-REPORT-{YYYY-MM-DD-HHmmss}.md` with this structure:
212
212
  ## Next Steps
213
213
 
214
214
  - Address {count} open blocker(s) before proceeding
215
- - Plan next phase with `/rihal-plan-phase {next_phase}`
215
+ - Plan next phase with `/rihal-plan {next_phase}`
216
216
  ```
217
217
 
218
218
  ## Step 8 — Print confirmation
@@ -118,22 +118,18 @@ Omit a section entirely when its array is empty.
118
118
 
119
119
  ## Step 6 — Next Up (intent-tree)
120
120
 
121
- Render `SNAPSHOT.routes[]` as a Route A/B/C menu:
121
+ Render `SNAPSHOT.routes[]` as a Route A/B/C menu. Each route is **one line** — the command is the thing you copy and run:
122
122
 
123
123
  ```
124
124
  Next Up:
125
125
 
126
- [A] {route where letter === "A"}
127
- {route.command}
128
-
129
- [B] {route where letter === "B"}
130
- → {route.command}
131
-
132
- [C] {route where letter === "C"}
133
- → {route.command}
126
+ [A] /rihal-execute 4
127
+ [B] /rihal-plan 5
128
+ [C] /rihal-audit-milestone 28 --fix-drift
129
+ [C] /rihal-complete-milestone
134
130
  ```
135
131
 
136
- Group routes by letter. If multiple routes share a letter, list them indented. If there are no routes, print the fallback suggestion from the CLI output.
132
+ Format: ` [{letter}] {command}` — no label, no arrow, no indented second line. The command already contains the relevant arguments (phase number, count, flags). Group routes by letter; multiple routes sharing a letter appear on consecutive lines. If there are no routes, print the fallback suggestion from the CLI output.
137
133
 
138
134
  </process>
139
135
 
@@ -26,6 +26,6 @@ Skill not installed — run: npx @hanzlaa/rcode install
26
26
 
27
27
  ## ▶ Next Up
28
28
 
29
- - **PRD valid:** `/rihal-create-milestone` — design M1..Mn roadmap
30
- - **Gaps found:** `/rihal-edit-prd` — fill in missing sections
31
- - **Need council review:** `/rihal-council {prd-question}` — debate key decisions
29
+ - /rihal-create-milestone
30
+ - /rihal-edit-prd
31
+ - /rihal-council {prd-question}
@@ -404,6 +404,6 @@ Orchestrator routes: `passed` → update_roadmap | `gaps_found` → create/execu
404
404
 
405
405
  ## ▶ Next Up
406
406
 
407
- - **Verification passed:** `/rihal-complete-milestone` (if all phases done) or `/rihal-execute` for next phase
408
- - **Gaps found:** `/rihal-plan --gaps {phase}` — plan gap-closure tasks
409
- - **Re-verify after fixes:** `/rihal-verify-phase {phase}`
407
+ - /rihal-complete-milestone
408
+ - /rihal-plan --gaps {phase}
409
+ - /rihal-verify-phase {phase}
@@ -204,6 +204,6 @@ If arguments are invalid, missing files, or subagent fails:
204
204
 
205
205
  ## ▶ Next Up
206
206
 
207
- - **Workstream created:** `/rihal-execute {workstream-phase}` — begin execution
208
- - **View all workstreams:** `/rihal-progress` — see parallel workstream status
209
- - **Stuck:** `/rihal-forensics` — diagnose any blocked workstream
207
+ - /rihal-execute {workstream-phase}
208
+ - /rihal-progress
209
+ - /rihal-forensics