@openlife/cli 1.8.3 → 1.9.3

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 (232) hide show
  1. package/.catalog/agents/test-agent/AGENT.md +1 -1
  2. package/.catalog/mcps/test-mcp/mcp.json +1 -1
  3. package/.catalog/skills/sample-from-url/IMPORTED_REFERENCE.md +2 -2
  4. package/.catalog/skills/test-skill/REFERENCE.md +1 -1
  5. package/.catalog/squads/00-governance-advisory-board/workflows/wf-board-meeting.yaml +25 -0
  6. package/.catalog/squads/00-governance-advisory-board/workflows/wf-decision-framework.yaml +25 -0
  7. package/.catalog/squads/00-governance-c-level-squad/workflows/wf-board-presentation.yaml +25 -0
  8. package/.catalog/squads/00-governance-c-level-squad/workflows/wf-strategic-planning.yaml +25 -0
  9. package/.catalog/squads/00-governance-project-ops-squad/workflows/mission-to-project.yaml +25 -0
  10. package/.catalog/squads/00-governance-project-ops-squad/workflows/sprint-planning.yaml +25 -0
  11. package/.catalog/squads/00-governance-project-ops-squad/workflows/weekly-review.yaml +25 -0
  12. package/.catalog/squads/01-meta-framework-swarm-tree-orchestration/workflows/tree-analysis-flow.yaml +25 -0
  13. package/.catalog/squads/01-meta-framework-swarm-tree-orchestration/workflows/tree-execution-flow.yaml +25 -0
  14. package/.catalog/squads/01-meta-framework-swarm-tree-orchestration/workflows/tree-planning-flow.yaml +25 -0
  15. package/.catalog/squads/01-meta-framework-swarm-tree-orchestration/workflows/tree-resume-flow.yaml +25 -0
  16. package/.catalog/squads/02-product-growth-brand-squad/workflows/wf-brand-creation.yaml +25 -0
  17. package/.catalog/squads/02-product-growth-brand-squad/workflows/wf-rebrand.yaml +25 -0
  18. package/.catalog/squads/02-product-growth-copy-squad/workflows/wf-copy-review-cycle.yaml +25 -0
  19. package/.catalog/squads/02-product-growth-copy-squad/workflows/wf-full-copy-project.yaml +25 -0
  20. package/.catalog/squads/02-product-growth-design-squad/workflows/wf-design-system-creation.yaml +25 -0
  21. package/.catalog/squads/02-product-growth-design-squad/workflows/wf-feature-design.yaml +25 -0
  22. package/.catalog/squads/02-product-growth-hormozi-squad/workflows/wf-business-turnaround.yaml +25 -0
  23. package/.catalog/squads/02-product-growth-hormozi-squad/workflows/wf-offer-creation.yaml +25 -0
  24. package/.catalog/squads/02-product-growth-movement/workflows/wf-movement-launch.yaml +25 -0
  25. package/.catalog/squads/02-product-growth-saas-onboarding-activator/workflows/full-onboarding-activation-workflow.yaml +25 -0
  26. package/.catalog/squads/02-product-growth-saas-onboarding-activator/workflows/quick-engagement-boost-workflow.yaml +25 -0
  27. package/.catalog/squads/02-product-growth-sales-squad/workflows/followup-sequence.yaml +25 -0
  28. package/.catalog/squads/02-product-growth-sales-squad/workflows/full-sales-cycle.yaml +25 -0
  29. package/.catalog/squads/02-product-growth-sales-squad/workflows/proposal-flow.yaml +25 -0
  30. package/.catalog/squads/02-product-growth-storytelling/workflows/wf-brand-narrative.yaml +25 -0
  31. package/.catalog/squads/02-product-growth-storytelling/workflows/wf-story-development.yaml +25 -0
  32. package/.catalog/squads/02-product-growth-traffic-masters/workflows/wf-account-audit.yaml +25 -0
  33. package/.catalog/squads/02-product-growth-traffic-masters/workflows/wf-campaign-launch.yaml +25 -0
  34. package/.catalog/squads/03-engineering-quality-automated-code-review-squad/workflows/full-code-review-workflow.yaml +25 -0
  35. package/.catalog/squads/03-engineering-quality-automated-code-review-squad/workflows/quick-security-check-workflow.yaml +25 -0
  36. package/.catalog/squads/04-data-security-cybersecurity/workflows/wf-incident-response.yaml +25 -0
  37. package/.catalog/squads/04-data-security-cybersecurity/workflows/wf-pentest-engagement.yaml +25 -0
  38. package/.catalog/squads/04-data-security-data-quality-guardian/workflows/full-data-quality-audit-workflow.yaml +25 -0
  39. package/.catalog/squads/04-data-security-data-quality-guardian/workflows/quick-data-check-workflow.yaml +25 -0
  40. package/.catalog/squads/04-data-security-data-squad/workflows/wf-analytics-setup.yaml +25 -0
  41. package/.catalog/squads/04-data-security-data-squad/workflows/wf-growth-sprint.yaml +25 -0
  42. package/.catalog/squads/04-data-security-incident-response-squad/workflows/full-incident-response-workflow.yaml +25 -0
  43. package/.catalog/squads/04-data-security-incident-response-squad/workflows/rapid-triage-workflow.yaml +25 -0
  44. package/.catalog/squads/04-data-security-soc-alert-triage/workflows/full-alert-triage-workflow.yaml +25 -0
  45. package/.catalog/squads/04-data-security-soc-alert-triage/workflows/rapid-classification-workflow.yaml +25 -0
  46. package/.catalog/squads/05-domain-specialists-adaptive-tutor-k12/workflows/full-tutoring-cycle-workflow.yaml +25 -0
  47. package/.catalog/squads/05-domain-specialists-adaptive-tutor-k12/workflows/quick-practice-session-workflow.yaml +25 -0
  48. package/.catalog/squads/05-domain-specialists-ambient-clinical-scribe/workflows/full-documentation-workflow.yaml +25 -0
  49. package/.catalog/squads/05-domain-specialists-ambient-clinical-scribe/workflows/quick-note-workflow.yaml +25 -0
  50. package/.catalog/squads/05-domain-specialists-contract-review-squad/workflows/full-contract-review-workflow.yaml +25 -0
  51. package/.catalog/squads/05-domain-specialists-contract-review-squad/workflows/quick-risk-assessment-workflow.yaml +25 -0
  52. package/.catalog/squads/05-domain-specialists-crypto-token-forge/workflows/full-token-launch-workflow.yaml +25 -0
  53. package/.catalog/squads/05-domain-specialists-crypto-token-forge/workflows/memecoin-express-workflow.yaml +25 -0
  54. package/.catalog/squads/05-domain-specialists-crypto-token-forge/workflows/utility-token-launch-workflow.yaml +25 -0
  55. package/.catalog/squads/05-domain-specialists-resume-screener-squad/workflows/full-resume-screening-workflow.yaml +25 -0
  56. package/.catalog/squads/05-domain-specialists-resume-screener-squad/workflows/quick-skills-match-workflow.yaml +25 -0
  57. package/.catalog/squads/test-squad/SQUAD.md +1 -1
  58. package/.openlife/method/agents/atlas.md +102 -0
  59. package/.openlife/method/agents/builder.md +92 -0
  60. package/.openlife/method/agents/conductor.md +93 -0
  61. package/.openlife/method/agents/forge.md +96 -0
  62. package/.openlife/method/agents/genesis.md +115 -0
  63. package/.openlife/method/agents/lyra.md +85 -0
  64. package/.openlife/method/agents/maestro.md +92 -0
  65. package/.openlife/method/agents/mesh.md +101 -0
  66. package/.openlife/method/agents/prism.md +85 -0
  67. package/.openlife/method/agents/sentinel.md +115 -0
  68. package/.openlife/method/agents/steward.md +93 -0
  69. package/.openlife/method/agents/vortex.md +94 -0
  70. package/dist/cli/CommandFlowRunner.js +167 -0
  71. package/dist/cli/install/Phases.js +43 -0
  72. package/dist/index.js +118 -0
  73. package/dist/orchestrator/ProjectMetadata.js +183 -0
  74. package/dist/test_flow_run_cli.js +183 -0
  75. package/dist/test_host_uninstaller.js +12 -2
  76. package/dist/test_openlife_method_inventory.js +183 -0
  77. package/dist/test_workflow_e2e.js +10 -3
  78. package/dist-templates/claude-code/agents/openlife-atlas.md +12 -44
  79. package/dist-templates/claude-code/agents/openlife-builder.md +20 -0
  80. package/dist-templates/claude-code/agents/openlife-conductor.md +20 -0
  81. package/dist-templates/claude-code/agents/openlife-forge.md +12 -34
  82. package/dist-templates/claude-code/agents/openlife-genesis.md +12 -51
  83. package/dist-templates/claude-code/agents/openlife-lyra.md +12 -32
  84. package/dist-templates/claude-code/agents/openlife-maestro.md +27 -41
  85. package/dist-templates/claude-code/agents/openlife-mesh.md +20 -0
  86. package/dist-templates/claude-code/agents/openlife-prism.md +20 -0
  87. package/dist-templates/claude-code/agents/openlife-sentinel.md +20 -0
  88. package/dist-templates/claude-code/agents/openlife-steward.md +20 -0
  89. package/dist-templates/claude-code/agents/openlife-vortex.md +20 -0
  90. package/dist-templates/claude-code/commands/openlife/agents/atlas.md +24 -0
  91. package/dist-templates/claude-code/commands/openlife/agents/builder.md +24 -0
  92. package/dist-templates/claude-code/commands/openlife/agents/conductor.md +24 -0
  93. package/dist-templates/claude-code/commands/openlife/agents/forge.md +24 -0
  94. package/dist-templates/claude-code/commands/openlife/agents/genesis.md +24 -0
  95. package/dist-templates/claude-code/commands/openlife/agents/lyra.md +24 -0
  96. package/dist-templates/claude-code/commands/openlife/agents/maestro.md +24 -0
  97. package/dist-templates/claude-code/commands/openlife/agents/mesh.md +24 -0
  98. package/dist-templates/claude-code/commands/openlife/agents/prism.md +24 -0
  99. package/dist-templates/claude-code/commands/openlife/agents/sentinel.md +24 -0
  100. package/dist-templates/claude-code/commands/openlife/agents/steward.md +24 -0
  101. package/dist-templates/claude-code/commands/openlife/agents/vortex.md +24 -0
  102. package/dist-templates/claude-code/commands/openlife/ask.md +13 -7
  103. package/dist-templates/claude-code/commands/openlife/audit.md +14 -0
  104. package/dist-templates/claude-code/commands/openlife/doctor.md +11 -14
  105. package/dist-templates/claude-code/commands/openlife/dream.md +10 -16
  106. package/dist-templates/claude-code/commands/openlife/explore.md +14 -0
  107. package/dist-templates/claude-code/commands/openlife/flow/brownfield-discovery.md +20 -0
  108. package/dist-templates/claude-code/commands/openlife/flow/brownfield-fullstack.md +20 -0
  109. package/dist-templates/claude-code/commands/openlife/flow/brownfield-service.md +20 -0
  110. package/dist-templates/claude-code/commands/openlife/flow/brownfield-ui.md +20 -0
  111. package/dist-templates/claude-code/commands/openlife/flow/epic.md +20 -0
  112. package/dist-templates/claude-code/commands/openlife/flow/greenfield-fullstack.md +20 -0
  113. package/dist-templates/claude-code/commands/openlife/flow/greenfield-service.md +20 -0
  114. package/dist-templates/claude-code/commands/openlife/flow/greenfield-ui.md +20 -0
  115. package/dist-templates/claude-code/commands/openlife/flow/qa-loop.md +20 -0
  116. package/dist-templates/claude-code/commands/openlife/flow/release.md +20 -0
  117. package/dist-templates/claude-code/commands/openlife/flow/spec-pipeline.md +20 -0
  118. package/dist-templates/claude-code/commands/openlife/flow/story-cycle.md +20 -0
  119. package/dist-templates/claude-code/commands/openlife/health.md +14 -0
  120. package/dist-templates/claude-code/commands/openlife/plan.md +14 -0
  121. package/dist-templates/claude-code/commands/openlife/review.md +14 -0
  122. package/dist-templates/claude-code/commands/openlife/ship.md +14 -0
  123. package/dist-templates/claude-code/commands/openlife/start.md +25 -0
  124. package/dist-templates/claude-code/commands/openlife/status.md +10 -10
  125. package/dist-templates/claude-code/commands/openlife/story.md +18 -0
  126. package/dist-templates/codex/agents/openlife-atlas.md +12 -44
  127. package/dist-templates/codex/agents/openlife-builder.md +20 -0
  128. package/dist-templates/codex/agents/openlife-conductor.md +20 -0
  129. package/dist-templates/codex/agents/openlife-forge.md +12 -34
  130. package/dist-templates/codex/agents/openlife-genesis.md +12 -51
  131. package/dist-templates/codex/agents/openlife-lyra.md +12 -32
  132. package/dist-templates/codex/agents/openlife-maestro.md +27 -41
  133. package/dist-templates/codex/agents/openlife-mesh.md +20 -0
  134. package/dist-templates/codex/agents/openlife-prism.md +20 -0
  135. package/dist-templates/codex/agents/openlife-sentinel.md +20 -0
  136. package/dist-templates/codex/agents/openlife-steward.md +20 -0
  137. package/dist-templates/codex/agents/openlife-vortex.md +20 -0
  138. package/dist-templates/codex/commands/openlife/agents/atlas.md +24 -0
  139. package/dist-templates/codex/commands/openlife/agents/builder.md +24 -0
  140. package/dist-templates/codex/commands/openlife/agents/conductor.md +24 -0
  141. package/dist-templates/codex/commands/openlife/agents/forge.md +24 -0
  142. package/dist-templates/codex/commands/openlife/agents/genesis.md +24 -0
  143. package/dist-templates/codex/commands/openlife/agents/lyra.md +24 -0
  144. package/dist-templates/codex/commands/openlife/agents/maestro.md +24 -0
  145. package/dist-templates/codex/commands/openlife/agents/mesh.md +24 -0
  146. package/dist-templates/codex/commands/openlife/agents/prism.md +24 -0
  147. package/dist-templates/codex/commands/openlife/agents/sentinel.md +24 -0
  148. package/dist-templates/codex/commands/openlife/agents/steward.md +24 -0
  149. package/dist-templates/codex/commands/openlife/agents/vortex.md +24 -0
  150. package/dist-templates/codex/commands/openlife/ask.md +13 -7
  151. package/dist-templates/codex/commands/openlife/audit.md +14 -0
  152. package/dist-templates/codex/commands/openlife/doctor.md +11 -14
  153. package/dist-templates/codex/commands/openlife/dream.md +10 -16
  154. package/dist-templates/codex/commands/openlife/explore.md +14 -0
  155. package/dist-templates/codex/commands/openlife/flow/brownfield-discovery.md +20 -0
  156. package/dist-templates/codex/commands/openlife/flow/brownfield-fullstack.md +20 -0
  157. package/dist-templates/codex/commands/openlife/flow/brownfield-service.md +20 -0
  158. package/dist-templates/codex/commands/openlife/flow/brownfield-ui.md +20 -0
  159. package/dist-templates/codex/commands/openlife/flow/epic.md +20 -0
  160. package/dist-templates/codex/commands/openlife/flow/greenfield-fullstack.md +20 -0
  161. package/dist-templates/codex/commands/openlife/flow/greenfield-service.md +20 -0
  162. package/dist-templates/codex/commands/openlife/flow/greenfield-ui.md +20 -0
  163. package/dist-templates/codex/commands/openlife/flow/qa-loop.md +20 -0
  164. package/dist-templates/codex/commands/openlife/flow/release.md +20 -0
  165. package/dist-templates/codex/commands/openlife/flow/spec-pipeline.md +20 -0
  166. package/dist-templates/codex/commands/openlife/flow/story-cycle.md +20 -0
  167. package/dist-templates/codex/commands/openlife/health.md +14 -0
  168. package/dist-templates/codex/commands/openlife/plan.md +14 -0
  169. package/dist-templates/codex/commands/openlife/review.md +14 -0
  170. package/dist-templates/codex/commands/openlife/ship.md +14 -0
  171. package/dist-templates/codex/commands/openlife/start.md +25 -0
  172. package/dist-templates/codex/commands/openlife/status.md +10 -10
  173. package/dist-templates/codex/commands/openlife/story.md +18 -0
  174. package/dist-templates/gemini-cli/agents/openlife-atlas.md +12 -44
  175. package/dist-templates/gemini-cli/agents/openlife-builder.md +20 -0
  176. package/dist-templates/gemini-cli/agents/openlife-conductor.md +20 -0
  177. package/dist-templates/gemini-cli/agents/openlife-forge.md +12 -34
  178. package/dist-templates/gemini-cli/agents/openlife-genesis.md +12 -51
  179. package/dist-templates/gemini-cli/agents/openlife-lyra.md +12 -32
  180. package/dist-templates/gemini-cli/agents/openlife-maestro.md +27 -41
  181. package/dist-templates/gemini-cli/agents/openlife-mesh.md +20 -0
  182. package/dist-templates/gemini-cli/agents/openlife-prism.md +20 -0
  183. package/dist-templates/gemini-cli/agents/openlife-sentinel.md +20 -0
  184. package/dist-templates/gemini-cli/agents/openlife-steward.md +20 -0
  185. package/dist-templates/gemini-cli/agents/openlife-vortex.md +20 -0
  186. package/dist-templates/gemini-cli/commands/openlife/agents/atlas.md +24 -0
  187. package/dist-templates/gemini-cli/commands/openlife/agents/builder.md +24 -0
  188. package/dist-templates/gemini-cli/commands/openlife/agents/conductor.md +24 -0
  189. package/dist-templates/gemini-cli/commands/openlife/agents/forge.md +24 -0
  190. package/dist-templates/gemini-cli/commands/openlife/agents/genesis.md +24 -0
  191. package/dist-templates/gemini-cli/commands/openlife/agents/lyra.md +24 -0
  192. package/dist-templates/gemini-cli/commands/openlife/agents/maestro.md +24 -0
  193. package/dist-templates/gemini-cli/commands/openlife/agents/mesh.md +24 -0
  194. package/dist-templates/gemini-cli/commands/openlife/agents/prism.md +24 -0
  195. package/dist-templates/gemini-cli/commands/openlife/agents/sentinel.md +24 -0
  196. package/dist-templates/gemini-cli/commands/openlife/agents/steward.md +24 -0
  197. package/dist-templates/gemini-cli/commands/openlife/agents/vortex.md +24 -0
  198. package/dist-templates/gemini-cli/commands/openlife/ask.md +13 -7
  199. package/dist-templates/gemini-cli/commands/openlife/audit.md +14 -0
  200. package/dist-templates/gemini-cli/commands/openlife/doctor.md +11 -14
  201. package/dist-templates/gemini-cli/commands/openlife/dream.md +10 -16
  202. package/dist-templates/gemini-cli/commands/openlife/explore.md +14 -0
  203. package/dist-templates/gemini-cli/commands/openlife/flow/brownfield-discovery.md +20 -0
  204. package/dist-templates/gemini-cli/commands/openlife/flow/brownfield-fullstack.md +20 -0
  205. package/dist-templates/gemini-cli/commands/openlife/flow/brownfield-service.md +20 -0
  206. package/dist-templates/gemini-cli/commands/openlife/flow/brownfield-ui.md +20 -0
  207. package/dist-templates/gemini-cli/commands/openlife/flow/epic.md +20 -0
  208. package/dist-templates/gemini-cli/commands/openlife/flow/greenfield-fullstack.md +20 -0
  209. package/dist-templates/gemini-cli/commands/openlife/flow/greenfield-service.md +20 -0
  210. package/dist-templates/gemini-cli/commands/openlife/flow/greenfield-ui.md +20 -0
  211. package/dist-templates/gemini-cli/commands/openlife/flow/qa-loop.md +20 -0
  212. package/dist-templates/gemini-cli/commands/openlife/flow/release.md +20 -0
  213. package/dist-templates/gemini-cli/commands/openlife/flow/spec-pipeline.md +20 -0
  214. package/dist-templates/gemini-cli/commands/openlife/flow/story-cycle.md +20 -0
  215. package/dist-templates/gemini-cli/commands/openlife/health.md +14 -0
  216. package/dist-templates/gemini-cli/commands/openlife/plan.md +14 -0
  217. package/dist-templates/gemini-cli/commands/openlife/review.md +14 -0
  218. package/dist-templates/gemini-cli/commands/openlife/ship.md +14 -0
  219. package/dist-templates/gemini-cli/commands/openlife/start.md +25 -0
  220. package/dist-templates/gemini-cli/commands/openlife/status.md +10 -10
  221. package/dist-templates/gemini-cli/commands/openlife/story.md +18 -0
  222. package/dist-templates/workflows/brownfield-fullstack.yaml +131 -0
  223. package/dist-templates/workflows/brownfield-service.yaml +111 -0
  224. package/dist-templates/workflows/brownfield-ui.yaml +115 -0
  225. package/dist-templates/workflows/continuous-deployment.yaml +139 -0
  226. package/dist-templates/workflows/epic-orchestration.yaml +101 -0
  227. package/dist-templates/workflows/greenfield-service.yaml +154 -0
  228. package/dist-templates/workflows/greenfield-ui.yaml +140 -0
  229. package/dist-templates/workflows/spec-pipeline.yaml +135 -0
  230. package/package.json +5 -2
  231. package/scripts/generate-slash-commands.js +220 -0
  232. package/scripts/generate-squad-workflow-stubs.js +144 -0
@@ -0,0 +1,220 @@
1
+ #!/usr/bin/env node
2
+ // scripts/generate-slash-commands.js
3
+ // One-shot generator for the OpenLife method's slash command surface.
4
+ // Produces files under dist-templates/<host>/commands/openlife/{,agents/,flow/}
5
+ // for hosts: claude-code, gemini-cli, codex.
6
+ //
7
+ // Idempotent: re-running overwrites with the canonical content.
8
+
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+
12
+ const HOSTS = ['claude-code', 'gemini-cli', 'codex'];
13
+ const REPO_ROOT = path.resolve(__dirname, '..');
14
+
15
+ // ─── Command catalog ────────────────────────────────────────────────────
16
+
17
+ const TOP_LEVEL = [
18
+ {
19
+ name: 'ask',
20
+ description: 'Ask the OpenLife Brain a question (uses primary/fallback model chain configured in models.json)',
21
+ argumentHint: '<question>',
22
+ body: 'Run `openlife ask "$ARGUMENTS"` and return the Brain\'s answer.\n\nNotes:\n- Uses the configured models.json chain (primary + fallbacks). If primary fails, it falls through.\n- The `OPENLIFE_ASK_TIMEOUT_MS` env var caps total time (default 90s).\n- If ask errors, report the error and suggest `openlife system doctor` to diagnose.',
23
+ keep: true,
24
+ },
25
+ {
26
+ name: 'doctor',
27
+ description: 'Run OpenLife health checks (API keys, model chain, runtime catalogs, daemon state)',
28
+ body: 'Run `openlife system doctor` and walk the user through results.\n\nFor each failed check: quote the line, explain in 1 sentence what it verifies, suggest the concrete fix.',
29
+ keep: true,
30
+ },
31
+ {
32
+ name: 'status',
33
+ description: 'Show OpenLife system status — installed profile, host, catalog counts, daemon state',
34
+ body: 'Run `openlife status --json` and present a tight summary of: active profile, host CLIs installed, catalog counts (agents/squads/skills), daemon heartbeat freshness, telegram allowed user.',
35
+ keep: true,
36
+ },
37
+ {
38
+ name: 'dream',
39
+ description: 'Run the OpenLife Dream Organizer — surfaces ideas, pending stories, and prioritization from accumulated context',
40
+ body: 'Run `openlife dream "$ARGUMENTS"` to surface unprioritized ideas and stories from memory. Present the output grouped by theme.',
41
+ keep: true,
42
+ },
43
+ {
44
+ name: 'start',
45
+ description: 'Bootstrap or resume work — reads .openlife/project.json mode and routes to greenfield or brownfield flow',
46
+ body: 'Detect the project mode:\n\n1. Read `.openlife/project.json` if it exists. Use its `mode` field (`greenfield` / `brownfield` / `not-applicable`).\n2. If missing, ask the user via AskUserQuestion:\n - "Is this a brand new project (greenfield) or existing codebase (brownfield)?"\n3. Based on the answer, recommend a workflow:\n - greenfield + fullstack → `openlife flow run greenfield-fullstack`\n - greenfield + service → `openlife flow run greenfield-service`\n - greenfield + ui → `openlife flow run greenfield-ui`\n - brownfield + first time → `openlife flow run brownfield-discovery`\n - brownfield + already discovered → ask sub-mode (fullstack/service/ui)\n4. If mode was just set, persist via `openlife project-mode set <mode>`.',
47
+ },
48
+ {
49
+ name: 'plan',
50
+ description: 'Run the spec pipeline — gather requirements, assess complexity, write executable spec',
51
+ body: 'Run `openlife flow run spec-pipeline "$ARGUMENTS"`. The 6-phase pipeline: gather → assess → research → write → critique → plan. Walk the user through each phase\'s output.',
52
+ },
53
+ {
54
+ name: 'story',
55
+ description: 'Create the next story from an epic (Conductor) or validate a draft (Steward)',
56
+ body: 'Determine intent from $ARGUMENTS:\n\n- If the user wants to CREATE a story → activate `@openlife-conductor` (reads `.openlife/method/agents/conductor.md`) and run `*create-next-story`.\n- If the user wants to VALIDATE a draft → activate `@openlife-steward` and run `*validate-story`.\n- If unclear, ask via AskUserQuestion which action to take.',
57
+ },
58
+ {
59
+ name: 'review',
60
+ description: 'Run the QA gate on a story (Sentinel) — 7-check verdict: PASS / CONCERNS / FAIL / WAIVED',
61
+ body: 'Activate `@openlife-sentinel` (reads `.openlife/method/agents/sentinel.md`) and run `*qa-gate "$ARGUMENTS"`. Pass the story id or the file path as the argument. Report the verdict + structured findings.',
62
+ },
63
+ {
64
+ name: 'ship',
65
+ description: 'Run the continuous-deployment workflow — release pipeline driven by Vortex',
66
+ body: 'Run `openlife flow run continuous-deployment "$ARGUMENTS"`. Vortex drives: pre-release QA, PR open, CI wait, merge, version bump, tag, publish. Maestro logs the release event at the end.',
67
+ },
68
+ {
69
+ name: 'explore',
70
+ description: 'Exploratory ideation with Lyra — divergent brainstorming, then convergent narrative',
71
+ body: 'Activate `@openlife-lyra` (reads `.openlife/method/agents/lyra.md`) and run `*brainstorm "$ARGUMENTS"`. Surface options + tradeoffs. Do NOT commit to a plan in this command — that\'s `/openlife:plan`.',
72
+ },
73
+ {
74
+ name: 'audit',
75
+ description: 'Run brownfield-discovery — 10-phase audit of an existing codebase',
76
+ body: 'Run `openlife flow run brownfield-discovery "$ARGUMENTS"`. The 10-phase audit produces architecture, schema, frontend specs, technical-debt assessment, and a backlog of remediation stories.',
77
+ },
78
+ {
79
+ name: 'health',
80
+ description: 'Extended health check — combines `doctor` with runtime diagnostics from Maestro',
81
+ body: 'Run `openlife system doctor` first, then activate `@openlife-maestro` and run `*health` to check cross-agent integrity (catalog completeness, missing handoff artifacts, draft components pending promotion).',
82
+ },
83
+ ];
84
+
85
+ const AGENTS = [
86
+ { id: 'maestro', desc: 'Master Orchestrator — routes work, manages handoffs, arbitrates cross-agent decisions' },
87
+ { id: 'builder', desc: 'Full-Stack Developer — implements validated stories with self-review' },
88
+ { id: 'sentinel', desc: 'QA / Test Architect — 7-check gate + iterative QA Loop (max 5)' },
89
+ { id: 'steward', desc: 'Product Owner / Story Validator — owns the Draft → Ready gate' },
90
+ { id: 'conductor', desc: 'Scrum Master — drafts stories, manages sprint cadence, runs retros' },
91
+ { id: 'vortex', desc: 'DevOps — EXCLUSIVE authority over git push, gh PR, MCP, releases' },
92
+ { id: 'mesh', desc: 'Data Engineer — DDL, query optimization, RLS policies, migrations' },
93
+ { id: 'prism', desc: 'UX / UI Designer — wireframes, user research, design-system audits' },
94
+ { id: 'atlas', desc: 'System Architect — ADRs, technology selection, impact analysis' },
95
+ { id: 'lyra', desc: 'Analyst — deep research, synthesis, PRDs, ADRs, release notes' },
96
+ { id: 'forge', desc: 'Component Creator — agents, squads, skills, workflows, MCP configs, slash commands' },
97
+ { id: 'genesis', desc: 'Product Manager / Bootstrap — gather requirements, create epics, set project mode' },
98
+ ];
99
+
100
+ const FLOWS = [
101
+ { id: 'greenfield-fullstack', desc: 'Greenfield Full-Stack: end-to-end new app from concept to shippable stories' },
102
+ { id: 'greenfield-service', desc: 'Greenfield Service: backend-only / API-only / CLI / worker / MCP server' },
103
+ { id: 'greenfield-ui', desc: 'Greenfield UI: frontend-only / SPA / landing / admin panel / docs site' },
104
+ { id: 'brownfield-discovery', desc: 'Brownfield Discovery: 10-phase audit of an existing codebase' },
105
+ { id: 'brownfield-fullstack', desc: 'Brownfield Full-Stack: enhance an existing full-stack app' },
106
+ { id: 'brownfield-service', desc: 'Brownfield Service: modify an existing service / API' },
107
+ { id: 'brownfield-ui', desc: 'Brownfield UI: refactor or enhance an existing UI' },
108
+ { id: 'story-cycle', wfId: 'story-development-cycle', desc: 'Story Development Cycle: 4-phase Create → Validate → Implement → QA' },
109
+ { id: 'qa-loop', desc: 'QA Loop: iterative review-fix cycle (max 5 iterations) between Sentinel and Builder' },
110
+ { id: 'spec-pipeline', desc: 'Spec Pipeline: 6-phase gather → assess → research → write → critique → plan' },
111
+ { id: 'epic', wfId: 'epic-orchestration', desc: 'Epic Orchestration: coordinate multiple dependent stories within an epic' },
112
+ { id: 'release', wfId: 'continuous-deployment', desc: 'Continuous Deployment: release pipeline driven by Vortex (PR → merge → tag → publish)' },
113
+ ];
114
+
115
+ // ─── File renderers ─────────────────────────────────────────────────────
116
+
117
+ function renderTopLevel(cmd) {
118
+ const hintLine = cmd.argumentHint ? `argument-hint: "${cmd.argumentHint}"\n` : '';
119
+ return `---
120
+ description: ${cmd.description}
121
+ ${hintLine}allowed-tools:
122
+ - Read
123
+ - Write
124
+ - Edit
125
+ - Bash(openlife:*)
126
+ - Grep
127
+ - Glob
128
+ - Agent
129
+ - AskUserQuestion
130
+ ---
131
+
132
+ ${cmd.body}
133
+ `;
134
+ }
135
+
136
+ function renderAgent(agent) {
137
+ return `---
138
+ description: Activate ${capitalize(agent.id)} — ${agent.desc}
139
+ argument-hint: "[optional context]"
140
+ allowed-tools:
141
+ - Read
142
+ - Write
143
+ - Edit
144
+ - Bash(openlife:*)
145
+ - Grep
146
+ - Glob
147
+ - Agent
148
+ - AskUserQuestion
149
+ ---
150
+
151
+ Activate **${capitalize(agent.id)}** from the OpenLife method.
152
+
153
+ 1. Read \`.openlife/method/agents/${agent.id}.md\` in full.
154
+ 2. Adopt the persona and execute the activation flow defined there:
155
+ - Display the persona greeting (icon + 1-line role)
156
+ - Show the top 5 commands
157
+ - HALT and await \`*command\` from the user
158
+ 3. If \`$ARGUMENTS\` is non-empty, treat it as an initial task or context for the persona.
159
+
160
+ After the user's first \`*command\`, follow the persona's hand-off rules to suggest the next persona when appropriate.
161
+ `;
162
+ }
163
+
164
+ function renderFlow(flow) {
165
+ const wfId = flow.wfId || flow.id;
166
+ return `---
167
+ description: ${flow.desc}
168
+ argument-hint: "[--dry-run] [--vars key=value]"
169
+ allowed-tools:
170
+ - Read
171
+ - Bash(openlife:*)
172
+ - Grep
173
+ - Glob
174
+ - Agent
175
+ - AskUserQuestion
176
+ ---
177
+
178
+ Run \`openlife flow run ${wfId} $ARGUMENTS\` and walk the user through the workflow as it executes.
179
+
180
+ - The workflow YAML is at \`dist-templates/workflows/${wfId}.yaml\` (or \`.openlife/method/workflows/${wfId}.yaml\` if locally overridden).
181
+ - Each phase invokes one or more OpenLife method agents.
182
+ - On any failure: surface the failing step + which agent is responsible, then offer to escalate to \`@openlife-maestro\`.
183
+ - \`--dry-run\` prints the phase plan without executing.
184
+
185
+ Refer the user to the persona of the active phase when they ask "who is doing this?".
186
+ `;
187
+ }
188
+
189
+ function capitalize(s) {
190
+ return s[0].toUpperCase() + s.slice(1);
191
+ }
192
+
193
+ // ─── Emit ───────────────────────────────────────────────────────────────
194
+
195
+ let total = 0;
196
+
197
+ for (const host of HOSTS) {
198
+ const baseDir = path.join(REPO_ROOT, 'dist-templates', host, 'commands', 'openlife');
199
+ fs.mkdirSync(path.join(baseDir, 'agents'), { recursive: true });
200
+ fs.mkdirSync(path.join(baseDir, 'flow'), { recursive: true });
201
+
202
+ for (const cmd of TOP_LEVEL) {
203
+ const fp = path.join(baseDir, `${cmd.name}.md`);
204
+ fs.writeFileSync(fp, renderTopLevel(cmd));
205
+ total++;
206
+ }
207
+ for (const agent of AGENTS) {
208
+ const fp = path.join(baseDir, 'agents', `${agent.id}.md`);
209
+ fs.writeFileSync(fp, renderAgent(agent));
210
+ total++;
211
+ }
212
+ for (const flow of FLOWS) {
213
+ const fp = path.join(baseDir, 'flow', `${flow.id}.md`);
214
+ fs.writeFileSync(fp, renderFlow(flow));
215
+ total++;
216
+ }
217
+ }
218
+
219
+ console.log(`[generate-slash-commands] wrote ${total} files across ${HOSTS.length} hosts.`);
220
+ console.log(`Breakdown per host: ${TOP_LEVEL.length} top-level + ${AGENTS.length} agents + ${FLOWS.length} flows = ${TOP_LEVEL.length + AGENTS.length + FLOWS.length}`);
@@ -0,0 +1,144 @@
1
+ #!/usr/bin/env node
2
+ // scripts/generate-squad-workflow-stubs.js
3
+ //
4
+ // Walks `.catalog/squads/*/SQUAD.md`, extracts the workflows declared in
5
+ // each squad's embedded yaml block (the `workflows:` list under
6
+ // `components:`), and creates parse-clean stub `.yaml` files at
7
+ // `.catalog/squads/<squad-id>/workflows/<ref>` for any reference that
8
+ // lacks a corresponding file on disk.
9
+ //
10
+ // Stubs are marked `status: draft` so the framework treats them as
11
+ // pending fleshing-out (via aiobuilder evolve or manual editing).
12
+ //
13
+ // Idempotent: re-running only creates missing files, never overwrites.
14
+
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+
18
+ const REPO_ROOT = path.resolve(__dirname, '..');
19
+ const SQUADS_DIR = path.join(REPO_ROOT, '.catalog', 'squads');
20
+
21
+ if (!fs.existsSync(SQUADS_DIR)) {
22
+ console.error(`SQUADS_DIR_MISSING: ${SQUADS_DIR}`);
23
+ process.exit(1);
24
+ }
25
+
26
+ function humanize(ref) {
27
+ return ref
28
+ .replace(/\.ya?ml$/, '')
29
+ .replace(/^wf-/, '')
30
+ .replace(/-/g, ' ')
31
+ .replace(/\b\w/g, (c) => c.toUpperCase());
32
+ }
33
+
34
+ function extractWorkflowRefs(squadMd) {
35
+ // Matches:
36
+ // workflows:
37
+ // - wf-foo.yaml
38
+ // - wf-bar.yaml
39
+ // (possibly nested with extra indentation; we just match the list items)
40
+ const refs = new Set();
41
+ const lines = squadMd.split('\n');
42
+ let inWorkflowBlock = false;
43
+ let workflowIndent = -1;
44
+
45
+ for (const raw of lines) {
46
+ const trimmed = raw.trimStart();
47
+ const indent = raw.length - trimmed.length;
48
+
49
+ if (/^workflows:\s*$/.test(trimmed)) {
50
+ inWorkflowBlock = true;
51
+ workflowIndent = indent;
52
+ continue;
53
+ }
54
+
55
+ if (inWorkflowBlock) {
56
+ // Exit block on the first non-list-item line at or below the parent indent
57
+ if (trimmed === '' || (indent <= workflowIndent && !trimmed.startsWith('-'))) {
58
+ inWorkflowBlock = false;
59
+ continue;
60
+ }
61
+ // List item: `- wf-foo.yaml` or `- "wf-foo.yaml"`
62
+ const m = trimmed.match(/^-\s+["']?([^"'\s]+\.ya?ml)["']?\s*$/);
63
+ if (m) refs.add(m[1]);
64
+ }
65
+ }
66
+
67
+ return Array.from(refs);
68
+ }
69
+
70
+ function renderStub(ref, squadId) {
71
+ const id = ref.replace(/\.ya?ml$/, '');
72
+ const name = humanize(ref);
73
+ // Stub is a parse-clean Workflow YAML. status:draft signals not-yet-fleshed.
74
+ return `workflow:
75
+ id: ${squadId}/${id}
76
+ name: "${name} (${squadId})"
77
+ description: >-
78
+ Stub workflow scaffolded for squad ${squadId}. Declared in SQUAD.md but
79
+ not yet fleshed out. Run \`openlife aiobuilder evolve\` or edit manually
80
+ to define phases, sequence, and success criteria.
81
+ type: custom
82
+ version: "0.1"
83
+ status: draft
84
+ framework: openlife-method
85
+
86
+ sequence:
87
+ - phase: 1
88
+ name: "TODO"
89
+ - id: todo-step
90
+ agent: openlife-forge
91
+ action: define_workflow
92
+ notes: |
93
+ Define the squad-internal workflow logic here.
94
+ Replace this stub with real phases and steps. When complete, change
95
+ status from "draft" to "active".
96
+
97
+ handoff_prompts:
98
+ initial: "This is a stub — define the workflow before running it."
99
+ `;
100
+ }
101
+
102
+ // ─── Main ───────────────────────────────────────────────────────────────
103
+
104
+ let squadsTotal = 0;
105
+ let squadsWithRefs = 0;
106
+ let stubsCreated = 0;
107
+ let stubsSkipped = 0;
108
+ const missingDetails = [];
109
+
110
+ for (const squadId of fs.readdirSync(SQUADS_DIR).sort()) {
111
+ const squadDir = path.join(SQUADS_DIR, squadId);
112
+ if (!fs.statSync(squadDir).isDirectory()) continue;
113
+ if (squadId.startsWith('test-')) continue; // test pollution
114
+
115
+ squadsTotal++;
116
+ const squadMdPath = path.join(squadDir, 'SQUAD.md');
117
+ if (!fs.existsSync(squadMdPath)) continue;
118
+
119
+ const content = fs.readFileSync(squadMdPath, 'utf-8');
120
+ const refs = extractWorkflowRefs(content);
121
+ if (refs.length === 0) continue;
122
+
123
+ squadsWithRefs++;
124
+ const workflowsDir = path.join(squadDir, 'workflows');
125
+ fs.mkdirSync(workflowsDir, { recursive: true });
126
+
127
+ for (const ref of refs) {
128
+ const target = path.join(workflowsDir, ref);
129
+ if (fs.existsSync(target)) {
130
+ stubsSkipped++;
131
+ continue;
132
+ }
133
+ fs.writeFileSync(target, renderStub(ref, squadId));
134
+ stubsCreated++;
135
+ missingDetails.push(`${squadId}/${ref}`);
136
+ }
137
+ }
138
+
139
+ console.log(`[squad-workflow-stubs] scanned ${squadsTotal} squads (${squadsWithRefs} with workflow refs)`);
140
+ console.log(`[squad-workflow-stubs] stubs: ${stubsCreated} created, ${stubsSkipped} already existed`);
141
+ if (stubsCreated > 0 && process.env.VERBOSE) {
142
+ console.log('Created:');
143
+ for (const d of missingDetails) console.log(' +', d);
144
+ }