@tekyzinc/gsd-t 3.12.12 → 3.12.13

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 (53) hide show
  1. package/CHANGELOG.md +73 -26
  2. package/README.md +76 -76
  3. package/bin/design-orchestrator.js +1 -1
  4. package/bin/gsd-t-unattended.cjs +1 -1
  5. package/bin/gsd-t-unattended.js +1 -1
  6. package/bin/gsd-t.js +82 -10
  7. package/commands/gsd-t-backlog-promote.md +6 -6
  8. package/commands/gsd-t-complete-milestone.md +7 -7
  9. package/commands/gsd-t-design-audit.md +3 -3
  10. package/commands/gsd-t-design-build.md +1 -1
  11. package/commands/gsd-t-design-decompose.md +4 -4
  12. package/commands/gsd-t-execute.md +1 -1
  13. package/commands/gsd-t-feature.md +3 -3
  14. package/commands/gsd-t-gap-analysis.md +3 -3
  15. package/commands/gsd-t-health.md +3 -3
  16. package/commands/gsd-t-help.md +10 -10
  17. package/commands/gsd-t-impact.md +3 -3
  18. package/commands/gsd-t-init-scan-setup.md +5 -5
  19. package/commands/gsd-t-init.md +4 -4
  20. package/commands/gsd-t-log.md +1 -1
  21. package/commands/gsd-t-milestone.md +2 -2
  22. package/commands/gsd-t-pause.md +2 -2
  23. package/commands/gsd-t-prd.md +2 -2
  24. package/commands/gsd-t-project.md +1 -1
  25. package/commands/gsd-t-resume.md +4 -4
  26. package/commands/gsd-t-scan.md +3 -3
  27. package/commands/gsd-t-setup.md +2 -2
  28. package/commands/gsd-t-test-sync.md +1 -1
  29. package/commands/gsd-t-unattended-watch.md +5 -5
  30. package/commands/gsd-t-unattended.md +9 -9
  31. package/commands/gsd-t-wave.md +4 -4
  32. package/commands/gsd.md +17 -17
  33. package/docs/GSD-T-README.md +68 -68
  34. package/docs/architecture.md +8 -8
  35. package/docs/context-budget-recovery-plan.md +2 -2
  36. package/docs/infrastructure.md +7 -7
  37. package/docs/methodology.md +1 -1
  38. package/docs/neo4j-setup.md +2 -2
  39. package/docs/prd-gsd2-hybrid.md +1 -1
  40. package/docs/prd-harness-evolution.md +1 -1
  41. package/docs/requirements.md +2 -2
  42. package/docs/unattended-config.md +1 -1
  43. package/docs/unattended-windows-caveats.md +1 -1
  44. package/docs/workflows.md +1 -1
  45. package/package.json +1 -1
  46. package/scripts/context-meter/threshold.test.js +2 -2
  47. package/scripts/gsd-t-auto-route.js +1 -1
  48. package/scripts/gsd-t-context-meter.e2e.test.js +1 -1
  49. package/scripts/gsd-t-context-meter.test.js +1 -1
  50. package/scripts/gsd-t-update-check.js +1 -1
  51. package/templates/CLAUDE-global.md +18 -163
  52. package/templates/stacks/_markdown.md +32 -0
  53. package/templates/stacks/design-to-code.md +1 -1
@@ -279,7 +279,7 @@ User immediately sees that notifications domain is consuming disproportionate to
279
279
  **Architecture**:
280
280
  ```
281
281
  gsd-t headless wave M25
282
- └── claude -p "/user:gsd-t-wave M25"
282
+ └── claude -p "/gsd-t-wave M25"
283
283
  └── Agent tool dispatches phases (fresh context per phase)
284
284
  └── Execute phase dispatches domains (parallel, worktree isolation)
285
285
  └── Each domain dispatches tasks (fresh context per task)
@@ -333,7 +333,7 @@ Evolve GSD-T from a static methodology framework into a self-calibrating quality
333
333
  4. **Per-spawn telemetry** (`bin/token-telemetry.js`, `token-telemetry-contract.md` v1.0.0 — m35-token-telemetry):
334
334
  - Every Task subagent spawn is wrapped in a token bracket that records `{timestamp, milestone, command, phase, step, domain, task, model, duration_s, input_tokens_before, input_tokens_after, tokens_consumed, context_window_pct_before, context_window_pct_after, outcome, halt_type, escalated_via_advisor}` to `.gsd-t/token-metrics.jsonl`.
335
335
  - `gsd-t metrics --tokens [--by model,command,phase,milestone]`, `gsd-t metrics --halts`, `gsd-t metrics --context-window` surface the history.
336
- - Telemetry feeds the runway estimator (historical cost-per-phase) and the optimization backlog (`bin/token-optimizer.js` → `.gsd-t/optimization-backlog.md`, detect-only — user selectively promotes via `/user:gsd-t-optimization-apply|reject`).
336
+ - Telemetry feeds the runway estimator (historical cost-per-phase) and the optimization backlog (`bin/token-optimizer.js` → `.gsd-t/optimization-backlog.md`, detect-only — user selectively promotes via `/gsd-t-optimization-apply|reject`).
337
337
 
338
338
  **Files affected (M35 active set)**:
339
339
  - MODIFY: `bin/token-budget.js` — three-band `getDegradationActions`, `WARN_THRESHOLD_PCT = 70`, `STOP_THRESHOLD_PCT = 85`
@@ -255,9 +255,9 @@
255
255
  | REQ-077 | Headless auto-spawn on runway refusal — user never sees a `/clear` prompt | headless-auto-spawn | T1–T5 | SUPERSEDED by REQ-088 (M38) — headless-by-default promotes auto-spawn from emergency pivot to default primitive |
256
256
  | REQ-078 | Structural elimination of native compact messages — `halt_type: native-compact` count is 0 during M35 execution | runway-estimator + headless-auto-spawn | T1–T5 (RE), T1–T5 (HAS) | SUPERSEDED by REQ-088 (M38) — achieved via structural headless-default spawn, not runway projection |
257
257
  | REQ-079 | `gsd-t unattended` CLI subcommand runs an active milestone to completion unattended on macOS and Linux (24h+ multi-worker relay, detached OS process) | m36-supervisor-core | T1–T5 | complete (M36 Wave 1–2) |
258
- | REQ-080 | `/user:gsd-t-unattended` slash command launches the supervisor from within a Claude session without blocking the terminal | m36-supervisor-core + m36-watch-loop | T1, T3 | complete (M36 Wave 1–3) |
258
+ | REQ-080 | `/gsd-t-unattended` slash command launches the supervisor from within a Claude session without blocking the terminal | m36-supervisor-core + m36-watch-loop | T1, T3 | complete (M36 Wave 1–3) |
259
259
  | REQ-081 | In-session watch loop ticks every 270s via `ScheduleWakeup` (inside 5-min prompt-cache TTL) to report live supervisor state | m36-watch-loop | T1–T2 | complete (M36 Wave 3) |
260
- | REQ-082 | `/clear` + `/user:gsd-t-resume` during a live unattended run transparently re-attaches to the watch loop (Step 0 auto-reattach, no user-visible disruption) | m36-watch-loop | T4 | complete (M36 Wave 3) |
260
+ | REQ-082 | `/clear` + `/gsd-t-resume` during a live unattended run transparently re-attaches to the watch loop (Step 0 auto-reattach, no user-visible disruption) | m36-watch-loop | T4 | complete (M36 Wave 3) |
261
261
  | REQ-083 | Supervisor survives `/compact` and context resets — each worker is a fresh `claude -p` session; context exhaustion is structurally irrelevant | m36-supervisor-core | T1–T5 | complete (M36 Wave 1–2) |
262
262
  | REQ-084 | Safety rails prevent infinite loops: gutter detection, blocker sentinels (`BLOCKED_NEEDS_HUMAN`, `DISPATCH_FAILED`), max-hours and max-iterations timeouts | m36-safety-rails | T1–T5 | complete (M36 Wave 2) |
263
263
  | REQ-085 | Cross-platform support — macOS (caffeinate sleep-prevention) + Linux (systemd-inhibit or no-op) + Windows (claude.cmd via PATH; sleep-prevention not supported — see docs/unattended-windows-caveats.md) | m36-cross-platform | T1–T5 | complete (M36 Wave 2) |
@@ -15,7 +15,7 @@ supervisor never silently falls back on a broken config.
15
15
 
16
16
  From highest to lowest:
17
17
 
18
- 1. **CLI flags** passed to `/user:gsd-t-unattended` (e.g. `--hours=48`)
18
+ 1. **CLI flags** passed to `/gsd-t-unattended` (e.g. `--hours=48`)
19
19
  2. **Environment variables** (`GSD_T_HOURS`, `GSD_T_MAX_ITERATIONS`, etc.)
20
20
  3. **`.gsd-t/.unattended/config.json`** fields
21
21
  4. **Hardcoded defaults** in `bin/gsd-t-unattended-safety.js` → `DEFAULTS`
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## 0. Required Software (All Platforms)
11
11
 
12
- The launch command (`/user:gsd-t-unattended`) pre-flights required software in
12
+ The launch command (`/gsd-t-unattended`) pre-flights required software in
13
13
  Step 1e and refuses to spawn if anything is missing. Install these before
14
14
  launching:
15
15
 
package/docs/workflows.md CHANGED
@@ -197,7 +197,7 @@ Every commit must pass applicable checks:
197
197
  2. `gsd-t-auto-route.js` UserPromptSubmit hook fires
198
198
  3. Script checks if `.gsd-t/progress.md` exists in cwd
199
199
  4. If yes: injects `[GSD-T AUTO-ROUTE]` signal into prompt context
200
- 5. Claude agent sees signal and routes the plain text message through `/user:gsd {message}`
200
+ 5. Claude agent sees signal and routes the plain text message through `/gsd {message}`
201
201
  6. Smart router interprets intent and launches appropriate GSD-T command
202
202
 
203
203
  **Note:** Only fires in GSD-T projects (`.gsd-t/progress.md` must exist). Silently passes through in all other directories.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "3.12.12",
3
+ "version": "3.12.13",
4
4
  "description": "GSD-T: Contract-Driven Development for Claude Code — 54 slash commands with headless-by-default workflow spawning, unattended supervisor relay with event stream, graph-powered code analysis, real-time agent dashboard, task telemetry, doc-ripple enforcement, backlog management, impact analysis, test sync, milestone archival, and PRD generation",
5
5
  "author": "Tekyz, Inc.",
6
6
  "license": "MIT",
@@ -183,7 +183,7 @@ test("buildAdditionalContext — marker is machine-readable and short (< 40 char
183
183
  assert.ok(result.length < 40, `marker too long: ${result.length}`);
184
184
  });
185
185
 
186
- test("buildAdditionalContext — marker contains NO user-facing language (no MANDATORY, STOP, /user:, /clear)", () => {
186
+ test("buildAdditionalContext — marker contains NO user-facing language (no MANDATORY, STOP, /, /clear)", () => {
187
187
  const result = buildAdditionalContext({
188
188
  pct: 80,
189
189
  modelWindowSize: 200000,
@@ -191,7 +191,7 @@ test("buildAdditionalContext — marker contains NO user-facing language (no MAN
191
191
  });
192
192
  assert.ok(!/MANDATORY/.test(result));
193
193
  assert.ok(!/STOP/.test(result));
194
- assert.ok(!/\/user:/.test(result));
194
+ assert.ok(!/\//.test(result));
195
195
  assert.ok(!/\/clear/.test(result));
196
196
  assert.ok(!/Destructive/.test(result));
197
197
  });
@@ -29,7 +29,7 @@ process.stdin.on("end", () => {
29
29
  // Plain text prompt in a GSD-T project — inject routing signal
30
30
  process.stdout.write(
31
31
  "[GSD-T AUTO-ROUTE] The user typed a plain text message (no leading /). " +
32
- "Route it automatically through the /gsd smart router — execute the /user:gsd " +
32
+ "Route it automatically through the /gsd smart router — execute the /gsd " +
33
33
  "command with the user's full message as the argument."
34
34
  );
35
35
  } catch {
@@ -272,7 +272,7 @@ test("E2E 2. above threshold — stdout additionalContext with large transcript"
272
272
  // v3.12 (M38): additionalContext is a short silent marker, not a MANDATORY STOP banner.
273
273
  assert.equal(parsed.additionalContext, "next-spawn-headless:true");
274
274
  assert.ok(!/MANDATORY STOP/.test(parsed.additionalContext));
275
- assert.ok(!/\/user:gsd-t-pause/.test(parsed.additionalContext));
275
+ assert.ok(!/\/gsd-t-pause/.test(parsed.additionalContext));
276
276
 
277
277
  const state = sandbox.readState();
278
278
  assert.ok(state);
@@ -145,7 +145,7 @@ test("3. check-frequency hit — at/over threshold → silent marker emitted, ba
145
145
  assert.equal(out.additionalContext, "next-spawn-headless:true");
146
146
  // No user-facing banner strings.
147
147
  assert.ok(!/MANDATORY STOP/.test(out.additionalContext));
148
- assert.ok(!/\/user:gsd-t-pause/.test(out.additionalContext));
148
+ assert.ok(!/\/gsd-t-pause/.test(out.additionalContext));
149
149
 
150
150
  const state = JSON.parse(fs.readFileSync(stateFile(tmpRoot), "utf8"));
151
151
  assert.equal(state.checkCount, 5);
@@ -49,7 +49,7 @@ function doAutoUpdate(latest, installed) {
49
49
  : latest;
50
50
  console.log(`[GSD-T AUTO-UPDATE] v${installed} → v${updated}. Changelog: ${CHANGELOG}`);
51
51
  } catch {
52
- console.log(`[GSD-T UPDATE] v${installed} — update available (v${installed} → v${latest}). Auto-update failed — run manually: /user:gsd-t-version-update-all. Changelog: ${CHANGELOG}`);
52
+ console.log(`[GSD-T UPDATE] v${installed} — update available (v${installed} → v${latest}). Auto-update failed — run manually: /gsd-t-version-update-all. Changelog: ${CHANGELOG}`);
53
53
  }
54
54
  }
55
55
 
@@ -26,65 +26,7 @@ PROJECT or FEATURE or SCAN
26
26
 
27
27
  ## Commands Reference
28
28
 
29
- | Command | Purpose |
30
- |---------|---------|
31
- | `/user:gsd` | Smart router — describe what you need, auto-routes to the right command |
32
- | `/user:gsd-t-help` | List all commands or get detailed help |
33
- | `/user:gsd-t-prompt` | Help formulate your idea before committing |
34
- | `/user:gsd-t-brainstorm` | Creative exploration and idea generation |
35
- | `/user:gsd-t-prd` | Generate a GSD-T-optimized Product Requirements Document |
36
- | `/user:gsd-t-project` | Full project → milestone roadmap |
37
- | `/user:gsd-t-feature` | Major feature → impact analysis + milestones |
38
- | `/user:gsd-t-scan` | Deep codebase analysis → techdebt.md |
39
- | `/user:gsd-t-gap-analysis` | Requirements gap analysis — spec vs. existing code |
40
- | `/user:gsd-t-promote-debt` | Convert debt items to milestones |
41
- | `/user:gsd-t-setup` | Generate or restructure project CLAUDE.md |
42
- | `/user:gsd-t-init` | Initialize project structure |
43
- | `/user:gsd-t-init-scan-setup` | Full onboarding: git + init + scan + setup in one |
44
- | `/user:gsd-t-milestone` | Define new milestone |
45
- | `/user:gsd-t-partition` | Decompose into domains + contracts |
46
- | `/user:gsd-t-discuss` | Multi-perspective design exploration |
47
- | `/user:gsd-t-plan` | Create atomic task lists per domain (tasks auto-split to fit one context window) |
48
- | `/user:gsd-t-impact` | Analyze downstream effects before execution |
49
- | `/user:gsd-t-execute` | Run tasks — task-level fresh dispatch, worktree isolation, adaptive replanning, active rule injection |
50
- | `/user:gsd-t-test-sync` | Keep tests aligned with code changes |
51
- | `/user:gsd-t-qa` | QA agent — test generation, execution, gap reporting |
52
- | `/user:gsd-t-doc-ripple` | Automated document ripple — update downstream docs after code changes |
53
- | `/user:gsd-t-integrate` | Wire domains together |
54
- | `/user:gsd-t-verify` | Run quality gates + goal-backward behavior verification |
55
- | `/user:gsd-t-complete-milestone` | Archive milestone + git tag (goal-backward gate, rule engine distillation) |
56
- | `/user:gsd-t-wave` | Full cycle (auto-advances all phases) |
57
- | `/user:gsd-t-status` | Cross-domain progress view with token breakdown, global ELO and cross-project rankings |
58
- | `/user:gsd-t-debug` | Systematic debugging |
59
- | `/user:gsd-t-quick` | Fast task, respects contracts |
60
- | `/user:gsd-t-visualize` | Launch browser dashboard |
61
- | `/user:gsd-t-metrics` | View task telemetry, process ELO, domain health, and cross-project comparison (`--cross-project`) |
62
- | `/user:gsd-t-health` | Validate .gsd-t/ structure, optionally repair |
63
- | `/user:gsd-t-pause` | Save exact position for reliable resume |
64
- | `/user:gsd-t-populate` | Auto-populate docs from existing codebase |
65
- | `/user:gsd-t-design-decompose` | Decompose design into element/widget/page contracts |
66
- | `/user:gsd-t-log` | Sync progress Decision Log with recent git activity |
67
- | `/user:gsd-t-resume` | Restore context, continue |
68
- | `/user:gsd-t-version-update` | Update GSD-T to latest version |
69
- | `/user:gsd-t-version-update-all` | Update GSD-T + all registered projects |
70
- | `/user:gsd-t-unattended` | Launch detached supervisor — runs active milestone to completion with zero human intervention |
71
- | `/user:gsd-t-unattended-watch` | Watch tick — fires every 270s via ScheduleWakeup, reports supervisor status |
72
- | `/user:gsd-t-unattended-stop` | Touch stop sentinel — supervisor halts after current worker finishes |
73
- | `/user:gsd-t-triage-and-merge` | Auto-review, merge, and publish GitHub branches |
74
- | `/user:gsd-t-design-audit` | Compare built screen against Figma design — structured deviation report |
75
- | `/user:gsd-t-design-build` | Build from design contracts with two-terminal review |
76
- | `/user:gsd-t-design-review` | Independent review agent for design build (Term 2) |
77
- | `/user:gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog |
78
- | `/user:gsd-t-backlog-list` | Filtered, ordered view of backlog items |
79
- | `/user:gsd-t-backlog-move` | Reorder items by position (priority) |
80
- | `/user:gsd-t-backlog-edit` | Modify backlog entry fields |
81
- | `/user:gsd-t-backlog-remove` | Drop item with optional reason |
82
- | `/user:gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow |
83
- | `/user:gsd-t-backlog-settings` | Manage types, apps, categories, defaults |
84
- | `/user:branch` | Create and switch to a new git branch |
85
- | `/user:checkin` | Auto-bump version, stage, commit, and push |
86
- | `/user:Claude-md` | Reload and apply CLAUDE.md directives |
87
- | `/global-change` | Apply file changes across all registered GSD-T projects |
29
+ See `/gsd-t-help` for the complete command list.
88
30
 
89
31
 
90
32
  # Living Documents
@@ -189,7 +131,7 @@ On session start, a version check hook auto-updates GSD-T and outputs a status m
189
131
  - If `[GSD-T UPDATE]` appears → update available but auto-update failed. Show:
190
132
  ```
191
133
  ⬆️ GSD-T update available: v{installed} → v{latest} (auto-update failed)
192
- Run: /user:gsd-t-version-update-all
134
+ Run: /gsd-t-version-update-all
193
135
  Changelog: https://github.com/Tekyz-Inc/get-stuff-done-teams/blob/main/CHANGELOG.md
194
136
  ```
195
137
  Also repeat at the **end** of your first response.
@@ -204,7 +146,7 @@ On session start, a version check hook auto-updates GSD-T and outputs a status m
204
146
 
205
147
  Only execute GSD-T workflow behavior when a `/gsd-t-*` command is invoked or when actively mid-phase (resumed via `/gsd-t-resume`). **Plain text messages — especially questions — should be answered conversationally.** Do not launch into workflow execution, file reading, or phase advancement from a question or comment. If the user wants work done, they will invoke a command.
206
148
 
207
- **Exception — Auto-Route signal**: When `[GSD-T AUTO-ROUTE]` appears in your context (injected by the UserPromptSubmit hook), the user's plain text message should be treated as a `/user:gsd {message}` invocation. Execute the `/gsd` smart router with the user's full message as the argument instead of replying conversationally. The hook only fires in GSD-T projects (directories containing `.gsd-t/progress.md`) — it silently passes through in all other directories.
149
+ **Exception — Auto-Route signal**: When `[GSD-T AUTO-ROUTE]` appears in your context (injected by the UserPromptSubmit hook), the user's plain text message should be treated as a `/gsd {message}` invocation. Execute the `/gsd` smart router with the user's full message as the argument instead of replying conversationally. The hook only fires in GSD-T projects (directories containing `.gsd-t/progress.md`) — it silently passes through in all other directories.
208
150
 
209
151
  ## Auto-Init Guard
210
152
 
@@ -284,74 +226,18 @@ Every Playwright assertion must verify one of:
284
226
 
285
227
  ## QA Agent (Mandatory)
286
228
 
287
- Any GSD-T phase that produces or validates code **MUST run QA**. The QA agent's sole job is test generation, execution, and gap reporting. It never writes feature code.
288
-
289
- **QA method by command:**
290
- - `execute`, `integrate` → spawn QA via **Task subagent** (lightweight, no TeamCreate)
291
- - `test-sync`, `verify`, `complete-milestone` → perform contract testing and gap analysis **inline**
292
- - `quick`, `debug` → run the full test suite **inline** as part of the command's Test & Verify step
293
- - `wave` → each phase agent handles QA per the rules above
294
- - `partition`, `plan` → no QA spawn needed (no code produced yet)
295
-
296
- **Task subagent spawn instruction (execute/integrate):**
297
- ```
298
- Task subagent (general-purpose):
299
- "Run ALL configured test suites — detect and run every one:
300
- a. Unit tests (vitest/jest/mocha): run the full suite
301
- b. E2E tests: check for playwright.config.* or cypress.config.* — if found, run the FULL E2E suite
302
- c. NEVER skip E2E when a config file exists. Running only unit tests is a QA FAILURE.
303
- d. Read .gsd-t/contracts/ for contract definitions. Check contract compliance.
304
- e. AUDIT E2E test quality: Review each Playwright spec — if any test only checks element
305
- existence (isVisible, toBeAttached, toBeEnabled) without verifying functional behavior
306
- (state changes, data loaded, content updated after user actions), flag it as
307
- 'SHALLOW TEST — needs functional assertions'. A passing test suite that doesn't catch
308
- broken features is a QA FAILURE.
309
- Report format: 'Unit: X/Y pass | E2E: X/Y pass (or N/A if no config) | Contract: compliant/violations | Shallow tests: N'"
310
- ```
311
-
312
- **QA failure OR shallow tests found blocks phase completion.** Lead cannot proceed until QA reports PASS with zero shallow tests, or user explicitly overrides.
229
+ Every code-producing/validating phase MUST run QA. QA writes ZERO feature code it generates, runs, and gap-reports tests. Failure (or any shallow E2E test) blocks phase completion.
230
+ Protocol: `templates/prompts/qa-subagent.md`. Contract: `.gsd-t/contracts/qa-agent-contract.md`.
313
231
 
314
232
  ## Design Verification Agent (Mandatory when design contract exists)
315
233
 
316
- After QA passes, if `.gsd-t/contracts/design-contract.md` exists, a **dedicated Design Verification Agent** is spawned. This agent's ONLY job is to open a browser, compare the built frontend against the original design, and produce a structured element-by-element comparison table. It writes ZERO feature code.
317
-
318
- **Why a dedicated agent?** Coding agents consistently skip visual verification — even with detailed instructions — because their incentive is to finish building, not to audit. Separating the verifier from the builder ensures the verification actually happens.
319
-
320
- **Design Verification method by command:**
321
- - `execute` → spawns Design Verification Agent after QA passes (Step 5.25)
322
- - `quick` → spawns Design Verification Agent after tests pass (Step 5.25)
323
- - `integrate`, `wave` → Design Verification runs within the execute phase per the rules above
324
- - Commands without UI work → skipped automatically (no design contract = no verification)
325
-
326
- **Key rules:**
327
- - **FAIL-BY-DEFAULT**: Every visual element starts as UNVERIFIED. Must prove each matches.
328
- - **Structured comparison table**: 30+ rows minimum for a full page. Each element gets specific design values vs. specific implementation values and a MATCH or DEVIATION verdict.
329
- - **No vague verdicts**: "Looks close" and "appears to match" are not valid. Only �� MATCH or ❌ DEVIATION with specific values.
330
- - **Side-by-side browser sessions**: Opens both the built frontend AND the original design (Figma page, design image, or MCP screenshot) for direct visual comparison.
331
- - **Artifact gate**: Orchestrator checks that `design-contract.md` contains a `## Verification Status` section with a populated comparison table. Missing artifact = re-spawn (1 retry).
332
- - **Fix cycle**: Deviations are fixed (up to 2 cycles) and re-verified before proceeding.
333
-
334
- **Design Verification FAIL blocks phase completion.** Deviations must be fixed or logged to `.gsd-t/deferred-items.md`.
234
+ When `.gsd-t/contracts/design-contract.md` or `.gsd-t/contracts/design/` exists, a dedicated agent opens a browser, compares the build against the design, and writes a structured element-by-element MATCH/DEVIATION table. Writes ZERO feature code. Deviations (or missing verification artifact) block phase completion.
235
+ Protocol: `templates/prompts/design-verify-subagent.md`.
335
236
 
336
237
  ## Red Team — Adversarial QA (Mandatory)
337
238
 
338
- After QA and Design Verification pass, every code-producing command spawns a **Red Team agent** — an adversarial subagent whose success is measured by bugs found, not tests passed. This inverts the incentive structure: the Red Team's drive toward "task complete" means digging deeper and finding more bugs, not rubber-stamping.
339
-
340
- **Red Team method by command:**
341
- - `execute` → spawns Red Team after Design Verification passes (Step 5.5)
342
- - `integrate` → spawns Red Team after integration tests pass (Step 7.5)
343
- - `quick` → spawns Red Team after Design Verification passes (Step 5.5)
344
- - `debug` → spawns Red Team after fix verification passes (Step 5.3)
345
- - `wave` → each phase agent handles Red Team per the rules above
346
-
347
- **Key Red Team rules:**
348
- - **Inverted incentive**: More bugs found = more value. Zero bugs requires exhaustive proof of thoroughness.
349
- - **False positive penalty**: Reporting non-bugs destroys credibility. Every bug must be reproduced with proof.
350
- - **Exhaustive categories**: Contract violations, boundary inputs, state transitions, error paths, missing flows, regression, E2E functional gaps, design fidelity (when design contract exists: render in browser, screenshot, build element inventory, produce structured comparison table with per-element MATCH/DEVIATION verdicts — never "looks close") — all must be attempted.
351
- - **VERDICT**: `FAIL` (bugs found — blocks completion) or `GRUDGING PASS` (exhaustive search, nothing found).
352
- - **Report**: Written to `.gsd-t/red-team-report.md`; bugs also appended to `.gsd-t/qa-issues.md`.
353
-
354
- **Red Team FAIL blocks phase completion.** CRITICAL/HIGH bugs must be fixed (up to 2 fix cycles). If bugs persist, they are logged to `.gsd-t/deferred-items.md` and presented to the user.
239
+ After QA + Design Verification pass, every code-producing command spawns an adversarial subagent whose success is measured by bugs found, not tests passed. VERDICT is `FAIL` (bugs blocks completion) or `GRUDGING PASS` (exhaustive search, nothing found). CRITICAL/HIGH bugs get up to 2 fix cycles before deferral.
240
+ Protocol: `templates/prompts/red-team-subagent.md`.
355
241
 
356
242
  ## Model Display (MANDATORY)
357
243
 
@@ -369,12 +255,8 @@ This gives the user real-time visibility into which model is handling each opera
369
255
 
370
256
  ## Headless-by-Default Spawn (M38, v3.12.10+)
371
257
 
372
- **Architectural shift**: long-running work spawns detached by default, not interactively. Commands that previously invited mid-session context exhaustion (execute, wave, integrate, debug's repair loops) now route through the unattended supervisor from the start. The interactive session invokes, sees a banner, and hands off no `/clear`, no pause/resume dance, no drift into the 95% `/compact` wall.
373
-
374
- - **Invocation**: any workflow command can accept `--watch` to keep a live status block in the interactive session (ScheduleWakeup-driven, 270s ticks). Without `--watch`, the caller gets a launch banner, an event-stream log location, and exits.
375
- - **Event stream**: the supervisor emits JSONL to `.gsd-t/events/YYYY-MM-DD.jsonl` at every phase boundary (task_start, task_complete, error, retry). The watch-tick command and dashboard consume the same stream.
376
- - **Router mode**: when the user describes what they want in plain language via `/user:gsd` and the request is exploratory/conversational (brainstorm, "help me think through", "what are the trade-offs"), the router answers inline — no command spawn. See `commands/gsd.md` Step 2.5.
377
- - **Contracts**: `.gsd-t/contracts/headless-default-contract.md` v1.0.0, `unattended-event-stream-contract.md` v1.0.0, `unattended-supervisor-contract.md` v1.1.0.
258
+ Long-running work (execute, wave, integrate, debug repair loops) spawns detached by default. Interactive session shows a banner, event-stream path, then exits no mid-session `/compact` wall. `--watch` keeps a ScheduleWakeup-driven status block in the caller; events stream JSONL to `.gsd-t/events/YYYY-MM-DD.jsonl`. Router mode (`/gsd`) answers exploratory requests inline without a command spawn — see `commands/gsd.md` Step 2.5.
259
+ Contract: `.gsd-t/contracts/headless-default-contract.md` (see also `unattended-event-stream-contract.md`, `unattended-supervisor-contract.md`).
378
260
 
379
261
  ## API Documentation Guard (Swagger/OpenAPI)
380
262
 
@@ -404,12 +286,8 @@ KEEP GOING. Only stop for:
404
286
 
405
287
  ## Unattended Execution (M36, v3.10.10+)
406
288
 
407
- `/user:gsd-t-unattended` launches a detached OS-process supervisor that drives the active milestone to completion over hours or days via a `claude -p` worker relay — each worker in a fresh context window. The interactive Claude session receives a 270-second ScheduleWakeup watch loop (`/user:gsd-t-unattended-watch`) that ticks and prints progress until the supervisor reaches a terminal state.
408
-
409
- - **Resume re-attach**: `/user:gsd-t-resume` checks for a live `supervisor.pid`; if the supervisor is still running, it skips normal resume and re-starts the watch loop automatically.
410
- - **Stop**: `/user:gsd-t-unattended-stop` touches `.gsd-t/.unattended/stop`; supervisor halts after the current worker finishes.
411
- - **Contract**: `.gsd-t/contracts/unattended-supervisor-contract.md` v1.0.0 — authoritative for state schema, exit codes, CLI flags, and platform matrix.
412
- - **Platform**: macOS and Linux fully supported. Windows supported except sleep-prevention (see `docs/unattended-windows-caveats.md`).
289
+ `/gsd-t-unattended` launches a detached supervisor that drives the active milestone to completion via a `claude -p` worker relay (fresh context per worker). `/gsd-t-resume` auto-reattaches via watch loop if `supervisor.pid` is live; `/gsd-t-unattended-stop` halts after the current worker. macOS/Linux fully supported; Windows lacks sleep-prevention.
290
+ Contract: `.gsd-t/contracts/unattended-supervisor-contract.md` (state schema, exit codes, CLI flags, platform matrix).
413
291
 
414
292
  ## Pre-Commit Gate (MANDATORY)
415
293
 
@@ -550,7 +428,7 @@ When a GSD-T command completes (and does NOT auto-advance to the next phase), di
550
428
 
551
429
  **{Phase Name}** — {one-line description of what happens next}
552
430
 
553
- `/user:gsd-t-{command}`
431
+ `/gsd-t-{command}`
554
432
 
555
433
  ───────────────────────────────────────────────────────────────
556
434
  ```
@@ -559,8 +437,8 @@ If there are alternative commands that also make sense, add them:
559
437
 
560
438
  ```
561
439
  **Also available:**
562
- - `/user:gsd-t-{alt-1}` — {description}
563
- - `/user:gsd-t-{alt-2}` — {description}
440
+ - `/gsd-t-{alt-1}` — {description}
441
+ - `/gsd-t-{alt-2}` — {description}
564
442
  ```
565
443
 
566
444
  Successor mapping:
@@ -625,30 +503,7 @@ private: _underscore (_internal_method)
625
503
 
626
504
  ## Markdown Tables
627
505
 
628
- Emoji display as 2 characters wide in terminal/monospace but count as 1 in string length. This causes misaligned columns. **Always add one extra space after emoji in table cells** to compensate:
629
-
630
- ```
631
- WRONG — misaligned in terminal:
632
- | Channel | Support |
633
- |----------|---------|
634
- | Discord | ✅ |
635
- | LINE | ❌ |
636
-
637
- RIGHT — one extra space after emoji:
638
- | Channel | Support |
639
- |----------|---------|
640
- | Discord | ✅ |
641
- | LINE | ❌ |
642
- ```
643
-
644
- This extra space is invisible in rendered HTML (GitHub, VS Code preview) but restores alignment in terminal views. Apply to all GSD-T-generated docs that use emoji in tables.
645
-
646
- Also pad all cell values in a column to the width of the widest value:
647
- ```
648
- | iMessage (BlueBubbles) | ✅ |
649
- | Discord | ✅ |
650
- | QQ | ❌ |
651
- ```
506
+ Markdown table emoji-padding rules live in `templates/stacks/_markdown.md` (auto-injected via Stack Rules Engine).
652
507
 
653
508
 
654
509
  ## Stack Rules Engine
@@ -661,7 +516,7 @@ GSD-T auto-detects project tech stack at subagent spawn time and injects mandato
661
516
 
662
517
  **Stack-specific rules**: Injected only when the matching stack is detected (e.g., `react.md` when `"react"` is in `package.json`).
663
518
 
664
- **Design-to-code**: Activated when `.gsd-t/contracts/design-contract.md` (flat), `.gsd-t/contracts/design/` (hierarchical element/widget/page contracts — bootstrap via `/user:gsd-t-design-decompose`), `design-tokens.json`, `design-tokens/`, `.figmarc`, or `figma.config.json` exists, OR when Figma MCP is configured in `~/.claude/settings.json`. Auto-bootstrapped during partition when Figma URLs or design references are detected in requirements. Enforces pixel-perfect frontend implementation from designs with: Figma MCP auto-detection, design token extraction protocol, stack capability evaluation (recommends alternatives if stack can't achieve the design), component decomposition, responsive breakpoint strategy, and a mandatory visual verification loop — every implemented screen must be rendered in a real browser, screenshotted at mobile/tablet/desktop breakpoints, and compared pixel-by-pixel against the Figma design. Visual deviations block task completion.
519
+ **Design-to-code**: Activated when `.gsd-t/contracts/design-contract.md` (flat), `.gsd-t/contracts/design/` (hierarchical element/widget/page contracts — bootstrap via `/gsd-t-design-decompose`), `design-tokens.json`, `design-tokens/`, `.figmarc`, or `figma.config.json` exists, OR when Figma MCP is configured in `~/.claude/settings.json`. Auto-bootstrapped during partition when Figma URLs or design references are detected in requirements. Enforces pixel-perfect frontend implementation from designs with: Figma MCP auto-detection, design token extraction protocol, stack capability evaluation (recommends alternatives if stack can't achieve the design), component decomposition, responsive breakpoint strategy, and a mandatory visual verification loop — every implemented screen must be rendered in a real browser, screenshotted at mobile/tablet/desktop breakpoints, and compared pixel-by-pixel against the Figma design. Visual deviations block task completion.
665
520
 
666
521
  **Enforcement**: Stack rule violations have the same weight as contract violations — they are task failures, not warnings.
667
522
 
@@ -0,0 +1,32 @@
1
+ # Markdown Table Standards (Universal — All Projects)
2
+
3
+ These rules are MANDATORY. Violations fail the task. No exceptions.
4
+
5
+ ---
6
+
7
+ ## Emoji Padding in Markdown Tables
8
+
9
+ Emoji display as 2 characters wide in terminal/monospace but count as 1 in string length. This causes misaligned columns. **Always add one extra space after emoji in table cells** to compensate:
10
+
11
+ ```
12
+ WRONG — misaligned in terminal:
13
+ | Channel | Support |
14
+ |----------|---------|
15
+ | Discord | ✅ |
16
+ | LINE | ❌ |
17
+
18
+ RIGHT — one extra space after emoji:
19
+ | Channel | Support |
20
+ |----------|---------|
21
+ | Discord | ✅ |
22
+ | LINE | ❌ |
23
+ ```
24
+
25
+ This extra space is invisible in rendered HTML (GitHub, VS Code preview) but restores alignment in terminal views. Apply to all GSD-T-generated docs that use emoji in tables.
26
+
27
+ Also pad all cell values in a column to the width of the widest value:
28
+ ```
29
+ | iMessage (BlueBubbles) | ✅ |
30
+ | Discord | ✅ |
31
+ | QQ | ❌ |
32
+ ```
@@ -19,7 +19,7 @@ Two contract layouts are supported. Pick the one that fits the project scope:
19
19
  - Use when: multiple pages, reusable components (charts, cards, legends), design system in play
20
20
  - Pros: element contracts are the single source of truth for visual spec — widgets and pages SELECT and POSITION but cannot override. Drift is structurally impossible.
21
21
  - Cons: more contracts to write upfront (elements: ~10-20, widgets: ~5-10, pages: N)
22
- - Bootstrap via: `/user:gsd-t-design-decompose {Figma URL or image path}`
22
+ - Bootstrap via: `/gsd-t-design-decompose {Figma URL or image path}`
23
23
  - Templates: `templates/element-contract.md`, `templates/widget-contract.md`, `templates/page-contract.md`
24
24
 
25
25
  **Precedence rule (hierarchical only)**: