@tekyzinc/gsd-t 2.51.10 → 2.53.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +379 -373
  3. package/bin/component-registry.js +250 -0
  4. package/bin/graph-cgc.js +510 -510
  5. package/bin/graph-indexer.js +147 -147
  6. package/bin/graph-overlay.js +195 -195
  7. package/bin/graph-parsers.js +327 -327
  8. package/bin/graph-query.js +453 -452
  9. package/bin/graph-store.js +154 -154
  10. package/bin/qa-calibrator.js +194 -0
  11. package/bin/scan-data-collector.js +153 -153
  12. package/bin/scan-diagrams-generators.js +187 -187
  13. package/bin/scan-diagrams.js +79 -79
  14. package/bin/scan-renderer.js +92 -92
  15. package/bin/scan-report-sections.js +121 -121
  16. package/bin/scan-report.js +184 -184
  17. package/bin/scan-schema-parsers.js +199 -199
  18. package/bin/scan-schema.js +103 -103
  19. package/bin/token-budget.js +246 -0
  20. package/commands/Claude-md.md +10 -10
  21. package/commands/branch.md +15 -15
  22. package/commands/checkin.md +45 -45
  23. package/commands/global-change.md +209 -209
  24. package/commands/gsd-t-audit.md +199 -0
  25. package/commands/gsd-t-backlog-add.md +94 -94
  26. package/commands/gsd-t-backlog-edit.md +111 -111
  27. package/commands/gsd-t-backlog-list.md +63 -63
  28. package/commands/gsd-t-backlog-move.md +94 -94
  29. package/commands/gsd-t-backlog-promote.md +123 -123
  30. package/commands/gsd-t-backlog-remove.md +86 -86
  31. package/commands/gsd-t-backlog-settings.md +158 -158
  32. package/commands/gsd-t-complete-milestone.md +528 -515
  33. package/commands/gsd-t-debug.md +506 -482
  34. package/commands/gsd-t-discuss.md +174 -174
  35. package/commands/gsd-t-execute.md +758 -715
  36. package/commands/gsd-t-feature.md +276 -276
  37. package/commands/gsd-t-health.md +142 -142
  38. package/commands/gsd-t-help.md +465 -457
  39. package/commands/gsd-t-impact.md +302 -302
  40. package/commands/gsd-t-init-scan-setup.md +1 -5
  41. package/commands/gsd-t-init.md +314 -280
  42. package/commands/gsd-t-integrate.md +365 -333
  43. package/commands/gsd-t-milestone.md +87 -87
  44. package/commands/gsd-t-partition.md +442 -361
  45. package/commands/gsd-t-pause.md +82 -82
  46. package/commands/gsd-t-plan.md +345 -344
  47. package/commands/gsd-t-populate.md +111 -111
  48. package/commands/gsd-t-prd.md +326 -326
  49. package/commands/gsd-t-project.md +211 -211
  50. package/commands/gsd-t-promote-debt.md +123 -123
  51. package/commands/gsd-t-prompt.md +137 -137
  52. package/commands/gsd-t-qa.md +266 -266
  53. package/commands/gsd-t-quick.md +357 -315
  54. package/commands/gsd-t-reflect.md +134 -134
  55. package/commands/gsd-t-resume.md +72 -72
  56. package/commands/gsd-t-scan.md +615 -615
  57. package/commands/gsd-t-setup.md +76 -0
  58. package/commands/gsd-t-status.md +192 -166
  59. package/commands/gsd-t-test-sync.md +381 -381
  60. package/commands/gsd-t-triage-and-merge.md +171 -171
  61. package/commands/gsd-t-verify.md +382 -382
  62. package/commands/gsd-t-visualize.md +118 -118
  63. package/commands/gsd-t-wave.md +401 -378
  64. package/docs/GSD-T-README.md +425 -424
  65. package/docs/architecture.md +385 -369
  66. package/docs/harness-design-analysis.md +371 -0
  67. package/docs/infrastructure.md +205 -205
  68. package/docs/prd-graph-engine.md +398 -398
  69. package/docs/prd-gsd2-hybrid.md +559 -559
  70. package/docs/prd-harness-evolution.md +583 -0
  71. package/docs/requirements.md +14 -0
  72. package/docs/workflows.md +226 -226
  73. package/examples/.gsd-t/domains/example-domain/scope.md +13 -13
  74. package/package.json +40 -40
  75. package/scripts/gsd-t-auto-route.js +39 -39
  76. package/scripts/gsd-t-dashboard-mockup.html +1143 -1143
  77. package/scripts/gsd-t-dashboard-server.js +171 -171
  78. package/scripts/gsd-t-dashboard.html +262 -262
  79. package/scripts/gsd-t-event-writer.js +128 -128
  80. package/scripts/gsd-t-statusline.js +94 -94
  81. package/scripts/gsd-t-tools.js +175 -175
  82. package/templates/CLAUDE-global.md +638 -634
  83. package/templates/CLAUDE-project.md +24 -0
  84. package/templates/backlog-settings.md +18 -18
  85. package/templates/backlog.md +1 -1
  86. package/templates/progress.md +40 -40
  87. package/templates/shared-services-contract.md +60 -60
  88. package/templates/stacks/desktop.ini +2 -2
  89. package/bin/desktop.ini +0 -2
  90. package/commands/desktop.ini +0 -2
  91. package/docs/ci-examples/desktop.ini +0 -2
  92. package/docs/desktop.ini +0 -2
  93. package/examples/.gsd-t/contracts/desktop.ini +0 -2
  94. package/examples/.gsd-t/desktop.ini +0 -2
  95. package/examples/.gsd-t/domains/desktop.ini +0 -2
  96. package/examples/.gsd-t/domains/example-domain/desktop.ini +0 -2
  97. package/examples/desktop.ini +0 -2
  98. package/examples/rules/desktop.ini +0 -2
  99. package/scripts/desktop.ini +0 -2
  100. package/templates/desktop.ini +0 -2
package/README.md CHANGED
@@ -1,373 +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
- | *Red Team* | Adversarial QA finds bugs the builder missed (inverted incentives) | Auto-spawned |
160
- | `/user:gsd-t-doc-ripple` | Automated document ripple — update downstream docs after code changes | Auto-spawned |
161
- | `/user:gsd-t-integrate` | Wire domains together | In wave |
162
- | `/user:gsd-t-verify` | Run quality gates + goal-backward behavior verification | In wave |
163
- | `/user:gsd-t-complete-milestone` | Archive + git tag (goal-backward gate required) | In wave |
164
-
165
- ### Automation & Utilities
166
-
167
- | Command | Purpose | Auto |
168
- |---------|---------|------|
169
- | `/user:gsd-t-wave` | Full cycle, auto-advances all phases | Manual |
170
- | `/user:gsd-t-status` | Cross-domain progress view with token breakdown by domain/task/phase | Manual |
171
- | `/user:gsd-t-resume` | Restore context, continue | Manual |
172
- | `/user:gsd-t-quick` | Fast task with GSD-T guarantees | Manual |
173
- | `/user:gsd-t-reflect` | Generate retrospective from event stream, propose memory updates | Manual |
174
- | `/user:gsd-t-visualize` | Launch browser dashboard SSE server + React Flow agent visualization | Manual |
175
- | `/user:gsd-t-debug` | Systematic debugging with state | Manual |
176
- | `/user:gsd-t-metrics` | View task telemetry, process ELO, signal distribution, domain health, and cross-project comparison (`--cross-project`) | Manual |
177
- | `/user:gsd-t-health` | Validate .gsd-t/ structure, optionally repair | Manual |
178
- | `/user:gsd-t-pause` | Save exact position for reliable resume | Manual |
179
- | `/user:gsd-t-log` | Sync progress Decision Log with recent git activity | Manual |
180
- | `/user:gsd-t-version-update` | Update GSD-T to latest version | Manual |
181
- | `/user:gsd-t-version-update-all` | Update GSD-T + all registered projects | Manual |
182
- | `/user:gsd-t-triage-and-merge` | Auto-review, merge, and publish GitHub branches | Manual |
183
-
184
- ### Backlog Management
185
-
186
- | Command | Purpose | Auto |
187
- |---------|---------|------|
188
- | `/user:gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog | Manual |
189
- | `/user:gsd-t-backlog-list` | Filtered, ordered view of backlog items | Manual |
190
- | `/user:gsd-t-backlog-move` | Reorder items by position (priority) | Manual |
191
- | `/user:gsd-t-backlog-edit` | Modify backlog entry fields | Manual |
192
- | `/user:gsd-t-backlog-remove` | Drop item with optional reason | Manual |
193
- | `/user:gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow | Manual |
194
- | `/user:gsd-t-backlog-settings` | Manage types, apps, categories, defaults | Manual |
195
-
196
- ### Git Helpers
197
-
198
- | Command | Purpose | Auto |
199
- |---------|---------|------|
200
- | `/user:branch` | Create and switch to a new git branch | Manual |
201
- | `/user:checkin` | Auto-bump version, stage, commit, and push | Manual |
202
- | `/user:Claude-md` | Reload CLAUDE.md directives mid-session | Manual |
203
- | `/global-change` | Apply file changes across all registered GSD-T projects | Manual |
204
-
205
- ---
206
-
207
- ## Workflow Phases
208
-
209
- | Phase | Purpose | Solo/Team |
210
- |-------|---------|-----------|
211
- | **Prompt** | Formulate idea (pre-workflow) | Solo |
212
- | **Project/Feature/Scan** | Initialize work | Solo (team for large scans) |
213
- | **Milestone** | Define deliverable | Solo |
214
- | **Partition** | Decompose into domains + contracts | Solo |
215
- | **Discuss** | Explore design decisions | Both |
216
- | **Plan** | Create atomic task lists | Solo (always) |
217
- | **Impact** | Downstream effect analysis | Solo |
218
- | **Execute** | Build it | Both |
219
- | **Test-Sync** | Maintain test coverage | Solo |
220
- | **Integrate** | Wire domains together | Solo (always) |
221
- | **Verify** | Quality gates | Both |
222
- | **Complete** | Archive + tag | Solo |
223
-
224
- ---
225
-
226
- ## Entry Points
227
-
228
- - **"I have an idea"** `gsd-t-project` milestone roadmap partition → execute
229
- - **"I have a codebase and need to add something"** → `gsd-t-feature` → impact analysis → milestones
230
- - **"I have a codebase and need to understand/fix it"** → `gsd-t-scan` → techdebt.md → promote to milestones
231
-
232
- ---
233
-
234
- ## Project Structure (What GSD-T Creates)
235
-
236
- ```
237
- your-project/
238
- ├── CLAUDE.md
239
- ├── docs/
240
- │ ├── requirements.md # Functional + technical requirements
241
- │ ├── architecture.md # System design, components, data flow
242
- │ ├── workflows.md # User journeys, technical processes
243
- │ └── infrastructure.md # Dev setup, DB, cloud, deployment
244
- ├── .gsd-t/
245
- ├── progress.md # Master state file
246
- │ ├── backlog.md # Captured backlog items (priority ordered)
247
- │ ├── backlog-settings.md # Types, apps, categories, defaults
248
- │ ├── roadmap.md # Milestone roadmap
249
- ├── techdebt.md # Technical debt register
250
- ├── verify-report.md # Latest verification results
251
- │ ├── impact-report.md # Downstream effect analysis
252
- │ ├── test-coverage.md # Test sync report
253
- │ ├── contracts/
254
- ├── api-contract.md
255
- ├── schema-contract.md
256
- ├── component-contract.md
257
- │ └── integration-points.md
258
- │ ├── domains/
259
- │ └── {domain-name}/
260
- │ │ ├── scope.md
261
- │ │ ├── tasks.md
262
- │ │ └── constraints.md
263
- ├── events/ # Execution event stream (JSONL, daily-rotated)
264
- │ ├── retrospectives/ # Retrospective reports from gsd-t-reflect
265
- ├── milestones/ # Archived completed milestones
266
- │ │ └── {milestone-name}-{date}/
267
- └── scan/ # Codebase analysis outputs
268
- └── src/
269
- ```
270
-
271
- ---
272
-
273
- ## Key Principles
274
-
275
- 1. **Contracts are the source of truth.** Code implements contracts, not the other way around.
276
- 2. **Domains own files exclusively.** No two domains should modify the same file.
277
- 3. **Impact before execution.** Always analyze downstream effects before making changes.
278
- 4. **Tests stay synced.** Every code change triggers test analysis.
279
- 5. **State survives sessions.** Everything is in `.gsd-t/`.
280
- 6. **Plan is single-brain, execute is multi-brain.** Planning and integration always solo; execution and verification can parallelize.
281
- 7. **Every decision is logged.** The Decision Log captures why, not just what.
282
- 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.
283
-
284
- ---
285
-
286
- ## Security
287
-
288
- - **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.
289
- - **Heartbeat logs** scrub sensitive patterns (passwords, tokens, API keys) from bash commands and mask URL query parameters before writing to `.gsd-t/heartbeat-*.jsonl`.
290
- - **File write paths** are validated (within `~/.claude/`) and checked for symlinks before writing.
291
- - **HTTP responses** are bounded at 1MB to prevent memory exhaustion from oversized registry responses.
292
- - **Directory creation** validates parent path components for symlinks to prevent path traversal.
293
- - Run `gsd-t doctor` to verify installation integrity. Keep GSD-T updated with `gsd-t update`.
294
-
295
- ---
296
-
297
- ## Enabling Agent Teams
298
-
299
- ```json
300
- {
301
- "env": {
302
- "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
303
- }
304
- }
305
- ```
306
-
307
- Teams are optional — all commands work in solo mode.
308
-
309
- ---
310
-
311
- ## Manual Installation (without npm)
312
-
313
- ```bash
314
- # Windows
315
- copy commands\*.md %USERPROFILE%\.claude\commands\
316
-
317
- # Mac/Linux
318
- cp commands/*.md ~/.claude/commands/
319
- ```
320
-
321
- Verify with: `/user:gsd-t-help`
322
-
323
- ---
324
-
325
- ## Repo Contents
326
-
327
- ```
328
- get-stuff-done-teams/
329
- ├── README.md
330
- ├── package.json
331
- ├── LICENSE
332
- ├── bin/
333
- │ └── gsd-t.js # CLI installer
334
- ├── commands/ # 51 slash commands
335
- ├── gsd-t-*.md # 45 GSD-T workflow commands
336
- ├── gsd.md # GSD-T smart router
337
- ├── branch.md # Git branch helper
338
- ├── checkin.md # Auto-version + commit/push helper
339
- │ └── Claude-md.md # Reload CLAUDE.md directives
340
- ├── templates/ # Document templates (9 base + stacks/)
341
- │ ├── CLAUDE-global.md
342
- │ ├── CLAUDE-project.md
343
- │ ├── requirements.md
344
- │ ├── architecture.md
345
- ├── workflows.md
346
- ├── infrastructure.md
347
- │ ├── progress.md
348
- │ ├── backlog.md
349
- │ ├── backlog-settings.md
350
- └── stacks/ # Stack Rules Engine templates
351
- ├── _security.md # Universal — always injected
352
- ├── react.md
353
- ├── typescript.md
354
- └── node-api.md
355
- ├── scripts/ # Runtime utility scripts (installed to ~/.claude/scripts/)
356
- ├── gsd-t-tools.js # State CLI (get/set/validate/list)
357
- ├── gsd-t-statusline.js # Context usage bar
358
- ├── gsd-t-event-writer.js # Structured JSONL event writer
359
- ├── gsd-t-dashboard-server.js # Zero-dep SSE server for dashboard
360
- └── gsd-t-dashboard.html # React Flow + Dagre real-time dashboard
361
- ├── examples/
362
- │ ├── settings.json
363
- └── .gsd-t/
364
- ├── docs/
365
- │ ├── GSD-T-README.md # Detailed methodology + usage guide
366
- │ └── methodology.md
367
- ```
368
-
369
- ---
370
-
371
- ## License
372
-
373
- 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