@hanzlaa/rcode 3.6.8 → 3.6.15

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 (142) hide show
  1. package/AGENTS.md +1 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +3 -3
  4. package/cli/generate-command-skills.cjs +5 -12
  5. package/cli/index.js +5 -1
  6. package/cli/lib/manifest.cjs +51 -43
  7. package/dist/rcode.js +32 -35
  8. package/package.json +3 -2
  9. package/rihal/bin/rihal-tools.cjs +45 -24
  10. package/rihal/commands/add-todo.md +1 -1
  11. package/rihal/commands/check-implementation-readiness.md +18 -0
  12. package/rihal/commands/create-architecture.md +18 -0
  13. package/rihal/commands/debug.md +1 -1
  14. package/rihal/commands/edit-prd.md +18 -0
  15. package/rihal/commands/memory-audit.md +1 -1
  16. package/rihal/commands/memory-distill.md +1 -1
  17. package/rihal/commands/memory-init.md +1 -1
  18. package/rihal/commands/memory-update.md +1 -1
  19. package/rihal/commands/progress.md +1 -1
  20. package/rihal/commands/resume-work.md +1 -1
  21. package/rihal/commands/retrospective.md +18 -0
  22. package/rihal/commands/review-edge-case-hunter.md +18 -0
  23. package/rihal/commands/scaffold-project.md +18 -0
  24. package/rihal/commands/validate-prd.md +18 -0
  25. package/rihal/references/agent-contracts.md +46 -20
  26. package/rihal/references/continuation-format.md +5 -6
  27. package/rihal/references/model-profile-resolution.md +41 -5
  28. package/rihal/references/phase-argument-parsing.md +31 -7
  29. package/rihal/references/research-synthesis-playbook.md +1 -1
  30. package/rihal/references/revision-loop.md +36 -9
  31. package/rihal/references/universal-anti-patterns.md +56 -12
  32. package/rihal/skills/SKILLS_INDEX.md +34 -5
  33. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/SKILL.md +1 -0
  34. package/rihal/skills/actions/1-analysis/research/rihal-market-research/SKILL.md +1 -0
  35. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/SKILL.md +1 -0
  36. package/rihal/skills/actions/1-analysis/rihal-document-project/SKILL.md +1 -0
  37. package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +1 -0
  38. package/rihal/skills/actions/1-analysis/rihal-product-brief/SKILL.md +1 -0
  39. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +1 -0
  40. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/workflow.md +12 -0
  41. package/rihal/skills/actions/2-plan/rihal-create-milestone/SKILL.md +1 -0
  42. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-06-phase-stubs.md +1 -1
  43. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-10-complete.md +1 -1
  44. package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +1 -0
  45. package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +1 -0
  46. package/rihal/skills/actions/2-plan/rihal-create-ux-design/SKILL.md +1 -0
  47. package/rihal/skills/actions/2-plan/rihal-edit-prd/SKILL.md +1 -0
  48. package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +1 -0
  49. package/rihal/skills/actions/2-plan/rihal-validate-prd/SKILL.md +1 -0
  50. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/SKILL.md +1 -0
  51. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/SKILL.md +1 -0
  52. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/SKILL.md +1 -0
  53. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +1 -0
  54. package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +1 -0
  55. package/rihal/skills/actions/4-implementation/rihal-correct-course/SKILL.md +1 -0
  56. package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +4 -16
  57. package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +1 -0
  58. package/rihal/skills/actions/4-implementation/rihal-dev-story/workflow.md +13 -0
  59. package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/SKILL.md +1 -0
  60. package/rihal/skills/actions/4-implementation/rihal-retrospective/SKILL.md +1 -0
  61. package/rihal/skills/actions/4-implementation/rihal-retrospective/workflow.md +12 -0
  62. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/SKILL.md +1 -0
  63. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +1 -0
  64. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/workflow.md +12 -0
  65. package/rihal/skills/actions/4-implementation/rihal-sprint-status/SKILL.md +1 -0
  66. package/rihal/skills/agents/ahmed-hassani-director/SKILL.md +1 -0
  67. package/rihal/skills/agents/dalil-scout/SKILL.md +1 -0
  68. package/rihal/skills/agents/fatima-qa/SKILL.md +1 -0
  69. package/rihal/skills/agents/haitham-frontend/SKILL.md +1 -0
  70. package/rihal/skills/agents/hanzla-engineer/SKILL.md +1 -0
  71. package/rihal/skills/agents/hussain-pm/SKILL.md +1 -0
  72. package/rihal/skills/agents/hussain-sm/SKILL.md +1 -0
  73. package/rihal/skills/agents/layla-designer/SKILL.md +1 -0
  74. package/rihal/skills/agents/majlis-council/SKILL.md +1 -0
  75. package/rihal/skills/agents/mariam-marketing/SKILL.md +1 -0
  76. package/rihal/skills/agents/nasser-eng-manager/SKILL.md +1 -0
  77. package/rihal/skills/agents/noor-writer/SKILL.md +1 -0
  78. package/rihal/skills/agents/raees-orchestrator/SKILL.md +1 -0
  79. package/rihal/skills/agents/rihal-cross-platform-auditor/SKILL.md +1 -0
  80. package/rihal/skills/agents/rihal-dep-auditor/SKILL.md +1 -0
  81. package/rihal/skills/agents/rihal-deviation-analyzer/SKILL.md +1 -0
  82. package/rihal/skills/agents/rihal-i18n-auditor/SKILL.md +1 -0
  83. package/rihal/skills/agents/rihal-observability-auditor/SKILL.md +1 -0
  84. package/rihal/skills/agents/sadiq-analyst/SKILL.md +1 -0
  85. package/rihal/skills/agents/waleed-architect/SKILL.md +1 -0
  86. package/rihal/skills/agents/yousef-backend/SKILL.md +1 -0
  87. package/rihal/skills/agents/zahra-branding/SKILL.md +1 -0
  88. package/rihal/skills/agents/zayd-ml/SKILL.md +1 -0
  89. package/rihal/skills/core/rihal-init/SKILL.md +1 -1
  90. package/rihal/skills/core/rihal-memory-audit/SKILL.md +5 -5
  91. package/rihal/skills/core/rihal-memory-distill/SKILL.md +5 -5
  92. package/rihal/skills/core/rihal-memory-init/SKILL.md +7 -7
  93. package/rihal/skills/core/rihal-memory-update/SKILL.md +4 -4
  94. package/rihal/team.yaml +56 -0
  95. package/rihal/templates/UAT.md +69 -18
  96. package/rihal/templates/memory/INDEX.md +2 -2
  97. package/rihal/templates/memory/distillates/project.distillate.md +2 -2
  98. package/rihal/templates/memory/distillates/stack.distillate.md +2 -2
  99. package/rihal/templates/memory/project/stack.md +1 -1
  100. package/rihal/templates/summary.md +54 -37
  101. package/rihal/templates/verification-report.md +72 -17
  102. package/rihal/workflows/analyze-dependencies.md +4 -4
  103. package/rihal/workflows/audit-fix.md +3 -3
  104. package/rihal/workflows/audit-milestone.md +12 -11
  105. package/rihal/workflows/audit-worktrees.md +163 -0
  106. package/rihal/workflows/audit.md +18 -3
  107. package/rihal/workflows/autonomous.md +2 -2
  108. package/rihal/workflows/correct-course.md +3 -3
  109. package/rihal/workflows/create-architecture.md +3 -3
  110. package/rihal/workflows/create-epics-and-stories.md +3 -3
  111. package/rihal/workflows/create-prd.md +1 -1
  112. package/rihal/workflows/diagnose-issues.md +75 -22
  113. package/rihal/workflows/discuss-phase-power.md +1 -1
  114. package/rihal/workflows/discuss-phase.md +1 -1
  115. package/rihal/workflows/document-project.md +3 -3
  116. package/rihal/workflows/edit-prd.md +3 -3
  117. package/rihal/workflows/execute-milestone.md +3 -3
  118. package/rihal/workflows/execute-sprint.md +1 -1
  119. package/rihal/workflows/execute-waves.md +27 -2
  120. package/rihal/workflows/forensics.md +3 -3
  121. package/rihal/workflows/health.md +19 -4
  122. package/rihal/workflows/help.md +0 -2
  123. package/rihal/workflows/memory-audit.md +2 -2
  124. package/rihal/workflows/memory-distill.md +2 -2
  125. package/rihal/workflows/memory-init.md +2 -2
  126. package/rihal/workflows/memory-update.md +2 -2
  127. package/rihal/workflows/new-project-roadmap.md +2 -2
  128. package/rihal/workflows/plan-research-validation.md +2 -2
  129. package/rihal/workflows/plan.md +7 -7
  130. package/rihal/workflows/research-phase.md +1 -1
  131. package/rihal/workflows/retrospective.md +3 -3
  132. package/rihal/workflows/review-adversarial.md +8 -6
  133. package/rihal/workflows/review.md +2 -2
  134. package/rihal/workflows/scaffold-project.md +3 -3
  135. package/rihal/workflows/secure-phase.md +4 -4
  136. package/rihal/workflows/session-report.md +1 -1
  137. package/rihal/workflows/status.md +6 -10
  138. package/rihal/workflows/validate-prd.md +4 -4
  139. package/rihal/workflows/verify-phase.md +3 -3
  140. package/rihal/workflows/verify-work.md +1 -1
  141. package/rihal/workflows/workstream.md +3 -3
  142. package/server/lib/html/client/views/MemoryView.js +6 -6
package/rihal/team.yaml CHANGED
@@ -85,6 +85,20 @@ agents:
85
85
  - backlog
86
86
  description: Scope, requirements, PRD writing, user stories, and backlog curation.
87
87
 
88
+ - id: rihal-hussain-sm
89
+ name: Hussain (حسين)
90
+ skill_path: rihal/skills/agents/hussain-sm
91
+ role: Scrum Master
92
+ authority_level: product
93
+ domain_keywords:
94
+ - sprint-planning
95
+ - story-preparation
96
+ - sprint-status
97
+ - retrospective
98
+ - course-correction
99
+ - agile-ceremonies
100
+ description: Sprint planning, story preparation, sprint status reporting, retrospectives, and mid-sprint course correction.
101
+
88
102
  - id: rihal-yousef
89
103
  name: Yousef (يوسف)
90
104
  file_path: rihal/agents/rihal-yousef.md
@@ -272,6 +286,48 @@ agents:
272
286
  - migrations
273
287
  description: Generalist engineer for implementation tasks spanning frontend and backend. Pairs with Hanzla on complex stories.
274
288
 
289
+ - id: rihal-dalil-scout
290
+ name: Dalil (دليل)
291
+ skill_path: rihal/skills/agents/dalil-scout
292
+ role: Codebase Scout
293
+ authority_level: analysis
294
+ domain_keywords:
295
+ - codebase-discovery
296
+ - repository-exploration
297
+ - topic-sweep
298
+ - architecture-mapping
299
+ - integrations-audit
300
+ - project-structure
301
+ description: Repository discovery, multi-root exploration, focused topic sweeps, and structured codebase documents.
302
+
303
+ - id: rihal-raees-orchestrator
304
+ name: Raees (رئيس)
305
+ skill_path: rihal/skills/agents/raees-orchestrator
306
+ role: Project Orchestration Director
307
+ authority_level: strategic
308
+ domain_keywords:
309
+ - orchestration
310
+ - dispatch
311
+ - work-routing
312
+ - phase-sequencing
313
+ - team-coordination
314
+ - handoffs
315
+ description: Dispatches work to the right specialists, sequences phases, identifies parallel vs sequential work, and coordinates handoffs.
316
+
317
+ - id: rihal-majlis-council
318
+ name: Majlis (مجلس)
319
+ skill_path: rihal/skills/agents/majlis-council
320
+ role: Multi-Agent Council
321
+ authority_level: strategic
322
+ domain_keywords:
323
+ - council
324
+ - team-consultation
325
+ - multi-agent-discussion
326
+ - crisis-mode
327
+ - incident-response
328
+ - cross-domain
329
+ description: Convenes the Rihal team to discuss any topic, collects perspectives from all relevant specialists, and delivers a synthesised answer with dissent noted.
330
+
275
331
  utility_agents:
276
332
  - id: rihal-planner
277
333
  name: Rihal Planner
@@ -1,29 +1,80 @@
1
- # UAT — {{phase_name}}
1
+ # UAT.mdUser Acceptance Test Template
2
2
 
3
- **Phase:** {{phase_id}}
4
- **Generated:** {{date}}
3
+ Each phase produces a UAT.md alongside its SUMMARY.md. UAT documents how a non-developer can verify the phase delivered what it promised.
5
4
 
6
- ## How to use
5
+ ## Frontmatter
7
6
 
8
- For each scenario below, mark status: ✅ pass | ❌ fail | ⏸ skipped |
9
- 🔍 needs-human. Add notes inline.
7
+ ```yaml
8
+ ---
9
+ phase: NN
10
+ phase_name: <slug>
11
+ generated: <ISO date>
12
+ status: pending | passed | partial | diagnosed | blocked | skipped | human_needed
13
+ last_run: <ISO date>
14
+ ---
15
+ ```
10
16
 
11
- ## Scenarios
17
+ ## Sections
12
18
 
13
- ### Scenario 1: {{golden path title}}
19
+ ### Phase goal (verbatim from ROADMAP.md)
14
20
 
15
- **Steps:**
16
- 1. {{action}}
17
- 2. {{action}}
21
+ One paragraph copied straight from the phase's roadmap entry. No paraphrase.
18
22
 
19
- **Expected:** {{outcome}}
20
- **Status:** ⏸
21
- **Notes:**
23
+ ### What to verify
22
24
 
23
- ### Scenario 2: {{edge case title}}
25
+ A bullet list. Each bullet is one observable behavior:
24
26
 
25
- (Repeat as needed.)
27
+ - **<feature>** — open <screen / endpoint / file>, do <action>, observe <expected outcome>
28
+ - ✅ **<feature>** — run `<exact command>`, expect output containing `<exact substring>`
26
29
 
27
- ## Outstanding items
30
+ Every bullet must be runnable without reading the source code.
28
31
 
29
- Items left as ⏸ or 🔍 carry forward to the next milestone audit.
32
+ ### Setup steps
33
+
34
+ If the verifier needs to seed data, set env vars, or start services:
35
+
36
+ ```bash
37
+ # 1. install
38
+ npx @hanzlaa/rcode install
39
+ # 2. seed
40
+ node .rihal/bin/rihal-tools.cjs ...
41
+ # 3. ready
42
+ open http://localhost:3000/foo
43
+ ```
44
+
45
+ ### Per-criterion result
46
+
47
+ After running, fill in:
48
+
49
+ | # | Criterion | Result | Notes |
50
+ |---|-----------|:------:|-------|
51
+ | 1 | <copy from "What to verify"> | ✅ / ⚠️ / ❌ | <one line> |
52
+ | 2 | ... | ... | ... |
53
+
54
+ ### Outstanding items
55
+
56
+ Anything that could not be verified, or where the verifier hit a blocker:
57
+
58
+ - **<criterion>**: status = `blocked` because <reason>; needs <action> from <owner>.
59
+
60
+ ### Sign-off
61
+
62
+ ```
63
+ Verified by: <name>
64
+ Date: <ISO>
65
+ Verdict: PASSED | PARTIAL | FAILED
66
+ ```
67
+
68
+ ## Status values
69
+
70
+ - `pending` — UAT.md generated but not yet run.
71
+ - `passed` — every criterion green.
72
+ - `partial` — some criteria green, some not. Note which.
73
+ - `diagnosed` — failed criteria have a known cause + a fix is in flight.
74
+ - `blocked` — failed criteria need external work (data, infra, API access).
75
+ - `skipped` — verifier intentionally did not run a criterion (with reason).
76
+ - `human_needed` — automated check inconclusive; needs subjective human judgment.
77
+
78
+ ## Audit
79
+
80
+ `/rihal:audit-uat` aggregates UAT.md files across all phases and surfaces outstanding items in one report.
@@ -37,8 +37,8 @@
37
37
  - **`project/decisions.md`** — append every architectural choice as it's made
38
38
  - **`milestones/current.md`** — update on milestone phase transitions
39
39
  - **`incidents/known-issues.md`** — add when a workaround ships, remove when a real fix lands
40
- - **`distillates/`** — regenerate via `/rcode:memory-distill` when source files change
41
- - **Whole bank** — audit via `/rcode:memory-audit` at every milestone close
40
+ - **`distillates/`** — regenerate via `/rihal-memory-distill` when source files change
41
+ - **Whole bank** — audit via `/rihal-memory-audit` at every milestone close
42
42
 
43
43
  ## Constraints
44
44
 
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  generated: true
3
3
  do-not-edit: true
4
- regenerate-with: /rcode:memory-distill
4
+ regenerate-with: /rihal-memory-distill
5
5
  ---
6
6
 
7
7
  # Project Distillate — `{{PROJECT_NAME}}`
8
8
 
9
9
  > Generated, lossless compression of `project/`, `people/`, `milestones/current.md`, and `incidents/known-issues.md`. Optimised for LLM context loading. Hand-edits are overwritten on regenerate.
10
10
 
11
- _(Run `/rcode:memory-distill` to populate.)_
11
+ _(Run `/rihal-memory-distill` to populate.)_
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  generated: true
3
3
  do-not-edit: true
4
- regenerate-with: /rcode:memory-distill
4
+ regenerate-with: /rihal-memory-distill
5
5
  ---
6
6
 
7
7
  # Stack Distillate — `{{PROJECT_NAME}}`
8
8
 
9
9
  > Generated, lossless compression of `project/stack.md` only. Useful when you need stack context but not full project history.
10
10
 
11
- _(Run `/rcode:memory-distill --target stack` to populate.)_
11
+ _(Run `/rihal-memory-distill --target stack` to populate.)_
@@ -1,6 +1,6 @@
1
1
  # Stack — `{{PROJECT_NAME}}`
2
2
 
3
- Inventory of languages, frameworks, libraries, and services. Refreshed via `/rcode:memory-update` when stack changes.
3
+ Inventory of languages, frameworks, libraries, and services. Refreshed via `/rihal-memory-update` when stack changes.
4
4
 
5
5
  ---
6
6
 
@@ -1,60 +1,77 @@
1
+ # SUMMARY.md Template
2
+
3
+ Each plan or sprint task produces a SUMMARY.md when it completes. The summary is the unit of work's lasting record — what was done, why, what remains, what other work it affects.
4
+
5
+ ## Frontmatter
6
+
7
+ ```yaml
1
8
  ---
2
- phase: "{{phase_id}}"
3
- status: complete
4
- closed_at: "{{closed_at}}"
9
+ phase: NN
10
+ plan: NN.M # if applicable
11
+ sprint: N # if applicable
12
+ story_id: NN.M # if dev-story produced this
13
+ generated: <ISO date>
14
+ status: complete | partial | blocked
15
+ verified: false # flips to true after /rihal:verify-work passes
5
16
  ---
17
+ ```
18
+
19
+ ## Sections
20
+
21
+ ### One-liner
22
+
23
+ A single line describing what was accomplished. Goes into `/rihal:progress` recent-work bullets, council recaps, milestone summaries. Be specific:
24
+
25
+ > ❌ "Added some dashboard improvements"
26
+ > ✅ "Wired live engagement metrics to dashboard top-3 tweets card; updates every 30s via SSE"
6
27
 
7
- # Phase Summary — {{phase_name}}
28
+ ### Outcomes
8
29
 
9
- <!-- P2: Omit any section that has nothing substantive to say. An empty section is worse than no section. -->
30
+ What changed as a result of this work, observable from outside:
10
31
 
11
- **Phase ID:** {{phase_id}}
12
- **Closed:** {{closed_at}}
13
- **Sprint:** SPRINT.md
32
+ - ...
14
33
 
15
- ## Outcomes
34
+ ### Files touched
16
35
 
17
- - {{what was built, in user-visible terms}}
36
+ ```
37
+ src/dashboard/Card.tsx new
38
+ src/dashboard/index.tsx modified — added engagement subscription
39
+ src/lib/sse.ts new — SSE client wrapper
40
+ test/dashboard.test.ts new — 4 tests
41
+ ```
18
42
 
19
- ## Decisions Made
43
+ ### Decisions
20
44
 
21
- <!-- Omit if no decisions were made that aren't already in SPRINT.md -->
22
- - {{key choices and their rationale}}
45
+ Decisions made during execution that aren't already in `state.decisions[]`:
23
46
 
24
- ## Deviations from Plan
47
+ - **<decision>**: chose A over B because <one-line reason>. Tradeoff: <what we gave up>.
25
48
 
26
- <!-- Omit if execution matched the plan exactly -->
27
- - {{anything that diverged from SPRINT.md and why}}
49
+ ### Issues encountered
28
50
 
29
- ## Issues Encountered
51
+ Problems hit during execution and how they were resolved:
30
52
 
31
- <!-- Omit if no tasks were pruned, escalated, or skipped -->
32
- - {{tasks pruned, escalated, or skipped}}
53
+ - **<problem>**: <one-line description>. Resolved by <action>. Time spent: <approx>.
33
54
 
34
- ## Patterns Established
55
+ If a problem was NOT resolved, it goes here AND becomes a follow-up filed below.
35
56
 
36
- <!-- Omit if no new patterns were introduced. List architectural/coding patterns future phases should follow. -->
37
- <!-- Example: "All service errors now wrap in ServiceError(code, message) — see auth.service.ts:42" -->
38
- - {{new pattern introduced by this phase and where it lives}}
57
+ ### Follow-ups
39
58
 
40
- ## Provides
59
+ GH issues filed (or to file) for work that this story surfaced but didn't ship:
41
60
 
42
- <!-- What this phase exposes for future phases to build on. Be specific: function names, API endpoints, data models, config keys. -->
43
- <!-- Example: "UserRepository.findByEmail() — src/repositories/user.repo.ts" -->
44
- - {{what future phases can reuse from this phase}}
61
+ - #N <title>
62
+ - (to file) — <description>
45
63
 
46
- ## Requires
64
+ ### Verification
47
65
 
48
- <!-- What this phase consumed from prior phases. Helps trace dependency chains. -->
49
- <!-- Example: "Database connection from Phase 3 (src/db/connection.ts)" -->
50
- - {{what this phase depended on from earlier phases}}
66
+ How a verifier confirms this story is actually done:
51
67
 
52
- ## Affects
68
+ - Run `<command>`, expect `<output>`
69
+ - Open `<UI element>`, click `<button>`, observe `<state change>`
53
70
 
54
- <!-- Downstream phases or components that may be impacted by what changed here. -->
55
- <!-- Example: "Phase 9 (checkout flow) — depends on Cart model introduced here" -->
56
- - {{phases or components that should re-verify after this phase}}
71
+ This block feeds into UAT.md when the phase completes.
57
72
 
58
- ## Hand-off
73
+ ### Status
59
74
 
60
- Next phase: {{next phase id and goal}}
75
+ - **complete** all acceptance criteria green, follow-ups filed.
76
+ - **partial** — some AC green, others deferred. Document which AC are open.
77
+ - **blocked** — couldn't proceed. Owner of unblock + ETA.
@@ -1,28 +1,83 @@
1
- # Verification Report — {{phase_name}}
1
+ # Verification Report Template
2
2
 
3
- **Phase:** {{phase_id}}
4
- **Verified:** {{date}}
5
- **Verifier:** rihal-verifier
3
+ Used by `/rihal:verify-phase`. Goal-backward analysis of whether the phase actually delivered the goal stated in ROADMAP.md.
6
4
 
7
- ## Goal-backward check
5
+ ## Frontmatter
8
6
 
9
- **Original goal:** {{phase goal from PLAN.md}}
7
+ ```yaml
8
+ ---
9
+ phase: NN
10
+ phase_name: <slug>
11
+ verifier: <agent / human>
12
+ verified_at: <ISO date>
13
+ verdict: pass | fail | partial
14
+ goal_source: ROADMAP.md (commit-sha-at-phase-start)
15
+ ---
16
+ ```
10
17
 
11
- **Met?** ✅ / ◐ partial / ❌ not met
18
+ ## Sections
12
19
 
13
- **Evidence:**
14
- - {{file:line or test name proving the goal is met}}
20
+ ### Phase goal (verbatim)
15
21
 
16
- ## Per-task verification
22
+ > <paste the goal statement from ROADMAP.md exactly as written when this phase was planned>
17
23
 
18
- | # | Task | Status | Evidence |
19
- |---|------|--------|----------|
20
- | 1 | {{task}} | ✅ | {{evidence}} |
24
+ ### Goal decomposition
21
25
 
22
- ## Gaps
26
+ The goal as one sentence is too coarse to verify against. Decompose into checkable claims:
23
27
 
24
- - {{what wasn't delivered + why}}
28
+ 1. **Claim 1**: <one observable thing the goal implies>
29
+ 2. **Claim 2**: ...
30
+ 3. **Claim N**: ...
25
31
 
26
- ## Recommendation
32
+ ### Evidence per claim
27
33
 
28
- - proceed / revise / block
34
+ For each claim, list:
35
+
36
+ - **Source of truth**: code path / file / endpoint / behavior
37
+ - **Verification method**: command / test name / manual step
38
+ - **Result**: ✅ / ❌ / ⚠️
39
+ - **Notes**: anything surprising
40
+
41
+ ```
42
+ | # | Claim | Method | Result | Notes |
43
+ |---|-------|--------|:------:|-------|
44
+ | 1 | ... | ... | ✅ | ... |
45
+ ```
46
+
47
+ ### Coverage gaps
48
+
49
+ What the phase goal said but no evidence-trail covered. List explicitly:
50
+
51
+ - **<claim>** has no implementation that can be pointed to. Either:
52
+ - The goal was aspirational and the phase didn't implement it (gap to file as follow-up)
53
+ - The implementation exists but no test or doc covers it (gap to file as test debt)
54
+
55
+ ### Side-effect audit
56
+
57
+ What the phase changed BEYOND the goal. Often these are silent:
58
+
59
+ - New dependencies added
60
+ - Schema changes
61
+ - API contract changes
62
+ - File-tree changes (new dirs, deleted files)
63
+
64
+ Each side effect should be intentional and documented.
65
+
66
+ ### Verdict reasoning
67
+
68
+ One paragraph explaining why the verdict (pass / fail / partial) was chosen. Include any judgment calls.
69
+
70
+ ### Follow-ups
71
+
72
+ Issues filed (or to file) for gaps surfaced during verification:
73
+
74
+ - #N — <title>
75
+ - (to file) — <description>
76
+
77
+ ## Sign-off
78
+
79
+ ```
80
+ Verifier: <name or agent id>
81
+ Date: <ISO>
82
+ Verdict: <verdict from frontmatter>
83
+ ```
@@ -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