@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.
- package/CHANGELOG.md +24 -0
- package/README.md +379 -372
- package/bin/component-registry.js +250 -0
- package/bin/graph-cgc.js +510 -510
- package/bin/graph-indexer.js +147 -147
- package/bin/graph-overlay.js +195 -195
- package/bin/graph-parsers.js +327 -327
- package/bin/graph-query.js +453 -452
- package/bin/graph-store.js +154 -154
- package/bin/qa-calibrator.js +194 -0
- package/bin/scan-data-collector.js +153 -153
- package/bin/scan-diagrams-generators.js +187 -187
- package/bin/scan-diagrams.js +79 -79
- package/bin/scan-renderer.js +92 -92
- package/bin/scan-report-sections.js +121 -121
- package/bin/scan-report.js +184 -184
- package/bin/scan-schema-parsers.js +199 -199
- package/bin/scan-schema.js +103 -103
- package/bin/token-budget.js +246 -0
- package/commands/Claude-md.md +10 -10
- package/commands/branch.md +15 -15
- package/commands/checkin.md +45 -45
- package/commands/global-change.md +209 -209
- package/commands/gsd-t-audit.md +199 -0
- package/commands/gsd-t-backlog-add.md +94 -94
- package/commands/gsd-t-backlog-edit.md +111 -111
- package/commands/gsd-t-backlog-list.md +63 -63
- package/commands/gsd-t-backlog-move.md +94 -94
- package/commands/gsd-t-backlog-promote.md +123 -123
- package/commands/gsd-t-backlog-remove.md +86 -86
- package/commands/gsd-t-backlog-settings.md +158 -158
- package/commands/gsd-t-complete-milestone.md +528 -515
- package/commands/gsd-t-debug.md +506 -399
- package/commands/gsd-t-discuss.md +174 -174
- package/commands/gsd-t-execute.md +758 -634
- package/commands/gsd-t-feature.md +276 -276
- package/commands/gsd-t-health.md +142 -142
- package/commands/gsd-t-help.md +465 -457
- package/commands/gsd-t-impact.md +302 -302
- package/commands/gsd-t-init.md +320 -280
- package/commands/gsd-t-integrate.md +365 -249
- package/commands/gsd-t-milestone.md +87 -87
- package/commands/gsd-t-partition.md +442 -361
- package/commands/gsd-t-pause.md +82 -82
- package/commands/gsd-t-plan.md +345 -344
- package/commands/gsd-t-populate.md +111 -111
- package/commands/gsd-t-prd.md +326 -326
- package/commands/gsd-t-project.md +211 -211
- package/commands/gsd-t-promote-debt.md +123 -123
- package/commands/gsd-t-prompt.md +137 -137
- package/commands/gsd-t-qa.md +266 -266
- package/commands/gsd-t-quick.md +357 -234
- package/commands/gsd-t-reflect.md +134 -134
- package/commands/gsd-t-resume.md +72 -72
- package/commands/gsd-t-scan.md +615 -615
- package/commands/gsd-t-setup.md +76 -0
- package/commands/gsd-t-status.md +192 -166
- package/commands/gsd-t-test-sync.md +381 -381
- package/commands/gsd-t-triage-and-merge.md +171 -171
- package/commands/gsd-t-verify.md +382 -382
- package/commands/gsd-t-visualize.md +118 -118
- package/commands/gsd-t-wave.md +401 -378
- package/docs/GSD-T-README.md +425 -422
- package/docs/architecture.md +385 -369
- package/docs/harness-design-analysis.md +371 -0
- package/docs/infrastructure.md +205 -205
- package/docs/prd-graph-engine.md +398 -398
- package/docs/prd-gsd2-hybrid.md +559 -559
- package/docs/prd-harness-evolution.md +583 -0
- package/docs/requirements.md +14 -0
- package/docs/workflows.md +226 -226
- package/examples/.gsd-t/domains/example-domain/scope.md +13 -13
- package/package.json +40 -40
- package/scripts/gsd-t-auto-route.js +39 -39
- package/scripts/gsd-t-dashboard-mockup.html +1143 -1143
- package/scripts/gsd-t-dashboard-server.js +171 -171
- package/scripts/gsd-t-dashboard.html +262 -262
- package/scripts/gsd-t-event-writer.js +128 -128
- package/scripts/gsd-t-statusline.js +94 -94
- package/scripts/gsd-t-tools.js +175 -175
- package/templates/CLAUDE-global.md +639 -614
- package/templates/CLAUDE-project.md +24 -0
- package/templates/backlog-settings.md +18 -18
- package/templates/backlog.md +1 -1
- package/templates/progress.md +40 -40
- package/templates/shared-services-contract.md +60 -60
- package/templates/stacks/desktop.ini +2 -2
- package/bin/desktop.ini +0 -2
- package/commands/desktop.ini +0 -2
- package/docs/ci-examples/desktop.ini +0 -2
- package/docs/desktop.ini +0 -2
- package/examples/.gsd-t/contracts/desktop.ini +0 -2
- package/examples/.gsd-t/desktop.ini +0 -2
- package/examples/.gsd-t/domains/desktop.ini +0 -2
- package/examples/.gsd-t/domains/example-domain/desktop.ini +0 -2
- package/examples/desktop.ini +0 -2
- package/examples/rules/desktop.ini +0 -2
- package/scripts/desktop.ini +0 -2
- package/templates/desktop.ini +0 -2
|
@@ -1,614 +1,639 @@
|
|
|
1
|
-
<!-- GSD-T:START — Do not remove this marker. Content between START/END is managed by gsd-t update. -->
|
|
2
|
-
# Prime Directives
|
|
3
|
-
|
|
4
|
-
1. SIMPLICITY ABOVE ALL. Every change should be minimal and impact as little code as possible. No massive refactors.
|
|
5
|
-
2. ALWAYS check for unwanted downstream effects before writing any new code or changing existing code.
|
|
6
|
-
3. ALWAYS check for completeness that any code creation/change/deletion is implemented thoroughly in every relevant file.
|
|
7
|
-
4. ALWAYS work autonomously. ONLY ask for user input when truly blocked.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# GSD-T: Contract-Driven Development
|
|
11
|
-
|
|
12
|
-
## Work Hierarchy
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
PROJECT or FEATURE or SCAN
|
|
16
|
-
└── MILESTONE (major deliverable)
|
|
17
|
-
└── PARTITION → DISCUSS → PLAN → IMPACT → EXECUTE → TEST-SYNC → INTEGRATE → VERIFY → COMPLETE
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
- **Project**: Full greenfield project → decomposed into milestones
|
|
21
|
-
- **Feature**: Major new feature for existing codebase → impact analysis → milestones
|
|
22
|
-
- **Scan**: Deep codebase analysis → techdebt.md → promotable to milestones
|
|
23
|
-
- **Milestone**: A significant deliverable (e.g., "User Authentication Complete")
|
|
24
|
-
- **Domain**: An independent area of responsibility within a milestone, with its own scope, tasks, and file boundaries
|
|
25
|
-
- **Contract**: The documented interface between domains — API shapes, schemas, component props
|
|
26
|
-
|
|
27
|
-
## Commands Reference
|
|
28
|
-
|
|
29
|
-
| Command | Purpose |
|
|
30
|
-
|---------|---------|
|
|
31
|
-
| `/user:gsd` | Smart router — describe what you need, auto-routes to the right command |
|
|
32
|
-
| `/user:gsd-t-help` | List all commands or get detailed help |
|
|
33
|
-
| `/user:gsd-t-prompt` | Help formulate your idea before committing |
|
|
34
|
-
| `/user:gsd-t-brainstorm` | Creative exploration and idea generation |
|
|
35
|
-
| `/user:gsd-t-prd` | Generate a GSD-T-optimized Product Requirements Document |
|
|
36
|
-
| `/user:gsd-t-project` | Full project → milestone roadmap |
|
|
37
|
-
| `/user:gsd-t-feature` | Major feature → impact analysis + milestones |
|
|
38
|
-
| `/user:gsd-t-scan` | Deep codebase analysis → techdebt.md |
|
|
39
|
-
| `/user:gsd-t-gap-analysis` | Requirements gap analysis — spec vs. existing code |
|
|
40
|
-
| `/user:gsd-t-promote-debt` | Convert debt items to milestones |
|
|
41
|
-
| `/user:gsd-t-setup` | Generate or restructure project CLAUDE.md |
|
|
42
|
-
| `/user:gsd-t-init` | Initialize project structure |
|
|
43
|
-
| `/user:gsd-t-init-scan-setup` | Full onboarding: git + init + scan + setup in one |
|
|
44
|
-
| `/user:gsd-t-milestone` | Define new milestone |
|
|
45
|
-
| `/user:gsd-t-partition` | Decompose into domains + contracts |
|
|
46
|
-
| `/user:gsd-t-discuss` | Multi-perspective design exploration |
|
|
47
|
-
| `/user:gsd-t-plan` | Create atomic task lists per domain (tasks auto-split to fit one context window) |
|
|
48
|
-
| `/user:gsd-t-impact` | Analyze downstream effects before execution |
|
|
49
|
-
| `/user:gsd-t-execute` | Run tasks — task-level fresh dispatch, worktree isolation, adaptive replanning, active rule injection |
|
|
50
|
-
| `/user:gsd-t-test-sync` | Keep tests aligned with code changes |
|
|
51
|
-
| `/user:gsd-t-qa` | QA agent — test generation, execution, gap reporting |
|
|
52
|
-
| `/user:gsd-t-doc-ripple` | Automated document ripple — update downstream docs after code changes |
|
|
53
|
-
| `/user:gsd-t-integrate` | Wire domains together |
|
|
54
|
-
| `/user:gsd-t-verify` | Run quality gates + goal-backward behavior verification |
|
|
55
|
-
| `/user:gsd-t-complete-milestone` | Archive milestone + git tag (goal-backward gate, rule engine distillation) |
|
|
56
|
-
| `/user:gsd-t-wave` | Full cycle (auto-advances all phases) |
|
|
57
|
-
| `/user:gsd-t-status` | Cross-domain progress view with token breakdown, global ELO and cross-project rankings |
|
|
58
|
-
| `/user:gsd-t-debug` | Systematic debugging |
|
|
59
|
-
| `/user:gsd-t-quick` | Fast task, respects contracts |
|
|
60
|
-
| `/user:gsd-t-reflect` | Generate retrospective from event stream, propose memory updates |
|
|
61
|
-
| `/user:gsd-t-visualize` | Launch browser dashboard |
|
|
62
|
-
| `/user:gsd-t-metrics` | View task telemetry, process ELO, domain health, and cross-project comparison (`--cross-project`) |
|
|
63
|
-
| `/user:gsd-t-health` | Validate .gsd-t/ structure, optionally repair |
|
|
64
|
-
| `/user:gsd-t-pause` | Save exact position for reliable resume |
|
|
65
|
-
| `/user:gsd-t-populate` | Auto-populate docs from existing codebase |
|
|
66
|
-
| `/user:gsd-t-log` | Sync progress Decision Log with recent git activity |
|
|
67
|
-
| `/user:gsd-t-resume` | Restore context, continue |
|
|
68
|
-
| `/user:gsd-t-version-update` | Update GSD-T to latest version |
|
|
69
|
-
| `/user:gsd-t-version-update-all` | Update GSD-T + all registered projects |
|
|
70
|
-
| `/user:gsd-t-triage-and-merge` | Auto-review, merge, and publish GitHub branches |
|
|
71
|
-
| `/user:gsd-t-
|
|
72
|
-
| `/user:gsd-t-backlog-
|
|
73
|
-
| `/user:gsd-t-backlog-
|
|
74
|
-
| `/user:gsd-t-backlog-
|
|
75
|
-
| `/user:gsd-t-backlog-
|
|
76
|
-
| `/user:gsd-t-backlog-
|
|
77
|
-
| `/user:gsd-t-backlog-
|
|
78
|
-
| `/user:
|
|
79
|
-
| `/user:
|
|
80
|
-
| `/user:
|
|
81
|
-
| `/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
| **
|
|
92
|
-
| **
|
|
93
|
-
| **
|
|
94
|
-
| **
|
|
95
|
-
| **
|
|
96
|
-
| **
|
|
97
|
-
| **
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
├── Is it about
|
|
107
|
-
├── Is it about
|
|
108
|
-
├── Is it about
|
|
109
|
-
├── Is it about
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
| **
|
|
122
|
-
| **
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
- **
|
|
129
|
-
-
|
|
130
|
-
- Version is
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
├──
|
|
141
|
-
├──
|
|
142
|
-
├──
|
|
143
|
-
├──
|
|
144
|
-
├──
|
|
145
|
-
├──
|
|
146
|
-
├──
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
- What
|
|
156
|
-
- What
|
|
157
|
-
- What
|
|
158
|
-
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
- `.gsd-t/
|
|
208
|
-
- `.
|
|
209
|
-
- `
|
|
210
|
-
- `
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
│
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
await page.
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
await
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
- **
|
|
275
|
-
- **
|
|
276
|
-
- **
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
- `
|
|
287
|
-
- `
|
|
288
|
-
- `
|
|
289
|
-
- `
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
**
|
|
317
|
-
- `
|
|
318
|
-
- `
|
|
319
|
-
- `
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
**
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
│
|
|
380
|
-
|
|
381
|
-
│
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
│ YES → Update
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
├── Did
|
|
410
|
-
│ YES →
|
|
411
|
-
├── Did
|
|
412
|
-
│ YES →
|
|
413
|
-
├── Did
|
|
414
|
-
│ YES →
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
**
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
-
|
|
455
|
-
-
|
|
456
|
-
-
|
|
457
|
-
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
**
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
-
|
|
496
|
-
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
1
|
+
<!-- GSD-T:START — Do not remove this marker. Content between START/END is managed by gsd-t update. -->
|
|
2
|
+
# Prime Directives
|
|
3
|
+
|
|
4
|
+
1. SIMPLICITY ABOVE ALL. Every change should be minimal and impact as little code as possible. No massive refactors.
|
|
5
|
+
2. ALWAYS check for unwanted downstream effects before writing any new code or changing existing code.
|
|
6
|
+
3. ALWAYS check for completeness that any code creation/change/deletion is implemented thoroughly in every relevant file.
|
|
7
|
+
4. ALWAYS work autonomously. ONLY ask for user input when truly blocked.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# GSD-T: Contract-Driven Development
|
|
11
|
+
|
|
12
|
+
## Work Hierarchy
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
PROJECT or FEATURE or SCAN
|
|
16
|
+
└── MILESTONE (major deliverable)
|
|
17
|
+
└── PARTITION → DISCUSS → PLAN → IMPACT → EXECUTE → TEST-SYNC → INTEGRATE → VERIFY → COMPLETE
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- **Project**: Full greenfield project → decomposed into milestones
|
|
21
|
+
- **Feature**: Major new feature for existing codebase → impact analysis → milestones
|
|
22
|
+
- **Scan**: Deep codebase analysis → techdebt.md → promotable to milestones
|
|
23
|
+
- **Milestone**: A significant deliverable (e.g., "User Authentication Complete")
|
|
24
|
+
- **Domain**: An independent area of responsibility within a milestone, with its own scope, tasks, and file boundaries
|
|
25
|
+
- **Contract**: The documented interface between domains — API shapes, schemas, component props
|
|
26
|
+
|
|
27
|
+
## Commands Reference
|
|
28
|
+
|
|
29
|
+
| Command | Purpose |
|
|
30
|
+
|---------|---------|
|
|
31
|
+
| `/user:gsd` | Smart router — describe what you need, auto-routes to the right command |
|
|
32
|
+
| `/user:gsd-t-help` | List all commands or get detailed help |
|
|
33
|
+
| `/user:gsd-t-prompt` | Help formulate your idea before committing |
|
|
34
|
+
| `/user:gsd-t-brainstorm` | Creative exploration and idea generation |
|
|
35
|
+
| `/user:gsd-t-prd` | Generate a GSD-T-optimized Product Requirements Document |
|
|
36
|
+
| `/user:gsd-t-project` | Full project → milestone roadmap |
|
|
37
|
+
| `/user:gsd-t-feature` | Major feature → impact analysis + milestones |
|
|
38
|
+
| `/user:gsd-t-scan` | Deep codebase analysis → techdebt.md |
|
|
39
|
+
| `/user:gsd-t-gap-analysis` | Requirements gap analysis — spec vs. existing code |
|
|
40
|
+
| `/user:gsd-t-promote-debt` | Convert debt items to milestones |
|
|
41
|
+
| `/user:gsd-t-setup` | Generate or restructure project CLAUDE.md |
|
|
42
|
+
| `/user:gsd-t-init` | Initialize project structure |
|
|
43
|
+
| `/user:gsd-t-init-scan-setup` | Full onboarding: git + init + scan + setup in one |
|
|
44
|
+
| `/user:gsd-t-milestone` | Define new milestone |
|
|
45
|
+
| `/user:gsd-t-partition` | Decompose into domains + contracts |
|
|
46
|
+
| `/user:gsd-t-discuss` | Multi-perspective design exploration |
|
|
47
|
+
| `/user:gsd-t-plan` | Create atomic task lists per domain (tasks auto-split to fit one context window) |
|
|
48
|
+
| `/user:gsd-t-impact` | Analyze downstream effects before execution |
|
|
49
|
+
| `/user:gsd-t-execute` | Run tasks — task-level fresh dispatch, worktree isolation, adaptive replanning, active rule injection |
|
|
50
|
+
| `/user:gsd-t-test-sync` | Keep tests aligned with code changes |
|
|
51
|
+
| `/user:gsd-t-qa` | QA agent — test generation, execution, gap reporting |
|
|
52
|
+
| `/user:gsd-t-doc-ripple` | Automated document ripple — update downstream docs after code changes |
|
|
53
|
+
| `/user:gsd-t-integrate` | Wire domains together |
|
|
54
|
+
| `/user:gsd-t-verify` | Run quality gates + goal-backward behavior verification |
|
|
55
|
+
| `/user:gsd-t-complete-milestone` | Archive milestone + git tag (goal-backward gate, rule engine distillation) |
|
|
56
|
+
| `/user:gsd-t-wave` | Full cycle (auto-advances all phases) |
|
|
57
|
+
| `/user:gsd-t-status` | Cross-domain progress view with token breakdown, global ELO and cross-project rankings |
|
|
58
|
+
| `/user:gsd-t-debug` | Systematic debugging |
|
|
59
|
+
| `/user:gsd-t-quick` | Fast task, respects contracts |
|
|
60
|
+
| `/user:gsd-t-reflect` | Generate retrospective from event stream, propose memory updates |
|
|
61
|
+
| `/user:gsd-t-visualize` | Launch browser dashboard |
|
|
62
|
+
| `/user:gsd-t-metrics` | View task telemetry, process ELO, domain health, and cross-project comparison (`--cross-project`) |
|
|
63
|
+
| `/user:gsd-t-health` | Validate .gsd-t/ structure, optionally repair |
|
|
64
|
+
| `/user:gsd-t-pause` | Save exact position for reliable resume |
|
|
65
|
+
| `/user:gsd-t-populate` | Auto-populate docs from existing codebase |
|
|
66
|
+
| `/user:gsd-t-log` | Sync progress Decision Log with recent git activity |
|
|
67
|
+
| `/user:gsd-t-resume` | Restore context, continue |
|
|
68
|
+
| `/user:gsd-t-version-update` | Update GSD-T to latest version |
|
|
69
|
+
| `/user:gsd-t-version-update-all` | Update GSD-T + all registered projects |
|
|
70
|
+
| `/user:gsd-t-triage-and-merge` | Auto-review, merge, and publish GitHub branches |
|
|
71
|
+
| `/user:gsd-t-audit` | Harness self-audit — analyze cost/benefit of enforcement components |
|
|
72
|
+
| `/user:gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog |
|
|
73
|
+
| `/user:gsd-t-backlog-list` | Filtered, ordered view of backlog items |
|
|
74
|
+
| `/user:gsd-t-backlog-move` | Reorder items by position (priority) |
|
|
75
|
+
| `/user:gsd-t-backlog-edit` | Modify backlog entry fields |
|
|
76
|
+
| `/user:gsd-t-backlog-remove` | Drop item with optional reason |
|
|
77
|
+
| `/user:gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow |
|
|
78
|
+
| `/user:gsd-t-backlog-settings` | Manage types, apps, categories, defaults |
|
|
79
|
+
| `/user:branch` | Create and switch to a new git branch |
|
|
80
|
+
| `/user:checkin` | Auto-bump version, stage, commit, and push |
|
|
81
|
+
| `/user:Claude-md` | Reload and apply CLAUDE.md directives |
|
|
82
|
+
| `/global-change` | Apply file changes across all registered GSD-T projects |
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# Living Documents
|
|
86
|
+
|
|
87
|
+
These documents MUST be maintained and referenced throughout development:
|
|
88
|
+
|
|
89
|
+
| Document | Location | Purpose |
|
|
90
|
+
|----------|----------|---------|
|
|
91
|
+
| **Requirements** | `docs/requirements.md` | Functional and technical requirements |
|
|
92
|
+
| **Architecture** | `docs/architecture.md` | System design, components, data flow, decisions |
|
|
93
|
+
| **Workflows** | `docs/workflows.md` | User journeys and technical process flows |
|
|
94
|
+
| **Infrastructure** | `docs/infrastructure.md` | Commands, DB setup, server access, creds |
|
|
95
|
+
| **README** | `README.md` | Project overview, setup, features |
|
|
96
|
+
| **Progress** | `.gsd-t/progress.md` | Current milestone/phase state + version |
|
|
97
|
+
| **Contracts** | `.gsd-t/contracts/` | Interfaces between domains |
|
|
98
|
+
| **Tech Debt** | `.gsd-t/techdebt.md` | Debt register from scans |
|
|
99
|
+
|
|
100
|
+
## The "No Re-Research" Rule
|
|
101
|
+
|
|
102
|
+
**BEFORE researching how something works, CHECK THE DOCS FIRST.**
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
NEED TO UNDERSTAND SOMETHING?
|
|
106
|
+
├── Is it about system structure/components? → Read docs/architecture.md
|
|
107
|
+
├── Is it about how a process flows? → Read docs/workflows.md
|
|
108
|
+
├── Is it about what to build? → Read docs/requirements.md
|
|
109
|
+
├── Is it about how to deploy/operate? → Read docs/infrastructure.md
|
|
110
|
+
├── Is it about domain interfaces? → Read .gsd-t/contracts/
|
|
111
|
+
└── Not documented? → Research, then DOCUMENT IT
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# Versioning
|
|
116
|
+
|
|
117
|
+
GSD-T tracks project version in `.gsd-t/progress.md` using semantic versioning: `Major.Minor.Patch`
|
|
118
|
+
|
|
119
|
+
| Segment | Bumped When | Example |
|
|
120
|
+
|---------|-------------|---------|
|
|
121
|
+
| **Major** | Breaking changes, major rework, v1 launch | 1.0.10 → 2.0.10 |
|
|
122
|
+
| **Minor** | New features, completed feature milestones | 1.10.10 → 1.11.10 |
|
|
123
|
+
| **Patch** | Bug fixes, minor improvements, cleanup | 1.1.10 → 1.1.11 |
|
|
124
|
+
|
|
125
|
+
**Patch convention**: Patch numbers are always 2 digits (≥10). When resetting after a minor or major bump, start at **10** (not 0). This keeps patches always 2 characters without leading zeros, so semver stays valid.
|
|
126
|
+
|
|
127
|
+
- Version is set during `gsd-t-init`:
|
|
128
|
+
- **New project** (no existing manifest version): starts at `0.1.00` — first `complete-milestone` resets patch to `0.1.10`
|
|
129
|
+
- **Existing repo** (has `package.json`, `pyproject.toml`, `Cargo.toml`, etc. with a version): use that version as the starting point
|
|
130
|
+
- Version is bumped during `gsd-t-complete-milestone` based on milestone scope
|
|
131
|
+
- Version is reflected in: `progress.md`, `README.md`, package manifest (if any), and git tags (`v{version}`)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# Destructive Action Guard (MANDATORY)
|
|
135
|
+
|
|
136
|
+
**NEVER perform destructive or structural changes without explicit user approval.** This applies at ALL autonomy levels, including Level 3.
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
BEFORE any of these actions, STOP and ask the user:
|
|
140
|
+
├── DROP TABLE, DROP COLUMN, DROP INDEX, TRUNCATE, DELETE without WHERE
|
|
141
|
+
├── Renaming or removing database tables or columns
|
|
142
|
+
├── Schema migrations that lose data or break existing queries
|
|
143
|
+
├── Replacing an existing architecture pattern (e.g., normalized → denormalized)
|
|
144
|
+
├── Removing or replacing existing files/modules that contain working functionality
|
|
145
|
+
├── Changing ORM models in ways that conflict with the existing database schema
|
|
146
|
+
├── Removing API endpoints or changing response shapes that existing clients depend on
|
|
147
|
+
├── Replacing a dependency or framework with a different one
|
|
148
|
+
└── Any change that would require other parts of the system to be rewritten
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### How to handle schema/architecture mismatches:
|
|
152
|
+
1. **READ the existing schema/code first** — understand what exists before proposing changes
|
|
153
|
+
2. **Adapt new code to match existing structures** — not the other way around
|
|
154
|
+
3. **If restructuring is truly needed**, present the case to the user with:
|
|
155
|
+
- What exists today and why it might have been designed that way
|
|
156
|
+
- What you want to change and why
|
|
157
|
+
- What will break if you make the change
|
|
158
|
+
- What data or functionality will be lost
|
|
159
|
+
- A migration path that preserves existing data
|
|
160
|
+
4. **Wait for explicit approval** before proceeding
|
|
161
|
+
|
|
162
|
+
### Why this matters:
|
|
163
|
+
Even in development, the user may have:
|
|
164
|
+
- Working functionality they've tested and rely on
|
|
165
|
+
- Data they've carefully set up (seed data, test accounts, configuration)
|
|
166
|
+
- Other code that depends on the current structure
|
|
167
|
+
- Design decisions made for reasons not documented
|
|
168
|
+
|
|
169
|
+
**"Adapt to what exists" is always safer than "replace what exists."**
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
# Autonomous Execution Rules
|
|
173
|
+
|
|
174
|
+
## Update Notices
|
|
175
|
+
|
|
176
|
+
On session start, a version check hook auto-updates GSD-T and outputs a status message. Show the result to the user at the **beginning** of your first response:
|
|
177
|
+
|
|
178
|
+
- If `[GSD-T AUTO-UPDATE]` appears → GSD-T was just auto-updated. Show:
|
|
179
|
+
```
|
|
180
|
+
✅ GSD-T auto-updated: v{old} → v{new}
|
|
181
|
+
Changelog: https://github.com/Tekyz-Inc/get-stuff-done-teams/blob/main/CHANGELOG.md
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- If `[GSD-T UPDATE]` appears → update available but auto-update failed. Show:
|
|
185
|
+
```
|
|
186
|
+
⬆️ GSD-T update available: v{installed} → v{latest} (auto-update failed)
|
|
187
|
+
Run: /user:gsd-t-version-update-all
|
|
188
|
+
Changelog: https://github.com/Tekyz-Inc/get-stuff-done-teams/blob/main/CHANGELOG.md
|
|
189
|
+
```
|
|
190
|
+
Also repeat at the **end** of your first response.
|
|
191
|
+
|
|
192
|
+
- If `[GSD-T]` appears → up to date. Show:
|
|
193
|
+
```
|
|
194
|
+
GSD-T v{version} — up to date
|
|
195
|
+
Changelog: https://github.com/Tekyz-Inc/get-stuff-done-teams/blob/main/CHANGELOG.md
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Conversation vs. Work
|
|
199
|
+
|
|
200
|
+
Only execute GSD-T workflow behavior when a `/gsd-t-*` command is invoked or when actively mid-phase (resumed via `/gsd-t-resume`). **Plain text messages — especially questions — should be answered conversationally.** Do not launch into workflow execution, file reading, or phase advancement from a question or comment. If the user wants work done, they will invoke a command.
|
|
201
|
+
|
|
202
|
+
**Exception — Auto-Route signal**: When `[GSD-T AUTO-ROUTE]` appears in your context (injected by the UserPromptSubmit hook), the user's plain text message should be treated as a `/user:gsd {message}` invocation. Execute the `/gsd` smart router with the user's full message as the argument instead of replying conversationally. The hook only fires in GSD-T projects (directories containing `.gsd-t/progress.md`) — it silently passes through in all other directories.
|
|
203
|
+
|
|
204
|
+
## Auto-Init Guard
|
|
205
|
+
|
|
206
|
+
Before executing any GSD-T workflow command, check if **any** of these files are missing in the current project:
|
|
207
|
+
- `.gsd-t/progress.md`, `.gsd-t/backlog.md`, `.gsd-t/backlog-settings.md`
|
|
208
|
+
- `.gsd-t/contracts/`, `.gsd-t/domains/`
|
|
209
|
+
- `.claude/settings.local.json` (if `~/.claude/settings.local` exists)
|
|
210
|
+
- `CLAUDE.md`, `README.md`
|
|
211
|
+
- `docs/requirements.md`, `docs/architecture.md`, `docs/workflows.md`, `docs/infrastructure.md`
|
|
212
|
+
|
|
213
|
+
If any are missing:
|
|
214
|
+
1. Run `gsd-t-init` automatically (it skips files that already exist)
|
|
215
|
+
2. Then continue with the originally requested command
|
|
216
|
+
|
|
217
|
+
**Exempt commands** (do not trigger auto-init): `gsd-t-init`, `gsd-t-init-scan-setup`, `gsd-t-help`, `gsd-t-version-update`, `gsd-t-version-update-all`.
|
|
218
|
+
|
|
219
|
+
## Playwright Readiness Guard
|
|
220
|
+
|
|
221
|
+
Before any command that involves testing (`gsd-t-execute`, `gsd-t-test-sync`, `gsd-t-verify`, `gsd-t-quick`, `gsd-t-wave`, `gsd-t-milestone`, `gsd-t-complete-milestone`, `gsd-t-debug`), check if `playwright.config.*` exists in the project. If it does not:
|
|
222
|
+
1. Detect the package manager and install Playwright (`@playwright/test` + chromium)
|
|
223
|
+
2. Create a basic `playwright.config.ts` with sensible defaults
|
|
224
|
+
3. Create the E2E test directory with a placeholder spec
|
|
225
|
+
4. Then continue with the original command
|
|
226
|
+
|
|
227
|
+
Playwright must always be ready before any testing occurs. Do not skip this check. Do not defer setup to "later."
|
|
228
|
+
|
|
229
|
+
### Playwright Cleanup
|
|
230
|
+
|
|
231
|
+
After Playwright tests finish (pass or fail), **kill any app/server processes that were started for the tests**. Playwright often launches a dev server (via `webServer` config or manually). These processes must not be left running:
|
|
232
|
+
1. Check for any dev server processes spawned during the test run
|
|
233
|
+
2. Kill them (e.g., `npx kill-port`, or terminate the process directly)
|
|
234
|
+
3. Verify the port is free before proceeding
|
|
235
|
+
|
|
236
|
+
This applies everywhere Playwright tests are executed: execute, test-sync, verify, quick, wave, debug, complete-milestone, and integrate.
|
|
237
|
+
|
|
238
|
+
### E2E Enforcement Rule (MANDATORY)
|
|
239
|
+
|
|
240
|
+
**Running only unit tests when E2E tests exist is a test failure.** This is non-negotiable.
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
BEFORE reporting "tests pass" for ANY task:
|
|
244
|
+
├── Does playwright.config.* or cypress.config.* exist?
|
|
245
|
+
│ YES → You MUST run the full E2E suite. Unit-only results are INCOMPLETE.
|
|
246
|
+
│ NO → Unit/integration tests are sufficient.
|
|
247
|
+
├── Did you run every detected test runner?
|
|
248
|
+
│ NO → Run it now. Do not commit until ALL suites pass.
|
|
249
|
+
└── Report format MUST include all suites:
|
|
250
|
+
"Unit: X/Y pass | E2E: X/Y pass" (or "E2E: N/A — no config")
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The conditional "if UI/routes/flows changed" in command files applies to **writing new E2E specs**, not to **running existing ones**. You always run existing E2E specs. Always.
|
|
254
|
+
|
|
255
|
+
### E2E Test Quality Standard (MANDATORY)
|
|
256
|
+
|
|
257
|
+
**E2E tests must be FUNCTIONAL tests, not LAYOUT tests.** This is non-negotiable.
|
|
258
|
+
|
|
259
|
+
A layout test checks that elements exist (`isVisible`, `toBeAttached`, `toBeEnabled`, `toHaveCount`). A functional test checks that features work — actions produce correct outcomes.
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
LAYOUT TEST (WRONG — passes even if every feature is broken):
|
|
263
|
+
await expect(page.locator('#tab-sessions')).toBeVisible();
|
|
264
|
+
await page.click('#tab-sessions');
|
|
265
|
+
// ← No assertion that the tab's content actually loaded
|
|
266
|
+
|
|
267
|
+
FUNCTIONAL TEST (RIGHT — fails if the feature is broken):
|
|
268
|
+
await page.click('#tab-sessions');
|
|
269
|
+
await expect(page.locator('.session-list')).toContainText('Session 1');
|
|
270
|
+
// ← Proves clicking the tab loaded the session data
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Every Playwright assertion must verify one of:
|
|
274
|
+
- **State changed**: After click/type/submit, the app state is different (new content, updated data, changed status)
|
|
275
|
+
- **Data flowed**: User input → API call → response rendered (use `page.waitForResponse` or assert on rendered data)
|
|
276
|
+
- **Content loaded**: Navigation/tab switch → destination content appeared (assert on text/data unique to destination)
|
|
277
|
+
- **Widget responded**: Terminal accepted keystrokes and produced output, editor saved changes, form submitted and data persisted
|
|
278
|
+
|
|
279
|
+
**If a test would pass on an empty HTML page with the correct element IDs and no JavaScript, it is not a functional test.** Rewrite it.
|
|
280
|
+
|
|
281
|
+
## QA Agent (Mandatory)
|
|
282
|
+
|
|
283
|
+
Any GSD-T phase that produces or validates code **MUST run QA**. The QA agent's sole job is test generation, execution, and gap reporting. It never writes feature code.
|
|
284
|
+
|
|
285
|
+
**QA method by command:**
|
|
286
|
+
- `execute`, `integrate` → spawn QA via **Task subagent** (lightweight, no TeamCreate)
|
|
287
|
+
- `test-sync`, `verify`, `complete-milestone` → perform contract testing and gap analysis **inline**
|
|
288
|
+
- `quick`, `debug` → run the full test suite **inline** as part of the command's Test & Verify step
|
|
289
|
+
- `wave` → each phase agent handles QA per the rules above
|
|
290
|
+
- `partition`, `plan` → no QA spawn needed (no code produced yet)
|
|
291
|
+
|
|
292
|
+
**Task subagent spawn instruction (execute/integrate):**
|
|
293
|
+
```
|
|
294
|
+
Task subagent (general-purpose):
|
|
295
|
+
"Run ALL configured test suites — detect and run every one:
|
|
296
|
+
a. Unit tests (vitest/jest/mocha): run the full suite
|
|
297
|
+
b. E2E tests: check for playwright.config.* or cypress.config.* — if found, run the FULL E2E suite
|
|
298
|
+
c. NEVER skip E2E when a config file exists. Running only unit tests is a QA FAILURE.
|
|
299
|
+
d. Read .gsd-t/contracts/ for contract definitions. Check contract compliance.
|
|
300
|
+
e. AUDIT E2E test quality: Review each Playwright spec — if any test only checks element
|
|
301
|
+
existence (isVisible, toBeAttached, toBeEnabled) without verifying functional behavior
|
|
302
|
+
(state changes, data loaded, content updated after user actions), flag it as
|
|
303
|
+
'SHALLOW TEST — needs functional assertions'. A passing test suite that doesn't catch
|
|
304
|
+
broken features is a QA FAILURE.
|
|
305
|
+
Report format: 'Unit: X/Y pass | E2E: X/Y pass (or N/A if no config) | Contract: compliant/violations | Shallow tests: N'"
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**QA failure OR shallow tests found blocks phase completion.** Lead cannot proceed until QA reports PASS with zero shallow tests, or user explicitly overrides.
|
|
309
|
+
|
|
310
|
+
**QA Calibration Feedback Loop** — If `bin/qa-calibrator.js` exists in the project, the system tracks QA miss-rates (bugs found by Red Team that QA missed) and automatically injects targeted guidance into future QA prompts. Weak-spot categories (error paths, boundary inputs, state transitions) are detected from miss patterns and injected as a preamble before the QA subagent runs. Projects without `qa-miss-log.jsonl` data behave identically to baseline — calibration is fully opt-in and backward compatible.
|
|
311
|
+
|
|
312
|
+
## Red Team — Adversarial QA (Mandatory)
|
|
313
|
+
|
|
314
|
+
After QA passes, every code-producing command spawns a **Red Team agent** — an adversarial subagent whose success is measured by bugs found, not tests passed. This inverts the incentive structure: the Red Team's drive toward "task complete" means digging deeper and finding more bugs, not rubber-stamping.
|
|
315
|
+
|
|
316
|
+
**Red Team method by command:**
|
|
317
|
+
- `execute` → spawns Red Team after all domain tasks pass (Step 5.5)
|
|
318
|
+
- `integrate` → spawns Red Team after integration tests pass (Step 7.5)
|
|
319
|
+
- `quick` → spawns Red Team after Test & Verify passes (Step 5.5)
|
|
320
|
+
- `debug` → spawns Red Team after fix verification passes (Step 5.3)
|
|
321
|
+
- `wave` → each phase agent handles Red Team per the rules above
|
|
322
|
+
|
|
323
|
+
**Key Red Team rules:**
|
|
324
|
+
- **Inverted incentive**: More bugs found = more value. Zero bugs requires exhaustive proof of thoroughness.
|
|
325
|
+
- **False positive penalty**: Reporting non-bugs destroys credibility. Every bug must be reproduced with proof.
|
|
326
|
+
- **Exhaustive categories**: Contract violations, boundary inputs, state transitions, error paths, missing flows, regression, E2E functional gaps — all must be attempted.
|
|
327
|
+
- **VERDICT**: `FAIL` (bugs found — blocks completion) or `GRUDGING PASS` (exhaustive search, nothing found).
|
|
328
|
+
- **Report**: Written to `.gsd-t/red-team-report.md`; bugs also appended to `.gsd-t/qa-issues.md`.
|
|
329
|
+
|
|
330
|
+
**Red Team FAIL blocks phase completion.** CRITICAL/HIGH bugs must be fixed (up to 2 fix cycles). If bugs persist, they are logged to `.gsd-t/deferred-items.md` and presented to the user.
|
|
331
|
+
|
|
332
|
+
## Model Display (MANDATORY)
|
|
333
|
+
|
|
334
|
+
**Before every subagent spawn, display the model being used to the user:**
|
|
335
|
+
`⚙ [{model}] {command} → {brief description}` (e.g., `⚙ [sonnet] gsd-t-execute → domain: auth-service`, `⚙ [haiku] gsd-t-execute → QA validation`)
|
|
336
|
+
|
|
337
|
+
This gives the user real-time visibility into which model is handling each operation.
|
|
338
|
+
|
|
339
|
+
**Model assignments:**
|
|
340
|
+
- `model: haiku` — strictly mechanical tasks: run test suites and report counts, check file existence, validate JSON structure, branch guard checks
|
|
341
|
+
- `model: sonnet` — mid-tier reasoning: routine code changes, standard refactors, test writing, QA evaluation, straightforward synthesis
|
|
342
|
+
- `model: opus` — high-stakes reasoning: architecture decisions, security analysis, complex debugging, cross-module refactors, Red Team adversarial QA, quality judgment on critical paths
|
|
343
|
+
|
|
344
|
+
**Token-Aware Orchestration** — If `bin/token-budget.js` exists, the system checks session token consumption before each subagent spawn in `execute`, `wave`, and `quick`. Graduated degradation: `downgrade` applies model overrides (opus→sonnet, sonnet→haiku), `conserve` checkpoints progress and skips non-essential phases, `stop` halts cleanly with a resume instruction. Projects without `token-budget.js` behave identically to baseline — token awareness is fully backward compatible.
|
|
345
|
+
|
|
346
|
+
## API Documentation Guard (Swagger/OpenAPI)
|
|
347
|
+
|
|
348
|
+
**Every API endpoint MUST be documented in a Swagger/OpenAPI spec. No exceptions.**
|
|
349
|
+
|
|
350
|
+
When any GSD-T command creates or modifies an API endpoint:
|
|
351
|
+
1. **If no Swagger/OpenAPI spec exists**: Set one up immediately
|
|
352
|
+
- Detect the framework (Express, Fastify, Hono, Django, FastAPI, etc.)
|
|
353
|
+
- Install the appropriate Swagger integration (e.g., `swagger-jsdoc` + `swagger-ui-express`, `@fastify/swagger`, FastAPI's built-in OpenAPI)
|
|
354
|
+
- Create the OpenAPI spec file or configure auto-generation from code
|
|
355
|
+
- Add a `/docs` or `/api-docs` route serving the Swagger UI
|
|
356
|
+
2. **Update the spec**: Every new or changed endpoint must be reflected in the Swagger/OpenAPI spec — routes, request/response schemas, auth requirements, error responses
|
|
357
|
+
3. **Publish the Swagger URL**: The Swagger/API docs URL MUST appear in:
|
|
358
|
+
- `CLAUDE.md` — under Documentation or Infrastructure section
|
|
359
|
+
- `README.md` — under API section or Getting Started
|
|
360
|
+
- `docs/infrastructure.md` — under API documentation
|
|
361
|
+
4. **Verify**: After any API change, confirm the Swagger UI loads and reflects the current endpoints
|
|
362
|
+
|
|
363
|
+
This applies during: `gsd-t-execute`, `gsd-t-quick`, `gsd-t-integrate`, `gsd-t-wave`, and any command that touches API code.
|
|
364
|
+
|
|
365
|
+
## Prime Rule
|
|
366
|
+
KEEP GOING. Only stop for:
|
|
367
|
+
1. Unrecoverable errors after 2 fix attempts (delegate to `gsd-t headless --debug-loop` first — only stop if exit code 4)
|
|
368
|
+
2. Ambiguity that fundamentally changes project direction
|
|
369
|
+
3. Milestone completion (checkpoint for user review)
|
|
370
|
+
4. Destructive actions (see Destructive Action Guard above — ALWAYS stop)
|
|
371
|
+
|
|
372
|
+
## Pre-Commit Gate (MANDATORY)
|
|
373
|
+
|
|
374
|
+
NEVER commit code without running this checklist. This is not optional.
|
|
375
|
+
|
|
376
|
+
```
|
|
377
|
+
BEFORE EVERY COMMIT:
|
|
378
|
+
├── Am I on the correct branch?
|
|
379
|
+
│ CHECK → Run `git branch --show-current`
|
|
380
|
+
│ Compare against "Expected branch" in project CLAUDE.md
|
|
381
|
+
│ WRONG BRANCH → STOP. Do NOT commit. Switch to the correct branch first.
|
|
382
|
+
│ No guard set → Proceed (but warn user to set one)
|
|
383
|
+
├── Did I create or change an API endpoint or response shape?
|
|
384
|
+
│ YES → Update .gsd-t/contracts/api-contract.md
|
|
385
|
+
│ YES → Update Swagger/OpenAPI spec (see API Documentation Guard below)
|
|
386
|
+
│ YES → Verify Swagger URL is in CLAUDE.md and README.md
|
|
387
|
+
├── Did I change the database schema?
|
|
388
|
+
│ YES → Update .gsd-t/contracts/schema-contract.md AND docs/schema.md
|
|
389
|
+
├── Did I add/change a UI component interface?
|
|
390
|
+
│ YES → Update .gsd-t/contracts/component-contract.md
|
|
391
|
+
├── Did I add new files or directories?
|
|
392
|
+
│ YES → Update the owning domain's scope.md
|
|
393
|
+
├── Did I implement or change a requirement?
|
|
394
|
+
│ YES → Update docs/requirements.md (mark complete or revise)
|
|
395
|
+
├── Did I add/change/remove a component or change data flow?
|
|
396
|
+
│ YES → Update docs/architecture.md
|
|
397
|
+
├── Did I modify any document, script, or code file?
|
|
398
|
+
│ YES → Add timestamped entry to .gsd-t/progress.md Decision Log
|
|
399
|
+
│ Format: `- YYYY-MM-DD HH:MM: {what was done} — {brief context or result}`
|
|
400
|
+
│ This includes ALL file-modifying activities:
|
|
401
|
+
│ project, feature, scan, gap-analysis, milestone, partition, discuss,
|
|
402
|
+
│ plan, impact, execute, test-sync, integrate, verify, complete-milestone,
|
|
403
|
+
│ wave, quick, debug, promote-debt, populate, setup, init, init-scan-setup,
|
|
404
|
+
│ backlog-add/edit/move/remove/promote/settings, and any manual code changes
|
|
405
|
+
├── Did I make an architectural or design decision?
|
|
406
|
+
│ YES → Also include decision rationale in the progress.md entry
|
|
407
|
+
├── Did I discover or fix tech debt?
|
|
408
|
+
│ YES → Update .gsd-t/techdebt.md
|
|
409
|
+
├── Did I establish a pattern future work should follow?
|
|
410
|
+
│ YES → Update CLAUDE.md or domain constraints.md
|
|
411
|
+
├── Did I add/change tests?
|
|
412
|
+
│ YES → Verify test names and paths are referenced in requirements
|
|
413
|
+
├── Did I change UI, routes, or user flows?
|
|
414
|
+
│ YES → Update affected E2E test specs (Playwright/Cypress)
|
|
415
|
+
└── Did I run the affected tests?
|
|
416
|
+
YES → Verify they pass. NO → Run them now.
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
If ANY answer is YES and the doc is NOT updated, update it BEFORE committing. No exceptions.
|
|
420
|
+
|
|
421
|
+
## Document Ripple Completion Gate (MANDATORY)
|
|
422
|
+
|
|
423
|
+
**NEVER report a task as "done" or present a summary until ALL downstream documents are updated.** This is not optional.
|
|
424
|
+
|
|
425
|
+
When a change affects multiple files (e.g., a new standard that applies across command files, a renamed API, a new convention), you MUST:
|
|
426
|
+
|
|
427
|
+
1. **Identify the full blast radius BEFORE starting**: List every file that needs the change
|
|
428
|
+
2. **Complete ALL updates in one pass**: Do not update 3 of 8 files and then present a summary
|
|
429
|
+
3. **Run the Pre-Commit Gate on the COMPLETE changeset**: Not on a partial subset
|
|
430
|
+
4. **Only THEN report completion**
|
|
431
|
+
|
|
432
|
+
```
|
|
433
|
+
BEFORE reporting "done" or presenting a summary:
|
|
434
|
+
├── Did this change establish a new standard, rule, or convention?
|
|
435
|
+
│ YES → Grep for every file that should enforce it. Update ALL of them.
|
|
436
|
+
├── Did this change modify a pattern used in multiple command files?
|
|
437
|
+
│ YES → Find and update EVERY command file that uses that pattern.
|
|
438
|
+
├── Did this change affect a template (CLAUDE-global, CLAUDE-project, etc.)?
|
|
439
|
+
│ YES → The template AND the live equivalent (~/.claude/CLAUDE.md) must match.
|
|
440
|
+
├── Did this change add a new requirement?
|
|
441
|
+
│ YES → Add to docs/requirements.md in the same pass.
|
|
442
|
+
├── Have I checked EVERY file in the blast radius?
|
|
443
|
+
│ NO → Keep going. Do not present partial work.
|
|
444
|
+
└── Am I about to say "want me to also update X?" or "should I check Y?"
|
|
445
|
+
YES → STOP. Just update X and check Y. Then report done.
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
**The test for this gate**: If the user asks "did you update all the documents?" and the answer would be "no, I missed some" — you failed this gate. The user should never need to ask.
|
|
449
|
+
|
|
450
|
+
## Execution Behavior
|
|
451
|
+
- ALWAYS check docs/architecture.md before adding or modifying components.
|
|
452
|
+
- ALWAYS check docs/workflows.md before changing any multi-step process.
|
|
453
|
+
- ALWAYS update docs as part of completing work — not as an afterthought.
|
|
454
|
+
- ALWAYS self-verify work by running tests and verification commands.
|
|
455
|
+
- NEVER re-research how something works if you built it — it should be documented.
|
|
456
|
+
- NEVER pause to show verification steps — execute them.
|
|
457
|
+
- NEVER ask "should I continue?" — just continue.
|
|
458
|
+
- NEVER summarize what you're "about to do" — just do it.
|
|
459
|
+
- IF a test fails, fix it immediately (up to 2 attempts) before reporting. If both attempts fail, delegate to `gsd-t headless --debug-loop` before stopping.
|
|
460
|
+
|
|
461
|
+
## Autonomy Levels
|
|
462
|
+
|
|
463
|
+
Projects can specify an autonomy level in their project CLAUDE.md:
|
|
464
|
+
|
|
465
|
+
| Level | Behavior |
|
|
466
|
+
|-------|----------|
|
|
467
|
+
| **Level 1: Supervised** | Pause at each phase for confirmation |
|
|
468
|
+
| **Level 2: Standard** | Pause only at milestones |
|
|
469
|
+
| **Level 3: Full Auto** | Only pause for blockers or project completion (default) |
|
|
470
|
+
|
|
471
|
+
If not specified, use Level 3.
|
|
472
|
+
|
|
473
|
+
## Workflow Preferences (Defaults — override in project CLAUDE.md)
|
|
474
|
+
|
|
475
|
+
### Research Policy
|
|
476
|
+
Before planning a phase, evaluate whether research is needed:
|
|
477
|
+
|
|
478
|
+
**Run research when:**
|
|
479
|
+
- Phase involves unfamiliar libraries, APIs, or services
|
|
480
|
+
- Architectural decisions are required
|
|
481
|
+
- Integrating external systems
|
|
482
|
+
- Phase scope is ambiguous or complex
|
|
483
|
+
|
|
484
|
+
**Skip research when:**
|
|
485
|
+
- Patterns are already established from earlier phases
|
|
486
|
+
- Straightforward CRUD, UI, or config work
|
|
487
|
+
- Domain is well understood
|
|
488
|
+
- Phase builds directly on existing code patterns
|
|
489
|
+
|
|
490
|
+
If in doubt, skip research and proceed — research if execution reveals gaps.
|
|
491
|
+
|
|
492
|
+
### Phase Flow
|
|
493
|
+
- Upon completing a phase, automatically proceed to the next phase
|
|
494
|
+
- ONLY run Discussion phase if truly required (clear path → skip to Plan)
|
|
495
|
+
- ALWAYS self-verify work by running verification commands
|
|
496
|
+
- NEVER pause to show verification steps — execute them
|
|
497
|
+
|
|
498
|
+
### Next Command Hint
|
|
499
|
+
|
|
500
|
+
When a GSD-T command completes (and does NOT auto-advance to the next phase), display a "Next Up" block at the very end of your response. This format is designed to trigger Claude Code's prompt suggestion engine — making the next command appear as ghost text in the user's input field.
|
|
501
|
+
|
|
502
|
+
**MANDATORY format** — use this exact structure:
|
|
503
|
+
|
|
504
|
+
```
|
|
505
|
+
───────────────────────────────────────────────────────────────
|
|
506
|
+
|
|
507
|
+
## ▶ Next Up
|
|
508
|
+
|
|
509
|
+
**{Phase Name}** — {one-line description of what happens next}
|
|
510
|
+
|
|
511
|
+
`/user:gsd-t-{command}`
|
|
512
|
+
|
|
513
|
+
───────────────────────────────────────────────────────────────
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
If there are alternative commands that also make sense, add them:
|
|
517
|
+
|
|
518
|
+
```
|
|
519
|
+
**Also available:**
|
|
520
|
+
- `/user:gsd-t-{alt-1}` — {description}
|
|
521
|
+
- `/user:gsd-t-{alt-2}` — {description}
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
Successor mapping:
|
|
525
|
+
| Completed | Next | Also available |
|
|
526
|
+
|-----------|------|----------------|
|
|
527
|
+
| `project` | `milestone` | |
|
|
528
|
+
| `feature` | `milestone` | |
|
|
529
|
+
| `milestone` | `partition` | |
|
|
530
|
+
| `partition` | `plan` | `discuss` (if complex) |
|
|
531
|
+
| `discuss` | `plan` | |
|
|
532
|
+
| `plan` | `execute` | `impact` (if risky) |
|
|
533
|
+
| `impact` | `execute` | |
|
|
534
|
+
| `execute` | `test-sync` | |
|
|
535
|
+
| `test-sync` | `verify` | `integrate` (if multi-domain) |
|
|
536
|
+
| `integrate` | `verify` | |
|
|
537
|
+
| `verify` | *(auto-invokes complete-milestone)* | |
|
|
538
|
+
| `complete-milestone` | `status` | |
|
|
539
|
+
| `scan` | `promote-debt` | `milestone` |
|
|
540
|
+
| `init` | `scan` | `milestone` |
|
|
541
|
+
| `init-scan-setup` | `milestone` | |
|
|
542
|
+
| `gap-analysis` | `milestone` | `feature` |
|
|
543
|
+
| `populate` | `status` | |
|
|
544
|
+
| `setup` | `status` | |
|
|
545
|
+
|
|
546
|
+
Commands with no successor (standalone): `quick`, `debug`, `brainstorm`, `status`, `help`, `resume`, `prompt`, `log`, `health`, `pause`, backlog commands.
|
|
547
|
+
|
|
548
|
+
Skip the hint if auto-advancing (Level 3 mid-wave) — only show when the user needs to manually invoke the next step.
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
# Don't Do These Things
|
|
552
|
+
|
|
553
|
+
- NEVER perform destructive or structural changes without explicit user approval (see Destructive Action Guard above).
|
|
554
|
+
- NEVER drop database tables, remove columns, or run destructive SQL on an existing database — adapt new code to the existing schema.
|
|
555
|
+
- NEVER replace existing architecture patterns (e.g., normalized → denormalized) without user approval — even if you think the new way is better.
|
|
556
|
+
- NEVER commit code without running the Pre-Commit Gate checklist. EVERY commit.
|
|
557
|
+
- NEVER batch doc updates for later — update docs as part of the same commit as the code change.
|
|
558
|
+
- NEVER start a phase without reading contracts and relevant docs first.
|
|
559
|
+
- NEVER complete a phase without running document ripple on affected docs.
|
|
560
|
+
- NEVER re-research how a component works — read architecture.md and contracts.
|
|
561
|
+
- NEVER let code and contract disagree — fix one or the other immediately.
|
|
562
|
+
- NEVER make changes that touch more than 3 files without pausing to confirm approach.
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
# Code Standards (Defaults — override in project CLAUDE.md)
|
|
566
|
+
|
|
567
|
+
## Patterns
|
|
568
|
+
- Type hints required on all function signatures
|
|
569
|
+
- Dataclasses/interfaces for data models, not raw dicts
|
|
570
|
+
- Functions under 30 lines — split if longer
|
|
571
|
+
- Files under 200 lines — create new modules if needed
|
|
572
|
+
- Enums for state management and fixed option sets
|
|
573
|
+
|
|
574
|
+
## Naming
|
|
575
|
+
```
|
|
576
|
+
files: snake_case (user_service.py)
|
|
577
|
+
classes: PascalCase (UserService)
|
|
578
|
+
functions: snake_case (get_user)
|
|
579
|
+
constants: UPPER_SNAKE_CASE (MAX_RETRIES)
|
|
580
|
+
private: _underscore (_internal_method)
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
## Markdown Tables
|
|
584
|
+
|
|
585
|
+
Emoji display as 2 characters wide in terminal/monospace but count as 1 in string length. This causes misaligned columns. **Always add one extra space after emoji in table cells** to compensate:
|
|
586
|
+
|
|
587
|
+
```
|
|
588
|
+
WRONG — misaligned in terminal:
|
|
589
|
+
| Channel | Support |
|
|
590
|
+
|----------|---------|
|
|
591
|
+
| Discord | ✅ |
|
|
592
|
+
| LINE | ❌ |
|
|
593
|
+
|
|
594
|
+
RIGHT — one extra space after emoji:
|
|
595
|
+
| Channel | Support |
|
|
596
|
+
|----------|---------|
|
|
597
|
+
| Discord | ✅ |
|
|
598
|
+
| LINE | ❌ |
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
This extra space is invisible in rendered HTML (GitHub, VS Code preview) but restores alignment in terminal views. Apply to all GSD-T-generated docs that use emoji in tables.
|
|
602
|
+
|
|
603
|
+
Also pad all cell values in a column to the width of the widest value:
|
|
604
|
+
```
|
|
605
|
+
| iMessage (BlueBubbles) | ✅ |
|
|
606
|
+
| Discord | ✅ |
|
|
607
|
+
| QQ | ❌ |
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
## Stack Rules Engine
|
|
612
|
+
|
|
613
|
+
GSD-T auto-detects project tech stack at subagent spawn time and injects mandatory best-practice rules into the subagent prompt.
|
|
614
|
+
|
|
615
|
+
**Detection sources**: `package.json` (React, TypeScript, Node API), `requirements.txt`/`pyproject.toml` (Python), `go.mod` (Go), `Cargo.toml` (Rust).
|
|
616
|
+
|
|
617
|
+
**Universal rules**: Templates prefixed with `_` (e.g., `_security.md`) are **always** injected, regardless of stack.
|
|
618
|
+
|
|
619
|
+
**Stack-specific rules**: Injected only when the matching stack is detected (e.g., `react.md` when `"react"` is in `package.json`).
|
|
620
|
+
|
|
621
|
+
**Enforcement**: Stack rule violations have the same weight as contract violations — they are task failures, not warnings.
|
|
622
|
+
|
|
623
|
+
**Extensible**: Drop a `.md` file into `templates/stacks/` in the GSD-T package to add rules for a new stack. If the directory is missing, detection skips silently.
|
|
624
|
+
|
|
625
|
+
**Commands that inject stack rules**: `gsd-t-execute`, `gsd-t-quick`, `gsd-t-integrate`, `gsd-t-wave`, `gsd-t-debug`.
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
# Recovery After Interruption
|
|
629
|
+
|
|
630
|
+
When resuming work (new session or after /clear):
|
|
631
|
+
1. Read `.gsd-t/progress.md` for current state
|
|
632
|
+
2. Read `docs/requirements.md` for what's left to build
|
|
633
|
+
3. Read `docs/architecture.md` for how the system is structured
|
|
634
|
+
4. Read `.gsd-t/contracts/` for domain interfaces
|
|
635
|
+
5. Verify last task's work is intact (files exist, tests pass)
|
|
636
|
+
6. Continue from current task — don't restart the phase
|
|
637
|
+
|
|
638
|
+
**CRITICAL: Do NOT research how the system works. The docs tell you. Read them.**
|
|
639
|
+
<!-- GSD-T:END — Do not remove this marker. -->
|