@tekyzinc/gsd-t 2.24.7 → 2.28.12

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 CHANGED
@@ -2,6 +2,66 @@
2
2
 
3
3
  All notable changes to GSD-T are documented here. Updated with each release.
4
4
 
5
+ ## [2.28.10] - 2026-02-18
6
+
7
+ ### Added
8
+ - **Milestone 13: Tooling & UX** — Infrastructure and UX improvements:
9
+ - **`scripts/gsd-t-tools.js`**: New zero-dependency Node.js CLI utility returning compact JSON. Subcommands: `state get/set` (read/write progress.md keys), `validate` (check required files), `parse progress --section` (extract named sections), `list domains|contracts`, `git pre-commit-check` (branch/status/last-commit), `template scope|tasks <domain>`
10
+ - **`scripts/gsd-t-statusline.js`**: New statusline script for Claude Code. Reads GSD-T project state and optionally reads `CLAUDE_CONTEXT_TOKENS_USED`/`CLAUDE_CONTEXT_TOKENS_MAX` env vars to show a color-coded context usage bar (green→yellow→orange→red). Configure via `"statusLine": "node ~/.claude/scripts/gsd-t-statusline.js"` in `settings.json`
11
+ - **`gsd-t-health`**: New slash command validating `.gsd-t/` project structure. Checks all required files, directories, version consistency, status validity, contract integrity, and domain integrity. `--repair` creates any missing files from templates. Reports HEALTHY / DEGRADED / BROKEN
12
+ - **`gsd-t-pause`**: New slash command saving exact position to `.gsd-t/continue-here-{timestamp}.md` with milestone, phase, domain, task, last completed action, next action, and open items
13
+ - Both scripts automatically installed to `~/.claude/scripts/` during `npx @tekyzinc/gsd-t install/update`
14
+
15
+ ### Changed
16
+ - **`gsd-t-resume`**: Now reads the most recent `.gsd-t/continue-here-*.md` file (if present) as the primary resume point before falling back to `progress.md`. Deletes the continue-here file after consuming it
17
+ - **`gsd-t-plan`**: Wave Execution Groups added to `integration-points.md` format — groups tasks into parallel-safe waves with checkpoints between them. Wave rules: same-wave tasks share no files and have no dependencies; different-wave tasks depend on each other's output or modify shared files
18
+ - **`gsd-t-execute`**: Reads Wave Execution Groups from `integration-points.md` and executes wave-by-wave. Tasks within a wave are parallel-safe; checkpoints between waves verify contract compliance before proceeding. Team mode now spawns teammates only within the same wave
19
+ - **`gsd-t-health`** and **`gsd-t-pause`** added to all reference files (help, README, GSD-T-README, CLAUDE-global template, user CLAUDE.md)
20
+ - Total command count: 43 → **45** (41 GSD-T workflow + 4 utility)
21
+
22
+ ## [2.27.10] - 2026-02-18
23
+
24
+ ### Changed
25
+ - **Milestone 12: Planning Intelligence** — Three improvements to correctness across milestones:
26
+ - **CONTEXT.md from discuss**: `gsd-t-discuss` now creates `.gsd-t/CONTEXT.md` with three sections — Locked Decisions (plan must implement exactly), Deferred Ideas (plan must NOT implement), and Claude's Discretion (free to decide). New Step 5 added to discuss; steps renumbered
27
+ - **Plan fidelity enforcement**: `gsd-t-plan` reads CONTEXT.md and maps every Locked Decision to at least one task. Also produces a REQ-ID → domain/task traceability table in `docs/requirements.md`
28
+ - **Plan validation checker**: A Task subagent validates the plan after creation — checks REQ coverage, Locked Decision mapping, task completeness, cross-domain dependencies, and contract existence. Max 3 fix iterations before stopping
29
+ - **Requirements close-out in verify**: `gsd-t-verify` marks matched requirements as `complete` in the traceability table and reports orphaned requirements and unanchored tasks
30
+
31
+ ## [2.26.10] - 2026-02-18
32
+
33
+ ### Changed
34
+ - **Milestone 11: Execution Quality** — Three improvements to execution reliability:
35
+ - **Deviation Rules**: `execute`, `quick`, and `debug` now include a 4-rule deviation protocol — auto-fix bugs (3-attempt limit), add minimum missing dependencies, fix blockers, and STOP for architectural changes. Failed attempts log to `.gsd-t/deferred-items.md`
36
+ - **Atomic per-task commits**: `execute` now commits after each task using `feat({domain}/task-{N}): {description}` format instead of batching at phase end. Team mode instructions updated with the same requirement
37
+ - **Wave spot-check**: Between-phase verification in `wave` now checks git log (commits present), filesystem (output files exist), and FAILED markers in progress.md — not just agent-reported status
38
+
39
+ ## [2.25.10] - 2026-02-18
40
+
41
+ ### Changed
42
+ - **Milestone 10: Token Efficiency** — QA overhead significantly reduced across all phases:
43
+ - `partition` and `plan`: QA spawn removed (no code produced in these phases)
44
+ - `test-sync`, `verify`, `complete-milestone`: contract testing and gap analysis performed inline (no QA teammate)
45
+ - `execute`, `integrate`: QA now spawned via lightweight Task subagent instead of TeamCreate teammate
46
+ - `quick`, `debug`: QA spawn removed; tests run inline in the existing Test & Verify step; both commands now self-spawn as Task subagents (Step 0) for fresh context windows
47
+ - `scan`, `status`: wrap themselves as Task subagents for fresh context on each invocation
48
+ - Global CLAUDE.md QA Mandatory section updated to reflect the new per-command QA method
49
+
50
+ ## [2.24.10] - 2026-02-18
51
+
52
+ ### Changed
53
+ - **Versioning scheme: patch numbers are always 2 digits**: Patch segment now starts at 10 (not 0) after any minor or major reset. Incrementing continues normally (10→11→12…). Semver validity is preserved — no leading zeros. `checkin.md` and `gsd-t-complete-milestone.md` updated with the new convention. `gsd-t-init` will initialize new projects at `0.1.10`
54
+
55
+ ## [2.24.9] - 2026-02-18
56
+
57
+ ### Changed
58
+ - **Default model**: Example settings.json updated from `claude-opus-4-6` to `claude-sonnet-4-6` (faster, lower token usage)
59
+
60
+ ## [2.24.8] - 2026-02-18
61
+
62
+ ### Fixed
63
+ - **CLAUDE.md update no longer overwrites user content**: Installer now uses marker-based merging (`<!-- GSD-T:START -->` / `<!-- GSD-T:END -->`). Updates only replace the GSD-T section between markers, preserving all user customizations. Existing installs without markers are auto-migrated. Backup still created for reference
64
+
5
65
  ## [2.24.7] - 2026-02-18
6
66
 
7
67
  ### Changed
package/README.md CHANGED
@@ -18,7 +18,7 @@ A methodology for reliable, parallelizable development using Claude Code with op
18
18
  npx @tekyzinc/gsd-t install
19
19
  ```
20
20
 
21
- This installs 39 GSD-T commands + 4 utility commands (43 total) to `~/.claude/commands/` and the global CLAUDE.md to `~/.claude/CLAUDE.md`. Works on Windows, Mac, and Linux.
21
+ This installs 41 GSD-T commands + 4 utility commands (45 total) to `~/.claude/commands/` and the global CLAUDE.md to `~/.claude/CLAUDE.md`. Works on Windows, Mac, and Linux.
22
22
 
23
23
  ### Start Using It
24
24
 
@@ -143,6 +143,8 @@ This will replace changed command files, back up your CLAUDE.md if customized, a
143
143
  | `/user:gsd-t-resume` | Restore context, continue | Manual |
144
144
  | `/user:gsd-t-quick` | Fast task with GSD-T guarantees | Manual |
145
145
  | `/user:gsd-t-debug` | Systematic debugging with state | Manual |
146
+ | `/user:gsd-t-health` | Validate .gsd-t/ structure, optionally repair | Manual |
147
+ | `/user:gsd-t-pause` | Save exact position for reliable resume | Manual |
146
148
  | `/user:gsd-t-log` | Sync progress Decision Log with recent git activity | Manual |
147
149
  | `/user:gsd-t-version-update` | Update GSD-T to latest version | Manual |
148
150
  | `/user:gsd-t-version-update-all` | Update GSD-T + all registered projects | Manual |
@@ -294,8 +296,8 @@ get-stuff-done-teams/
294
296
  ├── LICENSE
295
297
  ├── bin/
296
298
  │ └── gsd-t.js # CLI installer
297
- ├── commands/ # 43 slash commands
298
- │ ├── gsd-t-*.md # 39 GSD-T workflow commands
299
+ ├── commands/ # 45 slash commands
300
+ │ ├── gsd-t-*.md # 41 GSD-T workflow commands
299
301
  │ ├── gsd.md # GSD-T smart router
300
302
  │ ├── branch.md # Git branch helper
301
303
  │ ├── checkin.md # Auto-version + commit/push helper
package/bin/gsd-t.js CHANGED
@@ -456,6 +456,26 @@ function configureUpdateCheckHook(scriptPath) {
456
456
  }
457
457
  }
458
458
 
459
+ // ─── Utility Scripts ─────────────────────────────────────────────────────────
460
+
461
+ const UTILITY_SCRIPTS = ["gsd-t-tools.js", "gsd-t-statusline.js"];
462
+
463
+ function installUtilityScripts() {
464
+ ensureDir(SCRIPTS_DIR);
465
+ for (const script of UTILITY_SCRIPTS) {
466
+ const src = path.join(PKG_SCRIPTS, script);
467
+ const dest = path.join(SCRIPTS_DIR, script);
468
+ if (!fs.existsSync(src)) continue;
469
+ const srcContent = fs.readFileSync(src, "utf8");
470
+ const destContent = fs.existsSync(dest) ? fs.readFileSync(dest, "utf8") : "";
471
+ if (normalizeEol(srcContent) !== normalizeEol(destContent)) {
472
+ copyFile(src, dest, script);
473
+ } else {
474
+ info(`${script} unchanged`);
475
+ }
476
+ }
477
+ }
478
+
459
479
  // ─── Commands ────────────────────────────────────────────────────────────────
460
480
 
461
481
  function installCommands(isUpdate) {
@@ -483,47 +503,80 @@ function installCommands(isUpdate) {
483
503
  return { gsdtCommands, utilityCommands };
484
504
  }
485
505
 
506
+ const GSDT_START = "<!-- GSD-T:START";
507
+ const GSDT_END = "<!-- GSD-T:END";
508
+
486
509
  function installGlobalClaudeMd(isUpdate) {
487
510
  heading("Global CLAUDE.md");
488
511
  const globalSrc = path.join(PKG_TEMPLATES, "CLAUDE-global.md");
489
512
 
490
513
  if (!fs.existsSync(GLOBAL_CLAUDE_MD)) {
491
- copyFile(globalSrc, GLOBAL_CLAUDE_MD, "CLAUDE.md installed → ~/.claude/CLAUDE.md");
514
+ copyFile(globalSrc, GLOBAL_CLAUDE_MD, "CLAUDE.md installed");
515
+ return;
516
+ }
517
+
518
+ if (isSymlink(GLOBAL_CLAUDE_MD)) {
519
+ warn("Skipping CLAUDE.md — target is a symlink");
492
520
  return;
493
521
  }
494
522
 
495
523
  const existing = fs.readFileSync(GLOBAL_CLAUDE_MD, "utf8");
496
- if (existing.includes("GSD-T: Contract-Driven Development")) {
497
- updateExistingGlobalClaudeMd(globalSrc, existing, isUpdate);
524
+ const template = fs.readFileSync(globalSrc, "utf8");
525
+
526
+ if (existing.includes(GSDT_START)) {
527
+ mergeGsdtSection(existing, template, isUpdate);
528
+ } else if (existing.includes("GSD-T: Contract-Driven Development")) {
529
+ migrateToMarkers(existing, template);
498
530
  } else {
499
- appendGsdtToClaudeMd(globalSrc);
531
+ appendGsdtToClaudeMd(template);
500
532
  }
501
533
  }
502
534
 
503
- function updateExistingGlobalClaudeMd(globalSrc, existing, isUpdate) {
535
+ function mergeGsdtSection(existing, template, isUpdate) {
504
536
  if (!isUpdate) {
505
- info("CLAUDE.md already contains GSD-T config — skipping");
506
- info("Run 'gsd-t update' to overwrite with latest version");
537
+ info("CLAUDE.md already contains GSD-T config");
507
538
  return;
508
539
  }
509
- const template = fs.readFileSync(globalSrc, "utf8");
510
- if (normalizeEol(existing) === normalizeEol(template)) {
511
- copyFile(globalSrc, GLOBAL_CLAUDE_MD, "CLAUDE.md updated (no customizations detected)");
540
+ const startIdx = existing.indexOf(GSDT_START);
541
+ const endMarkerIdx = existing.indexOf(GSDT_END);
542
+ if (startIdx === -1 || endMarkerIdx === -1) {
543
+ warn("GSD-T markers incomplete — appending fresh copy");
544
+ appendGsdtToClaudeMd(template);
545
+ return;
546
+ }
547
+ const endLineEnd = existing.indexOf("\n", endMarkerIdx);
548
+ const endIdx = endLineEnd === -1 ? existing.length : endLineEnd + 1;
549
+ const before = existing.substring(0, startIdx);
550
+ const after = existing.substring(endIdx);
551
+ const merged = before + template.trimEnd() + "\n" + after;
552
+ if (normalizeEol(merged) === normalizeEol(existing)) {
553
+ info("CLAUDE.md GSD-T section already up to date");
512
554
  return;
513
555
  }
514
556
  const backupPath = GLOBAL_CLAUDE_MD + ".backup-" + Date.now();
515
- if (!isSymlink(backupPath)) fs.copyFileSync(GLOBAL_CLAUDE_MD, backupPath);
516
- else warn("Skipping backup — target is a symlink");
517
- copyFile(globalSrc, GLOBAL_CLAUDE_MD, "CLAUDE.md updated");
518
- warn(`Previous version backed up to ${path.basename(backupPath)}`);
519
- info("Review the backup if you had custom additions to merge back in.");
520
- }
521
-
522
- function appendGsdtToClaudeMd(globalSrc) {
523
- if (isSymlink(GLOBAL_CLAUDE_MD)) { warn("Skipping CLAUDE.md append — target is a symlink"); return; }
524
- const gsdtContent = fs.readFileSync(globalSrc, "utf8");
525
- const separator = "\n\n# ─── GSD-T Section (added by installer) ───\n\n";
526
- fs.appendFileSync(GLOBAL_CLAUDE_MD, separator + gsdtContent);
557
+ fs.copyFileSync(GLOBAL_CLAUDE_MD, backupPath);
558
+ fs.writeFileSync(GLOBAL_CLAUDE_MD, merged);
559
+ success("CLAUDE.md GSD-T section updated (custom content preserved)");
560
+ }
561
+
562
+ function migrateToMarkers(existing, template) {
563
+ const backupPath = GLOBAL_CLAUDE_MD + ".backup-" + Date.now();
564
+ fs.copyFileSync(GLOBAL_CLAUDE_MD, backupPath);
565
+ const sepIdx = existing.indexOf("# ─── GSD-T Section");
566
+ if (sepIdx !== -1) {
567
+ const before = existing.substring(0, sepIdx);
568
+ const merged = before + template.trimEnd() + "\n";
569
+ fs.writeFileSync(GLOBAL_CLAUDE_MD, merged);
570
+ } else {
571
+ fs.writeFileSync(GLOBAL_CLAUDE_MD, template);
572
+ }
573
+ success("CLAUDE.md migrated to marker-based format");
574
+ info("Backup saved: " + path.basename(backupPath));
575
+ }
576
+
577
+ function appendGsdtToClaudeMd(template) {
578
+ const separator = "\n\n";
579
+ fs.appendFileSync(GLOBAL_CLAUDE_MD, separator + template.trimEnd() + "\n");
527
580
  success("GSD-T config appended to existing CLAUDE.md");
528
581
  info("Your existing content was preserved.");
529
582
  }
@@ -543,6 +596,9 @@ function doInstall(opts = {}) {
543
596
 
544
597
  heading("Update Check (Session Start)");
545
598
  installUpdateCheck();
599
+
600
+ heading("Utility Scripts");
601
+ installUtilityScripts();
546
602
  saveInstalledVersion();
547
603
 
548
604
  showInstallSummary(gsdtCommands.length, utilityCommands.length);
@@ -1317,7 +1373,8 @@ module.exports = {
1317
1373
  checkDoctorClaudeMd,
1318
1374
  checkDoctorSettings,
1319
1375
  checkDoctorEncoding,
1320
- updateExistingGlobalClaudeMd,
1376
+ mergeGsdtSection,
1377
+ migrateToMarkers,
1321
1378
  appendGsdtToClaudeMd,
1322
1379
  readSettingsJson,
1323
1380
  readUpdateCache,
@@ -16,7 +16,11 @@ Automatically stage, commit, and push all updated files to GitHub with automatic
16
16
  - **minor**: New features, new commands, new capabilities
17
17
  - **major**: Breaking changes, major rework, incompatible API changes
18
18
  6. Read the current version from `package.json`
19
- 7. Bump the version according to the determined type (e.g., `2.3.0` → `2.3.1` for patch)
19
+ 7. Bump the version according to the determined type:
20
+ - **patch**: increment patch by 1 (e.g., `2.24.10` → `2.24.11`)
21
+ - **minor**: increment minor, reset patch to **10** (e.g., `2.24.11` → `2.25.10`)
22
+ - **major**: increment major, reset minor to 0, reset patch to **10** (e.g., `2.24.11` → `3.0.10`)
23
+ - **Patch numbers are always 2 digits (≥10).** After any minor/major reset, start at 10, never 0 or 1.
20
24
  8. Update the version in `package.json`
21
25
  9. If `.gsd-t/progress.md` exists, check for a `## Version` line and update it (or add one after the `## Date` line)
22
26
 
@@ -111,9 +111,10 @@ GSD-T tracks project version in `.gsd-t/progress.md` using semantic versioning:
111
111
  Determine the version bump based on the milestone:
112
112
  1. Read current version from `.gsd-t/progress.md`
113
113
  2. Assess milestone scope:
114
- - Was this a major/breaking milestone? → bump **major**, reset minor and patch to 0
115
- - Was this a feature milestone? → bump **minor**, reset patch to 0
116
- - Was this a bugfix/cleanup/debt milestone? → bump **patch**
114
+ - Was this a major/breaking milestone? → bump **major**, reset minor to 0, reset patch to **10**
115
+ - Was this a feature milestone? → bump **minor**, reset patch to **10**
116
+ - Was this a bugfix/cleanup/debt milestone? → bump **patch** (increment by 1)
117
+ - **Patch numbers are always 2 digits (≥10).** After any minor/major reset, start at 10, never 0 or 1.
117
118
  3. Update version in `.gsd-t/progress.md`
118
119
  4. If a package manifest exists (`package.json`, `pyproject.toml`, `Cargo.toml`, etc.), update its version to match
119
120
  5. Update `README.md` version badge or version reference if present
@@ -175,20 +176,9 @@ Before creating the git tag, verify all documentation is up to date:
175
176
 
176
177
  ### This is the LAST GATE before tagging — nothing should be undocumented.
177
178
 
178
- ## Step 10: Spawn QA Agent and Test Verification
179
+ ## Step 10: Test Verification
179
180
 
180
- Before creating the git tag, spawn the QA teammate for a final test audit:
181
-
182
- ```
183
- Teammate "qa": Read commands/gsd-t-qa.md for your full instructions.
184
- Phase context: complete-milestone. Read .gsd-t/contracts/ for contract definitions.
185
- Run final test audit before milestone archive. Verify all contract tests pass.
186
- Report: final test pass/fail counts and any unresolved gaps.
187
- ```
188
-
189
- Wait for QA agent to complete. QA failure blocks milestone completion.
190
-
191
- Then verify the milestone is truly complete:
181
+ Verify the milestone is truly complete:
192
182
 
193
183
  1. **Run the full test suite**: Execute ALL tests — unit, integration, and E2E
194
184
  2. **Run Playwright E2E** (if configured): Detect `playwright.config.*` or Playwright in dependencies. If present, run the full Playwright suite. If specs are missing or stale, invoke `gsd-t-test-sync` first.
@@ -2,6 +2,23 @@
2
2
 
3
3
  You are debugging an issue in a contract-driven project. Your approach should identify whether the bug is within a domain or at a contract boundary.
4
4
 
5
+ ## Step 0: Launch via Subagent
6
+
7
+ To give this debug session a fresh context window and prevent compaction, always execute via a Task subagent.
8
+
9
+ **If you are the orchestrating agent** (you received the slash command directly):
10
+ Spawn a fresh subagent using the Task tool:
11
+ ```
12
+ subagent_type: general-purpose
13
+ prompt: "You are running gsd-t-debug for this issue: {$ARGUMENTS}
14
+ Working directory: {current project root}
15
+ Read CLAUDE.md and .gsd-t/progress.md for project context, then execute gsd-t-debug starting at Step 1."
16
+ ```
17
+ Wait for the subagent to complete. Relay its summary to the user. **Do not execute Steps 1–5 yourself.**
18
+
19
+ **If you are the spawned subagent** (your prompt says "starting at Step 1"):
20
+ Continue to Step 1 below.
21
+
5
22
  ## Step 1: Load Context
6
23
 
7
24
  Read:
@@ -40,20 +57,17 @@ The contract didn't specify something it should have. Symptoms:
40
57
 
41
58
  → Update the contract, then fix implementations on both sides.
42
59
 
43
- ## Step 3: Spawn QA Agent
44
-
45
- Spawn the QA teammate to handle regression testing:
60
+ ## Step 3: Debug (Solo or Team)
46
61
 
47
- ```
48
- Teammate "qa": Read commands/gsd-t-qa.md for your full instructions.
49
- Phase context: debug. Read .gsd-t/contracts/ for relevant contracts.
50
- Write a regression test for the bug once root cause is identified.
51
- Report: regression test status and related test coverage.
52
- ```
62
+ ### Deviation Rules
53
63
 
54
- QA failure blocks the commit.
64
+ When you encounter unexpected situations during the fix:
65
+ 1. **Related bug found while tracing** → Fix it immediately (up to 3 attempts). Log to `.gsd-t/deferred-items.md` if it recurs.
66
+ 2. **Missing functionality required for the fix** → Add minimum needed. Note in commit message.
67
+ 3. **Blocker (missing file, wrong API response)** → Fix blocker and continue. Log if non-trivial.
68
+ 4. **Architectural change required to fix correctly** → STOP. Explain what exists, what needs to change, what breaks, and a migration path. Wait for user approval. Never self-approve.
55
69
 
56
- ## Step 4: Debug (Solo or Team)
70
+ **3-attempt limit**: If your fix doesn't work after 3 attempts, log to `.gsd-t/deferred-items.md` and stop trying.
57
71
 
58
72
  ### Solo Mode
59
73
  1. Reproduce the issue
@@ -77,7 +91,7 @@ Create an agent team to debug:
77
91
  First to find root cause: message the lead with findings.
78
92
  ```
79
93
 
80
- ## Step 5: Document Ripple
94
+ ## Step 4: Document Ripple
81
95
 
82
96
  After fixing, assess what documentation was affected by the change and update ALL relevant files:
83
97
 
@@ -97,7 +111,7 @@ After fixing, assess what documentation was affected by the change and update AL
97
111
 
98
112
  ### Skip what's not affected — don't update docs for the sake of updating them.
99
113
 
100
- ## Step 6: Test Verification
114
+ ## Step 5: Test Verification (run tests confirming fix)
101
115
 
102
116
  Before committing, ensure the fix is solid:
103
117
 
@@ -81,7 +81,31 @@ For each decision:
81
81
  2. Update domain `scope.md` and `constraints.md` if the decision affects boundaries
82
82
  3. Add to `.gsd-t/progress.md` Decision Log with date and rationale
83
83
 
84
- ## Step 5: Document Ripple
84
+ ## Step 5: Create CONTEXT.md
85
+
86
+ After finalizing decisions, create or update `.gsd-t/CONTEXT.md`:
87
+
88
+ ```markdown
89
+ # Discuss CONTEXT — {Milestone Name}
90
+ Generated: {date}
91
+
92
+ ## Locked Decisions
93
+ Decisions made in this session. The plan phase MUST implement each of these exactly.
94
+ - {Decision 1 — specific and implementable}
95
+ - {Decision 2}
96
+
97
+ ## Deferred Ideas
98
+ Good ideas surfaced but NOT in scope for this milestone. Plan must NOT implement these.
99
+ - {Idea 1 — brief description of what was deferred and why}
100
+
101
+ ## Claude's Discretion
102
+ Implementation details not specified — Claude can choose freely when executing.
103
+ - {Detail 1 — e.g., "Use either X or Y approach for the logging layer"}
104
+ ```
105
+
106
+ The plan phase planner must read this file and map every Locked Decision to at least one task. If a Locked Decision has no corresponding task, the plan is incomplete.
107
+
108
+ ## Step 6: Document Ripple
85
109
 
86
110
  Decisions don't just affect contracts — they can change the broader documentation:
87
111
 
@@ -97,7 +121,7 @@ Decisions don't just affect contracts — they can change the broader documentat
97
121
 
98
122
  ### Skip what's not affected.
99
123
 
100
- ## Step 6: Test Verification
124
+ ## Step 7: Test Verification
101
125
 
102
126
  If decisions resulted in contract or code changes:
103
127
 
@@ -105,7 +129,7 @@ If decisions resulted in contract or code changes:
105
129
  2. **Verify passing**: All tests must pass. If any fail from contract changes, fix before proceeding (up to 2 attempts)
106
130
  3. **Flag test gaps**: If decisions created new requirements with no test coverage, note them for the plan phase
107
131
 
108
- ## Step 7: Validate Contracts
132
+ ## Step 8: Validate Contracts
109
133
 
110
134
  After all updates:
111
135
  - [ ] All contracts are internally consistent (no conflicting types/shapes)
@@ -113,7 +137,7 @@ After all updates:
113
137
  - [ ] Every domain's constraints reflect the decisions made
114
138
  - [ ] Integration points are updated with any new dependencies
115
139
 
116
- ## Step 8: Report and Stop
140
+ ## Step 9: Report and Stop
117
141
 
118
142
  Present to the user:
119
143
  1. Decisions made (with brief rationale)
@@ -19,23 +19,55 @@ Identify:
19
19
  - Which tasks are unblocked (no pending dependencies)
20
20
  - Which tasks are blocked (waiting on checkpoints)
21
21
 
22
- ## Step 2: Spawn QA Agent
22
+ ## Step 2: QA Setup
23
23
 
24
- Spawn the QA teammate to handle testing alongside execution:
24
+ After completing each task, spawn a QA subagent via the Task tool to run tests:
25
25
 
26
26
  ```
27
- Teammate "qa": Read commands/gsd-t-qa.md for your full instructions.
28
- Phase context: execute. Read .gsd-t/contracts/ for contract definitions.
29
- Run tests continuously as tasks complete. Write edge case tests for new code paths.
30
- Report: test pass/fail status after each task completion.
27
+ Task subagent (general-purpose, model: haiku):
28
+ "Run the full test suite for this project and report pass/fail counts.
29
+ Read .gsd-t/contracts/ for contract definitions.
30
+ Write edge case tests for any new code paths in this task: {task description}.
31
+ Report: test pass/fail status and any coverage gaps found."
31
32
  ```
32
33
 
33
- The QA agent runs in parallel — it writes and executes tests while you implement tasks. QA failure on any task blocks proceeding to the next task.
34
+ **OBSERVABILITY LOGGING (MANDATORY):**
35
+ Before spawning: run `date +%s` via Bash → save as START
36
+ After subagent returns: run `date +%s` → compute `DURATION=$((END-START))`
37
+ Append to `.gsd-t/token-log.md` (create with header `| Date | Command | Step | Model | Duration(s) | Notes |` if missing):
38
+ `| {YYYY-MM-DD HH:MM} | gsd-t-execute | Step 2 | haiku | {DURATION}s | task: {task-name}, {pass/fail} |`
39
+ If QA found issues, append each to `.gsd-t/qa-issues.md` (create with header `| Date | Command | Step | Model | Duration(s) | Severity | Finding |` if missing):
40
+ `| {YYYY-MM-DD HH:MM} | gsd-t-execute | Step 2 | haiku | {DURATION}s | {severity} | {finding} |`
41
+
42
+ QA failure on any task blocks proceeding to the next task.
34
43
 
35
44
  ## Step 3: Choose Execution Mode
36
45
 
46
+ ### Wave Scheduling (read first)
47
+
48
+ Before choosing solo or team mode, read the `## Wave Execution Groups` section in `.gsd-t/contracts/integration-points.md` (added by the plan phase).
49
+
50
+ **If wave groups are present**:
51
+ - Execute wave-by-wave: complete all tasks in Wave 1 before starting Wave 2
52
+ - Within each wave, tasks marked as parallel-safe can run concurrently (team mode) or be interleaved (solo mode)
53
+ - At each wave boundary: run the CHECKPOINT — verify contract compliance — before proceeding
54
+ - File conflict detection: if two tasks in the same wave list the same file in their `scope.md` ownership, move one to the next wave
55
+
56
+ **If no wave groups are defined** (older plans): fall back to the `Execution Order` list.
57
+
37
58
  ### Solo Mode (default)
38
- Execute tasks yourself following the execution order in `integration-points.md`.
59
+ Execute tasks yourself following the wave groups (or execution order) in `integration-points.md`.
60
+
61
+ ### Deviation Rules (MANDATORY for every task)
62
+
63
+ When you encounter unexpected situations during a task:
64
+
65
+ 1. **Bug in existing code blocking progress** → Fix it immediately, up to 3 attempts. If still blocked after 3 attempts, add to `.gsd-t/deferred-items.md` and move to the next task.
66
+ 2. **Missing functionality that the task clearly requires** → Add the minimum required code to unblock the task. Do not gold-plate. Document in commit message.
67
+ 3. **Blocker (missing file, wrong API, broken dependency)** → Fix the blocker and continue. Add a note to `.gsd-t/deferred-items.md` if the fix was more than trivial.
68
+ 4. **Architectural change required** → STOP immediately. Do NOT proceed. Apply the Destructive Action Guard: explain what exists, what needs to change, what breaks, and a migration path. Wait for explicit user approval.
69
+
70
+ **3-attempt limit**: If any fix attempt fails 3 times, move on — don't loop. Log to `.gsd-t/deferred-items.md`.
39
71
 
40
72
  For each task:
41
73
  1. Read the task description, files list, and contract refs
@@ -56,12 +88,12 @@ For each task:
56
88
  d. **"No feature code without test code"** — implementation and tests are ONE deliverable, not two separate steps
57
89
  8. **Run ALL tests** — unit, integration, and full Playwright suite. Fix any failures before proceeding (up to 2 attempts)
58
90
  9. Run the Pre-Commit Gate checklist from CLAUDE.md — update ALL affected docs BEFORE committing
59
- 10. Commit with a descriptive message: `[{domain}] Task {N}: {description}`
91
+ 10. **Commit immediately** after each task: `feat({domain}/task-{N}): {description}` — do NOT batch commits at phase end
60
92
  11. Update `.gsd-t/progress.md` — mark task complete
61
93
  12. If you've reached a CHECKPOINT in integration-points.md, pause and verify the contract before continuing
62
94
 
63
95
  ### Team Mode (when agent teams are enabled)
64
- Spawn teammates for independent domains:
96
+ Spawn teammates for domains within the same wave. Only domains in the same wave can run in parallel — do not spawn teammates for domains in different waves simultaneously:
65
97
 
66
98
  ```
67
99
  Create an agent team for execution:
@@ -86,18 +118,14 @@ RULES FOR ALL TEAMMATES:
86
118
  - After completing each task, message the lead with:
87
119
  "DONE: {domain} Task {N} - {summary of what was created/modified}"
88
120
  - If you need to deviate from a contract, STOP and message the lead
89
- - Commit after each task: [{domain}] Task {N}: {description}
121
+ - **Commit immediately after each task**: `feat({domain}/task-{N}): {description}` — do NOT batch commits
122
+ - **Deviation Rules**: (1) Bug blocking progress → fix, 3 attempts max; (2) Missing dependency → add minimum needed; (3) Blocker → fix and log to deferred-items.md; (4) Architectural change → STOP, message lead, never self-approve
90
123
 
91
124
  Teammate assignments:
92
125
  - Teammate "{domain-1}": Execute .gsd-t/domains/{domain-1}/tasks.md
93
126
  - Teammate "{domain-2}": Execute .gsd-t/domains/{domain-2}/tasks.md
94
127
  - Teammate "{domain-3}": Execute .gsd-t/domains/{domain-3}/tasks.md
95
- - Teammate "qa": Read commands/gsd-t-qa.md for your full instructions.
96
- Phase context: execute. Read .gsd-t/contracts/ for contract definitions.
97
- Run tests continuously as tasks complete. Write edge case tests.
98
- Report: test pass/fail status after each task completion.
99
-
100
- Lead responsibilities:
128
+ Lead responsibilities (QA is handled via Task subagent — spawn one after each domain checkpoint):
101
129
  - Use delegate mode (Shift+Tab)
102
130
  - Track completions from teammate messages
103
131
  - When a CHECKPOINT is reached: