gsd-opencode 1.10.2 → 1.20.1

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 (164) hide show
  1. package/agents/gsd-codebase-mapper.md +29 -3
  2. package/agents/gsd-debugger.md +19 -21
  3. package/agents/gsd-executor.md +213 -528
  4. package/agents/gsd-integration-checker.md +20 -0
  5. package/agents/gsd-phase-researcher.md +189 -267
  6. package/agents/gsd-plan-checker.md +278 -279
  7. package/agents/gsd-planner.md +299 -490
  8. package/agents/gsd-project-researcher.md +103 -345
  9. package/agents/gsd-research-synthesizer.md +5 -22
  10. package/agents/gsd-roadmapper.md +43 -6
  11. package/agents/gsd-verifier.md +158 -377
  12. package/{lib → bin/dm/lib}/constants.js +10 -3
  13. package/{src → bin/dm/src}/commands/install.js +5 -4
  14. package/{src → bin/dm/src}/commands/uninstall.js +3 -1
  15. package/{src → bin/dm/src}/services/backup-manager.js +1 -1
  16. package/{src → bin/dm/src}/services/config.js +1 -1
  17. package/{src → bin/dm/src}/services/file-ops.js +20 -4
  18. package/{src → bin/dm/src}/services/health-checker.js +3 -1
  19. package/{src → bin/dm/src}/services/repair-service.js +3 -1
  20. package/{src → bin/dm/src}/services/settings.js +1 -1
  21. package/{src → bin/dm/src}/services/update-service.js +2 -2
  22. package/bin/gsd-install.js +0 -0
  23. package/bin/gsd.js +9 -9
  24. package/commands/gsd/gsd-add-phase.md +43 -0
  25. package/commands/gsd/gsd-add-todo.md +47 -0
  26. package/commands/gsd/gsd-audit-milestone.md +36 -0
  27. package/commands/gsd/gsd-check-todos.md +45 -0
  28. package/commands/gsd/gsd-cleanup.md +18 -0
  29. package/commands/gsd/{complete-milestone.md → gsd-complete-milestone.md} +1 -1
  30. package/commands/gsd/{debug.md → gsd-debug.md} +16 -21
  31. package/commands/gsd/{discuss-phase.md → gsd-discuss-phase.md} +6 -9
  32. package/commands/gsd/gsd-execute-phase.md +41 -0
  33. package/commands/gsd/gsd-health.md +22 -0
  34. package/commands/gsd/gsd-help.md +22 -0
  35. package/commands/gsd/gsd-insert-phase.md +32 -0
  36. package/commands/gsd/gsd-join-discord.md +18 -0
  37. package/commands/gsd/{list-phase-assumptions.md → gsd-list-phase-assumptions.md} +3 -7
  38. package/commands/gsd/{map-codebase.md → gsd-map-codebase.md} +3 -3
  39. package/commands/gsd/gsd-new-milestone.md +44 -0
  40. package/commands/gsd/gsd-new-project.md +42 -0
  41. package/commands/gsd/gsd-pause-work.md +38 -0
  42. package/commands/gsd/gsd-plan-milestone-gaps.md +34 -0
  43. package/commands/gsd/gsd-plan-phase.md +44 -0
  44. package/commands/gsd/gsd-progress.md +24 -0
  45. package/commands/gsd/gsd-quick.md +41 -0
  46. package/commands/gsd/gsd-reapply-patches.md +119 -0
  47. package/commands/gsd/gsd-remove-phase.md +31 -0
  48. package/commands/gsd/{research-phase.md → gsd-research-phase.md} +38 -49
  49. package/commands/gsd/{resume-work.md → gsd-resume-work.md} +2 -2
  50. package/commands/gsd/gsd-set-profile.md +34 -0
  51. package/commands/gsd/gsd-settings.md +36 -0
  52. package/commands/gsd/gsd-update.md +37 -0
  53. package/commands/gsd/gsd-verify-work.md +38 -0
  54. package/get-shit-done/bin/gsd-tools.cjs +553 -0
  55. package/get-shit-done/bin/gsd-tools.test.cjs +2346 -0
  56. package/get-shit-done/bin/lib/commands.cjs +556 -0
  57. package/get-shit-done/bin/lib/config.cjs +162 -0
  58. package/get-shit-done/bin/lib/core.cjs +377 -0
  59. package/get-shit-done/bin/lib/frontmatter.cjs +299 -0
  60. package/get-shit-done/bin/lib/init.cjs +694 -0
  61. package/get-shit-done/bin/lib/milestone.cjs +215 -0
  62. package/get-shit-done/bin/lib/phase.cjs +877 -0
  63. package/get-shit-done/bin/lib/roadmap.cjs +298 -0
  64. package/get-shit-done/bin/lib/state.cjs +490 -0
  65. package/get-shit-done/bin/lib/template.cjs +222 -0
  66. package/get-shit-done/bin/lib/verify.cjs +772 -0
  67. package/get-shit-done/references/checkpoints.md +62 -364
  68. package/get-shit-done/references/decimal-phase-calculation.md +65 -0
  69. package/get-shit-done/references/git-integration.md +10 -16
  70. package/get-shit-done/references/git-planning-commit.md +38 -0
  71. package/get-shit-done/references/model-profile-resolution.md +34 -0
  72. package/get-shit-done/references/model-profiles.md +54 -66
  73. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  74. package/get-shit-done/references/planning-config.md +112 -10
  75. package/get-shit-done/references/questioning.md +4 -0
  76. package/get-shit-done/references/ui-brand.md +1 -1
  77. package/get-shit-done/templates/UAT.md +1 -1
  78. package/get-shit-done/templates/VALIDATION.md +104 -0
  79. package/get-shit-done/templates/codebase/structure.md +6 -6
  80. package/get-shit-done/templates/config.json +37 -0
  81. package/get-shit-done/templates/context.md +2 -10
  82. package/get-shit-done/templates/continue-here.md +6 -6
  83. package/get-shit-done/templates/debug-subagent-prompt.md +2 -2
  84. package/get-shit-done/templates/discovery.md +6 -6
  85. package/get-shit-done/templates/milestone-archive.md +3 -3
  86. package/get-shit-done/templates/phase-prompt.md +9 -7
  87. package/get-shit-done/templates/planner-subagent-prompt.md +6 -6
  88. package/get-shit-done/templates/research-project/ARCHITECTURE.md +1 -1
  89. package/get-shit-done/templates/research.md +29 -6
  90. package/get-shit-done/templates/roadmap.md +1 -1
  91. package/get-shit-done/templates/state.md +0 -30
  92. package/get-shit-done/templates/summary-complex.md +59 -0
  93. package/get-shit-done/templates/summary-minimal.md +41 -0
  94. package/get-shit-done/templates/summary-standard.md +48 -0
  95. package/get-shit-done/templates/summary.md +16 -37
  96. package/get-shit-done/templates/user-setup.md +1 -13
  97. package/get-shit-done/templates/verification-report.md +5 -5
  98. package/get-shit-done/workflows/add-phase.md +111 -0
  99. package/{commands/gsd → get-shit-done/workflows}/add-todo.md +24 -60
  100. package/{commands/gsd → get-shit-done/workflows}/audit-milestone.md +83 -63
  101. package/{commands/gsd → get-shit-done/workflows}/check-todos.md +21 -73
  102. package/get-shit-done/workflows/cleanup.md +152 -0
  103. package/get-shit-done/workflows/complete-milestone.md +251 -312
  104. package/get-shit-done/workflows/diagnose-issues.md +6 -31
  105. package/get-shit-done/workflows/discovery-phase.md +11 -11
  106. package/get-shit-done/workflows/discuss-phase.md +156 -49
  107. package/get-shit-done/workflows/execute-phase.md +238 -396
  108. package/get-shit-done/workflows/execute-plan.md +180 -1609
  109. package/get-shit-done/workflows/health.md +156 -0
  110. package/{commands/gsd → get-shit-done/workflows}/help.md +33 -35
  111. package/get-shit-done/workflows/insert-phase.md +129 -0
  112. package/get-shit-done/workflows/list-phase-assumptions.md +3 -3
  113. package/get-shit-done/workflows/map-codebase.md +73 -80
  114. package/get-shit-done/workflows/new-milestone.md +382 -0
  115. package/{commands/gsd → get-shit-done/workflows}/new-project.md +281 -234
  116. package/get-shit-done/workflows/oc-set-profile.md +320 -0
  117. package/{commands/gsd → get-shit-done/workflows}/pause-work.md +31 -43
  118. package/{commands/gsd → get-shit-done/workflows}/plan-milestone-gaps.md +29 -50
  119. package/get-shit-done/workflows/plan-phase.md +478 -0
  120. package/{commands/gsd → get-shit-done/workflows}/progress.md +64 -47
  121. package/get-shit-done/workflows/quick.md +453 -0
  122. package/get-shit-done/workflows/remove-phase.md +154 -0
  123. package/get-shit-done/workflows/research-phase.md +73 -0
  124. package/get-shit-done/workflows/resume-project.md +17 -26
  125. package/get-shit-done/workflows/set-profile.md +80 -0
  126. package/get-shit-done/workflows/settings.md +213 -0
  127. package/get-shit-done/workflows/transition.md +84 -104
  128. package/{commands/gsd → get-shit-done/workflows}/update.md +70 -28
  129. package/get-shit-done/workflows/verify-phase.md +106 -492
  130. package/get-shit-done/workflows/verify-work.md +26 -53
  131. package/package.json +7 -4
  132. package/rules/gsd-oc-work-hard.md +36 -0
  133. package/skills/gsd-oc-select-model/SKILL.md +348 -0
  134. package/skills/gsd-oc-select-model/scripts/select-models.cjs +268 -0
  135. package/agents/gsd-set-model.md +0 -287
  136. package/agents/gsd-set-profile.md +0 -239
  137. package/agents/gsd-settings.md +0 -749
  138. package/bin/install.js +0 -323
  139. package/commands/gsd/add-phase.md +0 -207
  140. package/commands/gsd/execute-phase.md +0 -339
  141. package/commands/gsd/insert-phase.md +0 -227
  142. package/commands/gsd/new-milestone.md +0 -721
  143. package/commands/gsd/plan-phase.md +0 -525
  144. package/commands/gsd/quick.md +0 -309
  145. package/commands/gsd/remove-phase.md +0 -349
  146. package/commands/gsd/set-model.md +0 -77
  147. package/commands/gsd/set-profile.md +0 -46
  148. package/commands/gsd/settings.md +0 -33
  149. package/commands/gsd/verify-work.md +0 -219
  150. package/commands/gsd/whats-new.md +0 -124
  151. /package/{src → bin/dm/src}/commands/check.js +0 -0
  152. /package/{src → bin/dm/src}/commands/config.js +0 -0
  153. /package/{src → bin/dm/src}/commands/list.js +0 -0
  154. /package/{src → bin/dm/src}/commands/repair.js +0 -0
  155. /package/{src → bin/dm/src}/commands/update.js +0 -0
  156. /package/{src → bin/dm/src}/services/manifest-manager.js +0 -0
  157. /package/{src → bin/dm/src}/services/migration-service.js +0 -0
  158. /package/{src → bin/dm/src}/services/scope-manager.js +0 -0
  159. /package/{src → bin/dm/src}/services/structure-detector.js +0 -0
  160. /package/{src → bin/dm/src}/utils/hash.js +0 -0
  161. /package/{src → bin/dm/src}/utils/interactive.js +0 -0
  162. /package/{src → bin/dm/src}/utils/logger.js +0 -0
  163. /package/{src → bin/dm/src}/utils/npm-registry.js +0 -0
  164. /package/{src → bin/dm/src}/utils/path-resolver.js +0 -0
package/bin/install.js DELETED
@@ -1,323 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- const os = require("os");
6
- const readline = require("readline");
7
-
8
- // Colors
9
- const cyan = "\x1b[36m";
10
- const green = "\x1b[32m";
11
- const yellow = "\x1b[33m";
12
- const dim = "\x1b[2m";
13
- const gray = "\x1b[90m";
14
- const white = "\x1b[37m";
15
- const reset = "\x1b[0m";
16
-
17
- // Get version from package.json
18
- const pkg = require("../package.json");
19
-
20
- const banner = `
21
- ${cyan} ██████╗ ███████╗██████╗
22
- ██╔════╝ ██╔════╝██╔══██╗
23
- ██║ ███╗███████╗██║ ██║
24
- ██║ ██║╚════██║██║ ██║
25
- ╚██████╔╝███████║██████╔╝
26
- ╚═════╝ ╚══════╝╚═════╝${reset}
27
-
28
- ${white}▄${reset}
29
- ${gray}█▀▀█${reset} ${gray}█▀▀█${reset} ${gray}█▀▀█${reset} ${gray}█▀▀▄${reset} ${white}█▀▀▀${reset} ${white}█▀▀█${reset} ${white}█▀▀█${reset} ${white}█▀▀█${reset}
30
- ${gray}█░░█${reset} ${gray}█░░█${reset} ${gray}█▀▀▀${reset} ${gray}█░░█${reset} ${white}█░░░${reset} ${white}█░░█${reset} ${white}█░░█${reset} ${white}█▀▀▀${reset}
31
- ${gray}▀▀▀▀${reset} ${gray}█▀▀▀${reset} ${gray}▀▀▀▀${reset} ${gray}▀ ▀${reset} ${white}▀▀▀▀${reset} ${white}▀▀▀▀${reset} ${white}▀▀▀▀${reset} ${white}▀▀▀▀${reset}
32
-
33
- Get Shit Done ${dim}v${pkg.version}${reset}
34
- A meta-prompting, context engineering and spec-driven
35
- development system for Cloude Code by TÂCHES
36
- (adopted for OpenCode by rokicool and GLM4.7)
37
-
38
- `;
39
-
40
- // Parse args
41
- const args = process.argv.slice(2);
42
- const hasGlobal = args.includes("--global") || args.includes("-g");
43
- const hasLocal = args.includes("--local") || args.includes("-l");
44
-
45
- // Parse --config-dir argument
46
- function parseConfigDirArg() {
47
- const configDirIndex = args.findIndex(
48
- (arg) => arg === "--config-dir" || arg === "-c",
49
- );
50
- if (configDirIndex !== -1) {
51
- const nextArg = args[configDirIndex + 1];
52
- // Error if --config-dir is provided without a value or next arg is another flag
53
- if (!nextArg || nextArg.startsWith("-")) {
54
- console.error(` ${yellow}--config-dir requires a path argument${reset}`);
55
- process.exit(1);
56
- }
57
- return nextArg;
58
- }
59
- // Also handle --config-dir=value format
60
- const configDirArg = args.find(
61
- (arg) => arg.startsWith("--config-dir=") || arg.startsWith("-c="),
62
- );
63
- if (configDirArg) {
64
- return configDirArg.split("=")[1];
65
- }
66
- return null;
67
- }
68
- const explicitConfigDir = parseConfigDirArg();
69
- const hasHelp = args.includes("--help") || args.includes("-h");
70
-
71
- console.log(banner);
72
-
73
- // Show help if requested
74
- if (hasHelp) {
75
- console.log(` ${yellow}Usage:${reset} npx gsd-opencode [options]
76
-
77
- ${yellow}Options:${reset}
78
- ${cyan}-g, --global${reset} Install globally (to OpenCode config directory)
79
- ${cyan}-l, --local${reset} Install locally (to .opencode in current directory)
80
- ${cyan}-c, --config-dir <path>${reset} Specify custom OpenCode config directory
81
- ${cyan}-h, --help${reset} Show this help message
82
-
83
- ${yellow}Examples:${reset}
84
- ${dim}# Install to default ~/.config/opencode directory${reset}
85
- npx gsd-opencode --global
86
-
87
- ${dim}# Install to custom config directory (for multiple OpenCode accounts)${reset}
88
- npx gsd-opencode --global --config-dir ~/.opencode-bc
89
-
90
- ${dim}# Using environment variable${reset}
91
- OPENCODE_CONFIG_DIR=~/.opencode-bc npx gsd-opencode --global
92
-
93
- ${dim}# Install to current project only${reset}
94
- npx gsd-opencode --local
95
-
96
- ${yellow}Notes:${reset}
97
- The --config-dir option is useful when you have multiple OpenCode
98
- configurations (e.g., for different subscriptions). It takes priority
99
- over the OPENCODE_CONFIG_DIR environment variable.
100
- `);
101
- process.exit(0);
102
- }
103
-
104
- /**
105
- * Expand ~ to home directory (shell doesn't expand in env vars passed to node)
106
- */
107
- function expandTilde(filePath) {
108
- if (filePath && filePath.startsWith("~/")) {
109
- return path.join(os.homedir(), filePath.slice(2));
110
- }
111
- return filePath;
112
- }
113
-
114
- /**
115
- * Recursively copy directory, replacing paths in .md files
116
- */
117
- function copyWithPathReplacement(srcDir, destDir, pathPrefix) {
118
- fs.mkdirSync(destDir, { recursive: true });
119
-
120
- const entries = fs.readdirSync(srcDir, { withFileTypes: true });
121
-
122
- for (const entry of entries) {
123
- const srcPath = path.join(srcDir, entry.name);
124
- const destPath = path.join(destDir, entry.name);
125
-
126
- if (entry.isDirectory()) {
127
- copyWithPathReplacement(srcPath, destPath, pathPrefix);
128
- } else if (entry.name.endsWith(".md")) {
129
- // Replace repo-local prompt references so installed prompts work outside this repo.
130
- // IMPORTANT: order matters to avoid double-rewrites.
131
- let content = fs.readFileSync(srcPath, "utf8");
132
-
133
- // 1) @-references to this repo → install-relative @-references
134
- // @gsd-opencode/... → @~/.config/opencode/... (global)
135
- // @gsd-opencode/... → @./.opencode/... (local)
136
- content = content.replace(/@gsd-opencode\//g, `@${pathPrefix}`);
137
-
138
- // 2) Plain (non-@) repo-local paths → install-relative paths
139
- // gsd-opencode/... → ~/.config/opencode/... (global)
140
- // gsd-opencode/... → ./.opencode/... (local)
141
- content = content.replace(/\bgsd-opencode\//g, pathPrefix);
142
-
143
- // 3) Back-compat: rewrite legacy Claude paths → OpenCode paths
144
- // NOTE: keep these rewrites verbatim for backward compatibility.
145
- content = content.replace(/~\/\.claude\//g, pathPrefix);
146
- content = content.replace(/\.\/\.claude\//g, "./.opencode/");
147
-
148
- fs.writeFileSync(destPath, content);
149
- } else {
150
- fs.copyFileSync(srcPath, destPath);
151
- }
152
- }
153
- }
154
-
155
- /**
156
- * Install to the specified directory
157
- */
158
- function install(isGlobal) {
159
- const src = path.join(__dirname, "..");
160
- // Priority: explicit --config-dir arg > OPENCODE_CONFIG_DIR env var > default ~/.config/opencode
161
- const configDir =
162
- expandTilde(explicitConfigDir) ||
163
- expandTilde(process.env.OPENCODE_CONFIG_DIR);
164
- const defaultGlobalDir =
165
- configDir || path.join(os.homedir(), ".config", "opencode");
166
- const opencodeDir = isGlobal
167
- ? defaultGlobalDir
168
- : path.join(process.cwd(), ".opencode");
169
-
170
- const locationLabel = isGlobal
171
- ? opencodeDir.replace(os.homedir(), "~")
172
- : opencodeDir.replace(process.cwd(), ".");
173
-
174
- // Path prefix for file references
175
- // Use actual path when OPENCODE_CONFIG_DIR is set, otherwise use ~ shorthand
176
- const pathPrefix = isGlobal
177
- ? configDir
178
- ? `${opencodeDir}/`
179
- : "~/.config/opencode/"
180
- : "./.opencode/";
181
-
182
- function scanForUnresolvedRepoLocalTokens(destRoot) {
183
- const tokenRegex = /@gsd-opencode\/|\bgsd-opencode\//g;
184
- const maxHits = 10;
185
- const hits = [];
186
-
187
- function walk(dir) {
188
- const entries = fs.readdirSync(dir, { withFileTypes: true });
189
- for (const entry of entries) {
190
- if (hits.length >= maxHits) return;
191
-
192
- const filePath = path.join(dir, entry.name);
193
- if (entry.isDirectory()) {
194
- walk(filePath);
195
- continue;
196
- }
197
-
198
- if (!entry.name.endsWith(".md")) continue;
199
-
200
- const content = fs.readFileSync(filePath, "utf8");
201
- tokenRegex.lastIndex = 0;
202
- if (!tokenRegex.test(content)) continue;
203
-
204
- // Capture a readable snippet (first matching line)
205
- const lines = content.split(/\r?\n/);
206
- for (let i = 0; i < lines.length; i++) {
207
- tokenRegex.lastIndex = 0;
208
- if (tokenRegex.test(lines[i])) {
209
- hits.push({
210
- file: filePath,
211
- line: i + 1,
212
- snippet: lines[i].trim().slice(0, 200),
213
- });
214
- break;
215
- }
216
- }
217
- }
218
- }
219
-
220
- walk(destRoot);
221
-
222
- if (hits.length > 0) {
223
- console.log(
224
- `\n ${yellow}⚠️ Install sanity check: unresolved repo-local tokens found${reset}`,
225
- );
226
- console.log(
227
- ` ${yellow}This may cause commands like /gsd-settings to fail in other repos (ENOENT).${reset}`,
228
- );
229
- console.log(` ${dim}Showing up to ${maxHits} matches:${reset}`);
230
-
231
- for (const hit of hits) {
232
- const displayPath = isGlobal
233
- ? hit.file.replace(os.homedir(), "~")
234
- : hit.file.replace(process.cwd(), ".");
235
- console.log(
236
- ` - ${displayPath}:${hit.line}\n ${dim}${hit.snippet}${reset}`,
237
- );
238
- }
239
-
240
- console.log("");
241
- }
242
- }
243
-
244
- console.log(` Installing to ${cyan}${locationLabel}${reset}\n`);
245
-
246
- // Create commands directory (singular "command" not "commands")
247
- const commandsDir = path.join(opencodeDir, "command");
248
- fs.mkdirSync(commandsDir, { recursive: true });
249
-
250
- // Copy commands/gsd with path replacement
251
- const gsdSrc = path.join(src, "command", "gsd");
252
- const gsdDest = path.join(commandsDir, "gsd");
253
- copyWithPathReplacement(gsdSrc, gsdDest, pathPrefix);
254
- console.log(` ${green}✓${reset} Installed command/gsd`);
255
-
256
- // Copy agents with path replacement
257
- const agentsSrc = path.join(src, "agents");
258
- const agentsDest = path.join(opencodeDir, "agents");
259
- copyWithPathReplacement(agentsSrc, agentsDest, pathPrefix);
260
- console.log(` ${green}✓${reset} Installed agents`);
261
-
262
- // Copy get-shit-done skill with path replacement
263
- const skillSrc = path.join(src, "get-shit-done");
264
- const skillDest = path.join(opencodeDir, "get-shit-done");
265
- copyWithPathReplacement(skillSrc, skillDest, pathPrefix);
266
- console.log(` ${green}✓${reset} Installed get-shit-done`);
267
-
268
- // Post-install diagnostic (do not fail install).
269
- scanForUnresolvedRepoLocalTokens(opencodeDir);
270
-
271
- // Create VERSION file
272
- fs.writeFileSync(path.join(skillDest, "VERSION"), `v${pkg.version}`);
273
- console.log(` ${green}✓${reset} Created VERSION file`);
274
-
275
- console.log(`
276
- ${green}Done!${reset} Run ${cyan}/gsd-help${reset} to get started.
277
- `);
278
- }
279
-
280
- /**
281
- * Prompt for install location
282
- */
283
- function promptLocation() {
284
- const rl = readline.createInterface({
285
- input: process.stdin,
286
- output: process.stdout,
287
- });
288
-
289
- const configDir =
290
- expandTilde(explicitConfigDir) ||
291
- expandTilde(process.env.OPENCODE_CONFIG_DIR);
292
- const globalPath =
293
- configDir || path.join(os.homedir(), ".config", "opencode");
294
- const globalLabel = globalPath.replace(os.homedir(), "~");
295
-
296
- console.log(` ${yellow}Where would you like to install?${reset}
297
-
298
- ${cyan}1${reset}) Global ${dim}(${globalLabel})${reset} - available in all projects
299
- ${cyan}2${reset}) Local ${dim}(./.opencode)${reset} - this project only
300
- `);
301
-
302
- rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
303
- rl.close();
304
- const choice = answer.trim() || "1";
305
- const isGlobal = choice !== "2";
306
- install(isGlobal);
307
- });
308
- }
309
-
310
- // Main
311
- if (hasGlobal && hasLocal) {
312
- console.error(` ${yellow}Cannot specify both --global and --local${reset}`);
313
- process.exit(1);
314
- } else if (explicitConfigDir && hasLocal) {
315
- console.error(` ${yellow}Cannot use --config-dir with --local${reset}`);
316
- process.exit(1);
317
- } else if (hasGlobal) {
318
- install(true);
319
- } else if (hasLocal) {
320
- install(false);
321
- } else {
322
- promptLocation();
323
- }
@@ -1,207 +0,0 @@
1
- ---
2
- name: gsd-add-phase
3
- description: Add phase to end of current milestone in roadmap
4
- argument-hint: <description>
5
- tools:
6
- - read
7
- - write
8
- - bash
9
- ---
10
-
11
- <objective>
12
- Add a new integer phase to the end of the current milestone in the roadmap.
13
-
14
- This command appends sequential phases to the current milestone's phase list, automatically calculating the next phase number based on existing phases.
15
-
16
- Purpose: Add planned work discovered during execution that belongs at the end of current milestone.
17
- </objective>
18
-
19
- <execution_context>
20
- @.planning/ROADMAP.md
21
- @.planning/STATE.md
22
- </execution_context>
23
-
24
- <process>
25
-
26
- <step name="parse_arguments">
27
- Parse the command arguments:
28
- - `$ARGUMENTS` the phase description
29
- - Example: `/gsd-add-phase Add authentication` → description = "Add authentication"
30
- - Example: `/gsd-add-phase Fix critical performance issues` → description = "Fix critical performance issues"
31
-
32
- If no arguments provided:
33
-
34
- ```
35
- ERROR: Phase description required
36
- Usage: /gsd-add-phase <description>
37
- Example: /gsd-add-phase Add authentication system
38
- ```
39
-
40
- Exit.
41
- </step>
42
-
43
- <step name="load_roadmap">
44
- Load the roadmap file:
45
-
46
- ```bash
47
- if [ -f .planning/ROADMAP.md ]; then
48
- ROADMAP=".planning/ROADMAP.md"
49
- else
50
- echo "ERROR: No roadmap found (.planning/ROADMAP.md)"
51
- exit 1
52
- fi
53
- ```
54
-
55
- read roadmap content for parsing.
56
- </step>
57
-
58
- <step name="find_current_milestone">
59
- Parse the roadmap to find the current milestone section:
60
-
61
- 1. Locate the "## Current Milestone:" heading
62
- 2. Extract milestone name and version
63
- 3. Identify all phases under this milestone (before next "---" separator or next milestone heading)
64
- 4. Parse existing phase numbers (including decimals if present)
65
-
66
- Example structure:
67
-
68
- ```
69
- ## Current Milestone: v1.0 Foundation
70
-
71
- ### Phase 4: Focused Command System
72
- ### Phase 5: Path Routing & Validation
73
- ### Phase 6: Documentation & Distribution
74
- ```
75
-
76
- </step>
77
-
78
- <step name="calculate_next_phase">
79
- Find the highest integer phase number in the current milestone:
80
-
81
- 1. Extract all phase numbers from phase headings (### Phase N:)
82
- 2. Filter to integer phases only (ignore decimals like 4.1, 4.2)
83
- 3. Find the maximum integer value
84
- 4. Add 1 to get the next phase number
85
-
86
- Example: If phases are 4, 5, 5.1, 6 → next is 7
87
-
88
- Format as two-digit: `printf "%02d" $next_phase`
89
- </step>
90
-
91
- <step name="generate_slug">
92
- Convert the phase description to a kebab-case slug:
93
-
94
- ```bash
95
- # Example transformation:
96
- # "Add authentication" → "add-authentication"
97
- # "Fix critical performance issues" → "fix-critical-performance-issues"
98
-
99
- slug=$(echo "$description" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
100
- ```
101
-
102
- Phase directory name: `{two-digit-phase}-{slug}`
103
- Example: `07-add-authentication`
104
- </step>
105
-
106
- <step name="create_phase_directory">
107
- Create the phase directory structure:
108
-
109
- ```bash
110
- phase_dir=".planning/phases/${phase_num}-${slug}"
111
- mkdir -p "$phase_dir"
112
- ```
113
-
114
- Confirm: "Created directory: $phase_dir"
115
- </step>
116
-
117
- <step name="update_roadmap">
118
- Add the new phase entry to the roadmap:
119
-
120
- 1. Find the insertion point (after last phase in current milestone, before "---" separator)
121
- 2. Insert new phase heading:
122
-
123
- ```
124
- ### Phase {N}: {Description}
125
-
126
- **Goal:** [To be planned]
127
- **Depends on:** Phase {N-1}
128
- **Plans:** 0 plans
129
-
130
- Plans:
131
- - [ ] TBD (run /gsd-plan-phase {N} to break down)
132
-
133
- **Details:**
134
- [To be added during planning]
135
- ```
136
-
137
- 3. write updated roadmap back to file
138
-
139
- Preserve all other content exactly (formatting, spacing, other phases).
140
- </step>
141
-
142
- <step name="update_project_state">
143
- Update STATE.md to reflect the new phase:
144
-
145
- 1. read `.planning/STATE.md`
146
- 2. Under "## Current Position" → "**Next Phase:**" add reference to new phase
147
- 3. Under "## Accumulated Context" → "### Roadmap Evolution" add entry:
148
- ```
149
- - Phase {N} added: {description}
150
- ```
151
-
152
- If "Roadmap Evolution" section doesn't exist, create it.
153
- </step>
154
-
155
- <step name="completion">
156
- Present completion summary:
157
-
158
- ```
159
- Phase {N} added to current milestone:
160
- - Description: {description}
161
- - Directory: .planning/phases/{phase-num}-{slug}/
162
- - Status: Not planned yet
163
-
164
- Roadmap updated: {roadmap-path}
165
- Project state updated: .planning/STATE.md
166
-
167
- ---
168
-
169
- ## ▶ Next Up
170
-
171
- **Phase {N}: {description}**
172
-
173
- `/gsd-plan-phase {N}`
174
-
175
- *`/new` first → fresh context window*
176
-
177
- ---
178
-
179
- **Also available:**
180
- - `/gsd-add-phase <description>` — add another phase
181
- - Review roadmap
182
-
183
- ---
184
- ```
185
- </step>
186
-
187
- </process>
188
-
189
- <anti_patterns>
190
-
191
- - Don't modify phases outside current milestone
192
- - Don't renumber existing phases
193
- - Don't use decimal numbering (that's /gsd-insert-phase)
194
- - Don't create plans yet (that's /gsd-plan-phase)
195
- - Don't commit changes (user decides when to commit)
196
- </anti_patterns>
197
-
198
- <success_criteria>
199
- Phase addition is complete when:
200
-
201
- - [ ] Phase directory created: `.planning/phases/{NN}-{slug}/`
202
- - [ ] Roadmap updated with new phase entry
203
- - [ ] STATE.md updated with roadmap evolution note
204
- - [ ] New phase appears at end of current milestone
205
- - [ ] Next phase number calculated correctly (ignoring decimals)
206
- - [ ] User informed of next steps
207
- </success_criteria>