@hanzlaa/rcode 2.1.0

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 (676) hide show
  1. package/AGENTS.md +120 -0
  2. package/CLAUDE.md +120 -0
  3. package/CONTRIBUTING.md +298 -0
  4. package/README.md +436 -0
  5. package/cli/config.js +142 -0
  6. package/cli/context.js +213 -0
  7. package/cli/dashboard.js +38 -0
  8. package/cli/digest.js +66 -0
  9. package/cli/doctor.js +283 -0
  10. package/cli/github-sync.js +1016 -0
  11. package/cli/index.js +113 -0
  12. package/cli/install.js +946 -0
  13. package/cli/lib/config.cjs +334 -0
  14. package/cli/lib/fsutil.cjs +76 -0
  15. package/cli/lib/github.cjs +365 -0
  16. package/cli/lib/manifest.cjs +240 -0
  17. package/cli/lib/memory-bank.cjs +348 -0
  18. package/cli/lib/model-profiles.cjs +169 -0
  19. package/cli/lib/prompts.cjs +355 -0
  20. package/cli/postinstall.js +32 -0
  21. package/cli/set-mode.js +94 -0
  22. package/cli/set-profile.js +80 -0
  23. package/cli/show-model.js +82 -0
  24. package/cli/team.js +35 -0
  25. package/cli/tiers.js +49 -0
  26. package/cli/uninstall.js +600 -0
  27. package/cli/update.js +373 -0
  28. package/package.json +60 -0
  29. package/rihal/agents/rihal-advisor-researcher.md +116 -0
  30. package/rihal/agents/rihal-ahmed.md +66 -0
  31. package/rihal/agents/rihal-architect.md +79 -0
  32. package/rihal/agents/rihal-assumptions-analyzer.md +117 -0
  33. package/rihal/agents/rihal-code-fixer.md +74 -0
  34. package/rihal/agents/rihal-code-reviewer.md +75 -0
  35. package/rihal/agents/rihal-codebase-mapper.md +170 -0
  36. package/rihal/agents/rihal-debugger.md +140 -0
  37. package/rihal/agents/rihal-deviation-analyzer.md +74 -0
  38. package/rihal/agents/rihal-docs-auditor.md +77 -0
  39. package/rihal/agents/rihal-edge-case-hunter.md +75 -0
  40. package/rihal/agents/rihal-executor.md +113 -0
  41. package/rihal/agents/rihal-fatima.md +68 -0
  42. package/rihal/agents/rihal-haitham.md +75 -0
  43. package/rihal/agents/rihal-hanzla.md +59 -0
  44. package/rihal/agents/rihal-hussain-pm.md +82 -0
  45. package/rihal/agents/rihal-integration-checker.md +455 -0
  46. package/rihal/agents/rihal-khalid.md +59 -0
  47. package/rihal/agents/rihal-layla.md +57 -0
  48. package/rihal/agents/rihal-mariam.md +58 -0
  49. package/rihal/agents/rihal-nasser.md +57 -0
  50. package/rihal/agents/rihal-noor.md +60 -0
  51. package/rihal/agents/rihal-nyquist-auditor.md +182 -0
  52. package/rihal/agents/rihal-omar.md +57 -0
  53. package/rihal/agents/rihal-phase-researcher.md +84 -0
  54. package/rihal/agents/rihal-planner.md +176 -0
  55. package/rihal/agents/rihal-profiler.md +74 -0
  56. package/rihal/agents/rihal-project-researcher.md +80 -0
  57. package/rihal/agents/rihal-remediation-planner.md +78 -0
  58. package/rihal/agents/rihal-research-synthesizer.md +253 -0
  59. package/rihal/agents/rihal-roadmapper.md +73 -0
  60. package/rihal/agents/rihal-sadiq.md +72 -0
  61. package/rihal/agents/rihal-security-adversary.md +82 -0
  62. package/rihal/agents/rihal-security-auditor.md +78 -0
  63. package/rihal/agents/rihal-sprint-checker.md +124 -0
  64. package/rihal/agents/rihal-tech-writer.md +80 -0
  65. package/rihal/agents/rihal-ui-auditor.md +81 -0
  66. package/rihal/agents/rihal-ui-designer.md +6 -0
  67. package/rihal/agents/rihal-ux-designer.md +83 -0
  68. package/rihal/agents/rihal-verifier.md +124 -0
  69. package/rihal/agents/rihal-waleed.md +60 -0
  70. package/rihal/agents/rihal-yousef.md +78 -0
  71. package/rihal/agents/rihal-zahra.md +62 -0
  72. package/rihal/agents/rihal-zayd.md +78 -0
  73. package/rihal/agents/rules/codebase-mapper/detailed-guide.md +615 -0
  74. package/rihal/agents/rules/debugger/checkpoint-recovery.md +272 -0
  75. package/rihal/agents/rules/debugger/debug-session-state.md +261 -0
  76. package/rihal/agents/rules/debugger/hypothesis-templates.md +330 -0
  77. package/rihal/agents/rules/debugger/investigation-protocol.md +298 -0
  78. package/rihal/agents/rules/debugger/scientific-method.md +317 -0
  79. package/rihal/agents/rules/executor/authentication-gates.md +202 -0
  80. package/rihal/agents/rules/executor/deviation-rules.md +191 -0
  81. package/rihal/agents/rules/executor/execution-flow.md +116 -0
  82. package/rihal/agents/rules/executor/self-check.md +241 -0
  83. package/rihal/agents/rules/executor/stub-detection.md +267 -0
  84. package/rihal/agents/rules/executor/summary-creation.md +76 -0
  85. package/rihal/agents/rules/executor/task-commit-protocol.md +283 -0
  86. package/rihal/agents/rules/executor/tdd-flow.md +294 -0
  87. package/rihal/agents/rules/phase-researcher/detailed-guide.md +628 -0
  88. package/rihal/agents/rules/planner/common-patterns.md +373 -0
  89. package/rihal/agents/rules/planner/dependency-analysis.md +195 -0
  90. package/rihal/agents/rules/planner/goal-backward-thinking.md +220 -0
  91. package/rihal/agents/rules/planner/sprint-verification.md +202 -0
  92. package/rihal/agents/rules/planner/task-templates.md +296 -0
  93. package/rihal/agents/rules/project-researcher/detailed-guide.md +589 -0
  94. package/rihal/agents/rules/roadmapper/detailed-guide.md +620 -0
  95. package/rihal/agents/rules/sprint-checker/dimensions.md +414 -0
  96. package/rihal/agents/rules/sprint-checker/process.md +377 -0
  97. package/rihal/agents/rules/verifier/anti-patterns.md +94 -0
  98. package/rihal/agents/rules/verifier/artifact-verification.md +69 -0
  99. package/rihal/agents/rules/verifier/behavioral-spot-checks.md +49 -0
  100. package/rihal/agents/rules/verifier/context-loading.md +84 -0
  101. package/rihal/agents/rules/verifier/data-flow-trace.md +65 -0
  102. package/rihal/agents/rules/verifier/gap-output.md +51 -0
  103. package/rihal/agents/rules/verifier/key-links.md +56 -0
  104. package/rihal/agents/rules/verifier/requirements-coverage.md +28 -0
  105. package/rihal/agents/rules/verifier/verification-report.md +131 -0
  106. package/rihal/bin/lib/code-references.cjs +196 -0
  107. package/rihal/bin/lib/config.cjs +146 -0
  108. package/rihal/bin/lib/council-panel.cjs +501 -0
  109. package/rihal/bin/lib/roadmap.cjs +256 -0
  110. package/rihal/bin/lib/verify.cjs +118 -0
  111. package/rihal/bin/rihal-hooks.cjs +204 -0
  112. package/rihal/bin/rihal-tools.cjs +3554 -0
  113. package/rihal/brain/README.md +38 -0
  114. package/rihal/brain/best-practices/no-autonomous-bypass.md +37 -0
  115. package/rihal/brain/best-practices/research-citation-rule.md +39 -0
  116. package/rihal/brain/best-practices/state-sync-rule.md +43 -0
  117. package/rihal/brain/sources.yaml +59 -0
  118. package/rihal/commands/add-phase.md +18 -0
  119. package/rihal/commands/add-tests.md +18 -0
  120. package/rihal/commands/add-todo.md +8 -0
  121. package/rihal/commands/analyze-dependencies.md +11 -0
  122. package/rihal/commands/audit-fix.md +14 -0
  123. package/rihal/commands/audit-milestone.md +12 -0
  124. package/rihal/commands/audit-uat.md +18 -0
  125. package/rihal/commands/autonomous.md +19 -0
  126. package/rihal/commands/brainstorm.md +11 -0
  127. package/rihal/commands/chain.md +8 -0
  128. package/rihal/commands/check-implementation-readiness.md +8 -0
  129. package/rihal/commands/check-todos.md +18 -0
  130. package/rihal/commands/cleanup.md +18 -0
  131. package/rihal/commands/code-review-fix.md +14 -0
  132. package/rihal/commands/code-review.md +14 -0
  133. package/rihal/commands/complete-milestone.md +12 -0
  134. package/rihal/commands/config.md +8 -0
  135. package/rihal/commands/correct-course.md +8 -0
  136. package/rihal/commands/council.md +25 -0
  137. package/rihal/commands/create-epics-and-stories.md +8 -0
  138. package/rihal/commands/create-story.md +8 -0
  139. package/rihal/commands/dashboard.md +10 -0
  140. package/rihal/commands/debug.md +8 -0
  141. package/rihal/commands/decisions.md +10 -0
  142. package/rihal/commands/dev-story.md +8 -0
  143. package/rihal/commands/diff.md +10 -0
  144. package/rihal/commands/discuss-phase-power.md +11 -0
  145. package/rihal/commands/discuss-phase.md +19 -0
  146. package/rihal/commands/discuss.md +23 -0
  147. package/rihal/commands/do.md +22 -0
  148. package/rihal/commands/docs-update.md +14 -0
  149. package/rihal/commands/document-project.md +8 -0
  150. package/rihal/commands/enable-hooks.md +11 -0
  151. package/rihal/commands/execute-sprint.md +13 -0
  152. package/rihal/commands/execute.md +19 -0
  153. package/rihal/commands/explore.md +14 -0
  154. package/rihal/commands/export-to-github.md +11 -0
  155. package/rihal/commands/forensics.md +11 -0
  156. package/rihal/commands/from-template.md +11 -0
  157. package/rihal/commands/health.md +10 -0
  158. package/rihal/commands/help.md +8 -0
  159. package/rihal/commands/import.md +12 -0
  160. package/rihal/commands/inbox.md +12 -0
  161. package/rihal/commands/init.md +14 -0
  162. package/rihal/commands/insert-phase.md +11 -0
  163. package/rihal/commands/install.md +10 -0
  164. package/rihal/commands/karpathy-audit.md +12 -0
  165. package/rihal/commands/list-plans.md +11 -0
  166. package/rihal/commands/list-workspaces.md +10 -0
  167. package/rihal/commands/map-codebase.md +14 -0
  168. package/rihal/commands/milestone-summary.md +11 -0
  169. package/rihal/commands/new-milestone.md +12 -0
  170. package/rihal/commands/new-project-research.md +11 -0
  171. package/rihal/commands/new-project-roadmap.md +11 -0
  172. package/rihal/commands/new-project.md +13 -0
  173. package/rihal/commands/new-workspace.md +12 -0
  174. package/rihal/commands/next.md +19 -0
  175. package/rihal/commands/note.md +12 -0
  176. package/rihal/commands/notify-test.md +10 -0
  177. package/rihal/commands/pause-work.md +8 -0
  178. package/rihal/commands/plan-milestone-gaps.md +18 -0
  179. package/rihal/commands/plan.md +19 -0
  180. package/rihal/commands/plant-seed.md +18 -0
  181. package/rihal/commands/pr-branch.md +18 -0
  182. package/rihal/commands/profile-user.md +8 -0
  183. package/rihal/commands/progress.md +19 -0
  184. package/rihal/commands/quick.md +14 -0
  185. package/rihal/commands/remove-phase.md +18 -0
  186. package/rihal/commands/remove-workspace.md +11 -0
  187. package/rihal/commands/replay.md +11 -0
  188. package/rihal/commands/report.md +10 -0
  189. package/rihal/commands/rerun.md +11 -0
  190. package/rihal/commands/research-phase.md +18 -0
  191. package/rihal/commands/resume-work.md +8 -0
  192. package/rihal/commands/review-adversarial.md +8 -0
  193. package/rihal/commands/review-edge-case-hunter.md +8 -0
  194. package/rihal/commands/review.md +18 -0
  195. package/rihal/commands/scan.md +14 -0
  196. package/rihal/commands/secure-phase.md +14 -0
  197. package/rihal/commands/session-report.md +10 -0
  198. package/rihal/commands/settings.md +8 -0
  199. package/rihal/commands/ship.md +18 -0
  200. package/rihal/commands/show.md +10 -0
  201. package/rihal/commands/sprint-planning.md +20 -0
  202. package/rihal/commands/sprint-status.md +21 -0
  203. package/rihal/commands/stats.md +10 -0
  204. package/rihal/commands/status.md +21 -0
  205. package/rihal/commands/ui-phase.md +8 -0
  206. package/rihal/commands/ui-review.md +8 -0
  207. package/rihal/commands/undo.md +14 -0
  208. package/rihal/commands/update.md +11 -0
  209. package/rihal/commands/validate-phase.md +18 -0
  210. package/rihal/commands/verify-phase.md +18 -0
  211. package/rihal/commands/verify-work.md +19 -0
  212. package/rihal/commands/why.md +10 -0
  213. package/rihal/commands/workstream.md +11 -0
  214. package/rihal/config/model-profiles.json +226 -0
  215. package/rihal/config/model-profiles.schema.json +36 -0
  216. package/rihal/config.yaml +39 -0
  217. package/rihal/digests/README.md +50 -0
  218. package/rihal/digests/fatima.md +24 -0
  219. package/rihal/digests/hussain-pm.md +24 -0
  220. package/rihal/digests/mariam.md +24 -0
  221. package/rihal/digests/sadiq.md +24 -0
  222. package/rihal/digests/waleed.md +24 -0
  223. package/rihal/modules/core.yaml +101 -0
  224. package/rihal/modules/discovery.yaml +50 -0
  225. package/rihal/modules/execution.yaml +66 -0
  226. package/rihal/references/brain-methods.csv +9 -0
  227. package/rihal/references/checklist-architect.md +146 -0
  228. package/rihal/references/checklist-change.md +136 -0
  229. package/rihal/references/checklist-pm.md +154 -0
  230. package/rihal/references/checklist-po-master.md +100 -0
  231. package/rihal/references/checklist-story-dod.md +75 -0
  232. package/rihal/references/checklist-story-draft.md +53 -0
  233. package/rihal/references/checkpoints-index.md +53 -0
  234. package/rihal/references/checkpoints.md +778 -0
  235. package/rihal/references/codebase-grounding.md +76 -0
  236. package/rihal/references/command-redirect-format.md +62 -0
  237. package/rihal/references/commit-conventions.md +125 -0
  238. package/rihal/references/common-bug-patterns-index.md +44 -0
  239. package/rihal/references/common-bug-patterns.md +621 -0
  240. package/rihal/references/context-budget.md +104 -0
  241. package/rihal/references/continuation-format.md +249 -0
  242. package/rihal/references/council-protocol.md +91 -0
  243. package/rihal/references/domain-probes.md +213 -0
  244. package/rihal/references/elicitation-methods.csv +16 -0
  245. package/rihal/references/execution-protocol.md +155 -0
  246. package/rihal/references/gate-prompts.md +212 -0
  247. package/rihal/references/gates.md +127 -0
  248. package/rihal/references/git-integration.md +159 -0
  249. package/rihal/references/git-planning-commit.md +185 -0
  250. package/rihal/references/karpathy-guidelines.md +79 -0
  251. package/rihal/references/model-profiles.md +90 -0
  252. package/rihal/references/no-unauthorized-git-ops.md +73 -0
  253. package/rihal/references/output-format.md +319 -0
  254. package/rihal/references/output-realism.md +52 -0
  255. package/rihal/references/project-types.yaml +270 -0
  256. package/rihal/references/questioning.md +163 -0
  257. package/rihal/references/response-style.md +81 -0
  258. package/rihal/references/state-schema.md +366 -0
  259. package/rihal/references/tdd.md +263 -0
  260. package/rihal/references/thinking-models-debug.md +126 -0
  261. package/rihal/references/thinking-models-planning.md +127 -0
  262. package/rihal/references/ui-brand.md +254 -0
  263. package/rihal/references/verification-patterns-index.md +76 -0
  264. package/rihal/references/verification-patterns.md +612 -0
  265. package/rihal/references/workstream-flag.md +166 -0
  266. package/rihal/skills/SKILLS_INDEX.md +114 -0
  267. package/rihal/skills/_shared/no-autonomous-bypass.md +37 -0
  268. package/rihal/skills/_shared/research-citation-rule.md +39 -0
  269. package/rihal/skills/_shared/state-sync-rule.md +43 -0
  270. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/SKILL.md +31 -0
  271. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/domain-steps/step-01-init.md +137 -0
  272. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/domain-steps/step-02-domain-analysis.md +229 -0
  273. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/domain-steps/step-03-competitive-landscape.md +238 -0
  274. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/domain-steps/step-04-regulatory-focus.md +206 -0
  275. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/domain-steps/step-05-technical-trends.md +234 -0
  276. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/domain-steps/step-06-research-synthesis.md +444 -0
  277. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/research.template.md +29 -0
  278. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/workflow.md +49 -0
  279. package/rihal/skills/actions/1-analysis/research/rihal-market-research/SKILL.md +30 -0
  280. package/rihal/skills/actions/1-analysis/research/rihal-market-research/research.template.md +29 -0
  281. package/rihal/skills/actions/1-analysis/research/rihal-market-research/steps/step-01-init.md +184 -0
  282. package/rihal/skills/actions/1-analysis/research/rihal-market-research/steps/step-02-customer-behavior.md +239 -0
  283. package/rihal/skills/actions/1-analysis/research/rihal-market-research/steps/step-03-customer-pain-points.md +251 -0
  284. package/rihal/skills/actions/1-analysis/research/rihal-market-research/steps/step-04-customer-decisions.md +261 -0
  285. package/rihal/skills/actions/1-analysis/research/rihal-market-research/steps/step-05-competitive-analysis.md +173 -0
  286. package/rihal/skills/actions/1-analysis/research/rihal-market-research/steps/step-06-research-completion.md +478 -0
  287. package/rihal/skills/actions/1-analysis/research/rihal-market-research/workflow.md +49 -0
  288. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/SKILL.md +31 -0
  289. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/research.template.md +29 -0
  290. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/technical-steps/step-01-init.md +137 -0
  291. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/technical-steps/step-02-technical-overview.md +239 -0
  292. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/technical-steps/step-03-integration-patterns.md +248 -0
  293. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/technical-steps/step-04-architectural-patterns.md +202 -0
  294. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/technical-steps/step-05-implementation-research.md +233 -0
  295. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/technical-steps/step-06-research-synthesis.md +487 -0
  296. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/workflow.md +50 -0
  297. package/rihal/skills/actions/1-analysis/rihal-document-project/SKILL.md +30 -0
  298. package/rihal/skills/actions/1-analysis/rihal-document-project/checklist.md +245 -0
  299. package/rihal/skills/actions/1-analysis/rihal-document-project/documentation-requirements.csv +12 -0
  300. package/rihal/skills/actions/1-analysis/rihal-document-project/instructions.md +128 -0
  301. package/rihal/skills/actions/1-analysis/rihal-document-project/templates/deep-dive-template.md +345 -0
  302. package/rihal/skills/actions/1-analysis/rihal-document-project/templates/index-template.md +169 -0
  303. package/rihal/skills/actions/1-analysis/rihal-document-project/templates/project-overview-template.md +103 -0
  304. package/rihal/skills/actions/1-analysis/rihal-document-project/templates/project-scan-report-schema.json +160 -0
  305. package/rihal/skills/actions/1-analysis/rihal-document-project/templates/source-tree-template.md +135 -0
  306. package/rihal/skills/actions/1-analysis/rihal-document-project/workflow.md +27 -0
  307. package/rihal/skills/actions/1-analysis/rihal-document-project/workflows/deep-dive-instructions.md +299 -0
  308. package/rihal/skills/actions/1-analysis/rihal-document-project/workflows/deep-dive-workflow.md +34 -0
  309. package/rihal/skills/actions/1-analysis/rihal-document-project/workflows/full-scan-instructions.md +1107 -0
  310. package/rihal/skills/actions/1-analysis/rihal-document-project/workflows/full-scan-workflow.md +34 -0
  311. package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +120 -0
  312. package/rihal/skills/actions/1-analysis/rihal-prfaq/agents/artifact-analyzer.md +60 -0
  313. package/rihal/skills/actions/1-analysis/rihal-prfaq/agents/web-researcher.md +49 -0
  314. package/rihal/skills/actions/1-analysis/rihal-prfaq/assets/prfaq-template.md +62 -0
  315. package/rihal/skills/actions/1-analysis/rihal-prfaq/references/customer-faq.md +55 -0
  316. package/rihal/skills/actions/1-analysis/rihal-prfaq/references/internal-faq.md +51 -0
  317. package/rihal/skills/actions/1-analysis/rihal-prfaq/references/press-release.md +60 -0
  318. package/rihal/skills/actions/1-analysis/rihal-prfaq/references/verdict.md +79 -0
  319. package/rihal/skills/actions/1-analysis/rihal-prfaq/rihal-manifest.json +16 -0
  320. package/rihal/skills/actions/1-analysis/rihal-product-brief/SKILL.md +112 -0
  321. package/rihal/skills/actions/1-analysis/rihal-product-brief/agents/artifact-analyzer.md +60 -0
  322. package/rihal/skills/actions/1-analysis/rihal-product-brief/agents/opportunity-reviewer.md +44 -0
  323. package/rihal/skills/actions/1-analysis/rihal-product-brief/agents/skeptic-reviewer.md +44 -0
  324. package/rihal/skills/actions/1-analysis/rihal-product-brief/agents/web-researcher.md +49 -0
  325. package/rihal/skills/actions/1-analysis/rihal-product-brief/prompts/contextual-discovery.md +57 -0
  326. package/rihal/skills/actions/1-analysis/rihal-product-brief/prompts/draft-and-review.md +86 -0
  327. package/rihal/skills/actions/1-analysis/rihal-product-brief/prompts/finalize.md +75 -0
  328. package/rihal/skills/actions/1-analysis/rihal-product-brief/prompts/guided-elicitation.md +70 -0
  329. package/rihal/skills/actions/1-analysis/rihal-product-brief/resources/brief-template.md +60 -0
  330. package/rihal/skills/actions/1-analysis/rihal-product-brief/rihal-manifest.json +17 -0
  331. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +30 -0
  332. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/steps/step-01-validate-prerequisites.md +255 -0
  333. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/steps/step-02-design-epics.md +212 -0
  334. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/steps/step-03-create-stories.md +255 -0
  335. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/steps/step-04-final-validation.md +131 -0
  336. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/templates/epics-template.md +61 -0
  337. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/workflow.md +54 -0
  338. package/rihal/skills/actions/2-plan/rihal-create-milestone/SKILL.md +39 -0
  339. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/README.md +30 -0
  340. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-01-init.md +62 -0
  341. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-02-outcomes.md +64 -0
  342. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-03-sequencing.md +65 -0
  343. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-04-windows.md +60 -0
  344. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-05-kill-criteria.md +59 -0
  345. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-06-phase-stubs.md +56 -0
  346. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-07-backlog.md +44 -0
  347. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-08-write-roadmap.md +58 -0
  348. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-09-state-sync.md +62 -0
  349. package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-10-complete.md +56 -0
  350. package/rihal/skills/actions/2-plan/rihal-create-milestone/workflow.md +93 -0
  351. package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +40 -0
  352. package/rihal/skills/actions/2-plan/rihal-create-prd/data/domain-complexity.csv +15 -0
  353. package/rihal/skills/actions/2-plan/rihal-create-prd/data/prd-purpose.md +197 -0
  354. package/rihal/skills/actions/2-plan/rihal-create-prd/data/project-types.csv +11 -0
  355. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-01-init.md +178 -0
  356. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-01b-continue.md +161 -0
  357. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-02-discovery.md +208 -0
  358. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-02b-vision.md +142 -0
  359. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-02c-executive-summary.md +158 -0
  360. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-03-success.md +214 -0
  361. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-04-journeys.md +201 -0
  362. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-05-domain.md +194 -0
  363. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-06-innovation.md +211 -0
  364. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-07-project-type.md +222 -0
  365. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-08-scoping.md +216 -0
  366. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-09-functional.md +219 -0
  367. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-10-nonfunctional.md +230 -0
  368. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-11-polish.md +221 -0
  369. package/rihal/skills/actions/2-plan/rihal-create-prd/steps-c/step-12-complete.md +115 -0
  370. package/rihal/skills/actions/2-plan/rihal-create-prd/templates/prd-template.md +10 -0
  371. package/rihal/skills/actions/2-plan/rihal-create-prd/workflow.md +64 -0
  372. package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +31 -0
  373. package/rihal/skills/actions/2-plan/rihal-create-story/checklist.md +357 -0
  374. package/rihal/skills/actions/2-plan/rihal-create-story/discover-inputs.md +88 -0
  375. package/rihal/skills/actions/2-plan/rihal-create-story/template.md +49 -0
  376. package/rihal/skills/actions/2-plan/rihal-create-story/workflow.md +380 -0
  377. package/rihal/skills/actions/2-plan/rihal-create-ux-design/SKILL.md +31 -0
  378. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-01-init.md +135 -0
  379. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-01b-continue.md +127 -0
  380. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-02-discovery.md +190 -0
  381. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-03-core-experience.md +217 -0
  382. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-04-emotional-response.md +220 -0
  383. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-05-inspiration.md +235 -0
  384. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-06-design-system.md +253 -0
  385. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-07-defining-experience.md +255 -0
  386. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-08-visual-foundation.md +225 -0
  387. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-09-design-directions.md +225 -0
  388. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-10-user-journeys.md +242 -0
  389. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-11-component-strategy.md +249 -0
  390. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-12-ux-patterns.md +238 -0
  391. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-13-responsive-accessibility.md +265 -0
  392. package/rihal/skills/actions/2-plan/rihal-create-ux-design/steps/step-14-complete.md +171 -0
  393. package/rihal/skills/actions/2-plan/rihal-create-ux-design/ux-design-template.md +13 -0
  394. package/rihal/skills/actions/2-plan/rihal-create-ux-design/workflow.md +36 -0
  395. package/rihal/skills/actions/2-plan/rihal-edit-prd/SKILL.md +30 -0
  396. package/rihal/skills/actions/2-plan/rihal-edit-prd/steps-e/step-e-01-discovery.md +242 -0
  397. package/rihal/skills/actions/2-plan/rihal-edit-prd/steps-e/step-e-01b-legacy-conversion.md +204 -0
  398. package/rihal/skills/actions/2-plan/rihal-edit-prd/steps-e/step-e-02-review.md +245 -0
  399. package/rihal/skills/actions/2-plan/rihal-edit-prd/steps-e/step-e-03-edit.md +250 -0
  400. package/rihal/skills/actions/2-plan/rihal-edit-prd/steps-e/step-e-04-complete.md +165 -0
  401. package/rihal/skills/actions/2-plan/rihal-edit-prd/workflow.md +63 -0
  402. package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +169 -0
  403. package/rihal/skills/actions/2-plan/rihal-validate-prd/SKILL.md +29 -0
  404. package/rihal/skills/actions/2-plan/rihal-validate-prd/data/domain-complexity.csv +15 -0
  405. package/rihal/skills/actions/2-plan/rihal-validate-prd/data/prd-purpose.md +197 -0
  406. package/rihal/skills/actions/2-plan/rihal-validate-prd/data/project-types.csv +11 -0
  407. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-01-discovery.md +221 -0
  408. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-02-format-detection.md +188 -0
  409. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-02b-parity-check.md +206 -0
  410. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-03-density-validation.md +171 -0
  411. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-04-brief-coverage-validation.md +211 -0
  412. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-05-measurability-validation.md +225 -0
  413. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-06-traceability-validation.md +214 -0
  414. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-07-implementation-leakage-validation.md +202 -0
  415. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-08-domain-compliance-validation.md +240 -0
  416. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-09-project-type-validation.md +260 -0
  417. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-10-smart-validation.md +206 -0
  418. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-11-holistic-quality-validation.md +261 -0
  419. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-12-completeness-validation.md +239 -0
  420. package/rihal/skills/actions/2-plan/rihal-validate-prd/steps-v/step-v-13-report-complete.md +229 -0
  421. package/rihal/skills/actions/2-plan/rihal-validate-prd/workflow.md +62 -0
  422. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/SKILL.md +30 -0
  423. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/steps/step-01-document-discovery.md +179 -0
  424. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/steps/step-02-prd-analysis.md +168 -0
  425. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/steps/step-03-epic-coverage-validation.md +169 -0
  426. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/steps/step-04-ux-alignment.md +129 -0
  427. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/steps/step-05-epic-quality-review.md +241 -0
  428. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/steps/step-06-final-assessment.md +126 -0
  429. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/templates/readiness-report-template.md +4 -0
  430. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/workflow.md +49 -0
  431. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/SKILL.md +32 -0
  432. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/architecture-decision-template.md +12 -0
  433. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/data/domain-complexity.csv +13 -0
  434. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/data/project-types.csv +7 -0
  435. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/steps/step-01-init.md +153 -0
  436. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/steps/step-01b-continue.md +173 -0
  437. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/steps/step-02-context.md +224 -0
  438. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/steps/step-03-starter.md +329 -0
  439. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/steps/step-04-decisions.md +318 -0
  440. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/steps/step-05-patterns.md +359 -0
  441. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/steps/step-06-structure.md +379 -0
  442. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/steps/step-07-validation.md +359 -0
  443. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/steps/step-08-complete.md +76 -0
  444. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/workflow.md +38 -0
  445. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/SKILL.md +31 -0
  446. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/project-context-template.md +21 -0
  447. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/steps/step-01-discover.md +186 -0
  448. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/steps/step-02-generate.md +321 -0
  449. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/steps/step-03-complete.md +278 -0
  450. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/workflow.md +43 -0
  451. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +48 -0
  452. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/generate-trail.md +38 -0
  453. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/step-01-orientation.md +105 -0
  454. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/step-02-walkthrough.md +89 -0
  455. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/step-03-detail-pass.md +106 -0
  456. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/step-04-testing.md +74 -0
  457. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/step-05-wrapup.md +24 -0
  458. package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +31 -0
  459. package/rihal/skills/actions/4-implementation/rihal-code-review/steps/step-01-gather-context.md +62 -0
  460. package/rihal/skills/actions/4-implementation/rihal-code-review/steps/step-02-review.md +34 -0
  461. package/rihal/skills/actions/4-implementation/rihal-code-review/steps/step-03-triage.md +49 -0
  462. package/rihal/skills/actions/4-implementation/rihal-code-review/steps/step-04-present.md +129 -0
  463. package/rihal/skills/actions/4-implementation/rihal-code-review/workflow.md +55 -0
  464. package/rihal/skills/actions/4-implementation/rihal-correct-course/SKILL.md +29 -0
  465. package/rihal/skills/actions/4-implementation/rihal-correct-course/checklist.md +288 -0
  466. package/rihal/skills/actions/4-implementation/rihal-correct-course/workflow.md +267 -0
  467. package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +36 -0
  468. package/rihal/skills/actions/4-implementation/rihal-dev-story/checklist.md +80 -0
  469. package/rihal/skills/actions/4-implementation/rihal-dev-story/workflow.md +450 -0
  470. package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/SKILL.md +31 -0
  471. package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/checklist.md +33 -0
  472. package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/workflow.md +136 -0
  473. package/rihal/skills/actions/4-implementation/rihal-retrospective/SKILL.md +30 -0
  474. package/rihal/skills/actions/4-implementation/rihal-retrospective/workflow.md +1479 -0
  475. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/SKILL.md +77 -0
  476. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/steps/step-01-target.md +17 -0
  477. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/steps/step-02-safety.md +35 -0
  478. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/steps/step-03-clone.md +50 -0
  479. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/steps/step-04-post-setup.md +44 -0
  480. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +35 -0
  481. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/checklist.md +43 -0
  482. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/sprint-status-template.yaml +56 -0
  483. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/workflow.md +284 -0
  484. package/rihal/skills/actions/4-implementation/rihal-sprint-status/SKILL.md +30 -0
  485. package/rihal/skills/actions/4-implementation/rihal-sprint-status/workflow.md +261 -0
  486. package/rihal/skills/agents/ahmed-hassani-director/SKILL.md +121 -0
  487. package/rihal/skills/agents/fatima-qa/SKILL.md +106 -0
  488. package/rihal/skills/agents/fatima-qa/skill-manifest.yaml +11 -0
  489. package/rihal/skills/agents/haitham-frontend/SKILL.md +120 -0
  490. package/rihal/skills/agents/hanzla-engineer/SKILL.md +109 -0
  491. package/rihal/skills/agents/hanzla-engineer/skill-manifest.yaml +11 -0
  492. package/rihal/skills/agents/hussain-pm/SKILL.md +107 -0
  493. package/rihal/skills/agents/hussain-pm/skill-manifest.yaml +11 -0
  494. package/rihal/skills/agents/hussain-sm/SKILL.md +104 -0
  495. package/rihal/skills/agents/hussain-sm/skill-manifest.yaml +11 -0
  496. package/rihal/skills/agents/layla-designer/SKILL.md +96 -0
  497. package/rihal/skills/agents/layla-designer/skill-manifest.yaml +11 -0
  498. package/rihal/skills/agents/majlis-council/SKILL.md +179 -0
  499. package/rihal/skills/agents/mariam-marketing/SKILL.md +133 -0
  500. package/rihal/skills/agents/nasser-eng-manager/SKILL.md +125 -0
  501. package/rihal/skills/agents/noor-writer/SKILL.md +104 -0
  502. package/rihal/skills/agents/noor-writer/explain-concept.md +20 -0
  503. package/rihal/skills/agents/noor-writer/mermaid-gen.md +20 -0
  504. package/rihal/skills/agents/noor-writer/skill-manifest.yaml +11 -0
  505. package/rihal/skills/agents/noor-writer/validate-doc.md +19 -0
  506. package/rihal/skills/agents/noor-writer/write-document.md +20 -0
  507. package/rihal/skills/agents/raees-orchestrator/SKILL.md +154 -0
  508. package/rihal/skills/agents/sadiq-analyst/SKILL.md +106 -0
  509. package/rihal/skills/agents/sadiq-analyst/skill-manifest.yaml +11 -0
  510. package/rihal/skills/agents/waleed-architect/SKILL.md +106 -0
  511. package/rihal/skills/agents/waleed-architect/skill-manifest.yaml +11 -0
  512. package/rihal/skills/agents/yousef-backend/SKILL.md +136 -0
  513. package/rihal/skills/agents/zahra-branding/SKILL.md +141 -0
  514. package/rihal/skills/agents/zayd-ml/SKILL.md +124 -0
  515. package/rihal/skills/core/module-help.csv +11 -0
  516. package/rihal/skills/core/module.yaml +25 -0
  517. package/rihal/skills/core/rihal-advanced-elicitation/SKILL.md +155 -0
  518. package/rihal/skills/core/rihal-advanced-elicitation/methods.csv +51 -0
  519. package/rihal/skills/core/rihal-advanced-elicitation/rihal-advanced-elicitation/SKILL.md +148 -0
  520. package/rihal/skills/core/rihal-advanced-elicitation/rihal-advanced-elicitation/methods.csv +51 -0
  521. package/rihal/skills/core/rihal-brainstorming/SKILL.md +82 -0
  522. package/rihal/skills/core/rihal-brainstorming/brain-methods.csv +62 -0
  523. package/rihal/skills/core/rihal-brainstorming/steps/step-01-session-setup.md +214 -0
  524. package/rihal/skills/core/rihal-brainstorming/steps/step-01b-continue.md +124 -0
  525. package/rihal/skills/core/rihal-brainstorming/steps/step-02a-user-selected.md +229 -0
  526. package/rihal/skills/core/rihal-brainstorming/steps/step-02b-ai-recommended.md +239 -0
  527. package/rihal/skills/core/rihal-brainstorming/steps/step-02c-random-selection.md +211 -0
  528. package/rihal/skills/core/rihal-brainstorming/steps/step-02d-progressive-flow.md +266 -0
  529. package/rihal/skills/core/rihal-brainstorming/steps/step-03-technique-execution.md +401 -0
  530. package/rihal/skills/core/rihal-brainstorming/steps/step-04-idea-organization.md +305 -0
  531. package/rihal/skills/core/rihal-brainstorming/template.md +15 -0
  532. package/rihal/skills/core/rihal-brainstorming/workflow.md +53 -0
  533. package/rihal/skills/core/rihal-clone-website/SKILL.md +395 -0
  534. package/rihal/skills/core/rihal-distillator/SKILL.md +205 -0
  535. package/rihal/skills/core/rihal-distillator/agents/distillate-compressor.md +116 -0
  536. package/rihal/skills/core/rihal-distillator/agents/round-trip-reconstructor.md +68 -0
  537. package/rihal/skills/core/rihal-distillator/resources/compression-rules.md +51 -0
  538. package/rihal/skills/core/rihal-distillator/resources/distillate-format-reference.md +227 -0
  539. package/rihal/skills/core/rihal-distillator/resources/splitting-strategy.md +78 -0
  540. package/rihal/skills/core/rihal-distillator/scripts/analyze_sources.py +300 -0
  541. package/rihal/skills/core/rihal-distillator/scripts/tests/test_analyze_sources.py +204 -0
  542. package/rihal/skills/core/rihal-editorial-review-prose/SKILL.md +108 -0
  543. package/rihal/skills/core/rihal-editorial-review-structure/SKILL.md +193 -0
  544. package/rihal/skills/core/rihal-help/SKILL.md +91 -0
  545. package/rihal/skills/core/rihal-index-docs/SKILL.md +80 -0
  546. package/rihal/skills/core/rihal-init/SKILL.md +119 -0
  547. package/rihal/skills/core/rihal-init/resources/core-module.yaml +25 -0
  548. package/rihal/skills/core/rihal-init/scripts/rihal_init.py +593 -0
  549. package/rihal/skills/core/rihal-init/scripts/tests/test_rihal_init.py +329 -0
  550. package/rihal/skills/core/rihal-party-mode/SKILL.md +77 -0
  551. package/rihal/skills/core/rihal-party-mode/steps/step-01-agent-loading.md +138 -0
  552. package/rihal/skills/core/rihal-party-mode/steps/step-02-discussion-orchestration.md +187 -0
  553. package/rihal/skills/core/rihal-party-mode/steps/step-03-graceful-exit.md +167 -0
  554. package/rihal/skills/core/rihal-party-mode/workflow.md +190 -0
  555. package/rihal/skills/core/rihal-review-adversarial-general/SKILL.md +55 -0
  556. package/rihal/skills/core/rihal-review-edge-case-hunter/SKILL.md +81 -0
  557. package/rihal/skills/core/rihal-shard-doc/SKILL.md +119 -0
  558. package/rihal/skills/core/rihal-shard-doc/rihal-shard-doc/SKILL.md +122 -0
  559. package/rihal/team.yaml +343 -0
  560. package/rihal/templates/UI-SPEC.md +127 -0
  561. package/rihal/templates/documentation-requirements.csv +11 -0
  562. package/rihal/templates/github/bug-template.md +53 -0
  563. package/rihal/templates/github/epic-template.md +57 -0
  564. package/rihal/templates/github/feature-template.md +55 -0
  565. package/rihal/templates/github/task-template.md +52 -0
  566. package/rihal/templates/milestone.md +147 -0
  567. package/rihal/templates/projects/api-backend/PROJECT.md +37 -0
  568. package/rihal/templates/projects/api-backend/REQUIREMENTS.md +38 -0
  569. package/rihal/templates/projects/api-backend/ROADMAP.md +92 -0
  570. package/rihal/templates/projects/api-backend/template.yaml +17 -0
  571. package/rihal/templates/projects/mobile-app/PROJECT.md +37 -0
  572. package/rihal/templates/projects/mobile-app/REQUIREMENTS.md +32 -0
  573. package/rihal/templates/projects/mobile-app/ROADMAP.md +93 -0
  574. package/rihal/templates/projects/mobile-app/template.yaml +17 -0
  575. package/rihal/templates/projects/saas-b2b/PROJECT.md +40 -0
  576. package/rihal/templates/projects/saas-b2b/REQUIREMENTS.md +38 -0
  577. package/rihal/templates/projects/saas-b2b/ROADMAP.md +95 -0
  578. package/rihal/templates/projects/saas-b2b/template.yaml +18 -0
  579. package/rihal/templates/settings-hooks.json +36 -0
  580. package/rihal/templates/sprint.md +70 -0
  581. package/rihal/workflows/add-phase.md +112 -0
  582. package/rihal/workflows/add-tests.md +351 -0
  583. package/rihal/workflows/add-todo.md +181 -0
  584. package/rihal/workflows/analyze-dependencies.md +138 -0
  585. package/rihal/workflows/audit-fix.md +190 -0
  586. package/rihal/workflows/audit-milestone.md +155 -0
  587. package/rihal/workflows/audit-uat.md +109 -0
  588. package/rihal/workflows/autonomous.md +992 -0
  589. package/rihal/workflows/brainstorm.md +203 -0
  590. package/rihal/workflows/chain.md +188 -0
  591. package/rihal/workflows/check-implementation-readiness.md +193 -0
  592. package/rihal/workflows/check-todos.md +177 -0
  593. package/rihal/workflows/cleanup.md +152 -0
  594. package/rihal/workflows/code-review-fix.md +529 -0
  595. package/rihal/workflows/code-review.md +566 -0
  596. package/rihal/workflows/complete-milestone.md +836 -0
  597. package/rihal/workflows/config.md +105 -0
  598. package/rihal/workflows/correct-course.md +190 -0
  599. package/rihal/workflows/council.md +565 -0
  600. package/rihal/workflows/create-epics-and-stories.md +373 -0
  601. package/rihal/workflows/create-story.md +297 -0
  602. package/rihal/workflows/dashboard.md +102 -0
  603. package/rihal/workflows/debug.md +256 -0
  604. package/rihal/workflows/decisions.md +107 -0
  605. package/rihal/workflows/dev-story.md +432 -0
  606. package/rihal/workflows/diff.md +74 -0
  607. package/rihal/workflows/discuss-phase-power.md +325 -0
  608. package/rihal/workflows/discuss-phase.md +1201 -0
  609. package/rihal/workflows/discuss.md +227 -0
  610. package/rihal/workflows/do.md +175 -0
  611. package/rihal/workflows/docs-update.md +261 -0
  612. package/rihal/workflows/document-project.md +180 -0
  613. package/rihal/workflows/enable-hooks.md +102 -0
  614. package/rihal/workflows/execute-sprint.md +514 -0
  615. package/rihal/workflows/execute.md +1478 -0
  616. package/rihal/workflows/explore.md +171 -0
  617. package/rihal/workflows/export-to-github.md +174 -0
  618. package/rihal/workflows/forensics.md +201 -0
  619. package/rihal/workflows/from-template.md +173 -0
  620. package/rihal/workflows/health.md +194 -0
  621. package/rihal/workflows/help.md +318 -0
  622. package/rihal/workflows/import.md +306 -0
  623. package/rihal/workflows/inbox.md +418 -0
  624. package/rihal/workflows/init.md +245 -0
  625. package/rihal/workflows/insert-phase.md +116 -0
  626. package/rihal/workflows/install.md +85 -0
  627. package/rihal/workflows/karpathy-audit.md +409 -0
  628. package/rihal/workflows/list-plans.md +146 -0
  629. package/rihal/workflows/list-workspaces.md +115 -0
  630. package/rihal/workflows/map-codebase.md +449 -0
  631. package/rihal/workflows/milestone-summary.md +206 -0
  632. package/rihal/workflows/new-milestone.md +616 -0
  633. package/rihal/workflows/new-project-research.md +262 -0
  634. package/rihal/workflows/new-project-roadmap.md +446 -0
  635. package/rihal/workflows/new-project.md +1503 -0
  636. package/rihal/workflows/new-workspace.md +167 -0
  637. package/rihal/workflows/next.md +162 -0
  638. package/rihal/workflows/note.md +156 -0
  639. package/rihal/workflows/notify-test.md +113 -0
  640. package/rihal/workflows/pause-work.md +243 -0
  641. package/rihal/workflows/plan-milestone-gaps.md +273 -0
  642. package/rihal/workflows/plan.md +1262 -0
  643. package/rihal/workflows/plant-seed.md +169 -0
  644. package/rihal/workflows/pr-branch.md +129 -0
  645. package/rihal/workflows/profile-user.md +162 -0
  646. package/rihal/workflows/progress.md +184 -0
  647. package/rihal/workflows/quick.md +105 -0
  648. package/rihal/workflows/remove-phase.md +155 -0
  649. package/rihal/workflows/remove-workspace.md +158 -0
  650. package/rihal/workflows/replay.md +160 -0
  651. package/rihal/workflows/rerun.md +77 -0
  652. package/rihal/workflows/research-phase.md +82 -0
  653. package/rihal/workflows/resume-work.md +326 -0
  654. package/rihal/workflows/review-adversarial.md +180 -0
  655. package/rihal/workflows/review-edge-case-hunter.md +214 -0
  656. package/rihal/workflows/review.md +281 -0
  657. package/rihal/workflows/scan.md +135 -0
  658. package/rihal/workflows/secure-phase.md +196 -0
  659. package/rihal/workflows/session-report.md +187 -0
  660. package/rihal/workflows/settings.md +185 -0
  661. package/rihal/workflows/ship.md +237 -0
  662. package/rihal/workflows/show.md +63 -0
  663. package/rihal/workflows/sprint-planning.md +166 -0
  664. package/rihal/workflows/sprint-status.md +124 -0
  665. package/rihal/workflows/stats.md +141 -0
  666. package/rihal/workflows/status.md +116 -0
  667. package/rihal/workflows/ui-phase.md +148 -0
  668. package/rihal/workflows/ui-review.md +130 -0
  669. package/rihal/workflows/undo.md +426 -0
  670. package/rihal/workflows/update.md +185 -0
  671. package/rihal/workflows/validate-phase.md +174 -0
  672. package/rihal/workflows/verify-phase.md +375 -0
  673. package/rihal/workflows/verify-work.md +717 -0
  674. package/rihal/workflows/why.md +130 -0
  675. package/rihal/workflows/workstream.md +197 -0
  676. package/server/dashboard.js +632 -0
@@ -0,0 +1,1503 @@
1
+ <purpose>
2
+ Initialize a new project through unified flow: questioning, research (optional), requirements, roadmap. This is the most leveraged moment in any project — deep questioning here means better plans, better execution, better outcomes. One workflow takes you from idea to ready-for-planning.
3
+
4
+ </purpose>
5
+
6
+ <required_reading>
7
+ @.rihal/references/output-format.md
8
+
9
+ Read all files referenced by the invoking prompt's execution_context before starting.
10
+ </required_reading>
11
+
12
+ <output_format>
13
+ Open with banner:
14
+
15
+ ```
16
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
17
+ RIHAL ► NEW PROJECT
18
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
19
+ ```
20
+
21
+ Use TaskCreate at workflow start to show the full journey:
22
+ - TaskCreate: "Detect project type (greenfield / brownfield)"
23
+ - TaskCreate: "Collect workflow config (mode, granularity, parallelization, models, agents)"
24
+ - TaskCreate: "Write and commit PROJECT.md"
25
+ - TaskCreate: "Run domain research (4 parallel agents + synthesizer)" — if research enabled
26
+ - TaskCreate: "Define REQUIREMENTS.md"
27
+ - TaskCreate: "Spawn rihal-roadmapper to build ROADMAP.md"
28
+ - TaskCreate: "Finalize: STATE.md, CLAUDE.md refresh, commit"
29
+
30
+ Mark one in_progress at a time. Mark completed immediately after each step.
31
+
32
+ Per-stage banners:
33
+ - `RIHAL ► QUESTIONING`
34
+ - `RIHAL ► RESEARCHING`
35
+ - `RIHAL ► RESEARCH COMPLETE ✓`
36
+ - `RIHAL ► DEFINING REQUIREMENTS`
37
+ - `RIHAL ► CREATING ROADMAP`
38
+ - `RIHAL ► PROJECT INITIALIZED ✓`
39
+
40
+ **Brownfield detection banner** (if existing code found):
41
+ ```
42
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
43
+ RIHAL ► BROWNFIELD DETECTED
44
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
45
+
46
+ Existing {stack} code found in {path}. Mapping it first will save
47
+ duplication during planning.
48
+ ```
49
+
50
+ Then AskUserQuestion to route to /rihal:map-codebase before proceeding.
51
+
52
+ **Exiting to map-codebase handoff:**
53
+ ```
54
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
55
+ RIHAL ► EXITING TO CODEBASE MAP
56
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
57
+
58
+ Per the workflow, mapping runs first. After it finishes I'll re-enter
59
+ /rihal:new-project automatically with the map in hand.
60
+
61
+ Handing off to /rihal:map-codebase now.
62
+ ```
63
+ </output_format>
64
+
65
+
66
+ ## Step 0 — Usage check
67
+
68
+ If `$ARGUMENTS` is empty or contains only `--help` or `-h`:
69
+
70
+ ```
71
+ /rihal:new-project <argument-here>
72
+ ```
73
+
74
+ **Examples:**
75
+ ```
76
+ /rihal:new-project employee leave request tracker for an Omani government ministry
77
+ /rihal:new-project car rental marketplace SEO site for Dubai
78
+ /rihal:new-project tasbeeh app with Arabic RTL support for Android
79
+ ```
80
+
81
+ STOP — do not proceed.
82
+
83
+ <available_agent_types>
84
+ Valid Rihal subagent types (use exact names — do not fall back to 'general-purpose'):
85
+ - rihal-project-researcher — Researches project-level technical decisions
86
+ - rihal-research-synthesizer — Synthesizes findings from parallel research agents
87
+ - rihal-roadmapper — Creates phased execution roadmaps
88
+ </available_agent_types>
89
+
90
+ ## Step 0.5 — Detect existing project (redirect)
91
+
92
+ Before any processing, check if a project already exists in this directory:
93
+
94
+ ```bash
95
+ EXISTING=$(node .rihal/bin/rihal-tools.cjs state read 2>/dev/null | grep '"project"' | head -1)
96
+ ```
97
+
98
+ If `$EXISTING` is non-empty (project already initialized):
99
+
100
+ ```
101
+ ⚠ A rihal project already exists here.
102
+
103
+ To check current state: /rihal:status
104
+ To find next action: /rihal:next
105
+ To start a fresh phase instead: /rihal:add-phase
106
+ ```
107
+
108
+ Only proceed past this step if no project exists (`$EXISTING` is empty).
109
+
110
+ <auto_mode>
111
+
112
+ ## Auto Mode Detection
113
+
114
+ Check if `--auto` flag is present in $ARGUMENTS.
115
+
116
+ **If auto mode:**
117
+
118
+ - Skip brownfield mapping offer (assume greenfield)
119
+ - Skip deep questioning (extract context from provided document)
120
+ - Config: YOLO mode is implicit (skip that question), but ask granularity/git/agents FIRST (Step 2a)
121
+ - After config: run Steps 6-9 automatically with smart defaults:
122
+ - Research: Always yes
123
+ - Requirements: Include all table stakes + features from provided document
124
+ - Requirements approval: Auto-approve
125
+ - Roadmap approval: Auto-approve
126
+
127
+ **Document requirement:**
128
+ Auto mode requires an idea document — either:
129
+
130
+ - File reference: `/rihal:new-project --auto @prd.md`
131
+ - Pasted/written text in the prompt
132
+
133
+ If no document content provided, error:
134
+
135
+ ```
136
+ Error: --auto requires an idea document.
137
+
138
+ Usage:
139
+ /rihal:new-project --auto @your-idea.md
140
+ /rihal:new-project --auto [paste or write your idea here]
141
+
142
+ The document should describe what you want to build.
143
+ ```
144
+
145
+ </auto_mode>
146
+
147
+ <process>
148
+
149
+ ## 1. Setup
150
+
151
+ **MANDATORY FIRST STEP — Execute these checks before ANY user interaction:**
152
+
153
+ ```bash
154
+ INIT=$(node .rihal/bin/rihal-tools.cjs init new-project 2>/dev/null || node .rihal/bin/rihal-tools.cjs init)
155
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
156
+ AGENT_RESEARCHER=$(node .rihal/bin/rihal-tools.cjs agent-info rihal-project-researcher 2>/dev/null)
157
+ AGENT_SYNTHESIZER=$(node .rihal/bin/rihal-tools.cjs agent-info rihal-research-synthesizer 2>/dev/null)
158
+ AGENT_ROADMAPPER=$(node .rihal/bin/rihal-tools.cjs agent-info rihal-roadmapper 2>/dev/null)
159
+ RESEARCHER_MODEL=$(node .rihal/bin/rihal-tools.cjs resolve-model rihal-project-researcher 2>/dev/null || echo "sonnet")
160
+ SYNTHESIZER_MODEL=$(node .rihal/bin/rihal-tools.cjs resolve-model rihal-research-synthesizer 2>/dev/null || echo "sonnet")
161
+ ROADMAPPER_MODEL=$(node .rihal/bin/rihal-tools.cjs resolve-model rihal-roadmapper 2>/dev/null || echo "sonnet")
162
+ ```
163
+
164
+ Parse JSON for: `commit_docs`, `project_exists`, `has_codebase_map`, `planning_exists`, `has_existing_code`, `has_package_file`, `is_brownfield`, `needs_codebase_map`, `has_git`, `project_path`.
165
+
166
+ **Detect runtime and set instruction file name:**
167
+
168
+ Derive `RUNTIME` from the invoking prompt's `execution_context` path:
169
+ - Path contains `/.codex/` → `RUNTIME=codex`
170
+ - Path contains `/.gemini/` → `RUNTIME=gemini`
171
+ - Path contains `/.config/opencode/` or `/.opencode/` → `RUNTIME=opencode`
172
+ - Otherwise → `RUNTIME=claude`
173
+
174
+ Fallback via env vars:
175
+ ```bash
176
+ if [ -n "$CODEX_HOME" ]; then RUNTIME="codex"
177
+ elif [ -n "$GEMINI_CONFIG_DIR" ]; then RUNTIME="gemini"
178
+ elif [ -n "$OPENCODE_CONFIG_DIR" ] || [ -n "$OPENCODE_CONFIG" ]; then RUNTIME="opencode"
179
+ else RUNTIME="claude"; fi
180
+ ```
181
+
182
+ Set instruction file variable:
183
+ ```bash
184
+ if [ "$RUNTIME" = "codex" ]; then INSTRUCTION_FILE="AGENTS.md"; else INSTRUCTION_FILE="CLAUDE.md"; fi
185
+ ```
186
+
187
+ All subsequent references to the project instruction file use `$INSTRUCTION_FILE`.
188
+
189
+ **If `project_exists` is true:** Error — project already initialized. Use `/rihal:progress`.
190
+
191
+ **If `has_git` is false:** Initialize git:
192
+
193
+ ```bash
194
+ git init
195
+ ```
196
+
197
+ ## 2. Project Type Classification
198
+
199
+ **If auto mode:** Detect project type from provided document context. Skip to Step 4.
200
+
201
+ **Otherwise:** Ask user to classify the project via AskUserQuestion:
202
+
203
+ - header: "Project Type"
204
+ - question: "Is this a greenfield project or brownfield (existing codebase)?"
205
+ - multiSelect: false
206
+ - options:
207
+ - "Greenfield" — New project from scratch (default flow)
208
+ - "Brownfield" — Enhancing/modifying existing codebase (narrow discovery to delta questions)
209
+
210
+ ## 2.1. Brownfield Path (if brownfield selected)
211
+
212
+ **If `needs_codebase_map` is true** (existing code detected but no codebase map):
213
+
214
+ Use AskUserQuestion:
215
+
216
+ - header: "Codebase"
217
+ - question: "I detected existing code in this directory. Would you like to map the codebase first?"
218
+ - options:
219
+ - "Map codebase first" — Run /rihal:map-codebase to understand existing architecture (Recommended)
220
+ - "Skip mapping" — Proceed with targeted discovery
221
+
222
+ **If "Map codebase first":**
223
+
224
+ ```
225
+ Run `/rihal:map-codebase` first, then return to `/rihal:new-project`
226
+ ```
227
+
228
+ Exit command.
229
+
230
+ **Otherwise:** Continue with narrowed discovery (Step 3b).
231
+
232
+ ## 2.2. Greenfield Path (if greenfield selected)
233
+
234
+ Continue to Step 3 (standard deep discovery flow).
235
+
236
+ ### Step 3b. Brownfield Discovery (instead of deep questioning)
237
+
238
+ For brownfield projects, narrow discovery to delta questions:
239
+
240
+ ```
241
+ AskUserQuestion([
242
+ {
243
+ header: "Change Scope",
244
+ question: "What's changing in this project?",
245
+ multiSelect: false,
246
+ options: [
247
+ "New feature on existing architecture",
248
+ "Refactoring existing feature",
249
+ "Migration to new tech stack",
250
+ "Bug fixes and tech debt",
251
+ "Performance optimization"
252
+ ]
253
+ },
254
+ {
255
+ header: "Change Impact",
256
+ question: "Scope of impact?",
257
+ multiSelect: false,
258
+ options: [
259
+ "Single component/module",
260
+ "Multiple components",
261
+ "Entire system (breaking changes)"
262
+ ]
263
+ },
264
+ {
265
+ header: "Rollback Risk",
266
+ question: "Can this be rolled back easily?",
267
+ multiSelect: false,
268
+ options: [
269
+ "Yes — change is isolated",
270
+ "Partially — some migration needed",
271
+ "No — breaking change"
272
+ ]
273
+ }
274
+ ])
275
+ ```
276
+
277
+ Adapt PRD template — focus on delta: what's NEW or CHANGED, reference existing architecture/patterns, highlight breaking changes, identify rollback/migration strategy.
278
+
279
+ **Brownfield PRD Template:**
280
+
281
+ ```markdown
282
+ # PRD — {project_name}
283
+
284
+ ## Existing Context
285
+
286
+ - Current architecture: {from codebase map}
287
+ - Tech stack: {from codebase analysis}
288
+ - What exists today: {brief}
289
+
290
+ ## What's Changing
291
+
292
+ - New features: {list}
293
+ - Refactored components: {list}
294
+ - Removed features: {list}
295
+ - Tech debt addressed: {list}
296
+
297
+ ## Change Impact
298
+
299
+ - Breaking changes: {yes/no, list if yes}
300
+ - Rollback strategy: {how to back out}
301
+ - Migration path: {if moving data/state}
302
+
303
+ ## Success Criteria
304
+
305
+ - {delta-focused acceptance criteria}
306
+
307
+ ## Non-functional Requirements
308
+
309
+ - Backward compatibility: {required version range}
310
+ - Data migration: {strategy}
311
+ - Performance impact: {acceptable degradation}
312
+ ```
313
+
314
+ After delta discovery, continue with Step 5 (research, requirements approval, roadmap).
315
+
316
+ ## 2a. Auto Mode Config (auto mode only)
317
+
318
+ **If auto mode:** Collect config settings upfront.
319
+
320
+ YOLO mode is implicit (auto = YOLO). Ask remaining config questions:
321
+
322
+ **Round 1 — Core settings (3 questions, no Mode question):**
323
+
324
+ ```
325
+ AskUserQuestion([
326
+ {
327
+ header: "Granularity",
328
+ question: "How finely should scope be sliced into phases?",
329
+ multiSelect: false,
330
+ options: [
331
+ { label: "Coarse (Recommended)", description: "Fewer, broader phases (3-5 phases, 1-3 plans each)" },
332
+ { label: "Standard", description: "Balanced phase size (5-8 phases, 3-5 plans each)" },
333
+ { label: "Fine", description: "Many focused phases (8-12 phases, 5-10 plans each)" }
334
+ ]
335
+ },
336
+ {
337
+ header: "Execution",
338
+ question: "Run plans in parallel?",
339
+ multiSelect: false,
340
+ options: [
341
+ { label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
342
+ { label: "Sequential", description: "One plan at a time" }
343
+ ]
344
+ },
345
+ {
346
+ header: "Git Tracking",
347
+ question: "Commit planning docs to git?",
348
+ multiSelect: false,
349
+ options: [
350
+ { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
351
+ { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
352
+ ]
353
+ }
354
+ ])
355
+ ```
356
+
357
+ **Round 2 — Workflow agents (same as Step 5):**
358
+
359
+ ```
360
+ AskUserQuestion([
361
+ {
362
+ header: "Research",
363
+ question: "Research before planning each phase? (adds tokens/time)",
364
+ multiSelect: false,
365
+ options: [
366
+ { label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
367
+ { label: "No", description: "Plan directly from requirements" }
368
+ ]
369
+ },
370
+ {
371
+ header: "Plan Check",
372
+ question: "Verify plans will achieve their goals? (adds tokens/time)",
373
+ multiSelect: false,
374
+ options: [
375
+ { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
376
+ { label: "No", description: "Execute plans without verification" }
377
+ ]
378
+ },
379
+ {
380
+ header: "Verifier",
381
+ question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
382
+ multiSelect: false,
383
+ options: [
384
+ { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
385
+ { label: "No", description: "Trust execution, skip verification" }
386
+ ]
387
+ },
388
+ {
389
+ header: "AI Models",
390
+ question: "Which AI models for planning agents?",
391
+ multiSelect: false,
392
+ options: [
393
+ { label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
394
+ { label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
395
+ { label: "Budget", description: "Haiku where possible — fastest, lowest cost" },
396
+ { label: "Inherit", description: "Use the current session model for all agents" }
397
+ ]
398
+ }
399
+ ])
400
+ ```
401
+
402
+ Create `.planning/config.json`:
403
+
404
+ ```bash
405
+ mkdir -p .planning
406
+ cat > .planning/config.json <<EOF
407
+ {
408
+ "mode": "yolo",
409
+ "granularity": "[selected]",
410
+ "parallelization": true,
411
+ "commit_docs": true,
412
+ "model_profile": "balanced",
413
+ "workflow": {
414
+ "research": true,
415
+ "plan_check": true,
416
+ "verifier": true,
417
+ "nyquist_validation": true,
418
+ "auto_advance": true,
419
+ "_auto_chain_active": true
420
+ }
421
+ }
422
+ EOF
423
+ ```
424
+
425
+ **If commit_docs = No:** Add `.planning/` to `.gitignore`.
426
+
427
+ **Commit config.json (guarded):**
428
+
429
+ ```bash
430
+ git add .planning/config.json 2>/dev/null \
431
+ && git commit -m "chore: add project config" 2>/dev/null \
432
+ || echo "ℹ .planning/ gitignored — config written, not committed"
433
+ ```
434
+
435
+ Proceed to Step 4 (skip Steps 3 and 5).
436
+
437
+ ## 3. Deep Questioning
438
+
439
+ **If auto mode:** Skip (already handled in Step 2a). Extract project context from provided document instead and proceed to Step 4.
440
+
441
+ **Display stage banner:**
442
+
443
+ ```
444
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
445
+ RIHAL ► QUESTIONING
446
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
447
+ ```
448
+
449
+ **Open the conversation:**
450
+
451
+ Ask inline (freeform, NOT AskUserQuestion):
452
+
453
+ "What do you want to build?"
454
+
455
+ Wait for their response. This gives you the context needed to ask intelligent follow-up questions.
456
+
457
+ **Research-before-questions mode:** Check if `workflow.research_before_questions` is enabled in `.planning/config.json`. When enabled, before asking follow-up questions about a topic:
458
+
459
+ 1. Do a brief web search for best practices related to what the user described
460
+ 2. Mention key findings naturally as you ask questions
461
+ 3. This makes questions more informed without changing the conversational flow
462
+
463
+ When disabled (default), ask questions directly.
464
+
465
+ **Follow the thread:**
466
+
467
+ Based on what they said, ask follow-up questions via AskUserQuestion with options that probe what they mentioned — interpretations, clarifications, concrete examples.
468
+
469
+ Keep following threads. Ask about:
470
+
471
+ - What excited them
472
+ - What problem sparked this
473
+ - What they mean by vague terms
474
+ - What it would actually look like
475
+ - What's already decided
476
+
477
+ Techniques:
478
+
479
+ - Challenge vagueness
480
+ - Make abstract concrete
481
+ - Surface assumptions
482
+ - Find edges
483
+ - Reveal motivation
484
+
485
+ **Check context (background, not out loud):**
486
+
487
+ Mentally check the context checklist. If gaps remain, weave questions naturally. Don't suddenly switch to checklist mode.
488
+
489
+ **Decision gate:**
490
+
491
+ When you could write a clear PROJECT.md, use AskUserQuestion:
492
+
493
+ - header: "Ready?"
494
+ - question: "I think I understand what you're after. Ready to create PROJECT.md?"
495
+ - options:
496
+ - "Create PROJECT.md" — Let's move forward
497
+ - "Keep exploring" — I want to share more / ask me more
498
+
499
+ If "Keep exploring" — ask what they want to add, or identify gaps and probe naturally.
500
+
501
+ Loop until "Create PROJECT.md" selected.
502
+
503
+ ## 3.5. Detect Project Type
504
+
505
+ **If auto mode:** Skip — project type will be inferred from document in Step 4.
506
+
507
+ **Goal:** Classify the project into one of 9 types (api-backend, mobile-app, saas-b2b, cli-tool, web-app, desktop-app, iot, dev-tool, other). This shapes discovery questions and discovery section requirements.
508
+
509
+ **Load project type signals:**
510
+
511
+ ```bash
512
+ PROJECT_TYPES=$(cat .rihal/references/project-types.yaml 2>/dev/null || true)
513
+ ```
514
+
515
+ **Classify by signals:**
516
+
517
+ Scan the user's responses from Step 3 for keywords from the `signals` list. Build a score per type:
518
+
519
+ - Each signal match adds 1 point
520
+ - Pick the type with the highest score
521
+ - If tie or score < 2, ask the user to clarify
522
+
523
+ **If score is clear (>2 points for one type):**
524
+
525
+ ```
526
+ 📋 Detected project type: {display_name} (based on your description mentioning {signal1}, {signal2}, {signal3})
527
+
528
+ Proceed with this type? [Y/n]
529
+ ```
530
+
531
+ If "n": Ask the user to pick from the list.
532
+
533
+ **Store the detected type** in a shell variable for Step 5 discovery adaptation. Add required-sections and discovery questions from project-types.yaml to the upcoming questionnaire.
534
+
535
+ ## 4. Write PROJECT.md
536
+
537
+ **If auto mode:** Synthesize from provided document. No "Ready?" gate was shown — proceed directly to commit.
538
+
539
+ Synthesize all context into `.planning/PROJECT.md`. If `.rihal/templates/project.md` exists, use it. Otherwise use this inline template:
540
+
541
+ ```markdown
542
+ # Project: {name}
543
+
544
+ ## What This Is
545
+
546
+ {1-2 sentence description}
547
+
548
+ ## Core Value
549
+
550
+ {The ONE thing that must work}
551
+
552
+ ## Requirements
553
+
554
+ ### Validated
555
+
556
+ {For greenfield: "(None yet — ship to validate)"}
557
+ {For brownfield: list existing capabilities}
558
+
559
+ ### Active
560
+
561
+ - [ ] {Requirement 1}
562
+ - [ ] {Requirement 2}
563
+ - [ ] {Requirement 3}
564
+
565
+ ### Out of Scope
566
+
567
+ - {Exclusion 1} — {why}
568
+ - {Exclusion 2} — {why}
569
+
570
+ ## Key Decisions
571
+
572
+ | Decision | Rationale | Outcome |
573
+ |----------|-----------|---------|
574
+ | {Choice} | {Why} | — Pending |
575
+
576
+ ## Constraints
577
+
578
+ - {Budget / timeline / tech}
579
+
580
+ ## Context
581
+
582
+ {Current state, tech stack, user feedback themes}
583
+
584
+ ## Evolution
585
+
586
+ This document evolves at phase transitions and milestone boundaries.
587
+
588
+ **After each phase transition** (via `/rihal:discuss-phase` + `/rihal:plan`):
589
+ 1. Requirements invalidated? → Move to Out of Scope with reason
590
+ 2. Requirements validated? → Move to Validated with phase reference
591
+ 3. New requirements emerged? → Add to Active
592
+ 4. Decisions to log? → Add to Key Decisions
593
+ 5. "What This Is" still accurate? → Update if drifted
594
+
595
+ **After each milestone** (via `/rihal:complete-milestone`):
596
+ 1. Full review of all sections
597
+ 2. Core Value check — still the right priority?
598
+ 3. Audit Out of Scope — reasons still valid?
599
+ 4. Update Context with current state
600
+
601
+ ---
602
+ *Last updated: {date} after initialization*
603
+ ```
604
+
605
+ **For greenfield projects:** Initialize requirements as hypotheses (all Active).
606
+
607
+ **For brownfield projects (codebase map exists):** Read `.planning/codebase/ARCHITECTURE.md` and `STACK.md`. Identify what the codebase already does — these become the initial Validated set.
608
+
609
+ **Key Decisions:** Initialize with any decisions made during questioning.
610
+
611
+ Do not compress. Capture everything gathered.
612
+
613
+ **Commit PROJECT.md (guarded):**
614
+
615
+ ```bash
616
+ mkdir -p .planning
617
+ git add .planning/PROJECT.md 2>/dev/null \
618
+ && git commit -m "docs: initialize project" 2>/dev/null \
619
+ || echo "ℹ .planning/ gitignored — PROJECT.md written, not committed"
620
+ ```
621
+
622
+ ## 5. Workflow Preferences
623
+
624
+ **If auto mode:** Skip — config was collected in Step 2a. Proceed to Step 5.5.
625
+
626
+ **Check for global defaults** at `~/.rihal/defaults.json`. If the file exists, offer to use saved defaults:
627
+
628
+ ```
629
+ AskUserQuestion([
630
+ {
631
+ question: "Use your saved default settings? (from ~/.rihal/defaults.json)",
632
+ header: "Defaults",
633
+ multiSelect: false,
634
+ options: [
635
+ { label: "Yes (Recommended)", description: "Use saved defaults, skip settings questions" },
636
+ { label: "No", description: "Configure settings manually" }
637
+ ]
638
+ }
639
+ ])
640
+ ```
641
+
642
+ If "Yes": read `~/.rihal/defaults.json`, use those values for config.json, skip to **Commit config.json** below.
643
+
644
+ If "No" or file doesn't exist: proceed with the questions below.
645
+
646
+ **Round 1 — Core workflow settings (4 questions):**
647
+
648
+ ```
649
+ questions: [
650
+ {
651
+ header: "Mode",
652
+ question: "How do you want to work?",
653
+ multiSelect: false,
654
+ options: [
655
+ { label: "YOLO (Recommended)", description: "Auto-approve, just execute" },
656
+ { label: "Interactive", description: "Confirm at each step" }
657
+ ]
658
+ },
659
+ {
660
+ header: "Granularity",
661
+ question: "How finely should scope be sliced into phases?",
662
+ multiSelect: false,
663
+ options: [
664
+ { label: "Coarse", description: "Fewer, broader phases (3-5 phases, 1-3 plans each)" },
665
+ { label: "Standard", description: "Balanced phase size (5-8 phases, 3-5 plans each)" },
666
+ { label: "Fine", description: "Many focused phases (8-12 phases, 5-10 plans each)" }
667
+ ]
668
+ },
669
+ {
670
+ header: "Execution",
671
+ question: "Run plans in parallel?",
672
+ multiSelect: false,
673
+ options: [
674
+ { label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
675
+ { label: "Sequential", description: "One plan at a time" }
676
+ ]
677
+ },
678
+ {
679
+ header: "Git Tracking",
680
+ question: "Commit planning docs to git?",
681
+ multiSelect: false,
682
+ options: [
683
+ { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
684
+ { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
685
+ ]
686
+ }
687
+ ]
688
+ ```
689
+
690
+ **Round 2 — Workflow agents:**
691
+
692
+ These spawn additional agents during planning/execution. They add tokens and time but improve quality.
693
+
694
+ | Agent | When it runs | What it does |
695
+ |-------|--------------|--------------|
696
+ | **Researcher** | Before planning each phase | Investigates domain, finds patterns, surfaces gotchas |
697
+ | **Plan Checker** | After plan is created | Verifies plan actually achieves the phase goal |
698
+ | **Verifier** | After phase execution | Confirms must-haves were delivered |
699
+
700
+ ```
701
+ questions: [
702
+ {
703
+ header: "Research",
704
+ question: "Research before planning each phase? (adds tokens/time)",
705
+ multiSelect: false,
706
+ options: [
707
+ { label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
708
+ { label: "No", description: "Plan directly from requirements" }
709
+ ]
710
+ },
711
+ {
712
+ header: "Plan Check",
713
+ question: "Verify plans will achieve their goals? (adds tokens/time)",
714
+ multiSelect: false,
715
+ options: [
716
+ { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
717
+ { label: "No", description: "Execute plans without verification" }
718
+ ]
719
+ },
720
+ {
721
+ header: "Verifier",
722
+ question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
723
+ multiSelect: false,
724
+ options: [
725
+ { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
726
+ { label: "No", description: "Trust execution, skip verification" }
727
+ ]
728
+ },
729
+ {
730
+ header: "AI Models",
731
+ question: "Which AI models for planning agents?",
732
+ multiSelect: false,
733
+ options: [
734
+ { label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
735
+ { label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
736
+ { label: "Budget", description: "Haiku where possible — fastest, lowest cost" },
737
+ { label: "Inherit", description: "Use the current session model for all agents" }
738
+ ]
739
+ }
740
+ ]
741
+ ```
742
+
743
+ Create `.planning/config.json` with all settings:
744
+
745
+ ```bash
746
+ mkdir -p .planning
747
+ cat > .planning/config.json <<EOF
748
+ {
749
+ "mode": "[yolo|interactive]",
750
+ "granularity": "[selected]",
751
+ "parallelization": true,
752
+ "commit_docs": true,
753
+ "model_profile": "[quality|balanced|budget|inherit]",
754
+ "workflow": {
755
+ "research": true,
756
+ "plan_check": true,
757
+ "verifier": true,
758
+ "nyquist_validation": true
759
+ }
760
+ }
761
+ EOF
762
+ ```
763
+
764
+ **Note:** Run `/rihal:settings` anytime to update model profile, workflow agents, branching strategy, and other preferences.
765
+
766
+ **If commit_docs = No:**
767
+
768
+ - Set `commit_docs: false` in config.json
769
+ - Add `.planning/` to `.gitignore` (create if needed)
770
+
771
+ **Commit config.json (guarded):**
772
+
773
+ ```bash
774
+ git add .planning/config.json 2>/dev/null \
775
+ && git commit -m "chore: add project config" 2>/dev/null \
776
+ || echo "ℹ .planning/ gitignored — config written, not committed"
777
+ ```
778
+
779
+ ## 5.1. Sub-Repo Detection
780
+
781
+ **Detect multi-repo workspace:**
782
+
783
+ ```bash
784
+ find . -maxdepth 1 -type d -not -name ".*" -not -name "node_modules" -exec test -d "{}/.git" \; -print
785
+ ```
786
+
787
+ **If sub-repos found:**
788
+
789
+ Strip the `./` prefix (e.g., `./backend` → `backend`).
790
+
791
+ Use AskUserQuestion:
792
+
793
+ - header: "Multi-Repo Workspace"
794
+ - question: "I detected separate git repos in this workspace. Which directories contain code that Rihal should commit to?"
795
+ - multiSelect: true
796
+ - options: one option per detected directory
797
+
798
+ **If user selects one or more directories:**
799
+
800
+ - Set `planning.sub_repos` in config.json to the selected directory names array
801
+ - Auto-set `planning.commit_docs` to `false` (planning docs stay local in multi-repo workspaces)
802
+ - Add `.planning/` to `.gitignore` if not already present
803
+
804
+ **If no sub-repos found or user selects none:** Continue with no changes to config.
805
+
806
+ ## 5.5. Resolve Model Profile
807
+
808
+ Use models resolved in Step 1: `RESEARCHER_MODEL`, `SYNTHESIZER_MODEL`, `ROADMAPPER_MODEL`.
809
+
810
+ ## 6. Research Decision
811
+
812
+ **If auto mode:** Default to "Research first" without asking.
813
+
814
+ Use AskUserQuestion:
815
+
816
+ - header: "Research"
817
+ - question: "Research the domain ecosystem before defining requirements?"
818
+ - options:
819
+ - "Research first (Recommended)" — Discover standard stacks, expected features, architecture patterns
820
+ - "Skip research" — I know this domain well, go straight to requirements
821
+
822
+ **If "Research first":**
823
+
824
+ Display stage banner:
825
+
826
+ ```
827
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
828
+ RIHAL ► RESEARCHING
829
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
830
+
831
+ Researching [domain] ecosystem...
832
+ ```
833
+
834
+ Create research directory:
835
+
836
+ ```bash
837
+ mkdir -p .planning/research
838
+ ```
839
+
840
+ **Determine milestone context:**
841
+
842
+ - If no "Validated" requirements in PROJECT.md → Greenfield (building from scratch)
843
+ - If "Validated" requirements exist → Subsequent milestone (adding to existing app)
844
+
845
+ Display spawning indicator:
846
+
847
+ ```
848
+ ◆ Spawning 4 researchers in parallel...
849
+ → Stack research
850
+ → Features research
851
+ → Architecture research
852
+ → Pitfalls research
853
+ ```
854
+
855
+ Spawn 4 parallel rihal-project-researcher agents:
856
+
857
+ ```
858
+ Task(prompt="<research_type>
859
+ Project Research — Stack dimension for [domain].
860
+ </research_type>
861
+
862
+ <milestone_context>
863
+ [greenfield OR subsequent]
864
+
865
+ Greenfield: Research the standard stack for building [domain] from scratch.
866
+ Subsequent: Research what's needed to add [target features] to an existing [domain] app.
867
+ </milestone_context>
868
+
869
+ <question>
870
+ What's the standard 2026 stack for [domain]?
871
+ </question>
872
+
873
+ <files_to_read>
874
+ - .planning/PROJECT.md (Project context and goals)
875
+ </files_to_read>
876
+
877
+ ${AGENT_RESEARCHER}
878
+
879
+ <downstream_consumer>
880
+ Your STACK.md feeds into roadmap creation. Be prescriptive:
881
+ - Specific libraries with versions
882
+ - Clear rationale for each choice
883
+ - What NOT to use and why
884
+ </downstream_consumer>
885
+
886
+ <quality_gate>
887
+ - [ ] Versions are current (verify with Context7/official docs, not training data)
888
+ - [ ] Rationale explains WHY, not just WHAT
889
+ - [ ] Confidence levels assigned to each recommendation
890
+ </quality_gate>
891
+
892
+ <output>
893
+ Write to: .planning/research/STACK.md
894
+ </output>
895
+ ", subagent_type="rihal-project-researcher", model="${RESEARCHER_MODEL}", description="Stack research")
896
+
897
+ Task(prompt="<research_type>
898
+ Project Research — Features dimension for [domain].
899
+ </research_type>
900
+
901
+ <milestone_context>
902
+ [greenfield OR subsequent]
903
+
904
+ Greenfield: What features do [domain] products have? What's table stakes vs differentiating?
905
+ Subsequent: How do [target features] typically work? What's expected behavior?
906
+ </milestone_context>
907
+
908
+ <files_to_read>
909
+ - .planning/PROJECT.md
910
+ </files_to_read>
911
+
912
+ ${AGENT_RESEARCHER}
913
+
914
+ <downstream_consumer>
915
+ Your FEATURES.md feeds into requirements definition. Categorize clearly:
916
+ - Table stakes (must have or users leave)
917
+ - Differentiators (competitive advantage)
918
+ - Anti-features (things to deliberately NOT build)
919
+ </downstream_consumer>
920
+
921
+ <quality_gate>
922
+ - [ ] Categories are clear (table stakes vs differentiators vs anti-features)
923
+ - [ ] Complexity noted for each feature
924
+ - [ ] Dependencies between features identified
925
+ </quality_gate>
926
+
927
+ <output>
928
+ Write to: .planning/research/FEATURES.md
929
+ </output>
930
+ ", subagent_type="rihal-project-researcher", model="${RESEARCHER_MODEL}", description="Features research")
931
+
932
+ Task(prompt="<research_type>
933
+ Project Research — Architecture dimension for [domain].
934
+ </research_type>
935
+
936
+ <milestone_context>
937
+ [greenfield OR subsequent]
938
+
939
+ Greenfield: How are [domain] systems typically structured? What are major components?
940
+ Subsequent: How do [target features] integrate with existing [domain] architecture?
941
+ </milestone_context>
942
+
943
+ <files_to_read>
944
+ - .planning/PROJECT.md
945
+ </files_to_read>
946
+
947
+ ${AGENT_RESEARCHER}
948
+
949
+ <downstream_consumer>
950
+ Your ARCHITECTURE.md informs phase structure in roadmap. Include:
951
+ - Component boundaries (what talks to what)
952
+ - Data flow (how information moves)
953
+ - Suggested build order (dependencies between components)
954
+ </downstream_consumer>
955
+
956
+ <quality_gate>
957
+ - [ ] Components clearly defined with boundaries
958
+ - [ ] Data flow direction explicit
959
+ - [ ] Build order implications noted
960
+ </quality_gate>
961
+
962
+ <output>
963
+ Write to: .planning/research/ARCHITECTURE.md
964
+ </output>
965
+ ", subagent_type="rihal-project-researcher", model="${RESEARCHER_MODEL}", description="Architecture research")
966
+
967
+ Task(prompt="<research_type>
968
+ Project Research — Pitfalls dimension for [domain].
969
+ </research_type>
970
+
971
+ <milestone_context>
972
+ [greenfield OR subsequent]
973
+
974
+ Greenfield: What do [domain] projects commonly get wrong? Critical mistakes?
975
+ Subsequent: What are common mistakes when adding [target features] to [domain]?
976
+ </milestone_context>
977
+
978
+ <files_to_read>
979
+ - .planning/PROJECT.md
980
+ </files_to_read>
981
+
982
+ ${AGENT_RESEARCHER}
983
+
984
+ <downstream_consumer>
985
+ Your PITFALLS.md prevents mistakes in roadmap/planning. For each pitfall:
986
+ - Warning signs (how to detect early)
987
+ - Prevention strategy (how to avoid)
988
+ - Which phase should address it
989
+ </downstream_consumer>
990
+
991
+ <quality_gate>
992
+ - [ ] Pitfalls are specific to this domain (not generic advice)
993
+ - [ ] Prevention strategies are actionable
994
+ - [ ] Phase mapping included where relevant
995
+ </quality_gate>
996
+
997
+ <output>
998
+ Write to: .planning/research/PITFALLS.md
999
+ </output>
1000
+ ", subagent_type="rihal-project-researcher", model="${RESEARCHER_MODEL}", description="Pitfalls research")
1001
+ ```
1002
+
1003
+ After all 4 agents complete, spawn synthesizer to create SUMMARY.md:
1004
+
1005
+ ```
1006
+ Task(prompt="
1007
+ <task>
1008
+ Synthesize research outputs into SUMMARY.md.
1009
+ </task>
1010
+
1011
+ <files_to_read>
1012
+ - .planning/research/STACK.md
1013
+ - .planning/research/FEATURES.md
1014
+ - .planning/research/ARCHITECTURE.md
1015
+ - .planning/research/PITFALLS.md
1016
+ </files_to_read>
1017
+
1018
+ ${AGENT_SYNTHESIZER}
1019
+
1020
+ <output>
1021
+ Write to: .planning/research/SUMMARY.md
1022
+ Synthesize into: recommended stack, table stakes vs differentiators, architecture outline, top pitfalls to avoid.
1023
+ </output>
1024
+ ", subagent_type="rihal-research-synthesizer", model="${SYNTHESIZER_MODEL}", description="Synthesize research")
1025
+ ```
1026
+
1027
+ **Commit research (guarded):**
1028
+
1029
+ ```bash
1030
+ git add .planning/research/ 2>/dev/null \
1031
+ && git commit -m "docs: add project research" 2>/dev/null \
1032
+ || echo "ℹ .planning/ gitignored — research written, not committed"
1033
+ ```
1034
+
1035
+ Display research complete banner and key findings:
1036
+
1037
+ ```
1038
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1039
+ RIHAL ► RESEARCH COMPLETE ✓
1040
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1041
+
1042
+ ## Key Findings
1043
+
1044
+ **Stack:** [from SUMMARY.md]
1045
+ **Table Stakes:** [from SUMMARY.md]
1046
+ **Watch Out For:** [from SUMMARY.md]
1047
+
1048
+ Files: `.planning/research/`
1049
+ ```
1050
+
1051
+ **If "Skip research":** Continue to Step 7.
1052
+
1053
+ ## 7. Define Requirements
1054
+
1055
+ Display stage banner:
1056
+
1057
+ ```
1058
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1059
+ RIHAL ► DEFINING REQUIREMENTS
1060
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1061
+ ```
1062
+
1063
+ **Load context:**
1064
+
1065
+ Read PROJECT.md and extract:
1066
+
1067
+ - Core value (the ONE thing that must work)
1068
+ - Stated constraints (budget, timeline, tech limitations)
1069
+ - Any explicit scope boundaries
1070
+
1071
+ **If research exists:** Read research/FEATURES.md and extract feature categories.
1072
+
1073
+ **If auto mode:**
1074
+
1075
+ - Auto-include all table stakes features
1076
+ - Include features explicitly mentioned in provided document
1077
+ - Auto-defer differentiators not mentioned in document
1078
+ - Skip per-category AskUserQuestion loops
1079
+ - Skip "Any additions?" question
1080
+ - Skip requirements approval gate
1081
+ - Generate REQUIREMENTS.md and commit directly
1082
+
1083
+ **Present features by category (interactive mode only):**
1084
+
1085
+ ```
1086
+ Here are the features for [domain]:
1087
+
1088
+ ## Authentication
1089
+ **Table stakes:**
1090
+ - Sign up with email/password
1091
+ - Email verification
1092
+ - Password reset
1093
+ - Session management
1094
+
1095
+ **Differentiators:**
1096
+ - Magic link login
1097
+ - OAuth (Google, GitHub)
1098
+ - 2FA
1099
+
1100
+ **Research notes:** [any relevant notes]
1101
+
1102
+ ---
1103
+
1104
+ ## [Next Category]
1105
+ ...
1106
+ ```
1107
+
1108
+ **If no research:** Gather requirements through conversation.
1109
+
1110
+ Ask: "What are the main things users need to be able to do?"
1111
+
1112
+ For each capability mentioned:
1113
+
1114
+ - Ask clarifying questions to make it specific
1115
+ - Probe for related capabilities
1116
+ - Group into categories
1117
+
1118
+ **Scope each category:**
1119
+
1120
+ For each category, use AskUserQuestion:
1121
+
1122
+ - header: "[Category]" (max 12 chars)
1123
+ - question: "Which [category] features are in v1?"
1124
+ - multiSelect: true
1125
+ - options:
1126
+ - "[Feature 1]" — [brief description]
1127
+ - "[Feature 2]" — [brief description]
1128
+ - "[Feature 3]" — [brief description]
1129
+ - "None for v1" — Defer entire category
1130
+
1131
+ Track responses:
1132
+
1133
+ - Selected features → v1 requirements
1134
+ - Unselected table stakes → v2
1135
+ - Unselected differentiators → out of scope
1136
+
1137
+ **Identify gaps:**
1138
+
1139
+ Use AskUserQuestion:
1140
+
1141
+ - header: "Additions"
1142
+ - question: "Any requirements research missed?"
1143
+ - options:
1144
+ - "No, research covered it" — Proceed
1145
+ - "Yes, let me add some" — Capture additions
1146
+
1147
+ **Validate core value:**
1148
+
1149
+ Cross-check requirements against Core Value from PROJECT.md. If gaps detected, surface them.
1150
+
1151
+ **Generate REQUIREMENTS.md:**
1152
+
1153
+ Create `.planning/REQUIREMENTS.md` with:
1154
+
1155
+ - v1 Requirements grouped by category (checkboxes, REQ-IDs)
1156
+ - v2 Requirements (deferred)
1157
+ - Out of Scope (explicit exclusions with reasoning)
1158
+ - Traceability section (empty, filled by roadmap)
1159
+
1160
+ **REQ-ID format:** `[CATEGORY]-[NUMBER]` (AUTH-01, CONTENT-02)
1161
+
1162
+ **Requirement quality criteria:**
1163
+
1164
+ Good requirements are:
1165
+
1166
+ - **Specific and testable:** "User can reset password via email link"
1167
+ - **User-centric:** "User can X"
1168
+ - **Atomic:** One capability per requirement
1169
+ - **Independent:** Minimal dependencies on other requirements
1170
+
1171
+ Reject vague requirements. Push for specificity:
1172
+
1173
+ - "Handle authentication" → "User can log in with email/password and stay logged in across sessions"
1174
+ - "Support sharing" → "User can share post via link that opens in recipient's browser"
1175
+
1176
+ **Present full requirements list (interactive mode only):**
1177
+
1178
+ Show every requirement for user confirmation:
1179
+
1180
+ ```
1181
+ ## v1 Requirements
1182
+
1183
+ ### Authentication
1184
+ - [ ] **AUTH-01**: User can create account with email/password
1185
+ - [ ] **AUTH-02**: User can log in and stay logged in across sessions
1186
+ - [ ] **AUTH-03**: User can log out from any page
1187
+
1188
+ ### Content
1189
+ - [ ] **CONT-01**: User can create posts with text
1190
+ - [ ] **CONT-02**: User can edit their own posts
1191
+
1192
+ [... full list ...]
1193
+
1194
+ ---
1195
+
1196
+ Does this capture what you're building? (yes / adjust)
1197
+ ```
1198
+
1199
+ If "adjust": Return to scoping.
1200
+
1201
+ **Commit requirements (guarded):**
1202
+
1203
+ ```bash
1204
+ git add .planning/REQUIREMENTS.md 2>/dev/null \
1205
+ && git commit -m "docs: define v1 requirements" 2>/dev/null \
1206
+ || echo "ℹ .planning/ gitignored — requirements written, not committed"
1207
+ ```
1208
+
1209
+ ## 8. Create Roadmap
1210
+
1211
+ Display stage banner:
1212
+
1213
+ ```
1214
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1215
+ RIHAL ► CREATING ROADMAP
1216
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1217
+
1218
+ ◆ Spawning roadmapper...
1219
+ ```
1220
+
1221
+ Spawn rihal-roadmapper agent:
1222
+
1223
+ ```
1224
+ Task(prompt="
1225
+ <planning_context>
1226
+
1227
+ <files_to_read>
1228
+ - .planning/PROJECT.md (Project context)
1229
+ - .planning/REQUIREMENTS.md (v1 Requirements)
1230
+ - .planning/research/SUMMARY.md (Research findings - if exists)
1231
+ - .planning/config.json (Granularity and mode settings)
1232
+ </files_to_read>
1233
+
1234
+ ${AGENT_ROADMAPPER}
1235
+
1236
+ </planning_context>
1237
+
1238
+ <instructions>
1239
+ Create roadmap:
1240
+ 1. Derive phases from requirements (don't impose structure)
1241
+ 2. Map every v1 requirement to exactly one phase
1242
+ 3. Derive 2-5 success criteria per phase (observable user behaviors)
1243
+ 4. Validate 100% coverage
1244
+ 5. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
1245
+ 6. Return ROADMAP CREATED with summary
1246
+
1247
+ Write files first, then return. This ensures artifacts persist even if context is lost.
1248
+ </instructions>
1249
+ ", subagent_type="rihal-roadmapper", model="${ROADMAPPER_MODEL}", description="Create roadmap")
1250
+ ```
1251
+
1252
+ **Handle roadmapper return:**
1253
+
1254
+ **If `## ROADMAP BLOCKED`:**
1255
+
1256
+ - Present blocker information
1257
+ - Work with user to resolve
1258
+ - Re-spawn when resolved
1259
+
1260
+ **If `## ROADMAP CREATED`:**
1261
+
1262
+ Read the created ROADMAP.md and present it nicely inline:
1263
+
1264
+ ```
1265
+ ---
1266
+
1267
+ ## Proposed Roadmap
1268
+
1269
+ **[N] phases** | **[X] requirements mapped** | All v1 requirements covered ✓
1270
+
1271
+ | # | Phase | Goal | Requirements | Success Criteria |
1272
+ |---|-------|------|--------------|------------------|
1273
+ | 1 | [Name] | [Goal] | [REQ-IDs] | [count] |
1274
+ | 2 | [Name] | [Goal] | [REQ-IDs] | [count] |
1275
+ | 3 | [Name] | [Goal] | [REQ-IDs] | [count] |
1276
+
1277
+ ### Phase Details
1278
+
1279
+ **Phase 1: [Name]**
1280
+ Goal: [goal]
1281
+ Requirements: [REQ-IDs]
1282
+ Success criteria:
1283
+ 1. [criterion]
1284
+ 2. [criterion]
1285
+ 3. [criterion]
1286
+
1287
+ [... continue for all phases ...]
1288
+
1289
+ ---
1290
+ ```
1291
+
1292
+ **If auto mode:** Skip approval gate — auto-approve and commit directly.
1293
+
1294
+ **CRITICAL: Ask for approval before committing (interactive mode only):**
1295
+
1296
+ Use AskUserQuestion:
1297
+
1298
+ - header: "Roadmap"
1299
+ - question: "Does this roadmap structure work for you?"
1300
+ - options:
1301
+ - "Approve" — Commit and continue
1302
+ - "Adjust phases" — Tell me what to change
1303
+ - "Review full file" — Show raw ROADMAP.md
1304
+
1305
+ **If "Approve":** Continue to commit.
1306
+
1307
+ **If "Adjust phases":**
1308
+
1309
+ - Get user's adjustment notes
1310
+ - Re-spawn roadmapper with revision context:
1311
+
1312
+ ```
1313
+ Task(prompt="
1314
+ <revision>
1315
+ User feedback on roadmap:
1316
+ [user's notes]
1317
+
1318
+ <files_to_read>
1319
+ - .planning/ROADMAP.md (Current roadmap to revise)
1320
+ </files_to_read>
1321
+
1322
+ ${AGENT_ROADMAPPER}
1323
+
1324
+ Update the roadmap based on feedback. Edit files in place.
1325
+ Return ROADMAP REVISED with changes made.
1326
+ </revision>
1327
+ ", subagent_type="rihal-roadmapper", model="${ROADMAPPER_MODEL}", description="Revise roadmap")
1328
+ ```
1329
+
1330
+ - Present revised roadmap
1331
+ - Loop until user approves
1332
+
1333
+ **If "Review full file":** Display raw `cat .planning/ROADMAP.md`, then re-ask.
1334
+
1335
+ **Generate or refresh project instruction file before final commit:**
1336
+
1337
+ The rihal-tools CLI does not expose a `generate-claude-md` subcommand. Instead, if `$INSTRUCTION_FILE` does not already exist, write a minimal instruction file pointing at the rihal workflow docs:
1338
+
1339
+ ```markdown
1340
+ # {INSTRUCTION_FILE} — project instructions
1341
+
1342
+ This project uses Rihal for planning and execution. See `.planning/PROJECT.md` for context and `.planning/ROADMAP.md` for phases.
1343
+
1344
+ Common commands:
1345
+ - /rihal:progress — check status and next action
1346
+ - /rihal:discuss-phase N — gather context before planning phase N
1347
+ - /rihal:plan N — create a SPRINT.md for phase N
1348
+ - /rihal:execute N — execute a SPRINT.md
1349
+ - /rihal:verify-work — conversational UAT
1350
+ - /rihal:complete-milestone — archive milestone and reset
1351
+
1352
+ Rules:
1353
+ - Never run `git push` without explicit user authorization.
1354
+ - No Claude/AI attribution in commits.
1355
+ - Prefer editing existing files over creating new ones.
1356
+ ```
1357
+
1358
+ If it already exists, leave it alone (respect user-customized content).
1359
+
1360
+ **Commit roadmap (guarded):**
1361
+
1362
+ ```bash
1363
+ git add \
1364
+ .planning/ROADMAP.md \
1365
+ .planning/STATE.md \
1366
+ .planning/REQUIREMENTS.md \
1367
+ "$INSTRUCTION_FILE" 2>/dev/null \
1368
+ && git commit -m "docs: create roadmap ([N] phases)" 2>/dev/null \
1369
+ || echo "ℹ .planning/ gitignored — roadmap written, not committed (instruction file committed separately)"
1370
+
1371
+ # Fallback: also try committing just the instruction file if .planning was ignored
1372
+ git add "$INSTRUCTION_FILE" 2>/dev/null && git commit -m "docs: add project instruction file" 2>/dev/null || true
1373
+ ```
1374
+
1375
+ ## 9. Done
1376
+
1377
+ Present completion summary:
1378
+
1379
+ ```
1380
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1381
+ RIHAL ► PROJECT INITIALIZED ✓
1382
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1383
+
1384
+ **[Project Name]**
1385
+
1386
+ | Artifact | Location |
1387
+ |----------------|-----------------------------|
1388
+ | Project | `.planning/PROJECT.md` |
1389
+ | Config | `.planning/config.json` |
1390
+ | Research | `.planning/research/` |
1391
+ | Requirements | `.planning/REQUIREMENTS.md` |
1392
+ | Roadmap | `.planning/ROADMAP.md` |
1393
+ | Project guide | `$INSTRUCTION_FILE` |
1394
+
1395
+ **[N] phases** | **[X] requirements** | Ready to build ✓
1396
+ ```
1397
+
1398
+ **If auto mode:**
1399
+
1400
+ ```
1401
+ ╔══════════════════════════════════════════╗
1402
+ ║ AUTO-ADVANCING → DISCUSS PHASE 1 ║
1403
+ ╚══════════════════════════════════════════╝
1404
+ ```
1405
+
1406
+ Exit skill and invoke `/rihal:discuss-phase 1 --auto`.
1407
+
1408
+ **If interactive mode:**
1409
+
1410
+ Check if Phase 1 has UI indicators in ROADMAP.md:
1411
+
1412
+ ```bash
1413
+ PHASE1_SECTION=$(sed -n '/^## Phase 1/,/^## Phase /p' .planning/ROADMAP.md)
1414
+ PHASE1_HAS_UI=$(echo "$PHASE1_SECTION" | grep -qiE "UI|interface|frontend|component|layout|page|screen|view|form|dashboard|widget" && echo "true" || echo "false")
1415
+ ```
1416
+
1417
+ **If Phase 1 has UI:**
1418
+
1419
+ ```
1420
+ ───────────────────────────────────────────────────────────────
1421
+
1422
+ ## ▶ Next Up
1423
+
1424
+ **Phase 1: [Phase Name]** — [Goal from ROADMAP.md]
1425
+
1426
+ /clear then:
1427
+
1428
+ /rihal:discuss-phase 1 — gather context and clarify approach
1429
+
1430
+ ---
1431
+
1432
+ **Also available:**
1433
+ - /rihal:ui-phase 1 — generate UI design contract (recommended for frontend phases)
1434
+ - /rihal:plan 1 — skip discussion, plan directly
1435
+
1436
+ ───────────────────────────────────────────────────────────────
1437
+ ```
1438
+
1439
+ **If Phase 1 has no UI:**
1440
+
1441
+ ```
1442
+ ───────────────────────────────────────────────────────────────
1443
+
1444
+ ## ▶ Next Up
1445
+
1446
+ **Phase 1: [Phase Name]** — [Goal from ROADMAP.md]
1447
+
1448
+ /clear then:
1449
+
1450
+ /rihal:discuss-phase 1 — gather context and clarify approach
1451
+
1452
+ ---
1453
+
1454
+ **Also available:**
1455
+ - /rihal:plan 1 — skip discussion, plan directly
1456
+
1457
+ ───────────────────────────────────────────────────────────────
1458
+ ```
1459
+
1460
+ </process>
1461
+
1462
+ <output>
1463
+
1464
+ - `.planning/PROJECT.md`
1465
+ - `.planning/config.json`
1466
+ - `.planning/research/` (if research selected)
1467
+ - `STACK.md`
1468
+ - `FEATURES.md`
1469
+ - `ARCHITECTURE.md`
1470
+ - `PITFALLS.md`
1471
+ - `SUMMARY.md`
1472
+ - `.planning/REQUIREMENTS.md`
1473
+ - `.planning/ROADMAP.md`
1474
+ - `.planning/STATE.md`
1475
+ - `$INSTRUCTION_FILE` (`AGENTS.md` for Codex, `CLAUDE.md` for all other runtimes)
1476
+
1477
+ </output>
1478
+
1479
+ <success_criteria>
1480
+
1481
+ - [ ] .planning/ directory created
1482
+ - [ ] Git repo initialized
1483
+ - [ ] Brownfield detection completed
1484
+ - [ ] Deep questioning completed (threads followed, not rushed)
1485
+ - [ ] PROJECT.md captures full context → **committed (or noted as gitignored)**
1486
+ - [ ] config.json has workflow mode, granularity, parallelization → **committed**
1487
+ - [ ] Research completed (if selected) — 4 parallel agents spawned → **committed**
1488
+ - [ ] Requirements gathered (from research or conversation)
1489
+ - [ ] User scoped each category (v1/v2/out of scope)
1490
+ - [ ] REQUIREMENTS.md created with REQ-IDs → **committed**
1491
+ - [ ] rihal-roadmapper spawned with context
1492
+ - [ ] Roadmap files written immediately (not draft)
1493
+ - [ ] User feedback incorporated (if any)
1494
+ - [ ] ROADMAP.md created with phases, requirement mappings, success criteria
1495
+ - [ ] STATE.md initialized
1496
+ - [ ] REQUIREMENTS.md traceability updated
1497
+ - [ ] `$INSTRUCTION_FILE` generated (if missing) with rihal workflow guidance
1498
+ - [ ] User knows next step is `/rihal:discuss-phase 1`
1499
+ - [ ] No `git push` issued by the workflow (per AGENTS.md)
1500
+
1501
+ **Atomic commits:** Each phase commits its artifacts immediately. If context is lost, artifacts persist. When `.planning/` is gitignored, files are written but commit is skipped gracefully.
1502
+
1503
+ </success_criteria>