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,111 @@
1
+ # Workstream Flag (`--ws`)
2
+
3
+ ## Overview
4
+
5
+ The `--ws <name>` flag scopes GSD operations to a specific workstream, enabling
6
+ parallel milestone work by multiple OpenCode instances on the same codebase.
7
+
8
+ ## Resolution Priority
9
+
10
+ 1. `--ws <name>` flag (explicit, highest priority)
11
+ 2. `GSD_WORKSTREAM` environment variable (per-instance)
12
+ 3. Session-scoped active workstream pointer in temp storage (per runtime session / terminal)
13
+ 4. `.planning/active-workstream` file (legacy shared fallback when no session key exists)
14
+ 5. `null` — flat mode (no workstreams)
15
+
16
+ ## Why session-scoped pointers exist
17
+
18
+ The shared `.planning/active-workstream` file is fundamentally unsafe when multiple
19
+ OpenCode/Codex instances are active on the same repo at the same time. One session can
20
+ silently repoint another session's `STATE.md`, `ROADMAP.md`, and phase paths.
21
+
22
+ GSD now prefers a session-scoped pointer keyed by runtime/session identity
23
+ (`GSD_SESSION_KEY`, `CODEX_THREAD_ID`, `CLAUDE_CODE_SSE_PORT`, terminal session IDs,
24
+ or the controlling TTY). This keeps concurrent sessions isolated while preserving
25
+ legacy compatibility for runtimes that do not expose a stable session key.
26
+
27
+ ## Session Identity Resolution
28
+
29
+ When GSD resolves the session-scoped pointer in step 3 above, it uses this order:
30
+
31
+ 1. Explicit runtime/session env vars such as `GSD_SESSION_KEY`, `CODEX_THREAD_ID`,
32
+ `CLAUDE_SESSION_ID`, `CLAUDE_CODE_SSE_PORT`, `OPENCODE_SESSION_ID`,
33
+ `GEMINI_SESSION_ID`, `CURSOR_SESSION_ID`, `WINDSURF_SESSION_ID`,
34
+ `TERM_SESSION_ID`, `WT_SESSION`, `TMUX_PANE`, and `ZELLIJ_SESSION_NAME`
35
+ 2. `TTY` or `SSH_TTY` if the shell/runtime already exposes the terminal path
36
+ 3. A single best-effort `tty` probe, but only when stdin is interactive
37
+
38
+ If none of those produce a stable identity, GSD does not keep probing. It falls
39
+ back directly to the legacy shared `.planning/active-workstream` file.
40
+
41
+ This matters in headless or stripped environments: when stdin is already
42
+ non-interactive, GSD intentionally skips shelling out to `tty` because that path
43
+ cannot discover a stable session identity and only adds avoidable failures on the
44
+ routing hot path.
45
+
46
+ ## Pointer Lifecycle
47
+
48
+ Session-scoped pointers are intentionally lightweight and best-effort:
49
+
50
+ - Clearing a workstream for one session removes only that session's pointer file
51
+ - If that was the last pointer for the repo, GSD also removes the now-empty
52
+ per-project temp directory
53
+ - If sibling session pointers still exist, the temp directory is left in place
54
+ - When a pointer refers to a workstream directory that no longer exists, GSD
55
+ treats it as stale state: it removes that pointer file and resolves to `null`
56
+ until the session explicitly sets a new active workstream again
57
+
58
+ GSD does not currently run a background garbage collector for historical temp
59
+ directories. Cleanup is opportunistic at the pointer being cleared or self-healed,
60
+ and broader temp hygiene is left to OS temp cleanup or future maintenance work.
61
+
62
+ ## Routing Propagation
63
+
64
+ All workflow routing commands include `${GSD_WS}` which:
65
+ - Expands to `--ws <name>` when a workstream is active
66
+ - Expands to empty string in flat mode (backward compatible)
67
+
68
+ This ensures workstream scope chains automatically through the workflow:
69
+ `new-milestone → discuss-phase → plan-phase → execute-phase → transition`
70
+
71
+ ## Directory Structure
72
+
73
+ ```
74
+ .planning/
75
+ ├── PROJECT.md # Shared
76
+ ├── config.json # Shared
77
+ ├── milestones/ # Shared
78
+ ├── codebase/ # Shared
79
+ ├── active-workstream # Legacy shared fallback only
80
+ └── workstreams/
81
+ ├── feature-a/ # Workstream A
82
+ │ ├── STATE.md
83
+ │ ├── ROADMAP.md
84
+ │ ├── REQUIREMENTS.md
85
+ │ └── phases/
86
+ └── feature-b/ # Workstream B
87
+ ├── STATE.md
88
+ ├── ROADMAP.md
89
+ ├── REQUIREMENTS.md
90
+ └── phases/
91
+ ```
92
+
93
+ ## CLI Usage
94
+
95
+ ```bash
96
+ # All gsd-tools commands accept --ws
97
+ node gsd-tools.cjs state json --ws feature-a
98
+ node gsd-tools.cjs find-phase 3 --ws feature-b
99
+
100
+ # Session-local switching without --ws on every command
101
+ GSD_SESSION_KEY=my-terminal-a node gsd-tools.cjs workstream set feature-a
102
+ GSD_SESSION_KEY=my-terminal-a node gsd-tools.cjs state json
103
+ GSD_SESSION_KEY=my-terminal-b node gsd-tools.cjs workstream set feature-b
104
+ GSD_SESSION_KEY=my-terminal-b node gsd-tools.cjs state json
105
+
106
+ # Workstream CRUD
107
+ node gsd-tools.cjs workstream create <name>
108
+ node gsd-tools.cjs workstream list
109
+ node gsd-tools.cjs workstream status <name>
110
+ node gsd-tools.cjs workstream complete <name>
111
+ ```
@@ -0,0 +1,61 @@
1
+ ---
2
+ phase: {N}
3
+ slug: {phase-slug}
4
+ status: draft
5
+ threats_open: 0
6
+ asvs_level: 1
7
+ created: {date}
8
+ ---
9
+
10
+ # Phase {N} — Security
11
+
12
+ > Per-phase security contract: threat register, accepted risks, and audit trail.
13
+
14
+ ---
15
+
16
+ ## Trust Boundaries
17
+
18
+ | Boundary | Description | Data Crossing |
19
+ |----------|-------------|---------------|
20
+ | {boundary} | {description} | {data type / sensitivity} |
21
+
22
+ ---
23
+
24
+ ## Threat Register
25
+
26
+ | Threat ID | Category | Component | Disposition | Mitigation | Status |
27
+ |-----------|----------|-----------|-------------|------------|--------|
28
+ | T-{N}-01 | {STRIDE category} | {component} | {mitigate / accept / transfer} | {control or reference} | open |
29
+
30
+ *Status: open · closed*
31
+ *Disposition: mitigate (implementation required) · accept (documented risk) · transfer (third-party)*
32
+
33
+ ---
34
+
35
+ ## Accepted Risks Log
36
+
37
+ | Risk ID | Threat Ref | Rationale | Accepted By | Date |
38
+ |---------|------------|-----------|-------------|------|
39
+
40
+ *Accepted risks do not resurface in future audit runs.*
41
+
42
+ *If none: "No accepted risks."*
43
+
44
+ ---
45
+
46
+ ## Security Audit Trail
47
+
48
+ | Audit Date | Threats Total | Closed | Open | Run By |
49
+ |------------|---------------|--------|------|--------|
50
+ | {YYYY-MM-DD} | {N} | {N} | {N} | {name / agent} |
51
+
52
+ ---
53
+
54
+ ## Sign-Off
55
+
56
+ - [ ] All threats have a disposition (mitigate / accept / transfer)
57
+ - [ ] Accepted risks documented in Accepted Risks Log
58
+ - [ ] `threats_open: 0` confirmed
59
+ - [ ] `status: verified` set in frontmatter
60
+
61
+ **Approval:** {pending / verified YYYY-MM-DD}
@@ -8,7 +8,7 @@ Template for `.planning/phases/XX-name/{phase_num}-UAT.md` — persistent UAT se
8
8
 
9
9
  ```markdown
10
10
  ---
11
- status: testing | complete | diagnosed
11
+ status: testing | partial | complete | diagnosed
12
12
  phase: XX-name
13
13
  source: [list of SUMMARY.md files tested]
14
14
  started: [ISO timestamp]
@@ -45,6 +45,12 @@ expected: [observable behavior]
45
45
  result: skipped
46
46
  reason: [why skipped]
47
47
 
48
+ ### 5. [Test Name]
49
+ expected: [observable behavior]
50
+ result: blocked
51
+ blocked_by: server | physical-device | release-build | third-party | prior-phase
52
+ reason: [why blocked]
53
+
48
54
  ...
49
55
 
50
56
  ## Summary
@@ -54,6 +60,7 @@ passed: [N]
54
60
  issues: [N]
55
61
  pending: [N]
56
62
  skipped: [N]
63
+ blocked: [N]
57
64
 
58
65
  ## Gaps
59
66
 
@@ -74,7 +81,7 @@ skipped: [N]
74
81
  <section_rules>
75
82
 
76
83
  **Frontmatter:**
77
- - `status`: OVERWRITE - "testing" or "complete"
84
+ - `status`: OVERWRITE - "testing", "partial", or "complete"
78
85
  - `phase`: IMMUTABLE - set on creation
79
86
  - `source`: IMMUTABLE - SUMMARY files being tested
80
87
  - `started`: IMMUTABLE - set on creation
@@ -87,9 +94,10 @@ skipped: [N]
87
94
 
88
95
  **Tests:**
89
96
  - Each test: OVERWRITE result field when user responds
90
- - `result` values: [pending], pass, issue, skipped
97
+ - `result` values: [pending], pass, issue, skipped, blocked
91
98
  - If issue: add `reported` (verbatim) and `severity` (inferred)
92
99
  - If skipped: add `reason` if provided
100
+ - If blocked: add `blocked_by` (tag) and `reason` (if provided)
93
101
 
94
102
  **Summary:**
95
103
  - OVERWRITE counts after each response
@@ -156,6 +164,16 @@ skipped: [N]
156
164
  - Commit file
157
165
  - Present summary with next steps
158
166
 
167
+ **Partial completion:**
168
+ - status → "partial" (if pending, blocked, or unresolved skipped tests remain)
169
+ - Current Test → "[testing paused — {N} items outstanding]"
170
+ - Commit file
171
+ - Present summary with outstanding items highlighted
172
+
173
+ **Resuming partial session:**
174
+ - `/gsd-verify-work {phase}` picks up from first pending/blocked test
175
+ - When all items resolved, status advances to "complete"
176
+
159
177
  **Resume after /new:**
160
178
  1. read frontmatter → know phase and status
161
179
  2. read Current Test → know where we are
@@ -0,0 +1,100 @@
1
+ ---
2
+ phase: {N}
3
+ slug: {phase-slug}
4
+ status: draft
5
+ shadcn_initialized: false
6
+ preset: none
7
+ created: {date}
8
+ ---
9
+
10
+ # Phase {N} — UI Design Contract
11
+
12
+ > Visual and interaction contract for frontend phases. Generated by gsd-ui-researcher, verified by gsd-ui-checker.
13
+
14
+ ---
15
+
16
+ ## Design System
17
+
18
+ | Property | Value |
19
+ |----------|-------|
20
+ | Tool | {shadcn / none} |
21
+ | Preset | {preset string or "not applicable"} |
22
+ | Component library | {radix / base-ui / none} |
23
+ | Icon library | {library} |
24
+ | Font | {font} |
25
+
26
+ ---
27
+
28
+ ## Spacing Scale
29
+
30
+ Declared values (must be multiples of 4):
31
+
32
+ | Token | Value | Usage |
33
+ |-------|-------|-------|
34
+ | xs | 4px | Icon gaps, inline padding |
35
+ | sm | 8px | Compact element spacing |
36
+ | md | 16px | Default element spacing |
37
+ | lg | 24px | Section padding |
38
+ | xl | 32px | Layout gaps |
39
+ | 2xl | 48px | Major section breaks |
40
+ | 3xl | 64px | Page-level spacing |
41
+
42
+ Exceptions: {list any, or "none"}
43
+
44
+ ---
45
+
46
+ ## Typography
47
+
48
+ | Role | Size | Weight | Line Height |
49
+ |------|------|--------|-------------|
50
+ | Body | {px} | {weight} | {ratio} |
51
+ | Label | {px} | {weight} | {ratio} |
52
+ | Heading | {px} | {weight} | {ratio} |
53
+ | Display | {px} | {weight} | {ratio} |
54
+
55
+ ---
56
+
57
+ ## Color
58
+
59
+ | Role | Value | Usage |
60
+ |------|-------|-------|
61
+ | Dominant (60%) | {hex} | Background, surfaces |
62
+ | Secondary (30%) | {hex} | Cards, sidebar, nav |
63
+ | Accent (10%) | {hex} | {list specific elements only} |
64
+ | Destructive | {hex} | Destructive actions only |
65
+
66
+ Accent reserved for: {explicit list — never "all interactive elements"}
67
+
68
+ ---
69
+
70
+ ## Copywriting Contract
71
+
72
+ | Element | Copy |
73
+ |---------|------|
74
+ | Primary CTA | {specific verb + noun} |
75
+ | Empty state heading | {copy} |
76
+ | Empty state body | {copy + next step} |
77
+ | Error state | {problem + solution path} |
78
+ | Destructive confirmation | {action name}: {confirmation copy} |
79
+
80
+ ---
81
+
82
+ ## Registry Safety
83
+
84
+ | Registry | Blocks Used | Safety Gate |
85
+ |----------|-------------|-------------|
86
+ | shadcn official | {list} | not required |
87
+ | {third-party name} | {list} | shadcn view + diff required |
88
+
89
+ ---
90
+
91
+ ## Checker Sign-Off
92
+
93
+ - [ ] Dimension 1 Copywriting: PASS
94
+ - [ ] Dimension 2 Visuals: PASS
95
+ - [ ] Dimension 3 Color: PASS
96
+ - [ ] Dimension 4 Typography: PASS
97
+ - [ ] Dimension 5 Spacing: PASS
98
+ - [ ] Dimension 6 Registry Safety: PASS
99
+
100
+ **Approval:** {pending / approved YYYY-MM-DD}
@@ -36,9 +36,9 @@ created: {date}
36
36
 
37
37
  ## Per-task Verification Map
38
38
 
39
- | task ID | Plan | Wave | Requirement | Test Type | Automated Command | File Exists | Status |
40
- |---------|------|------|-------------|-----------|-------------------|-------------|--------|
41
- | {N}-01-01 | 01 | 1 | REQ-{XX} | unit | `{command}` | ✅ / ❌ W0 | ⬜ pending |
39
+ | task ID | Plan | Wave | Requirement | Threat Ref | Secure Behavior | Test Type | Automated Command | File Exists | Status |
40
+ |---------|------|------|-------------|------------|-----------------|-----------|-------------------|-------------|--------|
41
+ | {N}-01-01 | 01 | 1 | REQ-{XX} | T-{N}-01 / — | {expected secure behavior or "N/A"} | unit | `{command}` | ✅ / ❌ W0 | ⬜ pending |
42
42
 
43
43
  *Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*
44
44
 
@@ -0,0 +1,145 @@
1
+ # AGENTS.md Template
2
+
3
+ Template for project-root `AGENTS.md` — auto-generated by `gsd-tools generate-OpenCode-md`.
4
+
5
+ Contains 7 marker-bounded sections. Each section is independently updatable.
6
+ The `generate-OpenCode-md` subcommand manages 6 sections (project, stack, conventions, architecture, skills, workflow enforcement).
7
+ The profile section is managed exclusively by `generate-OpenCode-profile`.
8
+
9
+ ---
10
+
11
+ ## Section Templates
12
+
13
+ ### Project Section
14
+ ```
15
+ <!-- GSD:project-start source:PROJECT.md -->
16
+ ## Project
17
+
18
+ {{project_content}}
19
+ <!-- GSD:project-end -->
20
+ ```
21
+
22
+ **Fallback text:**
23
+ ```
24
+ Project not yet initialized. Run /gsd-new-project to set up.
25
+ ```
26
+
27
+ ### Stack Section
28
+ ```
29
+ <!-- GSD:stack-start source:STACK.md -->
30
+ ## Technology Stack
31
+
32
+ {{stack_content}}
33
+ <!-- GSD:stack-end -->
34
+ ```
35
+
36
+ **Fallback text:**
37
+ ```
38
+ Technology stack not yet documented. Will populate after codebase mapping or first phase.
39
+ ```
40
+
41
+ ### Conventions Section
42
+ ```
43
+ <!-- GSD:conventions-start source:CONVENTIONS.md -->
44
+ ## Conventions
45
+
46
+ {{conventions_content}}
47
+ <!-- GSD:conventions-end -->
48
+ ```
49
+
50
+ **Fallback text:**
51
+ ```
52
+ Conventions not yet established. Will populate as patterns emerge during development.
53
+ ```
54
+
55
+ ### Architecture Section
56
+ ```
57
+ <!-- GSD:architecture-start source:ARCHITECTURE.md -->
58
+ ## Architecture
59
+
60
+ {{architecture_content}}
61
+ <!-- GSD:architecture-end -->
62
+ ```
63
+
64
+ **Fallback text:**
65
+ ```
66
+ Architecture not yet mapped. Follow existing patterns found in the codebase.
67
+ ```
68
+
69
+ ### Skills Section
70
+ ```
71
+ <!-- GSD:skills-start source:skills/ -->
72
+ ## Project Skills
73
+
74
+ | skill | Description | Path |
75
+ | -------------- | --------------------- | ------------------------- |
76
+ | {{skill_name}} | {{skill_description}} | `{{skill_path}}/SKILL.md` |
77
+ <!-- GSD:skills-end -->
78
+ ```
79
+
80
+ **Fallback text:**
81
+ ```
82
+ No project skills found. Add skills to any of: `.OpenCode/skills/`, `.agents/skills/`, `.cursor/skills/`, or `.github/skills/` with a `SKILL.md` index file.
83
+ ```
84
+
85
+ **Discovery behavior:**
86
+ - Scans `.OpenCode/skills/`, `.agents/skills/`, `.cursor/skills/`, `.github/skills/` for subdirectories containing `SKILL.md`
87
+ - Extracts `name` and `description` from YAML frontmatter (supports multi-line descriptions)
88
+ - Skips GSD's own installed skills (directories starting with `gsd-`)
89
+ - Deduplicates by skill name across directories
90
+
91
+ ### Workflow Enforcement Section
92
+ ```
93
+ <!-- GSD:workflow-start source:GSD defaults -->
94
+ ## GSD Workflow Enforcement
95
+
96
+ Before using edit, write, or other file-changing tools, start work through a GSD command so planning artifacts and execution context stay in sync.
97
+
98
+ Use these entry points:
99
+ - `/gsd-quick` for small fixes, doc updates, and ad-hoc tasks
100
+ - `/gsd-debug` for investigation and bug fixing
101
+ - `/gsd-execute-phase` for planned phase work
102
+
103
+ Do not make direct repo edits outside a GSD workflow unless the user explicitly asks to bypass it.
104
+ <!-- GSD:workflow-end -->
105
+ ```
106
+
107
+ ### Profile Section (Placeholder Only)
108
+ ```
109
+ <!-- GSD:profile-start -->
110
+ ## Developer Profile
111
+
112
+ > Profile not yet configured. Run `/gsd-profile-user` to generate your developer profile.
113
+ > This section is managed by `generate-OpenCode-profile` — do not edit manually.
114
+ <!-- GSD:profile-end -->
115
+ ```
116
+
117
+ **Note:** This section is NOT managed by `generate-OpenCode-md`. It is managed exclusively
118
+ by `generate-OpenCode-profile`. The placeholder above is only used when creating a new
119
+ AGENTS.md file and no profile section exists yet.
120
+
121
+ ---
122
+
123
+ ## Section Ordering
124
+
125
+ 1. **Project** — Identity and purpose (what this project is)
126
+ 2. **Stack** — Technology choices (what tools are used)
127
+ 3. **Conventions** — Code patterns and rules (how code is written)
128
+ 4. **Architecture** — System structure (how components fit together)
129
+ 5. **Skills** — Discovered project skills with name and description (what domain knowledge is available)
130
+ 6. **Workflow Enforcement** — Default GSD entry points for file-changing work
131
+ 7. **Profile** — Developer behavioral preferences (how to interact)
132
+
133
+ ## Marker Format
134
+
135
+ - Start: `<!-- GSD:{name}-start source:{file} -->`
136
+ - End: `<!-- GSD:{name}-end -->`
137
+ - Source attribute enables targeted updates when source files change
138
+ - Partial match on start marker (without closing `-->`) for detection
139
+
140
+ ## Fallback Behavior
141
+
142
+ When a source file is missing, fallback text provides OpenCode-actionable guidance:
143
+ - Guides OpenCode's behavior in the absence of data
144
+ - Not placeholder ads or "missing" notices
145
+ - Each fallback tells OpenCode what to do, not just what's absent
@@ -6,11 +6,17 @@
6
6
  "plan_check": true,
7
7
  "verifier": true,
8
8
  "auto_advance": false,
9
- "nyquist_validation": true
9
+ "nyquist_validation": true,
10
+ "security_enforcement": true,
11
+ "security_asvs_level": 1,
12
+ "security_block_on": "high",
13
+ "discuss_mode": "discuss",
14
+ "research_before_questions": false
10
15
  },
11
16
  "planning": {
12
17
  "commit_docs": true,
13
- "search_gitignored": false
18
+ "search_gitignored": false,
19
+ "sub_repos": []
14
20
  },
15
21
  "parallelization": {
16
22
  "enabled": true,
@@ -33,5 +39,10 @@
33
39
  "safety": {
34
40
  "always_confirm_destructive": true,
35
41
  "always_confirm_external_services": true
36
- }
42
+ },
43
+ "hooks": {
44
+ "context_warnings": true
45
+ },
46
+ "project_code": null,
47
+ "agent_skills": {}
37
48
  }
@@ -31,14 +31,14 @@ Template for `.planning/phases/XX-name/{phase_num}-CONTEXT.md` - captures implem
31
31
  ## Implementation Decisions
32
32
 
33
33
  ### [Area 1 that was discussed]
34
- - [Specific decision made]
35
- - [Another decision if applicable]
34
+ - **D-01:** [Specific decision made]
35
+ - **D-02:** [Another decision if applicable]
36
36
 
37
37
  ### [Area 2 that was discussed]
38
- - [Specific decision made]
38
+ - **D-03:** [Specific decision made]
39
39
 
40
40
  ### [Area 3 that was discussed]
41
- - [Specific decision made]
41
+ - **D-04:** [Specific decision made]
42
42
 
43
43
  ### OpenCode's Discretion
44
44
  [Areas where user explicitly said "you decide" — OpenCode has flexibility here during planning/implementation]
@@ -54,6 +54,24 @@ Template for `.planning/phases/XX-name/{phase_num}-CONTEXT.md` - captures implem
54
54
 
55
55
  </specifics>
56
56
 
57
+ <canonical_refs>
58
+ ## Canonical References
59
+
60
+ **Downstream agents MUST read these before planning or implementing.**
61
+
62
+ [List every spec, ADR, feature doc, or design doc that defines requirements or constraints for this phase. Use full relative paths so agents can read them directly. Group by topic area when the phase has multiple concerns.]
63
+
64
+ ### [Topic area 1]
65
+ - `path/to/spec-or-adr.md` — [What this doc decides/defines that's relevant]
66
+ - `path/to/doc.md` §N — [Specific section and what it covers]
67
+
68
+ ### [Topic area 2]
69
+ - `path/to/feature-doc.md` — [What capability this defines]
70
+
71
+ [If the project has no external specs: "No external specs — requirements are fully captured in decisions above"]
72
+
73
+ </canonical_refs>
74
+
57
75
  <code_context>
58
76
  ## Existing Code Insights
59
77
 
@@ -124,6 +142,18 @@ Display posts from followed users in a scrollable feed. Users can view posts and
124
142
 
125
143
  </decisions>
126
144
 
145
+ <canonical_refs>
146
+ ## Canonical References
147
+
148
+ ### Feed display
149
+ - `docs/features/social-feed.md` — Feed requirements, post card fields, engagement display rules
150
+ - `docs/decisions/adr-012-infinite-scroll.md` — Scroll strategy decision, virtualization requirements
151
+
152
+ ### Empty states
153
+ - `docs/design/empty-states.md` — Empty state patterns, illustration guidelines
154
+
155
+ </canonical_refs>
156
+
127
157
  <specifics>
128
158
  ## Specific Ideas
129
159
 
@@ -186,6 +216,15 @@ CLI command to backup database to local file or S3. Supports full and incrementa
186
216
 
187
217
  </decisions>
188
218
 
219
+ <canonical_refs>
220
+ ## Canonical References
221
+
222
+ ### Backup CLI
223
+ - `docs/features/backup-restore.md` — Backup requirements, supported backends, encryption spec
224
+ - `docs/decisions/adr-007-cli-conventions.md` — Flag naming, exit codes, output format standards
225
+
226
+ </canonical_refs>
227
+
189
228
  <specifics>
190
229
  ## Specific Ideas
191
230
 
@@ -248,6 +287,15 @@ Organize existing photo library into structured folders. Handle duplicates and a
248
287
 
249
288
  </decisions>
250
289
 
290
+ <canonical_refs>
291
+ ## Canonical References
292
+
293
+ ### Organization rules
294
+ - `docs/features/photo-organization.md` — Grouping rules, duplicate policy, naming spec
295
+ - `docs/decisions/adr-003-exif-handling.md` — EXIF extraction strategy, fallback for missing metadata
296
+
297
+ </canonical_refs>
298
+
251
299
  <specifics>
252
300
  ## Specific Ideas
253
301
 
@@ -291,7 +339,14 @@ The output should answer: "What does the researcher need to investigate? What ch
291
339
 
292
340
  **After creation:**
293
341
  - File lives in phase directory: `.planning/phases/XX-name/{phase_num}-CONTEXT.md`
294
- - `gsd-phase-researcher` uses decisions to focus investigation
295
- - `gsd-planner` uses decisions + research to create executable tasks
342
+ - `gsd-phase-researcher` uses decisions to focus investigation AND reads canonical_refs to know WHAT docs to study
343
+ - `gsd-planner` uses decisions + research to create executable tasks AND reads canonical_refs to verify alignment
296
344
  - Downstream agents should NOT need to ask the user again about captured decisions
345
+
346
+ **CRITICAL — Canonical references:**
347
+ - The `<canonical_refs>` section is MANDATORY. Every CONTEXT.md must have one.
348
+ - If your project has external specs, ADRs, or design docs, list them with full relative paths grouped by topic
349
+ - If ROADMAP.md lists `Canonical refs:` per phase, extract and expand those
350
+ - Inline mentions like "see ADR-019" scattered in decisions are useless to downstream agents — they need full paths and section references in a dedicated section they can find
351
+ - If no external specs exist, say so explicitly — don't silently omit the section
297
352
  </guidelines>
@@ -53,16 +53,12 @@ Create: .planning/debug/{slug}.md
53
53
 
54
54
  **From /gsd-debug:**
55
55
  ```python
56
- task(
57
- prompt=filled_template,
58
- subagent_type="gsd-debugger",
59
- description="Debug {slug}"
60
- )
56
+ @gsd-debugger filled_template
61
57
  ```
62
58
 
63
59
  **From diagnose-issues (UAT):**
64
60
  ```python
65
- task(prompt=template, subagent_type="gsd-debugger", description="Debug UAT-001")
61
+ @gsd-debugger template
66
62
  ```
67
63
 
68
64
  ---
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: Load developer preferences into this session
3
+ ---
4
+
5
+ # Developer Preferences
6
+
7
+ > Generated by GSD on {{generated_at}} from {{data_source}}.
8
+ > Run `/gsd-profile-user --refresh` to regenerate.
9
+
10
+ ## Behavioral Directives
11
+
12
+ Follow these directives when working with this developer. Higher confidence
13
+ directives should be applied directly. Lower confidence directives should be
14
+ tried with hedging ("Based on your profile, I'll try X -- let me know if
15
+ that's off").
16
+
17
+ {{behavioral_directives}}
18
+
19
+ ## Stack Preferences
20
+
21
+ {{stack_preferences}}