@@ -115,7 +115,38 @@ CONTEXT: Existing user database schema, REST API endpoints
115115
116116** TodoWrite** : Mark phase 1 completed, phase 2 in_progress
117117
118- ** After Phase 1** : Return to user showing Phase 1 results, then auto-continue to Phase 2
118+ ** After Phase 1** : Initialize planning-notes.md with user intent
119+
120+ ``` javascript
121+ // Create minimal planning notes document
122+ const planningNotesPath = ` .workflow/active/${ sessionId} /planning-notes.md`
123+ const userGoal = structuredDescription .goal
124+ const userConstraints = structuredDescription .context || " None specified"
125+
126+ Write (planningNotesPath, ` # Planning Notes
127+
128+ **Session**: ${ sessionId}
129+ **Created**: ${ new Date ().toISOString ()}
130+
131+ ## User Intent (Phase 1)
132+
133+ - **GOAL**: ${ userGoal}
134+ - **KEY_CONSTRAINTS**: ${ userConstraints}
135+
136+ ---
137+
138+ ## Context Findings (Phase 2)
139+ (To be filled by context-gather)
140+
141+ ## Conflict Decisions (Phase 3)
142+ (To be filled if conflicts detected)
143+
144+ ## Consolidated Constraints (Phase 4 Input)
145+ 1. ${ userConstraints}
146+ ` )
147+ ```
148+
149+ Return to user showing Phase 1 results, then auto-continue to Phase 2
119150
120151---
121152
@@ -168,7 +199,37 @@ SlashCommand(command="/workflow:tools:context-gather --session [sessionId] \"[st
168199
169200** Note** : Phase 2 tasks completed and collapsed to summary.
170201
171- ** After Phase 2** : Return to user showing Phase 2 results, then auto-continue to Phase 3/4 (depending on conflict_risk)
202+ ** After Phase 2** : Update planning-notes.md with context findings, then auto-continue
203+
204+ ``` javascript
205+ // Read context-package to extract key findings
206+ const contextPackage = JSON .parse (Read (contextPath))
207+ const conflictRisk = contextPackage .conflict_detection ? .risk_level || ' low'
208+ const criticalFiles = (contextPackage .exploration_results ? .aggregated_insights ? .critical_files || [])
209+ .slice (0 , 5 ).map (f => f .path )
210+ const archPatterns = contextPackage .project_context ? .architecture_patterns || []
211+ const constraints = contextPackage .exploration_results ? .aggregated_insights ? .constraints || []
212+
213+ // Append Phase 2 findings to planning-notes.md
214+ Edit (planningNotesPath, {
215+ old: ' ## Context Findings (Phase 2)\n (To be filled by context-gather)' ,
216+ new: ` ## Context Findings (Phase 2)
217+
218+ - **CRITICAL_FILES**: ${ criticalFiles .join (' , ' ) || ' None identified' }
219+ - **ARCHITECTURE**: ${ archPatterns .join (' , ' ) || ' Not detected' }
220+ - **CONFLICT_RISK**: ${ conflictRisk}
221+ - **CONSTRAINTS**: ${ constraints .length > 0 ? constraints .join (' ; ' ) : ' None' } `
222+ })
223+
224+ // Append Phase 2 constraints to consolidated list
225+ Edit (planningNotesPath, {
226+ old: ' ## Consolidated Constraints (Phase 4 Input)' ,
227+ new: ` ## Consolidated Constraints (Phase 4 Input)
228+ ${ constraints .map ((c , i ) => ` ${ i + 2 } . [Context] ${ c} ` ).join (' \n ' )} `
229+ })
230+ ` ` `
231+
232+ Return to user showing Phase 2 results, then auto-continue to Phase 3/4 (depending on conflict_risk)
172233
173234---
174235
@@ -229,7 +290,45 @@ SlashCommand(command="/workflow:tools:conflict-resolution --session [sessionId]
229290
230291**Note**: Phase 3 tasks completed and collapsed to summary.
231292
232- ** After Phase 3** : Return to user showing conflict resolution results (if executed) and selected strategies, then auto-continue to Phase 3.5
293+ **After Phase 3**: Update planning-notes.md with conflict decisions (if executed), then auto-continue
294+
295+ ` ` ` javascript
296+ // If Phase 3 was executed, update planning-notes.md
297+ if (conflictRisk >= ' medium' ) {
298+ const conflictResPath = ` .workflow/active/${ sessionId} /.process/conflict-resolution.json`
299+
300+ if (fs .existsSync (conflictResPath)) {
301+ const conflictRes = JSON .parse (Read (conflictResPath))
302+ const resolved = conflictRes .resolved_conflicts || []
303+ const modifiedArtifacts = conflictRes .modified_artifacts || []
304+ const planningConstraints = conflictRes .planning_constraints || []
305+
306+ // Update Phase 3 section
307+ Edit (planningNotesPath, {
308+ old: ' ## Conflict Decisions (Phase 3)\n (To be filled if conflicts detected)' ,
309+ new: ` ## Conflict Decisions (Phase 3)
310+
311+ - **RESOLVED**: ${ resolved .map (r => ` ${ r .type } → ${ r .strategy } ` ).join (' ; ' ) || ' None' }
312+ - **MODIFIED_ARTIFACTS**: ${ modifiedArtifacts .join (' , ' ) || ' None' }
313+ - **CONSTRAINTS**: ${ planningConstraints .join (' ; ' ) || ' None' } `
314+ })
315+
316+ // Append Phase 3 constraints to consolidated list
317+ if (planningConstraints .length > 0 ) {
318+ const currentNotes = Read (planningNotesPath)
319+ const constraintCount = (currentNotes .match (/ ^ \d + \. / gm ) || []).length
320+
321+ Edit (planningNotesPath, {
322+ old: ' ## Consolidated Constraints (Phase 4 Input)' ,
323+ new: ` ## Consolidated Constraints (Phase 4 Input)
324+ ${ planningConstraints .map ((c , i ) => ` ${ constraintCount + i + 1 } . [Conflict] ${ c} ` ).join (' \n ' )} `
325+ })
326+ }
327+ }
328+ }
329+ ` ` `
330+
331+ Return to user showing conflict resolution results (if executed) and selected strategies, then auto-continue to Phase 3.5
233332
234333**Memory State Check**:
235334- Evaluate current context window usage and memory state
@@ -282,7 +381,12 @@ SlashCommand(command="/workflow:tools:task-generate-agent --session [sessionId]"
282381
283382**CLI Execution Note**: CLI tool usage is now determined semantically by action-planning-agent based on user's task description. If user specifies "use Codex/Gemini/Qwen for X", the agent embeds ` command` fields in relevant ` implementation_approach` steps.
284383
285- ** Input** : ` sessionId ` from Phase 1
384+ **Input**:
385+ - ` sessionId` from Phase 1
386+ - **planning-notes.md**: Consolidated constraints from all phases (Phase 1-3)
387+ - Path: ` .workflow / active/ [sessionId]/ planning- notes .md `
388+ - Contains: User intent, context findings, conflict decisions, consolidated constraints
389+ - **Purpose**: Provides structured, minimal context summary to action-planning-agent
286390
287391**Validation**:
288392- ` .workflow / active/ [sessionId]/ IMPL_PLAN .md ` exists
@@ -404,26 +508,22 @@ User Input (task description)
404508 ↓
405509Phase 1 : session: start -- auto " structured-description"
406510 ↓ Output: sessionId
407- ↓ Session Memory: Previous tasks, context, artifacts
511+ ↓ Write : planning - notes . md (User Intent section)
408512 ↓
409513Phase 2 : context- gather -- session sessionId " structured-description"
410- ↓ Input: sessionId + session memory + structured description
514+ ↓ Input: sessionId + structured description
411515 ↓ Output: contextPath (context- package .json ) + conflict_risk
516+ ↓ Update: planning- notes .md (Context Findings + Consolidated Constraints)
412517 ↓
413518Phase 3 : conflict- resolution [AUTO - TRIGGERED if conflict_risk ≥ medium]
414519 ↓ Input: sessionId + contextPath + conflict_risk
415- ↓ CLI-powered conflict detection (JSON output)
416- ↓ AskUserQuestion: Present conflicts + resolution strategies
417- ↓ User selects strategies (or skip)
418- ↓ Apply modifications via Edit tool:
419- ↓ - Update guidance-specification.md
420- ↓ - Update role analyses (*.md)
421- ↓ - Mark context-package.json as "resolved"
422- ↓ Output: Modified brainstorm artifacts (NO report file)
520+ ↓ Output: Modified brainstorm artifacts
521+ ↓ Update: planning- notes .md (Conflict Decisions + Consolidated Constraints)
423522 ↓ Skip if conflict_risk is none/ low → proceed directly to Phase 4
424523 ↓
425524Phase 4 : task- generate- agent -- session sessionId
426- ↓ Input: sessionId + resolved brainstorm artifacts + session memory
525+ ↓ Input: sessionId + planning- notes .md + context- package .json + brainstorm artifacts
526+ ↓ planning- notes .md provides: User Intent, Context Findings, Constraints
427527 ↓ Output: IMPL_PLAN .md , task JSONs, TODO_LIST .md
428528 ↓
429529Return summary to user
0 commit comments