@tekyzinc/gsd-t 2.50.12 → 2.53.10

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 (99) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +379 -372
  3. package/bin/component-registry.js +250 -0
  4. package/bin/graph-cgc.js +510 -510
  5. package/bin/graph-indexer.js +147 -147
  6. package/bin/graph-overlay.js +195 -195
  7. package/bin/graph-parsers.js +327 -327
  8. package/bin/graph-query.js +453 -452
  9. package/bin/graph-store.js +154 -154
  10. package/bin/qa-calibrator.js +194 -0
  11. package/bin/scan-data-collector.js +153 -153
  12. package/bin/scan-diagrams-generators.js +187 -187
  13. package/bin/scan-diagrams.js +79 -79
  14. package/bin/scan-renderer.js +92 -92
  15. package/bin/scan-report-sections.js +121 -121
  16. package/bin/scan-report.js +184 -184
  17. package/bin/scan-schema-parsers.js +199 -199
  18. package/bin/scan-schema.js +103 -103
  19. package/bin/token-budget.js +246 -0
  20. package/commands/Claude-md.md +10 -10
  21. package/commands/branch.md +15 -15
  22. package/commands/checkin.md +45 -45
  23. package/commands/global-change.md +209 -209
  24. package/commands/gsd-t-audit.md +199 -0
  25. package/commands/gsd-t-backlog-add.md +94 -94
  26. package/commands/gsd-t-backlog-edit.md +111 -111
  27. package/commands/gsd-t-backlog-list.md +63 -63
  28. package/commands/gsd-t-backlog-move.md +94 -94
  29. package/commands/gsd-t-backlog-promote.md +123 -123
  30. package/commands/gsd-t-backlog-remove.md +86 -86
  31. package/commands/gsd-t-backlog-settings.md +158 -158
  32. package/commands/gsd-t-complete-milestone.md +528 -515
  33. package/commands/gsd-t-debug.md +506 -399
  34. package/commands/gsd-t-discuss.md +174 -174
  35. package/commands/gsd-t-execute.md +758 -634
  36. package/commands/gsd-t-feature.md +276 -276
  37. package/commands/gsd-t-health.md +142 -142
  38. package/commands/gsd-t-help.md +465 -457
  39. package/commands/gsd-t-impact.md +302 -302
  40. package/commands/gsd-t-init.md +320 -280
  41. package/commands/gsd-t-integrate.md +365 -249
  42. package/commands/gsd-t-milestone.md +87 -87
  43. package/commands/gsd-t-partition.md +442 -361
  44. package/commands/gsd-t-pause.md +82 -82
  45. package/commands/gsd-t-plan.md +345 -344
  46. package/commands/gsd-t-populate.md +111 -111
  47. package/commands/gsd-t-prd.md +326 -326
  48. package/commands/gsd-t-project.md +211 -211
  49. package/commands/gsd-t-promote-debt.md +123 -123
  50. package/commands/gsd-t-prompt.md +137 -137
  51. package/commands/gsd-t-qa.md +266 -266
  52. package/commands/gsd-t-quick.md +357 -234
  53. package/commands/gsd-t-reflect.md +134 -134
  54. package/commands/gsd-t-resume.md +72 -72
  55. package/commands/gsd-t-scan.md +615 -615
  56. package/commands/gsd-t-setup.md +76 -0
  57. package/commands/gsd-t-status.md +192 -166
  58. package/commands/gsd-t-test-sync.md +381 -381
  59. package/commands/gsd-t-triage-and-merge.md +171 -171
  60. package/commands/gsd-t-verify.md +382 -382
  61. package/commands/gsd-t-visualize.md +118 -118
  62. package/commands/gsd-t-wave.md +401 -378
  63. package/docs/GSD-T-README.md +425 -422
  64. package/docs/architecture.md +385 -369
  65. package/docs/harness-design-analysis.md +371 -0
  66. package/docs/infrastructure.md +205 -205
  67. package/docs/prd-graph-engine.md +398 -398
  68. package/docs/prd-gsd2-hybrid.md +559 -559
  69. package/docs/prd-harness-evolution.md +583 -0
  70. package/docs/requirements.md +14 -0
  71. package/docs/workflows.md +226 -226
  72. package/examples/.gsd-t/domains/example-domain/scope.md +13 -13
  73. package/package.json +40 -40
  74. package/scripts/gsd-t-auto-route.js +39 -39
  75. package/scripts/gsd-t-dashboard-mockup.html +1143 -1143
  76. package/scripts/gsd-t-dashboard-server.js +171 -171
  77. package/scripts/gsd-t-dashboard.html +262 -262
  78. package/scripts/gsd-t-event-writer.js +128 -128
  79. package/scripts/gsd-t-statusline.js +94 -94
  80. package/scripts/gsd-t-tools.js +175 -175
  81. package/templates/CLAUDE-global.md +639 -614
  82. package/templates/CLAUDE-project.md +24 -0
  83. package/templates/backlog-settings.md +18 -18
  84. package/templates/backlog.md +1 -1
  85. package/templates/progress.md +40 -40
  86. package/templates/shared-services-contract.md +60 -60
  87. package/templates/stacks/desktop.ini +2 -2
  88. package/bin/desktop.ini +0 -2
  89. package/commands/desktop.ini +0 -2
  90. package/docs/ci-examples/desktop.ini +0 -2
  91. package/docs/desktop.ini +0 -2
  92. package/examples/.gsd-t/contracts/desktop.ini +0 -2
  93. package/examples/.gsd-t/desktop.ini +0 -2
  94. package/examples/.gsd-t/domains/desktop.ini +0 -2
  95. package/examples/.gsd-t/domains/example-domain/desktop.ini +0 -2
  96. package/examples/desktop.ini +0 -2
  97. package/examples/rules/desktop.ini +0 -2
  98. package/scripts/desktop.ini +0 -2
  99. package/templates/desktop.ini +0 -2
@@ -1,276 +1,276 @@
1
- # GSD-T: Feature — Add a Major Feature to an Existing Project
2
-
3
- You are the lead agent planning a significant new feature for an existing codebase. Unlike `/user:gsd-t-project` (greenfield), this command respects and builds on what already exists — existing patterns, schema, auth, conventions, and contracts.
4
-
5
- ## Step 0.5: Scan Freshness Auto-Refresh
6
-
7
- Before reading scan data for impact analysis, check if scan docs are stale and auto-refresh if needed. This ensures feature planning is based on current code — no warnings, no user involvement.
8
-
9
- If `.gsd-t/scan/.cache.json` exists:
10
- 1. Read the cache and check `scannedAt` for each dimension
11
- 2. Count commits since the scan: `git rev-list --count --after="{scannedAt}" HEAD`
12
- 3. If **>10 commits since scan** OR **scan is older than 14 days**:
13
- - Log: "Auto-refreshing scan docs (stale by {N} commits / {N} days)..."
14
- - Re-run only the stale dimensions by spawning the relevant scan teammates:
15
- - If `quality.md` stale → spawn quality teammate (model: sonnet)
16
- - If `architecture.md` stale → spawn architecture teammate (model: haiku)
17
- - If `security.md` stale → spawn security teammate (model: sonnet)
18
- - Update `.gsd-t/scan/.cache.json` after refresh
19
- 4. If fresh → proceed silently
20
-
21
- If `.gsd-t/scan/` doesn't exist at all → skip (no scan data to refresh).
22
-
23
- ## Step 1: Understand What Exists
24
-
25
- Read everything:
26
- 1. `CLAUDE.md` — project conventions, stack, patterns
27
- 2. `.gsd-t/progress.md` — completed milestones, decision history
28
- 3. `.gsd-t/roadmap.md` (if exists) — original project plan
29
- 4. `.gsd-t/contracts/` — existing contracts (these are constraints now)
30
- 5. `.gsd-t/domains/` — existing domain boundaries
31
- 6. `.gsd-t/techdebt.md` (if exists) — known issues that might interact
32
- 7. `docs/` — requirements, architecture, schema
33
- 8. Source code — scan the actual implementation:
34
- - Directory structure and organization patterns
35
- - Existing API endpoint patterns
36
- - Database schema (current state)
37
- - UI component patterns and state management approach
38
- - Auth/middleware patterns
39
- - Test patterns and coverage
40
-
41
- Build a mental model of: "How does this codebase work today?"
42
-
43
- **Multi-Client Architecture Check**: Before moving to Step 2, identify whether the project has or will have multiple consumer surfaces:
44
- - Look for directories: `web/`, `mobile/`, `app/`, `cli/`, `client/`, `frontend/`
45
- - Look for split route files: `routes/web.js`, `routes/mobile.js`, `routes/api/v1/`, `routes/api/v2/`
46
- - Check package.json scripts for `build:web`, `build:mobile`, `start:mobile`, etc.
47
- - Check `.gsd-t/scan/quality.md` (if exists) for the "Consumer Surfaces Detected" table
48
-
49
- Note what you find — this informs Step 3's Multi-Consumer Check and Step 4's milestone ordering.
50
-
51
- ## Step 1.5: Graph-Enhanced Blast Radius Analysis
52
-
53
- If `.gsd-t/graph/meta.json` exists (graph index is available):
54
- 1. Query `getSurfaceConsumers` and `getCallers` on functions likely affected by the feature to calculate blast radius across all consumer surfaces
55
- 2. Query `getTransitiveCallers` for deep impact chains that may not be obvious from architecture docs alone
56
- 3. Feed these findings into the Impact Analysis in Step 3
57
-
58
- If graph is not available, skip this step.
59
-
60
- ## Step 2: Understand the Feature
61
-
62
- From $ARGUMENTS and conversation:
63
- - What does this feature do?
64
- - Who uses it?
65
- - How does it interact with existing functionality?
66
- - What's the priority / timeline pressure?
67
-
68
- If context is thin, ask targeted questions:
69
- - How should this integrate with existing auth/permissions?
70
- - Does this need new database tables or extend existing ones?
71
- - Are there new third-party integrations?
72
- - Does this affect existing UI flows or is it a new section?
73
- - Any existing features this replaces or modifies?
74
-
75
- ## Step 3: Impact Analysis
76
-
77
- Before planning milestones, analyze how this feature touches the existing system.
78
-
79
- ### Team Mode (recommended for large codebases)
80
- If agent teams are enabled, parallelize the analysis by layer:
81
-
82
- ```
83
- Create an agent team to analyze the impact of this feature:
84
-
85
- ALL TEAMMATES read first:
86
- - CLAUDE.md
87
- - .gsd-t/contracts/ (all existing contracts)
88
- - docs/ (requirements, architecture, schema)
89
- Feature description: {feature summary from Step 2}
90
-
91
- - Teammate "data-layer": Analyze impact on database schema,
92
- migrations, models, data access patterns. What tables/columns
93
- are new? What existing queries break? Write to .gsd-t/scan/feature-impact-data.md
94
-
95
- - Teammate "backend": Analyze impact on API endpoints, services,
96
- middleware, business logic. What's new? What existing endpoints
97
- change? What contracts are affected? Write to .gsd-t/scan/feature-impact-backend.md
98
-
99
- - Teammate "frontend": Analyze impact on UI components, pages,
100
- navigation, state management. What's new? What existing flows
101
- change? Write to .gsd-t/scan/feature-impact-frontend.md
102
-
103
- - Teammate "security": Analyze impact on auth flows, permissions,
104
- input validation, data exposure. Any new attack surface?
105
- Write to .gsd-t/scan/feature-impact-security.md
106
-
107
- Lead: Synthesize all impact findings into the combined analysis below.
108
- ```
109
-
110
- ### Solo Mode (small codebases or teams not enabled)
111
- Work through each layer sequentially:
112
-
113
- Produce a combined analysis:
114
-
115
- ```markdown
116
- ## Impact Analysis: {feature name}
117
-
118
- ### New Components (doesn't exist yet)
119
- - {new API endpoints}
120
- - {new database tables/columns}
121
- - {new UI pages/components}
122
- - {new services/integrations}
123
-
124
- ### Modified Components (exists, needs changes)
125
- - {file/module}: {what changes and why}
126
- - {file/module}: {what changes and why}
127
-
128
- ### Affected Contracts (existing contracts impacted)
129
- - {contract}: {what needs to change}
130
- - Breaking change? {yes/no}
131
- - Consumers affected: {list}
132
-
133
- ### Untouched (confirmed no impact)
134
- - {areas explicitly not affected}
135
-
136
- ### Risk Areas
137
- - {where this feature could break existing functionality}
138
- - {complex integration points}
139
- - {performance concerns}
140
-
141
- ### Multi-Consumer Check
142
- - Consumer surfaces that exist or will exist after this feature: {list}
143
- - Does this feature add a new consumer surface? {yes/no}
144
- - If yes: backend operations this new surface needs: {list}
145
- - Of those, how many are already implemented for an existing surface? {list any matches}
146
- - SharedCore extraction candidates (operations needed by 2+ surfaces): {list or "none found"}
147
- - SharedCore milestone required? {yes — if 2+ candidates found | no — if none}
148
- ```
149
-
150
- ## Step 4: Decompose into Milestones
151
-
152
- The feature may be a single milestone or multiple, depending on scope:
153
-
154
- ### Single Milestone (if feature is focused):
155
- - 2-4 domains, < 15 tasks total
156
- - Minimal impact on existing contracts
157
- - Skip roadmap, go straight to: "Run `/user:gsd-t-partition` to begin"
158
-
159
- ### Multiple Milestones (if feature is complex):
160
- Apply these sequencing rules:
161
-
162
- 1. **Schema/data changes first**: New tables, migrations, model updates
163
- 2. **Backend before frontend**: API endpoints before UI that consumes them
164
- 3. **Existing contract updates early**: If existing contracts change, update and verify them before building new code against them
165
- 4. **New functionality before integration**: Build the new thing, then wire it into existing flows
166
- 5. **Migration/backfill as its own milestone**: If existing data needs transformation, isolate that work
167
- 6. **SharedCore before new consumer surfaces**: If the feature adds a new consumer surface (web, mobile, CLI) AND SharedCore candidates were identified in Step 3's Multi-Consumer Check, add a SharedCore milestone BEFORE the new client's milestone. The SharedCore milestone extracts shared operations into a reusable backend domain — the new client's API calls SharedCore functions, it does not duplicate them.
168
-
169
- ### Write the Feature Roadmap
170
-
171
- Append to `.gsd-t/roadmap.md` (or create if doesn't exist):
172
-
173
- ```markdown
174
- ---
175
-
176
- ## Feature: {feature name}
177
- **Added**: {date}
178
- **Context**: {why this feature is being added}
179
-
180
- ### Milestone {N}: {name} — Data Layer Extension
181
- **Goal**: {what "done" looks like}
182
- **Scope**:
183
- - {new tables/columns}
184
- - {schema migrations}
185
- - {data model updates}
186
- **Impact on existing**:
187
- - Extends schema-contract.md with {new tables}
188
- - No breaking changes to existing queries
189
- **Success criteria**:
190
- - [ ] {testable outcome}
191
-
192
- ### Milestone {N+1}: {name} — Feature Backend
193
- **Goal**: {what "done" looks like}
194
- **Scope**:
195
- - {new API endpoints}
196
- - {business logic}
197
- - {integration with existing auth}
198
- **Impact on existing**:
199
- - Adds to api-contract.md: {new endpoints}
200
- - Modifies: {existing middleware/routes}
201
- **Success criteria**:
202
- - [ ] {testable outcome}
203
-
204
- ### Milestone {N+2}: {name} — Feature UI + Integration
205
- **Goal**: {what "done" looks like}
206
- **Scope**:
207
- - {new pages/components}
208
- - {wire into existing navigation}
209
- - {update existing UI where needed}
210
- **Impact on existing**:
211
- - Modifies: {existing components}
212
- - Extends component-contract.md with {new components}
213
- **Success criteria**:
214
- - [ ] {testable outcome}
215
- ```
216
-
217
- ## Step 5: Reconcile with Existing State
218
-
219
- Critical step — make sure the new milestones fit with what's already built:
220
-
221
- 1. **Check for conflicts**: Do new milestones conflict with in-progress work?
222
- 2. **Check for dependencies**: Do any existing incomplete milestones need to finish first?
223
- 3. **Check techdebt.md**: Are there known issues that should be fixed before or during this feature?
224
- 4. **Update domain boundaries**: Will existing domains need scope changes? Will new domains be created?
225
-
226
- If conflicts exist, present them to the user with options:
227
- - "Milestone 3 (existing) modifies the same auth middleware this feature needs. Should we complete M3 first, or merge the work?"
228
-
229
- ## Step 6: Update Project State
230
-
231
- Update `.gsd-t/progress.md`:
232
- - Add new milestones to the table
233
- - Log the feature addition in Decision Log
234
- - Note any contract changes that will be needed
235
-
236
- ## Step 7: Document Ripple
237
-
238
- After creating the feature roadmap and milestones, update all affected documentation:
239
-
240
- ### Always update:
241
- 1. **`.gsd-t/progress.md`** — Already done in Step 6, but verify Decision Log includes the feature addition with rationale
242
-
243
- ### Check if affected:
244
- 2. **`docs/requirements.md`** — Add new functional/technical requirements identified during feature analysis
245
- 3. **`docs/architecture.md`** — If the feature introduces new components, data flows, or architectural patterns, document them
246
- 4. **`docs/workflows.md`** — If the feature introduces new user journeys or modifies existing flows, update them
247
- 5. **`CLAUDE.md`** — If the feature establishes new conventions or patterns that future work should follow, add them
248
- 6. **`.gsd-t/contracts/`** — If impact analysis identified contract changes needed, note them (actual updates happen during partition)
249
- 7. **`.gsd-t/techdebt.md`** — If analysis revealed existing debt that interacts with this feature, add or update items
250
-
251
- ### Skip what's not affected.
252
-
253
- ## Step 8: Test Verification
254
-
255
- Before finalizing the feature plan:
256
-
257
- 1. **Run existing tests**: Execute the full test suite to confirm the codebase is in a clean state before feature work begins
258
- 2. **Verify passing**: If any tests fail, flag them — they must be fixed before or during the first milestone
259
- 3. **Note test gaps**: From the impact analysis, identify which existing tests will need updates and which new tests will be needed — include these in milestone scope
260
-
261
- ## Step 9: Report to User
262
-
263
- Present:
264
- 1. Impact analysis summary (what's new vs. what's modified)
265
- 2. Milestone breakdown for the feature
266
- 3. Risk areas and how the milestones mitigate them
267
- 4. Any conflicts with existing work
268
- 5. Recommended starting point
269
-
270
- Ask: "Ready to start? Run `/user:gsd-t-partition` for Milestone {N}."
271
-
272
- $ARGUMENTS
273
-
274
- ## Auto-Clear
275
-
276
- All work is committed to project files. Execute `/clear` to free the context window for the next command.
1
+ # GSD-T: Feature — Add a Major Feature to an Existing Project
2
+
3
+ You are the lead agent planning a significant new feature for an existing codebase. Unlike `/user:gsd-t-project` (greenfield), this command respects and builds on what already exists — existing patterns, schema, auth, conventions, and contracts.
4
+
5
+ ## Step 0.5: Scan Freshness Auto-Refresh
6
+
7
+ Before reading scan data for impact analysis, check if scan docs are stale and auto-refresh if needed. This ensures feature planning is based on current code — no warnings, no user involvement.
8
+
9
+ If `.gsd-t/scan/.cache.json` exists:
10
+ 1. Read the cache and check `scannedAt` for each dimension
11
+ 2. Count commits since the scan: `git rev-list --count --after="{scannedAt}" HEAD`
12
+ 3. If **>10 commits since scan** OR **scan is older than 14 days**:
13
+ - Log: "Auto-refreshing scan docs (stale by {N} commits / {N} days)..."
14
+ - Re-run only the stale dimensions by spawning the relevant scan teammates:
15
+ - If `quality.md` stale → spawn quality teammate (model: sonnet)
16
+ - If `architecture.md` stale → spawn architecture teammate (model: haiku)
17
+ - If `security.md` stale → spawn security teammate (model: sonnet)
18
+ - Update `.gsd-t/scan/.cache.json` after refresh
19
+ 4. If fresh → proceed silently
20
+
21
+ If `.gsd-t/scan/` doesn't exist at all → skip (no scan data to refresh).
22
+
23
+ ## Step 1: Understand What Exists
24
+
25
+ Read everything:
26
+ 1. `CLAUDE.md` — project conventions, stack, patterns
27
+ 2. `.gsd-t/progress.md` — completed milestones, decision history
28
+ 3. `.gsd-t/roadmap.md` (if exists) — original project plan
29
+ 4. `.gsd-t/contracts/` — existing contracts (these are constraints now)
30
+ 5. `.gsd-t/domains/` — existing domain boundaries
31
+ 6. `.gsd-t/techdebt.md` (if exists) — known issues that might interact
32
+ 7. `docs/` — requirements, architecture, schema
33
+ 8. Source code — scan the actual implementation:
34
+ - Directory structure and organization patterns
35
+ - Existing API endpoint patterns
36
+ - Database schema (current state)
37
+ - UI component patterns and state management approach
38
+ - Auth/middleware patterns
39
+ - Test patterns and coverage
40
+
41
+ Build a mental model of: "How does this codebase work today?"
42
+
43
+ **Multi-Client Architecture Check**: Before moving to Step 2, identify whether the project has or will have multiple consumer surfaces:
44
+ - Look for directories: `web/`, `mobile/`, `app/`, `cli/`, `client/`, `frontend/`
45
+ - Look for split route files: `routes/web.js`, `routes/mobile.js`, `routes/api/v1/`, `routes/api/v2/`
46
+ - Check package.json scripts for `build:web`, `build:mobile`, `start:mobile`, etc.
47
+ - Check `.gsd-t/scan/quality.md` (if exists) for the "Consumer Surfaces Detected" table
48
+
49
+ Note what you find — this informs Step 3's Multi-Consumer Check and Step 4's milestone ordering.
50
+
51
+ ## Step 1.5: Graph-Enhanced Blast Radius Analysis
52
+
53
+ If `.gsd-t/graph/meta.json` exists (graph index is available):
54
+ 1. Query `getSurfaceConsumers` and `getCallers` on functions likely affected by the feature to calculate blast radius across all consumer surfaces
55
+ 2. Query `getTransitiveCallers` for deep impact chains that may not be obvious from architecture docs alone
56
+ 3. Feed these findings into the Impact Analysis in Step 3
57
+
58
+ If graph is not available, skip this step.
59
+
60
+ ## Step 2: Understand the Feature
61
+
62
+ From $ARGUMENTS and conversation:
63
+ - What does this feature do?
64
+ - Who uses it?
65
+ - How does it interact with existing functionality?
66
+ - What's the priority / timeline pressure?
67
+
68
+ If context is thin, ask targeted questions:
69
+ - How should this integrate with existing auth/permissions?
70
+ - Does this need new database tables or extend existing ones?
71
+ - Are there new third-party integrations?
72
+ - Does this affect existing UI flows or is it a new section?
73
+ - Any existing features this replaces or modifies?
74
+
75
+ ## Step 3: Impact Analysis
76
+
77
+ Before planning milestones, analyze how this feature touches the existing system.
78
+
79
+ ### Team Mode (recommended for large codebases)
80
+ If agent teams are enabled, parallelize the analysis by layer:
81
+
82
+ ```
83
+ Create an agent team to analyze the impact of this feature:
84
+
85
+ ALL TEAMMATES read first:
86
+ - CLAUDE.md
87
+ - .gsd-t/contracts/ (all existing contracts)
88
+ - docs/ (requirements, architecture, schema)
89
+ Feature description: {feature summary from Step 2}
90
+
91
+ - Teammate "data-layer": Analyze impact on database schema,
92
+ migrations, models, data access patterns. What tables/columns
93
+ are new? What existing queries break? Write to .gsd-t/scan/feature-impact-data.md
94
+
95
+ - Teammate "backend": Analyze impact on API endpoints, services,
96
+ middleware, business logic. What's new? What existing endpoints
97
+ change? What contracts are affected? Write to .gsd-t/scan/feature-impact-backend.md
98
+
99
+ - Teammate "frontend": Analyze impact on UI components, pages,
100
+ navigation, state management. What's new? What existing flows
101
+ change? Write to .gsd-t/scan/feature-impact-frontend.md
102
+
103
+ - Teammate "security": Analyze impact on auth flows, permissions,
104
+ input validation, data exposure. Any new attack surface?
105
+ Write to .gsd-t/scan/feature-impact-security.md
106
+
107
+ Lead: Synthesize all impact findings into the combined analysis below.
108
+ ```
109
+
110
+ ### Solo Mode (small codebases or teams not enabled)
111
+ Work through each layer sequentially:
112
+
113
+ Produce a combined analysis:
114
+
115
+ ```markdown
116
+ ## Impact Analysis: {feature name}
117
+
118
+ ### New Components (doesn't exist yet)
119
+ - {new API endpoints}
120
+ - {new database tables/columns}
121
+ - {new UI pages/components}
122
+ - {new services/integrations}
123
+
124
+ ### Modified Components (exists, needs changes)
125
+ - {file/module}: {what changes and why}
126
+ - {file/module}: {what changes and why}
127
+
128
+ ### Affected Contracts (existing contracts impacted)
129
+ - {contract}: {what needs to change}
130
+ - Breaking change? {yes/no}
131
+ - Consumers affected: {list}
132
+
133
+ ### Untouched (confirmed no impact)
134
+ - {areas explicitly not affected}
135
+
136
+ ### Risk Areas
137
+ - {where this feature could break existing functionality}
138
+ - {complex integration points}
139
+ - {performance concerns}
140
+
141
+ ### Multi-Consumer Check
142
+ - Consumer surfaces that exist or will exist after this feature: {list}
143
+ - Does this feature add a new consumer surface? {yes/no}
144
+ - If yes: backend operations this new surface needs: {list}
145
+ - Of those, how many are already implemented for an existing surface? {list any matches}
146
+ - SharedCore extraction candidates (operations needed by 2+ surfaces): {list or "none found"}
147
+ - SharedCore milestone required? {yes — if 2+ candidates found | no — if none}
148
+ ```
149
+
150
+ ## Step 4: Decompose into Milestones
151
+
152
+ The feature may be a single milestone or multiple, depending on scope:
153
+
154
+ ### Single Milestone (if feature is focused):
155
+ - 2-4 domains, < 15 tasks total
156
+ - Minimal impact on existing contracts
157
+ - Skip roadmap, go straight to: "Run `/user:gsd-t-partition` to begin"
158
+
159
+ ### Multiple Milestones (if feature is complex):
160
+ Apply these sequencing rules:
161
+
162
+ 1. **Schema/data changes first**: New tables, migrations, model updates
163
+ 2. **Backend before frontend**: API endpoints before UI that consumes them
164
+ 3. **Existing contract updates early**: If existing contracts change, update and verify them before building new code against them
165
+ 4. **New functionality before integration**: Build the new thing, then wire it into existing flows
166
+ 5. **Migration/backfill as its own milestone**: If existing data needs transformation, isolate that work
167
+ 6. **SharedCore before new consumer surfaces**: If the feature adds a new consumer surface (web, mobile, CLI) AND SharedCore candidates were identified in Step 3's Multi-Consumer Check, add a SharedCore milestone BEFORE the new client's milestone. The SharedCore milestone extracts shared operations into a reusable backend domain — the new client's API calls SharedCore functions, it does not duplicate them.
168
+
169
+ ### Write the Feature Roadmap
170
+
171
+ Append to `.gsd-t/roadmap.md` (or create if doesn't exist):
172
+
173
+ ```markdown
174
+ ---
175
+
176
+ ## Feature: {feature name}
177
+ **Added**: {date}
178
+ **Context**: {why this feature is being added}
179
+
180
+ ### Milestone {N}: {name} — Data Layer Extension
181
+ **Goal**: {what "done" looks like}
182
+ **Scope**:
183
+ - {new tables/columns}
184
+ - {schema migrations}
185
+ - {data model updates}
186
+ **Impact on existing**:
187
+ - Extends schema-contract.md with {new tables}
188
+ - No breaking changes to existing queries
189
+ **Success criteria**:
190
+ - [ ] {testable outcome}
191
+
192
+ ### Milestone {N+1}: {name} — Feature Backend
193
+ **Goal**: {what "done" looks like}
194
+ **Scope**:
195
+ - {new API endpoints}
196
+ - {business logic}
197
+ - {integration with existing auth}
198
+ **Impact on existing**:
199
+ - Adds to api-contract.md: {new endpoints}
200
+ - Modifies: {existing middleware/routes}
201
+ **Success criteria**:
202
+ - [ ] {testable outcome}
203
+
204
+ ### Milestone {N+2}: {name} — Feature UI + Integration
205
+ **Goal**: {what "done" looks like}
206
+ **Scope**:
207
+ - {new pages/components}
208
+ - {wire into existing navigation}
209
+ - {update existing UI where needed}
210
+ **Impact on existing**:
211
+ - Modifies: {existing components}
212
+ - Extends component-contract.md with {new components}
213
+ **Success criteria**:
214
+ - [ ] {testable outcome}
215
+ ```
216
+
217
+ ## Step 5: Reconcile with Existing State
218
+
219
+ Critical step — make sure the new milestones fit with what's already built:
220
+
221
+ 1. **Check for conflicts**: Do new milestones conflict with in-progress work?
222
+ 2. **Check for dependencies**: Do any existing incomplete milestones need to finish first?
223
+ 3. **Check techdebt.md**: Are there known issues that should be fixed before or during this feature?
224
+ 4. **Update domain boundaries**: Will existing domains need scope changes? Will new domains be created?
225
+
226
+ If conflicts exist, present them to the user with options:
227
+ - "Milestone 3 (existing) modifies the same auth middleware this feature needs. Should we complete M3 first, or merge the work?"
228
+
229
+ ## Step 6: Update Project State
230
+
231
+ Update `.gsd-t/progress.md`:
232
+ - Add new milestones to the table
233
+ - Log the feature addition in Decision Log
234
+ - Note any contract changes that will be needed
235
+
236
+ ## Step 7: Document Ripple
237
+
238
+ After creating the feature roadmap and milestones, update all affected documentation:
239
+
240
+ ### Always update:
241
+ 1. **`.gsd-t/progress.md`** — Already done in Step 6, but verify Decision Log includes the feature addition with rationale
242
+
243
+ ### Check if affected:
244
+ 2. **`docs/requirements.md`** — Add new functional/technical requirements identified during feature analysis
245
+ 3. **`docs/architecture.md`** — If the feature introduces new components, data flows, or architectural patterns, document them
246
+ 4. **`docs/workflows.md`** — If the feature introduces new user journeys or modifies existing flows, update them
247
+ 5. **`CLAUDE.md`** — If the feature establishes new conventions or patterns that future work should follow, add them
248
+ 6. **`.gsd-t/contracts/`** — If impact analysis identified contract changes needed, note them (actual updates happen during partition)
249
+ 7. **`.gsd-t/techdebt.md`** — If analysis revealed existing debt that interacts with this feature, add or update items
250
+
251
+ ### Skip what's not affected.
252
+
253
+ ## Step 8: Test Verification
254
+
255
+ Before finalizing the feature plan:
256
+
257
+ 1. **Run existing tests**: Execute the full test suite to confirm the codebase is in a clean state before feature work begins
258
+ 2. **Verify passing**: If any tests fail, flag them — they must be fixed before or during the first milestone
259
+ 3. **Note test gaps**: From the impact analysis, identify which existing tests will need updates and which new tests will be needed — include these in milestone scope
260
+
261
+ ## Step 9: Report to User
262
+
263
+ Present:
264
+ 1. Impact analysis summary (what's new vs. what's modified)
265
+ 2. Milestone breakdown for the feature
266
+ 3. Risk areas and how the milestones mitigate them
267
+ 4. Any conflicts with existing work
268
+ 5. Recommended starting point
269
+
270
+ Ask: "Ready to start? Run `/user:gsd-t-partition` for Milestone {N}."
271
+
272
+ $ARGUMENTS
273
+
274
+ ## Auto-Clear
275
+
276
+ All work is committed to project files. Execute `/clear` to free the context window for the next command.