@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
package/README.md CHANGED
@@ -1,372 +1,379 @@
1
- # GSD-T: Contract-Driven Development for Claude Code
2
-
3
- A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
4
-
5
- **Eliminates context rot** — task-level fresh dispatch (one subagent per task, ~10-20% context each) means compaction never triggers.
6
- **Compaction-proof debug loops** — `gsd-t headless --debug-loop` runs test-fix-retest cycles as separate `claude -p` sessions. A JSONL debug ledger persists all hypothesis/fix/learning history across fresh sessions. Anti-repetition preamble injection prevents retrying failed hypotheses. Escalation tiers (sonnet → opus → human) and a hard iteration ceiling enforced externally.
7
- **Safe parallel execution** — worktree isolation gives each domain agent its own filesystem; sequential atomic merges prevent conflicts.
8
- **Maintains test coverage** — automatically keeps tests aligned with code changes.
9
- **Catches downstream effects** — analyzes impact before changes break things.
10
- **Protects existing work** — destructive action guard prevents schema drops, architecture replacements, and data loss without explicit approval.
11
- **Visualizes execution in real time** — live browser dashboard renders agent hierarchy, tool activity, and phase progression from the event stream.
12
- **Generates visual scan reports** — every `/gsd-t-scan` produces a self-contained HTML report with 6 live architectural diagrams, a tech debt register, and domain health scores; optional DOCX/PDF export via `--export docx|pdf`.
13
- **Self-learning rule engine** — declarative rules in rules.jsonl detect failure patterns from task metrics. Candidate patches progress through a 5-stage lifecycle (candidate, applied, measured, promoted, graduated) with >55% improvement gates before becoming permanent methodology artifacts.
14
- **Cross-project learning** — proven rules propagate to `~/.claude/metrics/` and sync across all registered projects via `update-all`. Rules validated in 3+ projects become universal; 5+ projects qualify for npm distribution. Cross-project signal comparison and global ELO rankings available via `gsd-t-metrics --cross-project` and `gsd-t-status`.
15
- **Stack Rules Engine** — auto-detects project tech stack (React, TypeScript, Node API, Python, Go, Rust) from manifest files and injects mandatory best-practice rules into subagent prompts at execute-time. Universal security rules always apply; stack-specific rules layer on top. Extensible: drop a `.md` file in `templates/stacks/` to add a new stack.
16
-
17
- ---
18
-
19
- ## Quick Start
20
-
21
- ### Install with npm
22
-
23
- ```bash
24
- npx @tekyzinc/gsd-t install
25
- ```
26
-
27
- This installs 46 GSD-T commands + 5 utility commands (51 total) to `~/.claude/commands/` and the global CLAUDE.md to `~/.claude/CLAUDE.md`. Works on Windows, Mac, and Linux.
28
-
29
- ### Start Using It
30
-
31
- ```bash
32
- # 1. Start Claude Code in your project
33
- cd my-project
34
- claude
35
-
36
- # 2. Full onboarding (git + init + scan + setup in one)
37
- /user:gsd-t-init-scan-setup
38
-
39
- # Or step by step:
40
- /user:gsd-t-init my-project
41
-
42
- # 4. Define what you're building
43
- /user:gsd-t-milestone "User Authentication System"
44
-
45
- # 5. Let it rip (auto-advances through all phases)
46
- /user:gsd-t-wave
47
-
48
- # Or go phase by phase for more control:
49
- /user:gsd-t-partition
50
- /user:gsd-t-discuss
51
- /user:gsd-t-plan
52
- /user:gsd-t-impact
53
- /user:gsd-t-execute
54
- /user:gsd-t-test-sync
55
- /user:gsd-t-integrate
56
- /user:gsd-t-verify
57
- /user:gsd-t-complete-milestone
58
- ```
59
-
60
- ### Resuming After a Break
61
-
62
- ```bash
63
- claude
64
- /user:gsd-t-resume
65
- ```
66
-
67
- GSD-T reads all state files and tells you exactly where you left off.
68
-
69
- ---
70
-
71
- ## CLI Commands
72
-
73
- ```bash
74
- npx @tekyzinc/gsd-t install # Install commands + global CLAUDE.md
75
- npx @tekyzinc/gsd-t update # Update global commands + CLAUDE.md
76
- npx @tekyzinc/gsd-t update-all # Update globally + all registered project CLAUDE.md files
77
- npx @tekyzinc/gsd-t init [name] # Scaffold GSD-T project (auto-registers)
78
- npx @tekyzinc/gsd-t register # Register current directory as a GSD-T project
79
- npx @tekyzinc/gsd-t status # Check installation + version
80
- npx @tekyzinc/gsd-t doctor # Diagnose common issues
81
- npx @tekyzinc/gsd-t changelog # Open changelog in the browser
82
- npx @tekyzinc/gsd-t uninstall # Remove commands (keeps project files)
83
-
84
- # Headless mode (CI/CD)
85
- gsd-t headless verify --json --timeout=1200 # Run verify non-interactively
86
- gsd-t headless query status # Get project state (no LLM, <100ms)
87
- gsd-t headless query domains # List domains (no LLM)
88
-
89
- # Headless debug-loop (compaction-proof automated test-fix-retest)
90
- gsd-t headless --debug-loop # Auto-detect test cmd, up to 20 iterations
91
- gsd-t headless --debug-loop --max-iterations=10 # Cap at 10 iterations
92
- gsd-t headless --debug-loop --test-cmd="npm test" # Override test command
93
- gsd-t headless --debug-loop --fix-scope="src/auth/**" # Limit fix scope
94
- gsd-t headless --debug-loop --json --log # Structured output + per-iteration logs
95
- ```
96
-
97
- Each iteration runs as a fresh `claude -p` session. A cumulative debug ledger (`.gsd-t/debug-state.jsonl`) preserves hypothesis/fix/learning history across sessions. An anti-repetition preamble prevents retrying failed approaches.
98
-
99
- **Escalation tiers**: sonnet (iterations 1–5) opus (6–15) STOP with diagnostic summary (16–20)
100
-
101
- **Exit codes**: `0` all tests pass · `1` max iterations reached · `2` compaction error · `3` process error · `4` needs human decision
102
-
103
- ### Updating
104
-
105
- When a new version is published:
106
- ```bash
107
- npx @tekyzinc/gsd-t@latest update
108
- ```
109
-
110
- This will replace changed command files, back up your CLAUDE.md if customized, and track the installed version.
111
-
112
- ---
113
-
114
- ## Commands Reference
115
-
116
- ### Smart Router
117
-
118
- | Command | Purpose | Auto |
119
- |---------|---------|------|
120
- | `/user:gsd {request}` | Describe what you need → auto-routes to the right command | Manual |
121
- | _(any plain text)_ | Auto-routed via UserPromptSubmit hook — no leading `/` needed | Auto |
122
-
123
- ### Help & Onboarding
124
-
125
- | Command | Purpose | Auto |
126
- |---------|---------|------|
127
- | `/user:gsd-t-help` | List all commands with descriptions | Manual |
128
- | `/user:gsd-t-help {cmd}` | Detailed help for specific command | Manual |
129
- | `/user:gsd-t-prompt` | Help formulate your idea before committing | Manual |
130
- | `/user:gsd-t-brainstorm` | Creative exploration and idea generation | Manual |
131
- | `/user:gsd-t-prd` | Generate a GSD-T-optimized Product Requirements Document | Manual |
132
-
133
- ### Project Initialization
134
-
135
- | Command | Purpose | Auto |
136
- |---------|---------|------|
137
- | `/user:gsd-t-setup` | Generate or restructure project CLAUDE.md | Manual |
138
- | `/user:gsd-t-init` | Initialize GSD-T structure in project | Manual |
139
- | `/user:gsd-t-init-scan-setup` | Full onboarding: git + init + scan + setup in one | Manual |
140
- | `/user:gsd-t-project` | Full project → milestone roadmap | Manual |
141
- | `/user:gsd-t-feature` | Major feature → impact analysis + milestones | Manual |
142
- | `/user:gsd-t-scan` | Deep codebase analysis techdebt.md | Manual |
143
- | `/user:gsd-t-gap-analysis` | Requirements gap analysis spec vs. existing code | Manual |
144
- | `/user:gsd-t-promote-debt` | Convert techdebt items to milestones | Manual |
145
- | `/user:gsd-t-populate` | Auto-populate docs from existing codebase | Manual |
146
-
147
- ### Milestone Workflow
148
-
149
- | Command | Purpose | Auto |
150
- |---------|---------|------|
151
- | `/user:gsd-t-milestone` | Define new milestone | Manual |
152
- | `/user:gsd-t-partition` | Decompose into domains + contracts | In wave |
153
- | `/user:gsd-t-discuss` | Multi-perspective design exploration | In wave |
154
- | `/user:gsd-t-plan` | Create atomic task lists per domain (tasks auto-split to fit one context window) | In wave |
155
- | `/user:gsd-t-impact` | Analyze downstream effects | In wave |
156
- | `/user:gsd-t-execute` | Run tasks task-level fresh dispatch, worktree isolation, adaptive replanning | In wave |
157
- | `/user:gsd-t-test-sync` | Sync tests with code changes | In wave |
158
- | `/user:gsd-t-qa` | QA agent test generation, execution, gap reporting | Auto-spawned |
159
- | `/user:gsd-t-doc-ripple` | Automated document ripple update downstream docs after code changes | Auto-spawned |
160
- | `/user:gsd-t-integrate` | Wire domains together | In wave |
161
- | `/user:gsd-t-verify` | Run quality gates + goal-backward behavior verification | In wave |
162
- | `/user:gsd-t-complete-milestone` | Archive + git tag (goal-backward gate required) | In wave |
163
-
164
- ### Automation & Utilities
165
-
166
- | Command | Purpose | Auto |
167
- |---------|---------|------|
168
- | `/user:gsd-t-wave` | Full cycle, auto-advances all phases | Manual |
169
- | `/user:gsd-t-status` | Cross-domain progress view with token breakdown by domain/task/phase | Manual |
170
- | `/user:gsd-t-resume` | Restore context, continue | Manual |
171
- | `/user:gsd-t-quick` | Fast task with GSD-T guarantees | Manual |
172
- | `/user:gsd-t-reflect` | Generate retrospective from event stream, propose memory updates | Manual |
173
- | `/user:gsd-t-visualize` | Launch browser dashboard — SSE server + React Flow agent visualization | Manual |
174
- | `/user:gsd-t-debug` | Systematic debugging with state | Manual |
175
- | `/user:gsd-t-metrics` | View task telemetry, process ELO, signal distribution, domain health, and cross-project comparison (`--cross-project`) | Manual |
176
- | `/user:gsd-t-health` | Validate .gsd-t/ structure, optionally repair | Manual |
177
- | `/user:gsd-t-pause` | Save exact position for reliable resume | Manual |
178
- | `/user:gsd-t-log` | Sync progress Decision Log with recent git activity | Manual |
179
- | `/user:gsd-t-version-update` | Update GSD-T to latest version | Manual |
180
- | `/user:gsd-t-version-update-all` | Update GSD-T + all registered projects | Manual |
181
- | `/user:gsd-t-triage-and-merge` | Auto-review, merge, and publish GitHub branches | Manual |
182
-
183
- ### Backlog Management
184
-
185
- | Command | Purpose | Auto |
186
- |---------|---------|------|
187
- | `/user:gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog | Manual |
188
- | `/user:gsd-t-backlog-list` | Filtered, ordered view of backlog items | Manual |
189
- | `/user:gsd-t-backlog-move` | Reorder items by position (priority) | Manual |
190
- | `/user:gsd-t-backlog-edit` | Modify backlog entry fields | Manual |
191
- | `/user:gsd-t-backlog-remove` | Drop item with optional reason | Manual |
192
- | `/user:gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow | Manual |
193
- | `/user:gsd-t-backlog-settings` | Manage types, apps, categories, defaults | Manual |
194
-
195
- ### Git Helpers
196
-
197
- | Command | Purpose | Auto |
198
- |---------|---------|------|
199
- | `/user:branch` | Create and switch to a new git branch | Manual |
200
- | `/user:checkin` | Auto-bump version, stage, commit, and push | Manual |
201
- | `/user:Claude-md` | Reload CLAUDE.md directives mid-session | Manual |
202
- | `/global-change` | Apply file changes across all registered GSD-T projects | Manual |
203
-
204
- ---
205
-
206
- ## Workflow Phases
207
-
208
- | Phase | Purpose | Solo/Team |
209
- |-------|---------|-----------|
210
- | **Prompt** | Formulate idea (pre-workflow) | Solo |
211
- | **Project/Feature/Scan** | Initialize work | Solo (team for large scans) |
212
- | **Milestone** | Define deliverable | Solo |
213
- | **Partition** | Decompose into domains + contracts | Solo |
214
- | **Discuss** | Explore design decisions | Both |
215
- | **Plan** | Create atomic task lists | Solo (always) |
216
- | **Impact** | Downstream effect analysis | Solo |
217
- | **Execute** | Build it | Both |
218
- | **Test-Sync** | Maintain test coverage | Solo |
219
- | **Integrate** | Wire domains together | Solo (always) |
220
- | **Verify** | Quality gates | Both |
221
- | **Complete** | Archive + tag | Solo |
222
-
223
- ---
224
-
225
- ## Entry Points
226
-
227
- - **"I have an idea"** `gsd-t-project` milestone roadmap → partition → execute
228
- - **"I have a codebase and need to add something"** `gsd-t-feature` impact analysis milestones
229
- - **"I have a codebase and need to understand/fix it"** → `gsd-t-scan` → techdebt.md → promote to milestones
230
-
231
- ---
232
-
233
- ## Project Structure (What GSD-T Creates)
234
-
235
- ```
236
- your-project/
237
- ├── CLAUDE.md
238
- ├── docs/
239
- │ ├── requirements.md # Functional + technical requirements
240
- │ ├── architecture.md # System design, components, data flow
241
- │ ├── workflows.md # User journeys, technical processes
242
- │ └── infrastructure.md # Dev setup, DB, cloud, deployment
243
- ├── .gsd-t/
244
- ├── progress.md # Master state file
245
- ├── backlog.md # Captured backlog items (priority ordered)
246
- │ ├── backlog-settings.md # Types, apps, categories, defaults
247
- │ ├── roadmap.md # Milestone roadmap
248
- │ ├── techdebt.md # Technical debt register
249
- ├── verify-report.md # Latest verification results
250
- ├── impact-report.md # Downstream effect analysis
251
- │ ├── test-coverage.md # Test sync report
252
- │ ├── contracts/
253
- ├── api-contract.md
254
- ├── schema-contract.md
255
- ├── component-contract.md
256
- │ └── integration-points.md
257
- │ ├── domains/
258
- │ └── {domain-name}/
259
- ├── scope.md
260
- │ │ ├── tasks.md
261
- │ │ └── constraints.md
262
- │ ├── events/ # Execution event stream (JSONL, daily-rotated)
263
- ├── retrospectives/ # Retrospective reports from gsd-t-reflect
264
- │ ├── milestones/ # Archived completed milestones
265
- │ │ └── {milestone-name}-{date}/
266
- └── scan/ # Codebase analysis outputs
267
- └── src/
268
- ```
269
-
270
- ---
271
-
272
- ## Key Principles
273
-
274
- 1. **Contracts are the source of truth.** Code implements contracts, not the other way around.
275
- 2. **Domains own files exclusively.** No two domains should modify the same file.
276
- 3. **Impact before execution.** Always analyze downstream effects before making changes.
277
- 4. **Tests stay synced.** Every code change triggers test analysis.
278
- 5. **State survives sessions.** Everything is in `.gsd-t/`.
279
- 6. **Plan is single-brain, execute is multi-brain.** Planning and integration always solo; execution and verification can parallelize.
280
- 7. **Every decision is logged.** The Decision Log captures why, not just what.
281
- 8. **Agents learn from experience.** Every command invocation, phase transition, and subagent spawn is captured as a structured event. Past failures surface before each task (Reflexion pattern). Distillation converts repeated patterns into lasting CLAUDE.md rules.
282
-
283
- ---
284
-
285
- ## Security
286
-
287
- - **Wave mode** spawns phase agents with `bypassPermissions` agents execute without per-action user approval. Use Level 1 or Level 2 autonomy for sensitive projects to review each phase.
288
- - **Heartbeat logs** scrub sensitive patterns (passwords, tokens, API keys) from bash commands and mask URL query parameters before writing to `.gsd-t/heartbeat-*.jsonl`.
289
- - **File write paths** are validated (within `~/.claude/`) and checked for symlinks before writing.
290
- - **HTTP responses** are bounded at 1MB to prevent memory exhaustion from oversized registry responses.
291
- - **Directory creation** validates parent path components for symlinks to prevent path traversal.
292
- - Run `gsd-t doctor` to verify installation integrity. Keep GSD-T updated with `gsd-t update`.
293
-
294
- ---
295
-
296
- ## Enabling Agent Teams
297
-
298
- ```json
299
- {
300
- "env": {
301
- "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
302
- }
303
- }
304
- ```
305
-
306
- Teams are optional — all commands work in solo mode.
307
-
308
- ---
309
-
310
- ## Manual Installation (without npm)
311
-
312
- ```bash
313
- # Windows
314
- copy commands\*.md %USERPROFILE%\.claude\commands\
315
-
316
- # Mac/Linux
317
- cp commands/*.md ~/.claude/commands/
318
- ```
319
-
320
- Verify with: `/user:gsd-t-help`
321
-
322
- ---
323
-
324
- ## Repo Contents
325
-
326
- ```
327
- get-stuff-done-teams/
328
- ├── README.md
329
- ├── package.json
330
- ├── LICENSE
331
- ├── bin/
332
- │ └── gsd-t.js # CLI installer
333
- ├── commands/ # 51 slash commands
334
- │ ├── gsd-t-*.md # 45 GSD-T workflow commands
335
- ├── gsd.md # GSD-T smart router
336
- ├── branch.md # Git branch helper
337
- ├── checkin.md # Auto-version + commit/push helper
338
- │ └── Claude-md.md # Reload CLAUDE.md directives
339
- ├── templates/ # Document templates (9 base + stacks/)
340
- ├── CLAUDE-global.md
341
- │ ├── CLAUDE-project.md
342
- │ ├── requirements.md
343
- │ ├── architecture.md
344
- │ ├── workflows.md
345
- ├── infrastructure.md
346
- ├── progress.md
347
- │ ├── backlog.md
348
- │ ├── backlog-settings.md
349
- └── stacks/ # Stack Rules Engine templates
350
- ├── _security.md # Universal — always injected
351
- ├── react.md
352
- ├── typescript.md
353
- └── node-api.md
354
- ├── scripts/ # Runtime utility scripts (installed to ~/.claude/scripts/)
355
- │ ├── gsd-t-tools.js # State CLI (get/set/validate/list)
356
- ├── gsd-t-statusline.js # Context usage bar
357
- ├── gsd-t-event-writer.js # Structured JSONL event writer
358
- ├── gsd-t-dashboard-server.js # Zero-dep SSE server for dashboard
359
- └── gsd-t-dashboard.html # React Flow + Dagre real-time dashboard
360
- ├── examples/
361
- ├── settings.json
362
- └── .gsd-t/
363
- ├── docs/
364
- │ ├── GSD-T-README.md # Detailed methodology + usage guide
365
- └── methodology.md
366
- ```
367
-
368
- ---
369
-
370
- ## License
371
-
372
- MIT
1
+ # GSD-T: Contract-Driven Development for Claude Code
2
+
3
+ A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
4
+
5
+ **Eliminates context rot** — task-level fresh dispatch (one subagent per task, ~10-20% context each) means compaction never triggers.
6
+ **Compaction-proof debug loops** — `gsd-t headless --debug-loop` runs test-fix-retest cycles as separate `claude -p` sessions. A JSONL debug ledger persists all hypothesis/fix/learning history across fresh sessions. Anti-repetition preamble injection prevents retrying failed hypotheses. Escalation tiers (sonnet → opus → human) and a hard iteration ceiling enforced externally.
7
+ **Safe parallel execution** — worktree isolation gives each domain agent its own filesystem; sequential atomic merges prevent conflicts.
8
+ **Maintains test coverage** — automatically keeps tests aligned with code changes.
9
+ **Catches downstream effects** — analyzes impact before changes break things.
10
+ **Protects existing work** — destructive action guard prevents schema drops, architecture replacements, and data loss without explicit approval.
11
+ **Visualizes execution in real time** — live browser dashboard renders agent hierarchy, tool activity, and phase progression from the event stream.
12
+ **Generates visual scan reports** — every `/gsd-t-scan` produces a self-contained HTML report with 6 live architectural diagrams, a tech debt register, and domain health scores; optional DOCX/PDF export via `--export docx|pdf`.
13
+ **Self-learning rule engine** — declarative rules in rules.jsonl detect failure patterns from task metrics. Candidate patches progress through a 5-stage lifecycle (candidate, applied, measured, promoted, graduated) with >55% improvement gates before becoming permanent methodology artifacts.
14
+ **Cross-project learning** — proven rules propagate to `~/.claude/metrics/` and sync across all registered projects via `update-all`. Rules validated in 3+ projects become universal; 5+ projects qualify for npm distribution. Cross-project signal comparison and global ELO rankings available via `gsd-t-metrics --cross-project` and `gsd-t-status`.
15
+ **Stack Rules Engine** — auto-detects project tech stack (React, TypeScript, Node API, Python, Go, Rust) from manifest files and injects mandatory best-practice rules into subagent prompts at execute-time. Universal security rules always apply; stack-specific rules layer on top. Extensible: drop a `.md` file in `templates/stacks/` to add a new stack.
16
+ **Self-Calibrating QA** — `qa-calibrator.js` tracks QA miss-rates across milestones, detects weak-spot categories (error paths, boundaries, state transitions), and automatically injects targeted guidance into QA subagent prompts. Projects on the same stack share miss-rate data for faster calibration.
17
+ **Token-Aware Orchestration** — `token-budget.js` tracks session token consumption and applies graduated degradation: downgrade model assignments when approaching limits, checkpoint and skip non-essential operations to conserve budget, and halt cleanly with a resume instruction at the ceiling. Wave and execute phases check budget before each subagent spawn.
18
+ **Quality North Star** — projects define a `## Quality North Star` section in CLAUDE.md (1–3 sentences, e.g., "This is a published npm library. Every public API must be intuitive and backward-compatible."). `gsd-t-init` auto-detects preset (library/web-app/cli) from package.json signals; `gsd-t-setup` configures it for existing projects. Subagents read it as a quality lens; absent = silent skip (backward compatible).
19
+ **Design Brief Artifact** — during partition, UI/frontend projects (React, Vue, Svelte, Flutter, Tailwind) automatically get `.gsd-t/contracts/design-brief.md` with color palette, typography, spacing system, component patterns, and tone/voice. Non-UI projects skip silently. User-customized briefs are preserved. Referenced in plan phase for visual consistency.
20
+ **Exploratory Testing** — after scripted tests pass, if Playwright MCP is registered in Claude Code settings, QA agents get 3 minutes and Red Team gets 5 minutes of interactive browser exploration. All findings tagged `[EXPLORATORY]` and tracked separately in QA calibration. Silent skip when Playwright MCP absent. Wired into execute, quick, integrate, and debug.
21
+
22
+ ---
23
+
24
+ ## Quick Start
25
+
26
+ ### Install with npm
27
+
28
+ ```bash
29
+ npx @tekyzinc/gsd-t install
30
+ ```
31
+
32
+ This installs 47 GSD-T commands + 5 utility commands (52 total) to `~/.claude/commands/` and the global CLAUDE.md to `~/.claude/CLAUDE.md`. Works on Windows, Mac, and Linux.
33
+
34
+ ### Start Using It
35
+
36
+ ```bash
37
+ # 1. Start Claude Code in your project
38
+ cd my-project
39
+ claude
40
+
41
+ # 2. Full onboarding (git + init + scan + setup in one)
42
+ /user:gsd-t-init-scan-setup
43
+
44
+ # Or step by step:
45
+ /user:gsd-t-init my-project
46
+
47
+ # 4. Define what you're building
48
+ /user:gsd-t-milestone "User Authentication System"
49
+
50
+ # 5. Let it rip (auto-advances through all phases)
51
+ /user:gsd-t-wave
52
+
53
+ # Or go phase by phase for more control:
54
+ /user:gsd-t-partition
55
+ /user:gsd-t-discuss
56
+ /user:gsd-t-plan
57
+ /user:gsd-t-impact
58
+ /user:gsd-t-execute
59
+ /user:gsd-t-test-sync
60
+ /user:gsd-t-integrate
61
+ /user:gsd-t-verify
62
+ /user:gsd-t-complete-milestone
63
+ ```
64
+
65
+ ### Resuming After a Break
66
+
67
+ ```bash
68
+ claude
69
+ /user:gsd-t-resume
70
+ ```
71
+
72
+ GSD-T reads all state files and tells you exactly where you left off.
73
+
74
+ ---
75
+
76
+ ## CLI Commands
77
+
78
+ ```bash
79
+ npx @tekyzinc/gsd-t install # Install commands + global CLAUDE.md
80
+ npx @tekyzinc/gsd-t update # Update global commands + CLAUDE.md
81
+ npx @tekyzinc/gsd-t update-all # Update globally + all registered project CLAUDE.md files
82
+ npx @tekyzinc/gsd-t init [name] # Scaffold GSD-T project (auto-registers)
83
+ npx @tekyzinc/gsd-t register # Register current directory as a GSD-T project
84
+ npx @tekyzinc/gsd-t status # Check installation + version
85
+ npx @tekyzinc/gsd-t doctor # Diagnose common issues
86
+ npx @tekyzinc/gsd-t changelog # Open changelog in the browser
87
+ npx @tekyzinc/gsd-t uninstall # Remove commands (keeps project files)
88
+
89
+ # Headless mode (CI/CD)
90
+ gsd-t headless verify --json --timeout=1200 # Run verify non-interactively
91
+ gsd-t headless query status # Get project state (no LLM, <100ms)
92
+ gsd-t headless query domains # List domains (no LLM)
93
+
94
+ # Headless debug-loop (compaction-proof automated test-fix-retest)
95
+ gsd-t headless --debug-loop # Auto-detect test cmd, up to 20 iterations
96
+ gsd-t headless --debug-loop --max-iterations=10 # Cap at 10 iterations
97
+ gsd-t headless --debug-loop --test-cmd="npm test" # Override test command
98
+ gsd-t headless --debug-loop --fix-scope="src/auth/**" # Limit fix scope
99
+ gsd-t headless --debug-loop --json --log # Structured output + per-iteration logs
100
+ ```
101
+
102
+ Each iteration runs as a fresh `claude -p` session. A cumulative debug ledger (`.gsd-t/debug-state.jsonl`) preserves hypothesis/fix/learning history across sessions. An anti-repetition preamble prevents retrying failed approaches.
103
+
104
+ **Escalation tiers**: sonnet (iterations 1–5) → opus (6–15) → STOP with diagnostic summary (16–20)
105
+
106
+ **Exit codes**: `0` all tests pass · `1` max iterations reached · `2` compaction error · `3` process error · `4` needs human decision
107
+
108
+ ### Updating
109
+
110
+ When a new version is published:
111
+ ```bash
112
+ npx @tekyzinc/gsd-t@latest update
113
+ ```
114
+
115
+ This will replace changed command files, back up your CLAUDE.md if customized, and track the installed version.
116
+
117
+ ---
118
+
119
+ ## Commands Reference
120
+
121
+ ### Smart Router
122
+
123
+ | Command | Purpose | Auto |
124
+ |---------|---------|------|
125
+ | `/user:gsd {request}` | Describe what you need → auto-routes to the right command | Manual |
126
+ | _(any plain text)_ | Auto-routed via UserPromptSubmit hook — no leading `/` needed | Auto |
127
+
128
+ ### Help & Onboarding
129
+
130
+ | Command | Purpose | Auto |
131
+ |---------|---------|------|
132
+ | `/user:gsd-t-help` | List all commands with descriptions | Manual |
133
+ | `/user:gsd-t-help {cmd}` | Detailed help for specific command | Manual |
134
+ | `/user:gsd-t-prompt` | Help formulate your idea before committing | Manual |
135
+ | `/user:gsd-t-brainstorm` | Creative exploration and idea generation | Manual |
136
+ | `/user:gsd-t-prd` | Generate a GSD-T-optimized Product Requirements Document | Manual |
137
+
138
+ ### Project Initialization
139
+
140
+ | Command | Purpose | Auto |
141
+ |---------|---------|------|
142
+ | `/user:gsd-t-setup` | Generate or restructure project CLAUDE.md | Manual |
143
+ | `/user:gsd-t-init` | Initialize GSD-T structure in project | Manual |
144
+ | `/user:gsd-t-init-scan-setup` | Full onboarding: git + init + scan + setup in one | Manual |
145
+ | `/user:gsd-t-project` | Full project milestone roadmap | Manual |
146
+ | `/user:gsd-t-feature` | Major feature → impact analysis + milestones | Manual |
147
+ | `/user:gsd-t-scan` | Deep codebase analysis → techdebt.md | Manual |
148
+ | `/user:gsd-t-gap-analysis` | Requirements gap analysis — spec vs. existing code | Manual |
149
+ | `/user:gsd-t-promote-debt` | Convert techdebt items to milestones | Manual |
150
+ | `/user:gsd-t-populate` | Auto-populate docs from existing codebase | Manual |
151
+
152
+ ### Milestone Workflow
153
+
154
+ | Command | Purpose | Auto |
155
+ |---------|---------|------|
156
+ | `/user:gsd-t-milestone` | Define new milestone | Manual |
157
+ | `/user:gsd-t-partition` | Decompose into domains + contracts | In wave |
158
+ | `/user:gsd-t-discuss` | Multi-perspective design exploration | In wave |
159
+ | `/user:gsd-t-plan` | Create atomic task lists per domain (tasks auto-split to fit one context window) | In wave |
160
+ | `/user:gsd-t-impact` | Analyze downstream effects | In wave |
161
+ | `/user:gsd-t-execute` | Run tasks task-level fresh dispatch, worktree isolation, adaptive replanning | In wave |
162
+ | `/user:gsd-t-test-sync` | Sync tests with code changes | In wave |
163
+ | `/user:gsd-t-qa` | QA agent — test generation, execution, gap reporting | Auto-spawned |
164
+ | *Red Team* | Adversarial QA — finds bugs the builder missed (inverted incentives) | Auto-spawned |
165
+ | `/user:gsd-t-doc-ripple` | Automated document ripple — update downstream docs after code changes | Auto-spawned |
166
+ | `/user:gsd-t-integrate` | Wire domains together | In wave |
167
+ | `/user:gsd-t-verify` | Run quality gates + goal-backward behavior verification | In wave |
168
+ | `/user:gsd-t-complete-milestone` | Archive + git tag (goal-backward gate required) | In wave |
169
+
170
+ ### Automation & Utilities
171
+
172
+ | Command | Purpose | Auto |
173
+ |---------|---------|------|
174
+ | `/user:gsd-t-wave` | Full cycle, auto-advances all phases | Manual |
175
+ | `/user:gsd-t-status` | Cross-domain progress view with token breakdown by domain/task/phase | Manual |
176
+ | `/user:gsd-t-resume` | Restore context, continue | Manual |
177
+ | `/user:gsd-t-quick` | Fast task with GSD-T guarantees | Manual |
178
+ | `/user:gsd-t-reflect` | Generate retrospective from event stream, propose memory updates | Manual |
179
+ | `/user:gsd-t-visualize` | Launch browser dashboard SSE server + React Flow agent visualization | Manual |
180
+ | `/user:gsd-t-debug` | Systematic debugging with state | Manual |
181
+ | `/user:gsd-t-metrics` | View task telemetry, process ELO, signal distribution, domain health, and cross-project comparison (`--cross-project`) | Manual |
182
+ | `/user:gsd-t-health` | Validate .gsd-t/ structure, optionally repair | Manual |
183
+ | `/user:gsd-t-pause` | Save exact position for reliable resume | Manual |
184
+ | `/user:gsd-t-log` | Sync progress Decision Log with recent git activity | Manual |
185
+ | `/user:gsd-t-version-update` | Update GSD-T to latest version | Manual |
186
+ | `/user:gsd-t-version-update-all` | Update GSD-T + all registered projects | Manual |
187
+ | `/user:gsd-t-triage-and-merge` | Auto-review, merge, and publish GitHub branches | Manual |
188
+ | `/user:gsd-t-audit` | Harness self-audit analyze cost/benefit of enforcement components | Manual |
189
+
190
+ ### Backlog Management
191
+
192
+ | Command | Purpose | Auto |
193
+ |---------|---------|------|
194
+ | `/user:gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog | Manual |
195
+ | `/user:gsd-t-backlog-list` | Filtered, ordered view of backlog items | Manual |
196
+ | `/user:gsd-t-backlog-move` | Reorder items by position (priority) | Manual |
197
+ | `/user:gsd-t-backlog-edit` | Modify backlog entry fields | Manual |
198
+ | `/user:gsd-t-backlog-remove` | Drop item with optional reason | Manual |
199
+ | `/user:gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow | Manual |
200
+ | `/user:gsd-t-backlog-settings` | Manage types, apps, categories, defaults | Manual |
201
+
202
+ ### Git Helpers
203
+
204
+ | Command | Purpose | Auto |
205
+ |---------|---------|------|
206
+ | `/user:branch` | Create and switch to a new git branch | Manual |
207
+ | `/user:checkin` | Auto-bump version, stage, commit, and push | Manual |
208
+ | `/user:Claude-md` | Reload CLAUDE.md directives mid-session | Manual |
209
+ | `/global-change` | Apply file changes across all registered GSD-T projects | Manual |
210
+
211
+ ---
212
+
213
+ ## Workflow Phases
214
+
215
+ | Phase | Purpose | Solo/Team |
216
+ |-------|---------|-----------|
217
+ | **Prompt** | Formulate idea (pre-workflow) | Solo |
218
+ | **Project/Feature/Scan** | Initialize work | Solo (team for large scans) |
219
+ | **Milestone** | Define deliverable | Solo |
220
+ | **Partition** | Decompose into domains + contracts | Solo |
221
+ | **Discuss** | Explore design decisions | Both |
222
+ | **Plan** | Create atomic task lists | Solo (always) |
223
+ | **Impact** | Downstream effect analysis | Solo |
224
+ | **Execute** | Build it | Both |
225
+ | **Test-Sync** | Maintain test coverage | Solo |
226
+ | **Integrate** | Wire domains together | Solo (always) |
227
+ | **Verify** | Quality gates | Both |
228
+ | **Complete** | Archive + tag | Solo |
229
+
230
+ ---
231
+
232
+ ## Entry Points
233
+
234
+ - **"I have an idea"** → `gsd-t-project` → milestone roadmap → partition → execute
235
+ - **"I have a codebase and need to add something"** → `gsd-t-feature` → impact analysis → milestones
236
+ - **"I have a codebase and need to understand/fix it"** → `gsd-t-scan` → techdebt.md → promote to milestones
237
+
238
+ ---
239
+
240
+ ## Project Structure (What GSD-T Creates)
241
+
242
+ ```
243
+ your-project/
244
+ ├── CLAUDE.md
245
+ ├── docs/
246
+ │ ├── requirements.md # Functional + technical requirements
247
+ │ ├── architecture.md # System design, components, data flow
248
+ │ ├── workflows.md # User journeys, technical processes
249
+ └── infrastructure.md # Dev setup, DB, cloud, deployment
250
+ ├── .gsd-t/
251
+ │ ├── progress.md # Master state file
252
+ │ ├── backlog.md # Captured backlog items (priority ordered)
253
+ │ ├── backlog-settings.md # Types, apps, categories, defaults
254
+ │ ├── roadmap.md # Milestone roadmap
255
+ │ ├── techdebt.md # Technical debt register
256
+ ├── verify-report.md # Latest verification results
257
+ │ ├── impact-report.md # Downstream effect analysis
258
+ ├── test-coverage.md # Test sync report
259
+ │ ├── contracts/
260
+ │ │ ├── api-contract.md
261
+ │ │ ├── schema-contract.md
262
+ ├── component-contract.md
263
+ │ └── integration-points.md
264
+ │ ├── domains/
265
+ │ │ └── {domain-name}/
266
+ │ ├── scope.md
267
+ │ │ ├── tasks.md
268
+ │ │ └── constraints.md
269
+ │ ├── events/ # Execution event stream (JSONL, daily-rotated)
270
+ │ ├── retrospectives/ # Retrospective reports from gsd-t-reflect
271
+ │ ├── milestones/ # Archived completed milestones
272
+ │ │ └── {milestone-name}-{date}/
273
+ │ └── scan/ # Codebase analysis outputs
274
+ └── src/
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Key Principles
280
+
281
+ 1. **Contracts are the source of truth.** Code implements contracts, not the other way around.
282
+ 2. **Domains own files exclusively.** No two domains should modify the same file.
283
+ 3. **Impact before execution.** Always analyze downstream effects before making changes.
284
+ 4. **Tests stay synced.** Every code change triggers test analysis.
285
+ 5. **State survives sessions.** Everything is in `.gsd-t/`.
286
+ 6. **Plan is single-brain, execute is multi-brain.** Planning and integration always solo; execution and verification can parallelize.
287
+ 7. **Every decision is logged.** The Decision Log captures why, not just what.
288
+ 8. **Agents learn from experience.** Every command invocation, phase transition, and subagent spawn is captured as a structured event. Past failures surface before each task (Reflexion pattern). Distillation converts repeated patterns into lasting CLAUDE.md rules.
289
+
290
+ ---
291
+
292
+ ## Security
293
+
294
+ - **Wave mode** spawns phase agents with `bypassPermissions` — agents execute without per-action user approval. Use Level 1 or Level 2 autonomy for sensitive projects to review each phase.
295
+ - **Heartbeat logs** scrub sensitive patterns (passwords, tokens, API keys) from bash commands and mask URL query parameters before writing to `.gsd-t/heartbeat-*.jsonl`.
296
+ - **File write paths** are validated (within `~/.claude/`) and checked for symlinks before writing.
297
+ - **HTTP responses** are bounded at 1MB to prevent memory exhaustion from oversized registry responses.
298
+ - **Directory creation** validates parent path components for symlinks to prevent path traversal.
299
+ - Run `gsd-t doctor` to verify installation integrity. Keep GSD-T updated with `gsd-t update`.
300
+
301
+ ---
302
+
303
+ ## Enabling Agent Teams
304
+
305
+ ```json
306
+ {
307
+ "env": {
308
+ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
309
+ }
310
+ }
311
+ ```
312
+
313
+ Teams are optional — all commands work in solo mode.
314
+
315
+ ---
316
+
317
+ ## Manual Installation (without npm)
318
+
319
+ ```bash
320
+ # Windows
321
+ copy commands\*.md %USERPROFILE%\.claude\commands\
322
+
323
+ # Mac/Linux
324
+ cp commands/*.md ~/.claude/commands/
325
+ ```
326
+
327
+ Verify with: `/user:gsd-t-help`
328
+
329
+ ---
330
+
331
+ ## Repo Contents
332
+
333
+ ```
334
+ get-stuff-done-teams/
335
+ ├── README.md
336
+ ├── package.json
337
+ ├── LICENSE
338
+ ├── bin/
339
+ │ └── gsd-t.js # CLI installer
340
+ ├── commands/ # 51 slash commands
341
+ │ ├── gsd-t-*.md # 45 GSD-T workflow commands
342
+ │ ├── gsd.md # GSD-T smart router
343
+ │ ├── branch.md # Git branch helper
344
+ │ ├── checkin.md # Auto-version + commit/push helper
345
+ └── Claude-md.md # Reload CLAUDE.md directives
346
+ ├── templates/ # Document templates (9 base + stacks/)
347
+ │ ├── CLAUDE-global.md
348
+ │ ├── CLAUDE-project.md
349
+ ├── requirements.md
350
+ ├── architecture.md
351
+ ├── workflows.md
352
+ ├── infrastructure.md
353
+ ├── progress.md
354
+ ├── backlog.md
355
+ │ ├── backlog-settings.md
356
+ └── stacks/ # Stack Rules Engine templates
357
+ ├── _security.md # Universal always injected
358
+ ├── react.md
359
+ ├── typescript.md
360
+ │ └── node-api.md
361
+ ├── scripts/ # Runtime utility scripts (installed to ~/.claude/scripts/)
362
+ ├── gsd-t-tools.js # State CLI (get/set/validate/list)
363
+ ├── gsd-t-statusline.js # Context usage bar
364
+ │ ├── gsd-t-event-writer.js # Structured JSONL event writer
365
+ ├── gsd-t-dashboard-server.js # Zero-dep SSE server for dashboard
366
+ │ └── gsd-t-dashboard.html # React Flow + Dagre real-time dashboard
367
+ ├── examples/
368
+ │ ├── settings.json
369
+ │ └── .gsd-t/
370
+ ├── docs/
371
+ │ ├── GSD-T-README.md # Detailed methodology + usage guide
372
+ │ └── methodology.md
373
+ ```
374
+
375
+ ---
376
+
377
+ ## License
378
+
379
+ MIT