@hanzlaa/rcode 2.2.0 → 2.3.2

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 (143) hide show
  1. package/CLAUDE.md +15 -0
  2. package/CONTRIBUTING.md +138 -0
  3. package/README.md +74 -15
  4. package/cli/install.js +312 -80
  5. package/cli/postinstall.js +4 -4
  6. package/cli/uninstall.js +8 -0
  7. package/dist/rcode.js +19777 -0
  8. package/package.json +18 -5
  9. package/rihal/DOCS-AUDIT.md +14 -0
  10. package/rihal/agents/rihal-code-reviewer.md +1 -1
  11. package/rihal/agents/rihal-codebase-mapper.md +1 -1
  12. package/rihal/agents/rihal-docs-auditor.md +1 -1
  13. package/rihal/agents/rihal-edge-case-hunter.md +1 -1
  14. package/rihal/agents/rihal-executor.md +2 -1
  15. package/rihal/agents/rihal-hussain-pm.md +1 -0
  16. package/rihal/agents/rihal-nyquist-auditor.md +1 -1
  17. package/rihal/agents/rihal-phase-researcher.md +2 -2
  18. package/rihal/agents/rihal-planner.md +3 -2
  19. package/rihal/agents/rihal-roadmapper.md +1 -0
  20. package/rihal/agents/rihal-security-adversary.md +1 -1
  21. package/rihal/agents/rihal-security-auditor.md +1 -1
  22. package/rihal/agents/rihal-sprint-checker.md +1 -1
  23. package/rihal/agents/rihal-verifier.md +1 -1
  24. package/rihal/bin/lib/roadmap.cjs +2 -3
  25. package/rihal/bin/rihal-tools.cjs +11 -31
  26. package/rihal/brain/best-practices/no-theoretical-suggestions.md +56 -0
  27. package/rihal/commands/add-phase.md +2 -2
  28. package/rihal/commands/audit.md +8 -0
  29. package/rihal/commands/checkpoint-preview.md +13 -0
  30. package/rihal/commands/cleanup.md +2 -2
  31. package/rihal/commands/config.md +4 -4
  32. package/rihal/commands/pr-branch.md +2 -2
  33. package/rihal/commands/prfaq.md +15 -0
  34. package/rihal/commands/remove-phase.md +2 -2
  35. package/rihal/commands/research-phase.md +2 -2
  36. package/rihal/commands/settings.md +2 -2
  37. package/rihal/commands/ship.md +15 -3
  38. package/rihal/commands/validate-phase.md +1 -1
  39. package/rihal/commands/verify-phase.md +2 -2
  40. package/rihal/references/agent-contracts.md +12 -0
  41. package/rihal/references/karpathy-guidelines-full.md +79 -0
  42. package/rihal/references/karpathy-guidelines.md +8 -76
  43. package/rihal/references/model-profile-resolution.md +8 -0
  44. package/rihal/references/phase-argument-parsing.md +11 -0
  45. package/rihal/references/revision-loop.md +11 -0
  46. package/rihal/references/universal-anti-patterns.md +15 -0
  47. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/SKILL.md +11 -0
  48. package/rihal/skills/actions/1-analysis/research/rihal-market-research/SKILL.md +11 -0
  49. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/SKILL.md +13 -0
  50. package/rihal/skills/actions/1-analysis/rihal-document-project/SKILL.md +11 -0
  51. package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +12 -0
  52. package/rihal/skills/actions/1-analysis/rihal-product-brief/SKILL.md +7 -0
  53. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +15 -1
  54. package/rihal/skills/actions/2-plan/rihal-create-milestone/SKILL.md +21 -1
  55. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-10-complete.md +1 -1
  56. package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +26 -0
  57. package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +16 -2
  58. package/rihal/skills/actions/2-plan/rihal-create-ux-design/SKILL.md +12 -0
  59. package/rihal/skills/actions/2-plan/rihal-edit-prd/SKILL.md +11 -0
  60. package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +13 -0
  61. package/rihal/skills/actions/2-plan/rihal-validate-prd/SKILL.md +12 -0
  62. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/SKILL.md +12 -0
  63. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/SKILL.md +14 -0
  64. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/SKILL.md +12 -0
  65. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +16 -0
  66. package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +12 -0
  67. package/rihal/skills/actions/4-implementation/rihal-correct-course/SKILL.md +13 -0
  68. package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +12 -0
  69. package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/SKILL.md +12 -0
  70. package/rihal/skills/actions/4-implementation/rihal-retrospective/SKILL.md +11 -0
  71. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/SKILL.md +10 -0
  72. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +14 -1
  73. package/rihal/skills/actions/4-implementation/rihal-sprint-status/SKILL.md +10 -0
  74. package/rihal/skills/agents/ahmed-hassani-director/SKILL.md +13 -1
  75. package/rihal/skills/agents/fatima-qa/SKILL.md +14 -1
  76. package/rihal/skills/agents/haitham-frontend/SKILL.md +15 -1
  77. package/rihal/skills/agents/hanzla-engineer/SKILL.md +14 -1
  78. package/rihal/skills/agents/hussain-pm/SKILL.md +22 -1
  79. package/rihal/skills/agents/hussain-sm/SKILL.md +22 -1
  80. package/rihal/skills/agents/layla-designer/SKILL.md +15 -1
  81. package/rihal/skills/agents/majlis-council/SKILL.md +14 -1
  82. package/rihal/skills/agents/mariam-marketing/SKILL.md +15 -1
  83. package/rihal/skills/agents/nasser-eng-manager/SKILL.md +14 -1
  84. package/rihal/skills/agents/noor-writer/SKILL.md +14 -1
  85. package/rihal/skills/agents/raees-orchestrator/SKILL.md +13 -1
  86. package/rihal/skills/agents/sadiq-analyst/SKILL.md +15 -1
  87. package/rihal/skills/agents/waleed-architect/SKILL.md +16 -1
  88. package/rihal/skills/agents/yousef-backend/SKILL.md +16 -1
  89. package/rihal/skills/agents/zahra-branding/SKILL.md +15 -1
  90. package/rihal/skills/agents/zayd-ml/SKILL.md +17 -1
  91. package/rihal/skills/core/rihal-advanced-elicitation/SKILL.md +12 -0
  92. package/rihal/skills/core/rihal-brainstorming/SKILL.md +16 -0
  93. package/rihal/skills/core/rihal-clone-website/SKILL.md +21 -0
  94. package/rihal/skills/core/rihal-distillator/SKILL.md +8 -0
  95. package/rihal/skills/core/rihal-editorial-review-prose/SKILL.md +12 -0
  96. package/rihal/skills/core/rihal-editorial-review-structure/SKILL.md +18 -0
  97. package/rihal/skills/core/rihal-help/SKILL.md +12 -0
  98. package/rihal/skills/core/rihal-index-docs/SKILL.md +18 -0
  99. package/rihal/skills/core/rihal-init/SKILL.md +8 -0
  100. package/rihal/skills/core/rihal-party-mode/SKILL.md +14 -0
  101. package/rihal/skills/core/rihal-review-adversarial-general/SKILL.md +12 -0
  102. package/rihal/skills/core/rihal-review-edge-case-hunter/SKILL.md +18 -0
  103. package/rihal/skills/core/rihal-shard-doc/SKILL.md +18 -0
  104. package/rihal/team.yaml +205 -0
  105. package/rihal/templates/UAT.md +29 -0
  106. package/rihal/templates/milestone.md +2 -0
  107. package/rihal/templates/sprint.md +11 -28
  108. package/rihal/templates/summary.md +30 -0
  109. package/rihal/templates/verification-report.md +28 -0
  110. package/rihal/workflows/audit-milestone.md +34 -2
  111. package/rihal/workflows/audit.md +172 -0
  112. package/rihal/workflows/autonomous.md +67 -0
  113. package/rihal/workflows/checkpoint-preview.md +7 -0
  114. package/rihal/workflows/council.md +3 -1
  115. package/rihal/workflows/debug.md +8 -1
  116. package/rihal/workflows/diagnose-issues.md +34 -0
  117. package/rihal/workflows/do.md +47 -3
  118. package/rihal/workflows/document-project.md +1 -1
  119. package/rihal/workflows/execute-sprint.md +11 -4
  120. package/rihal/workflows/execute.md +9 -3
  121. package/rihal/workflows/help.md +1 -1
  122. package/rihal/workflows/karpathy-audit.md +7 -14
  123. package/rihal/workflows/pause-work.md +7 -1
  124. package/rihal/workflows/prfaq.md +7 -0
  125. package/rihal/workflows/profile-user.md +2 -2
  126. package/rihal/workflows/settings.md +116 -117
  127. package/rihal/workflows/ship.md +31 -1
  128. package/rihal/workflows/sprint-planning.md +39 -8
  129. package/rihal/workflows/status.md +5 -0
  130. package/rihal/workflows/ui-phase.md +3 -3
  131. package/rihal/workflows/update.md +80 -22
  132. package/rihal/workflows/validate-phase.md +7 -1
  133. package/server/dashboard.js +34 -575
  134. package/server/lib/api.js +123 -0
  135. package/server/lib/html/client.js +969 -0
  136. package/server/lib/html/css.js +416 -0
  137. package/server/lib/html/shell.js +230 -0
  138. package/server/lib/scanner.js +142 -0
  139. package/rihal/agents/rihal-ui-designer.md +0 -6
  140. package/rihal/skills/core/rihal-advanced-elicitation/rihal-advanced-elicitation/SKILL.md +0 -148
  141. package/rihal/skills/core/rihal-advanced-elicitation/rihal-advanced-elicitation/methods.csv +0 -51
  142. package/rihal/skills/core/rihal-shard-doc/rihal-shard-doc/SKILL.md +0 -122
  143. package/rihal/workflows/config.md +0 -105
package/rihal/team.yaml CHANGED
@@ -6,6 +6,7 @@ agents:
6
6
  - id: rihal-sadiq
7
7
  name: Sadiq (صادق)
8
8
  file_path: rihal/agents/rihal-sadiq.md
9
+ skill_path: rihal/skills/agents/sadiq-analyst
9
10
  role: Director of Strategy
10
11
  authority_level: strategic
11
12
  domain_keywords:
@@ -21,6 +22,7 @@ agents:
21
22
  - id: rihal-waleed
22
23
  name: Waleed (وليد)
23
24
  file_path: rihal/agents/rihal-waleed.md
25
+ skill_path: rihal/skills/agents/waleed-architect
24
26
  role: Chief Technology Officer
25
27
  authority_level: technical
26
28
  domain_keywords:
@@ -38,6 +40,7 @@ agents:
38
40
  - id: rihal-fatima
39
41
  name: Fatima (فاطمة)
40
42
  file_path: rihal/agents/rihal-fatima.md
43
+ skill_path: rihal/skills/agents/fatima-qa
41
44
  role: QA Lead
42
45
  authority_level: quality
43
46
  domain_keywords:
@@ -54,6 +57,7 @@ agents:
54
57
  - id: rihal-mariam
55
58
  name: Mariam (مريم)
56
59
  file_path: rihal/agents/rihal-mariam.md
60
+ skill_path: rihal/skills/agents/mariam-marketing
57
61
  role: Marketing & Growth Lead
58
62
  authority_level: growth
59
63
  domain_keywords:
@@ -69,6 +73,7 @@ agents:
69
73
  - id: rihal-hussain-pm
70
74
  name: Hussain (حسين)
71
75
  file_path: rihal/agents/rihal-hussain-pm.md
76
+ skill_path: rihal/skills/agents/hussain-pm
72
77
  role: Product Manager
73
78
  authority_level: product
74
79
  domain_keywords:
@@ -97,6 +102,7 @@ agents:
97
102
  - id: rihal-yousef
98
103
  name: Yousef (يوسف)
99
104
  file_path: rihal/agents/rihal-yousef.md
105
+ skill_path: rihal/skills/agents/yousef-backend
100
106
  role: Senior Backend Engineer
101
107
  authority_level: technical
102
108
  domain_keywords:
@@ -115,6 +121,7 @@ agents:
115
121
  - id: rihal-haitham
116
122
  name: Haitham (هيثم)
117
123
  file_path: rihal/agents/rihal-haitham.md
124
+ skill_path: rihal/skills/agents/haitham-frontend
118
125
  role: Senior Frontend Engineer
119
126
  authority_level: technical
120
127
  domain_keywords:
@@ -132,6 +139,7 @@ agents:
132
139
  - id: rihal-zayd
133
140
  name: Zayd (زيد)
134
141
  file_path: rihal/agents/rihal-zayd.md
142
+ skill_path: rihal/skills/agents/zayd-ml
135
143
  role: Senior ML Engineer
136
144
  authority_level: technical
137
145
  domain_keywords:
@@ -150,6 +158,7 @@ agents:
150
158
  - id: rihal-layla
151
159
  name: Layla (ليلى)
152
160
  file_path: rihal/agents/rihal-layla.md
161
+ skill_path: rihal/skills/agents/layla-designer
153
162
  role: UX Designer
154
163
  authority_level: design
155
164
  domain_keywords:
@@ -166,6 +175,7 @@ agents:
166
175
  - id: rihal-zahra
167
176
  name: Zahra (زهرة)
168
177
  file_path: rihal/agents/rihal-zahra.md
178
+ skill_path: rihal/skills/agents/zahra-branding
169
179
  role: Branding & Creative Director
170
180
  authority_level: design
171
181
  domain_keywords:
@@ -182,6 +192,7 @@ agents:
182
192
  - id: rihal-nasser
183
193
  name: Nasser (ناصر)
184
194
  file_path: rihal/agents/rihal-nasser.md
195
+ skill_path: rihal/skills/agents/nasser-eng-manager
185
196
  role: Software Engineering Manager
186
197
  authority_level: management
187
198
  domain_keywords:
@@ -215,6 +226,7 @@ agents:
215
226
  - id: rihal-noor
216
227
  name: Noor (نور)
217
228
  file_path: rihal/agents/rihal-noor.md
229
+ skill_path: rihal/skills/agents/noor-writer
218
230
  role: Technical Writer & Presentation Lead
219
231
  authority_level: operational
220
232
  domain_keywords:
@@ -231,6 +243,7 @@ agents:
231
243
  - id: rihal-ahmed
232
244
  name: Ahmed Al Hassani (أحمد الحسني)
233
245
  file_path: rihal/agents/rihal-ahmed.md
246
+ skill_path: rihal/skills/agents/ahmed-hassani-director
234
247
  role: Technology & Development Director
235
248
  authority_level: strategic
236
249
  domain_keywords:
@@ -246,6 +259,7 @@ agents:
246
259
  - id: rihal-hanzla
247
260
  name: Hanzla (حنظلة)
248
261
  file_path: rihal/agents/rihal-hanzla.md
262
+ skill_path: rihal/skills/agents/hanzla-engineer
249
263
  role: Senior Full-Stack Engineer
250
264
  authority_level: technical
251
265
  domain_keywords:
@@ -341,3 +355,194 @@ routing:
341
355
  - rihal-hussain-pm # scope
342
356
  - rihal-waleed # feasibility
343
357
  - rihal-sadiq # strategic fit
358
+
359
+ # Tactical / Workflow Agents (spawned by workflows)
360
+ tactical_agents:
361
+ - id: rihal-advisor-researcher
362
+ name: Advisor Researcher
363
+ file_path: rihal/agents/rihal-advisor-researcher.md
364
+ role: Advisor Researcher
365
+ authority_level: research
366
+ description: Advisor-level deep research for gray-area decisions
367
+
368
+ - id: rihal-architect
369
+ name: Architect
370
+ file_path: rihal/agents/rihal-architect.md
371
+ role: Architect
372
+ authority_level: technical
373
+ description: Enterprise architecture and system design reviews
374
+
375
+ - id: rihal-assumptions-analyzer
376
+ name: Assumptions Analyzer
377
+ file_path: rihal/agents/rihal-assumptions-analyzer.md
378
+ role: Assumptions Analyzer
379
+ authority_level: analysis
380
+ description: Analyzes phase assumptions with evidence from codebase
381
+
382
+ - id: rihal-code-fixer
383
+ name: Code Fixer
384
+ file_path: rihal/agents/rihal-code-fixer.md
385
+ role: Code Fixer
386
+ authority_level: implementation
387
+ description: Applies code review findings and implements fixes
388
+
389
+ - id: rihal-code-reviewer
390
+ name: Code Reviewer
391
+ file_path: rihal/agents/rihal-code-reviewer.md
392
+ role: Code Reviewer
393
+ authority_level: quality
394
+ description: Reviews code for bugs, security issues, quality problems
395
+
396
+ - id: rihal-codebase-mapper
397
+ name: Codebase Mapper
398
+ file_path: rihal/agents/rihal-codebase-mapper.md
399
+ role: Codebase Mapper
400
+ authority_level: analysis
401
+ description: Explores and documents codebase architecture
402
+
403
+ - id: rihal-debugger
404
+ name: Debugger
405
+ file_path: rihal/agents/rihal-debugger.md
406
+ role: Debugger
407
+ authority_level: implementation
408
+ description: Investigates bugs using scientific method
409
+
410
+ - id: rihal-deviation-analyzer
411
+ name: Deviation Analyzer
412
+ file_path: rihal/agents/rihal-deviation-analyzer.md
413
+ role: Deviation Analyzer
414
+ authority_level: analysis
415
+ description: Analyzes plan deviations and root causes
416
+
417
+ - id: rihal-docs-auditor
418
+ name: Docs Auditor
419
+ file_path: rihal/agents/rihal-docs-auditor.md
420
+ role: Docs Auditor
421
+ authority_level: quality
422
+ description: Audits documentation completeness and accuracy
423
+
424
+ - id: rihal-edge-case-hunter
425
+ name: Edge Case Hunter
426
+ file_path: rihal/agents/rihal-edge-case-hunter.md
427
+ role: Edge Case Hunter
428
+ authority_level: quality
429
+ description: Enumerates edge cases and boundary conditions
430
+
431
+ - id: rihal-executor
432
+ name: Executor
433
+ file_path: rihal/agents/rihal-executor.md
434
+ role: Executor
435
+ authority_level: implementation
436
+ description: Executes sprint plans with atomic commits
437
+
438
+ - id: rihal-integration-checker
439
+ name: Integration Checker
440
+ file_path: rihal/agents/rihal-integration-checker.md
441
+ role: Integration Checker
442
+ authority_level: quality
443
+ description: Verifies cross-phase integration and E2E flows
444
+
445
+ - id: rihal-nyquist-auditor
446
+ name: Nyquist Auditor
447
+ file_path: rihal/agents/rihal-nyquist-auditor.md
448
+ role: Nyquist Auditor
449
+ authority_level: quality
450
+ description: Fills test coverage gaps for phase requirements
451
+
452
+ - id: rihal-phase-researcher
453
+ name: Phase Researcher
454
+ file_path: rihal/agents/rihal-phase-researcher.md
455
+ role: Phase Researcher
456
+ authority_level: research
457
+ description: Researches how to implement a phase before planning
458
+
459
+ - id: rihal-planner
460
+ name: Planner
461
+ file_path: rihal/agents/rihal-planner.md
462
+ role: Planner
463
+ authority_level: planning
464
+ description: Creates executable phase plans with task breakdown
465
+
466
+ - id: rihal-profiler
467
+ name: Profiler
468
+ file_path: rihal/agents/rihal-profiler.md
469
+ role: Profiler
470
+ authority_level: analysis
471
+ description: Analyzes user behavior patterns and personas
472
+
473
+ - id: rihal-project-researcher
474
+ name: Project Researcher
475
+ file_path: rihal/agents/rihal-project-researcher.md
476
+ role: Project Researcher
477
+ authority_level: research
478
+ description: Researches domain ecosystem before roadmap creation
479
+
480
+ - id: rihal-remediation-planner
481
+ name: Remediation Planner
482
+ file_path: rihal/agents/rihal-remediation-planner.md
483
+ role: Remediation Planner
484
+ authority_level: planning
485
+ description: Plans remediation for issues and blockers
486
+
487
+ - id: rihal-research-synthesizer
488
+ name: Research Synthesizer
489
+ file_path: rihal/agents/rihal-research-synthesizer.md
490
+ role: Research Synthesizer
491
+ authority_level: research
492
+ description: Synthesizes parallel research outputs into summary
493
+
494
+ - id: rihal-roadmapper
495
+ name: Roadmapper
496
+ file_path: rihal/agents/rihal-roadmapper.md
497
+ role: Roadmapper
498
+ authority_level: planning
499
+ description: Creates project roadmaps with phase breakdown
500
+
501
+ - id: rihal-security-adversary
502
+ name: Security Adversary
503
+ file_path: rihal/agents/rihal-security-adversary.md
504
+ role: Security Adversary
505
+ authority_level: security
506
+ description: Adversarial security review and threat modeling
507
+
508
+ - id: rihal-security-auditor
509
+ name: Security Auditor
510
+ file_path: rihal/agents/rihal-security-auditor.md
511
+ role: Security Auditor
512
+ authority_level: security
513
+ description: Comprehensive security audit and compliance verification
514
+
515
+ - id: rihal-sprint-checker
516
+ name: Sprint Checker
517
+ file_path: rihal/agents/rihal-sprint-checker.md
518
+ role: Sprint Checker
519
+ authority_level: quality
520
+ description: Verifies sprint plans before execution
521
+
522
+ - id: rihal-ui-auditor
523
+ name: UI Auditor
524
+ file_path: rihal/agents/rihal-ui-auditor.md
525
+ role: UI Auditor
526
+ authority_level: quality
527
+ description: Audits UI for usability and design quality
528
+
529
+ - id: rihal-ux-designer
530
+ name: UX Designer
531
+ file_path: rihal/agents/rihal-ux-designer.md
532
+ role: UX Designer
533
+ authority_level: design
534
+ description: UX design, accessibility, and design system work
535
+
536
+ - id: rihal-plan-checker
537
+ name: Plan Checker
538
+ file_path: rihal/agents/rihal-sprint-checker.md
539
+ role: Plan Checker
540
+ authority_level: quality
541
+ description: Validates PLAN.md/SPRINT.md quality before execution (alias for sprint-checker)
542
+
543
+ - id: rihal-verifier
544
+ name: Verifier
545
+ file_path: rihal/agents/rihal-verifier.md
546
+ role: Verifier
547
+ authority_level: quality
548
+ description: Verifies phase goal achievement goal-backward
@@ -0,0 +1,29 @@
1
+ # UAT — {{phase_name}}
2
+
3
+ **Phase:** {{phase_id}}
4
+ **Generated:** {{date}}
5
+
6
+ ## How to use
7
+
8
+ For each scenario below, mark status: ✅ pass | ❌ fail | ⏸ skipped |
9
+ 🔍 needs-human. Add notes inline.
10
+
11
+ ## Scenarios
12
+
13
+ ### Scenario 1: {{golden path title}}
14
+
15
+ **Steps:**
16
+ 1. {{action}}
17
+ 2. {{action}}
18
+
19
+ **Expected:** {{outcome}}
20
+ **Status:** ⏸
21
+ **Notes:**
22
+
23
+ ### Scenario 2: {{edge case title}}
24
+
25
+ (Repeat as needed.)
26
+
27
+ ## Outstanding items
28
+
29
+ Items left as ⏸ or 🔍 carry forward to the next milestone audit.
@@ -1,5 +1,7 @@
1
1
  # Milestone Template
2
2
 
3
+ <!-- P2: Omit any section with nothing substantive. Empty sections are noise. Omit STATE.md blockers/workstreams if none active. Omit REQUIREMENTS.md out-of-scope if it doesn't constrain execution. -->
4
+
3
5
  Use this template when starting a new milestone with `/rihal:new-milestone`.
4
6
 
5
7
  ## ROADMAP.md
@@ -1,70 +1,53 @@
1
1
  # Sprint {sprint_id} — {sprint_goal}
2
2
 
3
+ <!-- P2: Omit Dependencies and Risks sections if empty. Omit Retrospective until sprint is complete. -->
4
+
3
5
  **Phase:** {phase_number} — {phase_name}
4
6
  **Status:** {status}
5
7
  **Velocity target:** {velocity_target} points
6
8
  **Started:** {started_at}
7
9
 
8
- ---
9
-
10
10
  ## Sprint Goal
11
11
 
12
12
  {sprint_goal}
13
13
 
14
- ---
15
-
16
14
  ## Stories
17
15
 
18
- | ID | Title | Points | Status | Acceptance |
19
- |----|-------|--------|--------|------------|
20
- | {story_id} | {title} | {points} | {status} | {acceptance} |
21
-
22
- ---
16
+ | ID | Title | Points | Status | Done when |
17
+ |----|-------|--------|--------|-----------|
18
+ | {story_id} | {title} | {points} | {status} | {verifiable_ac} |
23
19
 
24
20
  ## Capacity
25
21
 
26
22
  - **Velocity target:** {velocity_target} points
27
- - **Average velocity (last 3):** {avg_velocity} points
28
23
  - **Total committed:** {total_points} points
29
24
  - **Buffer:** {buffer_points} points ({buffer_pct}%)
30
25
 
31
- ---
32
-
26
+ <!-- Omit if no cross-story dependencies exist -->
33
27
  ## Dependencies
34
28
 
35
29
  | Story | Depends on | Status |
36
30
  |-------|-----------|--------|
37
- | | | |
38
-
39
- ---
40
31
 
32
+ <!-- Omit if no risks identified -->
41
33
  ## Risks
42
34
 
43
35
  | Risk | Impact | Mitigation |
44
36
  |------|--------|------------|
45
- | | | |
46
37
 
47
- ---
48
-
49
- ## Sprint Review Notes
50
-
51
- _Filled at sprint completion._
38
+ ## Sprint Review
52
39
 
40
+ <!-- Fill at sprint completion only — omit this section until then -->
53
41
  - Stories completed: {done_count}/{total_count}
54
42
  - Velocity actual: {velocity_actual} points
55
- - Carryover stories: {carryover}
56
-
57
- ---
43
+ - Carryover: {carryover}
58
44
 
59
45
  ## Retrospective
60
46
 
61
- _Filled at sprint completion._
62
-
47
+ <!-- Fill at sprint completion only — omit this section until then -->
63
48
  ### What went well
64
49
  -
65
-
66
50
  ### What didn't
67
51
  -
68
-
69
52
  ### Action items
70
53
  -
@@ -0,0 +1,30 @@
1
+ # Phase Summary — {{phase_name}}
2
+
3
+ <!-- P2: Omit any section that has nothing substantive to say. An empty section is worse than no section. -->
4
+
5
+ **Phase ID:** {{phase_id}}
6
+ **Closed:** {{closed_at}}
7
+ **Plan:** PLAN.md
8
+
9
+ ## Outcomes
10
+
11
+ - {{what was built, in user-visible terms}}
12
+
13
+ ## Decisions Made
14
+
15
+ <!-- Omit if no decisions were made that aren't already in PLAN.md -->
16
+ - {{key choices and their rationale}}
17
+
18
+ ## Deviations from Plan
19
+
20
+ <!-- Omit if execution matched the plan exactly -->
21
+ - {{anything that diverged from PLAN.md and why}}
22
+
23
+ ## Issues Encountered
24
+
25
+ <!-- Omit if no tasks were pruned, escalated, or skipped -->
26
+ - {{tasks pruned, escalated, or skipped}}
27
+
28
+ ## Hand-off
29
+
30
+ Next phase: {{next phase id and goal}}
@@ -0,0 +1,28 @@
1
+ # Verification Report — {{phase_name}}
2
+
3
+ **Phase:** {{phase_id}}
4
+ **Verified:** {{date}}
5
+ **Verifier:** rihal-verifier
6
+
7
+ ## Goal-backward check
8
+
9
+ **Original goal:** {{phase goal from PLAN.md}}
10
+
11
+ **Met?** ✅ / ◐ partial / ❌ not met
12
+
13
+ **Evidence:**
14
+ - {{file:line or test name proving the goal is met}}
15
+
16
+ ## Per-task verification
17
+
18
+ | # | Task | Status | Evidence |
19
+ |---|------|--------|----------|
20
+ | 1 | {{task}} | ✅ | {{evidence}} |
21
+
22
+ ## Gaps
23
+
24
+ - {{what wasn't delivered + why}}
25
+
26
+ ## Recommendation
27
+
28
+ - proceed / revise / block
@@ -140,13 +140,45 @@ If `--report` flag set, also print the report to stdout. Otherwise, just save to
140
140
 
141
141
  ## On Error
142
142
 
143
- If no SUMMARY.md files found:
143
+ If no SUMMARY.md files found, **do not dead-halt** (closes #234). Probe
144
+ for executed-phase signals and offer recovery options:
144
145
 
146
+ ```bash
147
+ PLANS=$(find "$MILESTONE_DIR" -name PLAN.md 2>/dev/null | wc -l)
148
+ GIT_FEAT=$(git log --oneline --grep='^feat' 2>/dev/null | wc -l)
149
+ APPS=$(ls -d apps packages src 2>/dev/null | wc -l)
145
150
  ```
146
- ⚠ No phase summaries found. Have phases been executed?
151
+
152
+ If `PLANS > 0` AND (`GIT_FEAT > 0` OR `APPS > 0`):
153
+
154
+ ```
155
+ ⚠ {PLANS} phases planned, 0 SUMMARY.md, {GIT_FEAT} feat commits, code present.
156
+ Phases were executed but never formally closed.
157
+
158
+ Options:
159
+ 1. Synthesize SUMMARY.md per phase from PLAN.md + git log [recommended]
160
+ (groups commits by phase tag like "feat(03-1):", writes a
161
+ first-pass SUMMARY.md the user can edit)
162
+ 2. Run /rihal:verify-phase NN per phase (manual close path)
163
+ 3. Continue audit anyway (only assesses what is documented — likely
164
+ reports 0% goal coverage)
165
+ 0. Cancel
166
+ ```
167
+
168
+ In `mode: yolo` (read via `node .rihal/bin/rihal-tools.cjs config-get
169
+ mode`), auto-pick option 1. In guided mode, ask. STOP after the user
170
+ picks 0 or 2; resume audit at Step 4 after option 1 completes.
171
+
172
+ If `PLANS == 0`:
173
+
174
+ ```
175
+ ⚠ No phase summaries and no plans found. Have phases been executed?
147
176
  Check: {MILESTONE_DIR}/phases/
177
+ Start one: /rihal:plan
148
178
  ```
149
179
 
180
+ STOP.
181
+
150
182
  If ROADMAP missing:
151
183
 
152
184
  ```
@@ -0,0 +1,172 @@
1
+ # Workflow: rihal:audit
2
+
3
+ <purpose>
4
+ Single entry point for every kind of audit. Asks the user *what* to audit
5
+ and dispatches to the right sub-workflow. Closes #234 — replaces the prior
6
+ state where users had to know about six separate audit/verify commands by
7
+ name (`audit-milestone`, `audit-uat`, `audit-fix`, `karpathy-audit`,
8
+ `verify-phase`, `verify-work`).
9
+
10
+ Honours `.rihal/config.yaml`: in `mode: yolo`, the router skips the menu
11
+ and auto-picks the most-relevant target based on project state. In
12
+ `mode: guided` (default), it asks.
13
+ </purpose>
14
+
15
+ ## Step 0 — Usage check
16
+
17
+ If `$ARGUMENTS` contains `--help` or `-h`:
18
+
19
+ ```
20
+ /rihal:audit # interactive — asks what to audit
21
+ /rihal:audit phase [<NN>] # → /rihal:verify-phase
22
+ /rihal:audit milestone [--strict] # → /rihal:audit-milestone (with synth fallback)
23
+ /rihal:audit uat # → /rihal:audit-uat
24
+ /rihal:audit code [--scope=...] # → /rihal:karpathy-audit
25
+ /rihal:audit fix # → /rihal:audit-fix
26
+ /rihal:audit work # → /rihal:verify-work
27
+ ```
28
+
29
+ **Examples:**
30
+ ```
31
+ /rihal:audit
32
+ /rihal:audit milestone --strict
33
+ /rihal:audit phase 03
34
+ ```
35
+
36
+ ## Step 1 — Resolve mode + arguments
37
+
38
+ ```bash
39
+ TOOL="node .rihal/bin/rihal-tools.cjs"
40
+ MODE=$($TOOL config-get mode 2>/dev/null || echo "guided")
41
+ DISCUSS=$($TOOL config-get workflow.discuss_mode 2>/dev/null || echo "adaptive")
42
+ ```
43
+
44
+ Parse `$ARGUMENTS`:
45
+ - First word ∈ {phase, milestone, uat, code, fix, work} → set `$TARGET`, drop it from args, jump to Step 4.
46
+ - Empty or unrecognised → continue to Step 2.
47
+
48
+ ## Step 2 — Detect project state
49
+
50
+ Probe what's audit-able right now:
51
+
52
+ ```bash
53
+ ROADMAP=$([ -f .planning/ROADMAP.md ] && echo yes || echo no)
54
+ PHASES=$(ls -d .planning/phases/*/ 2>/dev/null | wc -l)
55
+ PLANS=$(find .planning/phases -name PLAN.md 2>/dev/null | wc -l)
56
+ SUMMARIES=$(find .planning/phases -name SUMMARY.md 2>/dev/null | wc -l)
57
+ UAT_FILES=$(find .planning -name 'UAT*.md' 2>/dev/null | wc -l)
58
+ ON_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
59
+ DIRTY=$([ -n "$(git status --porcelain 2>/dev/null)" ] && echo yes || echo no)
60
+ ```
61
+
62
+ Use these to decide which menu options are *relevant* and which to mark
63
+ as `(no data — skip)`.
64
+
65
+ ## Step 3 — Ask user (guided mode only)
66
+
67
+ If `$MODE` is `yolo`, skip this step and pick the most relevant target
68
+ automatically (priority: `work` if dirty branch, else `phase` if PLANS>0
69
+ and SUMMARIES<PLANS, else `milestone` if SUMMARIES>0, else `code`).
70
+
71
+ Otherwise call AskUserQuestion:
72
+
73
+ ```
74
+ Question:
75
+ What do you want to audit?
76
+
77
+ Options:
78
+ 1. phase — verify a single phase against its PLAN ({PLANS} plans)
79
+ 2. milestone — cross-phase milestone goal coverage ({SUMMARIES} summaries)
80
+ 3. uat — outstanding UAT / verification items ({UAT_FILES} files)
81
+ 4. code-quality — Karpathy 4-principle code review (current diff)
82
+ 5. auto-fix — audit then auto-fix findings (uses #1–4 output)
83
+ 6. work — verify current branch / WIP ({ON_BRANCH}, dirty={DIRTY})
84
+ 0. cancel
85
+ ```
86
+
87
+ Set `$TARGET` from the user's choice.
88
+
89
+ ## Step 4 — Pre-flight per target
90
+
91
+ Each target has a precondition. Fail loudly with the fix step *before*
92
+ dispatching, so the user doesn't get a surprise halt deep inside the
93
+ sub-workflow.
94
+
95
+ | target | precondition | failure message |
96
+ |---|---|---|
97
+ | phase | at least one `.planning/phases/*/PLAN.md` | `No PLAN.md found. Run /rihal:plan first.` |
98
+ | milestone | ROADMAP.md exists | `No ROADMAP.md. Run /rihal:new-milestone first.` |
99
+ | uat | at least one UAT*.md exists | `No UAT files yet. Run /rihal:execute on a phase first.` |
100
+ | code | git repo with at least one commit | `Empty repo — nothing to audit yet.` |
101
+ | fix | a prior audit report exists OR a prior `--report` artefact | `No audit findings yet. Run /rihal:audit first.` |
102
+ | work | inside a git worktree | `Not in a git repo.` |
103
+
104
+ For `milestone` specifically, check the **graceful-degrade** condition
105
+ (closes #234 audit-milestone halt):
106
+
107
+ ```bash
108
+ if [ "$TARGET" = "milestone" ] && [ "$SUMMARIES" -eq 0 ] && [ "$PLANS" -gt 0 ]; then
109
+ # Phases planned but no formal closes — offer to synthesize.
110
+ GIT_FEAT_COMMITS=$(git log --oneline --grep='^feat' 2>/dev/null | wc -l)
111
+ echo "⚠ $PLANS phases planned, 0 SUMMARY.md, $GIT_FEAT_COMMITS feat commits."
112
+ echo " Phases were executed but never formally closed."
113
+ # Offer (yolo: auto-pick 1; guided: ask):
114
+ # 1. Synthesize SUMMARY.md per phase from PLAN.md + git log [recommended]
115
+ # 2. Run /rihal:verify-phase per phase (manual close)
116
+ # 3. Continue audit anyway (will only assess what's documented)
117
+ # 0. Cancel
118
+ fi
119
+ ```
120
+
121
+ In `mode: yolo`, auto-pick option 1: group `git log --oneline` output by
122
+ phase tag (e.g. commits matching `^feat\(0?(\d+)`) and write a first-pass
123
+ `SUMMARY.md` per phase under `.planning/phases/<phase>/SUMMARY.md`
124
+ containing the goal (from PLAN.md), the commit list, and a `# TODO:
125
+ expand outcomes` marker. The user can then refine before re-running the
126
+ audit.
127
+
128
+ A native `phase synthesize-summaries` CLI subcommand is tracked separately
129
+ (see #234 follow-ups) — until it lands, the LLM performs the synthesis
130
+ inline using `git log` + `Read PLAN.md` + `Write SUMMARY.md`.
131
+
132
+ ## Step 5 — Dispatch
133
+
134
+ Run the target's slash command, forwarding remaining args:
135
+
136
+ | target | dispatch |
137
+ |---|---|
138
+ | phase | `/rihal:verify-phase $REST_ARGS` |
139
+ | milestone | `/rihal:audit-milestone $REST_ARGS` |
140
+ | uat | `/rihal:audit-uat $REST_ARGS` |
141
+ | code | `/rihal:karpathy-audit $REST_ARGS` |
142
+ | fix | `/rihal:audit-fix $REST_ARGS` |
143
+ | work | `/rihal:verify-work $REST_ARGS` |
144
+
145
+ ## Step 6 — Closing summary
146
+
147
+ After the sub-workflow returns:
148
+
149
+ ```
150
+ RIHAL ► AUDIT ({TARGET}) ✓
151
+
152
+ Report: {report_path or "(stdout only)"}
153
+ Findings: {count}
154
+
155
+ Next:
156
+ /rihal:audit fix — auto-fix findings classified as auto-fixable
157
+ /rihal:audit code — drill into code-quality issues
158
+ /rihal:settings show — review which audit gates are enabled
159
+ ```
160
+
161
+ ## Success Criteria
162
+
163
+ - [ ] `/rihal:audit` (no args) presents menu in guided mode, auto-picks in yolo
164
+ - [ ] `/rihal:audit milestone` short-circuits the menu
165
+ - [ ] When SUMMARY.md absent but PLAN.md present, milestone offers synthesize/verify/skip — does not dead-halt
166
+ - [ ] Sub-workflow's closing report is surfaced unchanged
167
+
168
+ ## On Error
169
+
170
+ - **Sub-workflow not installed** (slash file missing): `Audit subroute '/rihal:{target}' not found. Run: npx @hanzlaa/rcode install .`
171
+ - **Precondition failed**: print the message from Step 4's table, suggest the unblocking command, STOP.
172
+ - **`.rihal/config.yaml` missing**: treat as `mode: guided`, continue.