@monoes/monomindcli 1.6.8 → 1.6.9

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.
@@ -87,10 +87,18 @@ Spawn 3-5 `researcher` agents in parallel using the Agent tool (mesh topology).
87
87
  - The user's prompt: `$ARGUMENTS`
88
88
  - The `PROJECT_CONTEXT` string from Step 1
89
89
 
90
- Each agent should generate ideas as a JSON array. There is no hard cap -- generate as many or as few as the topic warrants:
90
+ Each agent should generate ideas as a JSON array. There is no hard cap generate as many or as few as the topic warrants. Ideas should span **two categories**:
91
+
92
+ 1. **Feature/capability ideas** — what to build, what problem it solves, why it matters.
93
+ 2. **Technical stack & baseline decisions** — foundational choices that must be made before implementation (e.g., "Use PostgreSQL vs SQLite for persistence", "Adopt event-driven architecture vs request-response", "Choose WebSocket vs SSE for real-time updates", "Define the API versioning strategy"). These are the "how" decisions that shape everything downstream.
94
+
91
95
  ```json
92
96
  [
93
- { "title": "Short idea title", "description": "2-3 sentence description of the idea, what it solves, and why it matters." }
97
+ {
98
+ "title": "Short idea title",
99
+ "description": "2-3 sentence description of the idea, what it solves, and why it matters.",
100
+ "category": "feature | technical-baseline"
101
+ }
94
102
  ]
95
103
  ```
96
104
 
@@ -101,6 +109,8 @@ After all agents complete:
101
109
  ```bash
102
110
  monotask card create $BOARD_ID $COL_NEW "<title>" --json
103
111
  monotask card comment add $BOARD_ID $CARD_ID "<description>"
112
+ monotask card tag add $BOARD_ID $CARD_ID "monomind-idea"
113
+ monotask card tag add $BOARD_ID $CARD_ID "<category>"
104
114
  ```
105
115
 
106
116
  If zero ideas were generated after deduplication, report "No ideas generated by the research swarm." and STOP.
@@ -249,6 +259,7 @@ For each elaborated idea, the agent must:
249
259
  2. **Create each subtask** as a card in `Backlog` (has deps) or `Todo` (no deps):
250
260
  ```bash
251
261
  monotask card create $TASK_BOARD_ID $COLUMN_ID "<title>" --json
262
+ monotask card tag add $TASK_BOARD_ID $CARD_ID "monomind-idea"
252
263
  ```
253
264
 
254
265
  3. **Set description** with full context block:
@@ -303,11 +314,11 @@ For each elaborated idea, the agent must:
303
314
  Output a summary table:
304
315
 
305
316
  ```
306
- | # | Idea | Status | Subtasks | Total Effort | Agents |
307
- |---|-----------------------------|----------|----------|--------------|--------|
308
- | 1 | <title> | Tasked | 4 | 18/40 | coder, backend-dev, tester |
309
- | 2 | <title> | Iced | -- | -- | -- |
310
- | 3 | <title> | Rejected | -- | -- | -- |
317
+ | # | Idea | Category | Status | Subtasks | Total Effort | Agents |
318
+ |---|-----------------------------|--------------------|----- ----|----------|--------------|--------|
319
+ | 1 | <title> | feature | Tasked | 4 | 18/40 | coder, backend-dev, tester |
320
+ | 2 | <title> | technical-baseline | Iced | -- | -- | -- |
321
+ | 3 | <title> | feature | Rejected | -- | -- | -- |
311
322
  ```
312
323
 
313
324
  Then output:
@@ -0,0 +1,424 @@
1
+ ---
2
+ name: monomind-improve
3
+ description: "Monomind — Deeply analyze a project component, research improvements online, and create improvement tasks on monotask boards"
4
+ ---
5
+
6
+ If `$ARGUMENTS` is empty, output this and STOP:
7
+
8
+ > **Usage:** `/monomind:improve <component or concept>`
9
+ >
10
+ > Examples:
11
+ > - `/monomind:improve the authentication flow`
12
+ > - `/monomind:improve error handling across the codebase`
13
+ > - `/monomind:improve CLI startup performance`
14
+ > - `/monomind:improve the MCP server architecture`
15
+ >
16
+ > This command deeply analyzes the target component inside your project, researches improvement directions online, evaluates them, and decomposes the best ones into professional tasks on monotask boards. All cards are tagged `monomind-improve`.
17
+
18
+ Do NOT proceed further if no arguments were provided.
19
+
20
+ ---
21
+
22
+ ## Step 0: Check monotask CLI
23
+
24
+ Run:
25
+ ```bash
26
+ command -v monotask
27
+ ```
28
+
29
+ If `monotask` is NOT found, attempt to install:
30
+ ```bash
31
+ command -v cargo && cargo install monotask
32
+ ```
33
+
34
+ If `cargo` is also missing, output this and STOP:
35
+ > monotask requires Rust. Install Rust first:
36
+ > ```bash
37
+ > curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
38
+ > source "$HOME/.cargo/env"
39
+ > cargo install monotask
40
+ > ```
41
+
42
+ Verify monotask is now available before continuing.
43
+
44
+ ---
45
+
46
+ ## Step 1: Gather Project Context
47
+
48
+ Collect ALL of the following in parallel (skip any that error):
49
+
50
+ 1. **Repo name**: Run `git remote get-url origin`, extract the last path segment, strip `.git`. Fallback: `basename` of the current working directory. Store as `REPO_NAME`.
51
+
52
+ 2. **README**: Read `README.md` (first 200 lines). Skip if missing.
53
+
54
+ 3. **Package manifest**: Read whichever exists first: `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`. Extract name, description, and keywords/tags.
55
+
56
+ 4. **Knowledge graph**: Call `mcp__monomind__graphify_suggest` with the user's prompt (`$ARGUMENTS`). Skip if it errors or returns empty.
57
+
58
+ 5. **Memory search**: Call `mcp__monomind__memory_search` with the user's prompt (`$ARGUMENTS`). Use the top 5 results.
59
+
60
+ Bundle all gathered information into a single `PROJECT_CONTEXT` string for downstream agents.
61
+
62
+ ---
63
+
64
+ ## Step 2: Deep Component Analysis
65
+
66
+ This is what differentiates `/monomind:improve` from `/monomind:idea`. Before generating improvement ideas, we must deeply understand the current state of the target component.
67
+
68
+ Spawn 2 agents in parallel via the Agent tool:
69
+
70
+ ### Agent 1: `feature-dev:code-explorer`
71
+
72
+ Provide it with `$ARGUMENTS` and `PROJECT_CONTEXT`. It must:
73
+
74
+ 1. **Trace the component** — find all files, functions, classes, and modules related to the target. Use `mcp__monomind__graphify_query` for each key term found.
75
+ 2. **Map dependencies** — what does the component depend on? What depends on it? Use `mcp__monomind__graphify_shortest_path` for key relationships.
76
+ 3. **Identify pain points** — look for:
77
+ - Code smells (large files, deep nesting, god objects, duplicated logic)
78
+ - Missing tests or low coverage areas
79
+ - Performance bottlenecks (synchronous I/O, N+1 patterns, unnecessary allocations)
80
+ - Security gaps (unvalidated inputs, missing auth checks, exposed secrets)
81
+ - API inconsistencies (naming, error shapes, response formats)
82
+ - Outdated patterns (callbacks vs async/await, old library versions)
83
+ - Missing error handling or silent failures
84
+ 4. **Measure complexity** — count files, lines, dependencies, and circular references.
85
+
86
+ Return a structured analysis:
87
+ ```json
88
+ {
89
+ "component": "name",
90
+ "files": ["list of files touched"],
91
+ "total_lines": N,
92
+ "dependency_count": N,
93
+ "pain_points": [
94
+ { "type": "code-smell|perf|security|api|testing|pattern", "description": "...", "file": "path", "severity": "critical|high|medium|low" }
95
+ ],
96
+ "strengths": ["things that are already well done"],
97
+ "architecture_notes": "how it fits into the larger system"
98
+ }
99
+ ```
100
+
101
+ ### Agent 2: `researcher` (with WebSearch)
102
+
103
+ Provide it with `$ARGUMENTS` and `PROJECT_CONTEXT`. It must:
104
+
105
+ 1. **Search for best practices** related to the component's domain (e.g., "authentication best practices 2025", "CLI performance optimization techniques").
106
+ 2. **Find competitor/prior art** — how do similar tools/libraries solve this?
107
+ 3. **Search for common improvements** — what do blog posts, conference talks, and docs recommend?
108
+ 4. **Identify emerging patterns** — new libraries, frameworks, or techniques relevant to this area.
109
+
110
+ Return structured research:
111
+ ```json
112
+ {
113
+ "best_practices": [
114
+ { "title": "...", "description": "...", "source": "url or reference" }
115
+ ],
116
+ "prior_art": [
117
+ { "project": "name", "approach": "how they solve it", "takeaway": "what we can learn" }
118
+ ],
119
+ "emerging_patterns": [
120
+ { "pattern": "name", "description": "...", "relevance": "why it matters for us" }
121
+ ]
122
+ }
123
+ ```
124
+
125
+ After both agents complete, merge their outputs into `COMPONENT_ANALYSIS`.
126
+
127
+ ---
128
+
129
+ ## Step 3: Setup Monotask Space and Improve Board
130
+
131
+ ### Space
132
+ - Run `monotask space list` and check if a space named `$REPO_NAME` already exists.
133
+ - If not, create it: `monotask space create "$REPO_NAME"`.
134
+ - Store the `SPACE_ID`.
135
+
136
+ ### Improve Board
137
+ - List boards via `monotask board list --json`. For each board ID, run `monotask column list <BOARD_ID> --json` to find one whose title is `monomind-improve`. (There is no "board view" command -- column list reveals the board structure.)
138
+ - If the `monomind-improve` board does not exist:
139
+ 1. Create it: `monotask board create "monomind-improve" --json` — store the returned `BOARD_ID`.
140
+ 2. Add it to the space: `monotask space boards add $SPACE_ID $BOARD_ID`.
141
+ 3. Create these columns in order:
142
+ - `Discovered`
143
+ - `Evaluated`
144
+ - `Approved`
145
+ - `Tasked`
146
+ - `Deferred`
147
+ - `Rejected`
148
+ - Store all column IDs mapped by name.
149
+
150
+ ---
151
+
152
+ ## Step 4: Generate Improvement Ideas
153
+
154
+ Spawn a single `Software Architect` agent via the Agent tool. Provide it with:
155
+ - The user's prompt: `$ARGUMENTS`
156
+ - The full `COMPONENT_ANALYSIS` from Step 2
157
+ - The `PROJECT_CONTEXT` from Step 1
158
+
159
+ The agent must synthesize the code analysis and online research into concrete improvement ideas. For each idea, produce:
160
+
161
+ ```json
162
+ {
163
+ "title": "Short, action-oriented title",
164
+ "description": "2-3 sentences: what the improvement is, what problem it solves, and the expected benefit.",
165
+ "category": "performance | security | reliability | maintainability | dx | testing | architecture",
166
+ "evidence": "What from the analysis or research supports this (pain point ref, best practice ref, or prior art ref)",
167
+ "estimated_impact": "Concrete expected outcome (e.g., '50% faster CLI startup', 'eliminate 3 code smells', 'cover 5 untested edge cases')"
168
+ }
169
+ ```
170
+
171
+ **Idea generation rules:**
172
+ - Ideas must be grounded in the analysis — no generic "add more tests" without pointing to specific gaps
173
+ - Each idea must reference either a pain point from the code analysis or a best practice from the research
174
+ - Prefer high-impact, low-effort ideas first
175
+ - Include at least one idea from each applicable category (perf, security, testing, etc.)
176
+ - No duplicates — each idea must address a distinct improvement
177
+
178
+ For each idea, create a card in the `Discovered` column:
179
+ ```bash
180
+ monotask card create $BOARD_ID $COL_DISCOVERED "<title>" --json
181
+ monotask card comment add $BOARD_ID $CARD_ID "<description>"
182
+ monotask card comment add $BOARD_ID $CARD_ID "Category: <category>\nEvidence: <evidence>\nExpected impact: <estimated_impact>"
183
+ monotask card tag add $BOARD_ID $CARD_ID "monomind-improve"
184
+ ```
185
+
186
+ If zero ideas were generated, report "No improvement opportunities found for this component." and STOP.
187
+
188
+ ---
189
+
190
+ ## Step 5: Evaluate and Prioritize
191
+
192
+ Spawn a single `Product Manager` agent via the Agent tool. Provide it with:
193
+ - All improvement ideas (titles, descriptions, and all comments)
194
+ - The `COMPONENT_ANALYSIS`
195
+ - The `PROJECT_CONTEXT`
196
+
197
+ For EACH idea, the agent must return one of three verdicts, along with **impact** (0-10) and **effort** (0-10) scores:
198
+
199
+ | Verdict | Criteria |
200
+ |---------|----------|
201
+ | **approved** | High value, feasible, aligns with project direction. Include a `skipElaboration` boolean: `true` if straightforward, `false` if needs deeper investigation. |
202
+ | **deferred** | Good idea but wrong timing, blocked by something, or needs more research. Include the reason. |
203
+ | **rejected** | Low value, too risky, or out of scope. Include a 1-sentence reason. |
204
+
205
+ For each verdict, update the monotask board:
206
+
207
+ - **approved**: Move to `Evaluated`. Set impact and effort. Add value statement.
208
+ ```bash
209
+ monotask card move $BOARD_ID $CARD_ID $COL_EVALUATED --json
210
+ monotask card set-impact $BOARD_ID $CARD_ID <0-10>
211
+ monotask card set-effort $BOARD_ID $CARD_ID <0-10>
212
+ monotask card comment add $BOARD_ID $CARD_ID "Value: <value statement>"
213
+ ```
214
+ - **deferred**: Move to `Deferred`. Set impact and effort. Add reason.
215
+ ```bash
216
+ monotask card move $BOARD_ID $CARD_ID $COL_DEFERRED --json
217
+ monotask card set-impact $BOARD_ID $CARD_ID <0-10>
218
+ monotask card set-effort $BOARD_ID $CARD_ID <0-10>
219
+ monotask card comment add $BOARD_ID $CARD_ID "Deferred: <reason>"
220
+ ```
221
+ - **rejected**: Move to `Rejected`. Add reason.
222
+ ```bash
223
+ monotask card move $BOARD_ID $CARD_ID $COL_REJECTED --json
224
+ monotask card comment add $BOARD_ID $CARD_ID "Rejected: <reason>"
225
+ ```
226
+
227
+ If ALL ideas were deferred or rejected, output a summary table and STOP.
228
+
229
+ ---
230
+
231
+ ## Step 6: Elaborate Approved Improvements
232
+
233
+ Check if ANY approved ideas have `skipElaboration: false`.
234
+
235
+ **If ALL approved ideas have `skipElaboration: true`:**
236
+ - Move each directly from `Evaluated` to `Approved`:
237
+ ```bash
238
+ monotask card move $BOARD_ID $CARD_ID $COL_APPROVED --json
239
+ ```
240
+ - Skip spawning agents.
241
+
242
+ **Otherwise**, spawn two agents in parallel via the Agent tool:
243
+
244
+ 1. A `feature-dev:code-explorer` agent — traces implementation paths, identifies exactly which files/functions need to change, surfaces hidden constraints and breaking changes.
245
+ 2. A `researcher` agent (with WebSearch) — searches for implementation patterns, migration guides, and gotchas specific to each improvement.
246
+
247
+ After both complete, for each idea needing elaboration:
248
+ 1. Add findings as comments:
249
+ ```bash
250
+ monotask card comment add $BOARD_ID $CARD_ID "Implementation path: <files and functions to change>"
251
+ monotask card comment add $BOARD_ID $CARD_ID "Risks: <breaking changes, migration needs>"
252
+ monotask card comment add $BOARD_ID $CARD_ID "Research: <patterns and references found>"
253
+ ```
254
+ 2. If no blocking issues, move to `Approved`:
255
+ ```bash
256
+ monotask card move $BOARD_ID $CARD_ID $COL_APPROVED --json
257
+ ```
258
+ 3. If a blocking issue IS found, move to `Deferred`:
259
+ ```bash
260
+ monotask card move $BOARD_ID $CARD_ID $COL_DEFERRED --json
261
+ monotask card comment add $BOARD_ID $CARD_ID "Blocked: <issue>"
262
+ ```
263
+
264
+ Also move any `skipElaboration: true` ideas directly to `Approved`.
265
+
266
+ ---
267
+
268
+ ## Step 7: Task Decomposer — Break Improvements into Subtasks
269
+
270
+ ### Task Board Setup
271
+ - Check if a `monomind-task` board exists in the space (same lookup method as Step 3).
272
+ - If not, create it with these columns:
273
+ - `Backlog`
274
+ - `Todo`
275
+ - `In Progress`
276
+ - `Review`
277
+ - `Human in Loop`
278
+ - `Done`
279
+ - Store column IDs.
280
+
281
+ ### Decomposition into Professional Task Cards
282
+
283
+ Spawn a single `Software Architect` agent via the Agent tool. Provide it with:
284
+ - All ideas in the `Approved` column (titles, descriptions, and all comments including implementation paths and research)
285
+ - The `COMPONENT_ANALYSIS` from Step 2
286
+ - The `PROJECT_CONTEXT`
287
+
288
+ For each approved improvement, the agent must:
289
+
290
+ 1. **Analyze and decompose** into 2-6 subtasks. Each subtask must be a professional task card:
291
+
292
+ ```json
293
+ {
294
+ "title": "Action-oriented title (verb + noun + context)",
295
+ "description": "## What\nExact deliverable (new file, modified function, endpoint, etc.).\n\n## Why\nBusiness or technical motivation — what breaks without this?\n\n## Where\nFile paths, module boundaries, related components.\n\n## Patterns\nExisting conventions to follow (naming, error handling, test style).",
296
+ "definition_of_done": [
297
+ "Specific, binary, verifiable condition (include HTTP codes, error shapes, edge cases)",
298
+ "Quantified thresholds where applicable (rate limits, timeouts, sizes)"
299
+ ],
300
+ "testing_criteria": {
301
+ "unit_tests": ["function(input) → expected outcome"],
302
+ "integration_tests": ["endpoint + method → status + response shape"],
303
+ "edge_cases": ["boundary condition → expected behavior"]
304
+ },
305
+ "checklist": [
306
+ "Write failing test for [specific behavior]",
307
+ "Implement [function/class] in [file path]",
308
+ "Run tests — verify green",
309
+ "Commit: '[type]: [description]'"
310
+ ],
311
+ "agent_type": "best-fit agent from 230+ roster",
312
+ "priority": "critical | high | medium | low",
313
+ "effort": "1-10 (1=trivial, 10=full day)",
314
+ "dependencies": ["titles of prerequisite tasks, or empty"]
315
+ }
316
+ ```
317
+
318
+ **Task generation rules:**
319
+ - Tasks MUST be ordered so dependencies come first
320
+ - Each task: 5-30 minutes for a single agent
321
+ - Split anything larger
322
+ - Every task starts with writing a test (TDD)
323
+ - DOD items must be binary (pass/fail, not "looks good")
324
+ - Testing criteria must name specific functions, endpoints, inputs
325
+
326
+ 2. **Create each subtask** as a card in `Backlog` (has deps) or `Todo` (no deps):
327
+ ```bash
328
+ monotask card create $TASK_BOARD_ID $COLUMN_ID "<title>" --json
329
+ monotask card tag add $TASK_BOARD_ID $CARD_ID "monomind-improve"
330
+ ```
331
+
332
+ 3. **Set description** with full context block:
333
+ ```bash
334
+ monotask card set-description $TASK_BOARD_ID $CARD_ID "<description with What/Why/Where/Patterns>"
335
+ ```
336
+
337
+ 4. **Add DOD comment**:
338
+ ```bash
339
+ monotask card comment add $TASK_BOARD_ID $CARD_ID "## Definition of Done\n- [ ] <condition 1>\n- [ ] <condition 2>\n..."
340
+ ```
341
+
342
+ 5. **Add testing criteria comment**:
343
+ ```bash
344
+ monotask card comment add $TASK_BOARD_ID $CARD_ID "## Testing Criteria\n\n### Unit Tests\n- <test 1>\n\n### Integration Tests\n- <test 1>\n\n### Edge Cases\n- <case 1>"
345
+ ```
346
+
347
+ 6. **Add agent assignment + metadata**:
348
+ ```bash
349
+ monotask card comment add $TASK_BOARD_ID $CARD_ID "Assigned agent: <agent_type>\nPriority: <priority>\nEffort: <effort>/10\nDependencies: <dep titles or none>\nSource: monomind-improve"
350
+ ```
351
+
352
+ 7. **Set priority**: `monotask card set-priority $TASK_BOARD_ID $CARD_ID <1-4>`
353
+
354
+ 8. **Create checklist** (TDD implementation steps):
355
+ ```bash
356
+ monotask checklist add $TASK_BOARD_ID $CARD_ID "Implementation Steps" --json
357
+ ```
358
+ Then for each step:
359
+ ```bash
360
+ monotask checklist item-add $TASK_BOARD_ID $CARD_ID $CHECKLIST_ID "<step>"
361
+ ```
362
+
363
+ 9. **Comment on original improvement card** listing all subtask titles:
364
+ ```bash
365
+ monotask card comment add $BOARD_ID $IMPROVE_CARD_ID "Subtasks created:\n- <title> (agent: <type>, effort: <N>/10)\n- <title> (agent: <type>, effort: <N>/10)\n..."
366
+ ```
367
+
368
+ 10. **Move the improvement card** to `Tasked`:
369
+ ```bash
370
+ monotask card move $BOARD_ID $IMPROVE_CARD_ID $COL_TASKED --json
371
+ ```
372
+
373
+ **If the architect has doubts** about decomposing an improvement (unclear scope, missing info):
374
+ - Add a comment with the question
375
+ - Move the improvement to `Deferred` instead of `Tasked`
376
+
377
+ ---
378
+
379
+ ## Step 8: Final Summary
380
+
381
+ Output a component health report:
382
+
383
+ ```
384
+ ## Improvement Analysis: <component>
385
+
386
+ ### Component Health
387
+ - Files analyzed: N
388
+ - Pain points found: N (X critical, Y high, Z medium)
389
+ - Strengths identified: N
390
+
391
+ ### Improvement Pipeline
392
+ | # | Improvement | Category | Status | Impact | Effort | Subtasks |
393
+ |---|-----------------------------|----------------|----------|--------|--------|----------|
394
+ | 1 | <title> | performance | Tasked | 8 | 4 | 3 |
395
+ | 2 | <title> | security | Deferred | 7 | 8 | -- |
396
+ | 3 | <title> | testing | Rejected | -- | -- | -- |
397
+
398
+ ### Summary
399
+ - Improvements discovered: N
400
+ - Improvements tasked: N (with M total subtasks)
401
+ - Total effort points: X
402
+ - Improvements deferred: N
403
+ - Improvements rejected: N
404
+ ```
405
+
406
+ Output board references:
407
+ - Monotask space: `$REPO_NAME` (ID: `$SPACE_ID`)
408
+ - Improve board: `monomind-improve` (ID: `$BOARD_ID`)
409
+ - Task board: `monomind-task` (ID: `$TASK_BOARD_ID`)
410
+
411
+ ---
412
+
413
+ ## Step 9: Offer to Execute Tasks
414
+
415
+ If there are any tasked improvements (subtasks in Backlog/Todo), ask the user:
416
+
417
+ > **M subtasks are ready.** Want me to start executing them now?
418
+ >
419
+ > Say **yes** to launch `/monomind:do` — it will pick up tasks one by one, execute them with the assigned agent, review for bugs, and loop until the queue is empty.
420
+
421
+ If the user says yes, invoke:
422
+ ```
423
+ Skill("monomind-do", "--space $SPACE_ID --board $TASK_BOARD_ID")
424
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoes/monomindcli",
3
- "version": "1.6.8",
3
+ "version": "1.6.9",
4
4
  "type": "module",
5
5
  "description": "Monomind CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",