@monoes/monomindcli 2.10.9 → 2.10.13

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 (265) hide show
  1. package/.claude/commands/mastermind/brain.md +14 -14
  2. package/.claude/commands/mastermind/help.md +2 -2
  3. package/.claude/commands/mastermind/master.md +24 -19
  4. package/.claude/commands/mastermind/memory.md +8 -8
  5. package/.claude/commands/mastermind/monoswarm.md +4 -4
  6. package/.claude/commands/mastermind.md +7 -7
  7. package/.claude/commands/truth/start.md +3 -3
  8. package/.claude/settings.json +0 -4
  9. package/.claude/skills/mastermind/SKILL.md +7 -16
  10. package/.claude/skills/mastermind/references/antigravity-tools.md +0 -62
  11. package/.claude/skills/mastermind/references/claude-code-tools.md +0 -52
  12. package/.claude/skills/mastermind/references/codex-tools.md +0 -66
  13. package/.claude/skills/mastermind/references/copilot-tools.md +0 -51
  14. package/.claude/skills/mastermind/references/gemini-tools.md +0 -65
  15. package/.claude/skills/mastermind/references/pi-tools.md +0 -30
  16. package/.claude/skills/mastermind-createorg/SKILL.md +3 -1
  17. package/.claude/skills/mastermind-debug/SKILL.md +3 -277
  18. package/.claude/skills/mastermind-design/SKILL.md +2 -0
  19. package/.claude/skills/mastermind-execute/SKILL.md +59 -103
  20. package/.claude/skills/mastermind-idea/SKILL.md +9 -2
  21. package/.claude/skills/mastermind-intake/SKILL.md +31 -7
  22. package/.claude/skills/mastermind-issue-detail/SKILL.md +70 -16
  23. package/.claude/skills/mastermind-issues/SKILL.md +111 -16
  24. package/.claude/skills/mastermind-liveness/SKILL.md +96 -26
  25. package/.claude/skills/mastermind-memory/SKILL.md +0 -316
  26. package/.claude/skills/mastermind-my-issues/SKILL.md +40 -8
  27. package/.claude/skills/mastermind-org/SKILL.md +1 -12
  28. package/.claude/skills/mastermind-plan/SKILL.md +7 -228
  29. package/.claude/skills/mastermind-plan-to-tasks/SKILL.md +132 -24
  30. package/.claude/skills/mastermind-protocol/SKILL.md +33 -22
  31. package/.claude/skills/mastermind-research/SKILL.md +0 -163
  32. package/.claude/skills/mastermind-review/SKILL.md +0 -228
  33. package/.claude/skills/mastermind-runorg/SKILL.md +22 -3
  34. package/.claude/skills/mastermind-skill-builder/SKILL.md +1 -1
  35. package/.claude/skills/mastermind-tasks/SKILL.md +5 -0
  36. package/.claude/skills/mastermind-techport/SKILL.md +1 -1
  37. package/.claude/skills/performance-analysis/SKILL.md +1 -1
  38. package/.claude/skills/verification-quality/SKILL.md +2 -3
  39. package/README.md +2 -2
  40. package/dist/src/commands/agent-exec.d.ts +2 -0
  41. package/dist/src/commands/agent-exec.d.ts.map +1 -1
  42. package/dist/src/commands/agent-exec.js +16 -0
  43. package/dist/src/commands/agent-exec.js.map +1 -1
  44. package/dist/src/commands/doc.js +2 -2
  45. package/dist/src/commands/doc.js.map +1 -1
  46. package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
  47. package/dist/src/commands/doctor-project-checks.js +20 -1
  48. package/dist/src/commands/doctor-project-checks.js.map +1 -1
  49. package/dist/src/commands/init-wizard.d.ts.map +1 -1
  50. package/dist/src/commands/init-wizard.js +6 -0
  51. package/dist/src/commands/init-wizard.js.map +1 -1
  52. package/dist/src/commands/init.d.ts.map +1 -1
  53. package/dist/src/commands/init.js +12 -2
  54. package/dist/src/commands/init.js.map +1 -1
  55. package/dist/src/commands/monograph.d.ts.map +1 -1
  56. package/dist/src/commands/monograph.js +11 -4
  57. package/dist/src/commands/monograph.js.map +1 -1
  58. package/dist/src/commands/org-observe.d.ts +2 -0
  59. package/dist/src/commands/org-observe.d.ts.map +1 -1
  60. package/dist/src/commands/org-observe.js +115 -6
  61. package/dist/src/commands/org-observe.js.map +1 -1
  62. package/dist/src/commands/org.d.ts +26 -0
  63. package/dist/src/commands/org.d.ts.map +1 -1
  64. package/dist/src/commands/org.js +186 -28
  65. package/dist/src/commands/org.js.map +1 -1
  66. package/dist/src/init/codex-generator.d.ts +5 -0
  67. package/dist/src/init/codex-generator.d.ts.map +1 -1
  68. package/dist/src/init/codex-generator.js +12 -3
  69. package/dist/src/init/codex-generator.js.map +1 -1
  70. package/dist/src/init/executor.d.ts.map +1 -1
  71. package/dist/src/init/executor.js +10 -9
  72. package/dist/src/init/executor.js.map +1 -1
  73. package/dist/src/init/settings-generator.d.ts.map +1 -1
  74. package/dist/src/init/settings-generator.js +0 -5
  75. package/dist/src/init/settings-generator.js.map +1 -1
  76. package/dist/src/init/write-codex.d.ts.map +1 -1
  77. package/dist/src/init/write-codex.js +6 -5
  78. package/dist/src/init/write-codex.js.map +1 -1
  79. package/dist/src/knowledge/document-pipeline.d.ts +5 -0
  80. package/dist/src/knowledge/document-pipeline.d.ts.map +1 -1
  81. package/dist/src/knowledge/document-pipeline.js +32 -16
  82. package/dist/src/knowledge/document-pipeline.js.map +1 -1
  83. package/dist/src/mcp-tools/hooks-routing.d.ts +9 -0
  84. package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
  85. package/dist/src/mcp-tools/hooks-routing.js +12 -1
  86. package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
  87. package/dist/src/mcp-tools/knowledge-tools.d.ts.map +1 -1
  88. package/dist/src/mcp-tools/knowledge-tools.js +105 -13
  89. package/dist/src/mcp-tools/knowledge-tools.js.map +1 -1
  90. package/dist/src/mcp-tools/memory-tools.d.ts +13 -0
  91. package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
  92. package/dist/src/mcp-tools/memory-tools.js +257 -31
  93. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  94. package/dist/src/mcp-tools/monograph/health-tools.d.ts.map +1 -1
  95. package/dist/src/mcp-tools/monograph/health-tools.js +99 -42
  96. package/dist/src/mcp-tools/monograph/health-tools.js.map +1 -1
  97. package/dist/src/mcp-tools/monograph/impact-tools.d.ts.map +1 -1
  98. package/dist/src/mcp-tools/monograph/impact-tools.js +123 -51
  99. package/dist/src/mcp-tools/monograph/impact-tools.js.map +1 -1
  100. package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -1
  101. package/dist/src/mcp-tools/monograph/query-tools.js +113 -96
  102. package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -1
  103. package/dist/src/mcp-tools/monograph/shared.d.ts +37 -4
  104. package/dist/src/mcp-tools/monograph/shared.d.ts.map +1 -1
  105. package/dist/src/mcp-tools/monograph/shared.js +75 -56
  106. package/dist/src/mcp-tools/monograph/shared.js.map +1 -1
  107. package/dist/src/memory/embedding-operations.d.ts.map +1 -1
  108. package/dist/src/memory/embedding-operations.js +9 -4
  109. package/dist/src/memory/embedding-operations.js.map +1 -1
  110. package/dist/src/memory/memory-bridge.d.ts +60 -1
  111. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  112. package/dist/src/memory/memory-bridge.js +185 -42
  113. package/dist/src/memory/memory-bridge.js.map +1 -1
  114. package/dist/src/memory/memory-kg.d.ts +495 -28
  115. package/dist/src/memory/memory-kg.d.ts.map +1 -1
  116. package/dist/src/memory/memory-kg.js +2186 -251
  117. package/dist/src/memory/memory-kg.js.map +1 -1
  118. package/dist/src/memory/query-router.d.ts +51 -0
  119. package/dist/src/memory/query-router.d.ts.map +1 -1
  120. package/dist/src/memory/query-router.js +38 -2
  121. package/dist/src/memory/query-router.js.map +1 -1
  122. package/dist/src/orgrt/agent-exec.d.ts +14 -0
  123. package/dist/src/orgrt/agent-exec.d.ts.map +1 -1
  124. package/dist/src/orgrt/agent-exec.js +88 -4
  125. package/dist/src/orgrt/agent-exec.js.map +1 -1
  126. package/dist/src/orgrt/agent-runner.d.ts +26 -1
  127. package/dist/src/orgrt/agent-runner.d.ts.map +1 -1
  128. package/dist/src/orgrt/agent-runner.js +73 -22
  129. package/dist/src/orgrt/agent-runner.js.map +1 -1
  130. package/dist/src/orgrt/antigravity-runner.d.ts +1 -1
  131. package/dist/src/orgrt/antigravity-runner.d.ts.map +1 -1
  132. package/dist/src/orgrt/antigravity-runner.js +36 -19
  133. package/dist/src/orgrt/antigravity-runner.js.map +1 -1
  134. package/dist/src/orgrt/approvals.d.ts +26 -2
  135. package/dist/src/orgrt/approvals.d.ts.map +1 -1
  136. package/dist/src/orgrt/approvals.js +67 -7
  137. package/dist/src/orgrt/approvals.js.map +1 -1
  138. package/dist/src/orgrt/broker.d.ts +21 -2
  139. package/dist/src/orgrt/broker.d.ts.map +1 -1
  140. package/dist/src/orgrt/broker.js +56 -8
  141. package/dist/src/orgrt/broker.js.map +1 -1
  142. package/dist/src/orgrt/bus.d.ts +8 -0
  143. package/dist/src/orgrt/bus.d.ts.map +1 -1
  144. package/dist/src/orgrt/bus.js +27 -0
  145. package/dist/src/orgrt/bus.js.map +1 -1
  146. package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -1
  147. package/dist/src/orgrt/checkpoint-ops.js +15 -5
  148. package/dist/src/orgrt/checkpoint-ops.js.map +1 -1
  149. package/dist/src/orgrt/checkpoint.d.ts +42 -4
  150. package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
  151. package/dist/src/orgrt/checkpoint.js +75 -4
  152. package/dist/src/orgrt/checkpoint.js.map +1 -1
  153. package/dist/src/orgrt/codex-runner.d.ts +1 -1
  154. package/dist/src/orgrt/codex-runner.d.ts.map +1 -1
  155. package/dist/src/orgrt/codex-runner.js +50 -23
  156. package/dist/src/orgrt/codex-runner.js.map +1 -1
  157. package/dist/src/orgrt/copilot-runner.d.ts +24 -2
  158. package/dist/src/orgrt/copilot-runner.d.ts.map +1 -1
  159. package/dist/src/orgrt/copilot-runner.js +257 -157
  160. package/dist/src/orgrt/copilot-runner.js.map +1 -1
  161. package/dist/src/orgrt/cross-org.d.ts +10 -3
  162. package/dist/src/orgrt/cross-org.d.ts.map +1 -1
  163. package/dist/src/orgrt/cross-org.js +225 -10
  164. package/dist/src/orgrt/cross-org.js.map +1 -1
  165. package/dist/src/orgrt/crush-runner.d.ts +22 -2
  166. package/dist/src/orgrt/crush-runner.d.ts.map +1 -1
  167. package/dist/src/orgrt/crush-runner.js +227 -120
  168. package/dist/src/orgrt/crush-runner.js.map +1 -1
  169. package/dist/src/orgrt/daemon.d.ts +77 -7
  170. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  171. package/dist/src/orgrt/daemon.js +989 -385
  172. package/dist/src/orgrt/daemon.js.map +1 -1
  173. package/dist/src/orgrt/decisions.d.ts +2 -2
  174. package/dist/src/orgrt/decisions.d.ts.map +1 -1
  175. package/dist/src/orgrt/decisions.js +90 -18
  176. package/dist/src/orgrt/decisions.js.map +1 -1
  177. package/dist/src/orgrt/grok-runner.d.ts +29 -3
  178. package/dist/src/orgrt/grok-runner.d.ts.map +1 -1
  179. package/dist/src/orgrt/grok-runner.js +286 -150
  180. package/dist/src/orgrt/grok-runner.js.map +1 -1
  181. package/dist/src/orgrt/kimicode-runner.d.ts +5 -5
  182. package/dist/src/orgrt/kimicode-runner.d.ts.map +1 -1
  183. package/dist/src/orgrt/kimicode-runner.js +53 -32
  184. package/dist/src/orgrt/kimicode-runner.js.map +1 -1
  185. package/dist/src/orgrt/mailbox.d.ts +15 -0
  186. package/dist/src/orgrt/mailbox.d.ts.map +1 -1
  187. package/dist/src/orgrt/mailbox.js +29 -1
  188. package/dist/src/orgrt/mailbox.js.map +1 -1
  189. package/dist/src/orgrt/migrate.d.ts.map +1 -1
  190. package/dist/src/orgrt/migrate.js +8 -5
  191. package/dist/src/orgrt/migrate.js.map +1 -1
  192. package/dist/src/orgrt/opencode-runner.d.ts +1 -1
  193. package/dist/src/orgrt/opencode-runner.d.ts.map +1 -1
  194. package/dist/src/orgrt/opencode-runner.js +29 -3
  195. package/dist/src/orgrt/opencode-runner.js.map +1 -1
  196. package/dist/src/orgrt/org-memory.d.ts +19 -3
  197. package/dist/src/orgrt/org-memory.d.ts.map +1 -1
  198. package/dist/src/orgrt/org-memory.js +110 -38
  199. package/dist/src/orgrt/org-memory.js.map +1 -1
  200. package/dist/src/orgrt/pi-rpc-runner.d.ts +3 -1
  201. package/dist/src/orgrt/pi-rpc-runner.d.ts.map +1 -1
  202. package/dist/src/orgrt/pi-rpc-runner.js +35 -3
  203. package/dist/src/orgrt/pi-rpc-runner.js.map +1 -1
  204. package/dist/src/orgrt/pi-runner.d.ts +25 -2
  205. package/dist/src/orgrt/pi-runner.d.ts.map +1 -1
  206. package/dist/src/orgrt/pi-runner.js +271 -152
  207. package/dist/src/orgrt/pi-runner.js.map +1 -1
  208. package/dist/src/orgrt/policy.d.ts +1 -0
  209. package/dist/src/orgrt/policy.d.ts.map +1 -1
  210. package/dist/src/orgrt/policy.js +199 -39
  211. package/dist/src/orgrt/policy.js.map +1 -1
  212. package/dist/src/orgrt/provider.d.ts +4 -0
  213. package/dist/src/orgrt/provider.d.ts.map +1 -1
  214. package/dist/src/orgrt/provider.js +16 -0
  215. package/dist/src/orgrt/provider.js.map +1 -1
  216. package/dist/src/orgrt/qwen-rpc-runner.d.ts +3 -1
  217. package/dist/src/orgrt/qwen-rpc-runner.d.ts.map +1 -1
  218. package/dist/src/orgrt/qwen-rpc-runner.js +35 -3
  219. package/dist/src/orgrt/qwen-rpc-runner.js.map +1 -1
  220. package/dist/src/orgrt/qwen-runner.d.ts +30 -3
  221. package/dist/src/orgrt/qwen-runner.d.ts.map +1 -1
  222. package/dist/src/orgrt/qwen-runner.js +282 -142
  223. package/dist/src/orgrt/qwen-runner.js.map +1 -1
  224. package/dist/src/orgrt/role-slot.d.ts +88 -0
  225. package/dist/src/orgrt/role-slot.d.ts.map +1 -0
  226. package/dist/src/orgrt/role-slot.js +133 -0
  227. package/dist/src/orgrt/role-slot.js.map +1 -0
  228. package/dist/src/orgrt/runtime-options.d.ts +17 -0
  229. package/dist/src/orgrt/runtime-options.d.ts.map +1 -0
  230. package/dist/src/orgrt/runtime-options.js +32 -0
  231. package/dist/src/orgrt/runtime-options.js.map +1 -0
  232. package/dist/src/orgrt/scheduler-integration.d.ts +11 -0
  233. package/dist/src/orgrt/scheduler-integration.d.ts.map +1 -1
  234. package/dist/src/orgrt/scheduler-integration.js +75 -17
  235. package/dist/src/orgrt/scheduler-integration.js.map +1 -1
  236. package/dist/src/orgrt/scheduler.d.ts +4 -0
  237. package/dist/src/orgrt/scheduler.d.ts.map +1 -1
  238. package/dist/src/orgrt/scheduler.js +7 -1
  239. package/dist/src/orgrt/scheduler.js.map +1 -1
  240. package/dist/src/orgrt/server.d.ts +8 -3
  241. package/dist/src/orgrt/server.d.ts.map +1 -1
  242. package/dist/src/orgrt/server.js +48 -13
  243. package/dist/src/orgrt/server.js.map +1 -1
  244. package/dist/src/orgrt/session.d.ts +26 -2
  245. package/dist/src/orgrt/session.d.ts.map +1 -1
  246. package/dist/src/orgrt/session.js +99 -5
  247. package/dist/src/orgrt/session.js.map +1 -1
  248. package/dist/src/orgrt/task-dag.d.ts +5 -0
  249. package/dist/src/orgrt/task-dag.d.ts.map +1 -1
  250. package/dist/src/orgrt/task-dag.js +41 -0
  251. package/dist/src/orgrt/task-dag.js.map +1 -1
  252. package/dist/src/orgrt/test-loop.js +2 -2
  253. package/dist/src/orgrt/test-loop.js.map +1 -1
  254. package/dist/src/orgrt/types.d.ts +14 -2
  255. package/dist/src/orgrt/types.d.ts.map +1 -1
  256. package/dist/src/orgrt/types.js +15 -1
  257. package/dist/src/orgrt/types.js.map +1 -1
  258. package/dist/src/orgrt/vercel-runner.d.ts.map +1 -1
  259. package/dist/src/orgrt/vercel-runner.js +4 -0
  260. package/dist/src/orgrt/vercel-runner.js.map +1 -1
  261. package/dist/src/ui/routes-org.mjs +27 -7
  262. package/dist/src/ui/server.mjs +82 -48
  263. package/dist/tsconfig.tsbuildinfo +1 -1
  264. package/package.json +2 -1
  265. package/dist/src/ui/data/mastermind-sessions.json +0 -1
@@ -40,6 +40,7 @@ If the spec covers multiple independent subsystems, it should have been broken i
40
40
 
41
41
  Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
42
42
 
43
+ - Check `brain_context` for relevant prior lessons or patterns for this domain/project — past task-granularity mistakes, file-organization conventions, known gotchas — and apply them to the decomposition below. Note when a decomposition choice is informed by recalled history.
43
44
  - Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
44
45
  - You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
45
46
  - Files that change together should live together. Split by responsibility, not by technical layer.
@@ -73,7 +74,7 @@ A task is the smallest unit that carries its own test cycle and is worth a fresh
73
74
  ```markdown
74
75
  # [Feature Name] Implementation Plan
75
76
 
76
- > **For agentic workers:** REQUIRED SUB-SKILL: Use `Skill("mastermind-taskdev")` (recommended) or `Skill("mastermind-execute")` to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
77
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use `Skill("mastermind-execute")` to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
77
78
 
78
79
  **Goal:** [One sentence describing what this builds]
79
80
 
@@ -196,234 +197,12 @@ Wait for the user's response. If they request changes, make them inline and re-r
196
197
 
197
198
  After the plan is approved (or in auto mode, after self-review):
198
199
 
199
- **In confirm mode (default):** Ask the user to choose execution mode:
200
+ **In confirm mode (default):** Ask the user to confirm execution:
200
201
 
201
- **"Plan complete and saved to `docs/mastermind/plans/<filename>.md`. Two execution options:**
202
+ **"Plan complete and saved to `docs/mastermind/plans/<filename>.md`. Execute it now with `mastermind-execute`?"**
202
203
 
203
- **1. Subagent-Driven (recommended)** — Invoke `Skill("mastermind-taskdev")`: dispatches a fresh subagent per task, reviews between tasks, fast iteration.
204
+ **In auto mode:** Skip the question — invoke `Skill("mastermind-execute")` immediately.
204
205
 
205
- **2. Inline Execution** — Invoke `Skill("mastermind-execute")`: batch execution with checkpoints.
206
-
207
- **Which approach?"**
208
-
209
- **In auto mode:** Skip the question. Default to subagent-driven — invoke `Skill("mastermind-taskdev")` immediately.
210
-
211
- **If Subagent-Driven chosen (or auto mode):**
212
- - Invoke `Skill("mastermind-taskdev")`
213
- - Fresh subagent per task + two-stage review
214
-
215
- **If Inline Execution chosen:**
216
- - Invoke `Skill("mastermind-execute")`
217
- - Batch execution with checkpoints for review
218
- # monomind:start skills:claude:mastermind-plan
219
- # Mastermind Plan
220
-
221
- ## Overview
222
-
223
- Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
224
-
225
- Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
226
-
227
- **Announce at start:** "I'm using the mastermind:plan skill to create the implementation plan."
228
-
229
- **Context:** If working in an isolated worktree, it should have been created via the git worktrees workflow at execution time.
230
-
231
- **Save plans to:** `docs/mastermind/plans/YYYY-MM-DD-<feature-name>.md`
232
- - (User preferences for plan location override this default)
233
-
234
- ---
235
-
236
- ## Inputs
237
-
238
- - `brain_context`: BRAIN CONTEXT block (loaded via mastermind-protocol/SKILL.md brain load)
239
- - `params`: spec text, feature description, or path to spec file
240
- - `mode`: auto | confirm
241
-
242
- ---
243
-
244
- ## Scope Check
245
-
246
- If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
247
-
248
- ---
249
-
250
- ## File Structure
251
-
252
- Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
253
-
254
- - Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
255
- - You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
256
- - Files that change together should live together. Split by responsibility, not by technical layer.
257
- - In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure — but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
258
-
259
- This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
260
-
261
- ---
262
-
263
- ## Task Right-Sizing
264
-
265
- A task is the smallest unit that carries its own test cycle and is worth a fresh reviewer's gate. When drawing task boundaries: fold setup, configuration, scaffolding, and documentation steps into the task whose deliverable needs them; split only where a reviewer could meaningfully reject one task while approving its neighbor. Each task ends with an independently testable deliverable.
266
-
267
- ---
268
-
269
- ## Bite-Sized Task Granularity
270
-
271
- **Each step is one action (2-5 minutes):**
272
- - "Write the failing test" — step
273
- - "Run it to make sure it fails" — step
274
- - "Implement the minimal code to make the test pass" — step
275
- - "Run the tests and make sure they pass" — step
276
- - "Commit" — step
277
-
278
- ---
279
-
280
- ## Plan Document Header
281
-
282
- **Every plan MUST start with this header:**
283
-
284
- ```markdown
285
- # [Feature Name] Implementation Plan
286
-
287
- > **For agentic workers:** REQUIRED SUB-SKILL: Use `Skill("mastermind-taskdev")` (recommended) or `Skill("mastermind-execute")` to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
288
-
289
- **Goal:** [One sentence describing what this builds]
290
-
291
- **Architecture:** [2-3 sentences about approach]
292
-
293
- **Tech Stack:** [Key technologies/libraries]
294
-
295
- ## Global Constraints
296
-
297
- [The spec's project-wide requirements — version floors, dependency limits,
298
- naming and copy rules, platform requirements — one line each, with exact
299
- values copied verbatim from the spec. Every task's requirements implicitly
300
- include this section.]
301
-
302
- ---
303
- ```
304
-
305
- ---
306
-
307
- ## Task Structure
308
-
309
- ````markdown
310
- ### Task N: [Component Name]
311
-
312
- **Files:**
313
- - Create: `exact/path/to/file.py`
314
- - Modify: `exact/path/to/existing.py:123-145`
315
- - Test: `tests/exact/path/to/test.py`
316
-
317
- **Interfaces:**
318
- - Consumes: [what this task uses from earlier tasks — exact signatures]
319
- - Produces: [what later tasks rely on — exact function names, parameter
320
- and return types. A task's implementer sees only their own task; this
321
- block is how they learn the names and types neighboring tasks use.]
322
-
323
- - [ ] **Step 1: Write the failing test**
324
-
325
- ```python
326
- def test_specific_behavior():
327
- result = function(input)
328
- assert result == expected
329
- ```
330
-
331
- - [ ] **Step 2: Run test to verify it fails**
332
-
333
- Run: `pytest tests/path/test.py::test_name -v`
334
- Expected: FAIL with "function not defined"
335
-
336
- - [ ] **Step 3: Write minimal implementation**
337
-
338
- ```python
339
- def function(input):
340
- return expected
341
- ```
342
-
343
- - [ ] **Step 4: Run test to verify it passes**
344
-
345
- Run: `pytest tests/path/test.py::test_name -v`
346
- Expected: PASS
347
-
348
- - [ ] **Step 5: Commit**
349
-
350
- ```bash
351
- git add tests/path/test.py src/path/file.py
352
- git commit -m "feat: add specific feature"
353
- ```
354
- ````
355
-
356
- ---
357
-
358
- ## No Placeholders
359
-
360
- Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
361
- - "TBD", "TODO", "implement later", "fill in details"
362
- - "Add appropriate error handling" / "add validation" / "handle edge cases"
363
- - "Write tests for the above" (without actual test code)
364
- - "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
365
- - Steps that describe what to do without showing how (code blocks required for code steps)
366
- - References to types, functions, or methods not defined in any task
367
-
368
- ---
369
-
370
- ## Remember
371
- - Exact file paths always
372
- - Complete code in every step — if a step changes code, show the code
373
- - Exact commands with expected output
374
- - DRY, YAGNI, TDD, frequent commits
375
-
376
- ---
377
-
378
- ## Self-Review
379
-
380
- After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
381
-
382
- **1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
383
-
384
- **2. Placeholder scan:** Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
385
-
386
- **3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
387
-
388
- If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
389
-
390
- ---
391
-
392
- ## User Review Gate
393
-
394
- After self-review:
395
-
396
- **In confirm mode (default):** Ask the user to review the written plan before proceeding:
397
-
398
- > "Plan written and saved to `docs/mastermind/plans/<filename>.md`. Please review it and let me know if you'd like any changes before we start execution."
399
-
400
- Wait for the user's response. If they request changes, make them inline and re-run the self-review. Only proceed once the user approves.
401
-
402
- **In auto mode:** Skip the wait. Proceed directly to execution handoff.
403
-
404
- ---
405
-
406
- ## Execution Handoff
407
-
408
- After the plan is approved (or in auto mode, after self-review):
409
-
410
- **In confirm mode (default):** Ask the user to choose execution mode:
411
-
412
- **"Plan complete and saved to `docs/mastermind/plans/<filename>.md`. Two execution options:**
413
-
414
- **1. Subagent-Driven (recommended)** — Invoke `Skill("mastermind-taskdev")`: dispatches a fresh subagent per task, reviews between tasks, fast iteration.
415
-
416
- **2. Inline Execution** — Invoke `Skill("mastermind-execute")`: batch execution with checkpoints.
417
-
418
- **Which approach?"**
419
-
420
- **In auto mode:** Skip the question. Default to subagent-driven — invoke `Skill("mastermind-taskdev")` immediately.
421
-
422
- **If Subagent-Driven chosen (or auto mode):**
423
- - Invoke `Skill("mastermind-taskdev")`
424
- - Fresh subagent per task + two-stage review
425
-
426
- **If Inline Execution chosen:**
206
+ **On execution:**
427
207
  - Invoke `Skill("mastermind-execute")`
428
- - Batch execution with checkpoints for review
429
- # monomind:end skills:claude:mastermind-plan
208
+ - It loads the plan, reviews it critically, and works task-by-task with checkpoints for review
@@ -70,15 +70,24 @@ Read the plan carefully and apply these rules:
70
70
 
71
71
  **Decomposition output:**
72
72
 
73
- For each issue extracted from the plan, produce:
74
- ```
75
- ISSUE: <title>
76
- assignee: <agent-id or UNASSIGNED>
77
- priority: low | medium | high | urgent
78
- blockedBy: <issue-title> (or none)
79
- description: <1-2 sentence summary of the deliverable>
73
+ For each issue extracted from the plan, emit one object into a JSON array and write the
74
+ whole array to `.monomind/orgs/<org_name>-plan-decomposition.json` using the Write tool:
75
+
76
+ ```json
77
+ [
78
+ {
79
+ "title": "Short imperative deliverable name",
80
+ "description": "1-2 sentence summary of the deliverable",
81
+ "assignee": "<agent-id from the org roster, or null if unassigned>",
82
+ "priority": "low | medium | high | urgent",
83
+ "blockedBy": ["<exact title of a blocking issue in this same array>"]
84
+ }
85
+ ]
80
86
  ```
81
87
 
88
+ Titles must be unique within the array — `blockedBy` is resolved by exact title match.
89
+ Use `[]` for `blockedBy` when an issue has no blockers.
90
+
82
91
  **Quality checklist before creating:**
83
92
  - [ ] Enough detail that assignees can act without re-asking
84
93
  - [ ] Every concrete deliverable is an issue
@@ -91,31 +100,130 @@ ISSUE: <title>
91
100
 
92
101
  ## Step 4 — Create Issues (unless dry_run=true)
93
102
 
103
+ Reads the decomposition written in Step 3, assigns collision-free ids, validates assignees
104
+ against the org roster, resolves `blockedBy` titles into `blockedByIssueIds`, and appends
105
+ to the issues file atomically. Fails loudly on any unresolved or ambiguous reference —
106
+ an unresolved blocker silently dropped is exactly what produces a `blocked` issue with an
107
+ empty `blockedByIssueIds`, which `mastermind-liveness` reports as stalled.
108
+
94
109
  ```bash
95
110
  issuesFile=".monomind/orgs/${org_name}-issues.json"
111
+ decompFile=".monomind/orgs/${org_name}-plan-decomposition.json"
96
112
  [ ! -f "$issuesFile" ] && echo '{"issues":[]}' > "$issuesFile"
113
+ [ ! -f "$decompFile" ] && { echo "ERROR: $decompFile not found — Step 3 must write it first."; exit 1; }
97
114
 
98
115
  ts=$(date -u +%Y-%m-%dT%H:%M:%SZ)
99
116
 
100
- # Issues are created from the decomposition above
101
- # Each issue gets:
102
- # id: issue-<timestamp>-<N>
103
- # title, description, priority, status: open
104
- # assigneeId (from matched agent)
105
- # projectId, workspaceId (if provided)
106
- # blockedByIssueIds (resolved after all issues are created)
107
- # createdAt, updatedAt
108
-
109
- echo ""
110
- if [ "${dry_run:-false}" = "true" ]; then
111
- echo "DRY RUN — no issues were created."
112
- echo "Remove --dry-run to create these issues."
113
- else
114
- echo "CREATED ISSUES:"
115
- # (issue creation happens inline above as each issue is decomposed)
116
- fi
117
+ python3 - "$issuesFile" "$decompFile" "$orgFile" "${project_id:-}" "${workspace_id:-}" "${dry_run:-false}" "$ts" <<'PYEOF'
118
+ import json, os, sys, time
119
+
120
+ issues_path, decomp_path, org_path, project_id, workspace_id, dry_run, ts = sys.argv[1:]
121
+ dry = dry_run == "true"
122
+
123
+ VALID_PRIORITY = {"low", "medium", "high", "urgent"}
124
+
125
+ decomp = json.load(open(decomp_path))
126
+ if not isinstance(decomp, list) or not decomp:
127
+ print("ERROR: decomposition must be a non-empty JSON array.")
128
+ sys.exit(1)
129
+
130
+ roster = {r.get("id") for r in json.load(open(org_path)).get("roles", [])}
131
+ data = json.load(open(issues_path))
132
+ issues = data.setdefault("issues", [])
133
+
134
+ # --- Validate before mutating anything ---
135
+ errors, titles = [], {}
136
+ for n, item in enumerate(decomp, 1):
137
+ title = (item.get("title") or "").strip()
138
+ if not title:
139
+ errors.append(f"item {n}: missing title")
140
+ continue
141
+ if title in titles:
142
+ errors.append(f"item {n}: duplicate title {title!r} — titles must be unique to resolve blockedBy")
143
+ titles[title] = None
144
+ pri = item.get("priority") or "medium"
145
+ if pri not in VALID_PRIORITY:
146
+ errors.append(f"{title!r}: priority {pri!r} must be one of {sorted(VALID_PRIORITY)}")
147
+ asgn = item.get("assignee")
148
+ if asgn and asgn not in roster:
149
+ errors.append(f"{title!r}: assignee {asgn!r} is not a role in this org (roster: {sorted(roster)})")
150
+
151
+ existing_by_title = {i.get("title"): i.get("id") for i in issues}
152
+ for item in decomp:
153
+ for b in item.get("blockedBy") or []:
154
+ if b not in titles and b not in existing_by_title:
155
+ errors.append(f"{item.get('title')!r}: blockedBy {b!r} matches no issue in this batch or in the existing file")
156
+
157
+ if errors:
158
+ print("ERROR: decomposition did not validate — no issues were created.")
159
+ for e in errors:
160
+ print(f" · {e}")
161
+ sys.exit(1)
162
+
163
+ # --- Assign ids (batch-stable, collision-free) ---
164
+ batch = int(time.time() * 1000)
165
+ for n, item in enumerate(decomp, 1):
166
+ titles[item["title"].strip()] = f"issue-{batch}-{n:03d}"
167
+
168
+ def resolve(t):
169
+ return titles.get(t) or existing_by_title[t]
170
+
171
+ created = []
172
+ for item in decomp:
173
+ title = item["title"].strip()
174
+ created.append({
175
+ "id": titles[title],
176
+ "title": title,
177
+ "description": item.get("description") or "",
178
+ "status": "todo",
179
+ "priority": item.get("priority") or "medium",
180
+ "assigneeId": item.get("assignee") or None,
181
+ "assigneeAgentId": item.get("assignee") or None,
182
+ "assigneeUserId": None,
183
+ "parentId": None,
184
+ "projectId": project_id or None,
185
+ "workspaceId": workspace_id or None,
186
+ "blockedByIssueIds": [resolve(b) for b in (item.get("blockedBy") or [])],
187
+ "createdAt": ts,
188
+ "updatedAt": ts,
189
+ })
190
+
191
+ if dry:
192
+ print("DRY RUN — no issues were created. Would create:")
193
+ for c in created:
194
+ blockers = ", ".join(c["blockedByIssueIds"]) or "none"
195
+ print(f" {c['id']} [{c['priority']:<6}] {c['title']}")
196
+ print(f" assignee: {c['assigneeId'] or 'UNASSIGNED'} blockedBy: {blockers}")
197
+ print(f"\n {len(created)} issue(s) would be created.")
198
+ sys.exit(0)
199
+
200
+ issues.extend(created)
201
+ tmp = issues_path + ".tmp"
202
+ with open(tmp, "w") as f:
203
+ json.dump(data, f, indent=2)
204
+ os.replace(tmp, issues_path)
205
+
206
+ print("CREATED ISSUES:")
207
+ for c in created:
208
+ blockers = ", ".join(c["blockedByIssueIds"]) or "none"
209
+ print(f" {c['id']} [{c['priority']:<6}] {c['title']}")
210
+ print(f" assignee: {c['assigneeId'] or 'UNASSIGNED'} blockedBy: {blockers}")
211
+ print(f"\n {len(created)} issue(s) created in {issues_path}")
212
+
213
+ roots = [c for c in created if not c["blockedByIssueIds"]]
214
+ print(f" {len(roots)} issue(s) are unblocked and can start in parallel.")
215
+ PYEOF
216
+
217
+ rm -f "$decompFile"
117
218
  ```
118
219
 
220
+ > **These issues are not auto-consumed by the org runtime.** `OrgDaemon` builds its `TaskDag`
221
+ > fresh in memory on every start and never reads `<org>-issues.json` (verified: zero references
222
+ > in `packages/@monomind/cli/src/orgrt/`). Issues created here are tracked by the
223
+ > `mastermind-issues` / `mastermind-my-issues` / `mastermind-liveness` skills and shown in the
224
+ > dashboard, but running `monomind org run <org>` will not pick them up. Drive execution from
225
+ > this file with `mastermind-execute`, or pass work explicitly via `org run --task`.
226
+
119
227
  ---
120
228
 
121
229
  ## Step 5 — Return Output
@@ -30,17 +30,19 @@ Execute at the START of every mastermind run (master or standalone domain comman
30
30
 
31
31
  **Step A — Tier 3 core principles (all domains):**
32
32
  Try `mcp__monomind__memory_hierarchical-recall` with query `"mastermind principles"`, topK 20.
33
- If it returns `"LanceDB bridge not available"` or any error, fall back to:
33
+ If it returns an error, fall back to:
34
34
  `mcp__monomind__memory_pattern-search` with query `"mastermind principles"`, namespace `"mastermind:principles"`, limit 20.
35
+ Record the entry ids of whichever call actually returned results — `results[].id` from `memory_hierarchical-recall`, or `patterns[].id` from the `memory_pattern-search` fallback — into a running list: `recalled_entry_ids`.
35
36
 
36
37
  **Step B — Tier 2 weekly summary for this domain:**
37
38
  Try `mcp__monomind__memory_context-synthesize` with query `[current prompt keywords]`, maxEntries 10.
38
39
  If it fails, fall back to:
39
40
  `mcp__monomind__memory_pattern-search` with query `[current prompt keywords]`, namespace `"mastermind:<domain>:weekly"`, limit 10.
41
+ `memory_context-synthesize` returns only a `context` string and a `sources` count — no entry ids — so it cannot add to `recalled_entry_ids`. Only the `memory_pattern-search` fallback contributes ids (`patterns[].id`); append them to `recalled_entry_ids` when that fallback runs.
40
42
 
41
43
  **Step C — Relevant graph nodes:**
42
44
  Call `mcp__monomind__monograph_query` with question `[3-5 keywords extracted from current prompt]`, depth 2.
43
- If the graph is not built yet (error: "No graph found"), skip this tier — continue without graph context.
45
+ If the graph is not built yet (error: "No graph found"), skip this tier — continue without graph context. Graph nodes are not memory entries and never contribute to `recalled_entry_ids`.
44
46
 
45
47
  Combine all results into a **BRAIN CONTEXT** block. Insert this block before any planning, decomposition, or agent spawning step. Format:
46
48
 
@@ -54,19 +56,30 @@ Combine all results into a **BRAIN CONTEXT** block. Insert this block before any
54
56
 
55
57
  If any MCP call fails or returns empty, continue without that tier — do not abort the run.
56
58
 
59
+ **Step D — Visible recall confirmation:**
60
+ Immediately after loading, print one short line as part of the calling skill's normal output — not buried inside the BRAIN CONTEXT block or an internal note the user never sees:
61
+ - If anything was recalled: `Remembered: <one-line gist of the single most relevant recalled item>`
62
+ - If every tier came back empty: `Nothing relevant recalled.`
63
+
64
+ Keep `recalled_entry_ids` in scope for the rest of the run — the Brain Write Procedure's feedback step below needs it. Memory tools are stateless between calls, so the calling skill (not the MCP server) is what carries this list forward.
65
+
57
66
  ---
58
67
 
59
68
  ## Brain Write Procedure
60
69
 
61
70
  Execute at the END of every mastermind run. Always runs even if execution was partial or blocked.
62
71
 
63
- **Step 1 — Score this run:**
64
- ```
65
- score = confidence × (1 / (days_since_run + 1)) × log(uses + 1)
66
- ```
67
- - `confidence`: average of all decision confidence values from the unified output schema
68
- - `days_since_run`: 0 (this is a fresh run)
69
- - `uses`: 1 (first write)
72
+ **Step 1 — Close the feedback loop on recalled memory:**
73
+ If `recalled_entry_ids` from the Brain Load Procedure is non-empty, call `mcp__monomind__memory_feedback`:
74
+ - `taskId`: the `run_id` used in this run's unified output schema (ISO8601 timestamp) — also the idempotency key, so a retried or duplicated call for the same run never double-applies the rating
75
+ - `entryIds`: `recalled_entry_ids`
76
+ - `quality`: average of `decisions[].confidence` (0.0-1.0) from this run's unified output schema; omit if `decisions` is empty
77
+ - `success`: `true` when `status: complete`, or `status: partial` with no `outcome: reverted` decisions and no user rejection/correction of the recalled guidance during the run; otherwise `false`
78
+ - `agent`: `<domain>` (this skill's domain)
79
+
80
+ This applies an EWMA update to `feedback_weight` on each recalled entry (idempotent per `taskId`) and appends a feedback-event record via the same tool call. If `recalled_entry_ids` is empty — e.g. Brain Load only got a hit from `memory_context-synthesize`, which returns no entry ids — skip this call; there is nothing to rate.
81
+
82
+ `score` referenced in Steps 2-3 below is this same value: the average of `decisions[].confidence` from this run's unified output schema. The old day/use decay factors were already constants on a fresh write (day 0, first use), so this is equivalent and simpler.
70
83
 
71
84
  **Step 2 — Append to Tier 1 raw log:**
72
85
  Try `mcp__monomind__memory_hierarchical-store` with:
@@ -74,7 +87,7 @@ Try `mcp__monomind__memory_hierarchical-store` with:
74
87
  - content: [full unified output schema YAML from this run, as a string]
75
88
  - metadata: `{ score, project, run_id, date: ISO8601, domain }`
76
89
 
77
- If LanceDB is unavailable, fall back to `mcp__monomind__memory_pattern-store`:
90
+ If hierarchical storage is unavailable, fall back to `mcp__monomind__memory_pattern-store`:
78
91
  - key: `mastermind:<domain>:run:<run_id>`
79
92
  - value: [JSON-encoded unified output schema]
80
93
  - namespace: `mastermind:<domain>:raw`
@@ -82,7 +95,7 @@ If LanceDB is unavailable, fall back to `mcp__monomind__memory_pattern-store`:
82
95
 
83
96
  **Step 3 — Check weekly compaction trigger:**
84
97
  Try `mcp__monomind__memory_health` on namespace `mastermind:<domain>:raw`.
85
- If unavailable, call `mcp__monomind__memory_stats` and check entry count manually.
98
+ If unavailable, call `mcp__monomind__memory_health` and check entry count manually.
86
99
  If `entry_count >= 20` OR `days_since_last_compaction >= 7`:
87
100
  1. Retrieve all Tier 1 entries since last compaction
88
101
  2. Produce a per-domain weekly summary (use LLM synthesis: "Summarize the key decisions, patterns, and lessons from these run logs in under 300 words")
@@ -94,7 +107,7 @@ Call `mcp__monomind__monograph_community` for nodes matching `mastermind:<domain
94
107
  If 3+ similar memory nodes are detected in a cluster:
95
108
  1. Merge into a single principle via LLM: "Distill these memories into one clear principle in 1-2 sentences"
96
109
  2. Store principle: `mcp__monomind__memory_hierarchical-store` namespace `mastermind:principles`
97
- 3. Add `EXCEPTION` edge in Monograph for any conflicting memory: `mcp__monomind__monograph_add_fact`
110
+ 3. Add `EXCEPTION` edge in Monograph for any conflicting memory: `mcp__monomind__memory_kg_ingest`
98
111
 
99
112
  ---
100
113
 
@@ -126,19 +139,17 @@ Empty fields use `[]`. The `status` field reflects the highest-level result: `co
126
139
 
127
140
  ---
128
141
 
129
- ## Memory Scoring Formula
142
+ ## Memory Feedback Loop
130
143
 
131
- ```
132
- score = confidence × (1 / (days_since_run + 1)) × log(uses + 1)
133
- ```
144
+ Recalled memories are rated for real via `mcp__monomind__memory_feedback` (Brain Write Procedure, Step 1) — not a locally-computed formula. `score` (used by Steps 2-3 for the newly-stored run entry) is the average of `decisions[].confidence` from the unified output schema.
134
145
 
135
- | Variable | Source |
146
+ | Concept | Mechanism |
136
147
  |---|---|
137
- | `confidence` | Average of `decisions[].confidence` from output schema |
138
- | `days_since_run` | 0 on day of run, increases 1 per calendar day |
139
- | `uses` | Incremented each time this memory is returned by brain load |
140
- | Archive threshold | score < 0.1 |
141
- | Reinforcement | Increment `uses` on every brain load hit |
148
+ | `feedback_weight` | Per-entry EWMA, updated by `memory_feedback`'s `quality`/`success` params, blended into future ranking (`bridgeApplyFeedback` in `memory-bridge.ts`) |
149
+ | `frequency_weight` | Incremented automatically on every recall hit, inside the `memory_hierarchical-recall` / `memory_pattern-search` handlers themselves — protects frequently-used entries from GC |
150
+ | Idempotency | `memory_feedback`'s `taskId` is the idempotency key — the same `run_id` never double-applies a rating |
151
+ | Archive threshold | score < 0.1 (Step 3 above) |
152
+ | GC protection | `bridgeConsolidate` never collects entries with `feedback_weight > 0.6` or `frequency_weight >= 3` |
142
153
 
143
154
  ---
144
155