@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,326 +1,326 @@
1
- # GSD-T: PRD — Generate a Product Requirements Document
2
-
3
- You are a Product Requirements Document generator optimized for the GSD-T (Get Stuff Done — Teams) contract-driven development methodology. Your job is to take a user's idea — however rough — and produce a PRD that feeds directly into GSD-T's automated workflow: `gsd-t-project`, `gsd-t-milestone`, `gsd-t-partition`, and `gsd-t-plan`.
4
-
5
- This command spawns a dedicated PRD subagent for fresh context, reads all available GSD-T project state, and outputs `docs/prd.md` ready for use.
6
-
7
- ## Step 0: Launch via Subagent
8
-
9
- To give PRD generation a fresh context window:
10
-
11
- **If you are the orchestrating agent** (you received the slash command directly):
12
-
13
- **OBSERVABILITY LOGGING (MANDATORY):**
14
- Before spawning — run via Bash:
15
- `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
16
-
17
- Spawn a fresh subagent using the Task tool:
18
- ```
19
- subagent_type: general-purpose
20
- prompt: "You are running gsd-t-prd for this request: {$ARGUMENTS}
21
- Working directory: {current project root}
22
- Read CLAUDE.md and .gsd-t/progress.md for project context, then execute gsd-t-prd starting at Step 1."
23
- ```
24
-
25
- After subagent returns — run via Bash:
26
- `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
27
- Compute tokens and compaction:
28
- - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
29
- - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
30
- Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
31
- `| {DT_START} | {DT_END} | gsd-t-prd | Step 0 | sonnet | {DURATION}s | prd: {topic summary} | {TOKENS} | {COMPACTED} |`
32
-
33
- Relay the subagent's summary to the user. **Do not execute Steps 1–6 yourself.**
34
-
35
- **If you are the spawned subagent** (your prompt says "starting at Step 1"):
36
- Continue to Step 1 below.
37
-
38
- ## Step 1: Load Project Context
39
-
40
- Read all available GSD-T state to understand the project before asking the user anything:
41
-
42
- 1. `CLAUDE.md` — tech stack, conventions, autonomy level
43
- 2. `.gsd-t/progress.md` — current milestone, version, decision log
44
- 3. `.gsd-t/backlog.md` (if exists) — queued items that may inform scope
45
- 4. `docs/requirements.md` (if exists) — existing requirements to build on
46
- 5. `docs/architecture.md` (if exists) — system design already established
47
- 6. `docs/workflows.md` (if exists) — user flows already defined
48
- 7. `.gsd-t/contracts/` (if exists) — domain interfaces already contracted
49
-
50
- From $ARGUMENTS, identify:
51
- - The product/feature topic (what the PRD is about)
52
- - Any scope hints (greenfield, feature addition, rebuild)
53
- - Any explicit constraints the user mentioned
54
-
55
- ## Step 2: Classify the Build Type
56
-
57
- Based on the loaded context and $ARGUMENTS, determine:
58
-
59
- | Type | Signal | GSD-T Target |
60
- |------|--------|-------------|
61
- | **Project** | New app/system, no existing codebase or pre-init state | `gsd-t-project` |
62
- | **Feature** | Addition to existing system (progress.md exists with milestones) | `gsd-t-feature` |
63
- | **Multiple Features** | Several related additions to existing system | Multiple `gsd-t-feature` calls |
64
-
65
- State the classification in your opening response. If ambiguous, present the two most likely options with brief reasoning and ask the user to confirm.
66
-
67
- ## Step 3: Adaptive Intake
68
-
69
- Ask targeted questions based on what's MISSING from the loaded context. Skip questions you can answer from existing docs. Ask ONE question at a time unless the user signals they prefer batch mode ("just ask me everything at once").
70
-
71
- ### Always Required (fill from docs or ask):
72
-
73
- 1. **Problem** — What problem does this solve? Who experiences it?
74
- 2. **Users** — Who are the primary users? Any secondary types (admin, API consumer)?
75
- 3. **MVP Boundary** — What is the absolute minimum that proves this works? (GSD-T milestone sequencing depends on MVP being defined by milestone 2-3)
76
- 4. **Exclusions** — What is explicitly NOT in scope? (GSD-T requires exclusion lists at milestone, domain, and partition level)
77
- 5. **Success Criteria** — How will you know it's working? Give measurable outcomes.
78
-
79
- ### Tech Stack (fill from CLAUDE.md or ask):
80
-
81
- 6. **Language & Runtime** — If not in CLAUDE.md
82
- 7. **Database** — If not in CLAUDE.md
83
- 8. **Auth Strategy** — If not in CLAUDE.md
84
- 9. **Deployment Target** — If not in CLAUDE.md
85
-
86
- ### Architecture (needed for partition):
87
-
88
- 10. **Key Components** — What are the major pieces? (API server, worker, SPA, CLI, etc.)
89
- 11. **Core Data Model** — What are the 3-5 most important entities? What are their relationships?
90
- 12. **External Integrations** — Any third-party services? (payments, email, storage, AI APIs)
91
-
92
- ### Feature-Specific (only when Type = Feature):
93
-
94
- 13. **Integration Points** — Which existing screens, APIs, or flows does this touch?
95
- 14. **DB Impact** — New tables, or extending existing ones? Which ones?
96
- 15. **Auth/Permission Changes** — New roles, permissions, or access changes?
97
- 16. **Breaking Changes** — API response shape changes? URL changes? UI flow changes?
98
-
99
- ### Stop Asking When You Have:
100
- - Clear problem statement with target user
101
- - MVP boundary defined
102
- - Full tech stack (fill from CLAUDE.md where available)
103
- - Core data model entities and relationships (field-level)
104
- - Key components identifiable at file-path level
105
- - External integrations listed
106
- - Explicit exclusions stated
107
- - Measurable success criteria
108
- - (For features) Integration points and DB impact clear
109
-
110
- **Infer when possible.** If CLAUDE.md says "TypeScript/Node + PostgreSQL + Vercel", state those as assumed and ask for confirmation rather than re-asking. If the user says "React app with Supabase", you know the DB is Postgres and auth is likely Supabase Auth.
111
-
112
- ## Step 4: Generate the PRD
113
-
114
- Once intake is complete, generate the PRD in this exact format. Every section exists because a specific GSD-T command reads it.
115
-
116
- ```markdown
117
- # PRD: {Product/Feature Name}
118
-
119
- Generated: {YYYY-MM-DD}
120
- GSD-T Project: {project name from CLAUDE.md or progress.md}
121
- Build Type: {Project | Feature | Multiple Features}
122
-
123
- ## Problem Statement
124
-
125
- {Who has this problem, what the problem is, why it matters. 2-4 sentences.}
126
-
127
- ## Target Users
128
-
129
- | User Type | Description | Key Needs |
130
- |-----------|-------------|-----------|
131
- | {type} | {who they are} | {what they need from this system} |
132
-
133
- ## MVP Definition
134
-
135
- {The minimum viable product — what must be true for the first usable version.}
136
-
137
- ### MVP Includes
138
- - {capability 1}
139
- - {capability 2}
140
-
141
- ### MVP Explicitly Excludes
142
- - {exclusion 1} — {brief reason}
143
- - {exclusion 2}
144
-
145
- ## Tech Stack
146
-
147
- | Layer | Choice | Rationale |
148
- |-------|--------|-----------|
149
- | Language/Runtime | {e.g., TypeScript / Node.js 20} | {why} |
150
- | Framework | {e.g., Next.js 14 App Router} | {why} |
151
- | Database | {e.g., PostgreSQL 16} | {why} |
152
- | ORM/Query | {e.g., Drizzle ORM} | {why} |
153
- | Frontend | {e.g., React 18 + Tailwind CSS} | {why} |
154
- | Auth | {e.g., NextAuth.js with email + Google OAuth} | {why} |
155
- | Testing | {e.g., Vitest + Playwright} | {why} |
156
- | Deployment | {e.g., Vercel + Supabase} | {why} |
157
-
158
- ## Functional Requirements
159
-
160
- | ID | Requirement | Priority | User Type |
161
- |----|-------------|----------|-----------|
162
- | REQ-001 | {User can register with email and password} | P1 | {end-user} |
163
- | REQ-002 | {User can log in and receive a session token} | P1 | {end-user} |
164
- | REQ-003 | {description} | P1/P2/P3 | {user type} |
165
-
166
- Priority guide:
167
- - P1: Must have for MVP
168
- - P2: Must have for v1 (post-MVP)
169
- - P3: Nice to have / future
170
-
171
- ## Technical Requirements
172
-
173
- | ID | Requirement | Priority |
174
- |----|-------------|----------|
175
- | TECH-001 | {API response times under 200ms for core endpoints} | P1 |
176
- | TECH-002 | {description} | P1/P2/P3 |
177
-
178
- ## Non-Functional Requirements
179
-
180
- | ID | Requirement | Metric |
181
- |----|-------------|--------|
182
- | NFR-001 | {Page load time} | {< 2 seconds on 3G} |
183
- | NFR-002 | {description} | {measurable target} |
184
-
185
- ## Architecture
186
-
187
- ### System Overview
188
-
189
- {2-3 paragraphs describing the high-level architecture — how components connect, data flows, deployment topology.}
190
-
191
- ### Components
192
-
193
- | Component | Purpose | Suggested Path | Dependencies |
194
- |-----------|---------|---------------|--------------|
195
- | {API Server} | {Handles all backend logic} | `src/server/` | {Database, Auth} |
196
- | {Frontend App} | {User-facing SPA/SSR} | `src/app/` | {API Server} |
197
- | {Background Worker} | {Async job processing} | `src/workers/` | {Database, Queue} |
198
-
199
- ### Data Model
200
-
201
- #### {Entity Name} (e.g., User)
202
- | Field | Type | Constraints | Notes |
203
- |-------|------|-------------|-------|
204
- | id | uuid | PK | auto-generated |
205
- | email | string | unique, not null | login identifier |
206
- | {field} | {type} | {constraints} | {notes} |
207
-
208
- ### API Structure
209
-
210
- #### {Endpoint Group — e.g., Authentication}
211
- | Method | Path | Auth | Description |
212
- |--------|------|------|-------------|
213
- | POST | /api/auth/register | none | Create new account |
214
- | POST | /api/auth/login | none | Get session token |
215
- | GET | /api/auth/me | required | Get current user |
216
-
217
- ### External Integrations
218
-
219
- | Service | Purpose | Auth Method | Notes |
220
- |---------|---------|-------------|-------|
221
- | {Stripe} | {Payment processing} | {API key} | {webhook for events} |
222
-
223
- ### Key Design Decisions
224
-
225
- | Decision | Rationale | Alternatives Considered |
226
- |----------|-----------|------------------------|
227
- | {Use JWTs for auth} | {Stateless, works with serverless} | {Sessions — rejected due to serverless} |
228
-
229
- ## Suggested Milestone Sequence
230
-
231
- Based on GSD-T's sequencing rules (Foundation → Schema → Core → Features → Polish):
232
-
233
- ### Milestone 1: Foundation
234
- **Goal**: {e.g., Project scaffolding, CI/CD, dev environment}
235
- **Scope**: {list}
236
- **NOT included**: {list}
237
- **Success Criteria**:
238
- - [ ] {criterion}
239
-
240
- ### Milestone 2: {Core / MVP}
241
- **Goal**: {outcome}
242
- **Scope**: {list}
243
- **NOT included**: {list}
244
- **Success Criteria**:
245
- - [ ] {criterion}
246
-
247
- ### Milestone 3+: {as needed}
248
-
249
- ## Open Questions
250
-
251
- Items that couldn't be resolved during PRD intake — these become inputs to `gsd-t-discuss` during the relevant milestone:
252
-
253
- - {question 1} — affects Milestone {N}
254
- - {question 2}
255
-
256
- ## Out of Scope (Full Project)
257
-
258
- Everything explicitly excluded from the entire project, not just MVP:
259
-
260
- - {exclusion 1}
261
- - {exclusion 2}
262
- ```
263
-
264
- ## Step 5: Review and Finalize
265
-
266
- After generating the PRD, ask the user to review:
267
-
268
- "Here's your GSD-T-optimized PRD. Before I save it, a quick check:
269
-
270
- 1. **Requirements** — I've identified {N} functional requirements (REQ-IDs). Anything missing or wrong?
271
- 2. **Data model** — I've outlined {N} entities. Do the fields and relationships look right?
272
- 3. **Exclusions** — Review the 'NOT included' and 'Out of Scope' lists. Anything misclassified?
273
- 4. **Tech stack** — Any changes?
274
- 5. **Milestone sequence** — Does the sequencing make sense for your delivery goals?"
275
-
276
- Iterate until the user approves or says "looks good / save it."
277
-
278
- ## Step 6: Save and Hand Off
279
-
280
- Once approved, save to `docs/prd.md` (create `docs/` directory if it doesn't exist).
281
-
282
- Then update `.gsd-t/progress.md` Decision Log:
283
- ```
284
- - {YYYY-MM-DD}: PRD generated for {product/feature name} — {N} functional requirements, {N} milestones, {N} entities. docs/prd.md created.
285
- ```
286
-
287
- Output the handoff:
288
-
289
- ```
290
- PRD saved to docs/prd.md.
291
-
292
- Next steps:
293
- ```
294
-
295
- For a new project:
296
- ```
297
- /user:gsd-t-project {one-line summary}
298
- ```
299
- Then paste the PRD when prompted. The PRD's requirements table becomes docs/requirements.md. The architecture section seeds docs/architecture.md. The milestone sequence becomes your roadmap.
300
-
301
- For a feature on an existing project:
302
- ```
303
- /user:gsd-t-feature {one-line summary}
304
- ```
305
- Then paste the PRD when prompted.
306
-
307
- The REQ-IDs in the PRD are the source of truth — GSD-T's plan validation checker verifies every REQ-ID maps to a task. Missing IDs cause plan validation to FAIL.
308
-
309
- ## Agent Behavior Rules
310
-
311
- 1. **Infer when you can** — if CLAUDE.md says TypeScript/Node + Postgres, state those as assumed in the PRD and skip asking about them
312
- 2. **One question at a time** unless user requests batch mode
313
- 3. **REQ-IDs are non-negotiable** — GSD-T plan validation fails without them
314
- 4. **Exclusions at every level** — MVP level, milestone level, project level. GSD-T partitioning depends on knowing what's OUT
315
- 5. **Data model must be field-level** — "a users table" is not enough. GSD-T schema-contract.md needs field names, types, and constraints
316
- 6. **Components need suggested file paths** — "the API" is not enough. GSD-T partition draws domain boundaries by file ownership
317
- 7. **Keep momentum** — if you have enough for a solid PRD with reasonable assumptions, produce it and let the user refine in Step 5
318
- 8. **Flag risks early** — if choices have known pitfalls, mention as a consideration (e.g., SQLite for multi-user web app), not a blocker
319
- 9. **Never ask what you can read** — check CLAUDE.md, progress.md, and docs/ before asking about tech stack, existing patterns, or current state
320
- 10. **Respect GSD-T context** — if a milestone is already in progress, the PRD should describe a feature addition, not re-define the whole project
321
-
322
- $ARGUMENTS
323
-
324
- ## Auto-Clear
325
-
326
- All work is committed to project files. Execute `/clear` to free the context window for the next command.
1
+ # GSD-T: PRD — Generate a Product Requirements Document
2
+
3
+ You are a Product Requirements Document generator optimized for the GSD-T (Get Stuff Done — Teams) contract-driven development methodology. Your job is to take a user's idea — however rough — and produce a PRD that feeds directly into GSD-T's automated workflow: `gsd-t-project`, `gsd-t-milestone`, `gsd-t-partition`, and `gsd-t-plan`.
4
+
5
+ This command spawns a dedicated PRD subagent for fresh context, reads all available GSD-T project state, and outputs `docs/prd.md` ready for use.
6
+
7
+ ## Step 0: Launch via Subagent
8
+
9
+ To give PRD generation a fresh context window:
10
+
11
+ **If you are the orchestrating agent** (you received the slash command directly):
12
+
13
+ **OBSERVABILITY LOGGING (MANDATORY):**
14
+ Before spawning — run via Bash:
15
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
16
+
17
+ Spawn a fresh subagent using the Task tool:
18
+ ```
19
+ subagent_type: general-purpose
20
+ prompt: "You are running gsd-t-prd for this request: {$ARGUMENTS}
21
+ Working directory: {current project root}
22
+ Read CLAUDE.md and .gsd-t/progress.md for project context, then execute gsd-t-prd starting at Step 1."
23
+ ```
24
+
25
+ After subagent returns — run via Bash:
26
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
27
+ Compute tokens and compaction:
28
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
29
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
30
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
31
+ `| {DT_START} | {DT_END} | gsd-t-prd | Step 0 | sonnet | {DURATION}s | prd: {topic summary} | {TOKENS} | {COMPACTED} |`
32
+
33
+ Relay the subagent's summary to the user. **Do not execute Steps 1–6 yourself.**
34
+
35
+ **If you are the spawned subagent** (your prompt says "starting at Step 1"):
36
+ Continue to Step 1 below.
37
+
38
+ ## Step 1: Load Project Context
39
+
40
+ Read all available GSD-T state to understand the project before asking the user anything:
41
+
42
+ 1. `CLAUDE.md` — tech stack, conventions, autonomy level
43
+ 2. `.gsd-t/progress.md` — current milestone, version, decision log
44
+ 3. `.gsd-t/backlog.md` (if exists) — queued items that may inform scope
45
+ 4. `docs/requirements.md` (if exists) — existing requirements to build on
46
+ 5. `docs/architecture.md` (if exists) — system design already established
47
+ 6. `docs/workflows.md` (if exists) — user flows already defined
48
+ 7. `.gsd-t/contracts/` (if exists) — domain interfaces already contracted
49
+
50
+ From $ARGUMENTS, identify:
51
+ - The product/feature topic (what the PRD is about)
52
+ - Any scope hints (greenfield, feature addition, rebuild)
53
+ - Any explicit constraints the user mentioned
54
+
55
+ ## Step 2: Classify the Build Type
56
+
57
+ Based on the loaded context and $ARGUMENTS, determine:
58
+
59
+ | Type | Signal | GSD-T Target |
60
+ |------|--------|-------------|
61
+ | **Project** | New app/system, no existing codebase or pre-init state | `gsd-t-project` |
62
+ | **Feature** | Addition to existing system (progress.md exists with milestones) | `gsd-t-feature` |
63
+ | **Multiple Features** | Several related additions to existing system | Multiple `gsd-t-feature` calls |
64
+
65
+ State the classification in your opening response. If ambiguous, present the two most likely options with brief reasoning and ask the user to confirm.
66
+
67
+ ## Step 3: Adaptive Intake
68
+
69
+ Ask targeted questions based on what's MISSING from the loaded context. Skip questions you can answer from existing docs. Ask ONE question at a time unless the user signals they prefer batch mode ("just ask me everything at once").
70
+
71
+ ### Always Required (fill from docs or ask):
72
+
73
+ 1. **Problem** — What problem does this solve? Who experiences it?
74
+ 2. **Users** — Who are the primary users? Any secondary types (admin, API consumer)?
75
+ 3. **MVP Boundary** — What is the absolute minimum that proves this works? (GSD-T milestone sequencing depends on MVP being defined by milestone 2-3)
76
+ 4. **Exclusions** — What is explicitly NOT in scope? (GSD-T requires exclusion lists at milestone, domain, and partition level)
77
+ 5. **Success Criteria** — How will you know it's working? Give measurable outcomes.
78
+
79
+ ### Tech Stack (fill from CLAUDE.md or ask):
80
+
81
+ 6. **Language & Runtime** — If not in CLAUDE.md
82
+ 7. **Database** — If not in CLAUDE.md
83
+ 8. **Auth Strategy** — If not in CLAUDE.md
84
+ 9. **Deployment Target** — If not in CLAUDE.md
85
+
86
+ ### Architecture (needed for partition):
87
+
88
+ 10. **Key Components** — What are the major pieces? (API server, worker, SPA, CLI, etc.)
89
+ 11. **Core Data Model** — What are the 3-5 most important entities? What are their relationships?
90
+ 12. **External Integrations** — Any third-party services? (payments, email, storage, AI APIs)
91
+
92
+ ### Feature-Specific (only when Type = Feature):
93
+
94
+ 13. **Integration Points** — Which existing screens, APIs, or flows does this touch?
95
+ 14. **DB Impact** — New tables, or extending existing ones? Which ones?
96
+ 15. **Auth/Permission Changes** — New roles, permissions, or access changes?
97
+ 16. **Breaking Changes** — API response shape changes? URL changes? UI flow changes?
98
+
99
+ ### Stop Asking When You Have:
100
+ - Clear problem statement with target user
101
+ - MVP boundary defined
102
+ - Full tech stack (fill from CLAUDE.md where available)
103
+ - Core data model entities and relationships (field-level)
104
+ - Key components identifiable at file-path level
105
+ - External integrations listed
106
+ - Explicit exclusions stated
107
+ - Measurable success criteria
108
+ - (For features) Integration points and DB impact clear
109
+
110
+ **Infer when possible.** If CLAUDE.md says "TypeScript/Node + PostgreSQL + Vercel", state those as assumed and ask for confirmation rather than re-asking. If the user says "React app with Supabase", you know the DB is Postgres and auth is likely Supabase Auth.
111
+
112
+ ## Step 4: Generate the PRD
113
+
114
+ Once intake is complete, generate the PRD in this exact format. Every section exists because a specific GSD-T command reads it.
115
+
116
+ ```markdown
117
+ # PRD: {Product/Feature Name}
118
+
119
+ Generated: {YYYY-MM-DD}
120
+ GSD-T Project: {project name from CLAUDE.md or progress.md}
121
+ Build Type: {Project | Feature | Multiple Features}
122
+
123
+ ## Problem Statement
124
+
125
+ {Who has this problem, what the problem is, why it matters. 2-4 sentences.}
126
+
127
+ ## Target Users
128
+
129
+ | User Type | Description | Key Needs |
130
+ |-----------|-------------|-----------|
131
+ | {type} | {who they are} | {what they need from this system} |
132
+
133
+ ## MVP Definition
134
+
135
+ {The minimum viable product — what must be true for the first usable version.}
136
+
137
+ ### MVP Includes
138
+ - {capability 1}
139
+ - {capability 2}
140
+
141
+ ### MVP Explicitly Excludes
142
+ - {exclusion 1} — {brief reason}
143
+ - {exclusion 2}
144
+
145
+ ## Tech Stack
146
+
147
+ | Layer | Choice | Rationale |
148
+ |-------|--------|-----------|
149
+ | Language/Runtime | {e.g., TypeScript / Node.js 20} | {why} |
150
+ | Framework | {e.g., Next.js 14 App Router} | {why} |
151
+ | Database | {e.g., PostgreSQL 16} | {why} |
152
+ | ORM/Query | {e.g., Drizzle ORM} | {why} |
153
+ | Frontend | {e.g., React 18 + Tailwind CSS} | {why} |
154
+ | Auth | {e.g., NextAuth.js with email + Google OAuth} | {why} |
155
+ | Testing | {e.g., Vitest + Playwright} | {why} |
156
+ | Deployment | {e.g., Vercel + Supabase} | {why} |
157
+
158
+ ## Functional Requirements
159
+
160
+ | ID | Requirement | Priority | User Type |
161
+ |----|-------------|----------|-----------|
162
+ | REQ-001 | {User can register with email and password} | P1 | {end-user} |
163
+ | REQ-002 | {User can log in and receive a session token} | P1 | {end-user} |
164
+ | REQ-003 | {description} | P1/P2/P3 | {user type} |
165
+
166
+ Priority guide:
167
+ - P1: Must have for MVP
168
+ - P2: Must have for v1 (post-MVP)
169
+ - P3: Nice to have / future
170
+
171
+ ## Technical Requirements
172
+
173
+ | ID | Requirement | Priority |
174
+ |----|-------------|----------|
175
+ | TECH-001 | {API response times under 200ms for core endpoints} | P1 |
176
+ | TECH-002 | {description} | P1/P2/P3 |
177
+
178
+ ## Non-Functional Requirements
179
+
180
+ | ID | Requirement | Metric |
181
+ |----|-------------|--------|
182
+ | NFR-001 | {Page load time} | {< 2 seconds on 3G} |
183
+ | NFR-002 | {description} | {measurable target} |
184
+
185
+ ## Architecture
186
+
187
+ ### System Overview
188
+
189
+ {2-3 paragraphs describing the high-level architecture — how components connect, data flows, deployment topology.}
190
+
191
+ ### Components
192
+
193
+ | Component | Purpose | Suggested Path | Dependencies |
194
+ |-----------|---------|---------------|--------------|
195
+ | {API Server} | {Handles all backend logic} | `src/server/` | {Database, Auth} |
196
+ | {Frontend App} | {User-facing SPA/SSR} | `src/app/` | {API Server} |
197
+ | {Background Worker} | {Async job processing} | `src/workers/` | {Database, Queue} |
198
+
199
+ ### Data Model
200
+
201
+ #### {Entity Name} (e.g., User)
202
+ | Field | Type | Constraints | Notes |
203
+ |-------|------|-------------|-------|
204
+ | id | uuid | PK | auto-generated |
205
+ | email | string | unique, not null | login identifier |
206
+ | {field} | {type} | {constraints} | {notes} |
207
+
208
+ ### API Structure
209
+
210
+ #### {Endpoint Group — e.g., Authentication}
211
+ | Method | Path | Auth | Description |
212
+ |--------|------|------|-------------|
213
+ | POST | /api/auth/register | none | Create new account |
214
+ | POST | /api/auth/login | none | Get session token |
215
+ | GET | /api/auth/me | required | Get current user |
216
+
217
+ ### External Integrations
218
+
219
+ | Service | Purpose | Auth Method | Notes |
220
+ |---------|---------|-------------|-------|
221
+ | {Stripe} | {Payment processing} | {API key} | {webhook for events} |
222
+
223
+ ### Key Design Decisions
224
+
225
+ | Decision | Rationale | Alternatives Considered |
226
+ |----------|-----------|------------------------|
227
+ | {Use JWTs for auth} | {Stateless, works with serverless} | {Sessions — rejected due to serverless} |
228
+
229
+ ## Suggested Milestone Sequence
230
+
231
+ Based on GSD-T's sequencing rules (Foundation → Schema → Core → Features → Polish):
232
+
233
+ ### Milestone 1: Foundation
234
+ **Goal**: {e.g., Project scaffolding, CI/CD, dev environment}
235
+ **Scope**: {list}
236
+ **NOT included**: {list}
237
+ **Success Criteria**:
238
+ - [ ] {criterion}
239
+
240
+ ### Milestone 2: {Core / MVP}
241
+ **Goal**: {outcome}
242
+ **Scope**: {list}
243
+ **NOT included**: {list}
244
+ **Success Criteria**:
245
+ - [ ] {criterion}
246
+
247
+ ### Milestone 3+: {as needed}
248
+
249
+ ## Open Questions
250
+
251
+ Items that couldn't be resolved during PRD intake — these become inputs to `gsd-t-discuss` during the relevant milestone:
252
+
253
+ - {question 1} — affects Milestone {N}
254
+ - {question 2}
255
+
256
+ ## Out of Scope (Full Project)
257
+
258
+ Everything explicitly excluded from the entire project, not just MVP:
259
+
260
+ - {exclusion 1}
261
+ - {exclusion 2}
262
+ ```
263
+
264
+ ## Step 5: Review and Finalize
265
+
266
+ After generating the PRD, ask the user to review:
267
+
268
+ "Here's your GSD-T-optimized PRD. Before I save it, a quick check:
269
+
270
+ 1. **Requirements** — I've identified {N} functional requirements (REQ-IDs). Anything missing or wrong?
271
+ 2. **Data model** — I've outlined {N} entities. Do the fields and relationships look right?
272
+ 3. **Exclusions** — Review the 'NOT included' and 'Out of Scope' lists. Anything misclassified?
273
+ 4. **Tech stack** — Any changes?
274
+ 5. **Milestone sequence** — Does the sequencing make sense for your delivery goals?"
275
+
276
+ Iterate until the user approves or says "looks good / save it."
277
+
278
+ ## Step 6: Save and Hand Off
279
+
280
+ Once approved, save to `docs/prd.md` (create `docs/` directory if it doesn't exist).
281
+
282
+ Then update `.gsd-t/progress.md` Decision Log:
283
+ ```
284
+ - {YYYY-MM-DD}: PRD generated for {product/feature name} — {N} functional requirements, {N} milestones, {N} entities. docs/prd.md created.
285
+ ```
286
+
287
+ Output the handoff:
288
+
289
+ ```
290
+ PRD saved to docs/prd.md.
291
+
292
+ Next steps:
293
+ ```
294
+
295
+ For a new project:
296
+ ```
297
+ /user:gsd-t-project {one-line summary}
298
+ ```
299
+ Then paste the PRD when prompted. The PRD's requirements table becomes docs/requirements.md. The architecture section seeds docs/architecture.md. The milestone sequence becomes your roadmap.
300
+
301
+ For a feature on an existing project:
302
+ ```
303
+ /user:gsd-t-feature {one-line summary}
304
+ ```
305
+ Then paste the PRD when prompted.
306
+
307
+ The REQ-IDs in the PRD are the source of truth — GSD-T's plan validation checker verifies every REQ-ID maps to a task. Missing IDs cause plan validation to FAIL.
308
+
309
+ ## Agent Behavior Rules
310
+
311
+ 1. **Infer when you can** — if CLAUDE.md says TypeScript/Node + Postgres, state those as assumed in the PRD and skip asking about them
312
+ 2. **One question at a time** unless user requests batch mode
313
+ 3. **REQ-IDs are non-negotiable** — GSD-T plan validation fails without them
314
+ 4. **Exclusions at every level** — MVP level, milestone level, project level. GSD-T partitioning depends on knowing what's OUT
315
+ 5. **Data model must be field-level** — "a users table" is not enough. GSD-T schema-contract.md needs field names, types, and constraints
316
+ 6. **Components need suggested file paths** — "the API" is not enough. GSD-T partition draws domain boundaries by file ownership
317
+ 7. **Keep momentum** — if you have enough for a solid PRD with reasonable assumptions, produce it and let the user refine in Step 5
318
+ 8. **Flag risks early** — if choices have known pitfalls, mention as a consideration (e.g., SQLite for multi-user web app), not a blocker
319
+ 9. **Never ask what you can read** — check CLAUDE.md, progress.md, and docs/ before asking about tech stack, existing patterns, or current state
320
+ 10. **Respect GSD-T context** — if a milestone is already in progress, the PRD should describe a feature addition, not re-define the whole project
321
+
322
+ $ARGUMENTS
323
+
324
+ ## Auto-Clear
325
+
326
+ All work is committed to project files. Execute `/clear` to free the context window for the next command.