@monoes/monomindcli 1.9.16 → 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 +100 -46
  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 +37 -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 +318 -186
  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
@@ -8,7 +8,9 @@ description: "Monomind — Repeat any prompt or slash command on a schedule —
8
8
  Parse `$ARGUMENTS` for the following flags. **Everything after the first `--` (double dash) is the prompt — no further flag parsing, even if subsequent `--` tokens appear.** If no `--` is present, extract known flags in any order and treat the remainder as the prompt:
9
9
 
10
10
  - `--every <minutes>` — interval between repetitions in minutes (default: `15`). Minimum 1.
11
- - `--times <count>` — total number of repetitions (default: `10`)
11
+ - `--times <count>` — total number of repetitions (default: `10`). Ignored when `--tillend` is present.
12
+ - `--tillend` — run until a complete round produces no findings and no actions. Overrides `--times`.
13
+ - `--maxruns <N>` — safety cap for `--tillend` (default: `50`). Stops the loop even if the AI hasn't signaled done.
12
14
  - `--rep <N>` — (internal continuation flag injected by ScheduleWakeup; do not expose to user). Must be a positive integer ≤ MAX_REPS+1; reject otherwise.
13
15
  - `--loop <id>` — (internal continuation flag; preserves loop identity across runs). Must match format `repeat-[digits]-[digits]-[digits]`; reject otherwise.
14
16
  - `--` — end of flags; everything after this is the prompt verbatim
@@ -33,13 +35,17 @@ If `--loop` is present but does not match the pattern `repeat-<digits>-<digits>-
33
35
  ```
34
36
 
35
37
  If `$ARGUMENTS` is empty or contains only flags with no prompt, output this and STOP:
36
- > **Usage:** `/monomind:repeat [--every <minutes>] [--times <count>] <prompt>`
38
+ > **Usage:** `/monomind:repeat [--every <minutes>] [--times <count>] [--tillend [--maxruns <N>]] <prompt>`
37
39
  >
38
40
  > Defaults: every 15 minutes, 10 times.
39
41
  >
42
+ > **Fixed-count mode** (default): runs the prompt N times, then stops.
43
+ > **Tillend mode** (`--tillend`): runs until a complete round produces no findings and no actions. Safety cap: `--maxruns N` (default 50).
44
+ >
40
45
  > This is the universal loop wrapper. Wrap any slash command to repeat it:
41
46
  > - `/monomind:repeat --every 5 --times 9 /mastermind:architect review this project`
42
47
  > - `/monomind:repeat --every 1 --times 20 /mastermind:review check for security issues`
48
+ > - `/monomind:repeat --tillend /mastermind:review 1` ← runs until clean pass
43
49
  > - `/monomind:repeat --every 30 /monomind:do --space abc --board def`
44
50
  > - `/monomind:repeat check deployment status`
45
51
 
@@ -53,9 +59,8 @@ When `--rep <N>` is present in arguments, this is a continuation from a previous
53
59
  - Set `LOOP_ID` from `--loop <id>`
54
60
  - Skip Step 1 initialization entirely
55
61
  - Go directly to Step 2 (execute) with output:
56
- ```
57
- [monomind:repeat] Run N/MAX_REPS starting...
58
- ```
62
+ - **If `--tillend` active:** `[monomind:repeat] Tillend run N (cap: MAXRUNS) starting...`
63
+ - **Otherwise:** `[monomind:repeat] Run N/MAX_REPS starting...`
59
64
 
60
65
  ---
61
66
 
@@ -67,7 +72,7 @@ Extract:
67
72
  - `PROMPT` — everything remaining after flags are removed
68
73
  - `CURRENT_REP` — starts at `1`
69
74
 
70
- Write the initial loop state file so the dashboard can track this run. **You MUST run this bash block now via the Bash tool.** Before running, substitute `<INTERVAL>` and `<MAX_REPS>` with the parsed integer values. For `<PROMPT>`, substitute the raw prompt text inside the heredoc below — the single-quoted delimiter (`'MONOMIND_PROMPT_7x9k2m'`) prevents all bash expansion, and python3 handles JSON encoding. **If the prompt text contains the literal string `MONOMIND_PROMPT_7x9k2m`, replace that string in the prompt with `MONOMIND_PROMPT` before substitution** (this prevents heredoc delimiter collision):
75
+ Write the initial loop state file so the dashboard can track this run. **You MUST run this bash block now via the Bash tool.** Before running, substitute `<INTERVAL>` and `<MAX_REPS>` with the parsed integer values, `<TILLEND_ACTIVE>` with `true` or `false` based on whether `--tillend` was provided, and `<MAXRUNS>` with the safety cap value. For `<PROMPT>`, substitute the raw prompt text inside the heredoc below — the single-quoted delimiter (`'MONOMIND_PROMPT_7x9k2m'`) prevents all bash expansion, and python3 handles JSON encoding. **If the prompt text contains the literal string `MONOMIND_PROMPT_7x9k2m`, replace that string in the prompt with `MONOMIND_PROMPT` before substitution** (this prevents heredoc delimiter collision):
71
76
 
72
77
  ```bash
73
78
  mkdir -p .monomind/loops
@@ -78,16 +83,18 @@ PROMPT_JSON=$(python3 -c "import sys,json; sys.stdout.write(json.dumps(sys.stdin
78
83
  MONOMIND_PROMPT_7x9k2m
79
84
  )
80
85
  if [ -z "$PROMPT_JSON" ]; then PROMPT_JSON='"(prompt unavailable)"'; fi
86
+ LOOP_TYPE=$( [ '<TILLEND_ACTIVE>' = 'true' ] && echo 'tillend' || echo 'repeat' )
87
+ LOOP_MAXREPS=$( [ '<TILLEND_ACTIVE>' = 'true' ] && echo '<MAXRUNS>' || echo '<MAX_REPS>' )
81
88
  cat > ".monomind/loops/${LOOP_ID}.json" << EOF
82
89
  {
83
90
  "id": "${LOOP_ID}",
84
91
  "sessionId": "${LOOP_ID}",
85
- "type": "repeat",
92
+ "type": "${LOOP_TYPE}",
86
93
  "command": "/monomind:repeat",
87
94
  "prompt": ${PROMPT_JSON},
88
95
  "interval": <INTERVAL>,
89
96
  "currentRep": 1,
90
- "maxReps": <MAX_REPS>,
97
+ "maxReps": ${LOOP_MAXREPS},
91
98
  "startedAt": ${NOW_MS},
92
99
  "lastRunAt": ${NOW_MS},
93
100
  "nextRunAt": ${NOW_MS},
@@ -95,20 +102,30 @@ cat > ".monomind/loops/${LOOP_ID}.json" << EOF
95
102
  }
96
103
  EOF
97
104
  echo "LOOP_ID=${LOOP_ID}"
98
- curl -s -X POST "http://localhost:4242/api/mastermind/event" \
105
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
106
+ CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
107
+ curl -s -X POST "${CTRL_URL}/api/mastermind/event" \
99
108
  -H "Content-Type: application/json" \
100
- -d "{\"type\":\"loop:start\",\"loopId\":\"${LOOP_ID}\",\"command\":\"/monomind:repeat\",\"maxReps\":<MAX_REPS>,\"interval\":<INTERVAL>,\"ts\":$(date +%s)000}" || true
109
+ -d "{\"type\":\"loop:start\",\"loopId\":\"${LOOP_ID}\",\"command\":\"/monomind:repeat\",\"mode\":\"${LOOP_TYPE}\",\"maxReps\":${LOOP_MAXREPS},\"interval\":<INTERVAL>,\"ts\":$(date +%s)000}" || true
101
110
  ```
102
111
 
103
112
  Capture the `LOOP_ID` value echoed by the script — you will need it for all subsequent bash blocks.
104
113
 
105
114
  Output:
106
- ```
107
- [monomind:repeat] Starting: "<PROMPT>"
108
- Interval: every INTERVAL minutes
109
- Repetitions: MAX_REPS total
110
- Run 1/MAX_REPS starting now...
111
- ```
115
+ - **If `--tillend` active:**
116
+ ```
117
+ [monomind:repeat] Starting tillend loop: "<PROMPT>"
118
+ Interval: every INTERVAL minutes
119
+ Safety cap: MAXRUNS runs
120
+ Run 1 starting now...
121
+ ```
122
+ - **Otherwise:**
123
+ ```
124
+ [monomind:repeat] Starting: "<PROMPT>"
125
+ Interval: every INTERVAL minutes
126
+ Repetitions: MAX_REPS total
127
+ Run 1/MAX_REPS starting now...
128
+ ```
112
129
 
113
130
  ---
114
131
 
@@ -135,24 +152,57 @@ rm -f ".monomind/loops/<LOOP_ID>.json" ".monomind/loops/<LOOP_ID>.stop"
135
152
  Then STOP.
136
153
 
137
154
  After execution completes, save the current rep as `PREV_REP`, then increment `CURRENT_REP`. Output:
138
- ```
139
- [monomind:repeat] Run PREV_REP/MAX_REPS complete.
140
- ```
155
+ - **If `--tillend` active:** `[monomind:repeat] Tillend run PREV_REP complete.`
156
+ - **Otherwise:** `[monomind:repeat] Run PREV_REP/MAX_REPS complete.`
157
+
158
+ **If `--tillend` was active:** evaluate whether this round produced **zero findings AND zero actions**. Answer these two questions:
159
+ 1. Were any findings produced? (issues, problems, errors, tasks, items flagged, anything detected)
160
+ 2. Were any actions taken? (files edited, tasks created, commits made, content written, anything changed)
161
+
162
+ Set `TILLEND_EMPTY=true` only if both answers are "no". **If the round found things and fixed them, `TILLEND_EMPTY=false` — run again to verify.** Only an actually empty round (nothing found, nothing done) stops the loop.
163
+
164
+ If `TILLEND_EMPTY=true`:
165
+ - Output: `[monomind:repeat] Empty round — nothing found and nothing changed. Tillend loop complete after PREV_REP run(s).`
166
+ - Remove state file and emit loop:complete:
167
+ ```bash
168
+ rm -f ".monomind/loops/<LOOP_ID>.json" ".monomind/loops/<LOOP_ID>.stop"
169
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
170
+ CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
171
+ curl -s -X POST "${CTRL_URL}/api/mastermind/event" \
172
+ -H "Content-Type: application/json" \
173
+ -d "{\"type\":\"loop:complete\",\"loopId\":\"<LOOP_ID>\",\"command\":\"/monomind:repeat\",\"mode\":\"tillend\",\"ranReps\":<PREV_REP>,\"reason\":\"empty-round\",\"ts\":$(date +%s)000}" || true
174
+ ```
175
+ - STOP. Do NOT schedule another wake-up.
176
+
177
+ If `--tillend` is active AND `CURRENT_REP > MAXRUNS` (safety cap reached):
178
+ - Output: `[monomind:repeat] Safety cap reached (MAXRUNS runs). Stopping tillend loop. If work remains, re-run with a higher --maxruns.`
179
+ - Remove state file and emit loop:complete:
180
+ ```bash
181
+ rm -f ".monomind/loops/<LOOP_ID>.json" ".monomind/loops/<LOOP_ID>.stop"
182
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
183
+ CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
184
+ curl -s -X POST "${CTRL_URL}/api/mastermind/event" \
185
+ -H "Content-Type: application/json" \
186
+ -d "{\"type\":\"loop:complete\",\"loopId\":\"<LOOP_ID>\",\"command\":\"/monomind:repeat\",\"mode\":\"tillend\",\"ranReps\":<PREV_REP>,\"reason\":\"safety-cap\",\"ts\":$(date +%s)000}" || true
187
+ ```
188
+ - STOP.
141
189
 
142
- If `CURRENT_REP > MAX_REPS` (all runs done), output:
190
+ If `CURRENT_REP > MAX_REPS` (fixed-count: all runs done), output:
143
191
  ```
144
192
  [monomind:repeat] All MAX_REPS repetitions complete.
145
193
  ```
146
194
  Remove the state file and emit loop:complete:
147
195
  ```bash
148
196
  rm -f ".monomind/loops/<LOOP_ID>.json" ".monomind/loops/<LOOP_ID>.stop"
149
- curl -s -X POST "http://localhost:4242/api/mastermind/event" \
197
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
198
+ CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
199
+ curl -s -X POST "${CTRL_URL}/api/mastermind/event" \
150
200
  -H "Content-Type: application/json" \
151
201
  -d "{\"type\":\"loop:complete\",\"loopId\":\"<LOOP_ID>\",\"command\":\"/monomind:repeat\",\"ranReps\":<MAX_REPS>,\"ts\":$(date +%s)000}" || true
152
202
  ```
153
203
  STOP. Do NOT schedule another wake-up.
154
204
 
155
- Otherwise, update the loop state before scheduling. **Run this bash block** (substitute `<LOOP_ID>`, `<INTERVAL>`, `<CURRENT_REP>`, `<MAX_REPS>`, and `<PREV_REP>` with their literal values):
205
+ Otherwise, update the loop state before scheduling. **Run this bash block** (substitute `<LOOP_ID>`, `<INTERVAL>`, `<CURRENT_REP>`, `<MAX_REPS>`, `<PREV_REP>`, `<TILLEND_ACTIVE>`, and `<MAXRUNS>` with their literal values):
156
206
  ```bash
157
207
  NOW_MS=$(python3 -c 'import time;print(int(time.time()*1000))' 2>/dev/null || echo "$(date +%s)000")
158
208
  NEXT_AT=$(( NOW_MS + <INTERVAL> * 60 * 1000 ))
@@ -162,33 +212,39 @@ PROMPT_JSON=$(jq '.prompt' ".monomind/loops/<LOOP_ID>.json" 2>/dev/null \
162
212
  STARTED_AT=$(jq '.startedAt' ".monomind/loops/<LOOP_ID>.json" 2>/dev/null \
163
213
  || python3 -c "import json; print(json.load(open('.monomind/loops/<LOOP_ID>.json'))['startedAt'])" 2>/dev/null \
164
214
  || echo "${NOW_MS}")
215
+ LOOP_TYPE=$( [ '<TILLEND_ACTIVE>' = 'true' ] && echo 'tillend' || echo 'repeat' )
216
+ LOOP_MAXREPS=$( [ '<TILLEND_ACTIVE>' = 'true' ] && echo '<MAXRUNS>' || echo '<MAX_REPS>' )
165
217
  cat > ".monomind/loops/<LOOP_ID>.json" << EOF
166
218
  {
167
219
  "id": "<LOOP_ID>",
168
220
  "sessionId": "<LOOP_ID>",
169
- "type": "repeat",
221
+ "type": "${LOOP_TYPE}",
170
222
  "command": "/monomind:repeat",
171
223
  "prompt": ${PROMPT_JSON},
172
224
  "interval": <INTERVAL>,
173
225
  "currentRep": <CURRENT_REP>,
174
- "maxReps": <MAX_REPS>,
226
+ "maxReps": ${LOOP_MAXREPS},
175
227
  "startedAt": ${STARTED_AT},
176
228
  "lastRunAt": ${NOW_MS},
177
229
  "nextRunAt": ${NEXT_AT},
178
230
  "status": "running"
179
231
  }
180
232
  EOF
181
- curl -s -X POST "http://localhost:4242/api/mastermind/event" \
233
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
234
+ CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
235
+ curl -s -X POST "${CTRL_URL}/api/mastermind/event" \
182
236
  -H "Content-Type: application/json" \
183
- -d "{\"type\":\"loop:tick\",\"loopId\":\"<LOOP_ID>\",\"command\":\"/monomind:repeat\",\"completedRep\":<PREV_REP>,\"nextRep\":<CURRENT_REP>,\"nextAt\":${NEXT_AT},\"ts\":$(date +%s)000}" || true
237
+ -d "{\"type\":\"loop:tick\",\"loopId\":\"<LOOP_ID>\",\"command\":\"/monomind:repeat\",\"mode\":\"${LOOP_TYPE}\",\"completedRep\":<PREV_REP>,\"nextRep\":<CURRENT_REP>,\"nextAt\":${NEXT_AT},\"ts\":$(date +%s)000}" || true
184
238
  ```
185
239
 
186
- Output: `[monomind:repeat] Next run in INTERVAL minutes (run CURRENT_REP/MAX_REPS)...`
240
+ Output:
241
+ - **If `--tillend` active:** `[monomind:repeat] Next tillend run in INTERVAL minutes (run CURRENT_REP, cap: MAXRUNS)...`
242
+ - **Otherwise:** `[monomind:repeat] Next run in INTERVAL minutes (run CURRENT_REP/MAX_REPS)...`
187
243
 
188
244
  Use `ScheduleWakeup` with:
189
245
  - `delaySeconds`: `INTERVAL * 60`
190
- - `prompt`: `/monomind:repeat --every <INTERVAL> --times <MAX_REPS> --rep <CURRENT_REP> --loop <LOOP_ID> -- <PROMPT>`
191
- - `reason`: `"repeat run <CURRENT_REP>/<MAX_REPS> of /monomind:repeat"`
246
+ - **If `--tillend` active:** `prompt`: `/monomind:repeat --tillend --maxruns <MAXRUNS> --every <INTERVAL> --rep <CURRENT_REP> --loop <LOOP_ID> -- <PROMPT>`; `reason`: `"tillend run <CURRENT_REP> (cap: <MAXRUNS>) of /monomind:repeat"`
247
+ - **Otherwise:** `prompt`: `/monomind:repeat --every <INTERVAL> --times <MAX_REPS> --rep <CURRENT_REP> --loop <LOOP_ID> -- <PROMPT>`; `reason`: `"repeat run <CURRENT_REP>/<MAX_REPS> of /monomind:repeat"`
192
248
 
193
249
  The `--` before `<PROMPT>` ensures the prompt text is never parsed as flags, even if it contains `--every` or `--times`. Substitute all angle-bracket values with their literals.
194
250
 
@@ -3,7 +3,9 @@ name: monomind:review
3
3
  description: "Monomind — Multi-agent iterative review loop: runs Code Reviewer, Security Engineer, and domain specialists in parallel, auto-fixes findings each iteration, and captures human-in-loop items to a dated file."
4
4
  ---
5
5
 
6
- Parse `$ARGUMENTS` as `TOTAL_ITERATIONS` (integer, min 1, max 10).
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
+
8
+ Parse remaining `$ARGUMENTS` as `TOTAL_ITERATIONS` (integer, min 1, max 10).
7
9
 
8
10
  If `$ARGUMENTS` is empty, not a positive integer, or greater than 10, output this and STOP:
9
11
 
@@ -310,4 +312,6 @@ Saved to: `humaninloopreview-<date>.md`
310
312
  If `ALL_HIL` is empty, omit the HIL section and congratulate:
311
313
  > All findings were auto-fixed. No human decisions required.
312
314
 
313
- To repeat this command on a schedule, wrap it with `/monomind:repeat`.
315
+ To repeat this command on a schedule, wrap it with `/monomind:repeat` or use `--repeat N` / `--tillend` directly.
316
+
317
+ Follow the REPEAT POSTAMBLE from `_repeat.md`.
@@ -67,15 +67,16 @@ Proceed to **Step 3: Run understand analysis**.
67
67
  ## Step 3: Run understand analysis
68
68
 
69
69
  Locate the understand plugin. Check these paths in order:
70
- 1. `/Users/morteza/Desktop/tools/knowledgegraph/Understand-Anything/understand-anything-plugin`
71
- 2. `$HOME/Desktop/tools/knowledgegraph/Understand-Anything/understand-anything-plugin`
72
- 3. `$UA_PLUGIN_DIR` (if set)
70
+ 1. `$UA_PLUGIN_DIR` (if set)
71
+ 2. `$HOME/tools/understand-anything/understand-anything-plugin`
72
+ 3. Sibling directory: `../understand-anything/understand-anything-plugin` relative to the project root
73
73
 
74
74
  If the plugin is NOT found, tell the user:
75
- > understand plugin not found.
76
- > Clone it to a sibling of this project or set `UA_PLUGIN_DIR`:
75
+ > understand plugin not found. Set `UA_PLUGIN_DIR` to its location, or clone it:
77
76
  > ```bash
78
- > git clone https://github.com/nicholasgasior/understand-anything ~/Desktop/tools/knowledgegraph/Understand-Anything
77
+ > git clone https://github.com/nicholasgasior/understand-anything \
78
+ > ~/tools/understand-anything
79
+ > export UA_PLUGIN_DIR=~/tools/understand-anything/understand-anything-plugin
79
80
  > ```
80
81
  And STOP.
81
82
 
@@ -99,7 +100,8 @@ Wait for completion before proceeding.
99
100
  Run the import script:
100
101
 
101
102
  ```bash
102
- node /path/to/monobrain/scripts/ua-import.mjs "$GRAPH_JSON" "$DB"
103
+ REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
104
+ node "$REPO_ROOT/scripts/ua-import.mjs" "$GRAPH_JSON" "$DB"
103
105
  ```
104
106
 
105
107
  Where:
@@ -143,6 +145,6 @@ To repeat this command on a schedule, wrap it with `/monomind:repeat`.
143
145
 
144
146
  ## Error Handling
145
147
 
146
- - If `ua-import.mjs` exits non-zero, show stderr and suggest running `pnpm install` from the monobrain root.
148
+ - If `ua-import.mjs` exits non-zero, show stderr and suggest running `pnpm install` from the monomind root.
147
149
  - If graph.json is malformed JSON, report the parse error and suggest re-running `/understand`.
148
150
  - All errors are non-fatal to the main session — report and return cleanly.