@openlife/cli 1.9.3 → 1.10.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 (116) 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/test-squad/SQUAD.md +1 -1
  6. package/dist/test_openlife_method_inventory.js +31 -3
  7. package/dist-templates/claude-code/commands/openlife/agents/atlas.md +5 -1
  8. package/dist-templates/claude-code/commands/openlife/agents/builder.md +5 -1
  9. package/dist-templates/claude-code/commands/openlife/agents/conductor.md +5 -1
  10. package/dist-templates/claude-code/commands/openlife/agents/forge.md +5 -1
  11. package/dist-templates/claude-code/commands/openlife/agents/genesis.md +5 -1
  12. package/dist-templates/claude-code/commands/openlife/agents/lyra.md +5 -1
  13. package/dist-templates/claude-code/commands/openlife/agents/maestro.md +5 -1
  14. package/dist-templates/claude-code/commands/openlife/agents/mesh.md +5 -1
  15. package/dist-templates/claude-code/commands/openlife/agents/prism.md +5 -1
  16. package/dist-templates/claude-code/commands/openlife/agents/sentinel.md +5 -1
  17. package/dist-templates/claude-code/commands/openlife/agents/steward.md +5 -1
  18. package/dist-templates/claude-code/commands/openlife/agents/vortex.md +5 -1
  19. package/dist-templates/claude-code/commands/openlife/ask.md +23 -6
  20. package/dist-templates/claude-code/commands/openlife/audit.md +31 -2
  21. package/dist-templates/claude-code/commands/openlife/doctor.md +0 -2
  22. package/dist-templates/claude-code/commands/openlife/dream.md +23 -2
  23. package/dist-templates/claude-code/commands/openlife/explore.md +20 -2
  24. package/dist-templates/claude-code/commands/openlife/flow/brownfield-discovery.md +24 -6
  25. package/dist-templates/claude-code/commands/openlife/flow/brownfield-fullstack.md +24 -6
  26. package/dist-templates/claude-code/commands/openlife/flow/brownfield-service.md +24 -6
  27. package/dist-templates/claude-code/commands/openlife/flow/brownfield-ui.md +24 -6
  28. package/dist-templates/claude-code/commands/openlife/flow/epic.md +24 -6
  29. package/dist-templates/claude-code/commands/openlife/flow/greenfield-fullstack.md +24 -6
  30. package/dist-templates/claude-code/commands/openlife/flow/greenfield-service.md +24 -6
  31. package/dist-templates/claude-code/commands/openlife/flow/greenfield-ui.md +24 -6
  32. package/dist-templates/claude-code/commands/openlife/flow/qa-loop.md +24 -6
  33. package/dist-templates/claude-code/commands/openlife/flow/release.md +24 -6
  34. package/dist-templates/claude-code/commands/openlife/flow/spec-pipeline.md +24 -6
  35. package/dist-templates/claude-code/commands/openlife/flow/story-cycle.md +24 -6
  36. package/dist-templates/claude-code/commands/openlife/health.md +25 -2
  37. package/dist-templates/claude-code/commands/openlife/plan.md +26 -2
  38. package/dist-templates/claude-code/commands/openlife/review.md +22 -2
  39. package/dist-templates/claude-code/commands/openlife/ship.md +23 -2
  40. package/dist-templates/claude-code/commands/openlife/start.md +21 -8
  41. package/dist-templates/claude-code/commands/openlife/status.md +0 -2
  42. package/dist-templates/claude-code/commands/openlife/story.md +20 -4
  43. package/dist-templates/codex/commands/openlife/agents/atlas.md +5 -1
  44. package/dist-templates/codex/commands/openlife/agents/builder.md +5 -1
  45. package/dist-templates/codex/commands/openlife/agents/conductor.md +5 -1
  46. package/dist-templates/codex/commands/openlife/agents/forge.md +5 -1
  47. package/dist-templates/codex/commands/openlife/agents/genesis.md +5 -1
  48. package/dist-templates/codex/commands/openlife/agents/lyra.md +5 -1
  49. package/dist-templates/codex/commands/openlife/agents/maestro.md +5 -1
  50. package/dist-templates/codex/commands/openlife/agents/mesh.md +5 -1
  51. package/dist-templates/codex/commands/openlife/agents/prism.md +5 -1
  52. package/dist-templates/codex/commands/openlife/agents/sentinel.md +5 -1
  53. package/dist-templates/codex/commands/openlife/agents/steward.md +5 -1
  54. package/dist-templates/codex/commands/openlife/agents/vortex.md +5 -1
  55. package/dist-templates/codex/commands/openlife/ask.md +23 -6
  56. package/dist-templates/codex/commands/openlife/audit.md +31 -2
  57. package/dist-templates/codex/commands/openlife/doctor.md +0 -2
  58. package/dist-templates/codex/commands/openlife/dream.md +23 -2
  59. package/dist-templates/codex/commands/openlife/explore.md +20 -2
  60. package/dist-templates/codex/commands/openlife/flow/brownfield-discovery.md +24 -6
  61. package/dist-templates/codex/commands/openlife/flow/brownfield-fullstack.md +24 -6
  62. package/dist-templates/codex/commands/openlife/flow/brownfield-service.md +24 -6
  63. package/dist-templates/codex/commands/openlife/flow/brownfield-ui.md +24 -6
  64. package/dist-templates/codex/commands/openlife/flow/epic.md +24 -6
  65. package/dist-templates/codex/commands/openlife/flow/greenfield-fullstack.md +24 -6
  66. package/dist-templates/codex/commands/openlife/flow/greenfield-service.md +24 -6
  67. package/dist-templates/codex/commands/openlife/flow/greenfield-ui.md +24 -6
  68. package/dist-templates/codex/commands/openlife/flow/qa-loop.md +24 -6
  69. package/dist-templates/codex/commands/openlife/flow/release.md +24 -6
  70. package/dist-templates/codex/commands/openlife/flow/spec-pipeline.md +24 -6
  71. package/dist-templates/codex/commands/openlife/flow/story-cycle.md +24 -6
  72. package/dist-templates/codex/commands/openlife/health.md +25 -2
  73. package/dist-templates/codex/commands/openlife/plan.md +26 -2
  74. package/dist-templates/codex/commands/openlife/review.md +22 -2
  75. package/dist-templates/codex/commands/openlife/ship.md +23 -2
  76. package/dist-templates/codex/commands/openlife/start.md +21 -8
  77. package/dist-templates/codex/commands/openlife/status.md +0 -2
  78. package/dist-templates/codex/commands/openlife/story.md +20 -4
  79. package/dist-templates/gemini-cli/commands/openlife/agents/atlas.md +5 -1
  80. package/dist-templates/gemini-cli/commands/openlife/agents/builder.md +5 -1
  81. package/dist-templates/gemini-cli/commands/openlife/agents/conductor.md +5 -1
  82. package/dist-templates/gemini-cli/commands/openlife/agents/forge.md +5 -1
  83. package/dist-templates/gemini-cli/commands/openlife/agents/genesis.md +5 -1
  84. package/dist-templates/gemini-cli/commands/openlife/agents/lyra.md +5 -1
  85. package/dist-templates/gemini-cli/commands/openlife/agents/maestro.md +5 -1
  86. package/dist-templates/gemini-cli/commands/openlife/agents/mesh.md +5 -1
  87. package/dist-templates/gemini-cli/commands/openlife/agents/prism.md +5 -1
  88. package/dist-templates/gemini-cli/commands/openlife/agents/sentinel.md +5 -1
  89. package/dist-templates/gemini-cli/commands/openlife/agents/steward.md +5 -1
  90. package/dist-templates/gemini-cli/commands/openlife/agents/vortex.md +5 -1
  91. package/dist-templates/gemini-cli/commands/openlife/ask.md +23 -6
  92. package/dist-templates/gemini-cli/commands/openlife/audit.md +31 -2
  93. package/dist-templates/gemini-cli/commands/openlife/doctor.md +0 -2
  94. package/dist-templates/gemini-cli/commands/openlife/dream.md +23 -2
  95. package/dist-templates/gemini-cli/commands/openlife/explore.md +20 -2
  96. package/dist-templates/gemini-cli/commands/openlife/flow/brownfield-discovery.md +24 -6
  97. package/dist-templates/gemini-cli/commands/openlife/flow/brownfield-fullstack.md +24 -6
  98. package/dist-templates/gemini-cli/commands/openlife/flow/brownfield-service.md +24 -6
  99. package/dist-templates/gemini-cli/commands/openlife/flow/brownfield-ui.md +24 -6
  100. package/dist-templates/gemini-cli/commands/openlife/flow/epic.md +24 -6
  101. package/dist-templates/gemini-cli/commands/openlife/flow/greenfield-fullstack.md +24 -6
  102. package/dist-templates/gemini-cli/commands/openlife/flow/greenfield-service.md +24 -6
  103. package/dist-templates/gemini-cli/commands/openlife/flow/greenfield-ui.md +24 -6
  104. package/dist-templates/gemini-cli/commands/openlife/flow/qa-loop.md +24 -6
  105. package/dist-templates/gemini-cli/commands/openlife/flow/release.md +24 -6
  106. package/dist-templates/gemini-cli/commands/openlife/flow/spec-pipeline.md +24 -6
  107. package/dist-templates/gemini-cli/commands/openlife/flow/story-cycle.md +24 -6
  108. package/dist-templates/gemini-cli/commands/openlife/health.md +25 -2
  109. package/dist-templates/gemini-cli/commands/openlife/plan.md +26 -2
  110. package/dist-templates/gemini-cli/commands/openlife/review.md +22 -2
  111. package/dist-templates/gemini-cli/commands/openlife/ship.md +23 -2
  112. package/dist-templates/gemini-cli/commands/openlife/start.md +21 -8
  113. package/dist-templates/gemini-cli/commands/openlife/status.md +0 -2
  114. package/dist-templates/gemini-cli/commands/openlife/story.md +20 -4
  115. package/package.json +1 -1
  116. package/scripts/generate-slash-commands.js +209 -34
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Run the QA gate on a story (Sentinel) 7-check verdict: PASS / CONCERNS / FAIL / WAIVED
2
+ description: Run the QA gate on a story — host LLM acts as Sentinel and applies 7 quality checks
3
3
  allowed-tools:
4
4
  - Read
5
5
  - Write
@@ -11,4 +11,24 @@ allowed-tools:
11
11
  - AskUserQuestion
12
12
  ---
13
13
 
14
- 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.
14
+ **Mode:** host-native (the host LLM running this conversation answers directly no external API key required).
15
+
16
+ Read `.openlife/method/agents/sentinel.md`, become Sentinel, and run `*qa-gate` on the target (story id or file path from `$ARGUMENTS`).
17
+
18
+ Apply the 7 checks: code review, unit tests, AC coverage, no regressions, performance, security (OWASP-grade), documentation.
19
+
20
+ Return verdict: PASS / CONCERNS / FAIL / WAIVED with structured findings (severity + category + file:line + recommendation per finding).
21
+
22
+ If verdict is FAIL with HIGH/CRITICAL issues, suggest `/openlife:agents:builder` for the fix-loop iteration.
23
+
24
+ ---
25
+
26
+ ### Want the external model chain instead?
27
+
28
+ If you specifically need the configured `models.json` chain (for cost-tracking, batch, or non-host contexts), run the command in a terminal:
29
+
30
+ ```bash
31
+ openlife review "$ARGUMENTS"
32
+ ```
33
+
34
+ That path uses the Brain dispatcher and requires the appropriate API key in `.env`. The slash command (this one) intentionally bypasses external APIs to keep host-CLI usage zero-config.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Run the continuous-deployment workflowrelease pipeline driven by Vortex
2
+ description: Run the continuous-deployment pipelinehost LLM orchestrates Vortex through PR → merge → tag → publish
3
3
  allowed-tools:
4
4
  - Read
5
5
  - Write
@@ -11,4 +11,25 @@ allowed-tools:
11
11
  - AskUserQuestion
12
12
  ---
13
13
 
14
- 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.
14
+ **Mode:** host-native (the host LLM running this conversation answers directly no external API key required).
15
+
16
+ Orchestrate the continuous-deployment workflow yourself.
17
+
18
+ 1. Read `dist-templates/workflows/continuous-deployment.yaml` to understand the phases
19
+ 2. Read `.openlife/method/agents/vortex.md` and become Vortex for steps that require the EXCLUSIVE git/PR/release authority
20
+ 3. Walk through: pre-release QA → open PR → wait CI → merge → version bump → tag → publish → release notes → log event
21
+ 4. EVERY destructive step (push, tag, publish) requires explicit user OK before proceeding — never auto-merge
22
+
23
+ Vortex is the only persona authorized to push, open/merge PRs, and run releases.
24
+
25
+ ---
26
+
27
+ ### Want the external model chain instead?
28
+
29
+ If you specifically need the configured `models.json` chain (for cost-tracking, batch, or non-host contexts), run the command in a terminal:
30
+
31
+ ```bash
32
+ openlife ship "$ARGUMENTS"
33
+ ```
34
+
35
+ That path uses the Brain dispatcher and requires the appropriate API key in `.env`. The slash command (this one) intentionally bypasses external APIs to keep host-CLI usage zero-config.
@@ -11,15 +11,28 @@ allowed-tools:
11
11
  - AskUserQuestion
12
12
  ---
13
13
 
14
- Detect the project mode:
14
+ **Mode:** host-native (the host LLM running this conversation answers directly — no external API key required).
15
+
16
+ Detect the project mode and route to the right workflow.
15
17
 
16
18
  1. Read `.openlife/project.json` if it exists. Use its `mode` field (`greenfield` / `brownfield` / `not-applicable`).
17
- 2. If missing, ask the user via AskUserQuestion:
18
- - "Is this a brand new project (greenfield) or existing codebase (brownfield)?"
19
- 3. Based on the answer, recommend a workflow:
20
- - greenfield + fullstack`openlife flow run greenfield-fullstack`
21
- - greenfield + service`openlife flow run greenfield-service`
22
- - greenfield + ui`openlife flow run greenfield-ui`
23
- - brownfield + first time → `openlife flow run brownfield-discovery`
19
+ 2. If missing, ask the user via AskUserQuestion: "Is this a brand new project (greenfield) or existing codebase (brownfield)?"
20
+ 3. Based on the answer, decide and announce the recommended workflow:
21
+ - greenfield + fullstack run `/openlife:flow:greenfield-fullstack`
22
+ - greenfield + servicerun `/openlife:flow:greenfield-service`
23
+ - greenfield + uirun `/openlife:flow:greenfield-ui`
24
+ - brownfield + first time run `/openlife:flow:brownfield-discovery`
24
25
  - brownfield + already discovered → ask sub-mode (fullstack/service/ui)
25
26
  4. If mode was just set, persist via `openlife project-mode set <mode>`.
27
+
28
+ ---
29
+
30
+ ### Want the external model chain instead?
31
+
32
+ If you specifically need the configured `models.json` chain (for cost-tracking, batch, or non-host contexts), run the command in a terminal:
33
+
34
+ ```bash
35
+ openlife start "$ARGUMENTS"
36
+ ```
37
+
38
+ That path uses the Brain dispatcher and requires the appropriate API key in `.env`. The slash command (this one) intentionally bypasses external APIs to keep host-CLI usage zero-config.
@@ -2,8 +2,6 @@
2
2
  description: Show OpenLife system status — installed profile, host, catalog counts, daemon state
3
3
  allowed-tools:
4
4
  - Read
5
- - Write
6
- - Edit
7
5
  - Bash(openlife:*)
8
6
  - Grep
9
7
  - Glob
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Create the next story from an epic (Conductor) or validate a draft (Steward)
2
+ description: Create the next story (Conductor) or validate a draft (Steward) — host LLM acts as the right persona
3
3
  allowed-tools:
4
4
  - Read
5
5
  - Write
@@ -11,8 +11,24 @@ allowed-tools:
11
11
  - AskUserQuestion
12
12
  ---
13
13
 
14
- Determine intent from $ARGUMENTS:
14
+ **Mode:** host-native (the host LLM running this conversation answers directly — no external API key required).
15
15
 
16
- - If the user wants to CREATE a story → activate `@openlife-conductor` (reads `.openlife/method/agents/conductor.md`) and run `*create-next-story`.
17
- - If the user wants to VALIDATE a draft → activate `@openlife-steward` and run `*validate-story`.
16
+ Determine intent from `$ARGUMENTS`:
17
+
18
+ - If the user wants to CREATE a story → read `.openlife/method/agents/conductor.md`, become Conductor, run `*create-next-story`. Apply the story template (frontmatter, title, description, AC, scope, deps, complexity, business value, risks, DoD).
19
+ - If the user wants to VALIDATE a draft → read `.openlife/method/agents/steward.md`, become Steward, run `*validate-story` with the 10-point checklist. Verdict: GO (≥7/10) or NO-GO (with required fixes).
18
20
  - If unclear, ask via AskUserQuestion which action to take.
21
+
22
+ You play the persona directly — no shellout.
23
+
24
+ ---
25
+
26
+ ### Want the external model chain instead?
27
+
28
+ If you specifically need the configured `models.json` chain (for cost-tracking, batch, or non-host contexts), run the command in a terminal:
29
+
30
+ ```bash
31
+ openlife story "$ARGUMENTS"
32
+ ```
33
+
34
+ That path uses the Brain dispatcher and requires the appropriate API key in `.env`. The slash command (this one) intentionally bypasses external APIs to keep host-CLI usage zero-config.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openlife/cli",
3
- "version": "1.9.3",
3
+ "version": "1.10.0",
4
4
  "description": "OPEN-LIFE Córtex Orquestrador Dual-Core",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -1,9 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
  // scripts/generate-slash-commands.js
3
- // One-shot generator for the OpenLife method's slash command surface.
3
+ //
4
+ // Host-Native generator (v1.10.0+).
4
5
  // Produces files under dist-templates/<host>/commands/openlife/{,agents/,flow/}
5
6
  // for hosts: claude-code, gemini-cli, codex.
6
7
  //
8
+ // Architecture (v1.10.0):
9
+ // LLM-reasoning commands respond DIRECTLY using the host's LLM (Claude in
10
+ // Claude Code, Gemini in Gemini CLI, etc.) by reading the OpenLife method
11
+ // catalog at `.openlife/method/` for persona/workflow context. They do NOT
12
+ // shell out to `openlife <verb>` (which would route to an external Brain
13
+ // chain and require API keys).
14
+ //
15
+ // Runtime-state commands (doctor, status, project-mode get) still shell
16
+ // out — they query real local state, not LLM reasoning.
17
+ //
18
+ // External Brain mode is opt-in via the `--external` flag on the command
19
+ // or `OPENLIFE_USE_EXTERNAL_BRAIN=true` env var — useful for headless / CI
20
+ // contexts or when the user explicitly wants the configured model chain.
21
+ //
7
22
  // Idempotent: re-running overwrites with the canonical content.
8
23
 
9
24
  const fs = require('fs');
@@ -15,70 +30,168 @@ const REPO_ROOT = path.resolve(__dirname, '..');
15
30
  // ─── Command catalog ────────────────────────────────────────────────────
16
31
 
17
32
  const TOP_LEVEL = [
33
+ // ── LLM-reasoning: Claude responds directly, no shellout ──
18
34
  {
19
35
  name: 'ask',
20
- description: 'Ask the OpenLife Brain a question (uses primary/fallback model chain configured in models.json)',
36
+ mode: 'host-native',
37
+ persona: 'lyra',
38
+ description: 'Ask OpenLife — the host LLM answers directly using the OpenLife method context (no external API key required)',
21
39
  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,
40
+ instruction: `Answer the user's question directly using your own reasoning. You ARE the OpenLife Brain when invoked through a host CLI.
41
+
42
+ Optional context (read only when relevant to the question):
43
+ - \`.openlife/method/agents/lyra.md\` — research / synthesis persona to adopt when the question is research-shaped
44
+ - \`.openlife/project.json\` — current project mode (greenfield/brownfield)
45
+ - \`.catalog/\` — user's agents, squads, skills, capabilities
46
+ - \`dist-templates/workflows/\` — bundled method workflows
47
+
48
+ If the question is open-ended or asks for OpenLife status, prefer answering from this conversation's existing context rather than reading files speculatively. If the user explicitly wants the external model chain (e.g., for batch / cron / cost-tracking reasons), they can invoke \`openlife ask "..."\` directly in a terminal or pass \`--external\` to this command.`,
24
49
  },
25
50
  {
26
51
  name: 'doctor',
52
+ mode: 'runtime',
27
53
  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,
54
+ instruction: '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.',
30
55
  },
31
56
  {
32
57
  name: 'status',
58
+ mode: 'runtime',
33
59
  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,
60
+ instruction: '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.',
36
61
  },
37
62
  {
38
63
  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,
64
+ mode: 'host-native',
65
+ persona: 'lyra',
66
+ description: 'Dream Organizer — surface ideas, pending stories, and prioritization from accumulated context (host LLM answers directly)',
67
+ instruction: `Run the OpenLife Dream Organizer using your own reasoning, not an external model.
68
+
69
+ 1. Read recent context from this conversation + any planning files the user has open
70
+ 2. Optionally read \`.catalog/\` for project-specific ideas already captured
71
+ 3. Surface unprioritized ideas, pending stories, and recommendations grouped by theme
72
+ 4. Be opinionated about priority order — don't return a flat list
73
+
74
+ If the user wants the external model chain for richer ideation: \`openlife dream "..."\` in a terminal.`,
42
75
  },
43
76
  {
44
77
  name: 'start',
78
+ mode: 'host-native',
45
79
  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>`.',
80
+ instruction: `Detect the project mode and route to the right workflow.
81
+
82
+ 1. Read \`.openlife/project.json\` if it exists. Use its \`mode\` field (\`greenfield\` / \`brownfield\` / \`not-applicable\`).
83
+ 2. If missing, ask the user via AskUserQuestion: "Is this a brand new project (greenfield) or existing codebase (brownfield)?"
84
+ 3. Based on the answer, decide and announce the recommended workflow:
85
+ - greenfield + fullstack → run \`/openlife:flow:greenfield-fullstack\`
86
+ - greenfield + service → run \`/openlife:flow:greenfield-service\`
87
+ - greenfield + ui → run \`/openlife:flow:greenfield-ui\`
88
+ - brownfield + first time → run \`/openlife:flow:brownfield-discovery\`
89
+ - brownfield + already discovered → ask sub-mode (fullstack/service/ui)
90
+ 4. If mode was just set, persist via \`openlife project-mode set <mode>\`.`,
47
91
  },
48
92
  {
49
93
  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.',
94
+ mode: 'host-native',
95
+ persona: 'genesis',
96
+ description: 'Run the spec pipeline (gather → assess → research → write → critique → plan) — host LLM orchestrates the 6 phases',
97
+ instruction: `Orchestrate the spec-pipeline workflow YOURSELF, phase by phase. You play multiple personas inline.
98
+
99
+ 1. Read \`dist-templates/workflows/spec-pipeline.yaml\` to understand the phases
100
+ 2. Phase 1 — Gather: become @openlife-genesis (read \`.openlife/method/agents/genesis.md\`) and elicit requirements from the user via AskUserQuestion
101
+ 3. Phase 2 — Assess: become @openlife-atlas, score the 5 complexity dimensions
102
+ 4. Phase 3 — Research (skip if SIMPLE complexity): become @openlife-lyra, surface unknowns
103
+ 5. Phase 4 — Write: become @openlife-genesis again, draft spec.md
104
+ 6. Phase 5 — Critique: become @openlife-sentinel, return verdict (APPROVED / NEEDS_REVISION / BLOCKED)
105
+ 7. Phase 6 — Plan: become @openlife-atlas, generate implementation.yaml
106
+
107
+ Each phase ends with the user explicitly OK'ing before the next.`,
52
108
  },
53
109
  {
54
110
  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.',
111
+ mode: 'host-native',
112
+ description: 'Create the next story (Conductor) or validate a draft (Steward) host LLM acts as the right persona',
113
+ instruction: `Determine intent from \`$ARGUMENTS\`:
114
+
115
+ - If the user wants to CREATE a story → read \`.openlife/method/agents/conductor.md\`, become Conductor, run \`*create-next-story\`. Apply the story template (frontmatter, title, description, AC, scope, deps, complexity, business value, risks, DoD).
116
+ - If the user wants to VALIDATE a draft → read \`.openlife/method/agents/steward.md\`, become Steward, run \`*validate-story\` with the 10-point checklist. Verdict: GO (≥7/10) or NO-GO (with required fixes).
117
+ - If unclear, ask via AskUserQuestion which action to take.
118
+
119
+ You play the persona directly — no shellout.`,
57
120
  },
58
121
  {
59
122
  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.',
123
+ mode: 'host-native',
124
+ persona: 'sentinel',
125
+ description: 'Run the QA gate on a story — host LLM acts as Sentinel and applies 7 quality checks',
126
+ instruction: `Read \`.openlife/method/agents/sentinel.md\`, become Sentinel, and run \`*qa-gate\` on the target (story id or file path from \`$ARGUMENTS\`).
127
+
128
+ Apply the 7 checks: code review, unit tests, AC coverage, no regressions, performance, security (OWASP-grade), documentation.
129
+
130
+ Return verdict: PASS / CONCERNS / FAIL / WAIVED with structured findings (severity + category + file:line + recommendation per finding).
131
+
132
+ If verdict is FAIL with HIGH/CRITICAL issues, suggest \`/openlife:agents:builder\` for the fix-loop iteration.`,
62
133
  },
63
134
  {
64
135
  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.',
136
+ mode: 'host-native',
137
+ persona: 'vortex',
138
+ description: 'Run the continuous-deployment pipeline — host LLM orchestrates Vortex through PR → merge → tag → publish',
139
+ instruction: `Orchestrate the continuous-deployment workflow yourself.
140
+
141
+ 1. Read \`dist-templates/workflows/continuous-deployment.yaml\` to understand the phases
142
+ 2. Read \`.openlife/method/agents/vortex.md\` and become Vortex for steps that require the EXCLUSIVE git/PR/release authority
143
+ 3. Walk through: pre-release QA → open PR → wait CI → merge → version bump → tag → publish → release notes → log event
144
+ 4. EVERY destructive step (push, tag, publish) requires explicit user OK before proceeding — never auto-merge
145
+
146
+ Vortex is the only persona authorized to push, open/merge PRs, and run releases.`,
67
147
  },
68
148
  {
69
149
  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`.',
150
+ mode: 'host-native',
151
+ persona: 'lyra',
152
+ description: 'Exploratory ideation — host LLM acts as Lyra for divergent brainstorming then convergent narrative',
153
+ instruction: `Read \`.openlife/method/agents/lyra.md\`, become Lyra, and run \`*brainstorm "$ARGUMENTS"\`.
154
+
155
+ Surface options + tradeoffs. Mark confidence per claim (high / medium / low). Cite sources when claims are non-obvious.
156
+
157
+ Do NOT commit to a plan in this command — that's \`/openlife:plan\`. Explore is divergent; Plan is convergent.`,
72
158
  },
73
159
  {
74
160
  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.',
161
+ mode: 'host-native',
162
+ persona: 'genesis',
163
+ description: 'Run brownfield-discovery — host LLM orchestrates the 10-phase audit of an existing codebase',
164
+ instruction: `Orchestrate the brownfield-discovery workflow yourself, playing multiple personas inline.
165
+
166
+ 1. Read \`dist-templates/workflows/brownfield-discovery.yaml\` to understand the 10 phases
167
+ 2. Walk through:
168
+ - Phase 1 (Atlas): system-architecture.md
169
+ - Phase 2 (Mesh, conditional): SCHEMA.md + DB-AUDIT.md
170
+ - Phase 3 (Prism, conditional): frontend-spec.md
171
+ - Phase 4 (Atlas): technical-debt-DRAFT.md
172
+ - Phase 5 (Mesh): db-specialist-review.md
173
+ - Phase 6 (Prism): ux-specialist-review.md
174
+ - Phase 7 (Sentinel): qa-review.md (gate: APPROVED / NEEDS WORK)
175
+ - Phase 8 (Atlas): technical-debt-assessment.md (final)
176
+ - Phase 9 (Lyra): TECHNICAL-DEBT-REPORT.md (executive)
177
+ - Phase 10 (Genesis): Epic + stories ready for backlog
178
+
179
+ Each phase ends with the user OK'ing before the next.`,
77
180
  },
78
181
  {
79
182
  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).',
183
+ mode: 'host-native',
184
+ description: 'Extended health check combines `doctor` runtime check with Maestro\'s framework integrity review',
185
+ instruction: `Two-step health check:
186
+
187
+ 1. Run \`openlife system doctor\` (real shell command) to capture API keys, model chain, catalog state, daemon state
188
+ 2. Read \`.openlife/method/agents/maestro.md\`, become Maestro, and check cross-agent integrity:
189
+ - Catalog completeness (314 agents / 46 squads / 55 skills present?)
190
+ - Missing handoff artifacts in \`.openlife/handoffs/\`
191
+ - Draft components pending promotion in \`.catalog/{agents,squads,skills}/<id>/\` with \`status: draft\`
192
+ - Any contradictions between \`.openlife/project.json\` mode and active workflow
193
+
194
+ Present both diagnostics in one consolidated report.`,
82
195
  },
83
196
  ];
84
197
 
@@ -116,6 +229,25 @@ const FLOWS = [
116
229
 
117
230
  function renderTopLevel(cmd) {
118
231
  const hintLine = cmd.argumentHint ? `argument-hint: "${cmd.argumentHint}"\n` : '';
232
+
233
+ // Runtime-state commands shell out (real diagnostics, not LLM reasoning).
234
+ if (cmd.mode === 'runtime') {
235
+ return `---
236
+ description: ${cmd.description}
237
+ ${hintLine}allowed-tools:
238
+ - Read
239
+ - Bash(openlife:*)
240
+ - Grep
241
+ - Glob
242
+ - Agent
243
+ - AskUserQuestion
244
+ ---
245
+
246
+ ${cmd.instruction}
247
+ `;
248
+ }
249
+
250
+ // Host-native LLM-reasoning commands respond directly using the host LLM.
119
251
  return `---
120
252
  description: ${cmd.description}
121
253
  ${hintLine}allowed-tools:
@@ -129,7 +261,21 @@ ${hintLine}allowed-tools:
129
261
  - AskUserQuestion
130
262
  ---
131
263
 
132
- ${cmd.body}
264
+ **Mode:** host-native (the host LLM running this conversation answers directly — no external API key required).
265
+
266
+ ${cmd.instruction}
267
+
268
+ ---
269
+
270
+ ### Want the external model chain instead?
271
+
272
+ If you specifically need the configured \`models.json\` chain (for cost-tracking, batch, or non-host contexts), run the command in a terminal:
273
+
274
+ \`\`\`bash
275
+ openlife ${cmd.name} "$ARGUMENTS"
276
+ \`\`\`
277
+
278
+ That path uses the Brain dispatcher and requires the appropriate API key in \`.env\`. The slash command (this one) intentionally bypasses external APIs to keep host-CLI usage zero-config.
133
279
  `;
134
280
  }
135
281
 
@@ -148,7 +294,9 @@ allowed-tools:
148
294
  - AskUserQuestion
149
295
  ---
150
296
 
151
- Activate **${capitalize(agent.id)}** from the OpenLife method.
297
+ **Mode:** host-native — you (the host LLM) become **${capitalize(agent.id)}** for this conversation.
298
+
299
+ Activation:
152
300
 
153
301
  1. Read \`.openlife/method/agents/${agent.id}.md\` in full.
154
302
  2. Adopt the persona and execute the activation flow defined there:
@@ -158,6 +306,8 @@ Activate **${capitalize(agent.id)}** from the OpenLife method.
158
306
  3. If \`$ARGUMENTS\` is non-empty, treat it as an initial task or context for the persona.
159
307
 
160
308
  After the user's first \`*command\`, follow the persona's hand-off rules to suggest the next persona when appropriate.
309
+
310
+ This activation does NOT use any external model — you ARE the agent. The OpenLife Brain (external model chain) is reserved for headless / CI usage via \`openlife ask\` in a terminal.
161
311
  `;
162
312
  }
163
313
 
@@ -175,14 +325,32 @@ allowed-tools:
175
325
  - AskUserQuestion
176
326
  ---
177
327
 
178
- Run \`openlife flow run ${wfId} $ARGUMENTS\` and walk the user through the workflow as it executes.
328
+ **Mode:** host-native you (the host LLM) orchestrate the \`${wfId}\` workflow yourself, playing the personas as needed.
329
+
330
+ ### Step 1 — Load the workflow definition
331
+
332
+ Read \`dist-templates/workflows/${wfId}.yaml\` (project local override at \`.openlife/method/workflows/${wfId}.yaml\` or \`.catalog/workflows/${wfId}.yaml\` takes precedence if present).
333
+
334
+ If \`$ARGUMENTS\` contains \`--dry-run\`, ALSO shell out to \`openlife flow run ${wfId} --dry-run\` to print the phase plan, then STOP.
335
+
336
+ ### Step 2 — Walk the phases
337
+
338
+ For each phase in the workflow's \`sequence\`:
339
+
340
+ 1. Announce which phase you're entering and which persona owns this phase (the \`agent:\` field on the step)
341
+ 2. Read \`.openlife/method/agents/<persona-id>.md\` for the active persona — adopt that persona for this phase
342
+ 3. Execute the step's \`action\` using the persona's discipline (commands, hand-off rules, anti-patterns)
343
+ 4. Produce the artifacts listed in \`creates:\` — write them to the paths declared in the YAML
344
+ 5. If \`elicit: true\`, ask the user via AskUserQuestion before proceeding
345
+ 6. Hand off to the next phase's persona; announce the handoff
346
+
347
+ ### Step 3 — Surface failures explicitly
348
+
349
+ On any step failure: identify the failing step, the active persona, and offer to escalate to \`@openlife-maestro\` (read \`.openlife/method/agents/maestro.md\`).
179
350
 
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.
351
+ ### Why host-native, not shell?
184
352
 
185
- Refer the user to the persona of the active phase when they ask "who is doing this?".
353
+ Running the workflow this way uses your reasoning (the host LLM) instead of the external Brain chain. Zero API key needed for orchestration. If the user wants the external Brain to drive (headless / batch / cron), they can run \`openlife flow run ${wfId} "$ARGUMENTS"\` in a terminal.
186
354
  `;
187
355
  }
188
356
 
@@ -193,6 +361,8 @@ function capitalize(s) {
193
361
  // ─── Emit ───────────────────────────────────────────────────────────────
194
362
 
195
363
  let total = 0;
364
+ let hostNative = 0;
365
+ let runtime = 0;
196
366
 
197
367
  for (const host of HOSTS) {
198
368
  const baseDir = path.join(REPO_ROOT, 'dist-templates', host, 'commands', 'openlife');
@@ -203,18 +373,23 @@ for (const host of HOSTS) {
203
373
  const fp = path.join(baseDir, `${cmd.name}.md`);
204
374
  fs.writeFileSync(fp, renderTopLevel(cmd));
205
375
  total++;
376
+ if (cmd.mode === 'host-native') hostNative++;
377
+ else if (cmd.mode === 'runtime') runtime++;
206
378
  }
207
379
  for (const agent of AGENTS) {
208
380
  const fp = path.join(baseDir, 'agents', `${agent.id}.md`);
209
381
  fs.writeFileSync(fp, renderAgent(agent));
210
382
  total++;
383
+ hostNative++;
211
384
  }
212
385
  for (const flow of FLOWS) {
213
386
  const fp = path.join(baseDir, 'flow', `${flow.id}.md`);
214
387
  fs.writeFileSync(fp, renderFlow(flow));
215
388
  total++;
389
+ hostNative++;
216
390
  }
217
391
  }
218
392
 
219
393
  console.log(`[generate-slash-commands] wrote ${total} files across ${HOSTS.length} hosts.`);
220
394
  console.log(`Breakdown per host: ${TOP_LEVEL.length} top-level + ${AGENTS.length} agents + ${FLOWS.length} flows = ${TOP_LEVEL.length + AGENTS.length + FLOWS.length}`);
395
+ console.log(`Mode split: ${hostNative} host-native + ${runtime} runtime-state (× ${HOSTS.length} hosts)`);