@monoes/monomindcli 1.9.13 → 1.9.15
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.
- package/.claude/commands/mastermind/master.md +6 -0
- package/.claude/skills/mastermind/_protocol.md +34 -27
- package/.claude/skills/mastermind/idea.md +309 -76
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +11 -6
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +20 -2
- package/dist/src/init/executor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -108,6 +108,8 @@ Complexity threshold for manager agent: any of these is true:
|
|
|
108
108
|
- Has external dependencies (APIs, services)
|
|
109
109
|
- Is estimated to take more than one conversation turn
|
|
110
110
|
|
|
111
|
+
**DOMAIN EXCEPTION — `idea`:** The `idea` domain MUST always be handled by the master invoking `Skill("mastermind:idea")` directly — NEVER by spawning a Task agent. Spawned agents do not have Skill tool access, so delegating `idea` to a Task agent silently degrades to raw analysis with no pipeline execution. After `mastermind:idea` returns, treat its output as the `idea` domain's unified output schema and proceed to the next domain.
|
|
112
|
+
|
|
111
113
|
**Per-domain goal extraction:** For each activated domain, extract a one-sentence goal from the prompt describing what that domain must accomplish. Then **run the following Bash block**, substituting `<domain_goals_json>` with a JSON object mapping each domain name to its one-sentence goal (use the full `resolved_prompt` as the value for any domain where no specific goal is extractable):
|
|
112
114
|
|
|
113
115
|
```bash
|
|
@@ -251,8 +253,12 @@ jq --arg domains "$domains_needed" \
|
|
|
251
253
|
|
|
252
254
|
### Step 7 — Spawn Domain Managers
|
|
253
255
|
|
|
256
|
+
**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.
|
|
257
|
+
|
|
254
258
|
**Before spawning**, select the best domain manager agent type from the registry for each active domain. Do not hardcode `coordinator` — pick the agent whose expertise best fits the domain goal.
|
|
255
259
|
|
|
260
|
+
**BASH TOOL REQUIREMENT:** Domain managers must run `monotask` CLI commands. Only use subagent_types that include Bash in their tool list. If the registry returns an agent without Bash (e.g. `Product Manager`, `Backend Architect`), override it with `general-purpose` (which has all tools). Agents without Bash cannot create cards, emit curl events, or write session files — they will silently produce degraded output.
|
|
261
|
+
|
|
256
262
|
**Phase A — Registry selection** (run as one Bash call; must complete before Phase C):
|
|
257
263
|
|
|
258
264
|
```bash
|
|
@@ -15,18 +15,18 @@ This file is a reference loaded by mastermind domain skills and master. It is NE
|
|
|
15
15
|
Execute at the START of every mastermind run (master or standalone domain command). Load in this order:
|
|
16
16
|
|
|
17
17
|
**Step A — Tier 3 core principles (all domains):**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
Try `mcp__monobrain__agentdb_hierarchical-recall` with query `"mastermind principles"`, topK 20.
|
|
19
|
+
If it returns `"AgentDB bridge not available"` or any error, fall back to:
|
|
20
|
+
`mcp__monobrain__memory_search` with query `"mastermind principles"`, namespace `"mastermind:principles"`, limit 20.
|
|
21
21
|
|
|
22
22
|
**Step B — Tier 2 weekly summary for this domain:**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
Try `mcp__monobrain__agentdb_context-synthesize` with query `[current prompt keywords]`, maxEntries 10.
|
|
24
|
+
If it fails, fall back to:
|
|
25
|
+
`mcp__monobrain__memory_search` with query `[current prompt keywords]`, namespace `"mastermind:<domain>:weekly"`, limit 10.
|
|
26
26
|
|
|
27
27
|
**Step C — Relevant graph nodes:**
|
|
28
|
-
Call `
|
|
29
|
-
|
|
28
|
+
Call `mcp__monobrain__graphify_query` with question `[3-5 keywords extracted from current prompt]`, depth 2.
|
|
29
|
+
If the graph is not built yet (error: "No graph found"), skip this tier — continue without graph context.
|
|
30
30
|
|
|
31
31
|
Combine all results into a **BRAIN CONTEXT** block. Insert this block before any planning, decomposition, or agent spawning step. Format:
|
|
32
32
|
|
|
@@ -55,13 +55,20 @@ score = confidence × (1 / (days_since_run + 1)) × log(uses + 1)
|
|
|
55
55
|
- `uses`: 1 (first write)
|
|
56
56
|
|
|
57
57
|
**Step 2 — Append to Tier 1 raw log:**
|
|
58
|
-
|
|
58
|
+
Try `mcp__monobrain__agentdb_hierarchical-store` with:
|
|
59
59
|
- namespace: `mastermind:<domain>:raw`
|
|
60
60
|
- content: [full unified output schema YAML from this run, as a string]
|
|
61
61
|
- metadata: `{ score, project, run_id, date: ISO8601, domain }`
|
|
62
62
|
|
|
63
|
+
If AgentDB is unavailable, fall back to `mcp__monobrain__memory_store`:
|
|
64
|
+
- key: `mastermind:<domain>:run:<run_id>`
|
|
65
|
+
- value: [JSON-encoded unified output schema]
|
|
66
|
+
- namespace: `mastermind:<domain>:raw`
|
|
67
|
+
- tags: `["mastermind", "<domain>", "run"]`
|
|
68
|
+
|
|
63
69
|
**Step 3 — Check weekly compaction trigger:**
|
|
64
|
-
|
|
70
|
+
Try `mcp__monobrain__agentdb_health` on namespace `mastermind:<domain>:raw`.
|
|
71
|
+
If unavailable, call `mcp__monobrain__memory_stats` and check entry count manually.
|
|
65
72
|
If `entry_count >= 20` OR `days_since_last_compaction >= 7`:
|
|
66
73
|
1. Retrieve all Tier 1 entries since last compaction
|
|
67
74
|
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")
|
|
@@ -201,25 +208,25 @@ Every mastermind run MUST emit structured events to the live dashboard via WebFe
|
|
|
201
208
|
}
|
|
202
209
|
```
|
|
203
210
|
|
|
204
|
-
### How to Emit (WebFetch
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
session:
|
|
214
|
-
prompt
|
|
215
|
-
mode
|
|
216
|
-
|
|
217
|
-
ts:
|
|
218
|
-
})
|
|
219
|
-
})
|
|
211
|
+
### How to Emit (curl-first — WebFetch is blocked for localhost in Claude Code runtimes)
|
|
212
|
+
|
|
213
|
+
**Always use curl via Bash.** WebFetch is restricted for `localhost` URLs in Claude Code agent runtimes and will return ECONNREFUSED even when the server is running. Use this pattern:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
curl -s -o /dev/null -X POST "http://localhost:4242/api/mastermind/event" \
|
|
217
|
+
-H "Content-Type: application/json" \
|
|
218
|
+
-d "$(jq -cn \
|
|
219
|
+
--arg sid "$SESSION_ID" \
|
|
220
|
+
--arg type "session:start" \
|
|
221
|
+
--arg prompt "$resolved_prompt" \
|
|
222
|
+
--arg mode "$mode" \
|
|
223
|
+
--arg proj "$(pwd)" \
|
|
224
|
+
'{type:$type,session:$sid,prompt:$prompt,mode:$mode,project:$proj,ts:(now*1000|floor)}')" || true
|
|
220
225
|
```
|
|
221
226
|
|
|
222
|
-
**
|
|
227
|
+
**Always append `|| true`** — event emission is non-blocking and MUST NOT abort the run.
|
|
228
|
+
|
|
229
|
+
**If Bash is unavailable** (e.g. the agent type has no Bash tool): skip dashboard events entirely. They are observability-only and do not affect pipeline correctness. The master context always has Bash and emits session:start, domain:dispatch, and session:complete on behalf of the run.
|
|
223
230
|
|
|
224
231
|
**Session ID:** Generate once at session:start and reuse across all subsequent events for this run. A simple ID format: `mm-<ISO8601-compact>` (e.g. `mm-20260505T142300`).
|
|
225
232
|
|