declare-cc 0.1.0 → 0.3.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 (77) hide show
  1. package/README.md +126 -27
  2. package/agents/declare-codebase-mapper.md +761 -0
  3. package/agents/declare-debugger.md +1198 -0
  4. package/agents/declare-plan-checker.md +608 -0
  5. package/agents/declare-planner.md +1015 -0
  6. package/agents/declare-research-synthesizer.md +309 -0
  7. package/agents/declare-researcher.md +484 -0
  8. package/commands/declare/actions.md +41 -20
  9. package/commands/declare/add-todo.md +41 -0
  10. package/commands/declare/audit.md +76 -0
  11. package/commands/declare/check-todos.md +125 -0
  12. package/commands/declare/complete-milestone.md +215 -0
  13. package/commands/declare/dashboard.md +76 -0
  14. package/commands/{gsd → declare}/debug.md +11 -11
  15. package/commands/declare/discuss.md +65 -0
  16. package/commands/declare/execute.md +518 -0
  17. package/commands/declare/health.md +92 -0
  18. package/commands/declare/help.md +31 -0
  19. package/commands/declare/init.md +36 -0
  20. package/commands/declare/map-codebase.md +149 -0
  21. package/commands/declare/milestones.md +7 -7
  22. package/commands/declare/new-milestone.md +172 -0
  23. package/commands/declare/new-project.md +565 -0
  24. package/commands/declare/pause.md +138 -0
  25. package/commands/declare/plan.md +236 -0
  26. package/commands/declare/prioritize.md +65 -0
  27. package/commands/declare/progress.md +116 -0
  28. package/commands/declare/quick.md +119 -0
  29. package/commands/declare/reapply-patches.md +178 -0
  30. package/commands/declare/research.md +267 -0
  31. package/commands/declare/resume.md +146 -0
  32. package/commands/declare/set-profile.md +66 -0
  33. package/commands/declare/settings.md +119 -0
  34. package/commands/declare/status.md +14 -11
  35. package/commands/declare/trace.md +81 -0
  36. package/commands/declare/update.md +251 -0
  37. package/commands/declare/verify.md +64 -0
  38. package/commands/declare/visualize.md +74 -0
  39. package/dist/declare-tools.cjs +1234 -3
  40. package/package.json +4 -2
  41. package/templates/future.md +4 -0
  42. package/templates/milestones.md +11 -0
  43. package/workflows/actions.md +89 -0
  44. package/workflows/discuss.md +476 -0
  45. package/workflows/future.md +185 -0
  46. package/workflows/milestones.md +87 -0
  47. package/workflows/verify.md +504 -0
  48. package/commands/gsd/add-phase.md +0 -39
  49. package/commands/gsd/add-todo.md +0 -42
  50. package/commands/gsd/audit-milestone.md +0 -42
  51. package/commands/gsd/check-todos.md +0 -41
  52. package/commands/gsd/cleanup.md +0 -18
  53. package/commands/gsd/complete-milestone.md +0 -136
  54. package/commands/gsd/discuss-phase.md +0 -87
  55. package/commands/gsd/execute-phase.md +0 -42
  56. package/commands/gsd/health.md +0 -22
  57. package/commands/gsd/help.md +0 -22
  58. package/commands/gsd/insert-phase.md +0 -33
  59. package/commands/gsd/join-discord.md +0 -18
  60. package/commands/gsd/list-phase-assumptions.md +0 -50
  61. package/commands/gsd/map-codebase.md +0 -71
  62. package/commands/gsd/new-milestone.md +0 -51
  63. package/commands/gsd/new-project.md +0 -42
  64. package/commands/gsd/new-project.md.bak +0 -1041
  65. package/commands/gsd/pause-work.md +0 -35
  66. package/commands/gsd/plan-milestone-gaps.md +0 -40
  67. package/commands/gsd/plan-phase.md +0 -44
  68. package/commands/gsd/progress.md +0 -24
  69. package/commands/gsd/quick.md +0 -40
  70. package/commands/gsd/reapply-patches.md +0 -110
  71. package/commands/gsd/remove-phase.md +0 -32
  72. package/commands/gsd/research-phase.md +0 -187
  73. package/commands/gsd/resume-work.md +0 -40
  74. package/commands/gsd/set-profile.md +0 -34
  75. package/commands/gsd/settings.md +0 -36
  76. package/commands/gsd/update.md +0 -37
  77. package/commands/gsd/verify-work.md +0 -39
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "declare-cc",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "A future-driven meta-prompting engine for agentic development, rooted in declared futures and causal graph structure.",
5
5
  "bin": {
6
6
  "declare-cc": "bin/install.js"
@@ -10,7 +10,9 @@
10
10
  "commands",
11
11
  "agents",
12
12
  "dist",
13
- "scripts"
13
+ "scripts",
14
+ "workflows",
15
+ "templates"
14
16
  ],
15
17
  "keywords": [
16
18
  "claude",
@@ -0,0 +1,4 @@
1
+ # Future: [Project Name]
2
+
3
+ <!-- Each declaration is a standalone truth statement about the future. -->
4
+ <!-- Edit freely -- the system validates on load, not on save. -->
@@ -0,0 +1,11 @@
1
+ # Milestones & Actions: [Project Name]
2
+
3
+ ## Milestones
4
+
5
+ | ID | Title | Status | Realizes | Caused By |
6
+ |----|-------|--------|----------|-----------|
7
+
8
+ ## Actions
9
+
10
+ | ID | Title | Status | Causes |
11
+ |----|-------|--------|--------|
@@ -0,0 +1,89 @@
1
+ # Action Plan Derivation Workflow
2
+
3
+ You are guiding a user through action plan derivation: for each milestone, working backward to determine the concrete actions that must be done to make the milestone true.
4
+
5
+ ## Opening
6
+
7
+ Show the milestones being processed:
8
+
9
+ > Let's derive action plans for your milestones -- the concrete steps to make each one true.
10
+ >
11
+ > Milestones to plan:
12
+ > - M-01: [title] (realizes D-XX)
13
+ > - M-02: [title] (realizes D-XX)
14
+ > ...
15
+ >
16
+ > For each milestone, I'll ask: "For this to be true, what must be done?" Each answer becomes an action with a clear artifact or state change it produces.
17
+
18
+ If deriving for a specific milestone (argument provided), focus on just that one:
19
+
20
+ > Let's derive an action plan for:
21
+ > - [M-XX]: [title]
22
+
23
+ ## Per-Milestone Derivation Loop
24
+
25
+ For each milestone M that needs a plan:
26
+
27
+ ### a. State the backward question
28
+
29
+ > For "[M title]" to be true, what must be done?
30
+
31
+ ### b. Derive actions (2-6 per milestone)
32
+
33
+ For each proposed action:
34
+
35
+ - **Title:** clear, action-oriented (e.g., "Build authentication middleware", "Write migration script")
36
+ - **Produces:** what artifact or state change results (e.g., "auth middleware module", "migrated database schema")
37
+ - **Atomicity check:** Can this be completed in one focused session? Does it produce a verifiable artifact? Is "done" clear?
38
+ - If YES: include as an action.
39
+ - If NO: it may need to be split or may actually be a sub-milestone.
40
+
41
+ Err on the side of "atomic enough" -- over-decomposition creates bloat. If something is borderline, treat it as a single action.
42
+
43
+ ### c. Present complete plan for approval
44
+
45
+ Show all proposed actions together as a coherent plan:
46
+
47
+ > Here's the proposed plan for M-XX "[milestone title]":
48
+ >
49
+ > 1. **[Action A]** -- produces [what]
50
+ > 2. **[Action B]** -- produces [what]
51
+ > 3. **[Action C]** -- produces [what]
52
+ >
53
+ > This plan will be presented for your approval.
54
+
55
+ The command will present this for user approval via AskUserQuestion.
56
+
57
+ ### d. Handle adjustments
58
+
59
+ If the user wants changes:
60
+ - Add, remove, rename, or reorder actions as requested
61
+ - Re-present the adjusted plan for approval
62
+
63
+ If the user approves: signal the command to persist via create-plan.
64
+
65
+ ### e. Move to next milestone
66
+
67
+ After a plan is approved and persisted, move to the next milestone.
68
+
69
+ ## Closing
70
+
71
+ After all milestones have plans:
72
+
73
+ > Action derivation complete.
74
+ >
75
+ > Created plans for [X] milestones with [Y] total actions.
76
+ >
77
+ > Run `/declare:status` to see coverage and health.
78
+
79
+ ## Design Principles
80
+
81
+ Follow these throughout the conversation:
82
+
83
+ - **Actions are derived and presented as a complete plan per milestone**, not individually. The user reviews the whole plan at once.
84
+ - **"What must be done?" is the core question.** Keep the backward reasoning visible.
85
+ - **Each action should be atomic** -- single focused session, verifiable artifact, clear "done" state.
86
+ - **Err toward atomic enough.** Over-decomposition creates bloat. If something could be one action or two, lean toward one.
87
+ - **Show your reasoning.** For each action, explain what it produces and why it's needed.
88
+ - **Propose, don't dictate.** The user may have better ideas about how to decompose their work.
89
+ - **Do not use emojis.** Keep the tone professional and grounded.
@@ -0,0 +1,476 @@
1
+ <purpose>
2
+ Extract implementation decisions that downstream agents need. Analyze the milestone to identify gray areas, let the user choose what to discuss, then deep-dive each selected area until satisfied.
3
+
4
+ You are a thinking partner, not an interviewer. The user is the visionary — you are the builder. Your job is to capture decisions that will guide research and planning, not to figure out implementation yourself.
5
+ </purpose>
6
+
7
+ <downstream_awareness>
8
+ **CONTEXT.md feeds into:**
9
+
10
+ 1. **declare-researcher** — Reads CONTEXT.md to know WHAT to research
11
+ - "User wants card-based layout" → researcher investigates card component patterns
12
+ - "Streaming output decided" → researcher looks into streaming API patterns
13
+
14
+ 2. **declare-planner** — Reads CONTEXT.md to know WHAT decisions are locked
15
+ - "CLI output format is JSON" → planner includes that in task specs
16
+ - "Claude's Discretion: error handling style" → planner can decide approach
17
+
18
+ **Your job:** Capture decisions clearly enough that downstream agents can act on them without asking the user again.
19
+
20
+ **Not your job:** Figure out HOW to implement. That's what research and planning do with the decisions you capture.
21
+ </downstream_awareness>
22
+
23
+ <philosophy>
24
+ **User = founder/visionary. Claude = builder.**
25
+
26
+ The user knows:
27
+ - How they imagine it working
28
+ - What it should look/feel like
29
+ - What's essential vs nice-to-have
30
+ - Specific behaviors or references they have in mind
31
+
32
+ The user doesn't know (and shouldn't be asked):
33
+ - Codebase patterns (researcher reads the code)
34
+ - Technical risks (researcher identifies these)
35
+ - Implementation approach (planner figures this out)
36
+ - Success metrics (inferred from the work)
37
+
38
+ Ask about vision and implementation choices. Capture decisions for downstream agents.
39
+ </philosophy>
40
+
41
+ <scope_guardrail>
42
+ **CRITICAL: No scope creep.**
43
+
44
+ The milestone boundary comes from MILESTONES.md and is FIXED. Discussion clarifies HOW to implement what's scoped, never WHETHER to add new capabilities.
45
+
46
+ **Allowed (clarifying ambiguity):**
47
+ - "How should the discuss flow present gray areas?" (presentation, format, density)
48
+ - "What happens if a milestone already has context?" (behavior choice)
49
+ - "Interactive or auto mode?" (invocation pattern)
50
+
51
+ **Not allowed (scope creep):**
52
+ - "Should we also add a research step here?" (new capability)
53
+ - "What about integrating with the planner directly?" (new capability)
54
+ - "Maybe include visualization?" (new capability)
55
+
56
+ **The heuristic:** Does this clarify how we implement what's already in the milestone, or does it add a new capability that could be its own milestone?
57
+
58
+ **When user suggests scope creep:**
59
+ ```
60
+ "[Feature X] would be a new capability — that's its own milestone.
61
+ Want me to note it for the backlog?
62
+
63
+ For now, let's focus on [milestone domain]."
64
+ ```
65
+
66
+ Capture the idea in a "Deferred Ideas" section. Don't lose it, don't act on it.
67
+ </scope_guardrail>
68
+
69
+ <gray_area_identification>
70
+ Gray areas are **implementation decisions the user cares about** — things that could go multiple ways and would change the result.
71
+
72
+ **How to identify gray areas:**
73
+
74
+ 1. **Read the milestone goal** from MILESTONES.md
75
+ 2. **Understand the domain** — What kind of thing is being built?
76
+ - Something users SEE → visual presentation, interactions, states matter
77
+ - Something users CALL → interface contracts, responses, errors matter
78
+ - Something users RUN → invocation, output, behavior modes matter
79
+ - Something users READ → structure, tone, depth, flow matter
80
+ - Something being ORGANIZED → criteria, grouping, handling exceptions matter
81
+ 3. **Generate milestone-specific gray areas** — Not generic categories, but concrete decisions for THIS milestone
82
+
83
+ **Don't use generic category labels** (UI, UX, Behavior). Generate specific gray areas:
84
+
85
+ ```
86
+ Milestone: "Context capture per milestone"
87
+ → Discussion flow, Gray area presentation, CONTEXT.md structure, Existing context handling
88
+
89
+ Milestone: "Milestone research pipeline"
90
+ → Research depth, Source selection, Output format, Staleness policy
91
+
92
+ Milestone: "CLI for database backups"
93
+ → Output format, Flag design, Progress reporting, Error recovery
94
+
95
+ Milestone: "API documentation"
96
+ → Structure/navigation, Code examples depth, Versioning approach, Interactive elements
97
+ ```
98
+
99
+ **The key question:** What decisions would change the outcome that the user should weigh in on?
100
+
101
+ **Claude handles these (don't ask):**
102
+ - Technical implementation details
103
+ - Architecture patterns
104
+ - Performance optimization
105
+ - Scope (MILESTONES.md defines this)
106
+ </gray_area_identification>
107
+
108
+ <process>
109
+
110
+ <step name="initialize" priority="first">
111
+ Milestone ID from argument (required).
112
+
113
+ ```bash
114
+ node dist/declare-tools.cjs load-graph
115
+ ```
116
+
117
+ Parse the JSON. Extract milestone data for the given ID.
118
+
119
+ **If graph has an `error` field:**
120
+ ```
121
+ Project not initialized. Run /declare:init first.
122
+ ```
123
+ Exit workflow.
124
+
125
+ **If milestone ID not found in graph:**
126
+ ```
127
+ Milestone [M-XX] not found.
128
+
129
+ Use /declare:status to see available milestones.
130
+ ```
131
+ Exit workflow.
132
+
133
+ **If milestone found:** Continue to check_existing.
134
+ </step>
135
+
136
+ <step name="check_existing">
137
+ Check if CONTEXT.md already exists in the milestone directory.
138
+
139
+ ```bash
140
+ ls .planning/milestones/[M-XX]-[slug]/CONTEXT.md 2>/dev/null
141
+ ```
142
+
143
+ **If exists:**
144
+ Use AskUserQuestion:
145
+ - header: "Context"
146
+ - question: "Milestone [M-XX] already has context. What do you want to do?"
147
+ - options:
148
+ - "Update it" — Review and revise existing context
149
+ - "View it" — Show me what's there
150
+ - "Skip" — Use existing context as-is
151
+
152
+ If "Update": Load existing, continue to analyze_milestone
153
+ If "View": Display CONTEXT.md, then offer update/skip
154
+ If "Skip": Exit workflow
155
+
156
+ **If doesn't exist:**
157
+
158
+ Check if action exec plans already exist for this milestone. **If plans exist:**
159
+
160
+ Use AskUserQuestion:
161
+ - header: "Plans exist"
162
+ - question: "Milestone [M-XX] already has action plans created without user context. Your decisions here won't affect existing plans unless you re-derive them."
163
+ - options:
164
+ - "Continue anyway" — Capture context, re-derive actions afterward if needed
165
+ - "View existing plans" — Show plans before deciding
166
+ - "Cancel" — Skip discuss
167
+
168
+ If "Continue anyway": Continue to analyze_milestone.
169
+ If "View existing plans": Display plan files, then offer "Continue" / "Cancel".
170
+ If "Cancel": Exit workflow.
171
+
172
+ **If no plans exist:** Continue to analyze_milestone.
173
+ </step>
174
+
175
+ <step name="analyze_milestone">
176
+ Analyze the milestone to identify gray areas worth discussing.
177
+
178
+ **Read the milestone description from MILESTONES.md and FUTURE.md to understand context, then determine:**
179
+
180
+ 1. **Domain boundary** — What capability is this milestone delivering? State it clearly.
181
+
182
+ 2. **Gray areas** — For each relevant dimension, identify 1-2 specific ambiguities that would change implementation.
183
+
184
+ 3. **Skip assessment** — If no meaningful gray areas exist (pure infrastructure, clear-cut implementation), the milestone may not need discussion.
185
+
186
+ **Output your analysis internally, then present to user.**
187
+
188
+ Example analysis for "Context capture per milestone":
189
+ ```
190
+ Domain: Interactive discussion flow that captures user decisions into CONTEXT.md
191
+ Gray areas:
192
+ - Discussion flow: How gray areas are identified and presented
193
+ - Existing context: What to do when CONTEXT.md already exists
194
+ - Output structure: How decisions are organized in CONTEXT.md
195
+ - Auto-advance: Whether to chain into planning automatically
196
+ ```
197
+ </step>
198
+
199
+ <step name="present_gray_areas">
200
+ Present the domain boundary and gray areas to user.
201
+
202
+ **First, state the boundary:**
203
+ ```
204
+ Milestone [M-XX]: [Name]
205
+ Domain: [What this milestone delivers — from your analysis]
206
+
207
+ We'll clarify HOW to implement this.
208
+ (New capabilities belong in other milestones.)
209
+ ```
210
+
211
+ **Then use AskUserQuestion (multiSelect: true):**
212
+ - header: "Discuss"
213
+ - question: "Which areas do you want to discuss for [milestone name]?"
214
+ - options: Generate 3-4 milestone-specific gray areas, each formatted as:
215
+ - "[Specific area]" (label) — concrete, not generic
216
+ - [1-2 questions this covers] (description)
217
+
218
+ **Do NOT include a "skip" or "you decide" option.** User ran this command to discuss — give them real choices.
219
+
220
+ **Examples by domain:**
221
+
222
+ For "Context capture per milestone" (interactive flow):
223
+ ```
224
+ Discussion flow — How many gray areas to present? In what order?
225
+ Existing context handling — Update, view, or skip if CONTEXT.md exists?
226
+ Output structure — How should decisions be organized in CONTEXT.md?
227
+ Auto-advance — Chain into planning after context is captured?
228
+ ```
229
+
230
+ For "Milestone research pipeline" (background process):
231
+ ```
232
+ Research depth — Shallow scan or deep investigation per topic?
233
+ Output format — Structured markdown, JSON, or free-form notes?
234
+ Staleness policy — When should research be refreshed?
235
+ Source selection — Code-only, web, or both?
236
+ ```
237
+
238
+ For "CLI tooling" (command-line tool):
239
+ ```
240
+ Output format — JSON, table, or plain text? Verbosity levels?
241
+ Flag design — Short flags, long flags, or both? Required vs optional?
242
+ Progress reporting — Silent, progress bar, or verbose logging?
243
+ Error recovery — Fail fast, retry, or prompt for action?
244
+ ```
245
+
246
+ Continue to discuss_areas with selected areas.
247
+ </step>
248
+
249
+ <step name="discuss_areas">
250
+ For each selected area, conduct a focused discussion loop.
251
+
252
+ **Philosophy: 4 questions, then check.**
253
+
254
+ Ask 4 questions per area before offering to continue or move on. Each answer often reveals the next question.
255
+
256
+ **For each area:**
257
+
258
+ 1. **Announce the area:**
259
+ ```
260
+ Let's talk about [Area].
261
+ ```
262
+
263
+ 2. **Ask 4 questions using AskUserQuestion:**
264
+ - header: "[Area]" (max 12 chars — abbreviate if needed)
265
+ - question: Specific decision for this area
266
+ - options: 2-3 concrete choices (AskUserQuestion adds "Other" automatically)
267
+ - Include "You decide" as an option when reasonable — captures Claude discretion
268
+
269
+ 3. **After 4 questions, check:**
270
+ - header: "[Area]" (max 12 chars)
271
+ - question: "More questions about [area], or move to next?"
272
+ - options: "More questions" / "Next area"
273
+
274
+ If "More questions" → ask 4 more, then check again
275
+ If "Next area" → proceed to next selected area
276
+ If "Other" (free text) → interpret intent: continuation phrases ("chat more", "keep going", "yes", "more") map to "More questions"; advancement phrases ("done", "move on", "next", "skip") map to "Next area". If ambiguous, ask: "Continue with more questions about [area], or move to the next area?"
277
+
278
+ 4. **After all areas complete:**
279
+ - header: "Done"
280
+ - question: "That covers [list areas]. Ready to create context?"
281
+ - options: "Create context" / "Revisit an area"
282
+
283
+ **Question design:**
284
+ - Options should be concrete, not abstract ("Cards" not "Option A")
285
+ - Each answer should inform the next question
286
+ - If user picks "Other", receive their input, reflect it back, confirm
287
+
288
+ **Scope creep handling:**
289
+ If user mentions something outside the milestone domain:
290
+ ```
291
+ "[Feature] sounds like a new capability — that belongs in its own milestone.
292
+ I'll note it as a deferred idea.
293
+
294
+ Back to [current area]: [return to current question]"
295
+ ```
296
+
297
+ Track deferred ideas internally.
298
+ </step>
299
+
300
+ <step name="write_context">
301
+ Create CONTEXT.md capturing decisions made.
302
+
303
+ **Find or create milestone directory:**
304
+
305
+ Milestone directories live at: `.planning/milestones/[M-XX]-[slug]/`
306
+
307
+ If the directory doesn't exist:
308
+ ```bash
309
+ mkdir -p ".planning/milestones/[M-XX]-[slug]"
310
+ ```
311
+
312
+ **File location:** `.planning/milestones/[M-XX]-[slug]/CONTEXT.md`
313
+
314
+ **Structure the content by what was discussed:**
315
+
316
+ ```markdown
317
+ # Milestone [M-XX]: [Name] - Context
318
+
319
+ **Gathered:** [date]
320
+ **Status:** Ready for planning
321
+
322
+ <domain>
323
+ ## Milestone Boundary
324
+
325
+ [Clear statement of what this milestone delivers — the scope anchor]
326
+
327
+ </domain>
328
+
329
+ <decisions>
330
+ ## Implementation Decisions
331
+
332
+ ### [Category 1 that was discussed]
333
+ - [Decision or preference captured]
334
+ - [Another decision if applicable]
335
+
336
+ ### [Category 2 that was discussed]
337
+ - [Decision or preference captured]
338
+
339
+ ### Claude's Discretion
340
+ [Areas where user said "you decide" — note that Claude has flexibility here]
341
+
342
+ </decisions>
343
+
344
+ <specifics>
345
+ ## Specific Ideas
346
+
347
+ [Any particular references, examples, or "I want it like X" moments from discussion]
348
+
349
+ [If none: "No specific requirements — open to standard approaches"]
350
+
351
+ </specifics>
352
+
353
+ <deferred>
354
+ ## Deferred Ideas
355
+
356
+ [Ideas that came up but belong in other milestones. Don't lose them.]
357
+
358
+ [If none: "None — discussion stayed within milestone scope"]
359
+
360
+ </deferred>
361
+
362
+ ---
363
+
364
+ *Milestone: [M-XX]-[slug]*
365
+ *Context gathered: [date]*
366
+ ```
367
+
368
+ Write file.
369
+ </step>
370
+
371
+ <step name="confirm_creation">
372
+ Present summary and next steps:
373
+
374
+ ```
375
+ Created: .planning/milestones/[M-XX]-[slug]/CONTEXT.md
376
+
377
+ ## Decisions Captured
378
+
379
+ ### [Category]
380
+ - [Key decision]
381
+
382
+ ### [Category]
383
+ - [Key decision]
384
+
385
+ [If deferred ideas exist:]
386
+ ## Noted for Later
387
+ - [Deferred idea] — future milestone
388
+
389
+ ---
390
+
391
+ ## Next Up
392
+
393
+ **Milestone [M-XX]: [Name]** — [Goal from MILESTONES.md]
394
+
395
+ `/declare:execute M-XX`
396
+
397
+ ---
398
+
399
+ **Also available:**
400
+ - Review/edit CONTEXT.md before continuing
401
+ - `/declare:status` — see full milestone graph
402
+
403
+ ---
404
+ ```
405
+ </step>
406
+
407
+ <step name="git_commit">
408
+ Commit the milestone context:
409
+
410
+ ```bash
411
+ node dist/declare-tools.cjs commit "docs(M-XX): capture milestone context" --files ".planning/milestones/[M-XX]-[slug]/CONTEXT.md"
412
+ ```
413
+
414
+ Confirm: "Committed: docs(M-XX): capture milestone context"
415
+ </step>
416
+
417
+ <step name="auto_advance">
418
+ Check for auto-advance trigger:
419
+
420
+ 1. Parse `--auto` flag from $ARGUMENTS
421
+ 2. Read `workflow.auto_advance` from config:
422
+ ```bash
423
+ node dist/declare-tools.cjs config-get workflow.auto_advance 2>/dev/null || echo "false"
424
+ ```
425
+
426
+ **If `--auto` flag present AND config not already true:** Persist to config:
427
+ ```bash
428
+ node dist/declare-tools.cjs config-set workflow.auto_advance true
429
+ ```
430
+
431
+ **If `--auto` flag present OR config is true:**
432
+
433
+ Display banner:
434
+ ```
435
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
436
+ DECLARE ► AUTO-ADVANCING TO PLANNING
437
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
438
+
439
+ Context captured. Proceeding to milestone execution...
440
+ ```
441
+
442
+ Spawn execution as Task:
443
+ ```
444
+ Task(
445
+ prompt="Run /declare:execute [M-XX] --auto",
446
+ subagent_type="general-purpose",
447
+ description="Execute Milestone [M-XX]"
448
+ )
449
+ ```
450
+
451
+ **Handle execution return:**
452
+ - **COMPLETE** → Done
453
+ - **CHECKPOINT / needs input** → Display result, stop chain:
454
+ ```
455
+ Auto-advance stopped: Execution needs input.
456
+
457
+ Review the output above and continue manually:
458
+ /declare:execute [M-XX]
459
+ ```
460
+
461
+ **If neither `--auto` nor config enabled:**
462
+ Route to `confirm_creation` step (show manual next steps).
463
+ </step>
464
+
465
+ </process>
466
+
467
+ <success_criteria>
468
+ - Milestone validated against graph
469
+ - Gray areas identified through intelligent analysis (not generic questions)
470
+ - User selected which areas to discuss
471
+ - Each selected area explored until user satisfied
472
+ - Scope creep redirected to deferred ideas
473
+ - CONTEXT.md captures actual decisions, not vague vision
474
+ - Deferred ideas preserved for future milestones
475
+ - User knows next steps
476
+ </success_criteria>