@tekyzinc/gsd-t 3.29.10 → 4.0.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +176 -0
  2. package/bin/gsd-t-parallel.cjs +64 -13
  3. package/bin/gsd-t-test-data-adapters/file-json-array.cjs +27 -3
  4. package/bin/gsd-t-test-data-adapters/localstorage-key-prefix.cjs +6 -1
  5. package/bin/gsd-t-test-data-adapters/sqlite-table-where.cjs +16 -1
  6. package/bin/gsd-t-test-data-ledger.cjs +1 -0
  7. package/bin/gsd-t.js +48 -376
  8. package/bin/journey-coverage.cjs +6 -3
  9. package/bin/parallel-cli.cjs +13 -1
  10. package/commands/gsd-t-debug.md +47 -533
  11. package/commands/gsd-t-design-decompose.md +24 -497
  12. package/commands/gsd-t-doc-ripple.md +23 -139
  13. package/commands/gsd-t-execute.md +41 -958
  14. package/commands/gsd-t-help.md +0 -2
  15. package/commands/gsd-t-impact.md +26 -295
  16. package/commands/gsd-t-integrate.md +44 -369
  17. package/commands/gsd-t-milestone.md +25 -124
  18. package/commands/gsd-t-partition.md +28 -539
  19. package/commands/gsd-t-plan.md +26 -472
  20. package/commands/gsd-t-prd.md +25 -311
  21. package/commands/gsd-t-quick.md +1 -1
  22. package/commands/gsd-t-resume.md +0 -33
  23. package/commands/gsd-t-verify.md +52 -569
  24. package/commands/gsd-t-wave.md +41 -430
  25. package/package.json +1 -1
  26. package/scripts/gsd-t-calibration-hook.js +3 -1
  27. package/scripts/hooks/pre-commit-journey-coverage +0 -2
  28. package/scripts/hooks/pre-commit-playwright-gate +0 -2
  29. package/templates/CLAUDE-global.md +43 -173
  30. package/templates/CLAUDE-project.md +118 -104
  31. package/templates/prompts/design-verify-subagent.md +3 -0
  32. package/templates/prompts/qa-subagent.md +3 -0
  33. package/templates/prompts/red-team-subagent.md +5 -2
  34. package/templates/workflows/_lib.js +176 -0
  35. package/templates/workflows/gsd-t-debug.workflow.js +86 -0
  36. package/templates/workflows/gsd-t-execute.workflow.js +206 -0
  37. package/templates/workflows/gsd-t-integrate.workflow.js +71 -0
  38. package/templates/workflows/gsd-t-phase.workflow.js +94 -0
  39. package/templates/workflows/gsd-t-quick.workflow.js +72 -0
  40. package/templates/workflows/gsd-t-verify.workflow.js +348 -0
  41. package/templates/workflows/gsd-t-wave.workflow.js +43 -0
  42. package/bin/check-headless-sessions.js +0 -140
  43. package/bin/context-budget-audit.cjs +0 -447
  44. package/bin/context-meter-config.cjs +0 -101
  45. package/bin/context-meter-config.test.cjs +0 -101
  46. package/bin/event-stream.cjs +0 -205
  47. package/bin/gsd-t-benchmark-orchestrator.js +0 -437
  48. package/bin/gsd-t-capture-lint.cjs +0 -440
  49. package/bin/gsd-t-economics.cjs +0 -315
  50. package/bin/gsd-t-in-session-usage.cjs +0 -213
  51. package/bin/gsd-t-orchestrator-config.cjs +0 -161
  52. package/bin/gsd-t-orchestrator-queue.cjs +0 -180
  53. package/bin/gsd-t-orchestrator-recover.cjs +0 -231
  54. package/bin/gsd-t-orchestrator-worker.cjs +0 -219
  55. package/bin/gsd-t-orchestrator.js +0 -535
  56. package/bin/gsd-t-parallel-probe.cjs +0 -132
  57. package/bin/gsd-t-ratelimit-probe-worker.cjs +0 -237
  58. package/bin/gsd-t-ratelimit-probe.cjs +0 -648
  59. package/bin/gsd-t-report-tokens.cjs +0 -549
  60. package/bin/gsd-t-stream-feed-client.cjs +0 -151
  61. package/bin/gsd-t-token-backfill.cjs +0 -366
  62. package/bin/gsd-t-token-capture.cjs +0 -321
  63. package/bin/gsd-t-token-dashboard.cjs +0 -353
  64. package/bin/gsd-t-token-regenerate-log.cjs +0 -129
  65. package/bin/gsd-t-tool-attribution.cjs +0 -377
  66. package/bin/gsd-t-tool-cost.cjs +0 -195
  67. package/bin/gsd-t-transcript-tee.cjs +0 -246
  68. package/bin/gsd-t-unattended-heartbeat.cjs +0 -188
  69. package/bin/gsd-t-unattended-platform.cjs +0 -551
  70. package/bin/gsd-t-unattended-platform.js +0 -381
  71. package/bin/gsd-t-unattended-safety.cjs +0 -773
  72. package/bin/gsd-t-unattended-safety.js +0 -788
  73. package/bin/gsd-t-unattended.cjs +0 -2109
  74. package/bin/gsd-t-unattended.js +0 -1367
  75. package/bin/gsd-t-worker-dispatch.cjs +0 -211
  76. package/bin/handoff-lock.cjs +0 -249
  77. package/bin/handoff-lock.js +0 -249
  78. package/bin/headless-auto-spawn.cjs +0 -711
  79. package/bin/headless-auto-spawn.js +0 -373
  80. package/bin/headless-exit-codes.cjs +0 -67
  81. package/bin/live-activity-report.cjs +0 -615
  82. package/bin/log-tail.cjs +0 -81
  83. package/bin/m44-proof-measure.cjs +0 -285
  84. package/bin/m46-iter-proof.cjs +0 -149
  85. package/bin/m46-worker-proof.cjs +0 -201
  86. package/bin/m55-substrate-proof.cjs +0 -134
  87. package/bin/metrics-rollup.js +0 -200
  88. package/bin/model-windows.cjs +0 -99
  89. package/bin/model-windows.test.cjs +0 -75
  90. package/bin/parallelism-report.cjs +0 -535
  91. package/bin/runway-estimator.cjs +0 -242
  92. package/bin/spawn-plan-derive.cjs +0 -163
  93. package/bin/spawn-plan-status-updater.cjs +0 -292
  94. package/bin/spawn-plan-writer.cjs +0 -204
  95. package/bin/supervisor-pid-fingerprint.cjs +0 -126
  96. package/bin/token-budget.cjs +0 -265
  97. package/bin/unattended-watch-format.cjs +0 -178
  98. package/bin/watch-progress.js +0 -155
  99. package/commands/gsd-t-unattended-stop.md +0 -85
  100. package/commands/gsd-t-unattended-watch.md +0 -465
  101. package/commands/gsd-t-unattended.md +0 -476
  102. package/commands/gsd-t-visualize.md +0 -116
  103. package/scripts/gsd-t-context-meter.e2e.test.js +0 -364
  104. package/scripts/gsd-t-context-meter.js +0 -341
  105. package/scripts/gsd-t-context-meter.test.js +0 -471
  106. package/scripts/gsd-t-dashboard-server.js +0 -1203
  107. package/scripts/gsd-t-post-commit-spawn-plan.sh +0 -86
  108. package/scripts/gsd-t-transcript.html +0 -1821
  109. package/scripts/hooks/gsd-t-conversation-capture.js +0 -439
  110. package/scripts/hooks/gsd-t-in-session-usage-hook.js +0 -84
  111. package/scripts/spawn-plan-fmt-tokens.cjs +0 -80
  112. package/templates/hooks/post-commit-spawn-plan.sh +0 -85
@@ -1,330 +1,44 @@
1
1
  # GSD-T: PRD — Generate a Product Requirements Document
2
2
 
3
- You are a Product Requirements Document generator optimized for the GSD-T (Get Stuff Done — Teams) contract-driven development methodology. Your job is to take a user's idea — however rough — and produce a PRD that feeds directly into GSD-T's automated workflow: `gsd-t-project`, `gsd-t-milestone`, `gsd-t-partition`, and `gsd-t-plan`.
3
+ You are the lead agent. Generate a PRD by invoking the generic upper-stage Workflow at `templates/workflows/gsd-t-phase.workflow.js` with `phase: "prd"`. The output, `docs/prd.md`, feeds directly into `gsd-t-project`, `gsd-t-milestone`, `gsd-t-partition`, and `gsd-t-plan`.
4
4
 
5
- This command spawns a dedicated PRD subagent for fresh context, reads all available GSD-T project state, and outputs `docs/prd.md` ready for use.
6
-
7
- ## Step 0: Launch via Subagent
8
-
9
- To give PRD generation a fresh context window:
10
-
11
- **If you are the orchestrating agent** (you received the slash command directly):
12
-
13
- **OBSERVABILITY LOGGING (MANDATORY) — wrap the PRD subagent spawn with `captureSpawn`:**
5
+ ## What this command does
14
6
 
15
7
  ```
16
- node -e "
17
- const { captureSpawn } = require('./bin/gsd-t-token-capture.cjs');
18
- (async () => {
19
- await captureSpawn({
20
- command: 'gsd-t-prd',
21
- step: 'Step 0',
22
- model: 'sonnet',
23
- description: 'prd: {topic summary}',
24
- projectDir: '.',
25
- notes: 'prd: {topic summary}',
26
- spawnFn: async () => { /* Task subagent (subagent_type: general-purpose):
27
- 'You are running gsd-t-prd for this request: {\$ARGUMENTS}
28
- Working directory: {current project root}
29
- Read CLAUDE.md and .gsd-t/progress.md for project context, then execute gsd-t-prd starting at Step 1.' */ },
30
- });
31
- })();
32
- "
8
+ preflight brief (kind=prd) → PRD agent (opus, with phase protocol)
33
9
  ```
34
10
 
35
- `captureSpawn` parses `result.usage` and writes the row to `.gsd-t/token-log.md` under the canonical header. Tokens column renders as `in=N out=N cr=N cc=N $X.XX` or `—`, never `N/A`.
36
-
37
- Relay the subagent's summary to the user. **Do not execute Steps 1–6 yourself.**
38
-
39
- **If you are the spawned subagent** (your prompt says "starting at Step 1"):
40
- Continue to Step 1 below.
41
-
42
- ## Step 1: Load Project Context
43
-
44
- Read all available GSD-T state to understand the project before asking the user anything:
45
-
46
- 1. `CLAUDE.md` — tech stack, conventions, autonomy level
47
- 2. `.gsd-t/progress.md` — current milestone, version, decision log
48
- 3. `.gsd-t/backlog.md` (if exists) — queued items that may inform scope
49
- 4. `docs/requirements.md` (if exists) — existing requirements to build on
50
- 5. `docs/architecture.md` (if exists) — system design already established
51
- 6. `docs/workflows.md` (if exists) — user flows already defined
52
- 7. `.gsd-t/contracts/` (if exists) — domain interfaces already contracted
53
-
54
- From $ARGUMENTS, identify:
55
- - The product/feature topic (what the PRD is about)
56
- - Any scope hints (greenfield, feature addition, rebuild)
57
- - Any explicit constraints the user mentioned
58
-
59
- ## Step 2: Classify the Build Type
60
-
61
- Based on the loaded context and $ARGUMENTS, determine:
62
-
63
- | Type | Signal | GSD-T Target |
64
- |------|--------|-------------|
65
- | **Project** | New app/system, no existing codebase or pre-init state | `gsd-t-project` |
66
- | **Feature** | Addition to existing system (progress.md exists with milestones) | `gsd-t-feature` |
67
- | **Multiple Features** | Several related additions to existing system | Multiple `gsd-t-feature` calls |
68
-
69
- State the classification in your opening response. If ambiguous, present the two most likely options with brief reasoning and ask the user to confirm.
70
-
71
- ## Step 3: Adaptive Intake
72
-
73
- Ask targeted questions based on what's MISSING from the loaded context. Skip questions you can answer from existing docs. Ask ONE question at a time unless the user signals they prefer batch mode ("just ask me everything at once").
74
-
75
- ### Always Required (fill from docs or ask):
76
-
77
- 1. **Problem** — What problem does this solve? Who experiences it?
78
- 2. **Users** — Who are the primary users? Any secondary types (admin, API consumer)?
79
- 3. **MVP Boundary** — What is the absolute minimum that proves this works? (GSD-T milestone sequencing depends on MVP being defined by milestone 2-3)
80
- 4. **Exclusions** — What is explicitly NOT in scope? (GSD-T requires exclusion lists at milestone, domain, and partition level)
81
- 5. **Success Criteria** — How will you know it's working? Give measurable outcomes.
82
-
83
- ### Tech Stack (fill from CLAUDE.md or ask):
84
-
85
- 6. **Language & Runtime** — If not in CLAUDE.md
86
- 7. **Database** — If not in CLAUDE.md
87
- 8. **Auth Strategy** — If not in CLAUDE.md
88
- 9. **Deployment Target** — If not in CLAUDE.md
89
-
90
- ### Architecture (needed for partition):
91
-
92
- 10. **Key Components** — What are the major pieces? (API server, worker, SPA, CLI, etc.)
93
- 11. **Core Data Model** — What are the 3-5 most important entities? What are their relationships?
94
- 12. **External Integrations** — Any third-party services? (payments, email, storage, AI APIs)
95
-
96
- ### Feature-Specific (only when Type = Feature):
97
-
98
- 13. **Integration Points** — Which existing screens, APIs, or flows does this touch?
99
- 14. **DB Impact** — New tables, or extending existing ones? Which ones?
100
- 15. **Auth/Permission Changes** — New roles, permissions, or access changes?
101
- 16. **Breaking Changes** — API response shape changes? URL changes? UI flow changes?
102
-
103
- ### Stop Asking When You Have:
104
- - Clear problem statement with target user
105
- - MVP boundary defined
106
- - Full tech stack (fill from CLAUDE.md where available)
107
- - Core data model entities and relationships (field-level)
108
- - Key components identifiable at file-path level
109
- - External integrations listed
110
- - Explicit exclusions stated
111
- - Measurable success criteria
112
- - (For features) Integration points and DB impact clear
113
-
114
- **Infer when possible.** If CLAUDE.md says "TypeScript/Node + PostgreSQL + Vercel", state those as assumed and ask for confirmation rather than re-asking. If the user says "React app with Supabase", you know the DB is Postgres and auth is likely Supabase Auth.
115
-
116
- ## Step 4: Generate the PRD
117
-
118
- Once intake is complete, generate the PRD in this exact format. Every section exists because a specific GSD-T command reads it.
119
-
120
- ```markdown
121
- # PRD: {Product/Feature Name}
122
-
123
- Generated: {YYYY-MM-DD}
124
- GSD-T Project: {project name from CLAUDE.md or progress.md}
125
- Build Type: {Project | Feature | Multiple Features}
126
-
127
- ## Problem Statement
128
-
129
- {Who has this problem, what the problem is, why it matters. 2-4 sentences.}
130
-
131
- ## Target Users
132
-
133
- | User Type | Description | Key Needs |
134
- |-----------|-------------|-----------|
135
- | {type} | {who they are} | {what they need from this system} |
136
-
137
- ## MVP Definition
138
-
139
- {The minimum viable product — what must be true for the first usable version.}
140
-
141
- ### MVP Includes
142
- - {capability 1}
143
- - {capability 2}
144
-
145
- ### MVP Explicitly Excludes
146
- - {exclusion 1} — {brief reason}
147
- - {exclusion 2}
148
-
149
- ## Tech Stack
150
-
151
- | Layer | Choice | Rationale |
152
- |-------|--------|-----------|
153
- | Language/Runtime | {e.g., TypeScript / Node.js 20} | {why} |
154
- | Framework | {e.g., Next.js 14 App Router} | {why} |
155
- | Database | {e.g., PostgreSQL 16} | {why} |
156
- | ORM/Query | {e.g., Drizzle ORM} | {why} |
157
- | Frontend | {e.g., React 18 + Tailwind CSS} | {why} |
158
- | Auth | {e.g., NextAuth.js with email + Google OAuth} | {why} |
159
- | Testing | {e.g., Vitest + Playwright} | {why} |
160
- | Deployment | {e.g., Vercel + Supabase} | {why} |
161
-
162
- ## Functional Requirements
163
-
164
- | ID | Requirement | Priority | User Type |
165
- |----|-------------|----------|-----------|
166
- | REQ-001 | {User can register with email and password} | P1 | {end-user} |
167
- | REQ-002 | {User can log in and receive a session token} | P1 | {end-user} |
168
- | REQ-003 | {description} | P1/P2/P3 | {user type} |
169
-
170
- Priority guide:
171
- - P1: Must have for MVP
172
- - P2: Must have for v1 (post-MVP)
173
- - P3: Nice to have / future
174
-
175
- ## Technical Requirements
11
+ The agent takes a user's idea however rough reads available GSD-T project state, and produces `docs/prd.md` with functional and non-functional requirements traceable to acceptance criteria.
176
12
 
177
- | ID | Requirement | Priority |
178
- |----|-------------|----------|
179
- | TECH-001 | {API response times under 200ms for core endpoints} | P1 |
180
- | TECH-002 | {description} | P1/P2/P3 |
13
+ ## Step 1: Load context
181
14
 
182
- ## Non-Functional Requirements
15
+ Read any existing `docs/requirements.md`, `docs/architecture.md`, and `.gsd-t/progress.md`. Capture the user's idea from `$ARGUMENTS`.
183
16
 
184
- | ID | Requirement | Metric |
185
- |----|-------------|--------|
186
- | NFR-001 | {Page load time} | {< 2 seconds on 3G} |
187
- | NFR-002 | {description} | {measurable target} |
17
+ ## Step 2: Invoke the phase Workflow
188
18
 
189
- ## Architecture
190
-
191
- ### System Overview
192
-
193
- {2-3 paragraphs describing the high-level architecture — how components connect, data flows, deployment topology.}
194
-
195
- ### Components
196
-
197
- | Component | Purpose | Suggested Path | Dependencies |
198
- |-----------|---------|---------------|--------------|
199
- | {API Server} | {Handles all backend logic} | `src/server/` | {Database, Auth} |
200
- | {Frontend App} | {User-facing SPA/SSR} | `src/app/` | {API Server} |
201
- | {Background Worker} | {Async job processing} | `src/workers/` | {Database, Queue} |
202
-
203
- ### Data Model
204
-
205
- #### {Entity Name} (e.g., User)
206
- | Field | Type | Constraints | Notes |
207
- |-------|------|-------------|-------|
208
- | id | uuid | PK | auto-generated |
209
- | email | string | unique, not null | login identifier |
210
- | {field} | {type} | {constraints} | {notes} |
211
-
212
- ### API Structure
213
-
214
- #### {Endpoint Group — e.g., Authentication}
215
- | Method | Path | Auth | Description |
216
- |--------|------|------|-------------|
217
- | POST | /api/auth/register | none | Create new account |
218
- | POST | /api/auth/login | none | Get session token |
219
- | GET | /api/auth/me | required | Get current user |
220
-
221
- ### External Integrations
222
-
223
- | Service | Purpose | Auth Method | Notes |
224
- |---------|---------|-------------|-------|
225
- | {Stripe} | {Payment processing} | {API key} | {webhook for events} |
226
-
227
- ### Key Design Decisions
228
-
229
- | Decision | Rationale | Alternatives Considered |
230
- |----------|-----------|------------------------|
231
- | {Use JWTs for auth} | {Stateless, works with serverless} | {Sessions — rejected due to serverless} |
232
-
233
- ## Suggested Milestone Sequence
234
-
235
- Based on GSD-T's sequencing rules (Foundation → Schema → Core → Features → Polish):
236
-
237
- ### Milestone 1: Foundation
238
- **Goal**: {e.g., Project scaffolding, CI/CD, dev environment}
239
- **Scope**: {list}
240
- **NOT included**: {list}
241
- **Success Criteria**:
242
- - [ ] {criterion}
243
-
244
- ### Milestone 2: {Core / MVP}
245
- **Goal**: {outcome}
246
- **Scope**: {list}
247
- **NOT included**: {list}
248
- **Success Criteria**:
249
- - [ ] {criterion}
250
-
251
- ### Milestone 3+: {as needed}
252
-
253
- ## Open Questions
254
-
255
- Items that couldn't be resolved during PRD intake — these become inputs to `gsd-t-discuss` during the relevant milestone:
256
-
257
- - {question 1} — affects Milestone {N}
258
- - {question 2}
259
-
260
- ## Out of Scope (Full Project)
261
-
262
- Everything explicitly excluded from the entire project, not just MVP:
263
-
264
- - {exclusion 1}
265
- - {exclusion 2}
266
- ```
267
-
268
- ## Step 5: Review and Finalize
269
-
270
- After generating the PRD, ask the user to review:
271
-
272
- "Here's your GSD-T-optimized PRD. Before I save it, a quick check:
273
-
274
- 1. **Requirements** — I've identified {N} functional requirements (REQ-IDs). Anything missing or wrong?
275
- 2. **Data model** — I've outlined {N} entities. Do the fields and relationships look right?
276
- 3. **Exclusions** — Review the 'NOT included' and 'Out of Scope' lists. Anything misclassified?
277
- 4. **Tech stack** — Any changes?
278
- 5. **Milestone sequence** — Does the sequencing make sense for your delivery goals?"
279
-
280
- Iterate until the user approves or says "looks good / save it."
281
-
282
- ## Step 6: Save and Hand Off
283
-
284
- Once approved, save to `docs/prd.md` (create `docs/` directory if it doesn't exist).
285
-
286
- Then update `.gsd-t/progress.md` Decision Log:
287
- ```
288
- - {YYYY-MM-DD}: PRD generated for {product/feature name} — {N} functional requirements, {N} milestones, {N} entities. docs/prd.md created.
19
+ ```js
20
+ {
21
+ scriptPath: "templates/workflows/gsd-t-phase.workflow.js",
22
+ args: {
23
+ phase: "prd",
24
+ projectDir: ".",
25
+ userInput: "$ARGUMENTS"
26
+ }
27
+ }
289
28
  ```
290
29
 
291
- Output the handoff:
292
-
293
- ```
294
- PRD saved to docs/prd.md.
295
-
296
- Next steps:
297
- ```
298
-
299
- For a new project:
300
- ```
301
- /gsd-t-project {one-line summary}
302
- ```
303
- Then paste the PRD when prompted. The PRD's requirements table becomes docs/requirements.md. The architecture section seeds docs/architecture.md. The milestone sequence becomes your roadmap.
304
-
305
- For a feature on an existing project:
306
- ```
307
- /gsd-t-feature {one-line summary}
308
- ```
309
- Then paste the PRD when prompted.
30
+ ## Step 3: Interpret the result
310
31
 
311
- The REQ-IDs in the PRD are the source of truth — GSD-T's plan validation checker verifies every REQ-ID maps to a task. Missing IDs cause plan validation to FAIL.
32
+ The Workflow returns `{ status, artifacts, summary, decisions }`.
312
33
 
313
- ## Agent Behavior Rules
34
+ - `status === "complete"`: `docs/prd.md` written, requirements traceable to acceptance criteria.
35
+ - `status === "partial" | "blocked"`: the agent needs clarification on scope or priorities. Surface the questions.
36
+ - `status === "failed"`: read `summary`.
314
37
 
315
- 1. **Infer when you can** — if CLAUDE.md says TypeScript/Node + Postgres, state those as assumed in the PRD and skip asking about them
316
- 2. **One question at a time** unless user requests batch mode
317
- 3. **REQ-IDs are non-negotiable** — GSD-T plan validation fails without them
318
- 4. **Exclusions at every level** — MVP level, milestone level, project level. GSD-T partitioning depends on knowing what's OUT
319
- 5. **Data model must be field-level** — "a users table" is not enough. GSD-T schema-contract.md needs field names, types, and constraints
320
- 6. **Components need suggested file paths** — "the API" is not enough. GSD-T partition draws domain boundaries by file ownership
321
- 7. **Keep momentum** — if you have enough for a solid PRD with reasonable assumptions, produce it and let the user refine in Step 5
322
- 8. **Flag risks early** — if choices have known pitfalls, mention as a consideration (e.g., SQLite for multi-user web app), not a blocker
323
- 9. **Never ask what you can read** — check CLAUDE.md, progress.md, and docs/ before asking about tech stack, existing patterns, or current state
324
- 10. **Respect GSD-T context** — if a milestone is already in progress, the PRD should describe a feature addition, not re-define the whole project
38
+ ## Document Ripple
325
39
 
326
- $ARGUMENTS
40
+ The PRD agent writes `docs/prd.md` and a Decision Log entry.
327
41
 
328
- ## Auto-Clear
42
+ ## Next Up
329
43
 
330
- All work is committed to project files. Execute `/clear` to free the context window for the next command.
44
+ `/gsd-t-milestone` define the first milestone from the PRD. (Or `/gsd-t-project` to decompose a full greenfield build.)
@@ -475,7 +475,7 @@ const { captureSpawn } = require('./bin/gsd-t-token-capture.cjs');
475
475
  2. Re-run Red Team after fixes
476
476
  3. If bugs persist, log to `.gsd-t/deferred-items.md` and present to user
477
477
 
478
- **If GRUDGING PASS:** Proceed to doc-ripple.
478
+ **If GRUDGING-PASS:** Proceed to doc-ripple.
479
479
 
480
480
  ## Step 6: Doc-Ripple (Automated)
481
481
 
@@ -120,39 +120,6 @@ This prevents the child side of a headless spawn from reading a partial continue
120
120
 
121
121
  ---
122
122
 
123
- ## Step 0.3: Orchestrator Run Recovery (M40 D6)
124
-
125
- ```bash
126
- node scripts/gsd-t-watch-state.js advance --agent-id "$GSD_T_AGENT_ID" --parent-id "${GSD_T_PARENT_AGENT_ID:-null}" --command gsd-t-resume --step 0 --step-label ".3: Orchestrator Run Recovery (M40 D6)" 2>/dev/null || true
127
- ```
128
-
129
- If an orchestrator run was interrupted (crash, SIGINT, kill, parent timeout), `.gsd-t/orchestrator/state.json` will still exist with a non-terminal `status`. Detect this and offer to resume it via the deterministic `--resume` path rather than attempting prose-driven reconciliation:
130
-
131
- ```bash
132
- node -e "
133
- const fs = require('fs');
134
- const path = require('path');
135
- const fp = path.join('.gsd-t', 'orchestrator', 'state.json');
136
- if (!fs.existsSync(fp)) process.exit(0);
137
- let s; try { s = JSON.parse(fs.readFileSync(fp, 'utf8')); } catch { process.exit(0); }
138
- const TERMINAL = new Set(['done','failed','stopped','interrupted','completed']);
139
- if (!s || TERMINAL.has(s.status)) process.exit(0);
140
- const running = Object.entries(s.tasks || {}).filter(([,t]) => t && t.status === 'running');
141
- console.error('▶ Orchestrator run still in-flight (status=' + (s.status||'?') + ', ' + running.length + ' running task(s))');
142
- console.error(' Resume via: node bin/gsd-t-orchestrator.js orchestrate --milestone ' + (s.milestone || '<id>') + ' --resume');
143
- console.error(' This calls recoverRunState() to reconcile in-flight tasks (ok/ambiguous/failed) before continuing.');
144
- " || true
145
- ```
146
-
147
- Rules:
148
- - **State absent or terminal** → nothing to do; fall through.
149
- - **Non-terminal** → surface the recovery hint and, at Level 3, auto-invoke the orchestrator with `--resume` when the current milestone matches `state.milestone`. Ambiguous tasks (commit but no progress entry) are flagged in the orchestrator output and require operator triage — do **not** silently claim them done.
150
- - The recovery algorithm, archiving, and ambiguous handling are covered by unit tests in `test/m40-recovery.test.js` and implemented in `bin/gsd-t-orchestrator-recover.cjs`.
151
-
152
- Contract: stream-json-sink v1.1.0, wave-join v1.x, completion-signal v1.x.
153
-
154
- ---
155
-
156
123
  ## Step 0.5: Headless Read-Back Banner (MANDATORY)
157
124
 
158
125
  ```bash