gsd-opencode 1.22.1 → 1.33.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 (188) hide show
  1. package/agents/gsd-advisor-researcher.md +112 -0
  2. package/agents/gsd-assumptions-analyzer.md +110 -0
  3. package/agents/gsd-codebase-mapper.md +0 -2
  4. package/agents/gsd-debugger.md +117 -2
  5. package/agents/gsd-doc-verifier.md +207 -0
  6. package/agents/gsd-doc-writer.md +608 -0
  7. package/agents/gsd-executor.md +45 -4
  8. package/agents/gsd-integration-checker.md +0 -2
  9. package/agents/gsd-nyquist-auditor.md +0 -2
  10. package/agents/gsd-phase-researcher.md +191 -5
  11. package/agents/gsd-plan-checker.md +152 -5
  12. package/agents/gsd-planner.md +131 -157
  13. package/agents/gsd-project-researcher.md +28 -3
  14. package/agents/gsd-research-synthesizer.md +0 -2
  15. package/agents/gsd-roadmapper.md +29 -2
  16. package/agents/gsd-security-auditor.md +129 -0
  17. package/agents/gsd-ui-auditor.md +485 -0
  18. package/agents/gsd-ui-checker.md +305 -0
  19. package/agents/gsd-ui-researcher.md +368 -0
  20. package/agents/gsd-user-profiler.md +173 -0
  21. package/agents/gsd-verifier.md +207 -22
  22. package/commands/gsd/gsd-add-backlog.md +76 -0
  23. package/commands/gsd/gsd-analyze-dependencies.md +34 -0
  24. package/commands/gsd/gsd-audit-uat.md +24 -0
  25. package/commands/gsd/gsd-autonomous.md +45 -0
  26. package/commands/gsd/gsd-cleanup.md +5 -0
  27. package/commands/gsd/gsd-debug.md +29 -21
  28. package/commands/gsd/gsd-discuss-phase.md +15 -36
  29. package/commands/gsd/gsd-do.md +30 -0
  30. package/commands/gsd/gsd-docs-update.md +48 -0
  31. package/commands/gsd/gsd-execute-phase.md +24 -2
  32. package/commands/gsd/gsd-fast.md +30 -0
  33. package/commands/gsd/gsd-forensics.md +56 -0
  34. package/commands/gsd/gsd-help.md +2 -0
  35. package/commands/gsd/gsd-join-discord.md +2 -1
  36. package/commands/gsd/gsd-list-workspaces.md +19 -0
  37. package/commands/gsd/gsd-manager.md +40 -0
  38. package/commands/gsd/gsd-milestone-summary.md +51 -0
  39. package/commands/gsd/gsd-new-project.md +4 -0
  40. package/commands/gsd/gsd-new-workspace.md +44 -0
  41. package/commands/gsd/gsd-next.md +24 -0
  42. package/commands/gsd/gsd-note.md +34 -0
  43. package/commands/gsd/gsd-plan-phase.md +8 -1
  44. package/commands/gsd/gsd-plant-seed.md +28 -0
  45. package/commands/gsd/gsd-pr-branch.md +25 -0
  46. package/commands/gsd/gsd-profile-user.md +46 -0
  47. package/commands/gsd/gsd-quick.md +7 -3
  48. package/commands/gsd/gsd-reapply-patches.md +178 -45
  49. package/commands/gsd/gsd-remove-workspace.md +26 -0
  50. package/commands/gsd/gsd-research-phase.md +7 -12
  51. package/commands/gsd/gsd-review-backlog.md +62 -0
  52. package/commands/gsd/gsd-review.md +38 -0
  53. package/commands/gsd/gsd-secure-phase.md +35 -0
  54. package/commands/gsd/gsd-session-report.md +19 -0
  55. package/commands/gsd/gsd-set-profile.md +24 -23
  56. package/commands/gsd/gsd-ship.md +23 -0
  57. package/commands/gsd/gsd-stats.md +18 -0
  58. package/commands/gsd/gsd-thread.md +127 -0
  59. package/commands/gsd/gsd-ui-phase.md +34 -0
  60. package/commands/gsd/gsd-ui-review.md +32 -0
  61. package/commands/gsd/gsd-workstreams.md +71 -0
  62. package/get-shit-done/bin/gsd-tools.cjs +450 -90
  63. package/get-shit-done/bin/lib/commands.cjs +489 -24
  64. package/get-shit-done/bin/lib/config.cjs +329 -48
  65. package/get-shit-done/bin/lib/core.cjs +1143 -102
  66. package/get-shit-done/bin/lib/docs.cjs +267 -0
  67. package/get-shit-done/bin/lib/frontmatter.cjs +125 -43
  68. package/get-shit-done/bin/lib/init.cjs +918 -106
  69. package/get-shit-done/bin/lib/milestone.cjs +65 -33
  70. package/get-shit-done/bin/lib/model-profiles.cjs +70 -0
  71. package/get-shit-done/bin/lib/phase.cjs +434 -404
  72. package/get-shit-done/bin/lib/profile-output.cjs +1048 -0
  73. package/get-shit-done/bin/lib/profile-pipeline.cjs +539 -0
  74. package/get-shit-done/bin/lib/roadmap.cjs +156 -101
  75. package/get-shit-done/bin/lib/schema-detect.cjs +238 -0
  76. package/get-shit-done/bin/lib/security.cjs +384 -0
  77. package/get-shit-done/bin/lib/state.cjs +711 -79
  78. package/get-shit-done/bin/lib/template.cjs +2 -2
  79. package/get-shit-done/bin/lib/uat.cjs +282 -0
  80. package/get-shit-done/bin/lib/verify.cjs +254 -42
  81. package/get-shit-done/bin/lib/workstream.cjs +495 -0
  82. package/get-shit-done/references/agent-contracts.md +79 -0
  83. package/get-shit-done/references/artifact-types.md +113 -0
  84. package/get-shit-done/references/checkpoints.md +12 -10
  85. package/get-shit-done/references/context-budget.md +49 -0
  86. package/get-shit-done/references/continuation-format.md +15 -15
  87. package/get-shit-done/references/decimal-phase-calculation.md +2 -3
  88. package/get-shit-done/references/domain-probes.md +125 -0
  89. package/get-shit-done/references/gate-prompts.md +100 -0
  90. package/get-shit-done/references/git-integration.md +47 -0
  91. package/get-shit-done/references/model-profile-resolution.md +2 -0
  92. package/get-shit-done/references/model-profiles.md +62 -16
  93. package/get-shit-done/references/phase-argument-parsing.md +2 -2
  94. package/get-shit-done/references/planner-gap-closure.md +62 -0
  95. package/get-shit-done/references/planner-reviews.md +39 -0
  96. package/get-shit-done/references/planner-revision.md +87 -0
  97. package/get-shit-done/references/planning-config.md +18 -1
  98. package/get-shit-done/references/revision-loop.md +97 -0
  99. package/get-shit-done/references/ui-brand.md +2 -2
  100. package/get-shit-done/references/universal-anti-patterns.md +58 -0
  101. package/get-shit-done/references/user-profiling.md +681 -0
  102. package/get-shit-done/references/workstream-flag.md +111 -0
  103. package/get-shit-done/templates/SECURITY.md +61 -0
  104. package/get-shit-done/templates/UAT.md +21 -3
  105. package/get-shit-done/templates/UI-SPEC.md +100 -0
  106. package/get-shit-done/templates/VALIDATION.md +3 -3
  107. package/get-shit-done/templates/claude-md.md +145 -0
  108. package/get-shit-done/templates/config.json +14 -3
  109. package/get-shit-done/templates/context.md +61 -6
  110. package/get-shit-done/templates/debug-subagent-prompt.md +2 -6
  111. package/get-shit-done/templates/dev-preferences.md +21 -0
  112. package/get-shit-done/templates/discussion-log.md +63 -0
  113. package/get-shit-done/templates/phase-prompt.md +46 -5
  114. package/get-shit-done/templates/planner-subagent-prompt.md +2 -10
  115. package/get-shit-done/templates/project.md +2 -0
  116. package/get-shit-done/templates/state.md +2 -2
  117. package/get-shit-done/templates/user-profile.md +146 -0
  118. package/get-shit-done/workflows/add-phase.md +4 -4
  119. package/get-shit-done/workflows/add-tests.md +4 -4
  120. package/get-shit-done/workflows/add-todo.md +4 -4
  121. package/get-shit-done/workflows/analyze-dependencies.md +96 -0
  122. package/get-shit-done/workflows/audit-milestone.md +20 -16
  123. package/get-shit-done/workflows/audit-uat.md +109 -0
  124. package/get-shit-done/workflows/autonomous.md +1036 -0
  125. package/get-shit-done/workflows/check-todos.md +4 -4
  126. package/get-shit-done/workflows/cleanup.md +4 -4
  127. package/get-shit-done/workflows/complete-milestone.md +22 -10
  128. package/get-shit-done/workflows/diagnose-issues.md +21 -7
  129. package/get-shit-done/workflows/discovery-phase.md +2 -2
  130. package/get-shit-done/workflows/discuss-phase-assumptions.md +671 -0
  131. package/get-shit-done/workflows/discuss-phase-power.md +291 -0
  132. package/get-shit-done/workflows/discuss-phase.md +558 -47
  133. package/get-shit-done/workflows/do.md +104 -0
  134. package/get-shit-done/workflows/docs-update.md +1093 -0
  135. package/get-shit-done/workflows/execute-phase.md +741 -58
  136. package/get-shit-done/workflows/execute-plan.md +77 -12
  137. package/get-shit-done/workflows/fast.md +105 -0
  138. package/get-shit-done/workflows/forensics.md +265 -0
  139. package/get-shit-done/workflows/health.md +28 -6
  140. package/get-shit-done/workflows/help.md +127 -7
  141. package/get-shit-done/workflows/insert-phase.md +4 -4
  142. package/get-shit-done/workflows/list-phase-assumptions.md +2 -2
  143. package/get-shit-done/workflows/list-workspaces.md +56 -0
  144. package/get-shit-done/workflows/manager.md +363 -0
  145. package/get-shit-done/workflows/map-codebase.md +83 -44
  146. package/get-shit-done/workflows/milestone-summary.md +223 -0
  147. package/get-shit-done/workflows/new-milestone.md +133 -25
  148. package/get-shit-done/workflows/new-project.md +216 -54
  149. package/get-shit-done/workflows/new-workspace.md +237 -0
  150. package/get-shit-done/workflows/next.md +97 -0
  151. package/get-shit-done/workflows/node-repair.md +92 -0
  152. package/get-shit-done/workflows/note.md +156 -0
  153. package/get-shit-done/workflows/pause-work.md +132 -15
  154. package/get-shit-done/workflows/plan-milestone-gaps.md +6 -7
  155. package/get-shit-done/workflows/plan-phase.md +513 -62
  156. package/get-shit-done/workflows/plant-seed.md +169 -0
  157. package/get-shit-done/workflows/pr-branch.md +129 -0
  158. package/get-shit-done/workflows/profile-user.md +450 -0
  159. package/get-shit-done/workflows/progress.md +154 -29
  160. package/get-shit-done/workflows/quick.md +285 -111
  161. package/get-shit-done/workflows/remove-phase.md +2 -2
  162. package/get-shit-done/workflows/remove-workspace.md +90 -0
  163. package/get-shit-done/workflows/research-phase.md +13 -9
  164. package/get-shit-done/workflows/resume-project.md +37 -18
  165. package/get-shit-done/workflows/review.md +281 -0
  166. package/get-shit-done/workflows/secure-phase.md +154 -0
  167. package/get-shit-done/workflows/session-report.md +146 -0
  168. package/get-shit-done/workflows/set-profile.md +2 -2
  169. package/get-shit-done/workflows/settings.md +91 -11
  170. package/get-shit-done/workflows/ship.md +237 -0
  171. package/get-shit-done/workflows/stats.md +60 -0
  172. package/get-shit-done/workflows/transition.md +150 -23
  173. package/get-shit-done/workflows/ui-phase.md +292 -0
  174. package/get-shit-done/workflows/ui-review.md +183 -0
  175. package/get-shit-done/workflows/update.md +262 -30
  176. package/get-shit-done/workflows/validate-phase.md +14 -17
  177. package/get-shit-done/workflows/verify-phase.md +143 -11
  178. package/get-shit-done/workflows/verify-work.md +141 -39
  179. package/package.json +1 -1
  180. package/skills/gsd-audit-milestone/SKILL.md +29 -0
  181. package/skills/gsd-cleanup/SKILL.md +19 -0
  182. package/skills/gsd-complete-milestone/SKILL.md +131 -0
  183. package/skills/gsd-discuss-phase/SKILL.md +54 -0
  184. package/skills/gsd-execute-phase/SKILL.md +49 -0
  185. package/skills/gsd-plan-phase/SKILL.md +37 -0
  186. package/skills/gsd-ui-phase/SKILL.md +24 -0
  187. package/skills/gsd-ui-review/SKILL.md +24 -0
  188. package/skills/gsd-verify-work/SKILL.md +30 -0
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: gsd-next
3
+ description: Automatically advance to the next logical step in the GSD workflow
4
+ permissions:
5
+ read: true
6
+ bash: true
7
+ grep: true
8
+ glob: true
9
+ task: true
10
+ ---
11
+ <objective>
12
+ Detect the current project state and automatically invoke the next logical GSD workflow step.
13
+ No arguments needed — reads STATE.md, ROADMAP.md, and phase directories to determine what comes next.
14
+
15
+ Designed for rapid multi-project workflows where remembering which phase/step you're on is overhead.
16
+ </objective>
17
+
18
+ <execution_context>
19
+ @$HOME/.config/opencode/get-shit-done/workflows/next.md
20
+ </execution_context>
21
+
22
+ <process>
23
+ Execute the next workflow from @$HOME/.config/opencode/get-shit-done/workflows/next.md end-to-end.
24
+ </process>
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: gsd-note
3
+ description: Zero-friction idea capture. Append, list, or promote notes to todos.
4
+ argument-hint: "<text> | list | promote <N> [--global]"
5
+ permissions:
6
+ read: true
7
+ write: true
8
+ glob: true
9
+ grep: true
10
+ ---
11
+ <objective>
12
+ Zero-friction idea capture — one write call, one confirmation line.
13
+
14
+ Three subcommands:
15
+ - **append** (default): Save a timestamped note file. No questions, no formatting.
16
+ - **list**: Show all notes from project and global scopes.
17
+ - **promote**: Convert a note into a structured todo.
18
+
19
+ Runs inline — no task, no question, no bash.
20
+ </objective>
21
+
22
+ <execution_context>
23
+ @$HOME/.config/opencode/get-shit-done/workflows/note.md
24
+ @$HOME/.config/opencode/get-shit-done/references/ui-brand.md
25
+ </execution_context>
26
+
27
+ <context>
28
+ $ARGUMENTS
29
+ </context>
30
+
31
+ <process>
32
+ Execute the note workflow from @$HOME/.config/opencode/get-shit-done/workflows/note.md end-to-end.
33
+ Capture the note, list notes, or promote to todo — depending on arguments.
34
+ </process>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: gsd-plan-phase
3
3
  description: Create detailed phase plan (PLAN.md) with verification loop
4
- argument-hint: "[phase] [--auto] [--research] [--skip-research] [--gaps] [--skip-verify] [--prd <file>]"
4
+ argument-hint: "[phase] [--auto] [--research] [--skip-research] [--gaps] [--skip-verify] [--prd <file>] [--reviews] [--text]"
5
5
  agent: gsd-planner
6
6
  permissions:
7
7
  read: true
@@ -10,6 +10,7 @@ permissions:
10
10
  glob: true
11
11
  grep: true
12
12
  task: true
13
+ question: true
13
14
  webfetch: true
14
15
  mcp__context7__*: true
15
16
  ---
@@ -26,6 +27,10 @@ Create executable phase prompts (PLAN.md files) for a roadmap phase with integra
26
27
  @$HOME/.config/opencode/get-shit-done/references/ui-brand.md
27
28
  </execution_context>
28
29
 
30
+ <runtime_note>
31
+ **Copilot (VS Code):** Use `vscode_askquestions` wherever this workflow calls `question`. They are equivalent — `vscode_askquestions` is the VS Code Copilot implementation of the same interactive question API. Do not skip questioning steps because `question` appears unavailable; use `vscode_askquestions` instead.
32
+ </runtime_note>
33
+
29
34
  <context>
30
35
  Phase number: $ARGUMENTS (optional — auto-detects next unplanned phase if omitted)
31
36
 
@@ -35,6 +40,8 @@ Phase number: $ARGUMENTS (optional — auto-detects next unplanned phase if omit
35
40
  - `--gaps` — Gap closure mode (reads VERIFICATION.md, skips research)
36
41
  - `--skip-verify` — Skip verification loop
37
42
  - `--prd <file>` — Use a PRD/acceptance criteria file instead of discuss-phase. Parses requirements into CONTEXT.md automatically. Skips discuss-phase entirely.
43
+ - `--reviews` — Replan incorporating cross-AI review feedback from REVIEWS.md (produced by `/gsd-review`)
44
+ - `--text` — Use plain-text numbered lists instead of TUI menus (required for `/rc` remote sessions)
38
45
 
39
46
  Normalize phase input in step 2 before any directory lookups.
40
47
  </context>
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: gsd-plant-seed
3
+ description: Capture a forward-looking idea with trigger conditions — surfaces automatically at the right milestone
4
+ argument-hint: "[idea summary]"
5
+ permissions:
6
+ read: true
7
+ write: true
8
+ edit: true
9
+ bash: true
10
+ question: true
11
+ ---
12
+
13
+ <objective>
14
+ Capture an idea that's too big for now but should surface automatically when the right
15
+ milestone arrives. Seeds solve context rot: instead of a one-liner in Deferred that nobody
16
+ reads, a seed preserves the full WHY, WHEN to surface, and breadcrumbs to details.
17
+
18
+ Creates: .planning/seeds/SEED-NNN-slug.md
19
+ Consumed by: /gsd-new-milestone (scans seeds and presents matches)
20
+ </objective>
21
+
22
+ <execution_context>
23
+ @$HOME/.config/opencode/get-shit-done/workflows/plant-seed.md
24
+ </execution_context>
25
+
26
+ <process>
27
+ Execute the plant-seed workflow from @$HOME/.config/opencode/get-shit-done/workflows/plant-seed.md end-to-end.
28
+ </process>
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: gsd-pr-branch
3
+ description: Create a clean PR branch by filtering out .planning/ commits — ready for code review
4
+ argument-hint: "[target branch, default: main]"
5
+ permissions:
6
+ bash: true
7
+ read: true
8
+ question: true
9
+ ---
10
+
11
+ <objective>
12
+ Create a clean branch suitable for pull requests by filtering out .planning/ commits
13
+ from the current branch. Reviewers see only code changes, not GSD planning artifacts.
14
+
15
+ This solves the problem of PR diffs being cluttered with PLAN.md, SUMMARY.md, STATE.md
16
+ changes that are irrelevant to code review.
17
+ </objective>
18
+
19
+ <execution_context>
20
+ @$HOME/.config/opencode/get-shit-done/workflows/pr-branch.md
21
+ </execution_context>
22
+
23
+ <process>
24
+ Execute the pr-branch workflow from @$HOME/.config/opencode/get-shit-done/workflows/pr-branch.md end-to-end.
25
+ </process>
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: gsd-profile-user
3
+ description: Generate developer behavioral profile and create OpenCode-discoverable artifacts
4
+ argument-hint: "[--questionnaire] [--refresh]"
5
+ permissions:
6
+ read: true
7
+ write: true
8
+ bash: true
9
+ glob: true
10
+ grep: true
11
+ question: true
12
+ task: true
13
+ ---
14
+
15
+ <objective>
16
+ Generate a developer behavioral profile from session analysis (or questionnaire) and produce artifacts (USER-PROFILE.md, /gsd-dev-preferences, AGENTS.md section) that personalize OpenCode's responses.
17
+
18
+ Routes to the profile-user workflow which orchestrates the full flow: consent gate, session analysis or questionnaire fallback, profile generation, result display, and artifact selection.
19
+ </objective>
20
+
21
+ <execution_context>
22
+ @$HOME/.config/opencode/get-shit-done/workflows/profile-user.md
23
+ @$HOME/.config/opencode/get-shit-done/references/ui-brand.md
24
+ </execution_context>
25
+
26
+ <context>
27
+ Flags from $ARGUMENTS:
28
+ - `--questionnaire` -- Skip session analysis entirely, use questionnaire-only path
29
+ - `--refresh` -- Rebuild profile even when one exists, backup old profile, show dimension diff
30
+ </context>
31
+
32
+ <process>
33
+ Execute the profile-user workflow end-to-end.
34
+
35
+ The workflow handles all logic including:
36
+ 1. Initialization and existing profile detection
37
+ 2. Consent gate before session analysis
38
+ 3. Session scanning and data sufficiency checks
39
+ 4. Session analysis (profiler agent) or questionnaire fallback
40
+ 5. Cross-project split resolution
41
+ 6. Profile writing to USER-PROFILE.md
42
+ 7. Result display with report card and highlights
43
+ 8. Artifact selection (dev-preferences, AGENTS.md sections)
44
+ 9. Sequential artifact generation
45
+ 10. Summary with refresh diff (if applicable)
46
+ </process>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: gsd-quick
3
3
  description: Execute a quick task with GSD guarantees (atomic commits, state tracking) but skip optional agents
4
- argument-hint: "[--full] [--discuss]"
4
+ argument-hint: "[--full] [--validate] [--discuss] [--research]"
5
5
  permissions:
6
6
  read: true
7
7
  write: true
@@ -24,9 +24,13 @@ Quick mode is the same system with a shorter path:
24
24
 
25
25
  **`--discuss` flag:** Lightweight discussion phase before planning. Surfaces assumptions, clarifies gray areas, captures decisions in CONTEXT.md. Use when the task has ambiguity worth resolving upfront.
26
26
 
27
- **`--full` flag:** Enables plan-checking (max 2 iterations) and post-execution verification. Use when you want quality guarantees without full milestone ceremony.
27
+ **`--full` flag:** Enables the complete quality pipeline discussion + research + plan-checking + verification. One flag for everything.
28
28
 
29
- Flags are composable: `--discuss --full` gives discussion + plan-checking + verification.
29
+ **`--validate` flag:** Enables plan-checking (max 2 iterations) and post-execution verification only. Use when you want quality guarantees without discussion or research.
30
+
31
+ **`--research` flag:** Spawns a focused research agent before planning. Investigates implementation approaches, library options, and pitfalls for the task. Use when you're unsure of the best approach.
32
+
33
+ Granular flags are composable: `--discuss --research --validate` gives the same result as `--full`.
30
34
  </objective>
31
35
 
32
36
  <execution_context>
@@ -1,19 +1,22 @@
1
1
  ---
2
2
  name: gsd-reapply-patches
3
3
  description: Reapply local modifications after a GSD update
4
- permissions: read, write, edit, bash, glob, grep, question
4
+ permissions:
5
+ read: true
6
+ write: true
7
+ edit: true
8
+ bash: true
9
+ glob: true
10
+ grep: true
11
+ question: true
5
12
  ---
6
13
 
7
14
  <objective>
8
- Reapply user's local modifications to files after a GSD update reinstalls clean versions.
15
+ After a GSD update wipes and reinstalls files, this command merges user's previously saved local modifications back into the new version. Uses three-way comparison (pristine baseline, user-modified backup, newly installed version) to reliably distinguish user customizations from version drift.
9
16
 
10
- When GSD performs updates, it backs up user modifications to a patches directory. This command intelligently merges those modifications back into the new file versions, handling cases where both the upstream code and user modifications may have changed.
17
+ **Critical invariant:** Every file in `gsd-local-patches/` was backed up because the installer's hash comparison detected it was modified. The workflow must NEVER conclude "no custom content" for any backed-up file that is a logical contradiction. When in doubt, classify as CONFLICT requiring user review, not SKIP.
11
18
  </objective>
12
19
 
13
- <purpose>
14
- After a GSD update wipes and reinstalls files, this command merges user's previously saved local modifications back into the new version. Uses intelligent comparison to handle cases where the upstream file also changed.
15
- </purpose>
16
-
17
20
  <process>
18
21
 
19
22
  ## Step 1: Detect backed-up patches
@@ -21,19 +24,90 @@ After a GSD update wipes and reinstalls files, this command merges user's previo
21
24
  Check for local patches directory:
22
25
 
23
26
  ```bash
24
- # Global install — detect runtime config directory
25
- if [ -d "$HOME/.config/opencode/gsd-local-patches" ]; then
26
- PATCHES_DIR="$HOME/.config/opencode/gsd-local-patches"
27
- elif [ -d "$HOME/.opencode/gsd-local-patches" ]; then
28
- PATCHES_DIR="$HOME/.opencode/gsd-local-patches"
29
- elif [ -d "$HOME/.gemini/gsd-local-patches" ]; then
30
- PATCHES_DIR="$HOME/.gemini/gsd-local-patches"
31
- else
32
- PATCHES_DIR="$HOME/.OpenCode/gsd-local-patches"
27
+ expand_home() {
28
+ case "$1" in
29
+ "~/"*) printf '%s/%s\n' "$HOME" "${1#~/}" ;;
30
+ *) printf '%s\n' "$1" ;;
31
+ esac
32
+ }
33
+
34
+ PATCHES_DIR=""
35
+
36
+ # Env overrides first — covers custom config directories used with --config-dir
37
+ if [ -n "$KILO_CONFIG_DIR" ]; then
38
+ candidate="$(expand_home "$KILO_CONFIG_DIR")/gsd-local-patches"
39
+ if [ -d "$candidate" ]; then
40
+ PATCHES_DIR="$candidate"
41
+ fi
42
+ elif [ -n "$KILO_CONFIG" ]; then
43
+ candidate="$(dirname "$(expand_home "$KILO_CONFIG")")/gsd-local-patches"
44
+ if [ -d "$candidate" ]; then
45
+ PATCHES_DIR="$candidate"
46
+ fi
47
+ elif [ -n "$XDG_CONFIG_HOME" ]; then
48
+ candidate="$(expand_home "$XDG_CONFIG_HOME")/kilo/gsd-local-patches"
49
+ if [ -d "$candidate" ]; then
50
+ PATCHES_DIR="$candidate"
51
+ fi
52
+ fi
53
+
54
+ if [ -z "$PATCHES_DIR" ] && [ -n "$OPENCODE_CONFIG_DIR" ]; then
55
+ candidate="$(expand_home "$OPENCODE_CONFIG_DIR")/gsd-local-patches"
56
+ if [ -d "$candidate" ]; then
57
+ PATCHES_DIR="$candidate"
58
+ fi
59
+ elif [ -z "$PATCHES_DIR" ] && [ -n "$OPENCODE_CONFIG" ]; then
60
+ candidate="$(dirname "$(expand_home "$OPENCODE_CONFIG")")/gsd-local-patches"
61
+ if [ -d "$candidate" ]; then
62
+ PATCHES_DIR="$candidate"
63
+ fi
64
+ elif [ -z "$PATCHES_DIR" ] && [ -n "$XDG_CONFIG_HOME" ]; then
65
+ candidate="$(expand_home "$XDG_CONFIG_HOME")/opencode/gsd-local-patches"
66
+ if [ -d "$candidate" ]; then
67
+ PATCHES_DIR="$candidate"
68
+ fi
69
+ fi
70
+
71
+ if [ -z "$PATCHES_DIR" ] && [ -n "$GEMINI_CONFIG_DIR" ]; then
72
+ candidate="$(expand_home "$GEMINI_CONFIG_DIR")/gsd-local-patches"
73
+ if [ -d "$candidate" ]; then
74
+ PATCHES_DIR="$candidate"
75
+ fi
76
+ fi
77
+
78
+ if [ -z "$PATCHES_DIR" ] && [ -n "$CODEX_HOME" ]; then
79
+ candidate="$(expand_home "$CODEX_HOME")/gsd-local-patches"
80
+ if [ -d "$candidate" ]; then
81
+ PATCHES_DIR="$candidate"
82
+ fi
83
+ fi
84
+
85
+ if [ -z "$PATCHES_DIR" ] && [ -n "$CLAUDE_CONFIG_DIR" ]; then
86
+ candidate="$(expand_home "$CLAUDE_CONFIG_DIR")/gsd-local-patches"
87
+ if [ -d "$candidate" ]; then
88
+ PATCHES_DIR="$candidate"
89
+ fi
90
+ fi
91
+
92
+ # Global install — detect runtime config directory defaults
93
+ if [ -z "$PATCHES_DIR" ]; then
94
+ if [ -d "$HOME/.config/kilo/gsd-local-patches" ]; then
95
+ PATCHES_DIR="$HOME/.config/kilo/gsd-local-patches"
96
+ elif [ -d "$HOME/.config/opencode/gsd-local-patches" ]; then
97
+ PATCHES_DIR="$HOME/.config/opencode/gsd-local-patches"
98
+ elif [ -d "$HOME/.opencode/gsd-local-patches" ]; then
99
+ PATCHES_DIR="$HOME/.opencode/gsd-local-patches"
100
+ elif [ -d "$HOME/.gemini/gsd-local-patches" ]; then
101
+ PATCHES_DIR="$HOME/.gemini/gsd-local-patches"
102
+ elif [ -d "$HOME/.codex/gsd-local-patches" ]; then
103
+ PATCHES_DIR="$HOME/.codex/gsd-local-patches"
104
+ else
105
+ PATCHES_DIR="$HOME/.OpenCode/gsd-local-patches"
106
+ fi
33
107
  fi
34
108
  # Local install fallback — check all runtime directories
35
109
  if [ ! -d "$PATCHES_DIR" ]; then
36
- for dir in .config/opencode .opencode .gemini .OpenCode; do
110
+ for dir in .config/kilo .kilo .config/opencode .opencode .gemini .codex .OpenCode; do
37
111
  if [ -d "./$dir/gsd-local-patches" ]; then
38
112
  PATCHES_DIR="./$dir/gsd-local-patches"
39
113
  break
@@ -53,7 +127,43 @@ after modifying any GSD workflow, command, or agent files.
53
127
  ```
54
128
  Exit.
55
129
 
56
- ## Step 2: Show patch summary
130
+ ## Step 2: Determine baseline for three-way comparison
131
+
132
+ The quality of the merge depends on having a **pristine baseline** — the original unmodified version of each file from the pre-update GSD release. This enables three-way comparison:
133
+ - **Pristine baseline** (original GSD file before any user edits)
134
+ - **User's version** (backed up in `gsd-local-patches/`)
135
+ - **New version** (freshly installed after update)
136
+
137
+ Check for baseline sources in priority order:
138
+
139
+ ### Option A: Git history (most reliable)
140
+ If the config directory is a git repository:
141
+ ```bash
142
+ CONFIG_DIR=$(dirname "$PATCHES_DIR")
143
+ if git -C "$CONFIG_DIR" rev-parse --git-dir >/dev/null 2>&1; then
144
+ HAS_GIT=true
145
+ fi
146
+ ```
147
+ When `HAS_GIT=true`, use `git log` to find the commit where GSD was originally installed (before user edits). For each file, the pristine baseline can be extracted with:
148
+ ```bash
149
+ git -C "$CONFIG_DIR" log --diff-filter=A --format="%H" -- "{file_path}"
150
+ ```
151
+ This gives the commit that first added the file (the install commit). Extract the pristine version:
152
+ ```bash
153
+ git -C "$CONFIG_DIR" show {install_commit}:{file_path}
154
+ ```
155
+
156
+ ### Option B: Pristine snapshot directory
157
+ Check if a `gsd-pristine/` directory exists alongside `gsd-local-patches/`:
158
+ ```bash
159
+ PRISTINE_DIR="$CONFIG_DIR/gsd-pristine"
160
+ ```
161
+ If it exists, the installer saved pristine copies at install time. Use these as the baseline.
162
+
163
+ ### Option C: No baseline available (two-way fallback)
164
+ If neither git history nor pristine snapshots are available, fall back to two-way comparison — but with **strengthened heuristics** (see Step 3).
165
+
166
+ ## Step 3: Show patch summary
57
167
 
58
168
  ```
59
169
  ## Local Patches to Reapply
@@ -61,6 +171,7 @@ Exit.
61
171
  **Backed up from:** v{from_version}
62
172
  **Current version:** {read VERSION file}
63
173
  **Files modified:** {count}
174
+ **Merge strategy:** {three-way (git) | three-way (pristine) | two-way (enhanced)}
64
175
 
65
176
  | # | File | Status |
66
177
  |---|------|--------|
@@ -68,37 +179,57 @@ Exit.
68
179
  | 2 | {file_path} | Pending |
69
180
  ```
70
181
 
71
- ## Step 3: Merge each file
182
+ ## Step 4: Merge each file
72
183
 
73
184
  For each file in `backup-meta.json`:
74
185
 
75
186
  1. **read the backed-up version** (user's modified copy from `gsd-local-patches/`)
76
187
  2. **read the newly installed version** (current file after update)
77
- 3. **Compare and merge:**
188
+ 3. **If available, read the pristine baseline** (from git history or `gsd-pristine/`)
78
189
 
79
- - If the new file is identical to the backed-up file: skip (modification was incorporated upstream)
80
- - If the new file differs: identify the user's modifications and apply them to the new version
190
+ ### Three-way merge (when baseline is available)
81
191
 
82
- **Merge strategy:**
83
- - read both versions fully
84
- - Identify sections the user added or modified (look for additions, not just differences from path replacement)
85
- - Apply user's additions/modifications to the new version
86
- - If a section the user modified was also changed upstream: flag as conflict, show both versions, ask user which to keep
192
+ Compare the three versions to isolate changes:
193
+ - **User changes** = diff(pristine → user's version) — these are the customizations to preserve
194
+ - **Upstream changes** = diff(pristine new version) these are version updates to accept
87
195
 
88
- 4. **write merged result** to the installed location
89
- 5. **Report status:**
90
- - `Merged` user modifications applied cleanly
91
- - `Skipped` modification already in upstream
92
- - `Conflict` user chose resolution
196
+ **Merge rules:**
197
+ - Sections changed only by user → apply user's version
198
+ - Sections changed only by upstream → accept upstream version
199
+ - Sections changed by both flag as CONFLICT, show both, ask user
200
+ - Sections unchanged by either → use new version (identical to all three)
93
201
 
94
- ## Step 4: Update manifest
202
+ ### Two-way merge (fallback when no baseline)
95
203
 
96
- After reapplying, regenerate the file manifest so future updates correctly detect these as user modifications:
204
+ When no pristine baseline is available, use these **strengthened heuristics**:
97
205
 
206
+ **CRITICAL RULE: Every file in this backup directory was explicitly detected as modified by the installer's SHA-256 hash comparison. "No custom content" is never a valid conclusion.**
207
+
208
+ For each file:
209
+ a. read both versions completely
210
+ b. Identify ALL differences, then classify each as:
211
+ - **Mechanical drift** — path substitutions (e.g. `/Users/xxx/.OpenCode/` → `$HOME/.OpenCode/`), variable additions (`${GSD_WS}`, `${AGENT_SKILLS_*}`), error handling additions (`|| true`)
212
+ - **User customization** — added steps/sections, removed sections, reordered content, changed behavior, added frontmatter fields, modified instructions
213
+
214
+ c. **If ANY differences remain after filtering out mechanical drift → those are user customizations. Merge them.**
215
+ d. **If ALL differences appear to be mechanical drift → still flag as CONFLICT.** The installer's hash check already proved this file was modified. Ask the user: "This file appears to only have path/variable differences. Were there intentional customizations?" Do NOT silently skip.
216
+
217
+ ### Git-enhanced two-way merge
218
+
219
+ When the config directory is a git repo but the pristine install commit can't be found, use commit history to identify user changes:
98
220
  ```bash
99
- # The manifest will be regenerated on next /gsd-update
100
- # For now, just note which files were modified
221
+ # Find non-update commits that touched this file
222
+ git -C "$CONFIG_DIR" log --oneline --no-merges -- "{file_path}" | grep -v "gsd:update\|GSD update\|gsd-install"
101
223
  ```
224
+ Each matching commit represents an intentional user modification. Use the commit messages and diffs to understand what was changed and why.
225
+
226
+ 4. **write merged result** to the installed location
227
+ 5. **Report status per file:**
228
+ - `Merged` — user modifications applied cleanly (show summary of what was preserved)
229
+ - `Conflict` — user reviewed and chose resolution
230
+ - `Incorporated` — user's modification was already adopted upstream (only valid when pristine baseline confirms this)
231
+
232
+ **Never report `Skipped — no custom content`.** If a file is in the backup, it has custom content.
102
233
 
103
234
  ## Step 5: Cleanup option
104
235
 
@@ -111,11 +242,11 @@ Ask user:
111
242
  ```
112
243
  ## Patches Reapplied
113
244
 
114
- | # | File | Status |
115
- |---|------|--------|
116
- | 1 | {file_path} | Merged |
117
- | 2 | {file_path} | Skipped (already upstream) |
118
- | 3 | {file_path} | Conflict resolved |
245
+ | # | File | Result | User Changes Preserved |
246
+ |---|------|--------|----------------------|
247
+ | 1 | {file_path} | Merged | Added step X, modified section Y |
248
+ | 2 | {file_path} | Incorporated | Already in upstream v{version} |
249
+ | 3 | {file_path} | Conflict resolved | User chose: keep custom section |
119
250
 
120
251
  {count} file(s) updated. Your local modifications are active again.
121
252
  ```
@@ -123,8 +254,10 @@ Ask user:
123
254
  </process>
124
255
 
125
256
  <success_criteria>
126
- - [ ] All backed-up patches processed
127
- - [ ] User modifications merged into new version
128
- - [ ] Conflicts resolved with user input
129
- - [ ] Status reported for each file
257
+ - [ ] All backed-up patches processed — zero files left unhandled
258
+ - [ ] No file classified as "no custom content" or "SKIP" — every backed-up file is definitionally modified
259
+ - [ ] Three-way merge used when pristine baseline available (git history or gsd-pristine/)
260
+ - [ ] User modifications identified and merged into new version
261
+ - [ ] Conflicts surfaced to user with both versions shown
262
+ - [ ] Status reported for each file with summary of what was preserved
130
263
  </success_criteria>
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: gsd-remove-workspace
3
+ description: Remove a GSD workspace and clean up worktrees
4
+ argument-hint: "<workspace-name>"
5
+ permissions:
6
+ bash: true
7
+ read: true
8
+ question: true
9
+ ---
10
+ <context>
11
+ **Arguments:**
12
+ - `<workspace-name>` (required) — Name of the workspace to remove
13
+ </context>
14
+
15
+ <objective>
16
+ Remove a workspace directory after confirmation. For worktree strategy, runs `git worktree remove` for each member repo first. Refuses if any repo has uncommitted changes.
17
+ </objective>
18
+
19
+ <execution_context>
20
+ @$HOME/.config/opencode/get-shit-done/workflows/remove-workspace.md
21
+ @$HOME/.config/opencode/get-shit-done/references/ui-brand.md
22
+ </execution_context>
23
+
24
+ <process>
25
+ Execute the remove-workspace workflow from @$HOME/.config/opencode/get-shit-done/workflows/remove-workspace.md end-to-end.
26
+ </process>
@@ -23,6 +23,11 @@ Research how to implement a phase. Spawns gsd-phase-researcher agent with phase
23
23
  **Why subagent:** Research burns context fast (websearch, Context7 queries, source verification). Fresh 200k context for investigation. Main context stays lean for user interaction.
24
24
  </objective>
25
25
 
26
+ <available_agent_types>
27
+ Valid GSD subagent types (use exact names — do not fall back to 'general'):
28
+ - gsd-phase-researcher — Researches technical approaches for a phase
29
+ </available_agent_types>
30
+
26
31
  <context>
27
32
  Phase number: $ARGUMENTS (required)
28
33
 
@@ -135,12 +140,7 @@ write to: .planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md
135
140
  ```
136
141
 
137
142
  ```
138
- task(
139
- prompt=filled_prompt,
140
- subagent_type="gsd-phase-researcher",
141
- model="{researcher_model}",
142
- description="Research Phase {phase}"
143
- )
143
+ @gsd-phase-researcher filled_prompt
144
144
  ```
145
145
 
146
146
  ## 5. Handle Agent Return
@@ -171,12 +171,7 @@ Continue research for Phase {phase_number}: {phase_name}
171
171
  ```
172
172
 
173
173
  ```
174
- task(
175
- prompt=continuation_prompt,
176
- subagent_type="gsd-phase-researcher",
177
- model="{researcher_model}",
178
- description="Continue research Phase {phase}"
179
- )
174
+ @gsd-phase-researcher continuation_prompt
180
175
  ```
181
176
 
182
177
  </process>
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: gsd-review-backlog
3
+ description: Review and promote backlog items to active milestone
4
+ permissions:
5
+ read: true
6
+ write: true
7
+ bash: true
8
+ question: true
9
+ ---
10
+
11
+ <objective>
12
+ Review all 999.x backlog items and optionally promote them into the active
13
+ milestone sequence or remove stale entries.
14
+ </objective>
15
+
16
+ <process>
17
+
18
+ 1. **List backlog items:**
19
+ ```bash
20
+ ls -d .planning/phases/999* 2>/dev/null || echo "No backlog items found"
21
+ ```
22
+
23
+ 2. **read ROADMAP.md** and extract all 999.x phase entries:
24
+ ```bash
25
+ cat .planning/ROADMAP.md
26
+ ```
27
+ Show each backlog item with its description, any accumulated context (CONTEXT.md, RESEARCH.md), and creation date.
28
+
29
+ 3. **Present the list to the user** via question:
30
+ - For each backlog item, show: phase number, description, accumulated artifacts
31
+ - Options per item: **Promote** (move to active), **Keep** (leave in backlog), **Remove** (delete)
32
+
33
+ 4. **For items to PROMOTE:**
34
+ - Find the next sequential phase number in the active milestone
35
+ - Rename the directory from `999.x-slug` to `{new_num}-slug`:
36
+ ```bash
37
+ NEW_NUM=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" phase add "${DESCRIPTION}" --raw)
38
+ ```
39
+ - Move accumulated artifacts to the new phase directory
40
+ - Update ROADMAP.md: move the entry from `## Backlog` section to the active phase list
41
+ - Remove `(BACKLOG)` marker
42
+ - Add appropriate `**Depends on:**` field
43
+
44
+ 5. **For items to REMOVE:**
45
+ - Delete the phase directory
46
+ - Remove the entry from ROADMAP.md `## Backlog` section
47
+
48
+ 6. **Commit changes:**
49
+ ```bash
50
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: review backlog — promoted N, removed M" --files .planning/ROADMAP.md
51
+ ```
52
+
53
+ 7. **Report summary:**
54
+ ```
55
+ ## 📋 Backlog Review Complete
56
+
57
+ Promoted: {list of promoted items with new phase numbers}
58
+ Kept: {list of items remaining in backlog}
59
+ Removed: {list of deleted items}
60
+ ```
61
+
62
+ </process>