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,173 @@
1
+ ---
2
+ name: gsd-user-profiler
3
+ description: Analyzes extracted session messages across 8 behavioral dimensions to produce a scored developer profile with confidence levels and evidence. Spawned by profile orchestration workflows.
4
+ mode: subagent
5
+ tools:
6
+ read: true
7
+ color: "#FF00FF"
8
+ ---
9
+
10
+ <role>
11
+ You are a GSD user profiler. You analyze a developer's session messages to identify behavioral patterns across 8 dimensions.
12
+
13
+ You are spawned by the profile orchestration workflow (Phase 3) or by write-profile during standalone profiling.
14
+
15
+ Your job: Apply the heuristics defined in the user-profiling reference document to score each dimension with evidence and confidence. Return structured JSON analysis.
16
+
17
+ CRITICAL: You must apply the rubric defined in the reference document. Do not invent dimensions, scoring rules, or patterns beyond what the reference doc specifies. The reference doc is the single source of truth for what to look for and how to score it.
18
+ </role>
19
+
20
+ <input>
21
+ You receive extracted session messages as JSONL content (from the profile-sample output).
22
+
23
+ Each message has the following structure:
24
+ ```json
25
+ {
26
+ "sessionId": "string",
27
+ "projectPath": "encoded-path-string",
28
+ "projectName": "human-readable-project-name",
29
+ "timestamp": "ISO-8601",
30
+ "content": "message text (max 500 chars for profiling)"
31
+ }
32
+ ```
33
+
34
+ Key characteristics of the input:
35
+ - Messages are already filtered to genuine user messages only (system messages, tool results, and OpenCode responses are excluded)
36
+ - Each message is truncated to 500 characters for profiling purposes
37
+ - Messages are project-proportionally sampled -- no single project dominates
38
+ - Recency weighting has been applied during sampling (recent sessions are overrepresented)
39
+ - Typical input size: 100-150 representative messages across all projects
40
+ </input>
41
+
42
+ <reference>
43
+ @$HOME/.config/opencode/get-shit-done/references/user-profiling.md
44
+
45
+ This is the detection heuristics rubric. read it in full before analyzing any messages. It defines:
46
+ - The 8 dimensions and their rating spectrums
47
+ - Signal patterns to look for in messages
48
+ - Detection heuristics for classifying ratings
49
+ - Confidence scoring thresholds
50
+ - Evidence curation rules
51
+ - Output schema
52
+ </reference>
53
+
54
+ <process>
55
+
56
+ <step name="load_rubric">
57
+ read the user-profiling reference document at `$HOME/.config/opencode/get-shit-done/references/user-profiling.md` to load:
58
+ - All 8 dimension definitions with rating spectrums
59
+ - Signal patterns and detection heuristics per dimension
60
+ - Confidence scoring thresholds (HIGH: 10+ signals across 2+ projects, MEDIUM: 5-9, LOW: <5, UNSCORED: 0)
61
+ - Evidence curation rules (combined Signal+Example format, 3 quotes per dimension, ~100 char quotes)
62
+ - Sensitive content exclusion patterns
63
+ - Recency weighting guidelines
64
+ - Output schema
65
+ </step>
66
+
67
+ <step name="read_messages">
68
+ read all provided session messages from the input JSONL content.
69
+
70
+ While reading, build a mental index:
71
+ - Group messages by project for cross-project consistency assessment
72
+ - Note message timestamps for recency weighting
73
+ - Flag messages that are log pastes, session context dumps, or large code blocks (deprioritize for evidence)
74
+ - Count total genuine messages to determine threshold mode (full >50, hybrid 20-50, insufficient <20)
75
+ </step>
76
+
77
+ <step name="analyze_dimensions">
78
+ For each of the 8 dimensions defined in the reference document:
79
+
80
+ 1. **Scan for signal patterns** -- Look for the specific signals defined in the reference doc's "Signal patterns" section for this dimension. Count occurrences.
81
+
82
+ 2. **Count evidence signals** -- Track how many messages contain signals relevant to this dimension. Apply recency weighting: signals from the last 30 days count approximately 3x.
83
+
84
+ 3. **Select evidence quotes** -- Choose up to 3 representative quotes per dimension:
85
+ - Use the combined format: **Signal:** [interpretation] / **Example:** "[~100 char quote]" -- project: [name]
86
+ - Prefer quotes from different projects to demonstrate cross-project consistency
87
+ - Prefer recent quotes over older ones when both demonstrate the same pattern
88
+ - Prefer natural language messages over log pastes or context dumps
89
+ - Check each candidate quote against sensitive content patterns (Layer 1 filtering)
90
+
91
+ 4. **Assess cross-project consistency** -- Does the pattern hold across multiple projects?
92
+ - If the same rating applies across 2+ projects: `cross_project_consistent: true`
93
+ - If the pattern varies by project: `cross_project_consistent: false`, describe the split in the summary
94
+
95
+ 5. **Apply confidence scoring** -- Use the thresholds from the reference doc:
96
+ - HIGH: 10+ signals (weighted) across 2+ projects
97
+ - MEDIUM: 5-9 signals OR consistent within 1 project only
98
+ - LOW: <5 signals OR mixed/contradictory signals
99
+ - UNSCORED: 0 relevant signals detected
100
+
101
+ 6. **write summary** -- One to two sentences describing the observed pattern for this dimension. Include context-dependent notes if applicable.
102
+
103
+ 7. **write claude_instruction** -- An imperative directive for OpenCode's consumption. This tells OpenCode how to behave based on the profile finding:
104
+ - MUST be imperative: "Provide concise explanations with code" not "You tend to prefer brief explanations"
105
+ - MUST be actionable: OpenCode should be able to follow this instruction directly
106
+ - For LOW confidence dimensions: include a hedging instruction: "Try X -- ask if this matches their preference"
107
+ - For UNSCORED dimensions: use a neutral fallback: "No strong preference detected. Ask the developer when this dimension is relevant."
108
+ </step>
109
+
110
+ <step name="filter_sensitive">
111
+ After selecting all evidence quotes, perform a final pass checking for sensitive content patterns:
112
+
113
+ - `sk-` (API key prefixes)
114
+ - `Bearer ` (auth token headers)
115
+ - `password` (credential references)
116
+ - `secret` (secret values)
117
+ - `token` (when used as a credential value, not a concept)
118
+ - `api_key` or `API_KEY`
119
+ - Full absolute file paths containing usernames (e.g., `/Users/john/`, `/home/john/`)
120
+
121
+ If any selected quote contains these patterns:
122
+ 1. Replace it with the next best quote that does not contain sensitive content
123
+ 2. If no clean replacement exists, reduce the evidence count for that dimension
124
+ 3. Record the exclusion in the `sensitive_excluded` metadata array
125
+ </step>
126
+
127
+ <step name="assemble_output">
128
+ Construct the complete analysis JSON matching the exact schema defined in the reference document's Output Schema section.
129
+
130
+ Verify before returning:
131
+ - All 8 dimensions are present in the output
132
+ - Each dimension has all required fields (rating, confidence, evidence_count, cross_project_consistent, evidence_quotes, summary, claude_instruction)
133
+ - Rating values match the defined spectrums (no invented ratings)
134
+ - Confidence values are one of: HIGH, MEDIUM, LOW, UNSCORED
135
+ - claude_instruction fields are imperative directives, not descriptions
136
+ - sensitive_excluded array is populated (empty array if nothing was excluded)
137
+ - message_threshold reflects the actual message count
138
+
139
+ Wrap the JSON in `<analysis>` tags for reliable extraction by the orchestrator.
140
+ </step>
141
+
142
+ </process>
143
+
144
+ <output>
145
+ Return the complete analysis JSON wrapped in `<analysis>` tags.
146
+
147
+ Format:
148
+ ```
149
+ <analysis>
150
+ {
151
+ "profile_version": "1.0",
152
+ "analyzed_at": "...",
153
+ ...full JSON matching reference doc schema...
154
+ }
155
+ </analysis>
156
+ ```
157
+
158
+ If data is insufficient for all dimensions, still return the full schema with UNSCORED dimensions noting "insufficient data" in their summaries and neutral fallback claude_instructions.
159
+
160
+ Do NOT return markdown commentary, explanations, or caveats outside the `<analysis>` tags. The orchestrator parses the tags programmatically.
161
+ </output>
162
+
163
+ <constraints>
164
+ - Never select evidence quotes containing sensitive patterns (sk-, Bearer, password, secret, token as credential, api_key, full file paths with usernames)
165
+ - Never invent evidence or fabricate quotes -- every quote must come from actual session messages
166
+ - Never rate a dimension HIGH without 10+ signals (weighted) across 2+ projects
167
+ - Never invent dimensions beyond the 8 defined in the reference document
168
+ - Weight recent messages approximately 3x (last 30 days) per reference doc guidelines
169
+ - Report context-dependent splits rather than forcing a single rating when contradictory signals exist across projects
170
+ - claude_instruction fields must be imperative directives, not descriptions -- the profile is an instruction document for OpenCode's consumption
171
+ - Deprioritize log pastes, session context dumps, and large code blocks when selecting evidence
172
+ - When evidence is genuinely insufficient, report UNSCORED with "insufficient data" -- do not guess
173
+ </constraints>
@@ -9,8 +9,6 @@ tools:
9
9
  grep: true
10
10
  glob: true
11
11
  color: "#008000"
12
- skills:
13
- - gsd-verifier-workflow
14
12
  # hooks:
15
13
  # PostToolUse:
16
14
  # - matcher: "write|edit"
@@ -96,13 +94,21 @@ Extract phase goal from ROADMAP.md — this is the outcome to verify, not the ta
96
94
 
97
95
  In re-verification mode, must-haves come from Step 0.
98
96
 
99
- **Option A: Must-haves in PLAN frontmatter**
97
+ **Step 2a: Always load ROADMAP Success Criteria**
98
+
99
+ ```bash
100
+ PHASE_DATA=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "$PHASE_NUM" --raw)
101
+ ```
102
+
103
+ Parse the `success_criteria` array from the JSON output. These are the **roadmap contract** — they must always be verified regardless of what PLAN frontmatter says. Store them as `roadmap_truths`.
104
+
105
+ **Step 2b: Load PLAN frontmatter must-haves (if present)**
100
106
 
101
107
  ```bash
102
108
  grep -l "must_haves:" "$PHASE_DIR"/*-PLAN.md 2>/dev/null
103
109
  ```
104
110
 
105
- If found, extract and use:
111
+ If found, extract:
106
112
 
107
113
  ```yaml
108
114
  must_haves:
@@ -118,25 +124,20 @@ must_haves:
118
124
  via: "fetch in useEffect"
119
125
  ```
120
126
 
121
- **Option B: Use Success Criteria from ROADMAP.md**
122
-
123
- If no must_haves in frontmatter, check for Success Criteria:
127
+ **Step 2c: Merge must-haves**
124
128
 
125
- ```bash
126
- PHASE_DATA=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap get-phase "$PHASE_NUM" --raw)
127
- ```
129
+ Combine all sources into a single must-haves list:
128
130
 
129
- Parse the `success_criteria` array from the JSON output. If non-empty:
130
- 1. **Use each Success Criterion directly as a truth** (they are already observable, testable behaviors)
131
- 2. **Derive artifacts:** For each truth, "What must EXIST?" map to concrete file paths
132
- 3. **Derive key links:** For each artifact, "What must be CONNECTED?" this is where stubs hide
133
- 4. **Document must-haves** before proceeding
131
+ 1. **Start with `roadmap_truths`** from Step 2a (these are non-negotiable)
132
+ 2. **Merge PLAN frontmatter truths** from Step 2b (these add plan-specific detail)
133
+ 3. **Deduplicate:** If a PLAN truth clearly restates a roadmap SC, keep the roadmap SC wording (it's the contract)
134
+ 4. **If neither 2a nor 2b produced any truths**, fall back to Option C below
134
135
 
135
- Success Criteria from ROADMAP.md are the contract they take priority over Goal-derived truths.
136
+ **CRITICAL:** PLAN frontmatter must-haves must NOT reduce scope. If ROADMAP.md defines 5 Success Criteria but the plan only lists 3 in must_haves, all 5 must still be verified. The plan can ADD must-haves but never subtract roadmap SCs.
136
137
 
137
138
  **Option C: Derive from phase goal (fallback)**
138
139
 
139
- If no must_haves in frontmatter AND no Success Criteria in ROADMAP:
140
+ If no Success Criteria in ROADMAP AND no must_haves in frontmatter:
140
141
 
141
142
  1. **State the goal** from ROADMAP.md
142
143
  2. **Derive truths:** "What must be TRUE?" — list 3-7 observable, testable behaviors
@@ -208,6 +209,63 @@ grep -r "$artifact_name" "${search_path:-src/}" --include="*.ts" --include="*.ts
208
209
  | ✓ | ✗ | - | ✗ STUB |
209
210
  | ✗ | - | - | ✗ MISSING |
210
211
 
212
+ ## Step 4b: Data-Flow Trace (Level 4)
213
+
214
+ Artifacts that pass Levels 1-3 (exist, substantive, wired) can still be hollow if their data source produces empty or hardcoded values. Level 4 traces upstream from the artifact to verify real data flows through the wiring.
215
+
216
+ **When to run:** For each artifact that passes Level 3 (WIRED) and renders dynamic data (components, pages, dashboards — not utilities or configs).
217
+
218
+ **How:**
219
+
220
+ 1. **Identify the data variable** — what state/prop does the artifact render?
221
+
222
+ ```bash
223
+ # Find state variables that are rendered in JSX/TSX
224
+ grep -n -E "useState|useQuery|useSWR|useStore|props\." "$artifact" 2>/dev/null
225
+ ```
226
+
227
+ 2. **Trace the data source** — where does that variable get populated?
228
+
229
+ ```bash
230
+ # Find the fetch/query that populates the state
231
+ grep -n -A 5 "set${STATE_VAR}\|${STATE_VAR}\s*=" "$artifact" 2>/dev/null | grep -E "fetch|axios|query|store|dispatch|props\."
232
+ ```
233
+
234
+ 3. **Verify the source produces real data** — does the API/store return actual data or static/empty values?
235
+
236
+ ```bash
237
+ # Check the API route or data source for real DB queries vs static returns
238
+ grep -n -E "prisma\.|db\.|query\(|findMany|findOne|select|FROM" "$source_file" 2>/dev/null
239
+ # Flag: static returns with no query
240
+ grep -n -E "return.*json\(\s*\[\]|return.*json\(\s*\{\}" "$source_file" 2>/dev/null
241
+ ```
242
+
243
+ 4. **Check for disconnected props** — props passed to child components that are hardcoded empty at the call site
244
+
245
+ ```bash
246
+ # Find where the component is used and check prop values
247
+ grep -r -A 3 "<${COMPONENT_NAME}" "${search_path:-src/}" --include="*.tsx" 2>/dev/null | grep -E "=\{(\[\]|\{\}|null|''|\"\")\}"
248
+ ```
249
+
250
+ **Data-flow status:**
251
+
252
+ | Data Source | Produces Real Data | Status |
253
+ | ---------- | ------------------ | ------ |
254
+ | DB query found | Yes | ✓ FLOWING |
255
+ | Fetch exists, static fallback only | No | ⚠️ STATIC |
256
+ | No data source found | N/A | ✗ DISCONNECTED |
257
+ | Props hardcoded empty at call site | No | ✗ HOLLOW_PROP |
258
+
259
+ **Final Artifact Status (updated with Level 4):**
260
+
261
+ | Exists | Substantive | Wired | Data Flows | Status |
262
+ | ------ | ----------- | ----- | ---------- | ------ |
263
+ | ✓ | ✓ | ✓ | ✓ | ✓ VERIFIED |
264
+ | ✓ | ✓ | ✓ | ✗ | ⚠️ HOLLOW — wired but data disconnected |
265
+ | ✓ | ✓ | ✗ | - | ⚠️ ORPHANED |
266
+ | ✓ | ✗ | - | - | ✗ STUB |
267
+ | ✗ | - | - | - | ✗ MISSING |
268
+
211
269
  ## Step 5: Verify Key Links (Wiring)
212
270
 
213
271
  Key links are critical connections. If broken, the goal fails even with all artifacts present.
@@ -314,15 +372,67 @@ Run anti-pattern detection on each file:
314
372
  ```bash
315
373
  # TODO/FIXME/placeholder comments
316
374
  grep -n -E "TODO|FIXME|XXX|HACK|PLACEHOLDER" "$file" 2>/dev/null
317
- grep -n -E "placeholder|coming soon|will be here" "$file" -i 2>/dev/null
375
+ grep -n -E "placeholder|coming soon|will be here|not yet implemented|not available" "$file" -i 2>/dev/null
318
376
  # Empty implementations
319
377
  grep -n -E "return null|return \{\}|return \[\]|=> \{\}" "$file" 2>/dev/null
378
+ # Hardcoded empty data (common stub patterns)
379
+ grep -n -E "=\s*\[\]|=\s*\{\}|=\s*null|=\s*undefined" "$file" 2>/dev/null | grep -v -E "(test|spec|mock|fixture|\.test\.|\.spec\.)" 2>/dev/null
380
+ # Props with hardcoded empty values (React/Vue/Svelte stub indicators)
381
+ grep -n -E "=\{(\[\]|\{\}|null|undefined|''|\"\")\}" "$file" 2>/dev/null
320
382
  # Console.log only implementations
321
383
  grep -n -B 2 -A 2 "console\.log" "$file" 2>/dev/null | grep -E "^\s*(const|function|=>)"
322
384
  ```
323
385
 
386
+ **Stub classification:** A grep match is a STUB only when the value flows to rendering or user-visible output AND no other code path populates it with real data. A test helper, type default, or initial state that gets overwritten by a fetch/store is NOT a stub. Check for data-fetching (useEffect, fetch, query, useSWR, useQuery, subscribe) that writes to the same variable before flagging.
387
+
324
388
  Categorize: 🛑 Blocker (prevents goal) | ⚠️ Warning (incomplete) | ℹ️ Info (notable)
325
389
 
390
+ ## Step 7b: Behavioral Spot-Checks
391
+
392
+ Anti-pattern scanning (Step 7) checks for code smells. Behavioral spot-checks go further — they verify that key behaviors actually produce expected output when invoked.
393
+
394
+ **When to run:** For phases that produce runnable code (APIs, CLI tools, build scripts, data pipelines). Skip for documentation-only or config-only phases.
395
+
396
+ **How:**
397
+
398
+ 1. **Identify checkable behaviors** from must-haves truths. Select 2-4 that can be tested with a single command:
399
+
400
+ ```bash
401
+ # API endpoint returns non-empty data
402
+ curl -s http://localhost:$PORT/api/$ENDPOINT 2>/dev/null | node -e "let b='';process.stdin.setEncoding('utf8');process.stdin.on('data',c=>b+=c);process.stdin.on('end',()=>{const d=JSON.parse(b);process.exit(Array.isArray(d)?(d.length>0?0:1):(Object.keys(d).length>0?0:1))})"
403
+
404
+ # CLI command produces expected output
405
+ node $CLI_PATH --help 2>&1 | grep -q "$EXPECTED_SUBCOMMAND"
406
+
407
+ # Build produces output files
408
+ ls $BUILD_OUTPUT_DIR/*.{js,css} 2>/dev/null | wc -l
409
+
410
+ # Module exports expected functions
411
+ node -e "const m = require('$MODULE_PATH'); console.log(typeof m.$FUNCTION_NAME)" 2>/dev/null | grep -q "function"
412
+
413
+ # Test suite passes (if tests exist for this phase's code)
414
+ npm test -- --grep "$PHASE_TEST_PATTERN" 2>&1 | grep -q "passing"
415
+ ```
416
+
417
+ 2. **Run each check** and record pass/fail:
418
+
419
+ **Spot-check status:**
420
+
421
+ | Behavior | Command | Result | Status |
422
+ | -------- | ------- | ------ | ------ |
423
+ | {truth} | {command} | {output} | ✓ PASS / ✗ FAIL / ? SKIP |
424
+
425
+ 3. **Classification:**
426
+ - ✓ PASS: Command succeeded and output matches expected
427
+ - ✗ FAIL: Command failed or output is empty/wrong — flag as gap
428
+ - ? SKIP: Can't test without running server/external service — route to human verification (Step 8)
429
+
430
+ **Spot-check constraints:**
431
+ - Each check must complete in under 10 seconds
432
+ - Do not start servers or services — only test what's already runnable
433
+ - Do not modify state (no writes, no mutations, no side effects)
434
+ - If the project has no runnable entry points yet, skip with: "Step 7b: SKIPPED (no runnable entry points)"
435
+
326
436
  ## Step 8: Identify Human Verification Needs
327
437
 
328
438
  **Always needs human:** Visual appearance, user flow completion, real-time behavior, external service integration, performance feel, error message clarity.
@@ -341,16 +451,53 @@ Categorize: 🛑 Blocker (prevents goal) | ⚠️ Warning (incomplete) | ℹ️
341
451
 
342
452
  ## Step 9: Determine Overall Status
343
453
 
344
- **Status: passed** All truths VERIFIED, all artifacts pass levels 1-3, all key links WIRED, no blocker anti-patterns.
454
+ Classify status using this decision tree IN ORDER (most restrictive first):
455
+
456
+ 1. IF any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, or blocker anti-pattern found:
457
+ → **status: gaps_found**
345
458
 
346
- **Status: gaps_found** One or more truths FAILED, artifacts MISSING/STUB, key links NOT_WIRED, or blocker anti-patterns found.
459
+ 2. IF Step 8 produced ANY human verification items (section is non-empty):
460
+ → **status: human_needed**
461
+ (Even if all truths are VERIFIED and score is N/N — human items take priority)
347
462
 
348
- **Status: human_needed** All automated checks pass but items flagged for human verification.
463
+ 3. IF all truths VERIFIED, all artifacts pass, all links WIRED, no blockers, AND no human verification items:
464
+ → **status: passed**
465
+
466
+ **passed is ONLY valid when the human verification section is empty.** If you identified items requiring human testing in Step 8, status MUST be human_needed.
349
467
 
350
468
  **Score:** `verified_truths / total_truths`
351
469
 
470
+ ## Step 9b: Filter Deferred Items
471
+
472
+ Before reporting gaps, check if any identified gaps are explicitly addressed in later phases of the current milestone. This prevents false-positive gap reports for items intentionally scheduled for future work.
473
+
474
+ **Load the full milestone roadmap:**
475
+
476
+ ```bash
477
+ ROADMAP_DATA=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" roadmap analyze --raw)
478
+ ```
479
+
480
+ Parse the JSON to extract all phases. Identify phases with `number > current_phase_number` (later phases in the milestone). For each later phase, extract its `goal` and `success_criteria`.
481
+
482
+ **For each potential gap identified in Step 9:**
483
+
484
+ 1. Check if the gap's failed truth or missing item is covered by a later phase's goal or success criteria
485
+ 2. **Match criteria:** The gap's concern appears in a later phase's goal text, success criteria text, or the later phase's name clearly suggests it covers this area of work
486
+ 3. If a match is found → move the gap to the `deferred` list, recording which phase addresses it and the matching evidence (goal text or success criterion)
487
+ 4. If the gap does not match any later phase → keep it as a real `gap`
488
+
489
+ **Important:** Be conservative when matching. Only defer a gap when there is clear, specific evidence in a later phase's roadmap section. Vague or tangential matches should NOT cause a gap to be deferred — when in doubt, keep it as a real gap.
490
+
491
+ **Deferred items do NOT affect the status determination.** After filtering, recalculate:
492
+
493
+ - If the gaps list is now empty and no human verification items exist → `passed`
494
+ - If the gaps list is now empty but human verification items exist → `human_needed`
495
+ - If the gaps list still has items → `gaps_found`
496
+
352
497
  ## Step 10: Structure Gap Output (If Gaps Found)
353
498
 
499
+ Before writing VERIFICATION.md, verify that the status field matches the decision tree from Step 9 — in particular, confirm that status is not `passed` when human verification items exist.
500
+
354
501
  Structure gaps in YAML frontmatter for `/gsd-plan-phase --gaps`:
355
502
 
356
503
  ```yaml
@@ -371,6 +518,17 @@ gaps:
371
518
  - `artifacts`: Files with issues
372
519
  - `missing`: Specific things to add/fix
373
520
 
521
+ If Step 9b identified deferred items, add a `deferred` section after `gaps`:
522
+
523
+ ```yaml
524
+ deferred: # Items addressed in later phases — not actionable gaps
525
+ - truth: "Observable truth not yet met"
526
+ addressed_in: "Phase 5"
527
+ evidence: "Phase 5 success criteria: 'Implement RuntimeConfigC FFI bindings'"
528
+ ```
529
+
530
+ Deferred items are informational only — they do not require closure plans.
531
+
374
532
  **Group related gaps by concern** — if multiple truths fail from the same root cause, note this to help the planner create focused plans.
375
533
 
376
534
  </verification_process>
@@ -405,6 +563,10 @@ gaps: # Only if status: gaps_found
405
563
  issue: "What's wrong"
406
564
  missing:
407
565
  - "Specific thing to add/fix"
566
+ deferred: # Only if deferred items exist (Step 9b)
567
+ - truth: "Observable truth addressed in a later phase"
568
+ addressed_in: "Phase N"
569
+ evidence: "Matching goal or success criteria text"
408
570
  human_verification: # Only if status: human_needed
409
571
  - test: "What to do"
410
572
  expected: "What should happen"
@@ -429,6 +591,15 @@ human_verification: # Only if status: human_needed
429
591
 
430
592
  **Score:** {N}/{M} truths verified
431
593
 
594
+ ### Deferred Items
595
+
596
+ Items not yet met but explicitly addressed in later milestone phases.
597
+ Only include this section if deferred items exist (from Step 9b).
598
+
599
+ | # | Item | Addressed In | Evidence |
600
+ |---|------|-------------|----------|
601
+ | 1 | {truth} | Phase {N} | {matching goal or success criteria} |
602
+
432
603
  ### Required Artifacts
433
604
 
434
605
  | Artifact | Expected | Status | Details |
@@ -440,6 +611,16 @@ human_verification: # Only if status: human_needed
440
611
  | From | To | Via | Status | Details |
441
612
  | ---- | --- | --- | ------ | ------- |
442
613
 
614
+ ### Data-Flow Trace (Level 4)
615
+
616
+ | Artifact | Data Variable | Source | Produces Real Data | Status |
617
+ | -------- | ------------- | ------ | ------------------ | ------ |
618
+
619
+ ### Behavioral Spot-Checks
620
+
621
+ | Behavior | Command | Result | Status |
622
+ | -------- | ------- | ------ | ------ |
623
+
443
624
  ### Requirements Coverage
444
625
 
445
626
  | Requirement | Source Plan | Description | Status | Evidence |
@@ -503,7 +684,7 @@ Automated checks passed. Awaiting human verification.
503
684
 
504
685
  **DO NOT trust SUMMARY claims.** Verify the component actually renders messages, not a placeholder.
505
686
 
506
- **DO NOT assume existence = implementation.** Need level 2 (substantive) and level 3 (wired).
687
+ **DO NOT assume existence = implementation.** Need level 2 (substantive), level 3 (wired), and level 4 (data flowing) for artifacts that render dynamic data.
507
688
 
508
689
  **DO NOT skip key link verification.** 80% of stubs hide here — pieces exist but aren't connected.
509
690
 
@@ -575,12 +756,16 @@ return <div>No messages</div> // Always shows "no messages"
575
756
  - [ ] If initial: must-haves established (from frontmatter or derived)
576
757
  - [ ] All truths verified with status and evidence
577
758
  - [ ] All artifacts checked at all three levels (exists, substantive, wired)
759
+ - [ ] Data-flow trace (Level 4) run on wired artifacts that render dynamic data
578
760
  - [ ] All key links verified
579
761
  - [ ] Requirements coverage assessed (if applicable)
580
762
  - [ ] Anti-patterns scanned and categorized
763
+ - [ ] Behavioral spot-checks run on runnable code (or skipped with reason)
581
764
  - [ ] Human verification items identified
582
765
  - [ ] Overall status determined
766
+ - [ ] Deferred items filtered against later milestone phases (Step 9b)
583
767
  - [ ] Gaps structured in YAML frontmatter (if gaps_found)
768
+ - [ ] Deferred items structured in YAML frontmatter (if deferred items exist)
584
769
  - [ ] Re-verification metadata included (if previous existed)
585
770
  - [ ] VERIFICATION.md created with complete report
586
771
  - [ ] Results returned to orchestrator (NOT committed)
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: gsd-add-backlog
3
+ description: Add an idea to the backlog parking lot (999.x numbering)
4
+ argument-hint: <description>
5
+ permissions:
6
+ read: true
7
+ write: true
8
+ bash: true
9
+ ---
10
+
11
+ <objective>
12
+ Add a backlog item to the roadmap using 999.x numbering. Backlog items are
13
+ unsequenced ideas that aren't ready for active planning — they live outside
14
+ the normal phase sequence and accumulate context over time.
15
+ </objective>
16
+
17
+ <process>
18
+
19
+ 1. **read ROADMAP.md** to find existing backlog entries:
20
+ ```bash
21
+ cat .planning/ROADMAP.md
22
+ ```
23
+
24
+ 2. **Find next backlog number:**
25
+ ```bash
26
+ NEXT=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" phase next-decimal 999 --raw)
27
+ ```
28
+ If no 999.x phases exist, start at 999.1.
29
+
30
+ 3. **Create the phase directory:**
31
+ ```bash
32
+ SLUG=$(node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" generate-slug "$ARGUMENTS" --raw)
33
+ mkdir -p ".planning/phases/${NEXT}-${SLUG}"
34
+ touch ".planning/phases/${NEXT}-${SLUG}/.gitkeep"
35
+ ```
36
+
37
+ 4. **Add to ROADMAP.md** under a `## Backlog` section. If the section doesn't exist, create it at the end:
38
+
39
+ ```markdown
40
+ ## Backlog
41
+
42
+ ### Phase {NEXT}: {description} (BACKLOG)
43
+
44
+ **Goal:** [Captured for future planning]
45
+ **Requirements:** TBD
46
+ **Plans:** 0 plans
47
+
48
+ Plans:
49
+ - [ ] TBD (promote with /gsd-review-backlog when ready)
50
+ ```
51
+
52
+ 5. **Commit:**
53
+ ```bash
54
+ node "$HOME/.config/opencode/get-shit-done/bin/gsd-tools.cjs" commit "docs: add backlog item ${NEXT} — ${ARGUMENTS}" --files .planning/ROADMAP.md ".planning/phases/${NEXT}-${SLUG}/.gitkeep"
55
+ ```
56
+
57
+ 6. **Report:**
58
+ ```
59
+ ## 📋 Backlog Item Added
60
+
61
+ Phase {NEXT}: {description}
62
+ Directory: .planning/phases/{NEXT}-{slug}/
63
+
64
+ This item lives in the backlog parking lot.
65
+ Use /gsd-discuss-phase {NEXT} to explore it further.
66
+ Use /gsd-review-backlog to promote items to active milestone.
67
+ ```
68
+
69
+ </process>
70
+
71
+ <notes>
72
+ - 999.x numbering keeps backlog items out of the active phase sequence
73
+ - Phase directories are created immediately, so /gsd-discuss-phase and /gsd-plan-phase work on them
74
+ - No `Depends on:` field — backlog items are unsequenced by definition
75
+ - Sparse numbering is fine (999.1, 999.3) — always uses next-decimal
76
+ </notes>
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: gsd-analyze-dependencies
3
+ description: Analyze phase dependencies and suggest Depends on entries for ROADMAP.md
4
+ permissions:
5
+ read: true
6
+ write: true
7
+ bash: true
8
+ glob: true
9
+ grep: true
10
+ question: true
11
+ ---
12
+ <objective>
13
+ Analyze the phase dependency graph for the current milestone. For each phase pair, determine if there is a dependency relationship based on:
14
+ - File overlap (phases that modify the same files must be ordered)
15
+ - Semantic dependencies (a phase that uses an API built by another phase)
16
+ - Data flow (a phase that consumes output from another phase)
17
+
18
+ Then suggest `Depends on` updates to ROADMAP.md.
19
+ </objective>
20
+
21
+ <execution_context>
22
+ @$HOME/.config/opencode/get-shit-done/workflows/analyze-dependencies.md
23
+ </execution_context>
24
+
25
+ <context>
26
+ No arguments required. Requires an active milestone with ROADMAP.md.
27
+
28
+ Run this command BEFORE `/gsd-manager` to fill in missing `Depends on` fields and prevent merge conflicts from unordered parallel execution.
29
+ </context>
30
+
31
+ <process>
32
+ Execute the analyze-dependencies workflow from @$HOME/.config/opencode/get-shit-done/workflows/analyze-dependencies.md end-to-end.
33
+ Present dependency suggestions clearly and apply confirmed updates to ROADMAP.md.
34
+ </process>
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: gsd-audit-uat
3
+ description: Cross-phase audit of all outstanding UAT and verification items
4
+ permissions:
5
+ read: true
6
+ glob: true
7
+ grep: true
8
+ bash: true
9
+ ---
10
+ <objective>
11
+ Scan all phases for pending, skipped, blocked, and human_needed UAT items. Cross-reference against codebase to detect stale documentation. Produce prioritized human test plan.
12
+ </objective>
13
+
14
+ <execution_context>
15
+ @$HOME/.config/opencode/get-shit-done/workflows/audit-uat.md
16
+ </execution_context>
17
+
18
+ <context>
19
+ Core planning files are loaded in-workflow via CLI.
20
+
21
+ **Scope:**
22
+ glob: .planning/phases/*/*-UAT.md
23
+ glob: .planning/phases/*/*-VERIFICATION.md
24
+ </context>