@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,104 @@
1
+ <purpose>
2
+ Analyze freeform text from the user and route to the most appropriate Vector command. This is a dispatcher — it never does the work itself. Match user intent to the best command, confirm the routing, and hand off.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read all files referenced by the invoking prompt's execution_context before starting.
7
+ </required_reading>
8
+
9
+ <process>
10
+
11
+ <step name="validate">
12
+ **Check for input.**
13
+
14
+ If `$ARGUMENTS` is empty, ask via AskUserQuestion:
15
+
16
+ ```
17
+ What would you like to do? Describe the task, bug, or idea and I'll route it to the right Vector command.
18
+ ```
19
+
20
+ Wait for response before continuing.
21
+ </step>
22
+
23
+ <step name="check_project">
24
+ **Check if project exists.**
25
+
26
+ ```bash
27
+ INIT=$(node "~/.claude/core/bin/vector-tools.cjs" state load 2>/dev/null)
28
+ ```
29
+
30
+ Track whether `.planning/` exists — some routes require it, others don't.
31
+ </step>
32
+
33
+ <step name="route">
34
+ **Match intent to command.**
35
+
36
+ Evaluate `$ARGUMENTS` against these routing rules. Apply the **first matching** rule:
37
+
38
+ | If the text describes... | Route to | Why |
39
+ |--------------------------|----------|-----|
40
+ | Starting a new project, "set up", "initialize" | `/vector:new-project` | Needs full project initialization |
41
+ | Mapping or analyzing an existing codebase | `/vector:map-codebase` | Codebase discovery |
42
+ | A bug, error, crash, failure, or something broken | `/vector:debug` | Needs systematic investigation |
43
+ | Exploring, researching, comparing, or "how does X work" | `/vector:research-phase` | Domain research before planning |
44
+ | Discussing vision, "how should X look", brainstorming | `/vector:discuss-phase` | Needs context gathering |
45
+ | A complex task: refactoring, migration, multi-file architecture, system redesign | `/vector:add-phase` | Needs a full phase with plan/build cycle |
46
+ | Planning a specific phase or "plan phase N" | `/vector:plan-phase` | Direct planning request |
47
+ | Executing a phase or "build phase N", "run phase N" | `/vector:execute-phase` | Direct execution request |
48
+ | Running all remaining phases automatically | `/vector:autonomous` | Full autonomous execution |
49
+ | A review or quality concern about existing work | `/vector:verify-work` | Needs verification |
50
+ | Checking progress, status, "where am I" | `/vector:progress` | Status check |
51
+ | Resuming work, "pick up where I left off" | `/vector:resume-work` | Session restoration |
52
+ | A note, idea, or "remember to..." | `/vector:add-todo` | Capture for later |
53
+ | Adding tests, "write tests", "test coverage" | `/vector:add-tests` | Test generation |
54
+ | Completing a milestone, shipping, releasing | `/vector:complete-milestone` | Milestone lifecycle |
55
+ | A specific, actionable, small task (add feature, fix typo, update config) | `/vector:quick` | Self-contained, single executor |
56
+
57
+ **Requires `.planning/` directory:** All routes except `/vector:new-project`, `/vector:map-codebase`, `/vector:help`, and `/vector:join-discord`. If the project doesn't exist and the route requires it, suggest `/vector:new-project` first.
58
+
59
+ **Ambiguity handling:** If the text could reasonably match multiple routes, ask the user via AskUserQuestion with the top 2-3 options. For example:
60
+
61
+ ```
62
+ "Refactor the authentication system" could be:
63
+ 1. /vector:add-phase — Full planning cycle (recommended for multi-file refactors)
64
+ 2. /vector:quick — Quick execution (if scope is small and clear)
65
+
66
+ Which approach fits better?
67
+ ```
68
+ </step>
69
+
70
+ <step name="display">
71
+ **Show the routing decision.**
72
+
73
+ ```
74
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75
+ Vector ► ROUTING
76
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
77
+
78
+ **Input:** {first 80 chars of $ARGUMENTS}
79
+ **Routing to:** {chosen command}
80
+ **Reason:** {one-line explanation}
81
+ ```
82
+ </step>
83
+
84
+ <step name="dispatch">
85
+ **Invoke the chosen command.**
86
+
87
+ Run the selected `/vector:*` command, passing `$ARGUMENTS` as args.
88
+
89
+ If the chosen command expects a phase number and one wasn't provided in the text, extract it from context or ask via AskUserQuestion.
90
+
91
+ After invoking the command, stop. The dispatched command handles everything from here.
92
+ </step>
93
+
94
+ </process>
95
+
96
+ <success_criteria>
97
+ - [ ] Input validated (not empty)
98
+ - [ ] Intent matched to exactly one Vector command
99
+ - [ ] Ambiguity resolved via user question (if needed)
100
+ - [ ] Project existence checked for routes that require it
101
+ - [ ] Routing decision displayed before dispatch
102
+ - [ ] Command invoked with appropriate arguments
103
+ - [ ] No work done directly — dispatcher only
104
+ </success_criteria>
@@ -0,0 +1,468 @@
1
+ <purpose>
2
+ Execute all plans in a phase using wave-based parallel execution. Orchestrator stays lean — delegates plan execution to subagents.
3
+ </purpose>
4
+
5
+ <core_principle>
6
+ Orchestrator coordinates, not executes. Each subagent loads the full execute-plan context. Orchestrator: discover plans → analyze deps → group waves → spawn agents → handle checkpoints → collect results.
7
+ </core_principle>
8
+
9
+ <required_reading>
10
+ Read STATE.md before any operation to load project context.
11
+ </required_reading>
12
+
13
+ <process>
14
+
15
+ <step name="initialize" priority="first">
16
+ Load all context in one call:
17
+
18
+ ```bash
19
+ INIT=$(node "$HOME/.claude/core/bin/vector-tools.cjs" init execute-phase "${PHASE_ARG}")
20
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
21
+ ```
22
+
23
+ Parse JSON for: `executor_model`, `verifier_model`, `commit_docs`, `parallelization`, `branching_strategy`, `branch_name`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `plans`, `incomplete_plans`, `plan_count`, `incomplete_count`, `state_exists`, `roadmap_exists`, `phase_req_ids`.
24
+
25
+ **If `phase_found` is false:** Error — phase directory not found.
26
+ **If `plan_count` is 0:** Error — no plans found in phase.
27
+ **If `state_exists` is false but `.planning/` exists:** Offer reconstruct or continue.
28
+
29
+ When `parallelization` is false, plans within a wave execute sequentially.
30
+
31
+ **REQUIRED — Sync chain flag with intent.** If user invoked manually (no `--auto`), clear the ephemeral chain flag from any previous interrupted `--auto` chain. This prevents stale `_auto_chain_active: true` from causing unwanted auto-advance. This does NOT touch `workflow.auto_advance` (the user's persistent settings preference). You MUST execute this bash block before any config reads:
32
+ ```bash
33
+ # REQUIRED: prevents stale auto-chain from previous --auto runs
34
+ if [[ ! "$ARGUMENTS" =~ --auto ]]; then
35
+ node "$HOME/.claude/core/bin/vector-tools.cjs" config-set workflow._auto_chain_active false 2>/dev/null
36
+ fi
37
+ ```
38
+ </step>
39
+
40
+ <step name="handle_branching">
41
+ Check `branching_strategy` from init:
42
+
43
+ **"none":** Skip, continue on current branch.
44
+
45
+ **"phase" or "milestone":** Use pre-computed `branch_name` from init:
46
+ ```bash
47
+ git checkout -b "$BRANCH_NAME" 2>/dev/null || git checkout "$BRANCH_NAME"
48
+ ```
49
+
50
+ All subsequent commits go to this branch. User handles merging.
51
+ </step>
52
+
53
+ <step name="validate_phase">
54
+ From init JSON: `phase_dir`, `plan_count`, `incomplete_count`.
55
+
56
+ Report: "Found {plan_count} plans in {phase_dir} ({incomplete_count} incomplete)"
57
+ </step>
58
+
59
+ <step name="discover_and_group_plans">
60
+ Load plan inventory with wave grouping in one call:
61
+
62
+ ```bash
63
+ PLAN_INDEX=$(node "$HOME/.claude/core/bin/vector-tools.cjs" phase-plan-index "${PHASE_NUMBER}")
64
+ ```
65
+
66
+ Parse JSON for: `phase`, `plans[]` (each with `id`, `wave`, `autonomous`, `objective`, `files_modified`, `task_count`, `has_summary`), `waves` (map of wave number → plan IDs), `incomplete`, `has_checkpoints`.
67
+
68
+ **Filtering:** Skip plans where `has_summary: true`. If `--gaps-only`: also skip non-gap_closure plans. If all filtered: "No matching incomplete plans" → exit.
69
+
70
+ Report:
71
+ ```
72
+ ## Execution Plan
73
+
74
+ **Phase {X}: {Name}** — {total_plans} plans across {wave_count} waves
75
+
76
+ | Wave | Plans | What it builds |
77
+ |------|-------|----------------|
78
+ | 1 | 01-01, 01-02 | {from plan objectives, 3-8 words} |
79
+ | 2 | 01-03 | ... |
80
+ ```
81
+ </step>
82
+
83
+ <step name="execute_waves">
84
+ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`, sequential if `false`.
85
+
86
+ **For each wave:**
87
+
88
+ 1. **Describe what's being built (BEFORE spawning):**
89
+
90
+ Read each plan's `<objective>`. Extract what's being built and why.
91
+
92
+ ```
93
+ ---
94
+ ## Wave {N}
95
+
96
+ **{Plan ID}: {Plan Name}**
97
+ {2-3 sentences: what this builds, technical approach, why it matters}
98
+
99
+ Spawning {count} agent(s)...
100
+ ---
101
+ ```
102
+
103
+ - Bad: "Executing terrain generation plan"
104
+ - Good: "Procedural terrain generator using Perlin noise — creates height maps, biome zones, and collision meshes. Required before vehicle physics can interact with ground."
105
+
106
+ 2. **Spawn executor agents:**
107
+
108
+ Pass paths only — executors read files themselves with their fresh 200k context.
109
+ This keeps orchestrator context lean (~10-15%).
110
+
111
+ ```
112
+ Task(
113
+ subagent_type="vector-executor",
114
+ model="{executor_model}",
115
+ prompt="
116
+ <objective>
117
+ Execute plan {plan_number} of phase {phase_number}-{phase_name}.
118
+ Commit each task atomically. Create SUMMARY.md. Update STATE.md and ROADMAP.md.
119
+ </objective>
120
+
121
+ <execution_context>
122
+ @~/.claude/core/workflows/execute-plan.md
123
+ @~/.claude/core/templates/summary.md
124
+ @~/.claude/core/references/checkpoints.md
125
+ @~/.claude/core/references/tdd.md
126
+ </execution_context>
127
+
128
+ <files_to_read>
129
+ Read these files at execution start using the Read tool:
130
+ - {phase_dir}/{plan_file} (Plan)
131
+ - .planning/STATE.md (State)
132
+ - .planning/config.json (Config, if exists)
133
+ - ./CLAUDE.md (Project instructions, if exists — follow project-specific guidelines and coding conventions)
134
+ - .claude/skills/ or .agents/skills/ (Project skills, if either exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
135
+ </files_to_read>
136
+
137
+ <success_criteria>
138
+ - [ ] All tasks executed
139
+ - [ ] Each task committed individually
140
+ - [ ] SUMMARY.md created in plan directory
141
+ - [ ] STATE.md updated with position and decisions
142
+ - [ ] ROADMAP.md updated with plan progress (via `roadmap update-plan-progress`)
143
+ </success_criteria>
144
+ "
145
+ )
146
+ ```
147
+
148
+ 3. **Wait for all agents in wave to complete.**
149
+
150
+ 4. **Report completion — spot-check claims first:**
151
+
152
+ For each SUMMARY.md:
153
+ - Verify first 2 files from `key-files.created` exist on disk
154
+ - Check `git log --oneline --all --grep="{phase}-{plan}"` returns ≥1 commit
155
+ - Check for `## Self-Check: FAILED` marker
156
+
157
+ If ANY spot-check fails: report which plan failed, route to failure handler — ask "Retry plan?" or "Continue with remaining waves?"
158
+
159
+ If pass:
160
+ ```
161
+ ---
162
+ ## Wave {N} Complete
163
+
164
+ **{Plan ID}: {Plan Name}**
165
+ {What was built — from SUMMARY.md}
166
+ {Notable deviations, if any}
167
+
168
+ {If more waves: what this enables for next wave}
169
+ ---
170
+ ```
171
+
172
+ - Bad: "Wave 2 complete. Proceeding to Wave 3."
173
+ - Good: "Terrain system complete — 3 biome types, height-based texturing, physics collision meshes. Vehicle physics (Wave 3) can now reference ground surfaces."
174
+
175
+ 5. **Handle failures:**
176
+
177
+ **Known Claude Code bug (classifyHandoffIfNeeded):** If an agent reports "failed" with error containing `classifyHandoffIfNeeded is not defined`, this is a Claude Code runtime bug — not a Vector or agent issue. The error fires in the completion handler AFTER all tool calls finish. In this case: run the same spot-checks as step 4 (SUMMARY.md exists, git commits present, no Self-Check: FAILED). If spot-checks PASS → treat as **successful**. If spot-checks FAIL → treat as real failure below.
178
+
179
+ For real failures: report which plan failed → ask "Continue?" or "Stop?" → if continue, dependent plans may also fail. If stop, partial completion report.
180
+
181
+ 6. **Execute checkpoint plans between waves** — see `<checkpoint_handling>`.
182
+
183
+ 7. **Proceed to next wave.**
184
+ </step>
185
+
186
+ <step name="checkpoint_handling">
187
+ Plans with `autonomous: false` require user interaction.
188
+
189
+ **Auto-mode checkpoint handling:**
190
+
191
+ Read auto-advance config (chain flag + user preference):
192
+ ```bash
193
+ AUTO_CHAIN=$(node "$HOME/.claude/core/bin/vector-tools.cjs" config-get workflow._auto_chain_active 2>/dev/null || echo "false")
194
+ AUTO_CFG=$(node "$HOME/.claude/core/bin/vector-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
195
+ ```
196
+
197
+ When executor returns a checkpoint AND (`AUTO_CHAIN` is `"true"` OR `AUTO_CFG` is `"true"`):
198
+ - **human-verify** → Auto-spawn continuation agent with `{user_response}` = `"approved"`. Log `⚡ Auto-approved checkpoint`.
199
+ - **decision** → Auto-spawn continuation agent with `{user_response}` = first option from checkpoint details. Log `⚡ Auto-selected: [option]`.
200
+ - **human-action** → Present to user (existing behavior below). Auth gates cannot be automated.
201
+
202
+ **Standard flow (not auto-mode, or human-action type):**
203
+
204
+ 1. Spawn agent for checkpoint plan
205
+ 2. Agent runs until checkpoint task or auth gate → returns structured state
206
+ 3. Agent return includes: completed tasks table, current task + blocker, checkpoint type/details, what's awaited
207
+ 4. **Present to user:**
208
+ ```
209
+ ## Checkpoint: [Type]
210
+
211
+ **Plan:** 03-03 Dashboard Layout
212
+ **Progress:** 2/3 tasks complete
213
+
214
+ [Checkpoint Details from agent return]
215
+ [Awaiting section from agent return]
216
+ ```
217
+ 5. User responds: "approved"/"done" | issue description | decision selection
218
+ 6. **Spawn continuation agent (NOT resume)** using continuation-prompt.md template:
219
+ - `{completed_tasks_table}`: From checkpoint return
220
+ - `{resume_task_number}` + `{resume_task_name}`: Current task
221
+ - `{user_response}`: What user provided
222
+ - `{resume_instructions}`: Based on checkpoint type
223
+ 7. Continuation agent verifies previous commits, continues from resume point
224
+ 8. Repeat until plan completes or user stops
225
+
226
+ **Why fresh agent, not resume:** Resume relies on internal serialization that breaks with parallel tool calls. Fresh agents with explicit state are more reliable.
227
+
228
+ **Checkpoints in parallel waves:** Agent pauses and returns while other parallel agents may complete. Present checkpoint, spawn continuation, wait for all before next wave.
229
+ </step>
230
+
231
+ <step name="aggregate_results">
232
+ After all waves:
233
+
234
+ ```markdown
235
+ ## Phase {X}: {Name} Execution Complete
236
+
237
+ **Waves:** {N} | **Plans:** {M}/{total} complete
238
+
239
+ | Wave | Plans | Status |
240
+ |------|-------|--------|
241
+ | 1 | plan-01, plan-02 | ✓ Complete |
242
+ | CP | plan-03 | ✓ Verified |
243
+ | 2 | plan-04 | ✓ Complete |
244
+
245
+ ### Plan Details
246
+ 1. **03-01**: [one-liner from SUMMARY.md]
247
+ 2. **03-02**: [one-liner from SUMMARY.md]
248
+
249
+ ### Issues Encountered
250
+ [Aggregate from SUMMARYs, or "None"]
251
+ ```
252
+ </step>
253
+
254
+ <step name="close_parent_artifacts">
255
+ **For decimal/polish phases only (X.Y pattern):** Close the feedback loop by resolving parent UAT and debug artifacts.
256
+
257
+ **Skip if** phase number has no decimal (e.g., `3`, `04`) — only applies to gap-closure phases like `4.1`, `03.1`.
258
+
259
+ **1. Detect decimal phase and derive parent:**
260
+ ```bash
261
+ # Check if phase_number contains a decimal
262
+ if [[ "$PHASE_NUMBER" == *.* ]]; then
263
+ PARENT_PHASE="${PHASE_NUMBER%%.*}"
264
+ fi
265
+ ```
266
+
267
+ **2. Find parent UAT file:**
268
+ ```bash
269
+ PARENT_INFO=$(node "$HOME/.claude/core/bin/vector-tools.cjs" find-phase "${PARENT_PHASE}" --raw)
270
+ # Extract directory from PARENT_INFO JSON, then find UAT file in that directory
271
+ ```
272
+
273
+ **If no parent UAT found:** Skip this step (gap-closure may have been triggered by VERIFICATION.md instead).
274
+
275
+ **3. Update UAT gap statuses:**
276
+
277
+ Read the parent UAT file's `## Gaps` section. For each gap entry with `status: failed`:
278
+ - Update to `status: resolved`
279
+
280
+ **4. Update UAT frontmatter:**
281
+
282
+ If all gaps now have `status: resolved`:
283
+ - Update frontmatter `status: diagnosed` → `status: resolved`
284
+ - Update frontmatter `updated:` timestamp
285
+
286
+ **5. Resolve referenced debug sessions:**
287
+
288
+ For each gap that has a `debug_session:` field:
289
+ - Read the debug session file
290
+ - Update frontmatter `status:` → `resolved`
291
+ - Update frontmatter `updated:` timestamp
292
+ - Move to resolved directory:
293
+ ```bash
294
+ mkdir -p .planning/debug/resolved
295
+ mv .planning/debug/{slug}.md .planning/debug/resolved/
296
+ ```
297
+
298
+ **6. Commit updated artifacts:**
299
+ ```bash
300
+ node "$HOME/.claude/core/bin/vector-tools.cjs" commit "docs(phase-${PARENT_PHASE}): resolve UAT gaps and debug sessions after ${PHASE_NUMBER} gap closure" --files .planning/phases/*${PARENT_PHASE}*/*-UAT.md .planning/debug/resolved/*.md
301
+ ```
302
+ </step>
303
+
304
+ <step name="verify_phase_goal">
305
+ Verify phase achieved its GOAL, not just completed tasks.
306
+
307
+ ```
308
+ Task(
309
+ prompt="Verify phase {phase_number} goal achievement.
310
+ Phase directory: {phase_dir}
311
+ Phase goal: {goal from ROADMAP.md}
312
+ Phase requirement IDs: {phase_req_ids}
313
+ Check must_haves against actual codebase.
314
+ Cross-reference requirement IDs from PLAN frontmatter against REQUIREMENTS.md — every ID MUST be accounted for.
315
+ Create VERIFICATION.md.",
316
+ subagent_type="vector-verifier",
317
+ model="{verifier_model}"
318
+ )
319
+ ```
320
+
321
+ Read status:
322
+ ```bash
323
+ grep "^status:" "$PHASE_DIR"/*-VERIFICATION.md | cut -d: -f2 | tr -d ' '
324
+ ```
325
+
326
+ | Status | Action |
327
+ |--------|--------|
328
+ | `passed` | → update_roadmap |
329
+ | `human_needed` | Present items for human testing, get approval or feedback |
330
+ | `gaps_found` | Present gap summary, offer `/vector:plan-phase {phase} --gaps` |
331
+
332
+ **If human_needed:**
333
+ ```
334
+ ## ✓ Phase {X}: {Name} — Human Verification Required
335
+
336
+ All automated checks passed. {N} items need human testing:
337
+
338
+ {From VERIFICATION.md human_verification section}
339
+
340
+ "approved" → continue | Report issues → gap closure
341
+ ```
342
+
343
+ **If gaps_found:**
344
+ ```
345
+ ## ⚠ Phase {X}: {Name} — Gaps Found
346
+
347
+ **Score:** {N}/{M} must-haves verified
348
+ **Report:** {phase_dir}/{phase_num}-VERIFICATION.md
349
+
350
+ ### What's Missing
351
+ {Gap summaries from VERIFICATION.md}
352
+
353
+ ---
354
+ ## ▶ Next Up
355
+
356
+ `/vector:plan-phase {X} --gaps`
357
+
358
+ <sub>`/clear` first → fresh context window</sub>
359
+
360
+ Also: `cat {phase_dir}/{phase_num}-VERIFICATION.md` — full report
361
+ Also: `/vector:verify-work {X}` — manual testing first
362
+ ```
363
+
364
+ Gap closure cycle: `/vector:plan-phase {X} --gaps` reads VERIFICATION.md → creates gap plans with `gap_closure: true` → user runs `/vector:execute-phase {X} --gaps-only` → verifier re-runs.
365
+ </step>
366
+
367
+ <step name="update_roadmap">
368
+ **Mark phase complete and update all tracking files:**
369
+
370
+ ```bash
371
+ COMPLETION=$(node "$HOME/.claude/core/bin/vector-tools.cjs" phase complete "${PHASE_NUMBER}")
372
+ ```
373
+
374
+ The CLI handles:
375
+ - Marking phase checkbox `[x]` with completion date
376
+ - Updating Progress table (Status → Complete, date)
377
+ - Updating plan count to final
378
+ - Advancing STATE.md to next phase
379
+ - Updating REQUIREMENTS.md traceability
380
+
381
+ Extract from result: `next_phase`, `next_phase_name`, `is_last_phase`.
382
+
383
+ ```bash
384
+ node "$HOME/.claude/core/bin/vector-tools.cjs" commit "docs(phase-{X}): complete phase execution" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md {phase_dir}/*-VERIFICATION.md
385
+ ```
386
+ </step>
387
+
388
+ <step name="offer_next">
389
+
390
+ **Exception:** If `gaps_found`, the `verify_phase_goal` step already presents the gap-closure path (`/vector:plan-phase {X} --gaps`). No additional routing needed — skip auto-advance.
391
+
392
+ **No-transition check (spawned by auto-advance chain):**
393
+
394
+ Parse `--no-transition` flag from $ARGUMENTS.
395
+
396
+ **If `--no-transition` flag present:**
397
+
398
+ Execute-phase was spawned by plan-phase's auto-advance. Do NOT run transition.md.
399
+ After verification passes and roadmap is updated, return completion status to parent:
400
+
401
+ ```
402
+ ## PHASE COMPLETE
403
+
404
+ Phase: ${PHASE_NUMBER} - ${PHASE_NAME}
405
+ Plans: ${completed_count}/${total_count}
406
+ Verification: {Passed | Gaps Found}
407
+
408
+ [Include aggregate_results output]
409
+ ```
410
+
411
+ STOP. Do not proceed to auto-advance or transition.
412
+
413
+ **If `--no-transition` flag is NOT present:**
414
+
415
+ **Auto-advance detection:**
416
+
417
+ 1. Parse `--auto` flag from $ARGUMENTS
418
+ 2. Read both the chain flag and user preference (chain flag already synced in init step):
419
+ ```bash
420
+ AUTO_CHAIN=$(node "$HOME/.claude/core/bin/vector-tools.cjs" config-get workflow._auto_chain_active 2>/dev/null || echo "false")
421
+ AUTO_CFG=$(node "$HOME/.claude/core/bin/vector-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
422
+ ```
423
+
424
+ **If `--auto` flag present OR `AUTO_CHAIN` is true OR `AUTO_CFG` is true (AND verification passed with no gaps):**
425
+
426
+ ```
427
+ ╔══════════════════════════════════════════╗
428
+ ║ AUTO-ADVANCING → TRANSITION ║
429
+ ║ Phase {X} verified, continuing chain ║
430
+ ╚══════════════════════════════════════════╝
431
+ ```
432
+
433
+ Execute the transition workflow inline (do NOT use Task — orchestrator context is ~10-15%, transition needs phase completion data already in context):
434
+
435
+ Read and follow `~/.claude/core/workflows/transition.md`, passing through the `--auto` flag so it propagates to the next phase invocation.
436
+
437
+ **If none of `--auto`, `AUTO_CHAIN`, or `AUTO_CFG` is true:**
438
+
439
+ **STOP. Do not auto-advance. Do not execute transition. Do not plan next phase. Present options to the user and wait.**
440
+
441
+ ```
442
+ ## ✓ Phase {X}: {Name} Complete
443
+
444
+ /vector:progress — see updated roadmap
445
+ /vector:transition — plan next phase transition
446
+ /vector:execute-phase {next} — execute next phase
447
+ ```
448
+ </step>
449
+
450
+ </process>
451
+
452
+ <context_efficiency>
453
+ Orchestrator: ~10-15% context. Subagents: fresh 200k each. No polling (Task blocks). No context bleed.
454
+ </context_efficiency>
455
+
456
+ <failure_handling>
457
+ - **classifyHandoffIfNeeded false failure:** Agent reports "failed" but error is `classifyHandoffIfNeeded is not defined` → Claude Code bug, not Vector. Spot-check (SUMMARY exists, commits present) → if pass, treat as success
458
+ - **Agent fails mid-plan:** Missing SUMMARY.md → report, ask user how to proceed
459
+ - **Dependency chain breaks:** Wave 1 fails → Wave 2 dependents likely fail → user chooses attempt or skip
460
+ - **All agents in wave fail:** Systemic issue → stop, report for investigation
461
+ - **Checkpoint unresolvable:** "Skip this plan?" or "Abort phase execution?" → record partial progress in STATE.md
462
+ </failure_handling>
463
+
464
+ <resumption>
465
+ Re-run `/vector:execute-phase {phase}` → discover_plans finds completed SUMMARYs → skips them → resumes from first incomplete plan → continues wave execution.
466
+
467
+ STATE.md tracks: last completed plan, current wave, pending checkpoints.
468
+ </resumption>