@tekyzinc/gsd-t 3.12.10 → 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.
- package/CHANGELOG.md +110 -26
- package/README.md +76 -76
- package/bin/design-orchestrator.js +1 -1
- package/bin/gsd-t-unattended.cjs +56 -2
- package/bin/gsd-t-unattended.js +1 -1
- package/bin/gsd-t.js +198 -17
- package/bin/headless-auto-spawn.cjs +58 -2
- package/commands/gsd-t-backlog-promote.md +6 -6
- package/commands/gsd-t-complete-milestone.md +7 -7
- package/commands/gsd-t-design-audit.md +3 -3
- package/commands/gsd-t-design-build.md +1 -1
- package/commands/gsd-t-design-decompose.md +4 -4
- package/commands/gsd-t-execute.md +1 -1
- package/commands/gsd-t-feature.md +3 -3
- package/commands/gsd-t-gap-analysis.md +3 -3
- package/commands/gsd-t-health.md +3 -3
- package/commands/gsd-t-help.md +10 -10
- package/commands/gsd-t-impact.md +3 -3
- package/commands/gsd-t-init-scan-setup.md +5 -5
- package/commands/gsd-t-init.md +4 -4
- package/commands/gsd-t-log.md +1 -1
- package/commands/gsd-t-milestone.md +2 -2
- package/commands/gsd-t-pause.md +2 -2
- package/commands/gsd-t-prd.md +2 -2
- package/commands/gsd-t-project.md +1 -1
- package/commands/gsd-t-resume.md +4 -4
- package/commands/gsd-t-scan.md +3 -3
- package/commands/gsd-t-setup.md +2 -2
- package/commands/gsd-t-test-sync.md +1 -1
- package/commands/gsd-t-unattended-watch.md +5 -5
- package/commands/gsd-t-unattended.md +9 -9
- package/commands/gsd-t-wave.md +4 -4
- package/commands/gsd.md +17 -17
- package/docs/GSD-T-README.md +68 -68
- package/docs/architecture.md +8 -8
- package/docs/context-budget-recovery-plan.md +2 -2
- package/docs/infrastructure.md +7 -7
- package/docs/methodology.md +1 -1
- package/docs/neo4j-setup.md +2 -2
- package/docs/prd-gsd2-hybrid.md +1 -1
- package/docs/prd-harness-evolution.md +1 -1
- package/docs/requirements.md +2 -2
- package/docs/unattended-config.md +1 -1
- package/docs/unattended-windows-caveats.md +1 -1
- package/docs/workflows.md +1 -1
- package/package.json +1 -1
- package/scripts/context-meter/threshold.test.js +2 -2
- package/scripts/gsd-t-auto-route.js +1 -1
- package/scripts/gsd-t-context-meter.e2e.test.js +1 -1
- package/scripts/gsd-t-context-meter.test.js +1 -1
- package/scripts/gsd-t-event-writer.js +8 -2
- package/scripts/gsd-t-update-check.js +1 -1
- package/templates/CLAUDE-global.md +18 -163
- package/templates/stacks/_markdown.md +32 -0
- package/templates/stacks/design-to-code.md +1 -1
package/docs/GSD-T-README.md
CHANGED
|
@@ -24,34 +24,34 @@ cd my-project
|
|
|
24
24
|
claude
|
|
25
25
|
|
|
26
26
|
# 2. Full onboarding (git + init + scan + setup in one)
|
|
27
|
-
/
|
|
27
|
+
/gsd-t-init-scan-setup
|
|
28
28
|
|
|
29
29
|
# Or step by step:
|
|
30
|
-
/
|
|
30
|
+
/gsd-t-init my-project
|
|
31
31
|
|
|
32
32
|
# 3. Define what you're building
|
|
33
|
-
/
|
|
33
|
+
/gsd-t-milestone "User Authentication System"
|
|
34
34
|
|
|
35
35
|
# 5. Let it rip (auto-advances through all phases)
|
|
36
|
-
/
|
|
36
|
+
/gsd-t-wave
|
|
37
37
|
|
|
38
38
|
# Or go phase by phase for more control:
|
|
39
|
-
/
|
|
40
|
-
/
|
|
41
|
-
/
|
|
42
|
-
/
|
|
43
|
-
/
|
|
44
|
-
/
|
|
45
|
-
/
|
|
46
|
-
/
|
|
47
|
-
/
|
|
39
|
+
/gsd-t-partition
|
|
40
|
+
/gsd-t-discuss
|
|
41
|
+
/gsd-t-plan
|
|
42
|
+
/gsd-t-impact
|
|
43
|
+
/gsd-t-execute
|
|
44
|
+
/gsd-t-test-sync
|
|
45
|
+
/gsd-t-integrate
|
|
46
|
+
/gsd-t-verify
|
|
47
|
+
/gsd-t-complete-milestone
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
## Resuming After a Break
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
53
|
claude
|
|
54
|
-
/
|
|
54
|
+
/gsd-t-resume
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
GSD-T reads all state files and tells you exactly where you left off.
|
|
@@ -64,86 +64,86 @@ GSD-T reads all state files and tells you exactly where you left off.
|
|
|
64
64
|
|
|
65
65
|
| Command | Purpose | Auto |
|
|
66
66
|
|---------|---------|------|
|
|
67
|
-
| `/
|
|
67
|
+
| `/gsd {request}` | Describe what you need → auto-routes to the right command | Manual |
|
|
68
68
|
| _(any plain text)_ | Auto-routed via UserPromptSubmit hook — no leading `/` needed | Auto |
|
|
69
69
|
|
|
70
70
|
### Help & Onboarding
|
|
71
71
|
|
|
72
72
|
| Command | Purpose | Auto |
|
|
73
73
|
|---------|---------|------|
|
|
74
|
-
| `/
|
|
75
|
-
| `/
|
|
76
|
-
| `/
|
|
77
|
-
| `/
|
|
78
|
-
| `/
|
|
74
|
+
| `/gsd-t-help` | List all commands with descriptions | Manual |
|
|
75
|
+
| `/gsd-t-help {cmd}` | Detailed help for specific command | Manual |
|
|
76
|
+
| `/gsd-t-prompt` | Help formulate your idea before committing | Manual |
|
|
77
|
+
| `/gsd-t-brainstorm` | Creative exploration and idea generation | Manual |
|
|
78
|
+
| `/gsd-t-prd` | Generate a GSD-T-optimized Product Requirements Document | Manual |
|
|
79
79
|
|
|
80
80
|
### Project Initialization
|
|
81
81
|
|
|
82
82
|
| Command | Purpose | Auto |
|
|
83
83
|
|---------|---------|------|
|
|
84
|
-
| `/
|
|
85
|
-
| `/
|
|
86
|
-
| `/
|
|
87
|
-
| `/
|
|
88
|
-
| `/
|
|
89
|
-
| `/
|
|
90
|
-
| `/
|
|
91
|
-
| `/
|
|
92
|
-
| `/
|
|
93
|
-
| `/
|
|
84
|
+
| `/gsd-t-setup` | Generate or restructure project CLAUDE.md | Manual |
|
|
85
|
+
| `/gsd-t-init` | Initialize GSD-T structure in project | Manual |
|
|
86
|
+
| `/gsd-t-init-scan-setup` | Full onboarding: git + init + scan + setup in one | Manual |
|
|
87
|
+
| `/gsd-t-project` | Full project → milestone roadmap | Manual |
|
|
88
|
+
| `/gsd-t-feature` | Major feature → impact analysis + milestones | Manual |
|
|
89
|
+
| `/gsd-t-scan` | Deep codebase analysis → techdebt.md | Manual |
|
|
90
|
+
| `/gsd-t-gap-analysis` | Requirements gap analysis — spec vs. existing code | Manual |
|
|
91
|
+
| `/gsd-t-promote-debt` | Convert techdebt items to milestones | Manual |
|
|
92
|
+
| `/gsd-t-populate` | Auto-populate docs from existing codebase | Manual |
|
|
93
|
+
| `/gsd-t-design-decompose` | Decompose design into element/widget/page contracts | Manual |
|
|
94
94
|
|
|
95
95
|
### Milestone Workflow
|
|
96
96
|
|
|
97
97
|
| Command | Purpose | Auto |
|
|
98
98
|
|---------|---------|------|
|
|
99
|
-
| `/
|
|
100
|
-
| `/
|
|
101
|
-
| `/
|
|
102
|
-
| `/
|
|
103
|
-
| `/
|
|
104
|
-
| `/
|
|
105
|
-
| `/
|
|
106
|
-
| `/
|
|
99
|
+
| `/gsd-t-milestone` | Define new milestone | Manual |
|
|
100
|
+
| `/gsd-t-partition` | Decompose into domains + contracts | In wave |
|
|
101
|
+
| `/gsd-t-discuss` | Multi-perspective design exploration | In wave |
|
|
102
|
+
| `/gsd-t-plan` | Create atomic task lists per domain (tasks auto-split to fit one context window) | In wave |
|
|
103
|
+
| `/gsd-t-impact` | Analyze downstream effects | In wave |
|
|
104
|
+
| `/gsd-t-execute` | Run tasks — task-level fresh dispatch, worktree isolation, adaptive replanning, stack rules injection | In wave |
|
|
105
|
+
| `/gsd-t-test-sync` | Sync tests with code changes | In wave |
|
|
106
|
+
| `/gsd-t-qa` | QA agent — test generation, execution, gap reporting | Auto-spawned |
|
|
107
107
|
| *Red Team* | Adversarial QA — spawns after QA passes to find bugs the builder missed | Auto-spawned |
|
|
108
|
-
| `/
|
|
109
|
-
| `/
|
|
110
|
-
| `/
|
|
111
|
-
| `/
|
|
108
|
+
| `/gsd-t-doc-ripple` | Automated document ripple — update downstream docs after code changes | Auto-spawned |
|
|
109
|
+
| `/gsd-t-integrate` | Wire domains together | In wave |
|
|
110
|
+
| `/gsd-t-verify` | Run quality gates + goal-backward verification → auto-invokes complete-milestone | In wave |
|
|
111
|
+
| `/gsd-t-complete-milestone` | Archive + git tag (auto-invoked by verify, also standalone) | In wave |
|
|
112
112
|
|
|
113
113
|
### Automation & Utilities
|
|
114
114
|
|
|
115
115
|
| Command | Purpose | Auto |
|
|
116
116
|
|---------|---------|------|
|
|
117
|
-
| `/
|
|
118
|
-
| `/
|
|
119
|
-
| `/
|
|
120
|
-
| `/
|
|
121
|
-
| `/
|
|
122
|
-
| `/
|
|
123
|
-
| `/
|
|
124
|
-
| `/
|
|
125
|
-
| `/
|
|
126
|
-
| `/
|
|
127
|
-
| `/
|
|
128
|
-
| `/
|
|
129
|
-
| `/
|
|
130
|
-
| `/
|
|
131
|
-
| `/
|
|
132
|
-
| `/
|
|
133
|
-
| `/
|
|
117
|
+
| `/gsd-t-unattended` | Launch detached supervisor — runs active milestone to completion with zero human intervention | Manual |
|
|
118
|
+
| `/gsd-t-unattended-watch` | Watch tick — fires every 270s via ScheduleWakeup, reports supervisor status | Auto |
|
|
119
|
+
| `/gsd-t-unattended-stop` | Touch stop sentinel — supervisor halts after current worker finishes | Manual |
|
|
120
|
+
| `/gsd-t-wave` | Full cycle, auto-advances all phases | Manual |
|
|
121
|
+
| `/gsd-t-status` | Cross-domain progress view with token breakdown, global ELO and cross-project rankings | Manual |
|
|
122
|
+
| `/gsd-t-resume` | Restore context, continue | Manual |
|
|
123
|
+
| `/gsd-t-quick` | Fast task with GSD-T guarantees | Manual |
|
|
124
|
+
| `/gsd-t-visualize` | Launch browser dashboard — SSE server + React Flow agent visualization | Manual |
|
|
125
|
+
| `/gsd-t-debug` | Systematic debugging with state | Manual |
|
|
126
|
+
| `/gsd-t-metrics` | View task telemetry, process ELO, signal distribution, domain health, and cross-project comparison (`--cross-project`) | Manual |
|
|
127
|
+
| `/gsd-t-health` | Validate .gsd-t/ structure, optionally repair | Manual |
|
|
128
|
+
| `/gsd-t-pause` | Save exact position for reliable resume | Manual |
|
|
129
|
+
| `/gsd-t-log` | Sync progress Decision Log with recent git activity | Manual |
|
|
130
|
+
| `/gsd-t-version-update` | Update GSD-T to latest version | Manual |
|
|
131
|
+
| `/gsd-t-version-update-all` | Update GSD-T + all registered projects | Manual |
|
|
132
|
+
| `/gsd-t-triage-and-merge` | Auto-review, merge, and publish GitHub branches | Manual |
|
|
133
|
+
| `/gsd-t-design-audit` | Compare built screen against Figma — per-widget deviation report with severity | Manual |
|
|
134
134
|
| `/global-change` | Apply file changes (copy/insert/update/delete) across all GSD-T projects | Manual |
|
|
135
135
|
|
|
136
136
|
### Backlog Management
|
|
137
137
|
|
|
138
138
|
| Command | Purpose | Auto |
|
|
139
139
|
|---------|---------|------|
|
|
140
|
-
| `/
|
|
141
|
-
| `/
|
|
142
|
-
| `/
|
|
143
|
-
| `/
|
|
144
|
-
| `/
|
|
145
|
-
| `/
|
|
146
|
-
| `/
|
|
140
|
+
| `/gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog | Manual |
|
|
141
|
+
| `/gsd-t-backlog-list` | Filtered, ordered view of backlog items | Manual |
|
|
142
|
+
| `/gsd-t-backlog-move` | Reorder items by position (priority) | Manual |
|
|
143
|
+
| `/gsd-t-backlog-edit` | Modify backlog entry fields | Manual |
|
|
144
|
+
| `/gsd-t-backlog-remove` | Drop item with optional reason | Manual |
|
|
145
|
+
| `/gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow | Manual |
|
|
146
|
+
| `/gsd-t-backlog-settings` | Manage types, apps, categories, defaults | Manual |
|
|
147
147
|
|
|
148
148
|
---
|
|
149
149
|
|
|
@@ -293,7 +293,7 @@ Run the active milestone to completion over hours or days with zero human interv
|
|
|
293
293
|
|
|
294
294
|
**Relay model**: Each iteration spawns a fresh `claude -p` session with a compact prompt derived from `.gsd-t/progress.md` state. The supervisor waits for the worker to exit, records the exit code in `state.json`, runs safety checks (gutter detection, blocker sentinel scan), and spawns the next worker. Workers never overlap. Context rot is impossible — each worker starts clean.
|
|
295
295
|
|
|
296
|
-
**Watch loop**: `/
|
|
296
|
+
**Watch loop**: `/gsd-t-unattended` starts an in-session ScheduleWakeup loop that ticks every 270 seconds. Each tick reads `state.json` and `supervisor.pid` to render a live progress block. When the supervisor reaches a terminal state (`done`, `failed`, `stopped`), the watch loop stops rescheduling and prints a final summary. A `/clear` + `/gsd-t-resume` transparently re-attaches: the resume command checks for a live `supervisor.pid` and re-starts the watch loop automatically.
|
|
297
297
|
|
|
298
298
|
**Safety rails**: Branch protection (refuses to run on `main`/`master`/`release/*` by default), dirty-tree check (whitelists GSD-T runtime files), per-iteration gutter detection (repeated error patterns, file thrash, no-progress stall), wall-clock and iteration caps, and a blocker sentinel that halts on unrecoverable worker errors.
|
|
299
299
|
|
|
@@ -405,7 +405,7 @@ copy *.md %USERPROFILE%\.claude\commands\
|
|
|
405
405
|
cp *.md ~/.claude/commands/
|
|
406
406
|
```
|
|
407
407
|
|
|
408
|
-
Verify with: `/
|
|
408
|
+
Verify with: `/gsd-t-help`
|
|
409
409
|
|
|
410
410
|
---
|
|
411
411
|
|
package/docs/architecture.md
CHANGED
|
@@ -52,7 +52,7 @@ The framework has no runtime — it is consumed entirely by Claude Code's slash
|
|
|
52
52
|
- **Pre-task experience retrieval (execute, debug)**: Grep Decision Log for `[failure]`/`[learning]` entries matching current domain before spawning subagent — Reflexion pattern without fine-tuning. Writes `experience_retrieval` event.
|
|
53
53
|
- **Distillation step (complete-milestone Step 2.5)**: Scans `.gsd-t/events/*.jsonl` for patterns seen ≥3 times, proposes CLAUDE.md / constraints.md rule additions, user confirms before write.
|
|
54
54
|
### Auto-Route + Auto-Update Hooks (M16 — complete)
|
|
55
|
-
- **`scripts/gsd-t-auto-route.js`** (39 lines): UserPromptSubmit hook. Reads JSON from stdin (`{ prompt, cwd, session_id }`). If `.gsd-t/progress.md` does not exist in cwd → exits silently. If prompt starts with `/` → exits silently. If plain text in a GSD-T project → emits `[GSD-T AUTO-ROUTE]` signal to Claude's context, routing the message through `/
|
|
55
|
+
- **`scripts/gsd-t-auto-route.js`** (39 lines): UserPromptSubmit hook. Reads JSON from stdin (`{ prompt, cwd, session_id }`). If `.gsd-t/progress.md` does not exist in cwd → exits silently. If prompt starts with `/` → exits silently. If plain text in a GSD-T project → emits `[GSD-T AUTO-ROUTE]` signal to Claude's context, routing the message through `/gsd`. Catches all exceptions — never blocks the prompt.
|
|
56
56
|
- **`scripts/gsd-t-update-check.js`** (79 lines): SessionStart hook. Reads `~/.claude/.gsd-t-version`. Reads/refreshes `~/.claude/.gsd-t-update-check` cache (1h TTL). If newer version available: runs `npm install -g @tekyzinc/gsd-t@{latest}` + `gsd-t update-all` via execSync. Outputs `[GSD-T AUTO-UPDATE]`, `[GSD-T UPDATE]`, or `[GSD-T]` banner. NOTE: No module.exports — untestable as module (TD-081). Version string not validated before execSync (SEC-N28).
|
|
57
57
|
|
|
58
58
|
### Scan Visual Output (M17 — complete v2.34.10)
|
|
@@ -72,9 +72,9 @@ The framework has no runtime — it is consumed entirely by Claude Code's slash
|
|
|
72
72
|
|
|
73
73
|
### Headless Mode (M23 — complete)
|
|
74
74
|
- **doHeadless(args)**: Dispatch function for the `headless` CLI subcommand.
|
|
75
|
-
- **doHeadlessExec(command, cmdArgs, flags)**: Wraps `claude -p "/gsd-t-{command}"` via `execFileSync`. Verifies claude CLI availability, enforces timeout, writes log file if `--log` requested. Returns structured JSON if `--json` flag set. (M36 Phase 0: prompt form is `/gsd-t-X`, NOT `/
|
|
75
|
+
- **doHeadlessExec(command, cmdArgs, flags)**: Wraps `claude -p "/gsd-t-{command}"` via `execFileSync`. Verifies claude CLI availability, enforces timeout, writes log file if `--log` requested. Returns structured JSON if `--json` flag set. (M36 Phase 0: prompt form is `/gsd-t-X`, NOT `/gsd-t-X` — non-interactive mode rejects the `/` namespace prefix.)
|
|
76
76
|
- **parseHeadlessFlags(args)**: Extracts `--json`, `--timeout=N`, `--log` from raw args. Returns `{ flags, positional }`.
|
|
77
|
-
- **buildHeadlessCmd(command, cmdArgs)**: Builds the bare `/gsd-t-{command}` prompt string. Interactive-mode
|
|
77
|
+
- **buildHeadlessCmd(command, cmdArgs)**: Builds the bare `/gsd-t-{command}` prompt string. Interactive-mode `/` prefix deliberately omitted — see `.gsd-t/M36-spike-findings.md` Spike A.
|
|
78
78
|
- **mapHeadlessExitCode(processExitCode, output)**: Maps process exit code + output text patterns to GSD-T exit codes (0–5).
|
|
79
79
|
- **headlessLogPath(projectDir, timestamp)**: Generates `.gsd-t/headless-{timestamp}.log` path.
|
|
80
80
|
- **doHeadlessQuery(type)**: Dispatches to one of 7 query functions. All pure Node.js file reads, no LLM calls, <100ms.
|
|
@@ -130,7 +130,7 @@ gsd-t init [name] → templates/ → applyTokens()
|
|
|
130
130
|
|
|
131
131
|
### Runtime Command Execution (within Claude Code)
|
|
132
132
|
```
|
|
133
|
-
User types /
|
|
133
|
+
User types /gsd-t-{command} [args]
|
|
134
134
|
→ Claude Code loads ~/.claude/commands/gsd-t-{command}.md
|
|
135
135
|
→ Claude interprets step-by-step instructions
|
|
136
136
|
→ Reads state files → Executes workflow → Pre-Commit Gate → Updates progress.md
|
|
@@ -284,7 +284,7 @@ The unattended supervisor is a cross-session relay engine that runs an active GS
|
|
|
284
284
|
|
|
285
285
|
```
|
|
286
286
|
Interactive Claude session
|
|
287
|
-
└── /
|
|
287
|
+
└── /gsd-t-unattended (launch command)
|
|
288
288
|
├── Pre-flight safety checks (branch, dirty tree)
|
|
289
289
|
└── spawn(detached) → Supervisor process (bin/gsd-t-unattended.js)
|
|
290
290
|
├── writes .gsd-t/.unattended/supervisor.pid
|
|
@@ -296,7 +296,7 @@ Interactive Claude session
|
|
|
296
296
|
→ worker exits → post-worker safety check → next iter
|
|
297
297
|
|
|
298
298
|
In-session watch loop (every 270s via ScheduleWakeup)
|
|
299
|
-
└── /
|
|
299
|
+
└── /gsd-t-unattended-watch
|
|
300
300
|
├── reads supervisor.pid (kill -0 liveness)
|
|
301
301
|
├── reads state.json (status, iter, lastTick)
|
|
302
302
|
└── reschedules or reports final status
|
|
@@ -349,7 +349,7 @@ Closes the M35 parent/child race in `bin/headless-auto-spawn.js`. When the runwa
|
|
|
349
349
|
|
|
350
350
|
### Resume Auto-Reattach
|
|
351
351
|
|
|
352
|
-
`/
|
|
352
|
+
`/gsd-t-resume` Step 0 checks for a live supervisor before any other resume logic. If `supervisor.pid` exists and `kill -0` succeeds and `state.json.status` is non-terminal, the resume command skips normal resume flow entirely, prints the current watch block, and calls `ScheduleWakeup(270, '/gsd-t-unattended-watch', ...)`. The user transparently re-enters the watch loop without any manual step.
|
|
353
353
|
|
|
354
354
|
---
|
|
355
355
|
|
|
@@ -533,7 +533,7 @@ Orchestrator Context Gate — v3.0.0 semantics:
|
|
|
533
533
|
|
|
534
534
|
**Supporting components** (outside the context-meter dataflow):
|
|
535
535
|
- `bin/model-selector.js` — declarative rules table mapping phases to haiku/sonnet/opus; consulted at plan time, never at runtime under pressure
|
|
536
|
-
- `bin/check-headless-sessions.js` — renders the read-back banner on `/
|
|
536
|
+
- `bin/check-headless-sessions.js` — renders the read-back banner on `/gsd-t-resume` and `/gsd-t-status` for completed-but-not-yet-surfaced headless sessions
|
|
537
537
|
- `bin/event-stream.cjs` (M38) — shared library for JSONL event emission and cursor-based tailing; used by supervisor, watch tick, and dashboard
|
|
538
538
|
|
|
539
539
|
**Installer integration** (`bin/gsd-t.js`):
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
## Per-invocation cost (where the regression actually hides)
|
|
22
22
|
|
|
23
|
-
A typical `/
|
|
23
|
+
A typical `/gsd-t-execute` invocation loads:
|
|
24
24
|
|
|
25
25
|
| Item | Tokens | Notes |
|
|
26
26
|
|------|--------|-------|
|
|
@@ -85,7 +85,7 @@ Note: these savings only apply when a command is invoked. If you only ever run `
|
|
|
85
85
|
**Current size**: 9,679 tokens (4.8% of window — always loaded)
|
|
86
86
|
**Target size**: ~4,500 tokens
|
|
87
87
|
**Method**:
|
|
88
|
-
- The entire "Commands Reference" table (51 rows) duplicates `commands/gsd-t-help.md` — DELETE the table, replace with `Run /
|
|
88
|
+
- The entire "Commands Reference" table (51 rows) duplicates `commands/gsd-t-help.md` — DELETE the table, replace with `Run /gsd-t-help for the full command list.`
|
|
89
89
|
- The "Update Notices" / "Auto-Init Guard" / "Playwright Readiness Guard" / "QA Agent" / "Design Verification Agent" / "Red Team" sections (~3,000 tokens combined) are duplicated in the relevant command files. Move them to the command files only and replace with one-line summaries here.
|
|
90
90
|
- The "Pre-Commit Gate" decision tree (~1,500 tokens) is also in project CLAUDE.md — keep one, link from the other
|
|
91
91
|
- The "Document Ripple Completion Gate" (~1,500 tokens) is duplicated in `gsd-t-doc-ripple.md` — reference only
|
package/docs/infrastructure.md
CHANGED
|
@@ -123,7 +123,7 @@ Headless mode enables non-interactive GSD-T execution for CI/CD pipelines and ov
|
|
|
123
123
|
|
|
124
124
|
### headless exec
|
|
125
125
|
|
|
126
|
-
Wraps `claude -p "/
|
|
126
|
+
Wraps `claude -p "/gsd-t-{command} {args}"` for unattended execution.
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
129
|
gsd-t headless verify --json --timeout=1200 --log
|
|
@@ -314,16 +314,16 @@ The unattended supervisor runs an active GSD-T milestone to completion in a deta
|
|
|
314
314
|
|
|
315
315
|
```bash
|
|
316
316
|
# From within an interactive Claude session:
|
|
317
|
-
/
|
|
317
|
+
/gsd-t-unattended
|
|
318
318
|
|
|
319
319
|
# From the terminal (detached — returns immediately):
|
|
320
320
|
gsd-t unattended --hours=24 --milestone=M36
|
|
321
321
|
|
|
322
322
|
# Watch current run status (in-session, 270s tick):
|
|
323
|
-
/
|
|
323
|
+
/gsd-t-unattended-watch
|
|
324
324
|
|
|
325
325
|
# Request a graceful stop:
|
|
326
|
-
/
|
|
326
|
+
/gsd-t-unattended-stop
|
|
327
327
|
```
|
|
328
328
|
|
|
329
329
|
### CLI Flags
|
|
@@ -395,18 +395,18 @@ kill -0 $(cat .gsd-t/.unattended/supervisor.pid) && echo "alive" || echo "stale
|
|
|
395
395
|
rm .gsd-t/.unattended/supervisor.pid
|
|
396
396
|
|
|
397
397
|
# Or request a graceful stop:
|
|
398
|
-
/
|
|
398
|
+
/gsd-t-unattended-stop
|
|
399
399
|
# (or) touch .gsd-t/.unattended/stop
|
|
400
400
|
```
|
|
401
401
|
|
|
402
402
|
**Watch loop stopped firing**
|
|
403
|
-
- Re-invoke `/
|
|
403
|
+
- Re-invoke `/gsd-t-resume` from a fresh session
|
|
404
404
|
- Step 0 auto-reattach reads `supervisor.pid` — if the supervisor is still alive, it re-enters the watch loop automatically (no manual steps needed)
|
|
405
405
|
|
|
406
406
|
**Supervisor crashed mid-run**
|
|
407
407
|
- The watch loop detects crash via `kill -0` failure
|
|
408
408
|
- Check `.gsd-t/.unattended/run.log` and final `state.json` for diagnostics
|
|
409
|
-
- Resume normally with `/
|
|
409
|
+
- Resume normally with `/gsd-t-resume` — the milestone continues from its last checkpoint
|
|
410
410
|
|
|
411
411
|
---
|
|
412
412
|
|
package/docs/methodology.md
CHANGED
|
@@ -124,7 +124,7 @@ Between v2.74 and v2.75, GSD-T attempted to cope with context pressure through *
|
|
|
124
124
|
|
|
125
125
|
M34 gave GSD-T a real measurement of how much context window each session had consumed. M35 used that signal to refuse starting new work that would exceed the 85% threshold, auto-spawning a detached headless process instead so the user never had to manually run `/clear`. Both milestones still had a ceiling: the headless continuation was a single shot — it ran one Claude session, and if the milestone wasn't complete when that session exhausted its context, a human had to intervene again to trigger the next continuation. Long-running milestones (multi-day builds, large waves) still required periodic human attention to keep the relay going.
|
|
126
126
|
|
|
127
|
-
M36 (v2.77.10) makes the relay automatic and indefinite. The unattended supervisor (`bin/gsd-t-unattended.js`) is a long-lived OS process, fully detached from any Claude Code terminal session, that drives the relay itself: it spawns a fresh `claude -p "/gsd-t-resume"` worker, waits for it to exit, reads the outcome, and immediately spawns the next worker — repeating until the milestone reaches COMPLETED status or a wall-clock cap is hit. Each worker gets a pristine context window. The `/compact` that inevitably fires in a long session is irrelevant because the *next* session has already started fresh. The supervisor IS the orchestrator of runway handoffs. Safety rails (`bin/gsd-t-unattended-safety.js`) prevent infinite-loop scenarios: gutter detection catches stall patterns, blocker sentinels catch unrecoverable errors, and iteration/hour caps ensure the machine doesn't run forever on a broken state. A cross-platform abstraction layer handles macOS sleep-prevention (`caffeinate`), Linux equivalents, and Windows limitations. From the user's perspective: invoke `/
|
|
127
|
+
M36 (v2.77.10) makes the relay automatic and indefinite. The unattended supervisor (`bin/gsd-t-unattended.js`) is a long-lived OS process, fully detached from any Claude Code terminal session, that drives the relay itself: it spawns a fresh `claude -p "/gsd-t-resume"` worker, waits for it to exit, reads the outcome, and immediately spawns the next worker — repeating until the milestone reaches COMPLETED status or a wall-clock cap is hit. Each worker gets a pristine context window. The `/compact` that inevitably fires in a long session is irrelevant because the *next* session has already started fresh. The supervisor IS the orchestrator of runway handoffs. Safety rails (`bin/gsd-t-unattended-safety.js`) prevent infinite-loop scenarios: gutter detection catches stall patterns, blocker sentinels catch unrecoverable errors, and iteration/hour caps ensure the machine doesn't run forever on a broken state. A cross-platform abstraction layer handles macOS sleep-prevention (`caffeinate`), Linux equivalents, and Windows limitations. From the user's perspective: invoke `/gsd-t-unattended`, walk away, and receive a native OS notification when the milestone is done — hours or days later.
|
|
128
128
|
|
|
129
129
|
The in-session watch loop (270-second `ScheduleWakeup` ticks, chosen to stay inside the 5-minute prompt-cache TTL) closes the feedback loop for users who keep a Claude session open. And the `gsd-t-resume` Step 0 auto-reattach means that even a `/clear` or accidental session close is transparent: the next resume detects the live supervisor and silently re-enters the watch loop without any manual step. Taken together, M34 + M35 + M36 form a complete three-layer system: measure the context accurately, refuse to degrade when it runs low, and relay execution automatically across as many fresh sessions as the work requires.
|
|
130
130
|
|
package/docs/neo4j-setup.md
CHANGED
|
@@ -89,7 +89,7 @@ that doesn't exist.
|
|
|
89
89
|
After indexing is complete, run a full codebase scan in each project to generate the baseline analysis. From within each project directory:
|
|
90
90
|
|
|
91
91
|
```
|
|
92
|
-
/
|
|
92
|
+
/gsd-t-scan
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
Or to scan all projects at once, paste this prompt into Claude Code:
|
|
@@ -98,7 +98,7 @@ Or to scan all projects at once, paste this prompt into Claude Code:
|
|
|
98
98
|
For each project listed in ~/.claude/.gsd-t-projects that has source code
|
|
99
99
|
files (.js, .ts, .py, .jsx, .tsx):
|
|
100
100
|
1. cd into the project directory
|
|
101
|
-
2. Run /
|
|
101
|
+
2. Run /gsd-t-scan
|
|
102
102
|
3. Report: project name, scan status, tech debt items found, test count
|
|
103
103
|
|
|
104
104
|
Use team mode with parallel agents. Skip documentation-only projects
|
package/docs/prd-gsd2-hybrid.md
CHANGED
|
@@ -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 "/
|
|
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 `/
|
|
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`
|
package/docs/requirements.md
CHANGED
|
@@ -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 | `/
|
|
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` + `/
|
|
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 `/
|
|
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 (`/
|
|
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 `/
|
|
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.
|
|
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,
|
|
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(
|
|
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 /
|
|
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(!/\/
|
|
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(!/\/
|
|
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);
|
|
@@ -71,11 +71,17 @@ function nullify(val) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
function buildEvent(args) {
|
|
74
|
+
// Env-var fallbacks: workers spawned by supervisor/headless-auto-spawn inherit
|
|
75
|
+
// GSD_T_COMMAND and GSD_T_PHASE so tool_call events are tagged even when the
|
|
76
|
+
// worker doesn't pass --command/--phase explicitly (Fix 2, v3.12.12).
|
|
77
|
+
const envCommand = process.env.GSD_T_COMMAND || null;
|
|
78
|
+
const envPhase = process.env.GSD_T_PHASE || null;
|
|
79
|
+
|
|
74
80
|
return {
|
|
75
81
|
ts: new Date().toISOString(),
|
|
76
82
|
event_type: nullify(args["type"]),
|
|
77
|
-
command: nullify(args["command"]),
|
|
78
|
-
phase: nullify(args["phase"]),
|
|
83
|
+
command: nullify(args["command"]) || envCommand,
|
|
84
|
+
phase: nullify(args["phase"]) || envPhase,
|
|
79
85
|
agent_id: nullify(args["agent-id"]),
|
|
80
86
|
parent_agent_id: nullify(args["parent-id"]),
|
|
81
87
|
trace_id: nullify(args["trace-id"]),
|
|
@@ -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: /
|
|
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
|
|