gsd-code-first 1.0.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 (238) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja-JP.md +834 -0
  3. package/README.ko-KR.md +823 -0
  4. package/README.md +937 -0
  5. package/README.pt-BR.md +452 -0
  6. package/README.zh-CN.md +800 -0
  7. package/agents/gsd-advisor-researcher.md +104 -0
  8. package/agents/gsd-annotator.md +148 -0
  9. package/agents/gsd-arc-executor.md +537 -0
  10. package/agents/gsd-arc-planner.md +374 -0
  11. package/agents/gsd-assumptions-analyzer.md +105 -0
  12. package/agents/gsd-code-planner.md +155 -0
  13. package/agents/gsd-codebase-mapper.md +770 -0
  14. package/agents/gsd-debugger.md +1373 -0
  15. package/agents/gsd-executor.md +509 -0
  16. package/agents/gsd-integration-checker.md +443 -0
  17. package/agents/gsd-nyquist-auditor.md +176 -0
  18. package/agents/gsd-phase-researcher.md +698 -0
  19. package/agents/gsd-plan-checker.md +773 -0
  20. package/agents/gsd-planner.md +1354 -0
  21. package/agents/gsd-project-researcher.md +654 -0
  22. package/agents/gsd-prototyper.md +161 -0
  23. package/agents/gsd-research-synthesizer.md +247 -0
  24. package/agents/gsd-roadmapper.md +679 -0
  25. package/agents/gsd-ui-auditor.md +439 -0
  26. package/agents/gsd-ui-checker.md +300 -0
  27. package/agents/gsd-ui-researcher.md +357 -0
  28. package/agents/gsd-user-profiler.md +171 -0
  29. package/agents/gsd-verifier.md +700 -0
  30. package/bin/install.js +5009 -0
  31. package/commands/gsd/add-backlog.md +76 -0
  32. package/commands/gsd/add-phase.md +43 -0
  33. package/commands/gsd/add-tests.md +41 -0
  34. package/commands/gsd/add-todo.md +47 -0
  35. package/commands/gsd/annotate.md +54 -0
  36. package/commands/gsd/audit-milestone.md +36 -0
  37. package/commands/gsd/audit-uat.md +24 -0
  38. package/commands/gsd/autonomous.md +41 -0
  39. package/commands/gsd/check-todos.md +45 -0
  40. package/commands/gsd/cleanup.md +18 -0
  41. package/commands/gsd/complete-milestone.md +136 -0
  42. package/commands/gsd/debug.md +173 -0
  43. package/commands/gsd/deep-plan.md +52 -0
  44. package/commands/gsd/discuss-phase.md +64 -0
  45. package/commands/gsd/do.md +30 -0
  46. package/commands/gsd/execute-phase.md +59 -0
  47. package/commands/gsd/extract-plan.md +35 -0
  48. package/commands/gsd/fast.md +30 -0
  49. package/commands/gsd/forensics.md +56 -0
  50. package/commands/gsd/health.md +22 -0
  51. package/commands/gsd/help.md +22 -0
  52. package/commands/gsd/insert-phase.md +32 -0
  53. package/commands/gsd/iterate.md +124 -0
  54. package/commands/gsd/join-discord.md +18 -0
  55. package/commands/gsd/list-phase-assumptions.md +46 -0
  56. package/commands/gsd/list-workspaces.md +19 -0
  57. package/commands/gsd/manager.md +39 -0
  58. package/commands/gsd/map-codebase.md +71 -0
  59. package/commands/gsd/milestone-summary.md +51 -0
  60. package/commands/gsd/new-milestone.md +44 -0
  61. package/commands/gsd/new-project.md +42 -0
  62. package/commands/gsd/new-workspace.md +44 -0
  63. package/commands/gsd/next.md +24 -0
  64. package/commands/gsd/note.md +34 -0
  65. package/commands/gsd/pause-work.md +38 -0
  66. package/commands/gsd/plan-milestone-gaps.md +34 -0
  67. package/commands/gsd/plan-phase.md +47 -0
  68. package/commands/gsd/plant-seed.md +28 -0
  69. package/commands/gsd/pr-branch.md +25 -0
  70. package/commands/gsd/profile-user.md +46 -0
  71. package/commands/gsd/progress.md +24 -0
  72. package/commands/gsd/prototype.md +56 -0
  73. package/commands/gsd/quick.md +47 -0
  74. package/commands/gsd/reapply-patches.md +123 -0
  75. package/commands/gsd/remove-phase.md +31 -0
  76. package/commands/gsd/remove-workspace.md +26 -0
  77. package/commands/gsd/research-phase.md +195 -0
  78. package/commands/gsd/resume-work.md +40 -0
  79. package/commands/gsd/review-backlog.md +61 -0
  80. package/commands/gsd/review.md +37 -0
  81. package/commands/gsd/session-report.md +19 -0
  82. package/commands/gsd/set-mode.md +41 -0
  83. package/commands/gsd/set-profile.md +12 -0
  84. package/commands/gsd/settings.md +36 -0
  85. package/commands/gsd/ship.md +23 -0
  86. package/commands/gsd/stats.md +18 -0
  87. package/commands/gsd/thread.md +127 -0
  88. package/commands/gsd/ui-phase.md +34 -0
  89. package/commands/gsd/ui-review.md +32 -0
  90. package/commands/gsd/update.md +37 -0
  91. package/commands/gsd/validate-phase.md +35 -0
  92. package/commands/gsd/verify-work.md +38 -0
  93. package/commands/gsd/workstreams.md +63 -0
  94. package/get-shit-done/bin/gsd-tools.cjs +946 -0
  95. package/get-shit-done/bin/lib/arc-scanner.cjs +341 -0
  96. package/get-shit-done/bin/lib/commands.cjs +959 -0
  97. package/get-shit-done/bin/lib/config.cjs +466 -0
  98. package/get-shit-done/bin/lib/core.cjs +1230 -0
  99. package/get-shit-done/bin/lib/frontmatter.cjs +336 -0
  100. package/get-shit-done/bin/lib/init.cjs +1442 -0
  101. package/get-shit-done/bin/lib/milestone.cjs +252 -0
  102. package/get-shit-done/bin/lib/model-profiles.cjs +68 -0
  103. package/get-shit-done/bin/lib/phase.cjs +888 -0
  104. package/get-shit-done/bin/lib/profile-output.cjs +952 -0
  105. package/get-shit-done/bin/lib/profile-pipeline.cjs +539 -0
  106. package/get-shit-done/bin/lib/roadmap.cjs +329 -0
  107. package/get-shit-done/bin/lib/security.cjs +382 -0
  108. package/get-shit-done/bin/lib/state.cjs +1031 -0
  109. package/get-shit-done/bin/lib/template.cjs +222 -0
  110. package/get-shit-done/bin/lib/uat.cjs +282 -0
  111. package/get-shit-done/bin/lib/verify.cjs +888 -0
  112. package/get-shit-done/bin/lib/workstream.cjs +491 -0
  113. package/get-shit-done/commands/gsd/workstreams.md +63 -0
  114. package/get-shit-done/references/arc-standard.md +315 -0
  115. package/get-shit-done/references/checkpoints.md +778 -0
  116. package/get-shit-done/references/continuation-format.md +249 -0
  117. package/get-shit-done/references/decimal-phase-calculation.md +64 -0
  118. package/get-shit-done/references/git-integration.md +295 -0
  119. package/get-shit-done/references/git-planning-commit.md +38 -0
  120. package/get-shit-done/references/model-profile-resolution.md +36 -0
  121. package/get-shit-done/references/model-profiles.md +139 -0
  122. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  123. package/get-shit-done/references/planning-config.md +202 -0
  124. package/get-shit-done/references/questioning.md +162 -0
  125. package/get-shit-done/references/tdd.md +263 -0
  126. package/get-shit-done/references/ui-brand.md +160 -0
  127. package/get-shit-done/references/user-profiling.md +681 -0
  128. package/get-shit-done/references/verification-patterns.md +612 -0
  129. package/get-shit-done/references/workstream-flag.md +58 -0
  130. package/get-shit-done/templates/DEBUG.md +164 -0
  131. package/get-shit-done/templates/UAT.md +265 -0
  132. package/get-shit-done/templates/UI-SPEC.md +100 -0
  133. package/get-shit-done/templates/VALIDATION.md +76 -0
  134. package/get-shit-done/templates/claude-md.md +122 -0
  135. package/get-shit-done/templates/codebase/architecture.md +255 -0
  136. package/get-shit-done/templates/codebase/concerns.md +310 -0
  137. package/get-shit-done/templates/codebase/conventions.md +307 -0
  138. package/get-shit-done/templates/codebase/integrations.md +280 -0
  139. package/get-shit-done/templates/codebase/stack.md +186 -0
  140. package/get-shit-done/templates/codebase/structure.md +285 -0
  141. package/get-shit-done/templates/codebase/testing.md +480 -0
  142. package/get-shit-done/templates/config.json +44 -0
  143. package/get-shit-done/templates/context.md +352 -0
  144. package/get-shit-done/templates/continue-here.md +78 -0
  145. package/get-shit-done/templates/copilot-instructions.md +7 -0
  146. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  147. package/get-shit-done/templates/dev-preferences.md +21 -0
  148. package/get-shit-done/templates/discovery.md +146 -0
  149. package/get-shit-done/templates/discussion-log.md +63 -0
  150. package/get-shit-done/templates/milestone-archive.md +123 -0
  151. package/get-shit-done/templates/milestone.md +115 -0
  152. package/get-shit-done/templates/phase-prompt.md +610 -0
  153. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  154. package/get-shit-done/templates/project.md +186 -0
  155. package/get-shit-done/templates/requirements.md +231 -0
  156. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  157. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  158. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  159. package/get-shit-done/templates/research-project/STACK.md +120 -0
  160. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  161. package/get-shit-done/templates/research.md +552 -0
  162. package/get-shit-done/templates/retrospective.md +54 -0
  163. package/get-shit-done/templates/roadmap.md +202 -0
  164. package/get-shit-done/templates/state.md +176 -0
  165. package/get-shit-done/templates/summary-complex.md +59 -0
  166. package/get-shit-done/templates/summary-minimal.md +41 -0
  167. package/get-shit-done/templates/summary-standard.md +48 -0
  168. package/get-shit-done/templates/summary.md +248 -0
  169. package/get-shit-done/templates/user-profile.md +146 -0
  170. package/get-shit-done/templates/user-setup.md +311 -0
  171. package/get-shit-done/templates/verification-report.md +322 -0
  172. package/get-shit-done/workflows/add-phase.md +112 -0
  173. package/get-shit-done/workflows/add-tests.md +351 -0
  174. package/get-shit-done/workflows/add-todo.md +158 -0
  175. package/get-shit-done/workflows/audit-milestone.md +340 -0
  176. package/get-shit-done/workflows/audit-uat.md +109 -0
  177. package/get-shit-done/workflows/autonomous.md +891 -0
  178. package/get-shit-done/workflows/check-todos.md +177 -0
  179. package/get-shit-done/workflows/cleanup.md +152 -0
  180. package/get-shit-done/workflows/complete-milestone.md +767 -0
  181. package/get-shit-done/workflows/diagnose-issues.md +231 -0
  182. package/get-shit-done/workflows/discovery-phase.md +289 -0
  183. package/get-shit-done/workflows/discuss-phase-assumptions.md +653 -0
  184. package/get-shit-done/workflows/discuss-phase.md +1049 -0
  185. package/get-shit-done/workflows/do.md +104 -0
  186. package/get-shit-done/workflows/execute-phase.md +846 -0
  187. package/get-shit-done/workflows/execute-plan.md +514 -0
  188. package/get-shit-done/workflows/fast.md +105 -0
  189. package/get-shit-done/workflows/forensics.md +265 -0
  190. package/get-shit-done/workflows/health.md +181 -0
  191. package/get-shit-done/workflows/help.md +634 -0
  192. package/get-shit-done/workflows/insert-phase.md +130 -0
  193. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  194. package/get-shit-done/workflows/list-workspaces.md +56 -0
  195. package/get-shit-done/workflows/manager.md +362 -0
  196. package/get-shit-done/workflows/map-codebase.md +377 -0
  197. package/get-shit-done/workflows/milestone-summary.md +223 -0
  198. package/get-shit-done/workflows/new-milestone.md +486 -0
  199. package/get-shit-done/workflows/new-project.md +1250 -0
  200. package/get-shit-done/workflows/new-workspace.md +237 -0
  201. package/get-shit-done/workflows/next.md +97 -0
  202. package/get-shit-done/workflows/node-repair.md +92 -0
  203. package/get-shit-done/workflows/note.md +156 -0
  204. package/get-shit-done/workflows/pause-work.md +176 -0
  205. package/get-shit-done/workflows/plan-milestone-gaps.md +273 -0
  206. package/get-shit-done/workflows/plan-phase.md +859 -0
  207. package/get-shit-done/workflows/plant-seed.md +169 -0
  208. package/get-shit-done/workflows/pr-branch.md +129 -0
  209. package/get-shit-done/workflows/profile-user.md +450 -0
  210. package/get-shit-done/workflows/progress.md +507 -0
  211. package/get-shit-done/workflows/quick.md +757 -0
  212. package/get-shit-done/workflows/remove-phase.md +155 -0
  213. package/get-shit-done/workflows/remove-workspace.md +90 -0
  214. package/get-shit-done/workflows/research-phase.md +82 -0
  215. package/get-shit-done/workflows/resume-project.md +326 -0
  216. package/get-shit-done/workflows/review.md +228 -0
  217. package/get-shit-done/workflows/session-report.md +146 -0
  218. package/get-shit-done/workflows/settings.md +283 -0
  219. package/get-shit-done/workflows/ship.md +228 -0
  220. package/get-shit-done/workflows/stats.md +60 -0
  221. package/get-shit-done/workflows/transition.md +671 -0
  222. package/get-shit-done/workflows/ui-phase.md +302 -0
  223. package/get-shit-done/workflows/ui-review.md +165 -0
  224. package/get-shit-done/workflows/update.md +323 -0
  225. package/get-shit-done/workflows/validate-phase.md +174 -0
  226. package/get-shit-done/workflows/verify-phase.md +254 -0
  227. package/get-shit-done/workflows/verify-work.md +637 -0
  228. package/hooks/dist/gsd-check-update.js +114 -0
  229. package/hooks/dist/gsd-context-monitor.js +156 -0
  230. package/hooks/dist/gsd-prompt-guard.js +96 -0
  231. package/hooks/dist/gsd-statusline.js +119 -0
  232. package/hooks/dist/gsd-workflow-guard.js +94 -0
  233. package/package.json +52 -0
  234. package/scripts/base64-scan.sh +262 -0
  235. package/scripts/build-hooks.js +82 -0
  236. package/scripts/prompt-injection-scan.sh +198 -0
  237. package/scripts/run-tests.cjs +29 -0
  238. package/scripts/secret-scan.sh +227 -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: `/gsd:remove-phase 17` → phase = 17
15
+ - Example: `/gsd:remove-phase 16.1` → phase = 16.1
16
+
17
+ If no argument provided:
18
+
19
+ ```
20
+ ERROR: Phase number required
21
+ Usage: /gsd:remove-phase <phase-number>
22
+ Example: /gsd: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 "$HOME/.claude/get-shit-done/bin/gsd-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 /gsd: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 gsd-tools:**
81
+
82
+ ```bash
83
+ RESULT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phase remove "${target}")
84
+ ```
85
+
86
+ If the phase has executed plans (SUMMARY.md files), gsd-tools will error. Use `--force` only if the user confirms:
87
+
88
+ ```bash
89
+ RESULT=$(node "$HOME/.claude/get-shit-done/bin/gsd-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 "$HOME/.claude/get-shit-done/bin/gsd-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
+ - `/gsd: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 `gsd-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
+ - [ ] `gsd-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 GSD 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 "$HOME/.claude/get-shit-done/bin/gsd-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 `/gsd: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,82 @@
1
+ <purpose>
2
+ Research how to implement a phase. Spawns gsd-phase-researcher with phase context.
3
+
4
+ Standalone research command. For most workflows, use `/gsd:plan-phase` which integrates research automatically.
5
+ </purpose>
6
+
7
+ <available_agent_types>
8
+ Valid GSD subagent types (use exact names — do not fall back to 'general-purpose'):
9
+ - gsd-phase-researcher — Researches technical approaches for a phase
10
+ </available_agent_types>
11
+
12
+ <process>
13
+
14
+ ## Step 0: Resolve Model Profile
15
+
16
+ @~/.claude/get-shit-done/references/model-profile-resolution.md
17
+
18
+ Resolve model for:
19
+ - `gsd-phase-researcher`
20
+
21
+ ## Step 1: Normalize and Validate Phase
22
+
23
+ @~/.claude/get-shit-done/references/phase-argument-parsing.md
24
+
25
+ ```bash
26
+ PHASE_INFO=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}")
27
+ ```
28
+
29
+ If `found` is false: Error and exit.
30
+
31
+ ## Step 2: Check Existing Research
32
+
33
+ ```bash
34
+ ls .planning/phases/${PHASE}-*/RESEARCH.md 2>/dev/null || true
35
+ ```
36
+
37
+ If exists: Offer update/view/skip options.
38
+
39
+ ## Step 3: Gather Phase Context
40
+
41
+ ```bash
42
+ INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE}")
43
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
44
+ # Extract: phase_dir, padded_phase, phase_number, state_path, requirements_path, context_path
45
+ AGENT_SKILLS_RESEARCHER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-researcher 2>/dev/null)
46
+ ```
47
+
48
+ ## Step 4: Spawn Researcher
49
+
50
+ ```
51
+ Task(
52
+ prompt="<objective>
53
+ Research implementation approach for Phase {phase}: {name}
54
+ </objective>
55
+
56
+ <files_to_read>
57
+ - {context_path} (USER DECISIONS from /gsd:discuss-phase)
58
+ - {requirements_path} (Project requirements)
59
+ - {state_path} (Project decisions and history)
60
+ </files_to_read>
61
+
62
+ ${AGENT_SKILLS_RESEARCHER}
63
+
64
+ <additional_context>
65
+ Phase description: {description}
66
+ </additional_context>
67
+
68
+ <output>
69
+ Write to: .planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md
70
+ </output>",
71
+ subagent_type="gsd-phase-researcher",
72
+ model="{researcher_model}"
73
+ )
74
+ ```
75
+
76
+ ## Step 5: Handle Return
77
+
78
+ - `## RESEARCH COMPLETE` — Display summary, offer: Plan/Dig deeper/Review/Done
79
+ - `## CHECKPOINT REACHED` — Present to user, spawn continuation
80
+ - `## RESEARCH INCONCLUSIVE` — Show attempts, offer: Add context/Try different mode/Manual
81
+
82
+ </process>
@@ -0,0 +1,326 @@
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
+ @~/.claude/get-shit-done/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 "$HOME/.claude/get-shit-done/bin/gsd-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 /gsd: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 || true
68
+
69
+ # Check for continue-here files (mid-plan resumption)
70
+ ls .planning/phases/*/.continue-here*.md 2>/dev/null || true
71
+
72
+ # Check for plans without summaries (incomplete execution)
73
+ for plan in .planning/phases/*/*-PLAN.md; do
74
+ [ -e "$plan" ] || continue
75
+ summary="${plan/PLAN/SUMMARY}"
76
+ [ ! -f "$summary" ] && echo "Incomplete: $plan"
77
+ done 2>/dev/null || true
78
+
79
+ # Check for interrupted agents (use has_interrupted_agent and interrupted_agent_id from init)
80
+ if [ "$has_interrupted_agent" = "true" ]; then
81
+ echo "Interrupted agent: $interrupted_agent_id"
82
+ fi
83
+ ```
84
+
85
+ **If HANDOFF.json exists:**
86
+
87
+ - This is the primary resumption source — structured data from `/gsd:pause-work`
88
+ - Parse `status`, `phase`, `plan`, `task`, `total_tasks`, `next_action`
89
+ - Check `blockers` and `human_actions_pending` — surface these immediately
90
+ - Check `completed_tasks` for `in_progress` items — these need attention first
91
+ - Validate `uncommitted_files` against `git status` — flag divergence
92
+ - Use `context_notes` to restore mental model
93
+ - Flag: "Found structured handoff — resuming from task {task}/{total_tasks}"
94
+ - **After successful resumption, delete HANDOFF.json** (it's a one-shot artifact)
95
+
96
+ **If .continue-here file exists (fallback):**
97
+
98
+ - This is a mid-plan resumption point
99
+ - Read the file for specific resumption context
100
+ - Flag: "Found mid-plan checkpoint"
101
+
102
+ **If PLAN without SUMMARY exists:**
103
+
104
+ - Execution was started but not completed
105
+ - Flag: "Found incomplete plan execution"
106
+
107
+ **If interrupted agent found:**
108
+
109
+ - Subagent was spawned but session ended before completion
110
+ - Read agent-history.json for task details
111
+ - Flag: "Found interrupted agent"
112
+ </step>
113
+
114
+ <step name="present_status">
115
+ Present complete project status to user:
116
+
117
+ ```
118
+ ╔══════════════════════════════════════════════════════════════╗
119
+ ║ PROJECT STATUS ║
120
+ ╠══════════════════════════════════════════════════════════════╣
121
+ ║ Building: [one-liner from PROJECT.md "What This Is"] ║
122
+ ║ ║
123
+ ║ Phase: [X] of [Y] - [Phase name] ║
124
+ ║ Plan: [A] of [B] - [Status] ║
125
+ ║ Progress: [██████░░░░] XX% ║
126
+ ║ ║
127
+ ║ Last activity: [date] - [what happened] ║
128
+ ╚══════════════════════════════════════════════════════════════╝
129
+
130
+ [If incomplete work found:]
131
+ ⚠️ Incomplete work detected:
132
+ - [.continue-here file or incomplete plan]
133
+
134
+ [If interrupted agent found:]
135
+ ⚠️ Interrupted agent detected:
136
+ Agent ID: [id]
137
+ Task: [task description from agent-history.json]
138
+ Interrupted: [timestamp]
139
+
140
+ Resume with: Task tool (resume parameter with agent ID)
141
+
142
+ [If pending todos exist:]
143
+ 📋 [N] pending todos — /gsd:check-todos to review
144
+
145
+ [If blockers exist:]
146
+ ⚠️ Carried concerns:
147
+ - [blocker 1]
148
+ - [blocker 2]
149
+
150
+ [If alignment is not ✓:]
151
+ ⚠️ Brief alignment: [status] - [assessment]
152
+ ```
153
+
154
+ </step>
155
+
156
+ <step name="determine_next_action">
157
+ Based on project state, determine the most logical next action:
158
+
159
+ **If interrupted agent exists:**
160
+ → Primary: Resume interrupted agent (Task tool with resume parameter)
161
+ → Option: Start fresh (abandon agent work)
162
+
163
+ **If HANDOFF.json exists:**
164
+ → Primary: Resume from structured handoff (highest priority — specific task/blocker context)
165
+ → Option: Discard handoff and reassess from files
166
+
167
+ **If .continue-here file exists:**
168
+ → Fallback: Resume from checkpoint
169
+ → Option: Start fresh on current plan
170
+
171
+ **If incomplete plan (PLAN without SUMMARY):**
172
+ → Primary: Complete the incomplete plan
173
+ → Option: Abandon and move on
174
+
175
+ **If phase in progress, all plans complete:**
176
+ → Primary: Advance to next phase (via internal transition workflow)
177
+ → Option: Review completed work
178
+
179
+ **If phase ready to plan:**
180
+ → Check if CONTEXT.md exists for this phase:
181
+
182
+ - If CONTEXT.md missing:
183
+ → Primary: Discuss phase vision (how user imagines it working)
184
+ → Secondary: Plan directly (skip context gathering)
185
+ - If CONTEXT.md exists:
186
+ → Primary: Plan the phase
187
+ → Option: Review roadmap
188
+
189
+ **If phase ready to execute:**
190
+ → Primary: Execute next plan
191
+ → Option: Review the plan first
192
+ </step>
193
+
194
+ <step name="offer_options">
195
+ Present contextual options based on project state:
196
+
197
+ ```
198
+ What would you like to do?
199
+
200
+ [Primary action based on state - e.g.:]
201
+ 1. Resume interrupted agent [if interrupted agent found]
202
+ OR
203
+ 1. Execute phase (/gsd:execute-phase {phase} ${GSD_WS})
204
+ OR
205
+ 1. Discuss Phase 3 context (/gsd:discuss-phase 3 ${GSD_WS}) [if CONTEXT.md missing]
206
+ OR
207
+ 1. Plan Phase 3 (/gsd:plan-phase 3 ${GSD_WS}) [if CONTEXT.md exists or discuss option declined]
208
+
209
+ [Secondary options:]
210
+ 2. Review current phase status
211
+ 3. Check pending todos ([N] pending)
212
+ 4. Review brief alignment
213
+ 5. Something else
214
+ ```
215
+
216
+ **Note:** When offering phase planning, check for CONTEXT.md existence first:
217
+
218
+ ```bash
219
+ ls .planning/phases/XX-name/*-CONTEXT.md 2>/dev/null || true
220
+ ```
221
+
222
+ If missing, suggest discuss-phase before plan. If exists, offer plan directly.
223
+
224
+ Wait for user selection.
225
+ </step>
226
+
227
+ <step name="route_to_workflow">
228
+ Based on user selection, route to appropriate workflow:
229
+
230
+ - **Execute plan** → Show command for user to run after clearing:
231
+ ```
232
+ ---
233
+
234
+ ## ▶ Next Up
235
+
236
+ **{phase}-{plan}: [Plan Name]** — [objective from PLAN.md]
237
+
238
+ `/gsd:execute-phase {phase} ${GSD_WS}`
239
+
240
+ <sub>`/clear` first → fresh context window</sub>
241
+
242
+ ---
243
+ ```
244
+ - **Plan phase** → Show command for user to run after clearing:
245
+ ```
246
+ ---
247
+
248
+ ## ▶ Next Up
249
+
250
+ **Phase [N]: [Name]** — [Goal from ROADMAP.md]
251
+
252
+ `/gsd:plan-phase [phase-number] ${GSD_WS}`
253
+
254
+ <sub>`/clear` first → fresh context window</sub>
255
+
256
+ ---
257
+
258
+ **Also available:**
259
+ - `/gsd:discuss-phase [N] ${GSD_WS}` — gather context first
260
+ - `/gsd:research-phase [N] ${GSD_WS}` — investigate unknowns
261
+
262
+ ---
263
+ ```
264
+ - **Advance to next phase** → ./transition.md (internal workflow, invoked inline — NOT a user command)
265
+ - **Check todos** → Read .planning/todos/pending/, present summary
266
+ - **Review alignment** → Read PROJECT.md, compare to current state
267
+ - **Something else** → Ask what they need
268
+ </step>
269
+
270
+ <step name="update_session">
271
+ Before proceeding to routed workflow, update session continuity:
272
+
273
+ Update STATE.md:
274
+
275
+ ```markdown
276
+ ## Session Continuity
277
+
278
+ Last session: [now]
279
+ Stopped at: Session resumed, proceeding to [action]
280
+ Resume file: [updated if applicable]
281
+ ```
282
+
283
+ This ensures if session ends unexpectedly, next resume knows the state.
284
+ </step>
285
+
286
+ </process>
287
+
288
+ <reconstruction>
289
+ If STATE.md is missing but other artifacts exist:
290
+
291
+ "STATE.md missing. Reconstructing from artifacts..."
292
+
293
+ 1. Read PROJECT.md → Extract "What This Is" and Core Value
294
+ 2. Read ROADMAP.md → Determine phases, find current position
295
+ 3. Scan \*-SUMMARY.md files → Extract decisions, concerns
296
+ 4. Count pending todos in .planning/todos/pending/
297
+ 5. Check for .continue-here files → Session continuity
298
+
299
+ Reconstruct and write STATE.md, then proceed normally.
300
+
301
+ This handles cases where:
302
+
303
+ - Project predates STATE.md introduction
304
+ - File was accidentally deleted
305
+ - Cloning repo without full .planning/ state
306
+ </reconstruction>
307
+
308
+ <quick_resume>
309
+ If user says "continue" or "go":
310
+ - Load state silently
311
+ - Determine primary action
312
+ - Execute immediately without presenting options
313
+
314
+ "Continuing from [state]... [action]"
315
+ </quick_resume>
316
+
317
+ <success_criteria>
318
+ Resume is complete when:
319
+
320
+ - [ ] STATE.md loaded (or reconstructed)
321
+ - [ ] Incomplete work detected and flagged
322
+ - [ ] Clear status presented to user
323
+ - [ ] Contextual next actions offered
324
+ - [ ] User knows exactly where project stands
325
+ - [ ] Session continuity updated
326
+ </success_criteria>