@tekyzinc/gsd-t 3.12.15 → 3.13.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,10 @@ You are performing a gap analysis between a provided specification and the exist
4
4
 
5
5
  ## Step 0.5: Scan Freshness Auto-Refresh
6
6
 
7
+ ```bash
8
+ 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-gap-analysis --step 0 --step-label ".5: Scan Freshness Auto-Refresh" 2>/dev/null || true
9
+ ```
10
+
7
11
  Before reading scan data for gap classification, check if scan docs are stale and auto-refresh if needed. This ensures gap analysis is based on current code — no warnings, no user involvement.
8
12
 
9
13
  If `.gsd-t/scan/.cache.json` exists:
@@ -21,6 +25,10 @@ If `.gsd-t/scan/` doesn't exist at all → skip (no scan data to refresh).
21
25
 
22
26
  ## Step 1: Load Context
23
27
 
28
+ ```bash
29
+ 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-gap-analysis --step 1 --step-label "Load Context" 2>/dev/null || true
30
+ ```
31
+
24
32
  Read (if they exist):
25
33
  1. `CLAUDE.md` — project context
26
34
  2. `.gsd-t/progress.md` — current state
@@ -29,6 +37,10 @@ Read (if they exist):
29
37
 
30
38
  ## Step 1.5: Graph-Enhanced Code Mapping
31
39
 
40
+ ```bash
41
+ 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-gap-analysis --step 1 --step-label ".5: Graph-Enhanced Code Mapping" 2>/dev/null || true
42
+ ```
43
+
32
44
  If `.gsd-t/graph/meta.json` exists (graph index is available):
33
45
  1. Query `getRequirementFor` to pre-map requirements to code entities — provides evidence for classification in Step 4
34
46
  2. Query `findDeadCode` to identify unreachable code that may indicate implemented-but-disconnected features (potential gap indicators)
@@ -38,6 +50,10 @@ If graph is not available, skip this step.
38
50
 
39
51
  ## Step 2: Parse Requirements
40
52
 
53
+ ```bash
54
+ 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-gap-analysis --step 2 --step-label "Parse Requirements" 2>/dev/null || true
55
+ ```
56
+
41
57
  Break the provided spec into numbered discrete requirements. Each requirement should be:
42
58
  - **Atomic** — one testable behavior or capability per item
43
59
  - **Clear** — unambiguous language
@@ -61,6 +77,10 @@ For large specs, show progress: "Analyzing section {N} of {total}: {section name
61
77
 
62
78
  ## Step 3: Clarification Check
63
79
 
80
+ ```bash
81
+ 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-gap-analysis --step 3 --step-label "Clarification Check" 2>/dev/null || true
82
+ ```
83
+
64
84
  Review each requirement for ambiguity. If any are unclear:
65
85
 
66
86
  - At **Level 3 (Full Auto)**: Proceed with reasonable assumptions. Flag each assumption in the gap analysis with `[ASSUMED: {assumption}]`
@@ -76,6 +96,10 @@ Discuss now or proceed with assumptions?
76
96
 
77
97
  ## Step 4: System Scan + Gap Classification (Team Mode)
78
98
 
99
+ ```bash
100
+ 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-gap-analysis --step 4 --step-label "System Scan + Gap Classification (Team Mode)" 2>/dev/null || true
101
+ ```
102
+
79
103
  Automatically use agent teams to scan and classify requirements in parallel.
80
104
 
81
105
  ### Team Distribution Strategy
@@ -152,6 +176,10 @@ If agent teams are not available or there are fewer than 3 requirements, run seq
152
176
 
153
177
  ## Step 6: Generate Gap Analysis Document
154
178
 
179
+ ```bash
180
+ 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-gap-analysis --step 6 --step-label "Generate Gap Analysis Document" 2>/dev/null || true
181
+ ```
182
+
155
183
  Create `.gsd-t/gap-analysis.md`:
156
184
 
157
185
  ```markdown
@@ -205,6 +233,10 @@ Create `.gsd-t/gap-analysis.md`:
205
233
 
206
234
  ## Step 7: Merge to Requirements (Optional)
207
235
 
236
+ ```bash
237
+ 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-gap-analysis --step 7 --step-label "Merge to Requirements (Optional)" 2>/dev/null || true
238
+ ```
239
+
208
240
  After generating the gap analysis, offer:
209
241
 
210
242
  ```
@@ -218,6 +250,10 @@ If yes, merge the discrete requirements into `docs/requirements.md`, marking eac
218
250
 
219
251
  ## Step 8: Present Promotion Options
220
252
 
253
+ ```bash
254
+ 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-gap-analysis --step 8 --step-label "Present Promotion Options" 2>/dev/null || true
255
+ ```
256
+
221
257
  Show the recommended groupings and offer promotion paths:
222
258
 
223
259
  ```
@@ -239,6 +275,10 @@ At **Level 3**: Present the recommendations and wait for user direction. Do NOT
239
275
 
240
276
  ## Step 9: Re-run Support
241
277
 
278
+ ```bash
279
+ 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-gap-analysis --step 9 --step-label "Re-run Support" 2>/dev/null || true
280
+ ```
281
+
242
282
  If `.gsd-t/gap-analysis.md` already exists from a previous run:
243
283
 
244
284
  1. Read the previous gap analysis
@@ -25,6 +25,10 @@ Per `.gsd-t/contracts/model-selection-contract.md` v1.0.0.
25
25
 
26
26
  ## Step 1: Load Full State
27
27
 
28
+ ```bash
29
+ 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-integrate --step 1 --step-label "Load Full State" 2>/dev/null || true
30
+ ```
31
+
28
32
  Read everything:
29
33
  1. `CLAUDE.md`
30
34
  2. `.gsd-t/progress.md`
@@ -35,6 +39,10 @@ Read everything:
35
39
 
36
40
  ## Step 1.5: Graph-Enhanced Integration Validation
37
41
 
42
+ ```bash
43
+ 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-integrate --step 1 --step-label ".5: Graph-Enhanced Integration Validation" 2>/dev/null || true
44
+ ```
45
+
38
46
  If `.gsd-t/graph/meta.json` exists (graph index is available):
39
47
  1. Query `getDomainBoundaryViolations` to validate that cross-domain wiring matches contracts — flag any code that crosses boundaries without a contract
40
48
  2. Query `getCallers` and `getCallees` across domain boundaries to verify all integration points are accounted for in `integration-points.md`
@@ -44,6 +52,10 @@ If graph is not available, skip this step.
44
52
 
45
53
  ## Step 2: Contract Compliance Audit
46
54
 
55
+ ```bash
56
+ 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-integrate --step 2 --step-label "Contract Compliance Audit" 2>/dev/null || true
57
+ ```
58
+
47
59
  Before wiring anything together, verify each domain honored its contracts:
48
60
 
49
61
  For each contract file:
@@ -73,6 +85,10 @@ Fix any mismatches BEFORE proceeding to integration.
73
85
 
74
86
  ## Step 2.5: Worktree Merge Status Check
75
87
 
88
+ ```bash
89
+ 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-integrate --step 2 --step-label ".5: Worktree Merge Status Check" 2>/dev/null || true
90
+ ```
91
+
76
92
  Before wiring integration points, check whether team mode execution left any domains with rolled-back worktree merges:
77
93
 
78
94
  1. Read `.gsd-t/progress.md` — look for `[rollback]` entries in the Decision Log from the execute phase
@@ -83,6 +99,10 @@ If rolled-back domains exist, report them to the user (or if Level 3: log to `.g
83
99
 
84
100
  ## Step 3: Wire Integration Points
85
101
 
102
+ ```bash
103
+ 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-integrate --step 3 --step-label "Wire Integration Points" 2>/dev/null || true
104
+ ```
105
+
86
106
  **Stack Rules Detection (before spawning subagent):**
87
107
  Run via Bash to detect project stack and collect matching rules:
88
108
  `GSD_T_DIR=$(npm root -g 2>/dev/null)/@tekyzinc/gsd-t; STACKS_DIR="$GSD_T_DIR/templates/stacks"; STACK_RULES=""; if [ -d "$STACKS_DIR" ]; then for f in "$STACKS_DIR"/_*.md; do [ -f "$f" ] && STACK_RULES="${STACK_RULES}$(cat "$f")"$'\n\n'; done; if [ -f "package.json" ]; then grep -q '"react"' package.json 2>/dev/null && [ -f "$STACKS_DIR/react.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/react.md")"$'\n\n'; (grep -q '"typescript"' package.json 2>/dev/null || [ -f "tsconfig.json" ]) && [ -f "$STACKS_DIR/typescript.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/typescript.md")"$'\n\n'; grep -qE '"(express|fastify|hono|koa)"' package.json 2>/dev/null && [ -f "$STACKS_DIR/node-api.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/node-api.md")"$'\n\n'; fi; [ -f "requirements.txt" ] || [ -f "pyproject.toml" ] && [ -f "$STACKS_DIR/python.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/python.md")"$'\n\n'; [ -f "go.mod" ] && [ -f "$STACKS_DIR/go.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/go.md")"$'\n\n'; [ -f "Cargo.toml" ] && [ -f "$STACKS_DIR/rust.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/rust.md")"$'\n\n'; ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ] || grep -q '"figma"' ~/.claude/settings.json 2>/dev/null) && [ -f "$STACKS_DIR/design-to-code.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/design-to-code.md")"$'\n\n'; fi`
@@ -127,6 +147,10 @@ For each connection:
127
147
 
128
148
  ## Step 4: End-to-End Smoke Test
129
149
 
150
+ ```bash
151
+ 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-integrate --step 4 --step-label "End-to-End Smoke Test" 2>/dev/null || true
152
+ ```
153
+
130
154
  Run through the primary user flows:
131
155
  1. Identify the 3-5 most critical paths from requirements
132
156
  2. Trace each path through all domain boundaries
@@ -153,6 +177,10 @@ Result: PARTIAL — needs pagination contract addition
153
177
 
154
178
  ## Step 5: Contract Compliance Testing
155
179
 
180
+ ```bash
181
+ 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-integrate --step 5 --step-label "Contract Compliance Testing" 2>/dev/null || true
182
+ ```
183
+
156
184
  Spawn a QA subagent via the Task tool to verify contract compliance at all domain boundaries — `spawnType: 'validation'` (always headless, `--watch` ignored):
157
185
 
158
186
  ```
@@ -195,6 +223,10 @@ QA failure blocks integration completion.
195
223
 
196
224
  ## Step 6: Document Ripple
197
225
 
226
+ ```bash
227
+ 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-integrate --step 6 --step-label "Document Ripple" 2>/dev/null || true
228
+ ```
229
+
198
230
  Integration is where the real system takes shape. Verify documentation matches reality:
199
231
 
200
232
  ### Always update:
@@ -211,6 +243,10 @@ Integration is where the real system takes shape. Verify documentation matches r
211
243
 
212
244
  ## Step 7: Test Verification
213
245
 
246
+ ```bash
247
+ 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-integrate --step 7 --step-label "Test Verification" 2>/dev/null || true
248
+ ```
249
+
214
250
  After integration and doc ripple, verify everything works together:
215
251
 
216
252
  1. **Update tests**: Add or update integration tests for newly wired domain boundaries
@@ -225,6 +261,10 @@ After integration and doc ripple, verify everything works together:
225
261
 
226
262
  ## Step 7.5: Red Team — Adversarial QA (MANDATORY)
227
263
 
264
+ ```bash
265
+ 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-integrate --step 7 --step-label ".5: Red Team — Adversarial QA (MANDATORY)" 2>/dev/null || true
266
+ ```
267
+
228
268
  After integration tests pass, spawn an adversarial Red Team agent on the integrated system. Success is measured by bugs found, not tests passed.
229
269
 
230
270
  ⚙ [opus] Red Team → adversarial validation of integrated system
@@ -252,6 +292,10 @@ Append to `.gsd-t/token-log.md`:
252
292
 
253
293
  ## Step 8: Doc-Ripple (Automated)
254
294
 
295
+ ```bash
296
+ 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-integrate --step 8 --step-label "Doc-Ripple (Automated)" 2>/dev/null || true
297
+ ```
298
+
255
299
  After all integration work is committed but before reporting completion:
256
300
 
257
301
  1. Run threshold check — read `git diff --name-only HEAD~1` and evaluate against doc-ripple-contract.md trigger conditions
@@ -272,6 +316,10 @@ Report: 'Doc-ripple: {N} checked, {N} updated, {N} skipped'"
272
316
 
273
317
  ## Step 9: Handle Integration Issues
274
318
 
319
+ ```bash
320
+ 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-integrate --step 9 --step-label "Handle Integration Issues" 2>/dev/null || true
321
+ ```
322
+
275
323
  For each issue found:
276
324
  1. Determine if it's a contract gap (missing specification) or implementation bug
277
325
  2. **Contract gap**: Update the contract, create a follow-up task
@@ -280,6 +328,10 @@ For each issue found:
280
328
 
281
329
  ## Step 10: Update State
282
330
 
331
+ ```bash
332
+ 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-integrate --step 10 --step-label "Update State" 2>/dev/null || true
333
+ ```
334
+
283
335
  Update `.gsd-t/progress.md`:
284
336
  - Set status to `INTEGRATED`
285
337
  - Add contract audit results
@@ -4,6 +4,10 @@ You are defining a new milestone for the project. A milestone is a significant d
4
4
 
5
5
  ## Step 1: Load Context
6
6
 
7
+ ```bash
8
+ 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-milestone --step 1 --step-label "Load Context" 2>/dev/null || true
9
+ ```
10
+
7
11
  Read:
8
12
  1. `CLAUDE.md`
9
13
  2. `.gsd-t/progress.md` — check if GSD-T is initialized
@@ -13,6 +17,10 @@ If `.gsd-t/` doesn't exist, run the init workflow first.
13
17
 
14
18
  ## Step 2: Define the Milestone
15
19
 
20
+ ```bash
21
+ 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-milestone --step 2 --step-label "Define the Milestone" 2>/dev/null || true
22
+ ```
23
+
16
24
  Based on $ARGUMENTS and available documentation:
17
25
 
18
26
  1. **Name**: Clear, descriptive milestone name
@@ -29,6 +37,10 @@ Update `.gsd-t/progress.md` milestones table:
29
37
 
30
38
  ## Step 3: Clear Previous Milestone State (if applicable)
31
39
 
40
+ ```bash
41
+ 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-milestone --step 3 --step-label "Clear Previous Milestone State (if applicable)" 2>/dev/null || true
42
+ ```
43
+
32
44
  If there's a completed previous milestone:
33
45
  1. Archive domain task files (they contain valuable context)
34
46
  2. Keep contracts that are still valid
@@ -40,6 +52,10 @@ Ask user: "Milestone {N-1} is still {status}. Archive it and start new? Or compl
40
52
 
41
53
  ## Step 4: Pre-Partition Assessment
42
54
 
55
+ ```bash
56
+ 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-milestone --step 4 --step-label "Pre-Partition Assessment" 2>/dev/null || true
57
+ ```
58
+
43
59
  Before formal partitioning, do a quick assessment:
44
60
 
45
61
  - **Complexity estimate**: Simple (1-2 domains), Medium (3-4), Complex (5+)
@@ -52,6 +68,10 @@ Present the assessment and ask: "Ready to partition into domains now, or want to
52
68
 
53
69
  ## Step 5: Document Ripple
54
70
 
71
+ ```bash
72
+ 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-milestone --step 5 --step-label "Document Ripple" 2>/dev/null || true
73
+ ```
74
+
55
75
  After defining the milestone, update affected documentation:
56
76
 
57
77
  ### Always update:
@@ -67,6 +87,10 @@ After defining the milestone, update affected documentation:
67
87
 
68
88
  ## Step 6: Test Verification
69
89
 
90
+ ```bash
91
+ 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-milestone --step 6 --step-label "Test Verification" 2>/dev/null || true
92
+ ```
93
+
70
94
  Before proceeding to partition:
71
95
 
72
96
  1. **Run existing tests**: Execute the full test suite to confirm the codebase is clean before starting the milestone
@@ -75,6 +99,10 @@ Before proceeding to partition:
75
99
 
76
100
  ## Step 7: Auto-Partition (if user confirms)
77
101
 
102
+ ```bash
103
+ 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-milestone --step 7 --step-label "Auto-Partition (if user confirms)" 2>/dev/null || true
104
+ ```
105
+
78
106
  If the user wants to proceed immediately, execute the partition workflow (same as gsd-t-partition) for this milestone.
79
107
 
80
108
  Otherwise, set status to DEFINED and remind them:
@@ -11,6 +11,10 @@ Per `.gsd-t/contracts/model-selection-contract.md` v1.0.0.
11
11
 
12
12
  ## Step 0.5: Scan Freshness Auto-Refresh
13
13
 
14
+ ```bash
15
+ 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-partition --step 0 --step-label ".5: Scan Freshness Auto-Refresh" 2>/dev/null || true
16
+ ```
17
+
14
18
  Before reading scan data, check if scan docs are stale and auto-refresh if needed. This ensures partition decisions are based on current code — no warnings, no user involvement.
15
19
 
16
20
  If `.gsd-t/scan/.cache.json` exists:
@@ -28,6 +32,10 @@ If `.gsd-t/scan/` doesn't exist at all → skip (no scan data to refresh).
28
32
 
29
33
  ## Step 1: Understand the Project
30
34
 
35
+ ```bash
36
+ 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-partition --step 1 --step-label "Understand the Project" 2>/dev/null || true
37
+ ```
38
+
31
39
  Read these files in order:
32
40
  1. `CLAUDE.md` — project conventions and context
33
41
  2. `.gsd-t/progress.md` — current state (if exists)
@@ -45,6 +53,10 @@ If `.gsd-t/` doesn't exist, create the full directory structure:
45
53
 
46
54
  ## Step 1.5: Assumption Audit (MANDATORY — complete before domain work begins)
47
55
 
56
+ ```bash
57
+ 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-partition --step 1 --step-label ".5: Assumption Audit (MANDATORY — complete before domain work begins)" 2>/dev/null || true
58
+ ```
59
+
48
60
  Before partitioning, surface and lock down all assumptions baked into the requirements. Unexamined assumptions become architectural decisions no one approved.
49
61
 
50
62
  Work through each category below. For every match found, write the explicit disposition into the affected domain's `constraints.md` and into the Decision Log in `.gsd-t/progress.md`.
@@ -102,6 +114,10 @@ For each ambiguous item:
102
114
 
103
115
  ## Step 1.55: Graph-Enhanced Boundary Detection (if available)
104
116
 
117
+ ```bash
118
+ 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-partition --step 1 --step-label ".55: Graph-Enhanced Boundary Detection (if available)" 2>/dev/null || true
119
+ ```
120
+
105
121
  If `.gsd-t/graph/meta.json` exists, query the graph to inform domain decomposition:
106
122
 
107
123
  1. **Entity-to-file mapping**: `query('getEntities', { file })` for each source file — understand what functions/classes exist where
@@ -114,6 +130,10 @@ Use graph results to **propose initial domain boundaries** based on actual code
114
130
 
115
131
  ## Step 1.6: Consumer Surface Identification (MANDATORY — complete before domain work)
116
132
 
133
+ ```bash
134
+ 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-partition --step 1 --step-label ".6: Consumer Surface Identification (MANDATORY — complete before domain work)" 2>/dev/null || true
135
+ ```
136
+
117
137
  Before decomposing into domains, identify **every surface that will consume this system**. A surface is any client, app, or integration that calls your backend — web app, mobile app, CLI, external API, admin panel, background job, etc.
118
138
 
119
139
  Skipping this step leads to duplicated backend logic when a second consumer is added later.
@@ -190,6 +210,10 @@ If SharedCore was created, populate `.gsd-t/contracts/shared-services-contract.m
190
210
 
191
211
  ## Step 2: Identify Domains
192
212
 
213
+ ```bash
214
+ 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-partition --step 2 --step-label "Identify Domains" 2>/dev/null || true
215
+ ```
216
+
193
217
  Decompose the milestone into 2-5 independent domains. Each domain should:
194
218
  - Own a distinct area of functionality
195
219
  - Have minimal overlap with other domains
@@ -239,6 +263,10 @@ For each domain, create `.gsd-t/domains/{domain-name}/`:
239
263
 
240
264
  ## Step 3: Write Contracts
241
265
 
266
+ ```bash
267
+ 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-partition --step 3 --step-label "Write Contracts" 2>/dev/null || true
268
+ ```
269
+
242
270
  Contracts define HOW domains interact. Create files in `.gsd-t/contracts/`:
243
271
 
244
272
  For each boundary between domains, write a contract:
@@ -299,6 +327,10 @@ Owner: ui domain
299
327
 
300
328
  ## Step 3.5: Design Brief Detection (UI Projects Only)
301
329
 
330
+ ```bash
331
+ 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-partition --step 3 --step-label ".5: Design Brief Detection (UI Projects Only)" 2>/dev/null || true
332
+ ```
333
+
302
334
  After writing contracts, check for UI/frontend signals. If found, generate `.gsd-t/contracts/design-brief.md` to give all subagents a consistent visual language reference.
303
335
 
304
336
  **Skip this step entirely if no UI signals are detected.**
@@ -380,6 +412,10 @@ Log in `.gsd-t/progress.md` Decision Log: `- {date}: Design brief generated at .
380
412
 
381
413
  ## Step 3.6: Design Contract Bootstrap (Figma/Design Reference Detection)
382
414
 
415
+ ```bash
416
+ 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-partition --step 3 --step-label ".6: Design Contract Bootstrap (Figma/Design Reference Detection)" 2>/dev/null || true
417
+ ```
418
+
383
419
  After the design brief, check whether this project has a design reference (Figma, images, prototypes). If found, create `.gsd-t/contracts/design-contract.md` to activate the design-to-code stack rule during execute.
384
420
 
385
421
  **Skip this step if `.gsd-t/contracts/design-contract.md` already exists.**
@@ -427,6 +463,10 @@ Log in `.gsd-t/progress.md` Decision Log: `- {date}: Design contract created at
427
463
 
428
464
  ## Step 4: Initialize Progress
429
465
 
466
+ ```bash
467
+ 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-partition --step 4 --step-label "Initialize Progress" 2>/dev/null || true
468
+ ```
469
+
430
470
  Write `.gsd-t/progress.md`:
431
471
  ```markdown
432
472
  # GSD-T Progress
@@ -454,6 +494,10 @@ Write `.gsd-t/progress.md`:
454
494
 
455
495
  ## Step 5: Document Ripple
456
496
 
497
+ ```bash
498
+ 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-partition --step 5 --step-label "Document Ripple" 2>/dev/null || true
499
+ ```
500
+
457
501
  After creating domains and contracts, update affected documentation:
458
502
 
459
503
  ### Always update:
@@ -468,6 +512,10 @@ After creating domains and contracts, update affected documentation:
468
512
 
469
513
  ## Step 6: Test Verification
470
514
 
515
+ ```bash
516
+ 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-partition --step 6 --step-label "Test Verification" 2>/dev/null || true
517
+ ```
518
+
471
519
  Before finalizing the partition:
472
520
 
473
521
  1. **Run existing tests**: Execute the full test suite to confirm codebase is clean before domain work begins
@@ -476,6 +524,10 @@ Before finalizing the partition:
476
524
 
477
525
  ## Step 7: Validate
478
526
 
527
+ ```bash
528
+ 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-partition --step 7 --step-label "Validate" 2>/dev/null || true
529
+ ```
530
+
479
531
  Before finishing, verify:
480
532
  - [ ] Every file in `src/` is owned by exactly one domain
481
533
  - [ ] No domain scope overlaps with another
@@ -11,6 +11,10 @@ Per `.gsd-t/contracts/model-selection-contract.md` v1.0.0.
11
11
 
12
12
  ## Step 1: Load Full Context
13
13
 
14
+ ```bash
15
+ 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-plan --step 1 --step-label "Load Full Context" 2>/dev/null || true
16
+ ```
17
+
14
18
  Read ALL of these:
15
19
  1. `CLAUDE.md`
16
20
  2. `.gsd-t/progress.md`
@@ -25,6 +29,10 @@ Read ALL of these:
25
29
 
26
30
  ## Step 1.5: Graph-Enhanced Dependency Detection
27
31
 
32
+ ```bash
33
+ 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-plan --step 1 --step-label ".5: Graph-Enhanced Dependency Detection" 2>/dev/null || true
34
+ ```
35
+
28
36
  If `.gsd-t/graph/meta.json` exists (graph index is available):
29
37
  1. Query `findDuplicates` to detect when planned tasks would create duplicate functions across domains — flag for SharedCore extraction or deduplication
30
38
  2. Query `getImporters` for key modules to identify implicit task dependencies that might not be obvious from contracts alone
@@ -34,6 +42,10 @@ If graph is not available, skip this step.
34
42
 
35
43
  ## Step 1.7: Pre-Mortem — Historical Failure Analysis
36
44
 
45
+ ```bash
46
+ 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-plan --step 1 --step-label ".7: Pre-Mortem — Historical Failure Analysis" 2>/dev/null || true
47
+ ```
48
+
37
49
  Before creating task lists, check historical task-metrics for domain-level failure patterns from previous milestones:
38
50
 
39
51
  1. Run via Bash:
@@ -52,6 +64,10 @@ Before creating task lists, check historical task-metrics for domain-level failu
52
64
 
53
65
  ## Step 2: Create Task Lists Per Domain
54
66
 
67
+ ```bash
68
+ 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-plan --step 2 --step-label "Create Task Lists Per Domain" 2>/dev/null || true
69
+ ```
70
+
55
71
  ### SharedCore-First Pre-Check
56
72
 
57
73
  Before writing any domain task lists:
@@ -258,6 +274,10 @@ After creating task lists, append a traceability table to `docs/requirements.md`
258
274
 
259
275
  ## Step 3: Map Cross-Domain Dependencies
260
276
 
277
+ ```bash
278
+ 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-plan --step 3 --step-label "Map Cross-Domain Dependencies" 2>/dev/null || true
279
+ ```
280
+
261
281
  Update `.gsd-t/contracts/integration-points.md` with the full dependency graph **and wave groupings**:
262
282
 
263
283
  ```markdown
@@ -325,6 +345,10 @@ Each wave contains domains/tasks that can safely run in parallel (no shared file
325
345
 
326
346
  ## Step 4: Estimate Scope
327
347
 
348
+ ```bash
349
+ 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-plan --step 4 --step-label "Estimate Scope" 2>/dev/null || true
350
+ ```
351
+
328
352
  Add to each domain's `tasks.md`:
329
353
  ```markdown
330
354
  ## Execution Estimate
@@ -336,6 +360,10 @@ Add to each domain's `tasks.md`:
336
360
 
337
361
  ## Step 5: Document Ripple
338
362
 
363
+ ```bash
364
+ 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-plan --step 5 --step-label "Document Ripple" 2>/dev/null || true
365
+ ```
366
+
339
367
  After creating task lists and mapping dependencies, update affected documentation:
340
368
 
341
369
  ### Always update:
@@ -351,6 +379,10 @@ After creating task lists and mapping dependencies, update affected documentatio
351
379
 
352
380
  ## Step 6: Test Verification
353
381
 
382
+ ```bash
383
+ 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-plan --step 6 --step-label "Test Verification" 2>/dev/null || true
384
+ ```
385
+
354
386
  Before finalizing the plan:
355
387
 
356
388
  1. **Run existing tests**: Execute the full test suite to confirm codebase state before execution begins
@@ -359,6 +391,10 @@ Before finalizing the plan:
359
391
 
360
392
  ## Step 7: Plan Validation
361
393
 
394
+ ```bash
395
+ 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-plan --step 7 --step-label "Plan Validation" 2>/dev/null || true
396
+ ```
397
+
362
398
  Spawn a Task subagent to validate the plan before proceeding:
363
399
 
364
400
  ```
@@ -393,6 +429,10 @@ If validation FAIL, append each gap to `.gsd-t/qa-issues.md` (create with header
393
429
 
394
430
  ## Step 8: Update Progress
395
431
 
432
+ ```bash
433
+ 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-plan --step 8 --step-label "Update Progress" 2>/dev/null || true
434
+ ```
435
+
396
436
  Update `.gsd-t/progress.md`:
397
437
  - Set status to `PLANNED`
398
438
  - Update domain table with task counts
@@ -400,6 +440,10 @@ Update `.gsd-t/progress.md`:
400
440
 
401
441
  ## Step 9: Report
402
442
 
443
+ ```bash
444
+ 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-plan --step 9 --step-label "Report" 2>/dev/null || true
445
+ ```
446
+
403
447
  ### Autonomy Behavior
404
448
 
405
449
  **Level 3 (Full Auto)**: Log a brief status line (e.g., "✅ Plan complete — {N} tasks across {N} domains, {execution mode}") and auto-advance to the next phase. Do NOT wait for user input.
@@ -4,6 +4,10 @@ You are the lead agent taking a complete project vision and breaking it into a l
4
4
 
5
5
  ## Step 1: Gather Project Context
6
6
 
7
+ ```bash
8
+ 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-project --step 1 --step-label "Gather Project Context" 2>/dev/null || true
9
+ ```
10
+
7
11
  Read everything available:
8
12
  1. `CLAUDE.md` (if exists)
9
13
  2. `docs/` — any existing documentation
@@ -24,6 +28,10 @@ Do NOT proceed until you have enough context to make informed milestone decision
24
28
 
25
29
  ## Step 2: Identify the Full Scope
26
30
 
31
+ ```bash
32
+ 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-project --step 2 --step-label "Identify the Full Scope" 2>/dev/null || true
33
+ ```
34
+
27
35
  List ALL major capabilities the project needs. Group them into functional areas:
28
36
 
29
37
  ```markdown
@@ -66,6 +74,10 @@ Adjust these categories based on the actual project. Not every project needs all
66
74
 
67
75
  ## Step 3: Sequence into Milestones
68
76
 
77
+ ```bash
78
+ 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-project --step 3 --step-label "Sequence into Milestones" 2>/dev/null || true
79
+ ```
80
+
69
81
  Break functional areas into milestones following these principles:
70
82
 
71
83
  ### Sequencing Rules:
@@ -84,6 +96,10 @@ Break functional areas into milestones following these principles:
84
96
 
85
97
  ## Step 4: Write the Milestone Roadmap
86
98
 
99
+ ```bash
100
+ 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-project --step 4 --step-label "Write the Milestone Roadmap" 2>/dev/null || true
101
+ ```
102
+
87
103
  Create `.gsd-t/roadmap.md`:
88
104
 
89
105
  ```markdown
@@ -142,6 +158,10 @@ Create `.gsd-t/roadmap.md`:
142
158
 
143
159
  ## Step 5: Update Project State
144
160
 
161
+ ```bash
162
+ 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-project --step 5 --step-label "Update Project State" 2>/dev/null || true
163
+ ```
164
+
145
165
  Initialize or update `.gsd-t/progress.md`:
146
166
 
147
167
  ```markdown
@@ -168,6 +188,10 @@ Ensure `CLAUDE.md` exists and references the roadmap and tech stack.
168
188
 
169
189
  ## Step 6: Document Ripple
170
190
 
191
+ ```bash
192
+ 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-project --step 6 --step-label "Document Ripple" 2>/dev/null || true
193
+ ```
194
+
171
195
  After creating the roadmap and updating project state, verify all documentation is consistent:
172
196
 
173
197
  ### Always update:
@@ -185,6 +209,10 @@ After creating the roadmap and updating project state, verify all documentation
185
209
 
186
210
  ## Step 7: Test Verification
187
211
 
212
+ ```bash
213
+ 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-project --step 7 --step-label "Test Verification" 2>/dev/null || true
214
+ ```
215
+
188
216
  Before reporting to the user:
189
217
 
190
218
  1. **If existing code**: Run the full test suite to establish a baseline before milestone work begins
@@ -193,6 +221,10 @@ Before reporting to the user:
193
221
 
194
222
  ## Step 8: Report to User
195
223
 
224
+ ```bash
225
+ 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-project --step 8 --step-label "Report to User" 2>/dev/null || true
226
+ ```
227
+
196
228
  Present:
197
229
  1. The full milestone roadmap (summary view)
198
230
  2. Total milestone count and rough estimate