@tekyzinc/gsd-t 2.51.10 → 2.53.11

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 (100) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +379 -373
  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 -482
  34. package/commands/gsd-t-discuss.md +174 -174
  35. package/commands/gsd-t-execute.md +758 -715
  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-scan-setup.md +1 -5
  41. package/commands/gsd-t-init.md +314 -280
  42. package/commands/gsd-t-integrate.md +365 -333
  43. package/commands/gsd-t-milestone.md +87 -87
  44. package/commands/gsd-t-partition.md +442 -361
  45. package/commands/gsd-t-pause.md +82 -82
  46. package/commands/gsd-t-plan.md +345 -344
  47. package/commands/gsd-t-populate.md +111 -111
  48. package/commands/gsd-t-prd.md +326 -326
  49. package/commands/gsd-t-project.md +211 -211
  50. package/commands/gsd-t-promote-debt.md +123 -123
  51. package/commands/gsd-t-prompt.md +137 -137
  52. package/commands/gsd-t-qa.md +266 -266
  53. package/commands/gsd-t-quick.md +357 -315
  54. package/commands/gsd-t-reflect.md +134 -134
  55. package/commands/gsd-t-resume.md +72 -72
  56. package/commands/gsd-t-scan.md +615 -615
  57. package/commands/gsd-t-setup.md +76 -0
  58. package/commands/gsd-t-status.md +192 -166
  59. package/commands/gsd-t-test-sync.md +381 -381
  60. package/commands/gsd-t-triage-and-merge.md +171 -171
  61. package/commands/gsd-t-verify.md +382 -382
  62. package/commands/gsd-t-visualize.md +118 -118
  63. package/commands/gsd-t-wave.md +401 -378
  64. package/docs/GSD-T-README.md +425 -424
  65. package/docs/architecture.md +385 -369
  66. package/docs/harness-design-analysis.md +371 -0
  67. package/docs/infrastructure.md +205 -205
  68. package/docs/prd-graph-engine.md +398 -398
  69. package/docs/prd-gsd2-hybrid.md +559 -559
  70. package/docs/prd-harness-evolution.md +583 -0
  71. package/docs/requirements.md +14 -0
  72. package/docs/workflows.md +226 -226
  73. package/examples/.gsd-t/domains/example-domain/scope.md +13 -13
  74. package/package.json +40 -40
  75. package/scripts/gsd-t-auto-route.js +39 -39
  76. package/scripts/gsd-t-dashboard-mockup.html +1143 -1143
  77. package/scripts/gsd-t-dashboard-server.js +171 -171
  78. package/scripts/gsd-t-dashboard.html +262 -262
  79. package/scripts/gsd-t-event-writer.js +128 -128
  80. package/scripts/gsd-t-statusline.js +94 -94
  81. package/scripts/gsd-t-tools.js +175 -175
  82. package/templates/CLAUDE-global.md +638 -634
  83. package/templates/CLAUDE-project.md +24 -0
  84. package/templates/backlog-settings.md +18 -18
  85. package/templates/backlog.md +1 -1
  86. package/templates/progress.md +40 -40
  87. package/templates/shared-services-contract.md +60 -60
  88. package/templates/stacks/desktop.ini +2 -2
  89. package/bin/desktop.ini +0 -2
  90. package/commands/desktop.ini +0 -2
  91. package/docs/ci-examples/desktop.ini +0 -2
  92. package/docs/desktop.ini +0 -2
  93. package/examples/.gsd-t/contracts/desktop.ini +0 -2
  94. package/examples/.gsd-t/desktop.ini +0 -2
  95. package/examples/.gsd-t/domains/desktop.ini +0 -2
  96. package/examples/.gsd-t/domains/example-domain/desktop.ini +0 -2
  97. package/examples/desktop.ini +0 -2
  98. package/examples/rules/desktop.ini +0 -2
  99. package/scripts/desktop.ini +0 -2
  100. package/templates/desktop.ini +0 -2
@@ -1,280 +1,314 @@
1
- # GSD-T: Init — Initialize Project
2
-
3
- You are setting up a new project (or converting an existing one) to use the GSD-T contract-driven workflow.
4
-
5
- ## Step 1: Assess Current State
6
-
7
- Check what exists:
8
- - `CLAUDE.md` — project instructions?
9
- - `.gsd-t/` — already initialized?
10
- - `.gsd/` — legacy GSD structure?
11
- - `docs/` — existing documentation?
12
- - `src/` — existing code?
13
-
14
- ### If `.gsd-t/` already exists:
15
- Report current state and ask if user wants to reset or continue.
16
-
17
- ### If `.gsd/` exists (legacy GSD):
18
- Offer to migrate: "Found legacy GSD structure. Want me to migrate to GSD-T?"
19
- If yes, read `.gsd/` state and create equivalent `.gsd-t/` structure.
20
-
21
- ## Step 2: Copy Local Settings
22
-
23
- 1. **Ensure `~/.claude/settings.local` exists**:
24
- - If it does NOT exist, create it now with these default permissions:
25
- ```json
26
- {
27
- "permissions": {
28
- "allow": [
29
- "Edit",
30
- "Write",
31
- "Bash",
32
- "Read",
33
- "WebSearch",
34
- "WebFetch",
35
- "Skill"
36
- ]
37
- },
38
- "outputStyle": "default"
39
- }
40
- ```
41
- After creating it, log: "Created ~/.claude/settings.local with default permissions — update the allow list to match your security preferences."
42
-
43
- 2. **Copy to project**: If `.claude/settings.local.json` does NOT already exist in the project root:
44
- - Create the `.claude/` directory in the project root if it doesn't exist
45
- - Copy `~/.claude/settings.local` → `.claude/settings.local.json`
46
-
47
- Skip the copy (step 2) silently if the target already exists.
48
-
49
- ## Step 3: Create Directory Structure
50
-
51
- ```
52
- .gsd-t/
53
- ├── contracts/
54
- │ └── .gitkeep
55
- ├── domains/
56
- │ └── .gitkeep
57
- ├── stacks/
58
- └── README.md
59
- ├── events/
60
- ├── backlog.md
61
- ├── backlog-settings.md
62
- ├── progress.md
63
- ├── token-log.md
64
- └── qa-issues.md
65
- ```
66
-
67
- Create `.gsd-t/stacks/` directory with a `README.md` explaining the override mechanism:
68
- - This folder holds project-specific overrides of global stack rule files
69
- - If a file with the same name as a global stack file exists here, it replaces the global version
70
- - Folder stays empty until the developer explicitly adds overrides
71
-
72
- Create `.gsd-t/events/` directory (empty — populated at runtime by heartbeat and event writer).
73
-
74
- Create `token-log.md` with header row:
75
- ```
76
- | Date | Command | Step | Model | Duration(s) | Notes |
77
- |------|---------|------|-------|-------------|-------|
78
- ```
79
-
80
- Create `qa-issues.md` with header row:
81
- ```
82
- | Date | Command | Step | Model | Duration(s) | Severity | Finding |
83
- |------|---------|------|-------|-------------|----------|---------|
84
- ```
85
-
86
- ## Step 4: Initialize Backlog
87
-
88
- Create the backlog files from templates:
89
- 1. Copy `templates/backlog.md` → `.gsd-t/backlog.md`
90
- 2. Copy `templates/backlog-settings.md` `.gsd-t/backlog-settings.md`
91
-
92
- ### Category Derivation
93
-
94
- Read the project's `CLAUDE.md` (if it exists) to auto-populate backlog settings:
95
-
96
- 1. **Apps**: Scan for app names, service names, or product names (look for headings, "Tech Stack" sections, or named components). Populate the `## Apps` section in `backlog-settings.md` with discovered names (lowercase).
97
- 2. **Categories**: Scan for domain concepts, module names, and technical areas (e.g., "authentication", "payments", "api", "database"). Populate the `## Categories` section.
98
- 3. **Default App**: Set `**Default App:**` to the most prominent app found (the one mentioned most, or the first one). If only one app is found, use it.
99
- 4. **If nothing found**: Leave the placeholder values from the template — the user can configure later via `/user:gsd-t-backlog-settings`.
100
-
101
- ## Step 5: Initialize Progress File
102
-
103
- ### Version Detection
104
-
105
- Before creating the progress file, determine the starting version:
106
-
107
- 1. **Check for an existing version** in the project's manifest file (in this priority order):
108
- - `package.json` `version` field
109
- - `pyproject.toml` `[project] version` or `[tool.poetry] version`
110
- - `Cargo.toml` → `[package] version`
111
- - `setup.py` → `version=` argument
112
- - `build.gradle` / `build.gradle.kts` → `version = `
113
- - `.version` file → contents as-is
114
- 2. **If a version is found**: Use it as the starting GSD-T version (the project already has its own versioning history).
115
- 3. **If no version is found**: Use `0.1.00` — the standard GSD-T starting point for a brand-new project with no prior releases. The first `gsd-t-complete-milestone` will reset the patch to `0.1.10` (or bump minor/major per milestone scope).
116
-
117
- Create `.gsd-t/progress.md`:
118
-
119
- ```markdown
120
- # GSD-T Progress
121
-
122
- ## Project: {name from CLAUDE.md or $ARGUMENTS}
123
- ## Version: {detected version, or 0.1.00}
124
- ## Status: INITIALIZED
125
- ## Date: {today}
126
-
127
- ## Milestones
128
- | # | Milestone | Status | Domains |
129
- |---|-----------|--------|---------|
130
- | 1 | {TBD} | not started | TBD |
131
-
132
- ## Domains
133
- (populated during partition phase)
134
-
135
- ## Contracts
136
- (populated during partition phase)
137
-
138
- ## Integration Checkpoints
139
- (populated during plan phase)
140
-
141
- ## Decision Log
142
- - {date}: Project initialized with GSD-T workflow
143
- ```
144
-
145
- ## Step 6: Ensure CLAUDE.md Exists
146
-
147
- If no `CLAUDE.md`:
148
- Create a starter template:
149
-
150
- ```markdown
151
- # {Project Name}
152
-
153
- ## Overview
154
- {Brief project description — fill this in}
155
-
156
- ## Tech Stack
157
- {Languages, frameworks, services — fill this in}
158
-
159
- ## Documentation
160
- - Requirements: docs/requirements.md
161
- - Architecture: docs/architecture.md
162
- - Workflows: docs/workflows.md
163
- - Infrastructure: docs/infrastructure.md
164
-
165
- ## Autonomy Level
166
- **Level 3 Full Auto** (only pause for blockers or completion)
167
-
168
- ## Branch Guard
169
- **Expected branch**: {current branch from `git branch --show-current`}
170
-
171
- ## Conventions
172
- - {Coding style, naming patterns — fill this in}
173
-
174
- ## Workflow Preferences
175
- <!-- Override global defaults. Delete what you don't need to override. -->
176
-
177
- ## GSD-T Workflow
178
- This project uses contract-driven development.
179
- - State: .gsd-t/progress.md
180
- - Contracts: .gsd-t/contracts/
181
- - Domains: .gsd-t/domains/
182
- ```
183
-
184
- If `CLAUDE.md` exists but doesn't reference GSD-T, append the GSD-T section.
185
-
186
- ## Step 7: Create docs/ if Needed
187
-
188
- If no `docs/` directory, create it with all 4 living document templates.
189
- For each file, skip if it already exists:
190
-
191
- ```
192
- docs/
193
- ├── requirements.md — Functional, technical, and non-functional requirements
194
- ├── architecture.md — System design, components, data flow, design decisions
195
- ├── workflows.md — User journeys, technical processes, API flows
196
- └── infrastructure.md — Dev setup, DB commands, cloud provisioning, deployment, credentials
197
- ```
198
-
199
- These are the living documents that persist across milestones and keep institutional knowledge alive. The `infrastructure.md` is especially important — it captures the exact commands for provisioning cloud resources, setting up databases, managing secrets, and deploying, so this knowledge doesn't get lost between sessions.
200
-
201
- ## Step 8: Ensure README.md Exists
202
-
203
- If no `README.md` exists, create one with:
204
- - Project name and brief description
205
- - Tech stack summary
206
- - Getting started / setup instructions (from existing configs or placeholder)
207
- - Link to `docs/` for detailed documentation
208
-
209
- If `README.md` exists, leave it as-is — don't overwrite user content during init.
210
-
211
- ## Step 9: Map Existing Codebase (if code exists)
212
-
213
- If there's existing source code:
214
- 1. Scan the codebase structure
215
- 2. Identify natural domain boundaries based on file organization
216
- 3. Note existing patterns and conventions
217
- 4. Add findings to CLAUDE.md
218
- 5. Log in progress.md: "Existing codebase analyzed — {summary}"
219
-
220
- ## Step 10: Document Ripple
221
-
222
- After initialization, verify all created documentation is consistent:
223
-
224
- ### Always update:
225
- 1. **`.gsd-t/progress.md`** — Already created in Step 3, verify it's complete
226
- 2. **`CLAUDE.md`** — Already handled in Step 4, verify GSD-T section is present and references all docs
227
-
228
- ### Check if affected:
229
- 3. **`docs/requirements.md`** If existing code was scanned (Step 7), verify requirements doc reflects discovered functionality
230
- 4. **`docs/architecture.md`** If existing code was scanned, verify architecture doc reflects the actual system structure
231
- 5. **`README.md`** — Already handled in Step 6, verify it links to docs/ and reflects project state
232
-
233
- ### Skip what's not affectedinit creates docs, so most ripple is about consistency verification.
234
-
235
- ## Step 11: Playwright Setup (MANDATORY)
236
-
237
- Every GSD-T project must have Playwright ready for E2E testing. If `playwright.config.*` does not exist:
238
-
239
- 1. **Detect package manager**: Check for `bun.lockb` (bun), `yarn.lock` (yarn), `pnpm-lock.yaml` (pnpm), `package-lock.json` or `package.json` (npm), `requirements.txt`/`pyproject.toml` (Python)
240
- 2. **Install Playwright**:
241
- - bun: `bun add -d @playwright/test && bunx playwright install chromium`
242
- - npm: `npm install -D @playwright/test && npx playwright install chromium`
243
- - yarn: `yarn add -D @playwright/test && yarn playwright install chromium`
244
- - pnpm: `pnpm add -D @playwright/test && pnpm exec playwright install chromium`
245
- - Python: `pip install playwright && playwright install chromium`
246
- - No package manager detected: `npm init -y && npm install -D @playwright/test && npx playwright install chromium`
247
- 3. **Create `playwright.config.ts`** (or `.js` if not using TypeScript) with sensible defaults:
248
- - `testDir: './e2e'` (or `./tests/e2e`)
249
- - `use: { baseURL: 'http://localhost:3000' }` (adjust based on project)
250
- - Chromium only (keep it fast; user can add more browsers later)
251
- - Screenshot on failure enabled
252
- 4. **Create the E2E test directory** (`e2e/` or `tests/e2e/`) with a placeholder spec
253
- 5. **Add test script** to `package.json` if it exists: `"test:e2e": "playwright test"`
254
-
255
- Skip silently if `playwright.config.*` already exists.
256
-
257
- ## Step 12: Test Verification
258
-
259
- After initialization:
260
-
261
- 1. **If existing code with tests**: Run the full test suite to establish a baseline. Document results in `.gsd-t/progress.md`
262
- 2. **If existing code without tests**: Playwright is now set up (Step 7.6) — note unit test framework should be added as part of the first milestone
263
- 3. **If greenfield**: Playwright is ready. Note that unit test infrastructure should be added in Milestone 1
264
- 4. **Verify init outputs**: Confirm all created files exist and are non-empty
265
-
266
- ## Step 13: Report
267
-
268
- Tell the user:
269
- 1. What was created (including backlog files: `.gsd-t/backlog.md` and `.gsd-t/backlog-settings.md`)
270
- 2. What they should fill in (CLAUDE.md details, requirements)
271
- 3. Backlog settings status: whether apps/categories were auto-derived from CLAUDE.md or need manual configuration via `/user:gsd-t-backlog-settings`
272
- 4. Recommended next step:
273
- - New project: "Define your milestone, then run /user:gsd-t-partition"
274
- - Existing code: "I've mapped the codebase. Ready for /user:gsd-t-partition {milestone}"
275
-
276
- $ARGUMENTS
277
-
278
- ## Auto-Clear
279
-
280
- All work is committed to project files. Execute `/clear` to free the context window for the next command.
1
+ # GSD-T: Init — Initialize Project
2
+
3
+ You are setting up a new project (or converting an existing one) to use the GSD-T contract-driven workflow.
4
+
5
+ ## Step 1: Assess Current State
6
+
7
+ Check what exists:
8
+ - `CLAUDE.md` — project instructions?
9
+ - `.gsd-t/` — already initialized?
10
+ - `.gsd/` — legacy GSD structure?
11
+ - `docs/` — existing documentation?
12
+ - `src/` — existing code?
13
+
14
+ ### If `.gsd-t/` already exists:
15
+ Report current state and ask if user wants to reset or continue.
16
+
17
+ ### If `.gsd/` exists (legacy GSD):
18
+ Offer to migrate: "Found legacy GSD structure. Want me to migrate to GSD-T?"
19
+ If yes, read `.gsd/` state and create equivalent `.gsd-t/` structure.
20
+
21
+ ## Step 2: Copy Local Settings
22
+
23
+ 1. **Ensure `~/.claude/settings.local` exists**:
24
+ - If it does NOT exist, create it now with these default permissions:
25
+ ```json
26
+ {
27
+ "permissions": {
28
+ "allow": [
29
+ "Edit",
30
+ "Write",
31
+ "Bash",
32
+ "Read",
33
+ "WebSearch",
34
+ "WebFetch",
35
+ "Skill"
36
+ ]
37
+ },
38
+ "outputStyle": "default"
39
+ }
40
+ ```
41
+ After creating it, log: "Created ~/.claude/settings.local with default permissions — update the allow list to match your security preferences."
42
+
43
+ ## Step 3: Create Directory Structure
44
+
45
+ ```
46
+ .gsd-t/
47
+ ├── contracts/
48
+ │ └── .gitkeep
49
+ ├── domains/
50
+ │ └── .gitkeep
51
+ ├── stacks/
52
+ │ └── README.md
53
+ ├── events/
54
+ ├── backlog.md
55
+ ├── backlog-settings.md
56
+ ├── progress.md
57
+ ├── token-log.md
58
+ └── qa-issues.md
59
+ ```
60
+
61
+ Create `.gsd-t/stacks/` directory with a `README.md` explaining the override mechanism:
62
+ - This folder holds project-specific overrides of global stack rule files
63
+ - If a file with the same name as a global stack file exists here, it replaces the global version
64
+ - Folder stays empty until the developer explicitly adds overrides
65
+
66
+ Create `.gsd-t/events/` directory (empty — populated at runtime by heartbeat and event writer).
67
+
68
+ Create `token-log.md` with header row:
69
+ ```
70
+ | Date | Command | Step | Model | Duration(s) | Notes |
71
+ |------|---------|------|-------|-------------|-------|
72
+ ```
73
+
74
+ Create `qa-issues.md` with header row:
75
+ ```
76
+ | Date | Command | Step | Model | Duration(s) | Severity | Finding |
77
+ |------|---------|------|-------|-------------|----------|---------|
78
+ ```
79
+
80
+ ## Step 4: Initialize Backlog
81
+
82
+ Create the backlog files from templates:
83
+ 1. Copy `templates/backlog.md` → `.gsd-t/backlog.md`
84
+ 2. Copy `templates/backlog-settings.md` → `.gsd-t/backlog-settings.md`
85
+
86
+ ### Category Derivation
87
+
88
+ Read the project's `CLAUDE.md` (if it exists) to auto-populate backlog settings:
89
+
90
+ 1. **Apps**: Scan for app names, service names, or product names (look for headings, "Tech Stack" sections, or named components). Populate the `## Apps` section in `backlog-settings.md` with discovered names (lowercase).
91
+ 2. **Categories**: Scan for domain concepts, module names, and technical areas (e.g., "authentication", "payments", "api", "database"). Populate the `## Categories` section.
92
+ 3. **Default App**: Set `**Default App:**` to the most prominent app found (the one mentioned most, or the first one). If only one app is found, use it.
93
+ 4. **If nothing found**: Leave the placeholder values from the template — the user can configure later via `/user:gsd-t-backlog-settings`.
94
+
95
+ ## Step 5: Initialize Progress File
96
+
97
+ ### Version Detection
98
+
99
+ Before creating the progress file, determine the starting version:
100
+
101
+ 1. **Check for an existing version** in the project's manifest file (in this priority order):
102
+ - `package.json` → `version` field
103
+ - `pyproject.toml` → `[project] version` or `[tool.poetry] version`
104
+ - `Cargo.toml` → `[package] version`
105
+ - `setup.py` `version=` argument
106
+ - `build.gradle` / `build.gradle.kts` → `version = `
107
+ - `.version` file contents as-is
108
+ 2. **If a version is found**: Use it as the starting GSD-T version (the project already has its own versioning history).
109
+ 3. **If no version is found**: Use `0.1.00` the standard GSD-T starting point for a brand-new project with no prior releases. The first `gsd-t-complete-milestone` will reset the patch to `0.1.10` (or bump minor/major per milestone scope).
110
+
111
+ Create `.gsd-t/progress.md`:
112
+
113
+ ```markdown
114
+ # GSD-T Progress
115
+
116
+ ## Project: {name from CLAUDE.md or $ARGUMENTS}
117
+ ## Version: {detected version, or 0.1.00}
118
+ ## Status: INITIALIZED
119
+ ## Date: {today}
120
+
121
+ ## Milestones
122
+ | # | Milestone | Status | Domains |
123
+ |---|-----------|--------|---------|
124
+ | 1 | {TBD} | not started | TBD |
125
+
126
+ ## Domains
127
+ (populated during partition phase)
128
+
129
+ ## Contracts
130
+ (populated during partition phase)
131
+
132
+ ## Integration Checkpoints
133
+ (populated during plan phase)
134
+
135
+ ## Decision Log
136
+ - {date}: Project initialized with GSD-T workflow
137
+ ```
138
+
139
+ ## Step 6: Ensure CLAUDE.md Exists
140
+
141
+ If no `CLAUDE.md`:
142
+ Create a starter template:
143
+
144
+ ```markdown
145
+ # {Project Name}
146
+
147
+ ## Overview
148
+ {Brief project description — fill this in}
149
+
150
+ ## Tech Stack
151
+ {Languages, frameworks, services — fill this in}
152
+
153
+ ## Documentation
154
+ - Requirements: docs/requirements.md
155
+ - Architecture: docs/architecture.md
156
+ - Workflows: docs/workflows.md
157
+ - Infrastructure: docs/infrastructure.md
158
+
159
+ ## Autonomy Level
160
+ **Level 3 — Full Auto** (only pause for blockers or completion)
161
+
162
+ ## Branch Guard
163
+ **Expected branch**: {current branch from `git branch --show-current`}
164
+
165
+ ## Conventions
166
+ - {Coding style, naming patterns fill this in}
167
+
168
+ ## Workflow Preferences
169
+ <!-- Override global defaults. Delete what you don't need to override. -->
170
+
171
+ ## GSD-T Workflow
172
+ This project uses contract-driven development.
173
+ - State: .gsd-t/progress.md
174
+ - Contracts: .gsd-t/contracts/
175
+ - Domains: .gsd-t/domains/
176
+ ```
177
+
178
+ If `CLAUDE.md` exists but doesn't reference GSD-T, append the GSD-T section.
179
+
180
+ ## Step 6.5: Set Quality North Star
181
+
182
+ Detect the project type and offer a quality persona preset. This writes a `## Quality North Star` section to `CLAUDE.md` so subagents have a quality lens at execute time.
183
+
184
+ **Skip this step if `CLAUDE.md` already contains `## Quality North Star`.**
185
+
186
+ ### Auto-detect project type
187
+
188
+ Read `package.json` (if it exists) and apply the first matching rule:
189
+
190
+ | Signal | Suggested preset |
191
+ |--------|-----------------|
192
+ | `"bin"` field present | `cli` |
193
+ | `"react"`, `"next"`, or `"vue"` in `dependencies` or `devDependencies` | `web-app` |
194
+ | `"main"` field present AND no `"scripts.dev"` field | `library` |
195
+ | No strong signal | prompt user to choose |
196
+
197
+ ### Preset text
198
+
199
+ | Preset ID | Text to write |
200
+ |-----------|---------------|
201
+ | `library` | `This is a published npm library. Every public API must be intuitive, well-documented, and backward-compatible. Type safety and zero-dependency design are non-negotiable.` |
202
+ | `web-app` | `This is a user-facing web application. Every feature must be accessible, performant, and visually consistent. The user experience is the product.` |
203
+ | `cli` | `This is a developer CLI tool. Every command must be fast, predictable, and produce clear output. Error messages must explain what went wrong and how to fix it.` |
204
+ | `custom` | Ask user for a 1–3 sentence description of what "excellent" means for this project. |
205
+
206
+ ### Write to CLAUDE.md
207
+
208
+ Append (or insert before `## GSD-T Workflow` if present):
209
+
210
+ ```markdown
211
+ ## Quality North Star
212
+
213
+ {selected preset text or user-provided custom text}
214
+ ```
215
+
216
+ If no `package.json` is found and this is a non-JS project, prompt the user to choose a preset or provide custom text.
217
+
218
+ Log in `.gsd-t/progress.md` Decision Log: `- {date}: Quality North Star set preset: {preset-id}`
219
+
220
+ ## Step 7: Create docs/ if Needed
221
+
222
+ If no `docs/` directory, create it with all 4 living document templates.
223
+ For each file, skip if it already exists:
224
+
225
+ ```
226
+ docs/
227
+ ├── requirements.md — Functional, technical, and non-functional requirements
228
+ ├── architecture.md — System design, components, data flow, design decisions
229
+ ├── workflows.md User journeys, technical processes, API flows
230
+ └── infrastructure.md Dev setup, DB commands, cloud provisioning, deployment, credentials
231
+ ```
232
+
233
+ These are the living documents that persist across milestones and keep institutional knowledge alive. The `infrastructure.md` is especially important it captures the exact commands for provisioning cloud resources, setting up databases, managing secrets, and deploying, so this knowledge doesn't get lost between sessions.
234
+
235
+ ## Step 8: Ensure README.md Exists
236
+
237
+ If no `README.md` exists, create one with:
238
+ - Project name and brief description
239
+ - Tech stack summary
240
+ - Getting started / setup instructions (from existing configs or placeholder)
241
+ - Link to `docs/` for detailed documentation
242
+
243
+ If `README.md` exists, leave it as-is don't overwrite user content during init.
244
+
245
+ ## Step 9: Map Existing Codebase (if code exists)
246
+
247
+ If there's existing source code:
248
+ 1. Scan the codebase structure
249
+ 2. Identify natural domain boundaries based on file organization
250
+ 3. Note existing patterns and conventions
251
+ 4. Add findings to CLAUDE.md
252
+ 5. Log in progress.md: "Existing codebase analyzed {summary}"
253
+
254
+ ## Step 10: Document Ripple
255
+
256
+ After initialization, verify all created documentation is consistent:
257
+
258
+ ### Always update:
259
+ 1. **`.gsd-t/progress.md`** — Already created in Step 3, verify it's complete
260
+ 2. **`CLAUDE.md`** — Already handled in Step 4, verify GSD-T section is present and references all docs
261
+
262
+ ### Check if affected:
263
+ 3. **`docs/requirements.md`** If existing code was scanned (Step 7), verify requirements doc reflects discovered functionality
264
+ 4. **`docs/architecture.md`** If existing code was scanned, verify architecture doc reflects the actual system structure
265
+ 5. **`README.md`** — Already handled in Step 6, verify it links to docs/ and reflects project state
266
+
267
+ ### Skip what's not affected — init creates docs, so most ripple is about consistency verification.
268
+
269
+ ## Step 11: Playwright Setup (MANDATORY)
270
+
271
+ Every GSD-T project must have Playwright ready for E2E testing. If `playwright.config.*` does not exist:
272
+
273
+ 1. **Detect package manager**: Check for `bun.lockb` (bun), `yarn.lock` (yarn), `pnpm-lock.yaml` (pnpm), `package-lock.json` or `package.json` (npm), `requirements.txt`/`pyproject.toml` (Python)
274
+ 2. **Install Playwright**:
275
+ - bun: `bun add -d @playwright/test && bunx playwright install chromium`
276
+ - npm: `npm install -D @playwright/test && npx playwright install chromium`
277
+ - yarn: `yarn add -D @playwright/test && yarn playwright install chromium`
278
+ - pnpm: `pnpm add -D @playwright/test && pnpm exec playwright install chromium`
279
+ - Python: `pip install playwright && playwright install chromium`
280
+ - No package manager detected: `npm init -y && npm install -D @playwright/test && npx playwright install chromium`
281
+ 3. **Create `playwright.config.ts`** (or `.js` if not using TypeScript) with sensible defaults:
282
+ - `testDir: './e2e'` (or `./tests/e2e`)
283
+ - `use: { baseURL: 'http://localhost:3000' }` (adjust based on project)
284
+ - Chromium only (keep it fast; user can add more browsers later)
285
+ - Screenshot on failure enabled
286
+ 4. **Create the E2E test directory** (`e2e/` or `tests/e2e/`) with a placeholder spec
287
+ 5. **Add test script** to `package.json` if it exists: `"test:e2e": "playwright test"`
288
+
289
+ Skip silently if `playwright.config.*` already exists.
290
+
291
+ ## Step 12: Test Verification
292
+
293
+ After initialization:
294
+
295
+ 1. **If existing code with tests**: Run the full test suite to establish a baseline. Document results in `.gsd-t/progress.md`
296
+ 2. **If existing code without tests**: Playwright is now set up (Step 7.6) — note unit test framework should be added as part of the first milestone
297
+ 3. **If greenfield**: Playwright is ready. Note that unit test infrastructure should be added in Milestone 1
298
+ 4. **Verify init outputs**: Confirm all created files exist and are non-empty
299
+
300
+ ## Step 13: Report
301
+
302
+ Tell the user:
303
+ 1. What was created (including backlog files: `.gsd-t/backlog.md` and `.gsd-t/backlog-settings.md`)
304
+ 2. What they should fill in (CLAUDE.md details, requirements)
305
+ 3. Backlog settings status: whether apps/categories were auto-derived from CLAUDE.md or need manual configuration via `/user:gsd-t-backlog-settings`
306
+ 4. Recommended next step:
307
+ - New project: "Define your milestone, then run /user:gsd-t-partition"
308
+ - Existing code: "I've mapped the codebase. Ready for /user:gsd-t-partition {milestone}"
309
+
310
+ $ARGUMENTS
311
+
312
+ ## Auto-Clear
313
+
314
+ All work is committed to project files. Execute `/clear` to free the context window for the next command.