maxsimcli 4.3.1 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/assets/CHANGELOG.md +26 -0
  3. package/dist/assets/dashboard/server.js +248 -240
  4. package/dist/assets/templates/agents/AGENTS.md +68 -0
  5. package/dist/assets/templates/agents/maxsim-code-reviewer.md +138 -4
  6. package/dist/assets/templates/agents/maxsim-codebase-mapper.md +94 -7
  7. package/dist/assets/templates/agents/maxsim-debugger.md +124 -0
  8. package/dist/assets/templates/agents/maxsim-drift-checker.md +522 -0
  9. package/dist/assets/templates/agents/maxsim-executor.md +213 -8
  10. package/dist/assets/templates/agents/maxsim-integration-checker.md +99 -1
  11. package/dist/assets/templates/agents/maxsim-phase-researcher.md +83 -4
  12. package/dist/assets/templates/agents/maxsim-plan-checker.md +99 -4
  13. package/dist/assets/templates/agents/maxsim-planner.md +97 -0
  14. package/dist/assets/templates/agents/maxsim-project-researcher.md +82 -0
  15. package/dist/assets/templates/agents/maxsim-research-synthesizer.md +81 -0
  16. package/dist/assets/templates/agents/maxsim-roadmapper.md +85 -0
  17. package/dist/assets/templates/agents/maxsim-spec-reviewer.md +141 -4
  18. package/dist/assets/templates/agents/maxsim-verifier.md +102 -4
  19. package/dist/assets/templates/commands/maxsim/check-drift.md +56 -0
  20. package/dist/assets/templates/commands/maxsim/discuss.md +70 -0
  21. package/dist/assets/templates/commands/maxsim/realign.md +39 -0
  22. package/dist/assets/templates/workflows/check-drift.md +248 -0
  23. package/dist/assets/templates/workflows/discuss.md +343 -0
  24. package/dist/assets/templates/workflows/execute-phase.md +10 -6
  25. package/dist/assets/templates/workflows/progress.md +8 -0
  26. package/dist/assets/templates/workflows/quick.md +110 -0
  27. package/dist/assets/templates/workflows/realign.md +288 -0
  28. package/dist/assets/templates/workflows/roadmap.md +69 -20
  29. package/dist/backend-server.cjs +52 -29
  30. package/dist/backend-server.cjs.map +1 -1
  31. package/dist/cli.cjs +407 -5
  32. package/dist/cli.cjs.map +1 -1
  33. package/dist/cli.js +26 -1
  34. package/dist/cli.js.map +1 -1
  35. package/dist/core/core.d.ts.map +1 -1
  36. package/dist/core/core.js +1 -0
  37. package/dist/core/core.js.map +1 -1
  38. package/dist/core/drift.d.ts +37 -0
  39. package/dist/core/drift.d.ts.map +1 -0
  40. package/dist/core/drift.js +213 -0
  41. package/dist/core/drift.js.map +1 -0
  42. package/dist/core/frontmatter.d.ts.map +1 -1
  43. package/dist/core/frontmatter.js +6 -0
  44. package/dist/core/frontmatter.js.map +1 -1
  45. package/dist/core/index.d.ts +3 -2
  46. package/dist/core/index.d.ts.map +1 -1
  47. package/dist/core/index.js +18 -2
  48. package/dist/core/index.js.map +1 -1
  49. package/dist/core/init.d.ts +15 -3
  50. package/dist/core/init.d.ts.map +1 -1
  51. package/dist/core/init.js +251 -0
  52. package/dist/core/init.js.map +1 -1
  53. package/dist/core/types.d.ts +132 -1
  54. package/dist/core/types.d.ts.map +1 -1
  55. package/dist/core/types.js.map +1 -1
  56. package/dist/core-RRjCSt0G.cjs.map +1 -1
  57. package/dist/{lifecycle-0M4VqOMm.cjs → lifecycle-DxCru7rk.cjs} +2 -2
  58. package/dist/{lifecycle-0M4VqOMm.cjs.map → lifecycle-DxCru7rk.cjs.map} +1 -1
  59. package/dist/mcp/phase-tools.d.ts.map +1 -1
  60. package/dist/mcp/phase-tools.js +17 -4
  61. package/dist/mcp/phase-tools.js.map +1 -1
  62. package/dist/mcp-server.cjs +20 -5
  63. package/dist/mcp-server.cjs.map +1 -1
  64. package/dist/{server-G1MIg_Oe.cjs → server-By0TN-nC.cjs} +21 -6
  65. package/dist/server-By0TN-nC.cjs.map +1 -0
  66. package/dist/skills-MYlMkYNt.cjs.map +1 -1
  67. package/package.json +1 -1
  68. package/dist/server-G1MIg_Oe.cjs.map +0 -1
@@ -0,0 +1,343 @@
1
+ <sanity_check>
2
+ Before executing any step in this workflow, verify:
3
+ 1. The current directory contains a `.planning/` folder -- if not, stop and tell the user to run `/maxsim:new-project` first.
4
+ 2. `.planning/ROADMAP.md` exists -- if not, stop and tell the user to initialize the project.
5
+ </sanity_check>
6
+
7
+ <purpose>
8
+ Triage an unknown problem, idea, or bug into the right size -- quick todo or new phase -- through collaborative discussion.
9
+
10
+ You are a thinking partner, not a form collector. The user has something on their mind -- help them clarify it, size it, and file it in the right place. Then offer the next action so momentum continues.
11
+
12
+ **Key distinction:** This workflow triages an UNKNOWN item into the right size. `/maxsim:discuss-phase` gathers decisions for a KNOWN phase. They are complementary, not overlapping.
13
+ </purpose>
14
+
15
+ <required_reading>
16
+ Read all files referenced by the invoking prompt's execution_context before starting.
17
+ @./references/dashboard-bridge.md
18
+ @./references/thinking-partner.md
19
+ </required_reading>
20
+
21
+ <tool_mandate>
22
+ **CRITICAL -- Structured user interaction is MANDATORY.**
23
+
24
+ Every question directed at the user MUST use a structured tool. NEVER write a question as plain text and wait for the user to respond. This applies to:
25
+
26
+ - Existing todo confirmation
27
+ - Every clarifying question during discussion
28
+ - Triage size classification proposal
29
+ - Filing confirmation
30
+ - Next action offers
31
+ - Any follow-up or clarification
32
+
33
+ **Tool selection:** At workflow start, probe for the dashboard (see @dashboard-bridge). Then:
34
+ - **DASHBOARD_ACTIVE = true** -- use `mcp__maxsim-dashboard__ask_question` (questions appear in browser). Follow the schema translation rules from @dashboard-bridge.
35
+ - **DASHBOARD_ACTIVE = false** -- use `AskUserQuestion` (questions appear in terminal).
36
+
37
+ **The rule is simple:** If you need input from the user -- use the appropriate structured tool based on dashboard availability. Zero exceptions.
38
+ </tool_mandate>
39
+
40
+ <process>
41
+
42
+ <step name="init_context">
43
+ Load project state and todo context:
44
+
45
+ ```bash
46
+ STATE=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs state-load --raw)
47
+ ```
48
+
49
+ Check `planning_exists` from state. **Hard stop** if false -- tell user to run `/maxsim:new-project` first.
50
+
51
+ ```bash
52
+ INIT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs init todos)
53
+ ```
54
+
55
+ Extract from init JSON: `commit_docs`, `date`, `timestamp`, `todo_count`, `todos`, `pending_dir`, `todos_dir_exists`.
56
+
57
+ Ensure directories exist:
58
+ ```bash
59
+ mkdir -p .planning/todos/pending .planning/todos/done
60
+ ```
61
+
62
+ Parse user input from $ARGUMENTS (if any):
63
+ - If arguments provided: store as `user_input` for use in detect_existing_todo and gather_context
64
+ - If no arguments: `user_input` is empty -- will ask interactively in gather_context
65
+
66
+ Note existing areas from the todos array for consistency in later area inference.
67
+ </step>
68
+
69
+ <step name="detect_existing_todo">
70
+ **Only runs if `user_input` is non-empty.**
71
+
72
+ Search pending todos for a title or slug match against the user's input:
73
+
74
+ ```bash
75
+ # Search for matching words in existing todo titles
76
+ grep -l -i "[key words from user_input]" .planning/todos/pending/*.md 2>/dev/null
77
+ ```
78
+
79
+ Also compare against the `todos` array from init context -- check `title` and filename fields for partial matches.
80
+
81
+ **If a match is found:**
82
+
83
+ Use AskUserQuestion:
84
+ - header: "Existing Todo"
85
+ - question: "Found a pending todo that might match: **[todo title]**. Want to discuss this one?"
86
+ - options:
87
+ - "Yes, discuss this todo" -- Load its context and continue discussion about it
88
+ - "No, this is something new" -- Proceed as a new item
89
+
90
+ If "Yes": Read the matched todo file. Use its content as context for the discussion. The user may want to refine scope, change priority, or decide to work on it now.
91
+
92
+ If "No": Proceed to gather_context as a new item, using `user_input` as the starting description.
93
+
94
+ **If no match found (or no user_input):**
95
+
96
+ Proceed to gather_context.
97
+ </step>
98
+
99
+ <step name="gather_context">
100
+ Use adaptive questioning to understand what the user is describing.
101
+
102
+ **Apply thinking-partner behaviors from @./references/thinking-partner.md:**
103
+ - Challenge vague descriptions -- "broken" means what exactly?
104
+ - Surface unstated assumptions -- "this should be easy" might hide complexity
105
+ - Propose alternatives if the user's framing suggests a different approach
106
+ - Follow the thread -- build each question on the previous answer
107
+
108
+ **If `user_input` is non-empty (user provided a description):**
109
+
110
+ Start by reflecting back what you understood, then ask your first clarifying question.
111
+
112
+ Use AskUserQuestion:
113
+ - header: "Clarify"
114
+ - question: Based on the user's description, ask the most important clarifying question. For example: "You mentioned [X]. What specifically is the problem -- is it [scenario A] or [scenario B]?"
115
+ - options: 2-3 concrete options that capture likely answers, plus the implicit "Other" for free-text
116
+
117
+ **If `user_input` is empty (no arguments):**
118
+
119
+ Use AskUserQuestion:
120
+ - header: "Discuss"
121
+ - question: "What's on your mind? Describe the problem, idea, or bug you want to discuss."
122
+ - options: (none -- free text only, do not provide options for the opening question)
123
+
124
+ **After the first response, ask 1-2 more adaptive follow-up questions:**
125
+
126
+ Each follow-up uses AskUserQuestion with header, question, and options tailored to what the user just said.
127
+
128
+ **Adaptive depth:**
129
+ - If answers reveal the item is simple and well-defined (clear problem, clear scope, obvious size): move to triage after 2 questions
130
+ - If answers reveal complexity (multiple systems involved, unclear scope, competing approaches): ask up to 2 more questions before triage
131
+ - Maximum: 4 questions before triage. Read the room -- don't over-probe simple bugs.
132
+
133
+ **What to extract from the discussion:**
134
+ - `title`: 3-10 word descriptive title (action verb preferred)
135
+ - `problem`: What is wrong or why this is needed
136
+ - `scope_hint`: Simple fix, or touches multiple systems?
137
+ - `files`: Any file paths or areas mentioned
138
+ - `size_signal`: Does this feel like a quick todo or a multi-day phase?
139
+ </step>
140
+
141
+ <step name="triage">
142
+ Based on gathered context, propose a size classification.
143
+
144
+ **Assess the item:**
145
+ - Quick todo: Well-defined problem, clear fix, single area, could be done in one session
146
+ - Phase: Touches multiple systems, needs research, unclear approach, requires planning
147
+
148
+ **Present classification via AskUserQuestion:**
149
+ - header: "Size"
150
+ - question: "Based on what you described, this looks like [your assessment with brief explanation]. Does that match?"
151
+ - options:
152
+ - "Quick fix (todo)" -- File as a todo for later or work on it now
153
+ - "Needs a phase" -- Too big for a todo, add to the roadmap as a new phase
154
+ - "Let me explain more" -- I want to provide more context before deciding
155
+
156
+ Include a brief explanation of WHY you suggest the classification you suggest. For example: "This sounds like a focused bug fix in one file -- a quick todo should cover it." Or: "This touches auth, database, and the API layer -- that's phase-sized work."
157
+
158
+ **CRITICAL: Always present this as a question. Never auto-route.** Even if the size is obvious, the user confirms.
159
+
160
+ **If user selects "Let me explain more":**
161
+ Loop back to gather_context for 1-2 more questions, then return to triage with updated assessment.
162
+
163
+ **If user selects "Quick fix (todo)":**
164
+ Proceed to file_as_todo.
165
+
166
+ **If user selects "Needs a phase":**
167
+ Proceed to file_as_phase.
168
+ </step>
169
+
170
+ <step name="file_as_todo">
171
+ File the item as a todo using existing maxsim-tools.cjs commands.
172
+
173
+ **1. Generate slug:**
174
+ ```bash
175
+ slug=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs generate-slug "$title" --raw)
176
+ ```
177
+
178
+ **2. Infer area from discussion context:**
179
+
180
+ Use file paths and topic from the discussion to infer area:
181
+
182
+ | Path pattern | Area |
183
+ |--------------|------|
184
+ | `src/api/*`, `api/*` | `api` |
185
+ | `src/components/*`, `src/ui/*` | `ui` |
186
+ | `src/auth/*`, `auth/*` | `auth` |
187
+ | `src/db/*`, `database/*` | `database` |
188
+ | `tests/*`, `__tests__/*` | `testing` |
189
+ | `docs/*` | `docs` |
190
+ | `.planning/*` | `planning` |
191
+ | `scripts/*`, `bin/*` | `tooling` |
192
+ | No files or unclear | `general` |
193
+
194
+ Use existing areas from init context if a similar match exists.
195
+
196
+ **3. Check for duplicates:**
197
+ ```bash
198
+ # Search for key words from title in existing todos
199
+ grep -l -i "[key words from title]" .planning/todos/pending/*.md 2>/dev/null
200
+ ```
201
+
202
+ If potential duplicate found, read the existing todo and compare scope.
203
+
204
+ If overlapping, use AskUserQuestion:
205
+ - header: "Duplicate?"
206
+ - question: "A similar todo already exists: **[existing title]**. What would you like to do?"
207
+ - options:
208
+ - "Skip" -- Keep the existing todo as-is
209
+ - "Replace" -- Update the existing todo with new context from this discussion
210
+ - "Add anyway" -- Create a separate todo (they cover different aspects)
211
+
212
+ If "Skip": Jump to offer_next_action (nothing filed).
213
+ If "Replace": Update the existing file instead of creating new.
214
+ If "Add anyway": Continue creating new todo.
215
+
216
+ **4. Create todo file:**
217
+
218
+ Use values from init context: `timestamp` and `date` are already available.
219
+
220
+ Write to `.planning/todos/pending/${date}-${slug}.md`:
221
+
222
+ ```markdown
223
+ ---
224
+ created: [timestamp]
225
+ title: [title]
226
+ area: [area]
227
+ mode: discussed
228
+ files:
229
+ - [file paths from discussion, if any]
230
+ ---
231
+
232
+ ## Problem
233
+
234
+ [Problem description enriched with discussion insights -- enough context for a future Claude session to understand weeks later]
235
+
236
+ ## Solution
237
+
238
+ [Approach hints from the discussion, or "TBD" if only the problem was clarified]
239
+ ```
240
+
241
+ **5. Commit:**
242
+ ```bash
243
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs commit "docs: add todo [slug]" --files .planning/todos/pending/${date}-${slug}.md
244
+ ```
245
+
246
+ Confirm to user: "Filed as todo: **[title]**"
247
+
248
+ Proceed to offer_next_action.
249
+ </step>
250
+
251
+ <step name="file_as_phase">
252
+ File the item as a new phase on the roadmap.
253
+
254
+ **1. Gather phase details via AskUserQuestion:**
255
+ - header: "Phase"
256
+ - question: "What should this phase be called? And in one sentence, what's the goal?"
257
+ - options: (none -- free text for naming)
258
+
259
+ Parse the response to extract:
260
+ - `phase_name`: Short name (2-5 words)
261
+ - `phase_goal`: One-sentence goal description
262
+
263
+ **2. Preview and confirm via AskUserQuestion:**
264
+
265
+ First, check the current roadmap to determine what the next phase number would be:
266
+ ```bash
267
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs roadmap analyze --raw
268
+ ```
269
+
270
+ - header: "Confirm"
271
+ - question: "This would add **Phase [N]: [phase_name]** to the roadmap with goal: *[phase_goal]*. Proceed?"
272
+ - options:
273
+ - "Yes, add it" -- Add to roadmap
274
+ - "Let me adjust" -- I want to change the name or goal
275
+ - "Cancel" -- Don't add anything
276
+
277
+ If "Let me adjust": Ask again for name/goal, then re-preview.
278
+ If "Cancel": Jump to offer_next_action (nothing filed).
279
+ If "Yes, add it": Continue.
280
+
281
+ **3. Create the phase:**
282
+ ```bash
283
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs phase add "[phase_name]"
284
+ ```
285
+
286
+ **4. Commit:**
287
+ ```bash
288
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs commit "docs: add phase [phase_name]" --files .planning/ROADMAP.md .planning/phases/
289
+ ```
290
+
291
+ Confirm to user: "Added to roadmap: **Phase [N]: [phase_name]**"
292
+
293
+ Proceed to offer_next_action.
294
+ </step>
295
+
296
+ <step name="offer_next_action">
297
+ After filing (or skipping), offer contextual next actions.
298
+
299
+ **If filed as todo:**
300
+
301
+ Use AskUserQuestion:
302
+ - header: "Next"
303
+ - question: "Todo filed. What would you like to do next?"
304
+ - options:
305
+ - "Work on it now" -- Start a quick task with /maxsim:quick
306
+ - "Save for later" -- It's captured, move on
307
+ - "Check all todos" -- See pending todos with /maxsim:check-todos
308
+
309
+ If "Work on it now": Tell the user to run `/maxsim:quick [todo-title]` (print the command, do not auto-execute).
310
+ If "Save for later": Confirm and end workflow.
311
+ If "Check all todos": Tell the user to run `/maxsim:check-todos`.
312
+
313
+ **If filed as phase:**
314
+
315
+ Use AskUserQuestion:
316
+ - header: "Next"
317
+ - question: "Phase added to roadmap. What would you like to do next?"
318
+ - options:
319
+ - "Discuss it" -- Gather implementation context with /maxsim:discuss-phase [phase]
320
+ - "Plan it" -- Jump to planning with /maxsim:plan-phase [phase]
321
+ - "Save for later" -- It's on the roadmap, move on
322
+
323
+ If "Discuss it": Tell the user to run `/maxsim:discuss-phase [phase-number]`.
324
+ If "Plan it": Tell the user to run `/maxsim:plan-phase [phase-number]`.
325
+ If "Save for later": Confirm and end workflow.
326
+
327
+ **If nothing was filed (duplicate skip or cancel):**
328
+
329
+ Confirm that no action was taken and the discussion is complete.
330
+
331
+ **User always chooses -- no auto-start.** Print the recommended command for the user to copy and run, do not execute it.
332
+ </step>
333
+
334
+ </process>
335
+
336
+ <success_criteria>
337
+ - [ ] User's problem/idea/bug understood through adaptive discussion
338
+ - [ ] Existing todo detected if user referenced one
339
+ - [ ] Triage routing confirmed by user before any filing
340
+ - [ ] Item filed correctly (todo file in pending, or phase added to roadmap)
341
+ - [ ] Git commit created for the filed item
342
+ - [ ] Next action offered with concrete commands to run
343
+ </success_criteria>
@@ -174,12 +174,16 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
174
174
  - Verify first 2 files from `key-files.created` exist on disk
175
175
  - Check `git log --oneline --all --grep="{phase}-{plan}"` returns ≥1 commit
176
176
  - Check for `## Self-Check: FAILED` marker
177
- - **Check for `## Review Cycle` section** — verify all review stages show PASS/APPROVED/CLEAN/FIXED (not BLOCKED or FAIL)
177
+ - **Check for `## Review Cycle` section** — verify both review stages (Spec and Code) show PASS or SKIPPED (not BLOCKED or FAIL)
178
178
 
179
179
  If ANY spot-check fails: report which plan failed, route to failure handler — ask "Retry plan?" or "Continue with remaining waves?"
180
180
 
181
181
  If review cycle is missing or has unresolved issues: flag the plan as **review-incomplete** — ask "Run review cycle for this plan?" or "Continue (review will block phase completion)?"
182
182
 
183
+ **Note:** The executor agent runs the two-stage review (Spec Review + Code Review) after each wave. The orchestrator does NOT run reviews itself -- it only checks the executor's review results in SUMMARY.md. If review is missing, the executor failed to run it, and the orchestrator should offer to re-run the affected plan.
184
+
185
+ Review stages to check: `Spec:` and `Code:` lines in `## Review Cycle`. Both must be PASS or SKIPPED for the plan to be considered review-complete.
186
+
183
187
  If pass — **emit plan-complete lifecycle event** (if `DASHBOARD_ACTIVE`):
184
188
  ```
185
189
  mcp__maxsim-dashboard__submit_lifecycle_event(
@@ -279,10 +283,10 @@ After all waves:
279
283
  2. **03-02**: [one-liner from SUMMARY.md]
280
284
 
281
285
  ### Review Cycle Summary
282
- | Plan | Spec Review | Code Review | Simplify | Final Review |
283
- |------|-------------|-------------|----------|--------------|
284
- | 03-01 | PASS | APPROVED | CLEAN | — |
285
- | 03-02 | PASS | APPROVED | FIXED | APPROVED |
286
+ | Plan | Spec Review | Code Review | Retries |
287
+ |------|-------------|-------------|---------|
288
+ | 03-01 | PASS | PASS | 0 |
289
+ | 03-02 | PASS | PASS | 1 |
286
290
 
287
291
  [Aggregate review findings from each plan's SUMMARY.md `## Review Cycle` section.
288
292
  If any plan has no Review Cycle section: mark as "NOT RUN" and flag for attention.
@@ -295,7 +299,7 @@ If any plan has unresolved BLOCKED/FAIL status: list the blocking issues below.]
295
299
  [Aggregate from SUMMARYs, or "None"]
296
300
  ```
297
301
 
298
- **Phase completion gate:** If any plan has unresolved review issues (BLOCKED or FAIL in any review stage), the phase CANNOT proceed to `verify_phase_goal`. Present unresolved issues and offer:
302
+ **Phase completion gate:** If any plan has unresolved review issues (BLOCKED or FAIL in Spec Review or Code Review stages), the phase CANNOT proceed to `verify_phase_goal`. Present unresolved issues and offer:
299
303
  - "Fix review issues now" — re-run the review cycle for affected plans
300
304
  - "Override and continue" — mark as acknowledged, proceed (adds warning to VERIFICATION.md)
301
305
  </step>
@@ -127,6 +127,14 @@ CONTEXT: [✓ if has_context | - if not]
127
127
  [Next phase/plan objective from roadmap analyze]
128
128
  ```
129
129
 
130
+ **Performance metrics table truncation:**
131
+
132
+ When displaying the performance metrics table from STATE.md (the `## Performance Metrics` section):
133
+ - Show only the **last 20 entries** (most recent) by default.
134
+ - If there are more than 20 metric entries in STATE.md, add a note above the table: `Showing last 20 of {total} metrics entries.`
135
+ - This is a **display-time truncation only** — STATE.md retains all metrics as the source of truth. Do not modify or remove older entries from STATE.md.
136
+ - If there are 20 or fewer entries, show all without any truncation note.
137
+
130
138
  </step>
131
139
 
132
140
  <step name="route">
@@ -288,6 +288,116 @@ Note: For quick tasks producing multiple plans (rare), spawn executors in parall
288
288
 
289
289
  ---
290
290
 
291
+ **Step 6.3: Two-Stage Review**
292
+
293
+ Run spec-compliance and code-quality review on the completed quick task. This applies to ALL quick tasks regardless of model profile or `--full` flag (per locked decision: "Quick means fast planning, not skipped quality gates").
294
+
295
+ Display banner:
296
+ ```
297
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
298
+ MAXSIM ► REVIEWING RESULTS
299
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
300
+
301
+ ◆ Running two-stage review...
302
+ ```
303
+
304
+ 1. Read the completed SUMMARY.md from `${QUICK_DIR}/${next_num}-SUMMARY.md` to understand what was built.
305
+ 2. Get modified files: `git diff --name-only HEAD~{N}` where N = number of commits from the executor.
306
+ 3. Read the quick plan at `${QUICK_DIR}/${next_num}-PLAN.md` to get task specs.
307
+
308
+ **Spec Review:**
309
+
310
+ ```
311
+ Task(
312
+ prompt="
313
+ <review_context>
314
+ **Plan:** quick-${next_num}
315
+ **Description:** ${DESCRIPTION}
316
+
317
+ <task_specs>
318
+ {Copy task specs (action, done criteria, files) from ${QUICK_DIR}/${next_num}-PLAN.md}
319
+ </task_specs>
320
+
321
+ <modified_files>
322
+ {output of git diff --name-only HEAD~N}
323
+ </modified_files>
324
+
325
+ <plan_frontmatter>
326
+ {Plan frontmatter including requirements if present}
327
+ </plan_frontmatter>
328
+ </review_context>
329
+ ",
330
+ subagent_type="maxsim-spec-reviewer",
331
+ model="{executor_model}",
332
+ description="Spec review: ${DESCRIPTION}"
333
+ )
334
+ ```
335
+
336
+ Parse output frontmatter for `status:` field.
337
+ If FAIL: fix issues, commit (`fix(quick-${next_num}): address spec review findings`), retry (max 2 retries).
338
+ On retry exhaustion (3 total attempts):
339
+
340
+ ```
341
+ ## REVIEW BLOCKED
342
+
343
+ **Stage:** Spec Compliance
344
+ **Task:** quick-${next_num}: ${DESCRIPTION}
345
+ **Attempts:** 3 (initial + 2 retries)
346
+ **Failing Issues:**
347
+ - {issue list from review}
348
+
349
+ **Options:**
350
+ 1. Fix manually and continue
351
+ 2. Skip review for this task
352
+ 3. Abort execution
353
+ ```
354
+
355
+ STOP and wait for user decision.
356
+
357
+ **Code Review:**
358
+
359
+ ```
360
+ Task(
361
+ prompt="
362
+ <review_context>
363
+ **Plan:** quick-${next_num}
364
+
365
+ <modified_files>
366
+ {output of git diff --name-only HEAD~N, updated after any spec-review fix commits}
367
+ </modified_files>
368
+
369
+ <conventions>
370
+ {Content of .planning/CONVENTIONS.md or .planning/codebase/CONVENTIONS.md, or 'No CONVENTIONS.md found'}
371
+ </conventions>
372
+
373
+ <test_results>
374
+ {Last 20 lines of npm test output if package.json exists, or 'No tests available'}
375
+ </test_results>
376
+ </review_context>
377
+ ",
378
+ subagent_type="maxsim-code-reviewer",
379
+ model="{executor_model}",
380
+ description="Code review: ${DESCRIPTION}"
381
+ )
382
+ ```
383
+
384
+ Same retry logic as spec review (max 2 retries, then REVIEW BLOCKED with user options).
385
+
386
+ **Record review results** in the quick task SUMMARY.md:
387
+
388
+ Append `## Review Cycle` section to `${QUICK_DIR}/${next_num}-SUMMARY.md`:
389
+ ```markdown
390
+ ## Review Cycle
391
+ - Spec: {PASS/FAIL/SKIPPED} ({retry_count} retries)
392
+ - Code: {PASS/FAIL/SKIPPED} ({retry_count} retries)
393
+ - Issues: {critical_count} critical, {warning_count} warnings
394
+ ```
395
+
396
+ If `--full` flag was set: this review is part of the full quality pipeline (alongside plan-checking and verification that `--full` already enables).
397
+ If `--full` was NOT set: the review STILL runs (per locked decision).
398
+
399
+ ---
400
+
291
401
  **Step 6.5: Verification (only when `$FULL_MODE`)**
292
402
 
293
403
  Skip this step entirely if NOT `$FULL_MODE`.