@monoes/monomindcli 1.6.8 → 1.7.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.
@@ -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.
@@ -189,112 +199,44 @@ Also move any `skipElaboration: true` ideas directly to `Elaborated`.
189
199
 
190
200
  ---
191
201
 
192
- ## Step 6: Task Decomposer -- Break Ideas into Subtasks
193
-
194
- ### Task Board Setup
195
- - Check if a `monomind-task` board exists in the space (same lookup method as Step 2).
196
- - If not, create it with these columns:
197
- - `Backlog`
198
- - `Todo`
199
- - `In Progress`
200
- - `Review`
201
- - `Human in Loop`
202
- - `Done`
203
- - Store column IDs (especially `COL_BACKLOG`).
202
+ ## Step 6: Task Decomposer Break Ideas into Subtasks
204
203
 
205
- ### Decomposition into Professional Task Cards
204
+ ### Generate the TASKS Array
206
205
 
207
206
  Spawn a single `Software Architect` agent via the Agent tool. Provide it with:
208
207
  - All ideas in the `Elaborated` column (titles, descriptions, and all comments)
209
208
  - The `PROJECT_CONTEXT`
209
+ - **The Task Grouping Rules and Card Format from `monomind-task-engine` skill (Sections 1 & 2)** — include them verbatim in the agent prompt so it produces correctly structured tasks
210
210
 
211
- For each elaborated idea, the agent must:
212
-
213
- 1. **Analyze and decompose** into 2-6 subtasks. Each subtask must be a professional task card following this structure:
214
-
215
- ```json
216
- {
217
- "title": "Action-oriented title (verb + noun + context)",
218
- "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).",
219
- "definition_of_done": [
220
- "Specific, binary, verifiable condition (include HTTP codes, error shapes, edge cases)",
221
- "Quantified thresholds where applicable (rate limits, timeouts, sizes)"
222
- ],
223
- "testing_criteria": {
224
- "unit_tests": ["function(input) → expected outcome"],
225
- "integration_tests": ["endpoint + method → status + response shape"],
226
- "edge_cases": ["boundary condition → expected behavior"]
227
- },
228
- "checklist": [
229
- "Write failing test for [specific behavior]",
230
- "Implement [function/class] in [file path]",
231
- "Run tests — verify green",
232
- "Commit: '[type]: [description]'"
233
- ],
234
- "agent_type": "best-fit agent from 230+ roster (e.g., backend-dev, Frontend Developer, Security Engineer)",
235
- "priority": "critical | high | medium | low",
236
- "effort": "1-10 (1=trivial, 10=full day)",
237
- "dependencies": ["titles of prerequisite tasks, or empty"]
238
- }
239
- ```
240
-
241
- **Task generation rules:**
242
- - Tasks MUST be ordered so dependencies come first
243
- - Each task: 5-30 minutes for a single agent
244
- - Split anything larger
245
- - Every task starts with writing a test (TDD)
246
- - DOD items must be binary (pass/fail, not "looks good")
247
- - Testing criteria must name specific functions, endpoints, inputs
248
-
249
- 2. **Create each subtask** as a card in `Backlog` (has deps) or `Todo` (no deps):
250
- ```bash
251
- monotask card create $TASK_BOARD_ID $COLUMN_ID "<title>" --json
252
- ```
253
-
254
- 3. **Set description** with full context block:
255
- ```bash
256
- monotask card set-description $TASK_BOARD_ID $CARD_ID "<description with What/Why/Where/Patterns>"
257
- ```
258
-
259
- 4. **Add DOD comment**:
260
- ```bash
261
- monotask card comment add $TASK_BOARD_ID $CARD_ID "## Definition of Done\n- [ ] <condition 1>\n- [ ] <condition 2>\n..."
262
- ```
263
-
264
- 5. **Add testing criteria comment**:
265
- ```bash
266
- 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>"
267
- ```
211
+ The agent MUST produce a `TASKS` array following the `monomind-task-engine` card format (Section 2). Each task must comply with all 7 grouping rules (Section 1). For each elaborated idea, decompose into 2-6 subtasks.
268
212
 
269
- 6. **Add agent assignment + metadata**:
270
- ```bash
271
- monotask card comment add $TASK_BOARD_ID $CARD_ID "Assigned agent: <agent_type>\nPriority: <priority>\nEffort: <effort>/10\nDependencies: <dep titles or none>"
272
- ```
213
+ **If the architect has doubts** about decomposing an idea (unclear scope, missing info), they should:
214
+ - Add a comment with the question
215
+ - Move the idea to `Iced` instead of `Tasked`
273
216
 
274
- 7. **Set priority**: `monotask card set-priority $TASK_BOARD_ID $CARD_ID <1-4>`
217
+ Store the result as `TASKS` array.
275
218
 
276
- 8. **Create checklist** (TDD implementation steps):
277
- ```bash
278
- monotask checklist add $TASK_BOARD_ID $CARD_ID "Implementation Steps" --json
279
- ```
280
- Then for each step:
281
- ```bash
282
- monotask checklist item-add $TASK_BOARD_ID $CARD_ID $CHECKLIST_ID "<step>"
283
- ```
219
+ ### Invoke the Unified Task Engine
284
220
 
285
- 9. **Comment on original idea card** listing all subtask titles with their assigned agents:
286
- ```bash
287
- monotask card comment add $BOARD_ID $IDEA_CARD_ID "Subtasks created:\n- <title> (agent: <type>, effort: <N>/10)\n- <title> (agent: <type>, effort: <N>/10)\n..."
288
- ```
221
+ Invoke the `monomind-task-engine` skill (Sections 3-7) with these parameters:
289
222
 
290
- 10. **Move the idea card** to `Tasked`:
291
- ```bash
292
- monotask card move $BOARD_ID $IDEA_CARD_ID $COL_TASKED --json
293
- ```
223
+ | Parameter | Value |
224
+ |-----------|-------|
225
+ | `TASKS` | The array from the architect agent |
226
+ | `TASK_BOARD_ID` | From Step 2 (or let the engine set up the board) |
227
+ | `REPO_NAME` | From Step 1 |
228
+ | `SOURCE_TAG` | `"monomind-idea"` |
229
+ | `SOURCE_SUMMARY` | First 100 chars of `$ARGUMENTS` |
230
+ | `PARENT_CARD_ID` | Each `IDEA_CARD_ID` in the Elaborated column |
231
+ | `PARENT_BOARD_ID` | `$BOARD_ID` (the monomind-idea board) |
232
+ | `PARENT_DONE_COLUMN` | `$COL_TASKED` |
294
233
 
295
- **If the architect has doubts** about decomposing an idea (unclear scope, missing info), they should:
296
- - Add a comment with the question
297
- - Move the idea to `Iced` instead of `Tasked`
234
+ The engine will:
235
+ 1. Create all cards on the monotask board (Section 4)
236
+ 2. Store execution strategy in session memory (Section 5)
237
+ 3. Run the **Final Dependency & Critical Path Review** (Section 6) — a fresh Code Reviewer agent validates prerequisites, context groups, critical path, parallel safety, and agent assignments
238
+ 4. Fix any blocker issues automatically, present warnings to user
239
+ 5. Present execution offer with mode recommendation (Section 7)
298
240
 
299
241
  ---
300
242
 
@@ -303,11 +245,11 @@ For each elaborated idea, the agent must:
303
245
  Output a summary table:
304
246
 
305
247
  ```
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 | -- | -- | -- |
248
+ | # | Idea | Category | Status | Subtasks | Total Effort | Agents |
249
+ |---|-----------------------------|--------------------|----- ----|----------|--------------|--------|
250
+ | 1 | <title> | feature | Tasked | 4 | 18/40 | coder, backend-dev, tester |
251
+ | 2 | <title> | technical-baseline | Iced | -- | -- | -- |
252
+ | 3 | <title> | feature | Rejected | -- | -- | -- |
311
253
  ```
312
254
 
313
255
  Then output:
@@ -324,15 +266,10 @@ Then output:
324
266
 
325
267
  ## Step 8: Offer to Execute Tasks
326
268
 
327
- If there are any tasked ideas (subtasks in Backlog), ask the user:
269
+ The `monomind-task-engine` (Section 7) already presents the execution offer after the final review passes. If the user picks a mode there, it invokes `monomind-do` automatically.
328
270
 
329
- > **M subtasks are ready in the backlog.** Want me to start executing them now?
330
- >
331
- > 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 every 2 minutes until the queue is empty.
271
+ If the engine's execution offer was skipped or the user deferred, and there are tasks in Todo, offer:
332
272
 
333
- If the user says yes (or any affirmative), invoke the Skill tool with:
334
273
  ```
335
- Skill("monomind-do", "--space $SPACE_ID --board $TASK_BOARD_ID")
274
+ Skill("monomind-do", "--space $SPACE_ID --board $TASK_BOARD_ID --mode <parallel|minimal|sequential>")
336
275
  ```
337
-
338
- This passes the exact space and board IDs so `monomind:do` skips discovery and starts executing immediately.
@@ -0,0 +1,352 @@
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
+ ### Generate the TASKS Array
271
+
272
+ Spawn a single `Software Architect` agent via the Agent tool. Provide it with:
273
+ - All ideas in the `Approved` column (titles, descriptions, and all comments including implementation paths and research)
274
+ - The `COMPONENT_ANALYSIS` from Step 2
275
+ - The `PROJECT_CONTEXT`
276
+ - **The Task Grouping Rules and Card Format from `monomind-task-engine` skill (Sections 1 & 2)** — include them verbatim in the agent prompt so it produces correctly structured tasks
277
+
278
+ The agent MUST produce a `TASKS` array following the `monomind-task-engine` card format (Section 2). Each task must comply with all 7 grouping rules (Section 1). For each approved improvement, decompose into 2-6 subtasks.
279
+
280
+ **If the architect has doubts** about decomposing an improvement (unclear scope, missing info):
281
+ - Add a comment with the question
282
+ - Move the improvement to `Deferred` instead of `Tasked`
283
+
284
+ Store the result as `TASKS` array.
285
+
286
+ ### Invoke the Unified Task Engine
287
+
288
+ Invoke the `monomind-task-engine` skill (Sections 3-7) with these parameters:
289
+
290
+ | Parameter | Value |
291
+ |-----------|-------|
292
+ | `TASKS` | The array from the architect agent |
293
+ | `TASK_BOARD_ID` | From Step 3 (or let the engine set up the board) |
294
+ | `REPO_NAME` | From Step 1 |
295
+ | `SOURCE_TAG` | `"monomind-improve"` |
296
+ | `SOURCE_SUMMARY` | First 100 chars of `$ARGUMENTS` |
297
+ | `PARENT_CARD_ID` | Each `IMPROVE_CARD_ID` in the Approved column |
298
+ | `PARENT_BOARD_ID` | `$BOARD_ID` (the monomind-improve board) |
299
+ | `PARENT_DONE_COLUMN` | `$COL_TASKED` |
300
+
301
+ The engine will:
302
+ 1. Create all cards on the monotask board (Section 4)
303
+ 2. Store execution strategy in session memory (Section 5)
304
+ 3. Run the **Final Dependency & Critical Path Review** (Section 6) — a fresh Code Reviewer agent validates prerequisites, context groups, critical path, parallel safety, and agent assignments
305
+ 4. Fix any blocker issues automatically, present warnings to user
306
+ 5. Present execution offer with mode recommendation (Section 7)
307
+
308
+ ---
309
+
310
+ ## Step 8: Final Summary
311
+
312
+ Output a component health report:
313
+
314
+ ```
315
+ ## Improvement Analysis: <component>
316
+
317
+ ### Component Health
318
+ - Files analyzed: N
319
+ - Pain points found: N (X critical, Y high, Z medium)
320
+ - Strengths identified: N
321
+
322
+ ### Improvement Pipeline
323
+ | # | Improvement | Category | Status | Impact | Effort | Subtasks |
324
+ |---|-----------------------------|----------------|----------|--------|--------|----------|
325
+ | 1 | <title> | performance | Tasked | 8 | 4 | 3 |
326
+ | 2 | <title> | security | Deferred | 7 | 8 | -- |
327
+ | 3 | <title> | testing | Rejected | -- | -- | -- |
328
+
329
+ ### Summary
330
+ - Improvements discovered: N
331
+ - Improvements tasked: N (with M total subtasks)
332
+ - Total effort points: X
333
+ - Improvements deferred: N
334
+ - Improvements rejected: N
335
+ ```
336
+
337
+ Output board references:
338
+ - Monotask space: `$REPO_NAME` (ID: `$SPACE_ID`)
339
+ - Improve board: `monomind-improve` (ID: `$BOARD_ID`)
340
+ - Task board: `monomind-task` (ID: `$TASK_BOARD_ID`)
341
+
342
+ ---
343
+
344
+ ## Step 9: Offer to Execute Tasks
345
+
346
+ The `monomind-task-engine` (Section 7) already presents the execution offer after the final review passes. If the user picks a mode there, it invokes `monomind-do` automatically.
347
+
348
+ If the engine's execution offer was skipped or the user deferred, and there are tasks in Todo, offer:
349
+
350
+ ```
351
+ Skill("monomind-do", "--space $SPACE_ID --board $TASK_BOARD_ID --mode <parallel|minimal|sequential>")
352
+ ```