@monoes/monomindcli 1.9.17 → 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 (118) hide show
  1. package/.claude/commands/mastermind/_repeat.md +182 -39
  2. package/.claude/commands/mastermind/architect.md +17 -11
  3. package/.claude/commands/mastermind/brain.md +4 -0
  4. package/.claude/commands/mastermind/build.md +4 -0
  5. package/.claude/commands/mastermind/content.md +4 -0
  6. package/.claude/commands/mastermind/createorg.md +5 -3
  7. package/.claude/commands/mastermind/finance.md +4 -0
  8. package/.claude/commands/mastermind/idea.md +4 -0
  9. package/.claude/commands/mastermind/marketing.md +4 -0
  10. package/.claude/commands/mastermind/master.md +63 -37
  11. package/.claude/commands/mastermind/ops.md +4 -0
  12. package/.claude/commands/mastermind/release.md +4 -0
  13. package/.claude/commands/mastermind/research.md +4 -0
  14. package/.claude/commands/mastermind/review.md +4 -0
  15. package/.claude/commands/mastermind/runorg.md +5 -3
  16. package/.claude/commands/mastermind/sales.md +4 -0
  17. package/.claude/commands/mastermind/techport.md +9 -0
  18. package/.claude/commands/monomind/do.md +5 -1
  19. package/.claude/commands/monomind/idea.md +5 -1
  20. package/.claude/commands/monomind/improve.md +5 -1
  21. package/.claude/commands/monomind/repeat.md +85 -29
  22. package/.claude/commands/monomind/review.md +6 -2
  23. package/.claude/commands/monomind/understand.md +10 -8
  24. package/.claude/helpers/extras-registry.json +235 -235
  25. package/.claude/helpers/graphify-freshen.cjs +13 -1
  26. package/.claude/helpers/hook-handler.cjs +1 -1
  27. package/.claude/helpers/router.cjs +4 -1
  28. package/.claude/skills/mastermind/_protocol.md +28 -21
  29. package/.claude/skills/mastermind/access.md +236 -0
  30. package/.claude/skills/mastermind/activity.md +191 -0
  31. package/.claude/skills/mastermind/adapter-manager.md +259 -0
  32. package/.claude/skills/mastermind/adapters.md +204 -0
  33. package/.claude/skills/mastermind/agent-detail.md +242 -0
  34. package/.claude/skills/mastermind/agents.md +178 -0
  35. package/.claude/skills/mastermind/approval-detail.md +259 -0
  36. package/.claude/skills/mastermind/approve.md +181 -0
  37. package/.claude/skills/mastermind/architect.md +24 -8
  38. package/.claude/skills/mastermind/backup.md +197 -0
  39. package/.claude/skills/mastermind/bootstrap.md +190 -0
  40. package/.claude/skills/mastermind/budgets.md +237 -0
  41. package/.claude/skills/mastermind/companies.md +256 -0
  42. package/.claude/skills/mastermind/costs.md +151 -0
  43. package/.claude/skills/mastermind/createorg.md +23 -5
  44. package/.claude/skills/mastermind/diagnose.md +249 -0
  45. package/.claude/skills/mastermind/env.md +198 -0
  46. package/.claude/skills/mastermind/environments.md +250 -0
  47. package/.claude/skills/mastermind/export.md +324 -0
  48. package/.claude/skills/mastermind/goal-detail.md +255 -0
  49. package/.claude/skills/mastermind/goals.md +149 -0
  50. package/.claude/skills/mastermind/heartbeat.md +164 -0
  51. package/.claude/skills/mastermind/idea.md +250 -122
  52. package/.claude/skills/mastermind/import.md +281 -0
  53. package/.claude/skills/mastermind/inbox.md +214 -0
  54. package/.claude/skills/mastermind/instance-settings.md +315 -0
  55. package/.claude/skills/mastermind/instance.md +231 -0
  56. package/.claude/skills/mastermind/invite-landing.md +227 -0
  57. package/.claude/skills/mastermind/invites.md +254 -0
  58. package/.claude/skills/mastermind/issue-detail.md +291 -0
  59. package/.claude/skills/mastermind/issues.md +235 -0
  60. package/.claude/skills/mastermind/join-queue.md +170 -0
  61. package/.claude/skills/mastermind/liveness.md +392 -0
  62. package/.claude/skills/mastermind/memory.md +321 -0
  63. package/.claude/skills/mastermind/my-issues.md +146 -0
  64. package/.claude/skills/mastermind/new-agent.md +241 -0
  65. package/.claude/skills/mastermind/org-chart.md +207 -0
  66. package/.claude/skills/mastermind/org-settings.md +217 -0
  67. package/.claude/skills/mastermind/plan-to-tasks.md +136 -0
  68. package/.claude/skills/mastermind/plugin-manager.md +241 -0
  69. package/.claude/skills/mastermind/plugin-settings.md +273 -0
  70. package/.claude/skills/mastermind/plugins.md +190 -0
  71. package/.claude/skills/mastermind/profile.md +187 -0
  72. package/.claude/skills/mastermind/project-detail.md +249 -0
  73. package/.claude/skills/mastermind/project-workspace.md +244 -0
  74. package/.claude/skills/mastermind/projects.md +164 -0
  75. package/.claude/skills/mastermind/routine-detail.md +253 -0
  76. package/.claude/skills/mastermind/routines.md +202 -0
  77. package/.claude/skills/mastermind/runorg.md +74 -9
  78. package/.claude/skills/mastermind/search.md +186 -0
  79. package/.claude/skills/mastermind/secrets.md +199 -0
  80. package/.claude/skills/mastermind/skills.md +156 -0
  81. package/.claude/skills/mastermind/tasks.md +149 -0
  82. package/.claude/skills/mastermind/techport.md +5 -5
  83. package/.claude/skills/mastermind/threads.md +259 -0
  84. package/.claude/skills/mastermind/tree-control.md +250 -0
  85. package/.claude/skills/mastermind/wiki.md +314 -0
  86. package/.claude/skills/mastermind/workspace-detail.md +317 -0
  87. package/.claude/skills/mastermind/workspaces.md +261 -0
  88. package/.claude/skills/mastermind/worktree.md +187 -0
  89. package/dist/src/init/executor.js +8 -8
  90. package/dist/src/init/executor.js.map +1 -1
  91. package/dist/src/init/statusline-generator.d.ts.map +1 -1
  92. package/dist/src/init/statusline-generator.js +12 -0
  93. package/dist/src/init/statusline-generator.js.map +1 -1
  94. package/dist/src/ui/.monomind/data/ranked-context.json +1 -1
  95. package/dist/src/ui/.monomind/loops/mastermind-review-1778664132789.json +16 -0
  96. package/dist/src/ui/.monomind/sessions/current.json +5 -5
  97. package/dist/src/ui/.monomind/sessions/session-1776778451399.json +15 -0
  98. package/dist/src/ui/dashboard.html +3030 -181
  99. package/dist/src/ui/data/mastermind-events.jsonl +8 -0
  100. package/dist/src/ui/data/mastermind-sessions.json +1 -0
  101. package/dist/src/ui/server.mjs +738 -0
  102. package/dist/tsconfig.tsbuildinfo +1 -1
  103. package/package.json +1 -1
  104. package/.claude/skills/.monomind/data/ranked-context.json +0 -5
  105. package/.claude/skills/.monomind/sessions/current.json +0 -13
  106. package/.claude/skills/.monomind/sessions/session-1777829336455.json +0 -15
  107. package/.claude/skills/.monomind/sessions/session-1777831614725.json +0 -15
  108. package/.claude/skills/.monomind/sessions/session-1777832095857.json +0 -15
  109. package/.claude/skills/.monomind/sessions/session-1777839814183.json +0 -15
  110. package/.claude/skills/.monomind/sessions/session-1777841847131.json +0 -15
  111. package/.claude/skills/.monomind/sessions/session-1777843309463.json +0 -15
  112. package/.claude/skills/.monomind/sessions/session-1777880867159.json +0 -15
  113. package/.claude/skills/.monomind/sessions/session-1777881884593.json +0 -15
  114. package/.claude/skills/.monomind/sessions/session-1777884090471.json +0 -15
  115. package/.claude/skills/.monomind/sessions/session-1777884808221.json +0 -15
  116. package/.claude/skills/.monomind/sessions/session-1777885672155.json +0 -15
  117. package/.claude/skills/.monomind/sessions/session-1777886852818.json +0 -15
  118. package/.claude/skills/.monomind/sessions/session-1777896532690.json +0 -15
@@ -55,6 +55,11 @@ Extract from `$ARGUMENTS`:
55
55
  - `--iterate <N>` → iterate = N (integer ≥ 1; when flag is absent, no iteration runs)
56
56
  - Remaining text = prompt
57
57
 
58
+ If `--project` was not provided, default `project_name` to the current directory name:
59
+ ```bash
60
+ project_name="${project_name:-$(basename "$PWD")}"
61
+ ```
62
+
58
63
  ### Step 2 — Brain Load
59
64
 
60
65
  Follow the Brain Load Procedure from `_protocol.md`:
@@ -90,7 +95,8 @@ jq -n --arg sid "$SESSION_ID" --arg proj "$project_name" --arg prompt "$resolved
90
95
  > "$REPO_ROOT/.monomind/sessions/current.json.tmp" \
91
96
  && mv "$REPO_ROOT/.monomind/sessions/current.json.tmp" \
92
97
  "$REPO_ROOT/.monomind/sessions/current.json"
93
- curl -s -o /dev/null -X POST "http://localhost:4242/api/mastermind/event" \
98
+ CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
99
+ curl -s -o /dev/null -X POST "${CTRL_URL}/api/mastermind/event" \
94
100
  -H "Content-Type: application/json" \
95
101
  -d "$(jq -cn --arg sid "$SESSION_ID" --arg prompt "$resolved_prompt" --arg mode "$mode" --arg proj "$(pwd)" \
96
102
  '{type:"session:start",session:$sid,prompt:$prompt,mode:$mode,project:$proj,ts:(now*1000|floor)}')" || true
@@ -173,6 +179,17 @@ Follow the Monotask Space+Board Setup Procedure from `_protocol.md`. Resolve the
173
179
  REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
174
180
  SESSION_STATE="$REPO_ROOT/.monomind/sessions/current.json"
175
181
 
182
+ # monotask availability guard — all card/board operations below require it
183
+ if ! command -v monotask >/dev/null 2>&1; then
184
+ echo "WARN: monotask CLI not found — board and card creation will be skipped."
185
+ echo "Install via: npm install -g monotask"
186
+ echo "Domain managers will run without board IDs (text-only output)."
187
+ # Write marker to current.json so Step 7 Phase C skips Task spawning with empty boards
188
+ jq '. + {monotask_available: false}' "$SESSION_STATE" > "$SESSION_STATE.tmp" \
189
+ && mv "$SESSION_STATE.tmp" "$SESSION_STATE" 2>/dev/null || true
190
+ exit 0
191
+ fi
192
+
176
193
  SESSION_ID=$(jq -r '.sessionId // empty' "$SESSION_STATE" 2>/dev/null)
177
194
  [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID missing in current.json — run Step 3 first"; exit 1; }
178
195
  project_name=$(jq -r '.project_name // ""' "$SESSION_STATE")
@@ -197,7 +214,8 @@ for domain in $domains_needed; do
197
214
  canonical="${project_name}-${domain}"
198
215
 
199
216
  # Find existing board by canonical name — reuse across runs
200
- board_id=$(monotask board list 2>/dev/null | awk -F'|' '{gsub(/^ +| +$/,"",$1);gsub(/^ +| +$/,"",$2);if($2==n)print $1}' n="$canonical" | head -1)
217
+ # board list format is "uuid: name" (colon-space separator, NOT pipe)
218
+ board_id=$(monotask board list 2>/dev/null | awk -F': ' '{gsub(/^ +| +$/,"",$1);gsub(/^ +| +$/,"",$2);if($2==n)print $1}' n="$canonical" | head -1)
201
219
 
202
220
  # Domain-specific column schema:
203
221
  # idea → New | Evaluated | Elaborated | Tasked | Iced | Rejected (intake = "New")
@@ -259,7 +277,7 @@ echo "Session state saved to current.json"
259
277
 
260
278
  ### Step 7 — Spawn Domain Managers
261
279
 
262
- **BEFORE THIS STEP:** If `idea` is in `domains_needed`, invoke `Skill("mastermind:idea")` directly now (master context has Skill tool access). Pass the resolved prompt, project path, and mode. Write the result to `.monomind/sessions/<SESSION_ID>/idea.json` and mark the `idea` domain as handled. Do NOT include `idea` in the Task spawning below.
280
+ **BEFORE THIS STEP:** If `idea` is in `domains_needed`, invoke `Skill("mastermind:idea")` directly now (master context has Skill tool access). Pass the resolved prompt, project path, and mode. The idea skill's Step 7 writes its output to `.monomind/sessions/<SESSION_ID>/idea.json` automatically do not write it again. Mark the `idea` domain as handled. Do NOT include `idea` in the Task spawning below.
263
281
 
264
282
  **IDEA PIPELINE REQUIREMENT:** `mastermind:idea` runs a multi-step pipeline (Steps 3–6 inside idea.md). You MUST follow all of those steps — do NOT shortcut to manually creating cards. The full pipeline is:
265
283
  - Step 3: Board setup — find-or-create `<project_name>-idea` board (master's Step 6 already created it with correct columns: New → Evaluated → Elaborated → Tasked → Iced → Rejected). Load column IDs from existing board.
@@ -278,18 +296,20 @@ Skipping any of these steps produces an incomplete pipeline run — card content
278
296
  **Phase A — Registry selection** (run as one Bash call; must complete before Phase C):
279
297
 
280
298
  ```bash
281
- # Require bash 4.3+ for associative arrays and namerefs
282
- (( BASH_VERSINFO[0] * 100 + BASH_VERSINFO[1] < 403 )) && \
283
- { echo "ERROR: bash 4.3+ required (current: $BASH_VERSION). Install: brew install bash"; exit 1; }
284
-
299
+ # Compatible with macOS bash 3.2 uses jq accumulation instead of declare -A
285
300
  REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
286
301
  REGISTRY="$REPO_ROOT/.monomind/registry.json"
287
302
 
288
303
  # Reload state from current.json — this is a new shell; no inherited variables
289
304
  SESSION_STATE="$REPO_ROOT/.monomind/sessions/current.json"
290
305
  [ -f "$SESSION_STATE" ] || { echo "ERROR: current.json not found — run from Step 3"; exit 1; }
291
- domains_needed=$(jq -r '.domains_needed[]? // empty' "$SESSION_STATE" | tr '\n' ' ')
292
- [ -z "$domains_needed" ] && { echo "ERROR: domains_needed is empty in current.json"; exit 1; }
306
+ # If Step 6 skipped due to missing monotask, board_ids are empty skip Task agent spawning
307
+ if [ "$(jq -r '.monotask_available // true' "$SESSION_STATE")" = "false" ]; then
308
+ echo "INFO: monotask_available=false — domain managers will be spawned in text-only mode (no board IDs)"
309
+ echo " Install monotask (npm install -g monotask) and re-run to enable board tracking."
310
+ fi
311
+ domains_needed=$(jq -r '.domains_needed[]? // empty' "$SESSION_STATE" | grep -v '^idea$' | tr '\n' ' ')
312
+ [ -z "$domains_needed" ] && { echo "INFO: no non-idea domains to spawn as Task agents"; } # idea-only runs are valid
293
313
 
294
314
  # Returns: best agent name from registry for the given domain+goal
295
315
  pick_domain_manager() {
@@ -335,19 +355,17 @@ pick_domain_manager() {
335
355
  fi
336
356
  }
337
357
 
338
- declare -A domain_managers
358
+ # jq accumulation (replaces bash 4.3+ declare -A — compatible with macOS bash 3.2)
359
+ domain_managers_json='{}'
339
360
  for domain in $domains_needed; do
340
361
  goal=$(jq -r --arg d "$domain" '.domain_goals[$d] // empty' "$SESSION_STATE")
341
362
  [ -z "$goal" ] && goal=$(jq -r '.prompt // ""' "$SESSION_STATE")
342
363
  manager=$(pick_domain_manager "$domain" "$goal")
343
- domain_managers[$domain]="$manager"
364
+ domain_managers_json=$(echo "$domain_managers_json" | jq --arg d "$domain" --arg m "$manager" '. + {($d): $m}')
344
365
  echo "Domain manager for $domain: $manager"
345
366
  done
346
367
 
347
368
  # Persist domain_managers so Phase C can reload them without stdout parsing
348
- domain_managers_json=$(for k in "${!domain_managers[@]}"; do
349
- jq -n --arg k "$k" --arg v "${domain_managers[$k]}" '{key:$k,value:$v}'
350
- done | jq -s 'from_entries // {}')
351
369
  [ -z "$domain_managers_json" ] && domain_managers_json="{}"
352
370
  jq --argjson mgrs "$domain_managers_json" '. + {domain_managers:$mgrs}' \
353
371
  "$SESSION_STATE" > "$SESSION_STATE.tmp" && mv "$SESSION_STATE.tmp" "$SESSION_STATE"
@@ -372,11 +390,13 @@ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
372
390
  SESSION_STATE="$REPO_ROOT/.monomind/sessions/current.json"
373
391
  SESSION_ID=$(jq -r '.sessionId // empty' "$SESSION_STATE" 2>/dev/null)
374
392
  [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID not found in current.json"; exit 1; }
375
- domains_needed=$(jq -r '.domains_needed[]? // empty' "$SESSION_STATE" | tr '\n' ' ')
393
+ CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
394
+ # Filter idea — it was already handled by Skill tool before Phase A, not dispatched as a Task agent
395
+ domains_needed=$(jq -r '.domains_needed[]? // empty' "$SESSION_STATE" | grep -v '^idea$' | tr '\n' ' ')
376
396
  for domain in $domains_needed; do
377
397
  goal=$(jq -r --arg d "$domain" '.domain_goals[$d] // empty' "$SESSION_STATE")
378
398
  [ -z "$goal" ] && goal=$(jq -r '.prompt // ""' "$SESSION_STATE")
379
- curl -s -o /dev/null -X POST "http://localhost:4242/api/mastermind/event" \
399
+ curl -s -o /dev/null -X POST "${CTRL_URL}/api/mastermind/event" \
380
400
  -H "Content-Type: application/json" \
381
401
  -d "$(jq -cn --arg sid "$SESSION_ID" --arg d "$domain" --arg cmd "$goal" \
382
402
  '{type:"domain:dispatch",session:$sid,domain:$d,cmd:$cmd,ts:(now*1000|floor)}')" || true
@@ -394,10 +414,14 @@ SESSION_ID=$(jq -r '.sessionId // empty' "$SESSION_STATE" 2>/dev/null)
394
414
  [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID missing"; exit 1; }
395
415
 
396
416
  # Emit one line per domain for LLM to read before constructing Task calls
397
- for domain in $(jq -r '.domains_needed[]? // empty' "$SESSION_STATE"); do
417
+ for domain in $(jq -r '.domains_needed[]? // empty' "$SESSION_STATE" | grep -v '^idea$'); do
418
+ board_id=$(jq -r --arg d "$domain" '.board_ids[$d] // ""' "$SESSION_STATE")
419
+ if [ -z "$board_id" ]; then
420
+ echo "WARN: DOMAIN=$domain has no board_id — Step 6 may not have run or monotask is missing. Task agent will run without board tracking."
421
+ fi
398
422
  echo "DOMAIN=$domain \
399
423
  MANAGER=$(jq -r --arg d "$domain" '.domain_managers[$d] // "coordinator"' "$SESSION_STATE") \
400
- BOARD=$(jq -r --arg d "$domain" '.board_ids[$d] // ""' "$SESSION_STATE") \
424
+ BOARD=$board_id \
401
425
  TODO=$(jq -r --arg d "$domain" '.todo_cols[$d] // ""' "$SESSION_STATE") \
402
426
  DOING=$(jq -r --arg d "$domain" '.doing_cols[$d] // ""' "$SESSION_STATE") \
403
427
  DONE=$(jq -r --arg d "$domain" '.done_cols[$d] // ""' "$SESSION_STATE") \
@@ -413,7 +437,7 @@ Each Task call must include a complete briefing following the Monotask Task Brie
413
437
  - The specific goal for this domain
414
438
  - The project name and run context
415
439
  - Instruction to create monotask cards directly using `monotask card create $BOARD_ID $COL_TODO_ID "<title>" --json` for all sub-tasks
416
- - Instruction to use `/monomind:do` to execute
440
+ - Instruction to use `Skill("monomind:do")` to execute tasks (Task agents have Skill tool access — do NOT use slash command syntax)
417
441
  - Instruction to spawn specialized agents using the domain-appropriate swarm topology
418
442
  - Instruction to return the unified output schema when done
419
443
 
@@ -452,26 +476,29 @@ Task({
452
476
  " - Code review: subagent_type 'reviewer'\n" +
453
477
  " Default swarm: hierarchical 6 agents raft\n\n" +
454
478
  "3. BEFORE spawning each agent, emit agent:spawn via curl (NOT WebFetch — use jq for correct ms timestamps):\n" +
455
- " curl -s -o /dev/null -X POST http://localhost:4242/api/mastermind/event \\\n" +
479
+ " REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)\n" +
480
+ " CTRL_URL=$(jq -r '.url // \"http://localhost:4242\"' \"$REPO_ROOT/.monomind/control.json\" 2>/dev/null || echo \"http://localhost:4242\")\n" +
481
+ " curl -s -o /dev/null -X POST ${CTRL_URL}/api/mastermind/event \\\n" +
456
482
  " -H 'Content-Type: application/json' \\\n" +
457
483
  " -d \"$(jq -cn --arg sid '<SESSION_ID>' --arg agent '<slug>' --arg task '<title>' \\\n" +
458
484
  " '{type:\"agent:spawn\",session:$sid,domain:\"build\",agent:$agent,task:$task,ts:(now*1000|floor)}')\" || true\n\n" +
459
485
  "4. If handing off artifacts to another domain, emit intercom via curl:\n" +
460
- " curl -s -o /dev/null -X POST http://localhost:4242/api/mastermind/event \\\n" +
486
+ " curl -s -o /dev/null -X POST ${CTRL_URL}/api/mastermind/event \\\n" +
461
487
  " -H 'Content-Type: application/json' \\\n" +
462
488
  " -d \"$(jq -cn --arg sid '<SESSION_ID>' --arg to '<domain>' --arg msg '<summary>' \\\n" +
463
489
  " '{type:\"intercom\",session:$sid,from:\"build\",to:$to,msg:$msg,ts:(now*1000|floor)}')\" || true\n\n" +
464
- "5. Execute tasks via /monomind:do --board <board_build>\n" +
490
+ "5. Execute tasks via Skill(\"monomind:do\") --board <board_build> (use Skill tool — slash command syntax does not work inside a Task agent)\n" +
465
491
  "6. Collect all agent outputs\n\n" +
466
492
  "7. BEFORE returning, write your output schema to disk AND emit domain:complete:\n" +
467
493
  " REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)\n" +
494
+ " CTRL_URL=$(jq -r '.url // \"http://localhost:4242\"' \"$REPO_ROOT/.monomind/control.json\" 2>/dev/null || echo \"http://localhost:4242\")\n" +
468
495
  " mkdir -p \"$REPO_ROOT/.monomind/sessions/<SESSION_ID>\"\n" +
469
496
  " jq -n --arg domain 'build' --arg status '<status>' \\\n" +
470
497
  " --argjson artifacts '[\"<path1>\",\"<path2>\"]' \\\n" +
471
498
  " --argjson next_actions '[\"<action1>\"]' \\\n" +
472
499
  " '{domain:$domain,status:$status,artifacts:$artifacts,next_actions:$next_actions}' \\\n" +
473
500
  " > \"$REPO_ROOT/.monomind/sessions/<SESSION_ID>/build.json\"\n" +
474
- " curl -s -o /dev/null -X POST http://localhost:4242/api/mastermind/event \\\n" +
501
+ " curl -s -o /dev/null -X POST ${CTRL_URL}/api/mastermind/event \\\n" +
475
502
  " -H 'Content-Type: application/json' \\\n" +
476
503
  " -d \"$(jq -cn --arg sid '<SESSION_ID>' --arg status '<status>' \\\n" +
477
504
  " '{type:\"domain:complete\",session:$sid,domain:\"build\",status:$status,ts:(now*1000|floor)}')\" || true\n\n" +
@@ -499,11 +526,11 @@ Domain managers run in foreground (no `run_in_background`), so their unified out
499
526
  ```bash
500
527
  # Single bash block: aggregate status + emit dashboard event
501
528
  # (variables don't persist between Bash tool calls — keep aggregation and curl together)
502
- (( BASH_VERSINFO[0] * 100 + BASH_VERSINFO[1] < 400 )) && \
503
- { echo "ERROR: bash 4+ required (current: $BASH_VERSION). Install: brew install bash"; exit 1; }
529
+ # Compatible with macOS bash 3.2 only uses indexed arrays
504
530
  REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
505
531
  SESSION_ID=$(jq -r '.sessionId // empty' "$REPO_ROOT/.monomind/sessions/current.json" 2>/dev/null)
506
532
  [ -z "$SESSION_ID" ] && { echo "ERROR: SESSION_ID missing"; exit 1; }
533
+ CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
507
534
 
508
535
  overall_status="complete"
509
536
  completed_domains=()
@@ -525,7 +552,7 @@ echo "overall_status=$overall_status completed_domains=${completed_domains[*]}"
525
552
 
526
553
  completed_domains_json=$(jq -n '$ARGS.positional' --args "${completed_domains[@]}")
527
554
 
528
- curl -s -o /dev/null -X POST "http://localhost:4242/api/mastermind/event" \
555
+ curl -s -o /dev/null -X POST "${CTRL_URL}/api/mastermind/event" \
529
556
  -H "Content-Type: application/json" \
530
557
  -d "$(jq -cn \
531
558
  --arg sid "$SESSION_ID" \
@@ -579,8 +606,7 @@ Show the action summary (Step 9). If any compaction ran during Step 10, append:
579
606
  **Persist session state for iteration cycles:** Aggregate artifacts from per-domain output files written by each domain manager, then persist to disk so Step 12 can load it:
580
607
 
581
608
  ```bash
582
- (( BASH_VERSINFO[0] * 100 + BASH_VERSINFO[1] < 400 )) && \
583
- { echo "ERROR: bash 4+ required (current: $BASH_VERSION). Install: brew install bash"; exit 1; }
609
+ # Compatible with macOS bash 3.2 only uses indexed arrays
584
610
  REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
585
611
  SESSION_STATE="$REPO_ROOT/.monomind/sessions/current.json"
586
612
 
@@ -696,16 +722,16 @@ Log this as a decision in the cycle's output schema with `confidence` set accord
696
722
 
697
723
  #### 12c — Execute
698
724
 
699
- Execute the chosen activity by invoking the appropriate domain skill directly (Steps 4–10 of the main flow, condensed):
725
+ Execute the chosen activity by invoking the appropriate domain skill via the `Skill` tool (Steps 4–10 of the main flow, condensed). Use `Skill("mastermind:<domain>")` — do NOT use slash command syntax (`/<name>`), which only works in the Claude Code CLI prompt and not inside a running skill:
700
726
 
701
- - Test → invoke `/mastermind:build` with a testing-focused prompt
702
- - Debug/Fix → invoke `/mastermind:build` with the specific failing test or error as prompt
703
- - Review → invoke `/mastermind:review` with scope = artifacts from last run
704
- - Improve/Refactor → invoke `/mastermind:build` with refactor prompt
705
- - Add feature → invoke `/mastermind:build` with the next feature from the `next_actions` array printed by the Step 12a output above
706
- - Research → invoke `/mastermind:research` with the open question as prompt
707
- - Content/Docs → invoke `/mastermind:content` with scope = new artifacts
708
- - Release → invoke `/mastermind:release` with project scope
727
+ - Test → `Skill("mastermind:build")` with a testing-focused prompt
728
+ - Debug/Fix → `Skill("mastermind:build")` with the specific failing test or error as prompt
729
+ - Review → `Skill("mastermind:review")` with scope = artifacts from last run
730
+ - Improve/Refactor → `Skill("mastermind:build")` with refactor prompt
731
+ - Add feature → `Skill("mastermind:build")` with the next feature from the `next_actions` array printed by the Step 12a output above
732
+ - Research → `Skill("mastermind:research")` with the open question as prompt
733
+ - Content/Docs → `Skill("mastermind:content")` with scope = new artifacts
734
+ - Release → `Skill("mastermind:release")` with project scope
709
735
 
710
736
  Always pass: the current brain_context, project_name (from the `project_name` field above), the relevant board_id (look up `.board_ids[<chosen_domain>]` from the `board_ids` map printed above), and mode = auto (iteration cycles never pause for confirmation).
711
737
 
@@ -3,6 +3,8 @@ name: mastermind-ops
3
3
  description: Mastermind ops domain — workflow automation, reporting, process optimization. Default mode: auto.
4
4
  ---
5
5
 
6
+ **First — extract repeat flags:** Follow the REPEAT PREAMBLE from `_repeat.md`. Extracts `--repeat`, `--tillend`, `--maxruns`, `--wait`, `--rep`, `--loop` from `$ARGUMENTS` before all other parsing. If `is_continuation = true`, skip the empty-prompt check and intake below.
7
+
6
8
  Parse `$ARGUMENTS` for:
7
9
  - `--auto` flag → mode = auto
8
10
  - `--confirm` flag → mode = confirm
@@ -20,3 +22,5 @@ Default mode for this command: **auto** (unless `--confirm` flag present or inta
20
22
  Invoke `Skill("mastermind:ops")` passing: brain_context, prompt, project_name, board_id (create if needed), mode.
21
23
 
22
24
  After skill returns: follow _protocol.md Brain Write Procedure for domain `ops`.
25
+
26
+ Follow the REPEAT POSTAMBLE from `_repeat.md`.
@@ -3,6 +3,8 @@ name: mastermind-release
3
3
  description: Mastermind release domain — versioning, changelog, deployment. Default mode: auto.
4
4
  ---
5
5
 
6
+ **First — extract repeat flags:** Follow the REPEAT PREAMBLE from `_repeat.md`. Extracts `--repeat`, `--tillend`, `--maxruns`, `--wait`, `--rep`, `--loop` from `$ARGUMENTS` before all other parsing. If `is_continuation = true`, skip the empty-prompt check and intake below.
7
+
6
8
  Parse `$ARGUMENTS` for:
7
9
  - `--auto` flag → mode = auto
8
10
  - `--confirm` flag → mode = confirm
@@ -20,3 +22,5 @@ Default mode for this command: **auto** (unless `--confirm` flag present or inta
20
22
  Invoke `Skill("mastermind:release")` passing: brain_context, prompt, project_name, board_id (create if needed), mode.
21
23
 
22
24
  After skill returns: follow _protocol.md Brain Write Procedure for domain `release`.
25
+
26
+ Follow the REPEAT POSTAMBLE from `_repeat.md`.
@@ -3,6 +3,8 @@ name: mastermind-research
3
3
  description: Mastermind research domain — market research, competitor analysis, user research, trend scanning. Default mode: auto.
4
4
  ---
5
5
 
6
+ **First — extract repeat flags:** Follow the REPEAT PREAMBLE from `_repeat.md`. Extracts `--repeat`, `--tillend`, `--maxruns`, `--wait`, `--rep`, `--loop` from `$ARGUMENTS` before all other parsing. If `is_continuation = true`, skip the empty-prompt check and intake below.
7
+
6
8
  Parse `$ARGUMENTS` for:
7
9
  - `--auto` flag → mode = auto
8
10
  - `--confirm` flag → mode = confirm
@@ -20,3 +22,5 @@ Default mode for this command: **auto** (unless `--confirm` flag present or inta
20
22
  Invoke `Skill("mastermind:research")` passing: brain_context, prompt, project_name, board_id (create if needed), mode.
21
23
 
22
24
  After skill returns: follow _protocol.md Brain Write Procedure for domain `research`.
25
+
26
+ Follow the REPEAT POSTAMBLE from `_repeat.md`.
@@ -3,6 +3,8 @@ name: mastermind-review
3
3
  description: Mastermind review domain — code review, security audit, content and strategy review. Default mode: auto.
4
4
  ---
5
5
 
6
+ **First — extract repeat flags:** Follow the REPEAT PREAMBLE from `_repeat.md`. Extracts `--repeat`, `--tillend`, `--maxruns`, `--wait`, `--rep`, `--loop` from `$ARGUMENTS` before all other parsing. If `is_continuation = true`, skip the empty-prompt check and intake below.
7
+
6
8
  Parse `$ARGUMENTS` for:
7
9
  - `--auto` flag → mode = auto
8
10
  - `--confirm` flag → mode = confirm
@@ -20,3 +22,5 @@ Default mode for this command: **auto** (unless `--confirm` flag present or inta
20
22
  Invoke `Skill("mastermind:review")` passing: brain_context, prompt, project_name, board_id (create if needed), mode.
21
23
 
22
24
  After skill returns: follow _protocol.md Brain Write Procedure for domain `review`.
25
+
26
+ Follow the REPEAT POSTAMBLE from `_repeat.md`.
@@ -68,12 +68,14 @@ Load brain context for the `ops` domain (follow _protocol.md Brain Load Procedur
68
68
 
69
69
  Generate a session ID as a real shell variable:
70
70
  ```bash
71
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
71
72
  session_id="mm-$(date -u +%Y%m%dT%H%M%S)"
73
+ CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
72
74
  ```
73
75
 
74
76
  Emit `session:start` to dashboard:
75
77
  ```bash
76
- curl -s -X POST "http://localhost:4242/api/mastermind/event" \
78
+ curl -s -X POST "${CTRL_URL}/api/mastermind/event" \
77
79
  -H "Content-Type: application/json" \
78
80
  -d "$(jq -cn \
79
81
  --arg session "$session_id" \
@@ -84,7 +86,7 @@ curl -s -X POST "http://localhost:4242/api/mastermind/event" \
84
86
 
85
87
  Emit `domain:dispatch`:
86
88
  ```bash
87
- curl -s -X POST "http://localhost:4242/api/mastermind/event" \
89
+ curl -s -X POST "${CTRL_URL}/api/mastermind/event" \
88
90
  -H "Content-Type: application/json" \
89
91
  -d "$(jq -cn \
90
92
  --arg session "$session_id" \
@@ -96,7 +98,7 @@ Invoke `Skill("mastermind:runorg")` passing: brain_context, org_name: `$org_name
96
98
 
97
99
  After the skill spawns the boss agent and returns: note the status. Emit `session:complete`:
98
100
  ```bash
99
- curl -s -X POST "http://localhost:4242/api/mastermind/event" \
101
+ curl -s -X POST "${CTRL_URL}/api/mastermind/event" \
100
102
  -H "Content-Type: application/json" \
101
103
  -d "$(jq -cn \
102
104
  --arg session "$session_id" \
@@ -3,6 +3,8 @@ name: mastermind-sales
3
3
  description: Mastermind sales domain — outreach sequences, proposals, pipeline management. Default mode: confirm.
4
4
  ---
5
5
 
6
+ **First — extract repeat flags:** Follow the REPEAT PREAMBLE from `_repeat.md`. Extracts `--repeat`, `--tillend`, `--maxruns`, `--wait`, `--rep`, `--loop` from `$ARGUMENTS` before all other parsing. If `is_continuation = true`, skip the empty-prompt check and intake below.
7
+
6
8
  Parse `$ARGUMENTS` for:
7
9
  - `--auto` flag → mode = auto
8
10
  - `--confirm` flag → mode = confirm
@@ -20,3 +22,5 @@ Default mode for this command: **confirm** (unless `--auto` flag present or inta
20
22
  Invoke `Skill("mastermind:sales")` passing: brain_context, prompt, project_name, board_id (create if needed), mode.
21
23
 
22
24
  After skill returns: follow _protocol.md Brain Write Procedure for domain `sales`.
25
+
26
+ Follow the REPEAT POSTAMBLE from `_repeat.md`.
@@ -3,6 +3,8 @@ name: mastermind-techport
3
3
  description: Tech Port — deep-analyzes a foreign project folder and recommends porting valuable features, patterns, or infrastructure into the current monomind base project.
4
4
  ---
5
5
 
6
+ **First — extract repeat flags:** Follow the REPEAT PREAMBLE from `_repeat.md`. Extracts `--repeat`, `--tillend`, `--maxruns`, `--wait`, `--rep`, `--loop` from `$ARGUMENTS` before all other parsing. If `is_continuation = true`, skip the empty-prompt check below.
7
+
6
8
  Parse `$ARGUMENTS` for:
7
9
  - First path-like token (starts with `/`, `./`, `../`, or `~`) → source_path
8
10
  - `--auto` flag → mode = auto (port immediately after analysis)
@@ -14,4 +16,11 @@ If source_path is empty: ask "What is the path to the project you want to analyz
14
16
 
15
17
  Default mode: **confirm** (show analysis + port plan, wait before executing anything).
16
18
 
19
+ > **Note for `--tillend` / `--repeat` loops:** This command defaults to `--confirm`, which presents a plan but doesn't execute it. In an unattended loop, this means each run will find items (findings = yes) but take no action (actions = no), so `TILLEND_EMPTY` never becomes true and the loop runs until the safety cap. Always add `--auto` when using this command in a loop:
20
+ > ```
21
+ > /mastermind:techport --tillend --auto /path/to/project
22
+ > ```
23
+
17
24
  Invoke `Skill("mastermind:techport")` passing: source_path, focus_hint, mode.
25
+
26
+ Follow the REPEAT POSTAMBLE from `_repeat.md`.
@@ -3,9 +3,13 @@ name: monomind:do
3
3
  description: "Monomind — Execute tasks from monomind-task board with parallel, minimal, or sequential agent modes, smart context group routing, and review cycles"
4
4
  ---
5
5
 
6
+ ## Repeat Flag Extraction
7
+
8
+ **Before all other parsing:** Extract and discard `--repeat`, `--tillend`, `--maxruns`, `--wait` from `$ARGUMENTS` so they don't interfere with the command's own argument parser. `monomind:do` manages its own task-board-driven loop internally (see end of command) — the REPEAT POSTAMBLE is NOT used. To wrap this command with an external loop, use `/monomind:repeat -- /monomind:do ...`.
9
+
6
10
  ## Argument Parsing
7
11
 
8
- Parse `$ARGUMENTS` for the following flags (in any order):
12
+ Parse remaining `$ARGUMENTS` for the following flags (in any order):
9
13
 
10
14
  - `--space <SPACE_ID>` — use this space directly (skip space discovery)
11
15
  - `--board <BOARD_ID>` — use this task board directly (skip board discovery)
@@ -3,6 +3,8 @@ name: monomind:idea
3
3
  description: "Monomind — Research ideas from a prompt, evaluate them, and decompose into subtasks on monotask boards"
4
4
  ---
5
5
 
6
+ **First — extract repeat flags:** Follow the REPEAT PREAMBLE from `_repeat.md`. Extracts `--repeat`, `--tillend`, `--maxruns`, `--wait`, `--rep`, `--loop` from `$ARGUMENTS` before all other parsing. If `is_continuation = true`, skip the empty-arguments check below.
7
+
6
8
  If `$ARGUMENTS` is empty, output this and STOP:
7
9
 
8
10
  > **Usage:** `/monomind:idea <prompt>`
@@ -266,4 +268,6 @@ If there are tasks in Todo, offer:
266
268
  Skill("monomind:do", "--space $SPACE_ID --board $TASK_BOARD_ID --mode <parallel|minimal|sequential>")
267
269
  ```
268
270
 
269
- To repeat this command on a schedule, wrap it with `/monomind:repeat`.
271
+ To repeat this command on a schedule, wrap it with `/monomind:repeat` or use `--repeat N` / `--tillend` directly.
272
+
273
+ Follow the REPEAT POSTAMBLE from `_repeat.md`.
@@ -3,6 +3,8 @@ name: monomind:improve
3
3
  description: "Monomind — Deeply analyze a project component, research improvements online, and create improvement tasks on monotask boards"
4
4
  ---
5
5
 
6
+ **First — extract repeat flags:** Follow the REPEAT PREAMBLE from `_repeat.md`. Extracts `--repeat`, `--tillend`, `--maxruns`, `--wait`, `--rep`, `--loop` from `$ARGUMENTS` before all other parsing. If `is_continuation = true`, skip the empty-arguments check below.
7
+
6
8
  If `$ARGUMENTS` is empty, output this and STOP:
7
9
 
8
10
  > **Usage:** `/monomind:improve <component or concept>`
@@ -343,4 +345,6 @@ If there are tasks in Todo, offer:
343
345
  Skill("monomind:do", "--space $SPACE_ID --board $TASK_BOARD_ID --mode <parallel|minimal|sequential>")
344
346
  ```
345
347
 
346
- To repeat this command on a schedule, wrap it with `/monomind:repeat`.
348
+ To repeat this command on a schedule, wrap it with `/monomind:repeat` or use `--repeat N` / `--tillend` directly.
349
+
350
+ Follow the REPEAT POSTAMBLE from `_repeat.md`.