@hanzlaa/rcode 3.6.14 → 3.6.16

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 (127) hide show
  1. package/AGENTS.md +1 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +3 -3
  4. package/cli/index.js +5 -1
  5. package/cli/lib/manifest.cjs +51 -43
  6. package/dist/rcode.js +32 -35
  7. package/package.json +3 -2
  8. package/rihal/bin/rihal-tools.cjs +20 -0
  9. package/rihal/commands/add-todo.md +1 -1
  10. package/rihal/commands/check-implementation-readiness.md +18 -0
  11. package/rihal/commands/create-architecture.md +18 -0
  12. package/rihal/commands/debug.md +1 -1
  13. package/rihal/commands/edit-prd.md +18 -0
  14. package/rihal/commands/execute-milestone.md +2 -2
  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/plan-milestone.md +2 -2
  20. package/rihal/commands/progress.md +1 -1
  21. package/rihal/commands/resume-work.md +1 -1
  22. package/rihal/commands/retrospective.md +18 -0
  23. package/rihal/commands/review-edge-case-hunter.md +18 -0
  24. package/rihal/commands/scaffold-milestone.md +2 -2
  25. package/rihal/commands/scaffold-project.md +18 -0
  26. package/rihal/commands/validate-prd.md +18 -0
  27. package/rihal/references/agent-contracts.md +46 -20
  28. package/rihal/references/model-profile-resolution.md +41 -5
  29. package/rihal/references/phase-argument-parsing.md +31 -7
  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-prd/SKILL.md +1 -0
  43. package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +1 -0
  44. package/rihal/skills/actions/2-plan/rihal-create-ux-design/SKILL.md +1 -0
  45. package/rihal/skills/actions/2-plan/rihal-edit-prd/SKILL.md +1 -0
  46. package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +1 -0
  47. package/rihal/skills/actions/2-plan/rihal-validate-prd/SKILL.md +1 -0
  48. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/SKILL.md +1 -0
  49. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/SKILL.md +1 -0
  50. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/SKILL.md +1 -0
  51. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +1 -0
  52. package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +1 -0
  53. package/rihal/skills/actions/4-implementation/rihal-correct-course/SKILL.md +1 -0
  54. package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +3 -17
  55. package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +1 -0
  56. package/rihal/skills/actions/4-implementation/rihal-dev-story/workflow.md +13 -0
  57. package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/SKILL.md +1 -0
  58. package/rihal/skills/actions/4-implementation/rihal-retrospective/SKILL.md +1 -0
  59. package/rihal/skills/actions/4-implementation/rihal-retrospective/workflow.md +12 -0
  60. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/SKILL.md +1 -0
  61. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +1 -0
  62. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/workflow.md +12 -0
  63. package/rihal/skills/actions/4-implementation/rihal-sprint-status/SKILL.md +1 -0
  64. package/rihal/skills/agents/ahmed-hassani-director/SKILL.md +1 -0
  65. package/rihal/skills/agents/dalil-scout/SKILL.md +1 -0
  66. package/rihal/skills/agents/fatima-qa/SKILL.md +1 -0
  67. package/rihal/skills/agents/haitham-frontend/SKILL.md +1 -0
  68. package/rihal/skills/agents/hanzla-engineer/SKILL.md +1 -0
  69. package/rihal/skills/agents/hussain-pm/SKILL.md +1 -0
  70. package/rihal/skills/agents/hussain-sm/SKILL.md +1 -0
  71. package/rihal/skills/agents/layla-designer/SKILL.md +1 -0
  72. package/rihal/skills/agents/majlis-council/SKILL.md +1 -0
  73. package/rihal/skills/agents/mariam-marketing/SKILL.md +1 -0
  74. package/rihal/skills/agents/nasser-eng-manager/SKILL.md +1 -0
  75. package/rihal/skills/agents/noor-writer/SKILL.md +1 -0
  76. package/rihal/skills/agents/raees-orchestrator/SKILL.md +1 -0
  77. package/rihal/skills/agents/rihal-cross-platform-auditor/SKILL.md +1 -0
  78. package/rihal/skills/agents/rihal-dep-auditor/SKILL.md +1 -0
  79. package/rihal/skills/agents/rihal-deviation-analyzer/SKILL.md +1 -0
  80. package/rihal/skills/agents/rihal-i18n-auditor/SKILL.md +1 -0
  81. package/rihal/skills/agents/rihal-observability-auditor/SKILL.md +1 -0
  82. package/rihal/skills/agents/sadiq-analyst/SKILL.md +1 -0
  83. package/rihal/skills/agents/waleed-architect/SKILL.md +1 -0
  84. package/rihal/skills/agents/yousef-backend/SKILL.md +1 -0
  85. package/rihal/skills/agents/zahra-branding/SKILL.md +1 -0
  86. package/rihal/skills/agents/zayd-ml/SKILL.md +1 -0
  87. package/rihal/skills/core/rihal-init/SKILL.md +1 -1
  88. package/rihal/skills/core/rihal-memory-audit/SKILL.md +5 -5
  89. package/rihal/skills/core/rihal-memory-distill/SKILL.md +5 -5
  90. package/rihal/skills/core/rihal-memory-init/SKILL.md +7 -7
  91. package/rihal/skills/core/rihal-memory-update/SKILL.md +4 -4
  92. package/rihal/team.yaml +56 -0
  93. package/rihal/templates/UAT.md +69 -18
  94. package/rihal/templates/memory/INDEX.md +2 -2
  95. package/rihal/templates/memory/distillates/project.distillate.md +2 -2
  96. package/rihal/templates/memory/distillates/stack.distillate.md +2 -2
  97. package/rihal/templates/memory/project/stack.md +1 -1
  98. package/rihal/templates/summary.md +54 -37
  99. package/rihal/templates/verification-report.md +72 -17
  100. package/rihal/workflows/autonomous.md +2 -2
  101. package/rihal/workflows/create-prd.md +1 -1
  102. package/rihal/workflows/diagnose-issues.md +75 -22
  103. package/rihal/workflows/discuss-phase.md +1 -1
  104. package/rihal/workflows/edit-prd.md +1 -1
  105. package/rihal/workflows/health.md +6 -6
  106. package/rihal/workflows/help.md +0 -1
  107. package/rihal/workflows/memory-audit.md +2 -2
  108. package/rihal/workflows/memory-distill.md +2 -2
  109. package/rihal/workflows/memory-init.md +2 -2
  110. package/rihal/workflows/memory-update.md +2 -2
  111. package/rihal/workflows/research-phase.md +1 -1
  112. package/rihal/workflows/scaffold-project.md +1 -1
  113. package/rihal/workflows/validate-prd.md +2 -2
  114. package/rihal/workflows/verify-work.md +1 -1
  115. package/server/lib/html/client/components/App.js +56 -19
  116. package/server/lib/html/client/components/Sidebar.js +13 -0
  117. package/server/lib/html/client/components/Topbar.js +6 -3
  118. package/server/lib/html/client/store.js +30 -0
  119. package/server/lib/html/client/util.js +0 -10
  120. package/server/lib/html/client/views/FilesView.js +4 -1
  121. package/server/lib/html/client/views/KanbanView.js +15 -4
  122. package/server/lib/html/client/views/MemoryView.js +6 -6
  123. package/server/lib/html/client/views/OrchestrationView.js +12 -2
  124. package/server/lib/html/client/views/OverviewView.js +44 -4
  125. package/server/lib/html/client.js +7 -0
  126. package/server/lib/html/css.js +16 -0
  127. package/server/lib/scanner.js +7 -2
@@ -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
+ ```
@@ -18,7 +18,7 @@ interpos audit (issue #221) — DO NOT regress.
18
18
  2. **NEVER skip the methodology chain on greenfield projects.** Before
19
19
  the phase loop runs, the prerequisite check (next step) MUST verify:
20
20
  - `.planning/prd.md` exists (else halt → /rihal-create-prd)
21
- - ROADMAP.md has milestone structure (else halt → /rihal-create-milestone)
21
+ - ROADMAP.md has milestone structure (else halt → /rihal-new-milestone)
22
22
  - `.planning/epics.md` exists (else halt → /rihal-create-epics-and-stories)
23
23
  See issue #219 + #229.
24
24
 
@@ -68,7 +68,7 @@ If `SKIP_FLAG=false` AND any prerequisite is missing, HALT with a clear message:
68
68
 
69
69
  The autonomous flow assumes a project that has already gone through:
70
70
  1. /rihal-create-prd → produces .planning/prd.md
71
- 2. /rihal-create-milestone → produces ROADMAP.md with M1..Mn
71
+ 2. /rihal-new-milestone → produces ROADMAP.md with M1..Mn
72
72
  3. /rihal-create-epics-and-stories → produces .planning/epics.md
73
73
  4. THEN /rihal-autonomous ← you are here
74
74
 
@@ -21,5 +21,5 @@ Skill not installed — run: npx @hanzlaa/rcode install
21
21
  ## On Completion
22
22
 
23
23
  /rihal-validate-prd — validate the PRD for completeness
24
- /rihal-create-milestone — build the milestone roadmap from the PRD
24
+ /rihal-new-milestone — build the milestone roadmap from the PRD
25
25
  /rihal-edit-prd — revise the PRD
@@ -1,34 +1,87 @@
1
- # Workflow: rihal-diagnose-issues
2
-
3
1
  <purpose>
4
- Reusable diagnosis subroutine called from /rihal-verify-work when
5
- verification fails. Walks symptom → hypothesis → evidence → minimal
6
- repro and returns a structured finding. Not a top-level command.
2
+ Diagnose issues surfaced during /rihal:verify-work. For each failed acceptance criterion, identify root cause, classify severity, and decide whether to fix in-flight or file as follow-up.
3
+
4
+ Spawned by /rihal:verify-work when verification fails. Not typically called directly by users.
7
5
  </purpose>
8
6
 
9
- ## Step 1 — Symptom capture
7
+ <required_reading>
8
+ @.rihal/references/output-format.md
9
+ @.rihal/references/common-bug-patterns.md
10
+ @.rihal/references/verification-patterns.md
11
+ </required_reading>
12
+
13
+ <process>
14
+
15
+ ## 1. Receive failure list
16
+
17
+ `/rihal:verify-work` passes a structured list of failures:
18
+
19
+ ```json
20
+ [
21
+ {
22
+ "criterion": "Auth login completes in <2s",
23
+ "expected": "redirect to /dashboard within 2s of submit",
24
+ "actual": "redirected after 8s",
25
+ "evidence": "browser network log shows 6s spent on /api/me"
26
+ }
27
+ ]
28
+ ```
29
+
30
+ ## 2. For each failure — diagnose
31
+
32
+ Parallel-spawn one investigator per failure. Each investigator:
33
+
34
+ a. **Reproduce** locally using the verification steps from UAT.md.
35
+ b. **Bisect** — narrow down which file/function/commit introduced the regression. Use `git log --since` + `git bisect` if needed.
36
+ c. **Classify** — bug / config / docs / environment / spec.
37
+ d. **Severity** — critical (blocks ship) / high (degrades core feature) / medium (workaround exists) / low (cosmetic).
38
+ e. **Root cause** — one-sentence explanation.
39
+ f. **Fix proposal** — one of:
40
+ - **In-flight** — small enough to fix in this phase before merging
41
+ - **Follow-up** — substantial; file an issue and proceed
42
+ - **Stop** — phase shouldn't ship; halt and re-plan
43
+
44
+ ## 3. Aggregate diagnosis
45
+
46
+ Each investigator returns a structured diagnosis. The orchestrator collates:
47
+
48
+ ```
49
+ Failed criteria: 3
50
+ Diagnosis:
51
+ Critical: 1 (must fix before ship)
52
+ High: 1 (recommended fix in-flight)
53
+ Medium: 1 (file as follow-up, ship anyway)
54
+ ```
55
+
56
+ ## 4. Decide
57
+
58
+ - All criticals fixable in-flight → loop into rihal-code-fixer with the diagnosis bundle.
59
+ - Any critical not fixable in-flight → return STOP to verify-work; phase doesn't ship.
60
+ - Otherwise → file follow-ups, return PROCEED to verify-work.
10
61
 
11
- Record:
12
- - failing assertion / log line / wrong output
13
- - file:line where divergence first appears
14
- - last commit before symptom appeared (`git log -S<token>`)
62
+ ## 5. Output
15
63
 
16
- ## Step 2 Hypotheses
64
+ `DIAGNOSIS.md` per failure, written to `.planning/phases/<NN>/diagnosis/<criterion-slug>.md`. Each contains:
17
65
 
18
- List 2–3 plausible causes. For each:
19
- - a one-line predicted mechanism
20
- - the cheapest test that would falsify it
66
+ - Reproduction steps
67
+ - Bisect result
68
+ - Root cause
69
+ - Severity + classification
70
+ - Fix proposal + estimated effort
21
71
 
22
- ## Step 3 Evidence
72
+ Plus an aggregate `DIAGNOSIS-INDEX.md` summarizing all failures and the orchestrator's decision.
23
73
 
24
- Run the falsifying tests in cheapest-first order. Stop at the first
25
- hypothesis that matches all evidence.
74
+ </process>
26
75
 
27
- ## Step 4 — Minimal repro
76
+ ## Success Criteria
28
77
 
29
- Reduce to the smallest input that still triggers the bug. Save under
30
- `.planning/diagnostics/<slug>.md`.
78
+ - [ ] Every failed criterion has a DIAGNOSIS.md file
79
+ - [ ] Each DIAGNOSIS.md has reproduction + root cause + fix proposal
80
+ - [ ] Critical failures either get in-flight fix or halt the phase
81
+ - [ ] Follow-up issues filed for medium/low items proceed without blocking ship
31
82
 
32
- ## Step 5 — Hand-off
83
+ ## On Error
33
84
 
34
- Return JSON: `{ root_cause, repro_path, suggested_fix }` to the caller.
85
+ - **Cannot reproduce** mark diagnosis status `cannot-reproduce`. Often signals environment drift between verifier and dev. File as follow-up; do not block ship if all other criticals pass.
86
+ - **Bisect inconclusive** — fall back to a hypothesis-driven investigation (read recent commits in the affected file, look for likely causes).
87
+ - **Repair budget exhausted** — STOP. Return control to user with the full diagnosis bundle.
@@ -152,7 +152,7 @@ Phase number from argument (required).
152
152
  ```bash
153
153
  INIT=$(node ".rihal/bin/rihal-tools.cjs" init phase-op "${PHASE}")
154
154
  if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
155
- AGENT_SKILLS_ADVISOR=$(node ".rihal/bin/rihal-tools.cjs" agent-skills rihal-advisor 2>/dev/null)
155
+ AGENT_SKILLS_ADVISOR=$(node ".rihal/bin/rihal-tools.cjs" agent-skills rihal-advisor-researcher 2>/dev/null)
156
156
  ```
157
157
 
158
158
  Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`, `plan_count`, `roadmap_exists`, `planning_exists`, `response_language`.
@@ -27,5 +27,5 @@ Skill not installed — run: npx @hanzlaa/rcode install
27
27
  ## ▶ Next Up
28
28
 
29
29
  - /rihal-validate-prd
30
- - /rihal-create-milestone
30
+ - /rihal-new-milestone
31
31
  - /rihal-create-epics-and-stories
@@ -223,16 +223,16 @@ If `ORPHANS > 0`: `⚠ WARN — ${ORPHANS} orphaned worktree-agent-* artifact(s)
223
223
 
224
224
  **Action:** Count all pass/fail/warn results and display overall status.
225
225
 
226
- Total: `{N}/10 checks passed`
226
+ Total: `{N}/9 checks passed`
227
227
 
228
- If all 10 pass:
228
+ If all 9 pass:
229
229
  ```
230
- ✓ All systems nominal — rihal is healthy
230
+ ✓ All systems nominal — rihal is healthy (9/9)
231
231
  ```
232
232
 
233
- If fewer than 10 pass:
233
+ If fewer than 9 pass:
234
234
  ```
235
- ⚠ {N}/10 checks passed — {M} issue(s) found
235
+ ⚠ {N}/9 checks passed — {M} issue(s) found
236
236
  Run: /rihal-update to repair installation issues
237
237
  Run: /rihal-status for project-state issues
238
238
  Run: /rihal-audit worktrees --prune to clean orphaned executor artifacts
@@ -240,7 +240,7 @@ Run: /rihal-audit worktrees --prune to clean orphaned executor artifacts
240
240
 
241
241
  ## Success Criteria
242
242
 
243
- - [ ] All 10 checks executed (skip state checks if no state.json)
243
+ - [ ] All 9 checks executed (skip state checks if no state.json)
244
244
  - [ ] Each check result printed clearly
245
245
  - [ ] Final summary shows pass/fail count
246
246
  - [ ] Repair instructions shown if any checks fail
@@ -231,7 +231,6 @@ init → new-project → plan → execute → next → status → ship
231
231
  | `/rihal-dev-story <file>` | Execute an approved STORY by writing tests + code per AC. |
232
232
  | (internal) `check-implementation-readiness` | Guard called by `/rihal-plan` and `/rihal-execute` to verify PRD + architecture aligned before build. |
233
233
  | `/rihal-create-architecture` | Write an Architecture Decision Record (ADR). |
234
- | `/rihal-create-ux-design` | Realize a UX design that informs architecture and implementation. |
235
234
  | `/rihal-correct-course` | Course-correct mid-sprint when major change is discovered. |
236
235
  | `/rihal-sprint-planning` | Compute capacity, prioritize stories, create SPRINT.md. |
237
236
  | `/rihal-sprint-status` | Sprint progress — stories, points, velocity, burndown. |
@@ -33,7 +33,7 @@ fi
33
33
 
34
34
  ## Halt conditions
35
35
 
36
- - Memory Bank not initialised → instruct to run `/rcode:memory-init` first
36
+ - Memory Bank not initialised → instruct to run `/rihal-memory-init` first
37
37
 
38
38
  ---
39
39
 
@@ -77,7 +77,7 @@ For `change-records/`, `incidents/post-mortems/`, `milestones/archive/`:
77
77
  For each `distillates/*.distillate.md`:
78
78
  - Read frontmatter `source-digest`
79
79
  - Recompute digest of current source files (per `rcode-memory-distill` rules)
80
- - If mismatch, emit a `warn` finding suggesting `/rcode:memory-distill`
80
+ - If mismatch, emit a `warn` finding suggesting `/rihal-memory-distill`
81
81
 
82
82
  ### Step 8 — Render report
83
83
 
@@ -20,7 +20,7 @@ Regenerate Memory Bank distillates with lossless compression. Idempotent.
20
20
 
21
21
  ## Halt conditions
22
22
 
23
- - `.rihal/memory/` missing → instruct to run `/rcode:memory-init` first
23
+ - `.rihal/memory/` missing → instruct to run `/rihal-memory-init` first
24
24
  - All sources empty (only template placeholders) → warn and exit; no point distilling empty content
25
25
 
26
26
  ---
@@ -70,7 +70,7 @@ For each target distillate, write:
70
70
  ---
71
71
  generated: true
72
72
  do-not-edit: true
73
- regenerate-with: /rcode:memory-distill
73
+ regenerate-with: /rihal-memory-distill
74
74
  source-digest: <hash>
75
75
  generated-at: <ISO datetime>
76
76
  source-files:
@@ -41,7 +41,7 @@ If `INDEX.md` exists:
41
41
  - List every file under `.rihal/memory/`
42
42
  - For each, count non-template lines (lines that don't start with `<!--` or contain `_(...)_` placeholders)
43
43
  - Print which files are empty / template-only and which are populated
44
- - Suggest `/rcode:memory-update` for surgical edits and exit
44
+ - Suggest `/rihal-memory-update` for surgical edits and exit
45
45
 
46
46
  ### Step 2 — Copy templates
47
47
 
@@ -90,7 +90,7 @@ Add or update the `memory_bank` block in `.rihal/state.json`:
90
90
  Show:
91
91
  - File tree of `.rihal/memory/`
92
92
  - Files seeded vs files still empty
93
- - Suggested next command: `/rcode:memory-distill`
93
+ - Suggested next command: `/rihal-memory-distill`
94
94
 
95
95
  ---
96
96
 
@@ -15,7 +15,7 @@ Append-only surgical update to a single Memory Bank file. Never rewrites, never
15
15
 
16
16
  ## Preconditions
17
17
 
18
- - `.rihal/memory/` exists (run `/rcode:memory-init` first)
18
+ - `.rihal/memory/` exists (run `/rihal-memory-init` first)
19
19
 
20
20
  ## Halt conditions
21
21
 
@@ -72,7 +72,7 @@ For `change-records/`:
72
72
 
73
73
  ### Step 5 — Suggest distillate refresh
74
74
 
75
- If the change was to `project/`, `milestones/current.md`, or `incidents/`, suggest `/rcode:memory-distill` to refresh distillates. Optional, not enforced.
75
+ If the change was to `project/`, `milestones/current.md`, or `incidents/`, suggest `/rihal-memory-distill` to refresh distillates. Optional, not enforced.
76
76
 
77
77
  ---
78
78
 
@@ -44,7 +44,7 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
44
44
  # If INIT is empty or INIT.ok is false: print "Error: rihal-tools init failed." and exit.
45
45
  # Extract: phase_dir, padded_phase, phase_number, state_path, requirements_path, context_path, response_language
46
46
  # If response_language is set, include "Respond in {value}." in all spawned subagent prompts.
47
- AGENT_SKILLS_RESEARCHER=$(node ".rihal/bin/rihal-tools.cjs" agent-skills rihal-researcher 2>/dev/null)
47
+ AGENT_SKILLS_RESEARCHER=$(node ".rihal/bin/rihal-tools.cjs" agent-skills rihal-phase-researcher 2>/dev/null)
48
48
  ```
49
49
 
50
50
  ## Step 4: Spawn Researcher
@@ -27,5 +27,5 @@ Skill not installed — run: npx @hanzlaa/rcode install
27
27
  ## ▶ Next Up
28
28
 
29
29
  - /rihal-create-prd
30
- - /rihal-create-milestone
30
+ - /rihal-new-milestone
31
31
  - /rihal-do