@mobiman/vector 1.1.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 (225) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -0
  3. package/agents/vector-codebase-mapper.md +770 -0
  4. package/agents/vector-debugger.md +1338 -0
  5. package/agents/vector-executor.md +487 -0
  6. package/agents/vector-integration-checker.md +443 -0
  7. package/agents/vector-nyquist-auditor.md +176 -0
  8. package/agents/vector-phase-researcher.md +553 -0
  9. package/agents/vector-plan-checker.md +706 -0
  10. package/agents/vector-planner.md +1307 -0
  11. package/agents/vector-project-researcher.md +629 -0
  12. package/agents/vector-research-synthesizer.md +247 -0
  13. package/agents/vector-roadmapper.md +650 -0
  14. package/agents/vector-ui-auditor.md +439 -0
  15. package/agents/vector-ui-checker.md +300 -0
  16. package/agents/vector-ui-researcher.md +353 -0
  17. package/agents/vector-verifier.md +579 -0
  18. package/bin/install.cjs +2907 -0
  19. package/bin/install.cjs.map +1 -0
  20. package/bin/install.cts +3103 -0
  21. package/bin/install.d.cts +3 -0
  22. package/bin/install.d.cts.map +1 -0
  23. package/commands/vector/add-phase.md +43 -0
  24. package/commands/vector/add-tests.md +41 -0
  25. package/commands/vector/add-todo.md +47 -0
  26. package/commands/vector/audit-milestone.md +36 -0
  27. package/commands/vector/autonomous.md +41 -0
  28. package/commands/vector/check-todos.md +45 -0
  29. package/commands/vector/cleanup.md +18 -0
  30. package/commands/vector/complete-milestone.md +136 -0
  31. package/commands/vector/debug.md +168 -0
  32. package/commands/vector/discuss-phase.md +90 -0
  33. package/commands/vector/do.md +30 -0
  34. package/commands/vector/execute-phase.md +41 -0
  35. package/commands/vector/health.md +22 -0
  36. package/commands/vector/help.md +22 -0
  37. package/commands/vector/insert-phase.md +32 -0
  38. package/commands/vector/join-discord.md +18 -0
  39. package/commands/vector/list-phase-assumptions.md +46 -0
  40. package/commands/vector/map-codebase.md +71 -0
  41. package/commands/vector/new-milestone.md +44 -0
  42. package/commands/vector/new-project.md +42 -0
  43. package/commands/vector/pause-work.md +38 -0
  44. package/commands/vector/plan-milestone-gaps.md +34 -0
  45. package/commands/vector/plan-phase.md +45 -0
  46. package/commands/vector/progress.md +24 -0
  47. package/commands/vector/quick.md +47 -0
  48. package/commands/vector/reapply-patches.md +123 -0
  49. package/commands/vector/remove-phase.md +31 -0
  50. package/commands/vector/research-phase.md +190 -0
  51. package/commands/vector/resume-work.md +40 -0
  52. package/commands/vector/set-profile.md +12 -0
  53. package/commands/vector/settings.md +36 -0
  54. package/commands/vector/stats.md +18 -0
  55. package/commands/vector/ui-phase.md +34 -0
  56. package/commands/vector/ui-review.md +32 -0
  57. package/commands/vector/update.md +37 -0
  58. package/commands/vector/validate-phase.md +35 -0
  59. package/commands/vector/verify-work.md +38 -0
  60. package/core/bin/lib/commands.cjs +641 -0
  61. package/core/bin/lib/commands.cjs.map +1 -0
  62. package/core/bin/lib/commands.cts +712 -0
  63. package/core/bin/lib/commands.d.cts +23 -0
  64. package/core/bin/lib/commands.d.cts.map +1 -0
  65. package/core/bin/lib/config.cjs +281 -0
  66. package/core/bin/lib/config.cjs.map +1 -0
  67. package/core/bin/lib/config.cts +301 -0
  68. package/core/bin/lib/config.d.cts +50 -0
  69. package/core/bin/lib/config.d.cts.map +1 -0
  70. package/core/bin/lib/core.cjs +483 -0
  71. package/core/bin/lib/core.cjs.map +1 -0
  72. package/core/bin/lib/core.cts +544 -0
  73. package/core/bin/lib/core.d.cts +96 -0
  74. package/core/bin/lib/core.d.cts.map +1 -0
  75. package/core/bin/lib/frontmatter.cjs +341 -0
  76. package/core/bin/lib/frontmatter.cjs.map +1 -0
  77. package/core/bin/lib/frontmatter.cts +295 -0
  78. package/core/bin/lib/frontmatter.d.cts +18 -0
  79. package/core/bin/lib/frontmatter.d.cts.map +1 -0
  80. package/core/bin/lib/init.cjs +674 -0
  81. package/core/bin/lib/init.cjs.map +1 -0
  82. package/core/bin/lib/init.cts +775 -0
  83. package/core/bin/lib/init.d.cts +16 -0
  84. package/core/bin/lib/init.d.cts.map +1 -0
  85. package/core/bin/lib/milestone.cjs +210 -0
  86. package/core/bin/lib/milestone.cjs.map +1 -0
  87. package/core/bin/lib/milestone.cts +241 -0
  88. package/core/bin/lib/milestone.d.cts +11 -0
  89. package/core/bin/lib/milestone.d.cts.map +1 -0
  90. package/core/bin/lib/model-profiles.cjs +62 -0
  91. package/core/bin/lib/model-profiles.cjs.map +1 -0
  92. package/core/bin/lib/model-profiles.cts +66 -0
  93. package/core/bin/lib/model-profiles.d.cts +33 -0
  94. package/core/bin/lib/model-profiles.d.cts.map +1 -0
  95. package/core/bin/lib/phase.cjs +713 -0
  96. package/core/bin/lib/phase.cjs.map +1 -0
  97. package/core/bin/lib/phase.cts +914 -0
  98. package/core/bin/lib/phase.d.cts +21 -0
  99. package/core/bin/lib/phase.d.cts.map +1 -0
  100. package/core/bin/lib/roadmap.cjs +246 -0
  101. package/core/bin/lib/roadmap.cjs.map +1 -0
  102. package/core/bin/lib/roadmap.cts +311 -0
  103. package/core/bin/lib/roadmap.d.cts +7 -0
  104. package/core/bin/lib/roadmap.d.cts.map +1 -0
  105. package/core/bin/lib/state.cjs +709 -0
  106. package/core/bin/lib/state.cjs.map +1 -0
  107. package/core/bin/lib/state.cts +718 -0
  108. package/core/bin/lib/state.d.cts +47 -0
  109. package/core/bin/lib/state.d.cts.map +1 -0
  110. package/core/bin/lib/template.cjs +220 -0
  111. package/core/bin/lib/template.cjs.map +1 -0
  112. package/core/bin/lib/template.cts +229 -0
  113. package/core/bin/lib/template.d.cts +15 -0
  114. package/core/bin/lib/template.d.cts.map +1 -0
  115. package/core/bin/lib/verify.cjs +824 -0
  116. package/core/bin/lib/verify.cjs.map +1 -0
  117. package/core/bin/lib/verify.cts +829 -0
  118. package/core/bin/lib/verify.d.cts +17 -0
  119. package/core/bin/lib/verify.d.cts.map +1 -0
  120. package/core/bin/vector-tools.cjs +641 -0
  121. package/core/bin/vector-tools.cjs.map +1 -0
  122. package/core/bin/vector-tools.cts +603 -0
  123. package/core/bin/vector-tools.d.cts +128 -0
  124. package/core/bin/vector-tools.d.cts.map +1 -0
  125. package/core/references/checkpoints.md +776 -0
  126. package/core/references/continuation-format.md +249 -0
  127. package/core/references/decimal-phase-calculation.md +65 -0
  128. package/core/references/git-integration.md +248 -0
  129. package/core/references/git-planning-commit.md +38 -0
  130. package/core/references/model-profile-resolution.md +36 -0
  131. package/core/references/model-profiles.md +101 -0
  132. package/core/references/phase-argument-parsing.md +61 -0
  133. package/core/references/planning-config.md +200 -0
  134. package/core/references/questioning.md +162 -0
  135. package/core/references/tdd.md +263 -0
  136. package/core/references/ui-brand.md +160 -0
  137. package/core/references/verification-patterns.md +612 -0
  138. package/core/templates/DEBUG.md +164 -0
  139. package/core/templates/UAT.md +247 -0
  140. package/core/templates/UI-SPEC.md +100 -0
  141. package/core/templates/VALIDATION.md +76 -0
  142. package/core/templates/codebase/architecture.md +255 -0
  143. package/core/templates/codebase/concerns.md +310 -0
  144. package/core/templates/codebase/conventions.md +307 -0
  145. package/core/templates/codebase/integrations.md +280 -0
  146. package/core/templates/codebase/stack.md +186 -0
  147. package/core/templates/codebase/structure.md +285 -0
  148. package/core/templates/codebase/testing.md +480 -0
  149. package/core/templates/config.json +37 -0
  150. package/core/templates/context.md +352 -0
  151. package/core/templates/continue-here.md +78 -0
  152. package/core/templates/copilot-instructions.md +7 -0
  153. package/core/templates/debug-subagent-prompt.md +91 -0
  154. package/core/templates/discovery.md +146 -0
  155. package/core/templates/milestone-archive.md +123 -0
  156. package/core/templates/milestone.md +115 -0
  157. package/core/templates/phase-prompt.md +610 -0
  158. package/core/templates/planner-subagent-prompt.md +117 -0
  159. package/core/templates/project.md +184 -0
  160. package/core/templates/requirements.md +231 -0
  161. package/core/templates/research-project/ARCHITECTURE.md +204 -0
  162. package/core/templates/research-project/FEATURES.md +147 -0
  163. package/core/templates/research-project/PITFALLS.md +200 -0
  164. package/core/templates/research-project/STACK.md +120 -0
  165. package/core/templates/research-project/SUMMARY.md +170 -0
  166. package/core/templates/research.md +552 -0
  167. package/core/templates/retrospective.md +54 -0
  168. package/core/templates/roadmap.md +202 -0
  169. package/core/templates/state.md +176 -0
  170. package/core/templates/summary-complex.md +59 -0
  171. package/core/templates/summary-minimal.md +41 -0
  172. package/core/templates/summary-standard.md +48 -0
  173. package/core/templates/summary.md +248 -0
  174. package/core/templates/user-setup.md +311 -0
  175. package/core/templates/verification-report.md +322 -0
  176. package/core/workflows/add-phase.md +112 -0
  177. package/core/workflows/add-tests.md +351 -0
  178. package/core/workflows/add-todo.md +158 -0
  179. package/core/workflows/audit-milestone.md +332 -0
  180. package/core/workflows/autonomous.md +743 -0
  181. package/core/workflows/check-todos.md +177 -0
  182. package/core/workflows/cleanup.md +152 -0
  183. package/core/workflows/complete-milestone.md +766 -0
  184. package/core/workflows/diagnose-issues.md +219 -0
  185. package/core/workflows/discovery-phase.md +289 -0
  186. package/core/workflows/discuss-phase.md +762 -0
  187. package/core/workflows/do.md +104 -0
  188. package/core/workflows/execute-phase.md +468 -0
  189. package/core/workflows/execute-plan.md +483 -0
  190. package/core/workflows/health.md +159 -0
  191. package/core/workflows/help.md +513 -0
  192. package/core/workflows/insert-phase.md +130 -0
  193. package/core/workflows/list-phase-assumptions.md +178 -0
  194. package/core/workflows/map-codebase.md +316 -0
  195. package/core/workflows/new-milestone.md +386 -0
  196. package/core/workflows/new-project.md +1113 -0
  197. package/core/workflows/node-repair.md +92 -0
  198. package/core/workflows/pause-work.md +122 -0
  199. package/core/workflows/plan-milestone-gaps.md +274 -0
  200. package/core/workflows/plan-phase.md +666 -0
  201. package/core/workflows/progress.md +382 -0
  202. package/core/workflows/quick.md +717 -0
  203. package/core/workflows/remove-phase.md +155 -0
  204. package/core/workflows/research-phase.md +74 -0
  205. package/core/workflows/resume-project.md +307 -0
  206. package/core/workflows/settings.md +243 -0
  207. package/core/workflows/stats.md +60 -0
  208. package/core/workflows/transition.md +544 -0
  209. package/core/workflows/ui-phase.md +290 -0
  210. package/core/workflows/ui-review.md +157 -0
  211. package/core/workflows/update.md +320 -0
  212. package/core/workflows/validate-phase.md +167 -0
  213. package/core/workflows/verify-phase.md +243 -0
  214. package/core/workflows/verify-work.md +584 -0
  215. package/package.json +55 -0
  216. package/scripts/build-hooks.cjs +38 -0
  217. package/scripts/build-hooks.cjs.map +1 -0
  218. package/scripts/build-hooks.cts +41 -0
  219. package/scripts/build-hooks.d.cts +6 -0
  220. package/scripts/build-hooks.d.cts.map +1 -0
  221. package/scripts/run-tests.cjs +28 -0
  222. package/scripts/run-tests.cjs.map +1 -0
  223. package/scripts/run-tests.cts +28 -0
  224. package/scripts/run-tests.d.cts +3 -0
  225. package/scripts/run-tests.d.cts.map +1 -0
@@ -0,0 +1,666 @@
1
+ <purpose>
2
+ Create executable phase prompts (PLAN.md files) for a roadmap phase with integrated research and verification. Default flow: Research (if needed) -> Plan -> Verify -> Done. Orchestrates vector-phase-researcher, vector-planner, and vector-plan-checker agents with a revision loop (max 3 iterations).
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read all files referenced by the invoking prompt's execution_context before starting.
7
+
8
+ @~/.claude/core/references/ui-brand.md
9
+ </required_reading>
10
+
11
+ <process>
12
+
13
+ ## 1. Initialize
14
+
15
+ Load all context in one call (paths only to minimize orchestrator context):
16
+
17
+ ```bash
18
+ INIT=$(node "$HOME/.claude/core/bin/vector-tools.cjs" init plan-phase "$PHASE")
19
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
20
+ ```
21
+
22
+ Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `nyquist_validation_enabled`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`, `phase_req_ids`.
23
+
24
+ **File paths (for <files_to_read> blocks):** `state_path`, `roadmap_path`, `requirements_path`, `context_path`, `research_path`, `verification_path`, `uat_path`. These are null if files don't exist.
25
+
26
+ **If `planning_exists` is false:** Error — run `/vector:new-project` first.
27
+
28
+ ## 2. Parse and Normalize Arguments
29
+
30
+ Extract from $ARGUMENTS: phase number (integer or decimal like `2.1`), flags (`--research`, `--skip-research`, `--gaps`, `--skip-verify`, `--prd <filepath>`).
31
+
32
+ Extract `--prd <filepath>` from $ARGUMENTS. If present, set PRD_FILE to the filepath.
33
+
34
+ **If no phase number:** Detect next unplanned phase from roadmap.
35
+
36
+ **If `phase_found` is false:** Validate phase exists in ROADMAP.md. If valid, create the directory using `phase_slug` and `padded_phase` from init:
37
+ ```bash
38
+ mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"
39
+ ```
40
+
41
+ **Existing artifacts from init:** `has_research`, `has_plans`, `plan_count`.
42
+
43
+ ## 3. Validate Phase
44
+
45
+ ```bash
46
+ PHASE_INFO=$(node "$HOME/.claude/core/bin/vector-tools.cjs" roadmap get-phase "${PHASE}")
47
+ ```
48
+
49
+ **If `found` is false:** Error with available phases. **If `found` is true:** Extract `phase_number`, `phase_name`, `goal` from JSON.
50
+
51
+ ## 3.5. Handle PRD Express Path
52
+
53
+ **Skip if:** No `--prd` flag in arguments.
54
+
55
+ **If `--prd <filepath>` provided:**
56
+
57
+ 1. Read the PRD file:
58
+ ```bash
59
+ PRD_CONTENT=$(cat "$PRD_FILE" 2>/dev/null)
60
+ if [ -z "$PRD_CONTENT" ]; then
61
+ echo "Error: PRD file not found: $PRD_FILE"
62
+ exit 1
63
+ fi
64
+ ```
65
+
66
+ 2. Display banner:
67
+ ```
68
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
69
+ Vector ► PRD EXPRESS PATH
70
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
71
+
72
+ Using PRD: {PRD_FILE}
73
+ Generating CONTEXT.md from requirements...
74
+ ```
75
+
76
+ 3. Parse the PRD content and generate CONTEXT.md. The orchestrator should:
77
+ - Extract all requirements, user stories, acceptance criteria, and constraints from the PRD
78
+ - Map each to a locked decision (everything in the PRD is treated as a locked decision)
79
+ - Identify any areas the PRD doesn't cover and mark as "Claude's Discretion"
80
+ - **Extract canonical refs** from ROADMAP.md for this phase, plus any specs/ADRs referenced in the PRD — expand to full file paths (MANDATORY)
81
+ - Create CONTEXT.md in the phase directory
82
+
83
+ 4. Write CONTEXT.md:
84
+ ```markdown
85
+ # Phase [X]: [Name] - Context
86
+
87
+ **Gathered:** [date]
88
+ **Status:** Ready for planning
89
+ **Source:** PRD Express Path ({PRD_FILE})
90
+
91
+ <domain>
92
+ ## Phase Boundary
93
+
94
+ [Extracted from PRD — what this phase delivers]
95
+
96
+ </domain>
97
+
98
+ <decisions>
99
+ ## Implementation Decisions
100
+
101
+ {For each requirement/story/criterion in the PRD:}
102
+ ### [Category derived from content]
103
+ - [Requirement as locked decision]
104
+
105
+ ### Claude's Discretion
106
+ [Areas not covered by PRD — implementation details, technical choices]
107
+
108
+ </decisions>
109
+
110
+ <canonical_refs>
111
+ ## Canonical References
112
+
113
+ **Downstream agents MUST read these before planning or implementing.**
114
+
115
+ [MANDATORY. Extract from ROADMAP.md and any docs referenced in the PRD.
116
+ Use full relative paths. Group by topic area.]
117
+
118
+ ### [Topic area]
119
+ - `path/to/spec-or-adr.md` — [What it decides/defines]
120
+
121
+ [If no external specs: "No external specs — requirements fully captured in decisions above"]
122
+
123
+ </canonical_refs>
124
+
125
+ <specifics>
126
+ ## Specific Ideas
127
+
128
+ [Any specific references, examples, or concrete requirements from PRD]
129
+
130
+ </specifics>
131
+
132
+ <deferred>
133
+ ## Deferred Ideas
134
+
135
+ [Items in PRD explicitly marked as future/v2/out-of-scope]
136
+ [If none: "None — PRD covers phase scope"]
137
+
138
+ </deferred>
139
+
140
+ ---
141
+
142
+ *Phase: XX-name*
143
+ *Context gathered: [date] via PRD Express Path*
144
+ ```
145
+
146
+ 5. Commit:
147
+ ```bash
148
+ node "$HOME/.claude/core/bin/vector-tools.cjs" commit "docs(${padded_phase}): generate context from PRD" --files "${phase_dir}/${padded_phase}-CONTEXT.md"
149
+ ```
150
+
151
+ 6. Set `context_content` to the generated CONTEXT.md content and continue to step 5 (Handle Research).
152
+
153
+ **Effect:** This completely bypasses step 4 (Load CONTEXT.md) since we just created it. The rest of the workflow (research, planning, verification) proceeds normally with the PRD-derived context.
154
+
155
+ ## 4. Load CONTEXT.md
156
+
157
+ **Skip if:** PRD express path was used (CONTEXT.md already created in step 3.5).
158
+
159
+ Check `context_path` from init JSON.
160
+
161
+ If `context_path` is not null, display: `Using phase context from: ${context_path}`
162
+
163
+ **If `context_path` is null (no CONTEXT.md exists):**
164
+
165
+ Use AskUserQuestion:
166
+ - header: "No context"
167
+ - question: "No CONTEXT.md found for Phase {X}. Plans will use research and requirements only — your design preferences won't be included. Continue or capture context first?"
168
+ - options:
169
+ - "Continue without context" — Plan using research + requirements only
170
+ - "Run discuss-phase first" — Capture design decisions before planning
171
+
172
+ If "Continue without context": Proceed to step 5.
173
+ If "Run discuss-phase first": Display `/vector:discuss-phase {X}` and exit workflow.
174
+
175
+ ## 5. Handle Research
176
+
177
+ **Skip if:** `--gaps` flag, `--skip-research` flag, or `research_enabled` is false (from init) without `--research` override.
178
+
179
+ **If `has_research` is true (from init) AND no `--research` flag:** Use existing, skip to step 6.
180
+
181
+ **If RESEARCH.md missing OR `--research` flag:**
182
+
183
+ Display banner:
184
+ ```
185
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
186
+ Vector ► RESEARCHING PHASE {X}
187
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
188
+
189
+ ◆ Spawning researcher...
190
+ ```
191
+
192
+ ### Spawn vector-phase-researcher
193
+
194
+ ```bash
195
+ PHASE_DESC=$(node "$HOME/.claude/core/bin/vector-tools.cjs" roadmap get-phase "${PHASE}" | jq -r '.section')
196
+ ```
197
+
198
+ Research prompt:
199
+
200
+ ```markdown
201
+ <objective>
202
+ Research how to implement Phase {phase_number}: {phase_name}
203
+ Answer: "What do I need to know to PLAN this phase well?"
204
+ </objective>
205
+
206
+ <files_to_read>
207
+ - {context_path} (USER DECISIONS from /vector:discuss-phase)
208
+ - {requirements_path} (Project requirements)
209
+ - {state_path} (Project decisions and history)
210
+ </files_to_read>
211
+
212
+ <additional_context>
213
+ **Phase description:** {phase_description}
214
+ **Phase requirement IDs (MUST address):** {phase_req_ids}
215
+
216
+ **Project instructions:** Read ./CLAUDE.md if exists — follow project-specific guidelines
217
+ **Project skills:** Check .claude/skills/ or .agents/skills/ directory (if either exists) — read SKILL.md files, research should account for project skill patterns
218
+ </additional_context>
219
+
220
+ <output>
221
+ Write to: {phase_dir}/{phase_num}-RESEARCH.md
222
+ </output>
223
+ ```
224
+
225
+ ```
226
+ Task(
227
+ prompt=research_prompt,
228
+ subagent_type="vector-phase-researcher",
229
+ model="{researcher_model}",
230
+ description="Research Phase {phase}"
231
+ )
232
+ ```
233
+
234
+ ### Handle Researcher Return
235
+
236
+ - **`## RESEARCH COMPLETE`:** Display confirmation, continue to step 6
237
+ - **`## RESEARCH BLOCKED`:** Display blocker, offer: 1) Provide context, 2) Skip research, 3) Abort
238
+
239
+ ## 5.5. Create Validation Strategy
240
+
241
+ Skip if `nyquist_validation_enabled` is false OR `research_enabled` is false.
242
+
243
+ If `research_enabled` is false and `nyquist_validation_enabled` is true: warn "Nyquist validation enabled but research disabled — VALIDATION.md cannot be created without RESEARCH.md. Plans will lack validation requirements (Dimension 8)." Continue to step 6.
244
+
245
+ **But Nyquist is not applicable for this run** when all of the following are true:
246
+ - `research_enabled` is false
247
+ - `has_research` is false
248
+ - no `--research` flag was provided
249
+
250
+ In that case: **skip validation-strategy creation entirely**. Do **not** expect `RESEARCH.md` or `VALIDATION.md` for this run, and continue to Step 6.
251
+
252
+ ```bash
253
+ grep -l "## Validation Architecture" "${PHASE_DIR}"/*-RESEARCH.md 2>/dev/null
254
+ ```
255
+
256
+ **If found:**
257
+ 1. Read template: `~/.claude/core/templates/VALIDATION.md`
258
+ 2. Write to `${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md` (use Write tool)
259
+ 3. Fill frontmatter: `{N}` → phase number, `{phase-slug}` → slug, `{date}` → current date
260
+ 4. Verify:
261
+ ```bash
262
+ test -f "${PHASE_DIR}/${PADDED_PHASE}-VALIDATION.md" && echo "VALIDATION_CREATED=true" || echo "VALIDATION_CREATED=false"
263
+ ```
264
+ 5. If `VALIDATION_CREATED=false`: STOP — do not proceed to Step 6
265
+ 6. If `commit_docs`: `commit "docs(phase-${PHASE}): add validation strategy"`
266
+
267
+ **If not found:** Warn and continue — plans may fail Dimension 8.
268
+
269
+ ## 5.6. UI Design Contract Gate
270
+
271
+ > Skip if `workflow.ui_phase` is explicitly `false` AND `workflow.ui_safety_gate` is explicitly `false` in `.planning/config.json`. If keys are absent, treat as enabled.
272
+
273
+ ```bash
274
+ UI_PHASE_CFG=$(node "$HOME/.claude/core/bin/vector-tools.cjs" config-get workflow.ui_phase 2>/dev/null || echo "true")
275
+ UI_GATE_CFG=$(node "$HOME/.claude/core/bin/vector-tools.cjs" config-get workflow.ui_safety_gate 2>/dev/null || echo "true")
276
+ ```
277
+
278
+ **If both are `false`:** Skip to step 6.
279
+
280
+ Check if phase has frontend indicators:
281
+
282
+ ```bash
283
+ PHASE_SECTION=$(node "$HOME/.claude/core/bin/vector-tools.cjs" roadmap get-phase "${PHASE}" 2>/dev/null)
284
+ echo "$PHASE_SECTION" | grep -iE "UI|interface|frontend|component|layout|page|screen|view|form|dashboard|widget" > /dev/null 2>&1
285
+ HAS_UI=$?
286
+ ```
287
+
288
+ **If `HAS_UI` is 0 (frontend indicators found):**
289
+
290
+ Check for existing UI-SPEC:
291
+ ```bash
292
+ UI_SPEC_FILE=$(ls "${PHASE_DIR}"/*-UI-SPEC.md 2>/dev/null | head -1)
293
+ ```
294
+
295
+ **If UI-SPEC.md found:** Set `UI_SPEC_PATH=$UI_SPEC_FILE`. Display: `Using UI design contract: ${UI_SPEC_PATH}`
296
+
297
+ **If UI-SPEC.md missing AND `UI_GATE_CFG` is `true`:**
298
+
299
+ Use AskUserQuestion:
300
+ - header: "UI Design Contract"
301
+ - question: "Phase {N} has frontend indicators but no UI-SPEC.md. Generate a design contract before planning?"
302
+ - options:
303
+ - "Generate UI-SPEC first" → Display: "Run `/vector:ui-phase {N}` then re-run `/vector:plan-phase {N}`". Exit workflow.
304
+ - "Continue without UI-SPEC" → Continue to step 6.
305
+ - "Not a frontend phase" → Continue to step 6.
306
+
307
+ **If `HAS_UI` is 1 (no frontend indicators):** Skip silently to step 6.
308
+
309
+ ## 6. Check Existing Plans
310
+
311
+ ```bash
312
+ ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null
313
+ ```
314
+
315
+ **If exists:** Offer: 1) Add more plans, 2) View existing, 3) Replan from scratch.
316
+
317
+ ## 7. Use Context Paths from INIT
318
+
319
+ Extract from INIT JSON:
320
+
321
+ ```bash
322
+ STATE_PATH=$(printf '%s\n' "$INIT" | jq -r '.state_path // empty')
323
+ ROADMAP_PATH=$(printf '%s\n' "$INIT" | jq -r '.roadmap_path // empty')
324
+ REQUIREMENTS_PATH=$(printf '%s\n' "$INIT" | jq -r '.requirements_path // empty')
325
+ RESEARCH_PATH=$(printf '%s\n' "$INIT" | jq -r '.research_path // empty')
326
+ VERIFICATION_PATH=$(printf '%s\n' "$INIT" | jq -r '.verification_path // empty')
327
+ UAT_PATH=$(printf '%s\n' "$INIT" | jq -r '.uat_path // empty')
328
+ CONTEXT_PATH=$(printf '%s\n' "$INIT" | jq -r '.context_path // empty')
329
+ ```
330
+
331
+ ## 7.5. Verify Nyquist Artifacts
332
+
333
+ Skip if `nyquist_validation_enabled` is false OR `research_enabled` is false.
334
+
335
+ Also skip if all of the following are true:
336
+ - `research_enabled` is false
337
+ - `has_research` is false
338
+ - no `--research` flag was provided
339
+
340
+ In that no-research path, Nyquist artifacts are **not required** for this run.
341
+
342
+ ```bash
343
+ VALIDATION_EXISTS=$(ls "${PHASE_DIR}"/*-VALIDATION.md 2>/dev/null | head -1)
344
+ ```
345
+
346
+ If missing and Nyquist is still enabled/applicable — ask user:
347
+ 1. Re-run: `/vector:plan-phase {PHASE} --research`
348
+ 2. Disable Nyquist with the exact command:
349
+ `node "$HOME/.claude/core/bin/vector-tools.cjs" config-set workflow.nyquist_validation false`
350
+ 3. Continue anyway (plans fail Dimension 8)
351
+
352
+ Proceed to Step 8 only if user selects 2 or 3.
353
+
354
+ ## 8. Spawn vector-planner Agent
355
+
356
+ Display banner:
357
+ ```
358
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
359
+ Vector ► PLANNING PHASE {X}
360
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
361
+
362
+ ◆ Spawning planner...
363
+ ```
364
+
365
+ Planner prompt:
366
+
367
+ ```markdown
368
+ <planning_context>
369
+ **Phase:** {phase_number}
370
+ **Mode:** {standard | gap_closure}
371
+
372
+ <files_to_read>
373
+ - {state_path} (Project State)
374
+ - {roadmap_path} (Roadmap)
375
+ - {requirements_path} (Requirements)
376
+ - {context_path} (USER DECISIONS from /vector:discuss-phase)
377
+ - {research_path} (Technical Research)
378
+ - {verification_path} (Verification Gaps - if --gaps)
379
+ - {uat_path} (UAT Gaps - if --gaps)
380
+ - {UI_SPEC_PATH} (UI Design Contract — visual/interaction specs, if exists)
381
+ </files_to_read>
382
+
383
+ **Phase requirement IDs (every ID MUST appear in a plan's `requirements` field):** {phase_req_ids}
384
+
385
+ **Project instructions:** Read ./CLAUDE.md if exists — follow project-specific guidelines
386
+ **Project skills:** Check .claude/skills/ or .agents/skills/ directory (if either exists) — read SKILL.md files, plans should account for project skill rules
387
+ </planning_context>
388
+
389
+ <downstream_consumer>
390
+ Output consumed by /vector:execute-phase. Plans need:
391
+ - Frontmatter (wave, depends_on, files_modified, autonomous)
392
+ - Tasks in XML format with read_first and acceptance_criteria fields (MANDATORY on every task)
393
+ - Verification criteria
394
+ - must_haves for goal-backward verification
395
+ </downstream_consumer>
396
+
397
+ <deep_work_rules>
398
+ ## Anti-Shallow Execution Rules (MANDATORY)
399
+
400
+ Every task MUST include these fields — they are NOT optional:
401
+
402
+ 1. **`<read_first>`** — Files the executor MUST read before touching anything. Always include:
403
+ - The file being modified (so executor sees current state, not assumptions)
404
+ - Any "source of truth" file referenced in CONTEXT.md (reference implementations, existing patterns, config files, schemas)
405
+ - Any file whose patterns, signatures, types, or conventions must be replicated or respected
406
+
407
+ 2. **`<acceptance_criteria>`** — Verifiable conditions that prove the task was done correctly. Rules:
408
+ - Every criterion must be checkable with grep, file read, test command, or CLI output
409
+ - NEVER use subjective language ("looks correct", "properly configured", "consistent with")
410
+ - ALWAYS include exact strings, patterns, values, or command outputs that must be present
411
+ - Examples:
412
+ - Code: `auth.py contains def verify_token(` / `test_auth.py exits 0`
413
+ - Config: `.env.example contains DATABASE_URL=` / `Dockerfile contains HEALTHCHECK`
414
+ - Docs: `README.md contains '## Installation'` / `API.md lists all endpoints`
415
+ - Infra: `deploy.yml has rollback step` / `docker-compose.yml has healthcheck for db`
416
+
417
+ 3. **`<action>`** — Must include CONCRETE values, not references. Rules:
418
+ - NEVER say "align X with Y", "match X to Y", "update to be consistent" without specifying the exact target state
419
+ - ALWAYS include the actual values: config keys, function signatures, SQL statements, class names, import paths, env vars, etc.
420
+ - If CONTEXT.md has a comparison table or expected values, copy them into the action verbatim
421
+ - The executor should be able to complete the task from the action text alone, without needing to read CONTEXT.md or reference files (read_first is for verification, not discovery)
422
+
423
+ **Why this matters:** Executor agents work from the plan text. Vague instructions like "update the config to match production" produce shallow one-line changes. Concrete instructions like "add DATABASE_URL=postgresql://... , set POOL_SIZE=20, add REDIS_URL=redis://..." produce complete work. The cost of verbose plans is far less than the cost of re-doing shallow execution.
424
+ </deep_work_rules>
425
+
426
+ <quality_gate>
427
+ - [ ] PLAN.md files created in phase directory
428
+ - [ ] Each plan has valid frontmatter
429
+ - [ ] Tasks are specific and actionable
430
+ - [ ] Every task has `<read_first>` with at least the file being modified
431
+ - [ ] Every task has `<acceptance_criteria>` with grep-verifiable conditions
432
+ - [ ] Every `<action>` contains concrete values (no "align X with Y" without specifying what)
433
+ - [ ] Dependencies correctly identified
434
+ - [ ] Waves assigned for parallel execution
435
+ - [ ] must_haves derived from phase goal
436
+ </quality_gate>
437
+ ```
438
+
439
+ ```
440
+ Task(
441
+ prompt=filled_prompt,
442
+ subagent_type="vector-planner",
443
+ model="{planner_model}",
444
+ description="Plan Phase {phase}"
445
+ )
446
+ ```
447
+
448
+ ## 9. Handle Planner Return
449
+
450
+ - **`## PLANNING COMPLETE`:** Display plan count. If `--skip-verify` or `plan_checker_enabled` is false (from init): skip to step 13. Otherwise: step 10.
451
+ - **`## CHECKPOINT REACHED`:** Present to user, get response, spawn continuation (step 12)
452
+ - **`## PLANNING INCONCLUSIVE`:** Show attempts, offer: Add context / Retry / Manual
453
+
454
+ ## 10. Spawn vector-plan-checker Agent
455
+
456
+ Display banner:
457
+ ```
458
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
459
+ Vector ► VERIFYING PLANS
460
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
461
+
462
+ ◆ Spawning plan checker...
463
+ ```
464
+
465
+ Checker prompt:
466
+
467
+ ```markdown
468
+ <verification_context>
469
+ **Phase:** {phase_number}
470
+ **Phase Goal:** {goal from ROADMAP}
471
+
472
+ <files_to_read>
473
+ - {PHASE_DIR}/*-PLAN.md (Plans to verify)
474
+ - {roadmap_path} (Roadmap)
475
+ - {requirements_path} (Requirements)
476
+ - {context_path} (USER DECISIONS from /vector:discuss-phase)
477
+ - {research_path} (Technical Research — includes Validation Architecture)
478
+ </files_to_read>
479
+
480
+ **Phase requirement IDs (MUST ALL be covered):** {phase_req_ids}
481
+
482
+ **Project instructions:** Read ./CLAUDE.md if exists — verify plans honor project guidelines
483
+ **Project skills:** Check .claude/skills/ or .agents/skills/ directory (if either exists) — verify plans account for project skill rules
484
+ </verification_context>
485
+
486
+ <expected_output>
487
+ - ## VERIFICATION PASSED — all checks pass
488
+ - ## ISSUES FOUND — structured issue list
489
+ </expected_output>
490
+ ```
491
+
492
+ ```
493
+ Task(
494
+ prompt=checker_prompt,
495
+ subagent_type="vector-plan-checker",
496
+ model="{checker_model}",
497
+ description="Verify Phase {phase} plans"
498
+ )
499
+ ```
500
+
501
+ ## 11. Handle Checker Return
502
+
503
+ - **`## VERIFICATION PASSED`:** Display confirmation, proceed to step 13.
504
+ - **`## ISSUES FOUND`:** Display issues, check iteration count, proceed to step 12.
505
+
506
+ ## 12. Revision Loop (Max 3 Iterations)
507
+
508
+ Track `iteration_count` (starts at 1 after initial plan + check).
509
+
510
+ **If iteration_count < 3:**
511
+
512
+ Display: `Sending back to planner for revision... (iteration {N}/3)`
513
+
514
+ Revision prompt:
515
+
516
+ ```markdown
517
+ <revision_context>
518
+ **Phase:** {phase_number}
519
+ **Mode:** revision
520
+
521
+ <files_to_read>
522
+ - {PHASE_DIR}/*-PLAN.md (Existing plans)
523
+ - {context_path} (USER DECISIONS from /vector:discuss-phase)
524
+ </files_to_read>
525
+
526
+ **Checker issues:** {structured_issues_from_checker}
527
+ </revision_context>
528
+
529
+ <instructions>
530
+ Make targeted updates to address checker issues.
531
+ Do NOT replan from scratch unless issues are fundamental.
532
+ Return what changed.
533
+ </instructions>
534
+ ```
535
+
536
+ ```
537
+ Task(
538
+ prompt=revision_prompt,
539
+ subagent_type="vector-planner",
540
+ model="{planner_model}",
541
+ description="Revise Phase {phase} plans"
542
+ )
543
+ ```
544
+
545
+ After planner returns -> spawn checker again (step 10), increment iteration_count.
546
+
547
+ **If iteration_count >= 3:**
548
+
549
+ Display: `Max iterations reached. {N} issues remain:` + issue list
550
+
551
+ Offer: 1) Force proceed, 2) Provide guidance and retry, 3) Abandon
552
+
553
+ ## 13. Present Final Status
554
+
555
+ Route to `<offer_next>` OR `auto_advance` depending on flags/config.
556
+
557
+ ## 14. Auto-Advance Check
558
+
559
+ Check for auto-advance trigger:
560
+
561
+ 1. Parse `--auto` flag from $ARGUMENTS
562
+ 2. **Sync chain flag with intent** — if user invoked manually (no `--auto`), clear the ephemeral chain flag from any previous interrupted `--auto` chain. This does NOT touch `workflow.auto_advance` (the user's persistent settings preference):
563
+ ```bash
564
+ if [[ ! "$ARGUMENTS" =~ --auto ]]; then
565
+ node "$HOME/.claude/core/bin/vector-tools.cjs" config-set workflow._auto_chain_active false 2>/dev/null
566
+ fi
567
+ ```
568
+ 3. Read both the chain flag and user preference:
569
+ ```bash
570
+ AUTO_CHAIN=$(node "$HOME/.claude/core/bin/vector-tools.cjs" config-get workflow._auto_chain_active 2>/dev/null || echo "false")
571
+ AUTO_CFG=$(node "$HOME/.claude/core/bin/vector-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
572
+ ```
573
+
574
+ **If `--auto` flag present OR `AUTO_CHAIN` is true OR `AUTO_CFG` is true:**
575
+
576
+ Display banner:
577
+ ```
578
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
579
+ Vector ► AUTO-ADVANCING TO EXECUTE
580
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
581
+
582
+ Plans ready. Launching execute-phase...
583
+ ```
584
+
585
+ Launch execute-phase using the Skill tool to avoid nested Task sessions (which cause runtime freezes due to deep agent nesting):
586
+ ```
587
+ Skill(skill="vector:execute-phase", args="${PHASE} --auto --no-transition")
588
+ ```
589
+
590
+ The `--no-transition` flag tells execute-phase to return status after verification instead of chaining further. This keeps the auto-advance chain flat — each phase runs at the same nesting level rather than spawning deeper Task agents.
591
+
592
+ **Handle execute-phase return:**
593
+ - **PHASE COMPLETE** → Display final summary:
594
+ ```
595
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
596
+ Vector ► PHASE ${PHASE} COMPLETE ✓
597
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
598
+
599
+ Auto-advance pipeline finished.
600
+
601
+ Next: /vector:discuss-phase ${NEXT_PHASE} --auto
602
+ ```
603
+ - **GAPS FOUND / VERIFICATION FAILED** → Display result, stop chain:
604
+ ```
605
+ Auto-advance stopped: Execution needs review.
606
+
607
+ Review the output above and continue manually:
608
+ /vector:execute-phase ${PHASE}
609
+ ```
610
+
611
+ **If neither `--auto` nor config enabled:**
612
+ Route to `<offer_next>` (existing behavior).
613
+
614
+ </process>
615
+
616
+ <offer_next>
617
+ Output this markdown directly (not as a code block):
618
+
619
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
620
+ Vector ► PHASE {X} PLANNED ✓
621
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
622
+
623
+ **Phase {X}: {Name}** — {N} plan(s) in {M} wave(s)
624
+
625
+ | Wave | Plans | What it builds |
626
+ |------|-------|----------------|
627
+ | 1 | 01, 02 | [objectives] |
628
+ | 2 | 03 | [objective] |
629
+
630
+ Research: {Completed | Used existing | Skipped}
631
+ Verification: {Passed | Passed with override | Skipped}
632
+
633
+ ───────────────────────────────────────────────────────────────
634
+
635
+ ## ▶ Next Up
636
+
637
+ **Execute Phase {X}** — run all {N} plans
638
+
639
+ /vector:execute-phase {X}
640
+
641
+ <sub>/clear first → fresh context window</sub>
642
+
643
+ ───────────────────────────────────────────────────────────────
644
+
645
+ **Also available:**
646
+ - cat .planning/phases/{phase-dir}/*-PLAN.md — review plans
647
+ - /vector:plan-phase {X} --research — re-research first
648
+
649
+ ───────────────────────────────────────────────────────────────
650
+ </offer_next>
651
+
652
+ <success_criteria>
653
+ - [ ] .planning/ directory validated
654
+ - [ ] Phase validated against roadmap
655
+ - [ ] Phase directory created if needed
656
+ - [ ] CONTEXT.md loaded early (step 4) and passed to ALL agents
657
+ - [ ] Research completed (unless --skip-research or --gaps or exists)
658
+ - [ ] vector-phase-researcher spawned with CONTEXT.md
659
+ - [ ] Existing plans checked
660
+ - [ ] vector-planner spawned with CONTEXT.md + RESEARCH.md
661
+ - [ ] Plans created (PLANNING COMPLETE or CHECKPOINT handled)
662
+ - [ ] vector-plan-checker spawned with CONTEXT.md
663
+ - [ ] Verification passed OR user override OR max iterations with user decision
664
+ - [ ] User sees status between agent spawns
665
+ - [ ] User knows next steps
666
+ </success_criteria>