mindforge-cc 2.1.0 → 2.1.2

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 (236) hide show
  1. package/.agent/bin/lib/commands.cjs +959 -0
  2. package/.agent/bin/lib/config.cjs +421 -0
  3. package/.agent/bin/lib/core.cjs +1166 -0
  4. package/.agent/bin/lib/frontmatter.cjs +307 -0
  5. package/.agent/bin/lib/init.cjs +1336 -0
  6. package/.agent/bin/lib/milestone.cjs +252 -0
  7. package/.agent/bin/lib/model-profiles.cjs +68 -0
  8. package/.agent/bin/lib/phase.cjs +888 -0
  9. package/.agent/bin/lib/profile-output.cjs +952 -0
  10. package/.agent/bin/lib/profile-pipeline.cjs +539 -0
  11. package/.agent/bin/lib/roadmap.cjs +329 -0
  12. package/.agent/bin/lib/security.cjs +356 -0
  13. package/.agent/bin/lib/state.cjs +969 -0
  14. package/.agent/bin/lib/template.cjs +222 -0
  15. package/.agent/bin/lib/uat.cjs +189 -0
  16. package/.agent/bin/lib/verify.cjs +851 -0
  17. package/.agent/bin/lib/workstream.cjs +491 -0
  18. package/.agent/bin/mindforge-tools.cjs +897 -0
  19. package/.agent/file-manifest.json +219 -0
  20. package/.agent/hooks/mindforge-check-update.js +114 -0
  21. package/.agent/hooks/mindforge-context-monitor.js +156 -0
  22. package/.agent/hooks/mindforge-prompt-guard.js +96 -0
  23. package/.agent/hooks/mindforge-statusline.js +119 -0
  24. package/.agent/hooks/mindforge-workflow-guard.js +94 -0
  25. package/.agent/mindforge/discuss-phase.md +1 -1
  26. package/.agent/mindforge/help.md +1 -1
  27. package/.agent/mindforge/learn.md +3 -2
  28. package/.agent/mindforge/research.md +3 -2
  29. package/.agent/mindforge/steer.md +1 -1
  30. package/.agent/settings.json +38 -0
  31. package/.agent/skills/mindforge-add-backlog/SKILL.md +72 -0
  32. package/.agent/skills/mindforge-add-phase/SKILL.md +39 -0
  33. package/.agent/skills/mindforge-add-tests/SKILL.md +28 -0
  34. package/.agent/skills/mindforge-add-todo/SKILL.md +42 -0
  35. package/.agent/skills/mindforge-audit-milestone/SKILL.md +29 -0
  36. package/.agent/skills/mindforge-audit-uat/SKILL.md +20 -0
  37. package/.agent/skills/mindforge-autonomous/SKILL.md +33 -0
  38. package/.agent/skills/mindforge-check-todos/SKILL.md +40 -0
  39. package/.agent/skills/mindforge-cleanup/SKILL.md +19 -0
  40. package/.agent/skills/mindforge-complete-milestone/SKILL.md +131 -0
  41. package/.agent/skills/mindforge-debug/SKILL.md +163 -0
  42. package/.agent/skills/mindforge-discuss-phase/SKILL.md +54 -0
  43. package/.agent/skills/mindforge-do/SKILL.md +26 -0
  44. package/.agent/skills/mindforge-execute-phase/SKILL.md +49 -0
  45. package/.agent/skills/mindforge-fast/SKILL.md +23 -0
  46. package/.agent/skills/mindforge-forensics/SKILL.md +49 -0
  47. package/.agent/skills/mindforge-health/SKILL.md +17 -0
  48. package/.agent/skills/mindforge-help/SKILL.md +23 -0
  49. package/.agent/skills/mindforge-insert-phase/SKILL.md +28 -0
  50. package/.agent/skills/mindforge-join-discord/SKILL.md +19 -0
  51. package/.agent/skills/mindforge-list-phase-assumptions/SKILL.md +41 -0
  52. package/.agent/skills/mindforge-list-workspaces/SKILL.md +17 -0
  53. package/.agent/skills/mindforge-manager/SKILL.md +32 -0
  54. package/.agent/skills/mindforge-map-codebase/SKILL.md +64 -0
  55. package/.agent/skills/mindforge-milestone-summary/SKILL.md +44 -0
  56. package/.agent/skills/mindforge-new-milestone/SKILL.md +38 -0
  57. package/.agent/skills/mindforge-new-project/SKILL.md +36 -0
  58. package/.agent/skills/mindforge-new-workspace/SKILL.md +39 -0
  59. package/.agent/skills/mindforge-next/SKILL.md +19 -0
  60. package/.agent/skills/mindforge-note/SKILL.md +29 -0
  61. package/.agent/skills/mindforge-pause-work/SKILL.md +35 -0
  62. package/.agent/skills/mindforge-plan-milestone-gaps/SKILL.md +28 -0
  63. package/.agent/skills/mindforge-plan-phase/SKILL.md +37 -0
  64. package/.agent/skills/mindforge-plant-seed/SKILL.md +22 -0
  65. package/.agent/skills/mindforge-pr-branch/SKILL.md +21 -0
  66. package/.agent/skills/mindforge-profile-user/SKILL.md +38 -0
  67. package/.agent/skills/mindforge-progress/SKILL.md +19 -0
  68. package/.agent/skills/mindforge-quick/SKILL.md +38 -0
  69. package/.agent/skills/mindforge-reapply-patches/SKILL.md +124 -0
  70. package/.agent/skills/mindforge-remove-phase/SKILL.md +26 -0
  71. package/.agent/skills/mindforge-remove-workspace/SKILL.md +22 -0
  72. package/.agent/skills/mindforge-research-phase/SKILL.md +186 -0
  73. package/.agent/skills/mindforge-resume-work/SKILL.md +35 -0
  74. package/.agent/skills/mindforge-review/SKILL.md +31 -0
  75. package/.agent/skills/mindforge-review-backlog/SKILL.md +58 -0
  76. package/.agent/skills/mindforge-session-report/SKILL.md +16 -0
  77. package/.agent/skills/mindforge-set-profile/SKILL.md +9 -0
  78. package/.agent/skills/mindforge-settings/SKILL.md +32 -0
  79. package/.agent/skills/mindforge-ship/SKILL.md +16 -0
  80. package/.agent/skills/mindforge-stats/SKILL.md +16 -0
  81. package/.agent/skills/mindforge-thread/SKILL.md +123 -0
  82. package/.agent/skills/mindforge-ui-phase/SKILL.md +24 -0
  83. package/.agent/skills/mindforge-ui-review/SKILL.md +24 -0
  84. package/.agent/skills/mindforge-update/SKILL.md +35 -0
  85. package/.agent/skills/mindforge-validate-phase/SKILL.md +26 -0
  86. package/.agent/skills/mindforge-verify-work/SKILL.md +30 -0
  87. package/.agent/skills/mindforge-workstreams/SKILL.md +65 -0
  88. package/.agent/workflows/mindforge-add-phase.md +112 -0
  89. package/.agent/workflows/mindforge-add-tests.md +351 -0
  90. package/.agent/workflows/mindforge-add-todo.md +158 -0
  91. package/.agent/workflows/mindforge-audit-milestone.md +332 -0
  92. package/.agent/workflows/mindforge-audit-uat.md +109 -0
  93. package/.agent/workflows/mindforge-autonomous.md +815 -0
  94. package/.agent/workflows/mindforge-check-todos.md +177 -0
  95. package/.agent/workflows/mindforge-cleanup.md +152 -0
  96. package/.agent/workflows/mindforge-complete-milestone.md +766 -0
  97. package/.agent/workflows/mindforge-diagnose-issues.md +220 -0
  98. package/.agent/workflows/mindforge-discovery-phase.md +289 -0
  99. package/.agent/workflows/mindforge-discuss-phase-assumptions.md +645 -0
  100. package/.agent/workflows/mindforge-discuss-phase.md +1047 -0
  101. package/.agent/workflows/mindforge-do.md +104 -0
  102. package/.agent/workflows/mindforge-execute-phase.md +838 -0
  103. package/.agent/workflows/mindforge-execute-plan.md +509 -0
  104. package/.agent/workflows/mindforge-fast.md +105 -0
  105. package/.agent/workflows/mindforge-forensics.md +265 -0
  106. package/.agent/workflows/mindforge-health.md +181 -0
  107. package/.agent/workflows/mindforge-help.md +606 -0
  108. package/.agent/workflows/mindforge-insert-phase.md +130 -0
  109. package/.agent/workflows/mindforge-list-phase-assumptions.md +178 -0
  110. package/.agent/workflows/mindforge-list-workspaces.md +56 -0
  111. package/.agent/workflows/mindforge-manager.md +360 -0
  112. package/.agent/workflows/mindforge-map-codebase.md +370 -0
  113. package/.agent/workflows/mindforge-milestone-summary.md +223 -0
  114. package/.agent/workflows/mindforge-new-milestone.md +469 -0
  115. package/.agent/workflows/mindforge-new-project.md +1226 -0
  116. package/.agent/workflows/mindforge-new-workspace.md +237 -0
  117. package/.agent/workflows/mindforge-next.md +97 -0
  118. package/.agent/workflows/mindforge-node-repair.md +92 -0
  119. package/.agent/workflows/mindforge-note.md +156 -0
  120. package/.agent/workflows/mindforge-pause-work.md +176 -0
  121. package/.agent/workflows/mindforge-plan-milestone-gaps.md +273 -0
  122. package/.agent/workflows/mindforge-plan-phase.md +848 -0
  123. package/.agent/workflows/mindforge-plant-seed.md +169 -0
  124. package/.agent/workflows/mindforge-pr-branch.md +129 -0
  125. package/.agent/workflows/mindforge-profile-user.md +450 -0
  126. package/.agent/workflows/mindforge-progress.md +507 -0
  127. package/.agent/workflows/mindforge-quick.md +732 -0
  128. package/.agent/workflows/mindforge-remove-phase.md +155 -0
  129. package/.agent/workflows/mindforge-remove-workspace.md +90 -0
  130. package/.agent/workflows/mindforge-research-phase.md +74 -0
  131. package/.agent/workflows/mindforge-resume-project.md +325 -0
  132. package/.agent/workflows/mindforge-review.md +228 -0
  133. package/.agent/workflows/mindforge-session-report.md +146 -0
  134. package/.agent/workflows/mindforge-settings.md +283 -0
  135. package/.agent/workflows/mindforge-ship.md +228 -0
  136. package/.agent/workflows/mindforge-stats.md +60 -0
  137. package/.agent/workflows/mindforge-transition.md +671 -0
  138. package/.agent/workflows/mindforge-ui-phase.md +290 -0
  139. package/.agent/workflows/mindforge-ui-review.md +157 -0
  140. package/.agent/workflows/mindforge-update.md +323 -0
  141. package/.agent/workflows/mindforge-validate-phase.md +167 -0
  142. package/.agent/workflows/mindforge-verify-phase.md +254 -0
  143. package/.agent/workflows/mindforge-verify-work.md +623 -0
  144. package/.mindforge/personas/advisor-researcher.md +3 -3
  145. package/.mindforge/personas/debug-specialist.md +1 -1
  146. package/.mindforge/personas/debugger.md +1 -1
  147. package/.mindforge/personas/developer.md +1 -1
  148. package/.mindforge/personas/phase-researcher.md +4 -4
  149. package/.mindforge/personas/project-researcher.md +3 -3
  150. package/.mindforge/personas/research-agent.md +4 -3
  151. package/.mindforge/personas/tech-writer.md +1 -1
  152. package/.mindforge/personas/ui-researcher.md +1 -1
  153. package/.planning/ROADMAP.md +10 -0
  154. package/CHANGELOG.md +34 -0
  155. package/README.md +70 -45
  156. package/RELEASENOTES.md +26 -26
  157. package/bin/install.js +41 -41
  158. package/bin/installer-core.js +67 -26
  159. package/bin/wizard/setup-wizard.js +11 -24
  160. package/bin/wizard/theme.js +141 -0
  161. package/docs/PERSONAS.md +119 -87
  162. package/docs/References/checkpoints.md +778 -0
  163. package/docs/References/config-reference.md +81 -0
  164. package/docs/References/continuation-format.md +249 -0
  165. package/docs/References/decimal-phase-calculation.md +64 -0
  166. package/docs/References/git-integration.md +295 -0
  167. package/docs/References/git-planning-commit.md +38 -0
  168. package/docs/References/model-profile-resolution.md +36 -0
  169. package/docs/References/model-profiles.md +139 -0
  170. package/docs/References/phase-argument-parsing.md +61 -0
  171. package/docs/References/planning-config.md +202 -0
  172. package/docs/References/questioning.md +162 -0
  173. package/docs/References/tdd.md +263 -0
  174. package/docs/References/ui-brand.md +160 -0
  175. package/docs/References/user-profiling.md +681 -0
  176. package/docs/References/verification-patterns.md +612 -0
  177. package/docs/References/workstream-flag.md +58 -0
  178. package/docs/Templates/Agents/CLAUDE-MD.md +122 -0
  179. package/docs/Templates/Agents/COPILOT-INSTRUCTIONS.md +7 -0
  180. package/docs/Templates/Agents/DEBUGGER-PROMPT.md +91 -0
  181. package/docs/Templates/Agents/PLANNER-PROMPT.md +117 -0
  182. package/docs/Templates/Codebase/architecture.md +255 -0
  183. package/docs/Templates/Codebase/concerns.md +310 -0
  184. package/docs/Templates/Codebase/conventions.md +307 -0
  185. package/docs/Templates/Codebase/integrations.md +280 -0
  186. package/docs/Templates/Codebase/stack.md +186 -0
  187. package/docs/Templates/Codebase/structure.md +285 -0
  188. package/docs/Templates/Codebase/testing.md +480 -0
  189. package/docs/Templates/Execution/CONTINUE-HERE.md +78 -0
  190. package/docs/Templates/Execution/DISCUSSION-LOG.md +63 -0
  191. package/docs/Templates/Execution/PHASE-PROMPT.md +610 -0
  192. package/docs/Templates/Execution/STATE.md +176 -0
  193. package/docs/Templates/Execution/SUMMARY-COMPLEX.md +59 -0
  194. package/docs/Templates/Execution/SUMMARY-MINIMAL.md +41 -0
  195. package/docs/Templates/Execution/SUMMARY-STANDARD.md +48 -0
  196. package/docs/Templates/Execution/SUMMARY.md +248 -0
  197. package/docs/Templates/Profile/DEV-PREFERENCES.md +21 -0
  198. package/docs/Templates/Profile/USER-PROFILE.md +146 -0
  199. package/docs/Templates/Profile/USER-SETUP.md +311 -0
  200. package/docs/Templates/Project/DISCOVERY.md +146 -0
  201. package/docs/Templates/Project/MILESTONE-ARCHIVE.md +123 -0
  202. package/docs/Templates/Project/MILESTONE.md +115 -0
  203. package/docs/Templates/Project/PROJECT.md +206 -0
  204. package/docs/Templates/Project/REQUIREMENTS.md +231 -0
  205. package/docs/Templates/Project/RETROSPECTIVE.md +54 -0
  206. package/docs/Templates/Project/ROADMAP.md +202 -0
  207. package/docs/Templates/Quality/DEBUG.md +164 -0
  208. package/docs/Templates/Quality/UAT.md +280 -0
  209. package/docs/Templates/Quality/UI-SPEC.md +100 -0
  210. package/docs/Templates/Quality/VALIDATION.md +76 -0
  211. package/docs/Templates/Quality/VERIFICATION-REPORT.md +322 -0
  212. package/docs/Templates/Research/ARCHITECTURE.md +204 -0
  213. package/docs/Templates/Research/FEATURES.md +147 -0
  214. package/docs/Templates/Research/PITFALLS.md +200 -0
  215. package/docs/Templates/Research/STACK.md +120 -0
  216. package/docs/Templates/Research/SUMMARY.md +170 -0
  217. package/docs/Templates/System/CONFIG.json +43 -0
  218. package/docs/Templates/System/CONTEXT.md +352 -0
  219. package/docs/architecture/README.md +54 -42
  220. package/docs/commands-reference.md +62 -14
  221. package/docs/getting-started.md +26 -18
  222. package/docs/skills-authoring-guide.md +40 -12
  223. package/docs/tutorial.md +83 -116
  224. package/docs/user-guide.md +72 -198
  225. package/package.json +7 -2
  226. package/.mindforge/memory/knowledge-base.jsonl +0 -7
  227. package/.mindforge/memory/pattern-library.jsonl +0 -1
  228. package/.mindforge/memory/team-preferences.jsonl +0 -4
  229. package/.planning/browser-daemon.log +0 -32
  230. package/docs/mindforge-md-reference.md +0 -57
  231. package/docs/reference/config-reference.md +0 -64
  232. /package/{.mindforge/memory/decision-library.jsonl → .planning/phases/01-migrate-gsd-to-mindforge/.gitkeep} +0 -0
  233. /package/docs/{reference → References}/audit-events.md +0 -0
  234. /package/docs/{reference → References}/commands.md +0 -0
  235. /package/docs/{reference → References}/sdk-api.md +0 -0
  236. /package/docs/{reference → References}/skills-api.md +0 -0
@@ -0,0 +1,155 @@
1
+ <purpose>
2
+ Remove an unstarted future phase from the project roadmap, delete its directory, renumber all subsequent phases to maintain a clean linear sequence, and commit the change. The git commit serves as the historical record of removal.
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="parse_arguments">
12
+ Parse the command arguments:
13
+ - Argument is the phase number to remove (integer or decimal)
14
+ - Example: `/mindforge-remove-phase 17` → phase = 17
15
+ - Example: `/mindforge-remove-phase 16.1` → phase = 16.1
16
+
17
+ If no argument provided:
18
+
19
+ ```
20
+ ERROR: Phase number required
21
+ Usage: /mindforge-remove-phase <phase-number>
22
+ Example: /mindforge-remove-phase 17
23
+ ```
24
+
25
+ Exit.
26
+ </step>
27
+
28
+ <step name="init_context">
29
+ Load phase operation context:
30
+
31
+ ```bash
32
+ INIT=$(node ".agent/bin/mindforge-tools.cjs" init phase-op "${target}")
33
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
34
+ ```
35
+
36
+ Extract: `phase_found`, `phase_dir`, `phase_number`, `commit_docs`, `roadmap_exists`.
37
+
38
+ Also read STATE.md and ROADMAP.md content for parsing current position.
39
+ </step>
40
+
41
+ <step name="validate_future_phase">
42
+ Verify the phase is a future phase (not started):
43
+
44
+ 1. Compare target phase to current phase from STATE.md
45
+ 2. Target must be > current phase number
46
+
47
+ If target <= current phase:
48
+
49
+ ```
50
+ ERROR: Cannot remove Phase {target}
51
+
52
+ Only future phases can be removed:
53
+ - Current phase: {current}
54
+ - Phase {target} is current or completed
55
+
56
+ To abandon current work, use /mindforge-pause-work instead.
57
+ ```
58
+
59
+ Exit.
60
+ </step>
61
+
62
+ <step name="confirm_removal">
63
+ Present removal summary and confirm:
64
+
65
+ ```
66
+ Removing Phase {target}: {Name}
67
+
68
+ This will:
69
+ - Delete: .planning/phases/{target}-{slug}/
70
+ - Renumber all subsequent phases
71
+ - Update: ROADMAP.md, STATE.md
72
+
73
+ Proceed? (y/n)
74
+ ```
75
+
76
+ Wait for confirmation.
77
+ </step>
78
+
79
+ <step name="execute_removal">
80
+ **Delegate the entire removal operation to mindforge-tools:**
81
+
82
+ ```bash
83
+ RESULT=$(node ".agent/bin/mindforge-tools.cjs" phase remove "${target}")
84
+ ```
85
+
86
+ If the phase has executed plans (SUMMARY.md files), mindforge-tools will error. Use `--force` only if the user confirms:
87
+
88
+ ```bash
89
+ RESULT=$(node ".agent/bin/mindforge-tools.cjs" phase remove "${target}" --force)
90
+ ```
91
+
92
+ The CLI handles:
93
+ - Deleting the phase directory
94
+ - Renumbering all subsequent directories (in reverse order to avoid conflicts)
95
+ - Renaming all files inside renumbered directories (PLAN.md, SUMMARY.md, etc.)
96
+ - Updating ROADMAP.md (removing section, renumbering all phase references, updating dependencies)
97
+ - Updating STATE.md (decrementing phase count)
98
+
99
+ Extract from result: `removed`, `directory_deleted`, `renamed_directories`, `renamed_files`, `roadmap_updated`, `state_updated`.
100
+ </step>
101
+
102
+ <step name="commit">
103
+ Stage and commit the removal:
104
+
105
+ ```bash
106
+ node ".agent/bin/mindforge-tools.cjs" commit "chore: remove phase {target} ({original-phase-name})" --files .planning/
107
+ ```
108
+
109
+ The commit message preserves the historical record of what was removed.
110
+ </step>
111
+
112
+ <step name="completion">
113
+ Present completion summary:
114
+
115
+ ```
116
+ Phase {target} ({original-name}) removed.
117
+
118
+ Changes:
119
+ - Deleted: .planning/phases/{target}-{slug}/
120
+ - Renumbered: {N} directories and {M} files
121
+ - Updated: ROADMAP.md, STATE.md
122
+ - Committed: chore: remove phase {target} ({original-name})
123
+
124
+ ---
125
+
126
+ ## What's Next
127
+
128
+ Would you like to:
129
+ - `/mindforge-progress` — see updated roadmap status
130
+ - Continue with current phase
131
+ - Review roadmap
132
+
133
+ ---
134
+ ```
135
+ </step>
136
+
137
+ </process>
138
+
139
+ <anti_patterns>
140
+
141
+ - Don't remove completed phases (have SUMMARY.md files) without --force
142
+ - Don't remove current or past phases
143
+ - Don't manually renumber — use `mindforge-tools phase remove` which handles all renumbering
144
+ - Don't add "removed phase" notes to STATE.md — git commit is the record
145
+ - Don't modify completed phase directories
146
+ </anti_patterns>
147
+
148
+ <success_criteria>
149
+ Phase removal is complete when:
150
+
151
+ - [ ] Target phase validated as future/unstarted
152
+ - [ ] `mindforge-tools phase remove` executed successfully
153
+ - [ ] Changes committed with descriptive message
154
+ - [ ] User informed of changes
155
+ </success_criteria>
@@ -0,0 +1,90 @@
1
+ <purpose>
2
+ Remove a MindForge workspace, cleaning up git worktrees and deleting the workspace directory.
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
+ ## 1. Setup
12
+
13
+ Extract workspace name from $ARGUMENTS.
14
+
15
+ ```bash
16
+ INIT=$(node ".agent/bin/mindforge-tools.cjs" init remove-workspace "$WORKSPACE_NAME")
17
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
18
+ ```
19
+
20
+ Parse JSON for: `workspace_name`, `workspace_path`, `has_manifest`, `strategy`, `repos`, `repo_count`, `dirty_repos`, `has_dirty_repos`.
21
+
22
+ **If no workspace name provided:**
23
+
24
+ First run `/mindforge-list-workspaces` to show available workspaces, then ask:
25
+
26
+ Use AskUserQuestion:
27
+ - header: "Remove Workspace"
28
+ - question: "Which workspace do you want to remove?"
29
+ - requireAnswer: true
30
+
31
+ Re-run init with the provided name.
32
+
33
+ ## 2. Safety Checks
34
+
35
+ **If `has_dirty_repos` is true:**
36
+
37
+ ```
38
+ Cannot remove workspace "$WORKSPACE_NAME" — the following repos have uncommitted changes:
39
+
40
+ - repo1
41
+ - repo2
42
+
43
+ Commit or stash changes in these repos before removing the workspace:
44
+ cd $WORKSPACE_PATH/repo1
45
+ git stash # or git commit
46
+ ```
47
+
48
+ Exit. Do NOT proceed.
49
+
50
+ ## 3. Confirm Removal
51
+
52
+ Use AskUserQuestion:
53
+ - header: "Confirm Removal"
54
+ - question: "Remove workspace '$WORKSPACE_NAME' at $WORKSPACE_PATH? This will delete all files in the workspace directory. Type the workspace name to confirm:"
55
+ - requireAnswer: true
56
+
57
+ **If answer does not match `$WORKSPACE_NAME`:** Exit with "Removal cancelled."
58
+
59
+ ## 4. Clean Up Worktrees
60
+
61
+ **If strategy is `worktree`:**
62
+
63
+ For each repo in the workspace:
64
+
65
+ ```bash
66
+ cd "$SOURCE_REPO_PATH"
67
+ git worktree remove "$WORKSPACE_PATH/$REPO_NAME" 2>&1 || true
68
+ ```
69
+
70
+ If `git worktree remove` fails, warn but continue:
71
+ ```
72
+ Warning: Could not remove worktree for $REPO_NAME — source repo may have been moved or deleted.
73
+ ```
74
+
75
+ ## 5. Delete Workspace Directory
76
+
77
+ ```bash
78
+ rm -rf "$WORKSPACE_PATH"
79
+ ```
80
+
81
+ ## 6. Report
82
+
83
+ ```
84
+ Workspace "$WORKSPACE_NAME" removed.
85
+
86
+ Path: $WORKSPACE_PATH (deleted)
87
+ Repos: $REPO_COUNT worktrees cleaned up
88
+ ```
89
+
90
+ </process>
@@ -0,0 +1,74 @@
1
+ <purpose>
2
+ Research how to implement a phase. Spawns mindforge-phase-researcher with phase context.
3
+
4
+ Standalone research command. For most workflows, use `/mindforge-plan-phase` which integrates research automatically.
5
+ </purpose>
6
+
7
+ <process>
8
+
9
+ ## Step 0: Resolve Model Profile
10
+
11
+ @.agent/references/model-profile-resolution.md
12
+
13
+ Resolve model for:
14
+ - `mindforge-phase-researcher`
15
+
16
+ ## Step 1: Normalize and Validate Phase
17
+
18
+ @.agent/references/phase-argument-parsing.md
19
+
20
+ ```bash
21
+ PHASE_INFO=$(node ".agent/bin/mindforge-tools.cjs" roadmap get-phase "${PHASE}")
22
+ ```
23
+
24
+ If `found` is false: Error and exit.
25
+
26
+ ## Step 2: Check Existing Research
27
+
28
+ ```bash
29
+ ls .planning/phases/${PHASE}-*/RESEARCH.md 2>/dev/null
30
+ ```
31
+
32
+ If exists: Offer update/view/skip options.
33
+
34
+ ## Step 3: Gather Phase Context
35
+
36
+ ```bash
37
+ INIT=$(node ".agent/bin/mindforge-tools.cjs" init phase-op "${PHASE}")
38
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
39
+ # Extract: phase_dir, padded_phase, phase_number, state_path, requirements_path, context_path
40
+ ```
41
+
42
+ ## Step 4: Spawn Researcher
43
+
44
+ ```
45
+ Task(
46
+ prompt="<objective>
47
+ Research implementation approach for Phase {phase}: {name}
48
+ </objective>
49
+
50
+ <files_to_read>
51
+ - {context_path} (USER DECISIONS from /mindforge-discuss-phase)
52
+ - {requirements_path} (Project requirements)
53
+ - {state_path} (Project decisions and history)
54
+ </files_to_read>
55
+
56
+ <additional_context>
57
+ Phase description: {description}
58
+ </additional_context>
59
+
60
+ <output>
61
+ Write to: .planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md
62
+ </output>",
63
+ subagent_type="mindforge-phase-researcher",
64
+ model="{researcher_model}"
65
+ )
66
+ ```
67
+
68
+ ## Step 5: Handle Return
69
+
70
+ - `## RESEARCH COMPLETE` — Display summary, offer: Plan/Dig deeper/Review/Done
71
+ - `## CHECKPOINT REACHED` — Present to user, spawn continuation
72
+ - `## RESEARCH INCONCLUSIVE` — Show attempts, offer: Add context/Try different mode/Manual
73
+
74
+ </process>
@@ -0,0 +1,325 @@
1
+ <trigger>
2
+ Use this workflow when:
3
+ - Starting a new session on an existing project
4
+ - User says "continue", "what's next", "where were we", "resume"
5
+ - Any planning operation when .planning/ already exists
6
+ - User returns after time away from project
7
+ </trigger>
8
+
9
+ <purpose>
10
+ Instantly restore full project context so "Where were we?" has an immediate, complete answer.
11
+ </purpose>
12
+
13
+ <required_reading>
14
+ @.agent/references/continuation-format.md
15
+ </required_reading>
16
+
17
+ <process>
18
+
19
+ <step name="initialize">
20
+ Load all context in one call:
21
+
22
+ ```bash
23
+ INIT=$(node ".agent/bin/mindforge-tools.cjs" init resume)
24
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
25
+ ```
26
+
27
+ Parse JSON for: `state_exists`, `roadmap_exists`, `project_exists`, `planning_exists`, `has_interrupted_agent`, `interrupted_agent_id`, `commit_docs`.
28
+
29
+ **If `state_exists` is true:** Proceed to load_state
30
+ **If `state_exists` is false but `roadmap_exists` or `project_exists` is true:** Offer to reconstruct STATE.md
31
+ **If `planning_exists` is false:** This is a new project - route to /mindforge-new-project
32
+ </step>
33
+
34
+ <step name="load_state">
35
+
36
+ Read and parse STATE.md, then PROJECT.md:
37
+
38
+ ```bash
39
+ cat .planning/STATE.md
40
+ cat .planning/PROJECT.md
41
+ ```
42
+
43
+ **From STATE.md extract:**
44
+
45
+ - **Project Reference**: Core value and current focus
46
+ - **Current Position**: Phase X of Y, Plan A of B, Status
47
+ - **Progress**: Visual progress bar
48
+ - **Recent Decisions**: Key decisions affecting current work
49
+ - **Pending Todos**: Ideas captured during sessions
50
+ - **Blockers/Concerns**: Issues carried forward
51
+ - **Session Continuity**: Where we left off, any resume files
52
+
53
+ **From PROJECT.md extract:**
54
+
55
+ - **What This Is**: Current accurate description
56
+ - **Requirements**: Validated, Active, Out of Scope
57
+ - **Key Decisions**: Full decision log with outcomes
58
+ - **Constraints**: Hard limits on implementation
59
+
60
+ </step>
61
+
62
+ <step name="check_incomplete_work">
63
+ Look for incomplete work that needs attention:
64
+
65
+ ```bash
66
+ # Check for structured handoff (preferred — machine-readable)
67
+ cat .planning/HANDOFF.json 2>/dev/null
68
+
69
+ # Check for continue-here files (mid-plan resumption)
70
+ ls .planning/phases/*/.continue-here*.md 2>/dev/null
71
+
72
+ # Check for plans without summaries (incomplete execution)
73
+ for plan in .planning/phases/*/*-PLAN.md; do
74
+ summary="${plan/PLAN/SUMMARY}"
75
+ [ ! -f "$summary" ] && echo "Incomplete: $plan"
76
+ done 2>/dev/null
77
+
78
+ # Check for interrupted agents (use has_interrupted_agent and interrupted_agent_id from init)
79
+ if [ "$has_interrupted_agent" = "true" ]; then
80
+ echo "Interrupted agent: $interrupted_agent_id"
81
+ fi
82
+ ```
83
+
84
+ **If HANDOFF.json exists:**
85
+
86
+ - This is the primary resumption source — structured data from `/mindforge-pause-work`
87
+ - Parse `status`, `phase`, `plan`, `task`, `total_tasks`, `next_action`
88
+ - Check `blockers` and `human_actions_pending` — surface these immediately
89
+ - Check `completed_tasks` for `in_progress` items — these need attention first
90
+ - Validate `uncommitted_files` against `git status` — flag divergence
91
+ - Use `context_notes` to restore mental model
92
+ - Flag: "Found structured handoff — resuming from task {task}/{total_tasks}"
93
+ - **After successful resumption, delete HANDOFF.json** (it's a one-shot artifact)
94
+
95
+ **If .continue-here file exists (fallback):**
96
+
97
+ - This is a mid-plan resumption point
98
+ - Read the file for specific resumption context
99
+ - Flag: "Found mid-plan checkpoint"
100
+
101
+ **If PLAN without SUMMARY exists:**
102
+
103
+ - Execution was started but not completed
104
+ - Flag: "Found incomplete plan execution"
105
+
106
+ **If interrupted agent found:**
107
+
108
+ - Subagent was spawned but session ended before completion
109
+ - Read agent-history.json for task details
110
+ - Flag: "Found interrupted agent"
111
+ </step>
112
+
113
+ <step name="present_status">
114
+ Present complete project status to user:
115
+
116
+ ```
117
+ ╔══════════════════════════════════════════════════════════════╗
118
+ ║ PROJECT STATUS ║
119
+ ╠══════════════════════════════════════════════════════════════╣
120
+ ║ Building: [one-liner from PROJECT.md "What This Is"] ║
121
+ ║ ║
122
+ ║ Phase: [X] of [Y] - [Phase name] ║
123
+ ║ Plan: [A] of [B] - [Status] ║
124
+ ║ Progress: [██████░░░░] XX% ║
125
+ ║ ║
126
+ ║ Last activity: [date] - [what happened] ║
127
+ ╚══════════════════════════════════════════════════════════════╝
128
+
129
+ [If incomplete work found:]
130
+ ⚠️ Incomplete work detected:
131
+ - [.continue-here file or incomplete plan]
132
+
133
+ [If interrupted agent found:]
134
+ ⚠️ Interrupted agent detected:
135
+ Agent ID: [id]
136
+ Task: [task description from agent-history.json]
137
+ Interrupted: [timestamp]
138
+
139
+ Resume with: Task tool (resume parameter with agent ID)
140
+
141
+ [If pending todos exist:]
142
+ 📋 [N] pending todos — /mindforge-check-todos to review
143
+
144
+ [If blockers exist:]
145
+ ⚠️ Carried concerns:
146
+ - [blocker 1]
147
+ - [blocker 2]
148
+
149
+ [If alignment is not ✓:]
150
+ ⚠️ Brief alignment: [status] - [assessment]
151
+ ```
152
+
153
+ </step>
154
+
155
+ <step name="determine_next_action">
156
+ Based on project state, determine the most logical next action:
157
+
158
+ **If interrupted agent exists:**
159
+ → Primary: Resume interrupted agent (Task tool with resume parameter)
160
+ → Option: Start fresh (abandon agent work)
161
+
162
+ **If HANDOFF.json exists:**
163
+ → Primary: Resume from structured handoff (highest priority — specific task/blocker context)
164
+ → Option: Discard handoff and reassess from files
165
+
166
+ **If .continue-here file exists:**
167
+ → Fallback: Resume from checkpoint
168
+ → Option: Start fresh on current plan
169
+
170
+ **If incomplete plan (PLAN without SUMMARY):**
171
+ → Primary: Complete the incomplete plan
172
+ → Option: Abandon and move on
173
+
174
+ **If phase in progress, all plans complete:**
175
+ → Primary: Advance to next phase (via internal transition workflow)
176
+ → Option: Review completed work
177
+
178
+ **If phase ready to plan:**
179
+ → Check if CONTEXT.md exists for this phase:
180
+
181
+ - If CONTEXT.md missing:
182
+ → Primary: Discuss phase vision (how user imagines it working)
183
+ → Secondary: Plan directly (skip context gathering)
184
+ - If CONTEXT.md exists:
185
+ → Primary: Plan the phase
186
+ → Option: Review roadmap
187
+
188
+ **If phase ready to execute:**
189
+ → Primary: Execute next plan
190
+ → Option: Review the plan first
191
+ </step>
192
+
193
+ <step name="offer_options">
194
+ Present contextual options based on project state:
195
+
196
+ ```
197
+ What would you like to do?
198
+
199
+ [Primary action based on state - e.g.:]
200
+ 1. Resume interrupted agent [if interrupted agent found]
201
+ OR
202
+ 1. Execute phase (/mindforge-execute-phase {phase} ${MindForge_WS})
203
+ OR
204
+ 1. Discuss Phase 3 context (/mindforge-discuss-phase 3 ${MindForge_WS}) [if CONTEXT.md missing]
205
+ OR
206
+ 1. Plan Phase 3 (/mindforge-plan-phase 3 ${MindForge_WS}) [if CONTEXT.md exists or discuss option declined]
207
+
208
+ [Secondary options:]
209
+ 2. Review current phase status
210
+ 3. Check pending todos ([N] pending)
211
+ 4. Review brief alignment
212
+ 5. Something else
213
+ ```
214
+
215
+ **Note:** When offering phase planning, check for CONTEXT.md existence first:
216
+
217
+ ```bash
218
+ ls .planning/phases/XX-name/*-CONTEXT.md 2>/dev/null
219
+ ```
220
+
221
+ If missing, suggest discuss-phase before plan. If exists, offer plan directly.
222
+
223
+ Wait for user selection.
224
+ </step>
225
+
226
+ <step name="route_to_workflow">
227
+ Based on user selection, route to appropriate workflow:
228
+
229
+ - **Execute plan** → Show command for user to run after clearing:
230
+ ```
231
+ ---
232
+
233
+ ## ▶ Next Up
234
+
235
+ **{phase}-{plan}: [Plan Name]** — [objective from PLAN.md]
236
+
237
+ `/mindforge-execute-phase {phase} ${MindForge_WS}`
238
+
239
+ <sub>`/clear` first → fresh context window</sub>
240
+
241
+ ---
242
+ ```
243
+ - **Plan phase** → Show command for user to run after clearing:
244
+ ```
245
+ ---
246
+
247
+ ## ▶ Next Up
248
+
249
+ **Phase [N]: [Name]** — [Goal from ROADMAP.md]
250
+
251
+ `/mindforge-plan-phase [phase-number] ${MindForge_WS}`
252
+
253
+ <sub>`/clear` first → fresh context window</sub>
254
+
255
+ ---
256
+
257
+ **Also available:**
258
+ - `/mindforge-discuss-phase [N] ${MindForge_WS}` — gather context first
259
+ - `/mindforge-research-phase [N] ${MindForge_WS}` — investigate unknowns
260
+
261
+ ---
262
+ ```
263
+ - **Advance to next phase** → ./transition.md (internal workflow, invoked inline — NOT a user command)
264
+ - **Check todos** → Read .planning/todos/pending/, present summary
265
+ - **Review alignment** → Read PROJECT.md, compare to current state
266
+ - **Something else** → Ask what they need
267
+ </step>
268
+
269
+ <step name="update_session">
270
+ Before proceeding to routed workflow, update session continuity:
271
+
272
+ Update STATE.md:
273
+
274
+ ```markdown
275
+ ## Session Continuity
276
+
277
+ Last session: [now]
278
+ Stopped at: Session resumed, proceeding to [action]
279
+ Resume file: [updated if applicable]
280
+ ```
281
+
282
+ This ensures if session ends unexpectedly, next resume knows the state.
283
+ </step>
284
+
285
+ </process>
286
+
287
+ <reconstruction>
288
+ If STATE.md is missing but other artifacts exist:
289
+
290
+ "STATE.md missing. Reconstructing from artifacts..."
291
+
292
+ 1. Read PROJECT.md → Extract "What This Is" and Core Value
293
+ 2. Read ROADMAP.md → Determine phases, find current position
294
+ 3. Scan \*-SUMMARY.md files → Extract decisions, concerns
295
+ 4. Count pending todos in .planning/todos/pending/
296
+ 5. Check for .continue-here files → Session continuity
297
+
298
+ Reconstruct and write STATE.md, then proceed normally.
299
+
300
+ This handles cases where:
301
+
302
+ - Project predates STATE.md introduction
303
+ - File was accidentally deleted
304
+ - Cloning repo without full .planning/ state
305
+ </reconstruction>
306
+
307
+ <quick_resume>
308
+ If user says "continue" or "go":
309
+ - Load state silently
310
+ - Determine primary action
311
+ - Execute immediately without presenting options
312
+
313
+ "Continuing from [state]... [action]"
314
+ </quick_resume>
315
+
316
+ <success_criteria>
317
+ Resume is complete when:
318
+
319
+ - [ ] STATE.md loaded (or reconstructed)
320
+ - [ ] Incomplete work detected and flagged
321
+ - [ ] Clear status presented to user
322
+ - [ ] Contextual next actions offered
323
+ - [ ] User knows exactly where project stands
324
+ - [ ] Session continuity updated
325
+ </success_criteria>