@tekyzinc/gsd-t 2.50.12 → 2.53.10
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 +24 -0
- package/README.md +379 -372
- package/bin/component-registry.js +250 -0
- package/bin/graph-cgc.js +510 -510
- package/bin/graph-indexer.js +147 -147
- package/bin/graph-overlay.js +195 -195
- package/bin/graph-parsers.js +327 -327
- package/bin/graph-query.js +453 -452
- package/bin/graph-store.js +154 -154
- package/bin/qa-calibrator.js +194 -0
- package/bin/scan-data-collector.js +153 -153
- package/bin/scan-diagrams-generators.js +187 -187
- package/bin/scan-diagrams.js +79 -79
- package/bin/scan-renderer.js +92 -92
- package/bin/scan-report-sections.js +121 -121
- package/bin/scan-report.js +184 -184
- package/bin/scan-schema-parsers.js +199 -199
- package/bin/scan-schema.js +103 -103
- package/bin/token-budget.js +246 -0
- package/commands/Claude-md.md +10 -10
- package/commands/branch.md +15 -15
- package/commands/checkin.md +45 -45
- package/commands/global-change.md +209 -209
- package/commands/gsd-t-audit.md +199 -0
- package/commands/gsd-t-backlog-add.md +94 -94
- package/commands/gsd-t-backlog-edit.md +111 -111
- package/commands/gsd-t-backlog-list.md +63 -63
- package/commands/gsd-t-backlog-move.md +94 -94
- package/commands/gsd-t-backlog-promote.md +123 -123
- package/commands/gsd-t-backlog-remove.md +86 -86
- package/commands/gsd-t-backlog-settings.md +158 -158
- package/commands/gsd-t-complete-milestone.md +528 -515
- package/commands/gsd-t-debug.md +506 -399
- package/commands/gsd-t-discuss.md +174 -174
- package/commands/gsd-t-execute.md +758 -634
- package/commands/gsd-t-feature.md +276 -276
- package/commands/gsd-t-health.md +142 -142
- package/commands/gsd-t-help.md +465 -457
- package/commands/gsd-t-impact.md +302 -302
- package/commands/gsd-t-init.md +320 -280
- package/commands/gsd-t-integrate.md +365 -249
- package/commands/gsd-t-milestone.md +87 -87
- package/commands/gsd-t-partition.md +442 -361
- package/commands/gsd-t-pause.md +82 -82
- package/commands/gsd-t-plan.md +345 -344
- package/commands/gsd-t-populate.md +111 -111
- package/commands/gsd-t-prd.md +326 -326
- package/commands/gsd-t-project.md +211 -211
- package/commands/gsd-t-promote-debt.md +123 -123
- package/commands/gsd-t-prompt.md +137 -137
- package/commands/gsd-t-qa.md +266 -266
- package/commands/gsd-t-quick.md +357 -234
- package/commands/gsd-t-reflect.md +134 -134
- package/commands/gsd-t-resume.md +72 -72
- package/commands/gsd-t-scan.md +615 -615
- package/commands/gsd-t-setup.md +76 -0
- package/commands/gsd-t-status.md +192 -166
- package/commands/gsd-t-test-sync.md +381 -381
- package/commands/gsd-t-triage-and-merge.md +171 -171
- package/commands/gsd-t-verify.md +382 -382
- package/commands/gsd-t-visualize.md +118 -118
- package/commands/gsd-t-wave.md +401 -378
- package/docs/GSD-T-README.md +425 -422
- package/docs/architecture.md +385 -369
- package/docs/harness-design-analysis.md +371 -0
- package/docs/infrastructure.md +205 -205
- package/docs/prd-graph-engine.md +398 -398
- package/docs/prd-gsd2-hybrid.md +559 -559
- package/docs/prd-harness-evolution.md +583 -0
- package/docs/requirements.md +14 -0
- package/docs/workflows.md +226 -226
- package/examples/.gsd-t/domains/example-domain/scope.md +13 -13
- package/package.json +40 -40
- package/scripts/gsd-t-auto-route.js +39 -39
- package/scripts/gsd-t-dashboard-mockup.html +1143 -1143
- package/scripts/gsd-t-dashboard-server.js +171 -171
- package/scripts/gsd-t-dashboard.html +262 -262
- package/scripts/gsd-t-event-writer.js +128 -128
- package/scripts/gsd-t-statusline.js +94 -94
- package/scripts/gsd-t-tools.js +175 -175
- package/templates/CLAUDE-global.md +639 -614
- package/templates/CLAUDE-project.md +24 -0
- package/templates/backlog-settings.md +18 -18
- package/templates/backlog.md +1 -1
- package/templates/progress.md +40 -40
- package/templates/shared-services-contract.md +60 -60
- package/templates/stacks/desktop.ini +2 -2
- package/bin/desktop.ini +0 -2
- package/commands/desktop.ini +0 -2
- package/docs/ci-examples/desktop.ini +0 -2
- package/docs/desktop.ini +0 -2
- package/examples/.gsd-t/contracts/desktop.ini +0 -2
- package/examples/.gsd-t/desktop.ini +0 -2
- package/examples/.gsd-t/domains/desktop.ini +0 -2
- package/examples/.gsd-t/domains/example-domain/desktop.ini +0 -2
- package/examples/desktop.ini +0 -2
- package/examples/rules/desktop.ini +0 -2
- package/scripts/desktop.ini +0 -2
- package/templates/desktop.ini +0 -2
package/commands/gsd-t-plan.md
CHANGED
|
@@ -1,344 +1,345 @@
|
|
|
1
|
-
# GSD-T: Plan — Create Domain Task Lists with Dependencies
|
|
2
|
-
|
|
3
|
-
You are the lead agent creating atomic execution plans for each domain. This phase is ALWAYS single-session — one agent with full context across all domains to ensure consistency.
|
|
4
|
-
|
|
5
|
-
## Step 1: Load Full Context
|
|
6
|
-
|
|
7
|
-
Read ALL of these:
|
|
8
|
-
1. `CLAUDE.md`
|
|
9
|
-
2. `.gsd-t/progress.md`
|
|
10
|
-
3. `.gsd-t/contracts/` — every contract file
|
|
11
|
-
4. `.gsd-t/domains/*/scope.md` — every domain scope
|
|
12
|
-
5. `.gsd-t/domains/*/constraints.md` — every domain constraint
|
|
13
|
-
6. `docs/` — requirements, architecture, schema, design
|
|
14
|
-
7. Existing source code (if any) — understand current state
|
|
15
|
-
8. `.gsd-t/CONTEXT.md` (if exists — from discuss phase) — **MANDATORY READ if present**
|
|
16
|
-
|
|
17
|
-
**If CONTEXT.md exists:** Every Locked Decision listed in it MUST be mapped to at least one task in Step 2. Do NOT proceed to execute if any Locked Decision is unmapped.
|
|
18
|
-
|
|
19
|
-
## Step 1.5: Graph-Enhanced Dependency Detection
|
|
20
|
-
|
|
21
|
-
If `.gsd-t/graph/meta.json` exists (graph index is available):
|
|
22
|
-
1. Query `findDuplicates` to detect when planned tasks would create duplicate functions across domains — flag for SharedCore extraction or deduplication
|
|
23
|
-
2. Query `getImporters` for key modules to identify implicit task dependencies that might not be obvious from contracts alone
|
|
24
|
-
3. Feed these findings into the Cross-Domain Duplicate Operation Scan and dependency mapping in Steps 2–3
|
|
25
|
-
|
|
26
|
-
If graph is not available, skip this step.
|
|
27
|
-
|
|
28
|
-
## Step 1.7: Pre-Mortem — Historical Failure Analysis
|
|
29
|
-
|
|
30
|
-
Before creating task lists, check historical task-metrics for domain-level failure patterns from previous milestones:
|
|
31
|
-
|
|
32
|
-
1. Run via Bash:
|
|
33
|
-
`node -e "const c = require('./bin/metrics-collector.js'); const domains = [/* list domain names from scope files */]; domains.forEach(d => { const w = c.getPreFlightWarnings(d); if(w.length) w.forEach(x => console.log('⚠️ ' + x)); });" 2>/dev/null || true`
|
|
34
|
-
|
|
35
|
-
2. If any domain has `first_pass_rate < 0.6` historically:
|
|
36
|
-
- Display warning inline: `⚠️ Domain {name} has historically low first-pass rate ({rate}%). Consider: smaller tasks, more explicit acceptance criteria, or additional contract detail.`
|
|
37
|
-
- This is **non-blocking** — it informs task design, does not prevent planning.
|
|
38
|
-
|
|
39
|
-
3. If `.gsd-t/metrics/task-metrics.jsonl` does not exist: skip this step silently (first milestone, no historical data).
|
|
40
|
-
|
|
41
|
-
4. **Rule-based pre-mortem**: Run via Bash:
|
|
42
|
-
`node -e "const re = require('./bin/rule-engine.js'); const domains = [/* list domain names */]; domains.forEach(d => { const rules = re.getPreMortemRules(d); if(rules.length) rules.forEach(r => console.log('RULE ' + r.id + ': ' + r.name + ' — historically triggered for domains like ' + d)); });" 2>/dev/null || true`
|
|
43
|
-
|
|
44
|
-
If matching rules found: display warnings inline (non-blocking — informs task design). Falls back gracefully if rules.jsonl does not exist or is empty.
|
|
45
|
-
|
|
46
|
-
## Step 2: Create Task Lists Per Domain
|
|
47
|
-
|
|
48
|
-
### SharedCore-First Pre-Check
|
|
49
|
-
|
|
50
|
-
Before writing any domain task lists:
|
|
51
|
-
1. Does `.gsd-t/contracts/shared-services-contract.md` exist?
|
|
52
|
-
- **YES**: A `shared-core` domain has been identified. Plan its tasks first. All client-surface domains that consume SharedCore operations are BLOCKED BY shared-core until its tasks complete. Use `BLOCKED BY shared-core Task {N}` in the relevant client domain task lists.
|
|
53
|
-
- **NO**: Proceed. The Cross-Domain Duplicate Operation Scan (below) will catch any shared operations missed during partition.
|
|
54
|
-
|
|
55
|
-
For each domain, write `.gsd-t/domains/{domain-name}/tasks.md`:
|
|
56
|
-
|
|
57
|
-
```markdown
|
|
58
|
-
# Tasks: {domain-name}
|
|
59
|
-
|
|
60
|
-
## Summary
|
|
61
|
-
{1-2 sentence description of what this domain delivers when all tasks complete}
|
|
62
|
-
|
|
63
|
-
## Tasks
|
|
64
|
-
|
|
65
|
-
### Task 1: {descriptive name}
|
|
66
|
-
- **Files**: {files to create or modify}
|
|
67
|
-
- **Contract refs**: {which contracts this implements}
|
|
68
|
-
- **Dependencies**: NONE | BLOCKED by {domain} Task {N}
|
|
69
|
-
- **Acceptance criteria**:
|
|
70
|
-
- {specific testable outcome}
|
|
71
|
-
- {specific testable outcome}
|
|
72
|
-
|
|
73
|
-
### Task 2: {descriptive name}
|
|
74
|
-
- **Files**: {files to create or modify}
|
|
75
|
-
- **Contract refs**: {which contracts this implements}
|
|
76
|
-
- **Dependencies**: Requires Task 1 (within domain)
|
|
77
|
-
- **Acceptance criteria**:
|
|
78
|
-
- {specific testable outcome}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Task Design Rules:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
- Task
|
|
97
|
-
- Task
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
>
|
|
102
|
-
> - Task {N}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
>
|
|
129
|
-
> - `{operation}` — found in: {domain-A} Task {N}, {domain-
|
|
130
|
-
>
|
|
131
|
-
>
|
|
132
|
-
>
|
|
133
|
-
>
|
|
134
|
-
>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
>
|
|
150
|
-
>
|
|
151
|
-
>
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
| REQ-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
- Every
|
|
171
|
-
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
- **
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
- **
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
- .
|
|
282
|
-
- .gsd-t/
|
|
283
|
-
-
|
|
284
|
-
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
- If CTX_PCT >=
|
|
309
|
-
|
|
310
|
-
`|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
-
|
|
320
|
-
-
|
|
321
|
-
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
1
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
- **Solo
|
|
335
|
-
- **
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
1
|
+
# GSD-T: Plan — Create Domain Task Lists with Dependencies
|
|
2
|
+
|
|
3
|
+
You are the lead agent creating atomic execution plans for each domain. This phase is ALWAYS single-session — one agent with full context across all domains to ensure consistency.
|
|
4
|
+
|
|
5
|
+
## Step 1: Load Full Context
|
|
6
|
+
|
|
7
|
+
Read ALL of these:
|
|
8
|
+
1. `CLAUDE.md`
|
|
9
|
+
2. `.gsd-t/progress.md`
|
|
10
|
+
3. `.gsd-t/contracts/` — every contract file
|
|
11
|
+
4. `.gsd-t/domains/*/scope.md` — every domain scope
|
|
12
|
+
5. `.gsd-t/domains/*/constraints.md` — every domain constraint
|
|
13
|
+
6. `docs/` — requirements, architecture, schema, design
|
|
14
|
+
7. Existing source code (if any) — understand current state
|
|
15
|
+
8. `.gsd-t/CONTEXT.md` (if exists — from discuss phase) — **MANDATORY READ if present**
|
|
16
|
+
|
|
17
|
+
**If CONTEXT.md exists:** Every Locked Decision listed in it MUST be mapped to at least one task in Step 2. Do NOT proceed to execute if any Locked Decision is unmapped.
|
|
18
|
+
|
|
19
|
+
## Step 1.5: Graph-Enhanced Dependency Detection
|
|
20
|
+
|
|
21
|
+
If `.gsd-t/graph/meta.json` exists (graph index is available):
|
|
22
|
+
1. Query `findDuplicates` to detect when planned tasks would create duplicate functions across domains — flag for SharedCore extraction or deduplication
|
|
23
|
+
2. Query `getImporters` for key modules to identify implicit task dependencies that might not be obvious from contracts alone
|
|
24
|
+
3. Feed these findings into the Cross-Domain Duplicate Operation Scan and dependency mapping in Steps 2–3
|
|
25
|
+
|
|
26
|
+
If graph is not available, skip this step.
|
|
27
|
+
|
|
28
|
+
## Step 1.7: Pre-Mortem — Historical Failure Analysis
|
|
29
|
+
|
|
30
|
+
Before creating task lists, check historical task-metrics for domain-level failure patterns from previous milestones:
|
|
31
|
+
|
|
32
|
+
1. Run via Bash:
|
|
33
|
+
`node -e "const c = require('./bin/metrics-collector.js'); const domains = [/* list domain names from scope files */]; domains.forEach(d => { const w = c.getPreFlightWarnings(d); if(w.length) w.forEach(x => console.log('⚠️ ' + x)); });" 2>/dev/null || true`
|
|
34
|
+
|
|
35
|
+
2. If any domain has `first_pass_rate < 0.6` historically:
|
|
36
|
+
- Display warning inline: `⚠️ Domain {name} has historically low first-pass rate ({rate}%). Consider: smaller tasks, more explicit acceptance criteria, or additional contract detail.`
|
|
37
|
+
- This is **non-blocking** — it informs task design, does not prevent planning.
|
|
38
|
+
|
|
39
|
+
3. If `.gsd-t/metrics/task-metrics.jsonl` does not exist: skip this step silently (first milestone, no historical data).
|
|
40
|
+
|
|
41
|
+
4. **Rule-based pre-mortem**: Run via Bash:
|
|
42
|
+
`node -e "const re = require('./bin/rule-engine.js'); const domains = [/* list domain names */]; domains.forEach(d => { const rules = re.getPreMortemRules(d); if(rules.length) rules.forEach(r => console.log('RULE ' + r.id + ': ' + r.name + ' — historically triggered for domains like ' + d)); });" 2>/dev/null || true`
|
|
43
|
+
|
|
44
|
+
If matching rules found: display warnings inline (non-blocking — informs task design). Falls back gracefully if rules.jsonl does not exist or is empty.
|
|
45
|
+
|
|
46
|
+
## Step 2: Create Task Lists Per Domain
|
|
47
|
+
|
|
48
|
+
### SharedCore-First Pre-Check
|
|
49
|
+
|
|
50
|
+
Before writing any domain task lists:
|
|
51
|
+
1. Does `.gsd-t/contracts/shared-services-contract.md` exist?
|
|
52
|
+
- **YES**: A `shared-core` domain has been identified. Plan its tasks first. All client-surface domains that consume SharedCore operations are BLOCKED BY shared-core until its tasks complete. Use `BLOCKED BY shared-core Task {N}` in the relevant client domain task lists.
|
|
53
|
+
- **NO**: Proceed. The Cross-Domain Duplicate Operation Scan (below) will catch any shared operations missed during partition.
|
|
54
|
+
|
|
55
|
+
For each domain, write `.gsd-t/domains/{domain-name}/tasks.md`:
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
# Tasks: {domain-name}
|
|
59
|
+
|
|
60
|
+
## Summary
|
|
61
|
+
{1-2 sentence description of what this domain delivers when all tasks complete}
|
|
62
|
+
|
|
63
|
+
## Tasks
|
|
64
|
+
|
|
65
|
+
### Task 1: {descriptive name}
|
|
66
|
+
- **Files**: {files to create or modify}
|
|
67
|
+
- **Contract refs**: {which contracts this implements}
|
|
68
|
+
- **Dependencies**: NONE | BLOCKED by {domain} Task {N}
|
|
69
|
+
- **Acceptance criteria**:
|
|
70
|
+
- {specific testable outcome}
|
|
71
|
+
- {specific testable outcome}
|
|
72
|
+
|
|
73
|
+
### Task 2: {descriptive name}
|
|
74
|
+
- **Files**: {files to create or modify}
|
|
75
|
+
- **Contract refs**: {which contracts this implements}
|
|
76
|
+
- **Dependencies**: Requires Task 1 (within domain)
|
|
77
|
+
- **Acceptance criteria**:
|
|
78
|
+
- {specific testable outcome}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Task Design Rules:
|
|
82
|
+
0. **UI tasks — reference the design brief**: If `.gsd-t/contracts/design-brief.md` exists, UI task descriptions must reference it. Include a note like: "Follow the color palette, typography, spacing, and component patterns defined in `.gsd-t/contracts/design-brief.md`." This ensures visual consistency without repeating spec details in every task.
|
|
83
|
+
1. **Atomic**: Each task produces a working, testable increment
|
|
84
|
+
2. **Self-contained context**: A fresh agent with only CLAUDE.md, the domain's scope/constraints, the relevant contracts, and the task description should be able to execute it
|
|
85
|
+
3. **File-scoped**: Each task lists exactly which files it touches — no surprises
|
|
86
|
+
4. **Contract-bound**: Every task that crosses a domain boundary must reference the specific contract it implements
|
|
87
|
+
5. **Ordered**: Tasks within a domain are numbered in execution order
|
|
88
|
+
6. **No implicit knowledge**: Don't assume the executing agent remembers previous tasks — reference contracts and files explicitly
|
|
89
|
+
7. **Context-window fit**: Each task MUST be executable within a single context window. Apply the scope validation heuristics below.
|
|
90
|
+
|
|
91
|
+
### Task Scope Validation
|
|
92
|
+
|
|
93
|
+
After writing each task, apply this heuristic check before finalizing:
|
|
94
|
+
|
|
95
|
+
**Splitting candidates — flag if ANY of these are true:**
|
|
96
|
+
- Task lists **more than 5 files** to modify or create
|
|
97
|
+
- Task has **more than 3 complex dependencies** (other tasks, contracts, or external systems it must read and understand)
|
|
98
|
+
- Task description spans multiple distinct concerns (e.g., "implement X and also refactor Y and update Z docs")
|
|
99
|
+
|
|
100
|
+
**Warning threshold:** If a task is flagged, emit:
|
|
101
|
+
> ⚠️ **Task scope warning — {domain} Task {N}**: Estimated context load is high ({N} files, {N} dependencies). This task may approach the 70% context window threshold. Consider splitting into:
|
|
102
|
+
> - Task {N}a: {first concern}
|
|
103
|
+
> - Task {N}b: {second concern}
|
|
104
|
+
|
|
105
|
+
**Auto-split rule (Level 3 Full Auto):** If a task has >5 files AND >3 dependencies, split it automatically. Renumber subsequent tasks. Document the split rationale in the task's Dependencies field.
|
|
106
|
+
|
|
107
|
+
**Guidance for estimating context size:**
|
|
108
|
+
- Each file to read ≈ 1–5% of context window (varies by file size)
|
|
109
|
+
- CLAUDE.md + scope.md + constraints.md + contracts ≈ 15–25% baseline overhead
|
|
110
|
+
- Tasks with >5 files or >3 cross-domain contracts commonly exceed 70% total context
|
|
111
|
+
|
|
112
|
+
This rule implements the "task must fit in one context window" constraint — a task that compacts its subagent is a task that produces incomplete or corrupt output.
|
|
113
|
+
|
|
114
|
+
### Cross-Domain Duplicate Operation Scan
|
|
115
|
+
|
|
116
|
+
After creating all domain task lists, scan for operations that appear in more than one domain.
|
|
117
|
+
|
|
118
|
+
**Check for duplicate task descriptions, function names, or operation verbs** across all `tasks.md` files:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
For each operation in each domain's task list:
|
|
122
|
+
Does this operation appear (by name or clear equivalent) in another domain's task list?
|
|
123
|
+
→ YES → flag as duplicate candidate
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**If duplicates found:**
|
|
127
|
+
|
|
128
|
+
> ⚠️ **Duplicate operations detected** — the following operations appear in multiple domains:
|
|
129
|
+
> - `{operation}` — found in: {domain-A} Task {N}, {domain-B} Task {N}
|
|
130
|
+
> - `{operation}` — found in: {domain-A} Task {N}, {domain-C} Task {N}
|
|
131
|
+
>
|
|
132
|
+
> **Options:**
|
|
133
|
+
> 1. If a `shared-core` domain exists → reassign these tasks to shared-core
|
|
134
|
+
> 2. If no shared-core → extract to a new `shared-core` domain (go back to partition and add it)
|
|
135
|
+
> 3. If the operations are truly surface-specific variants → document the distinction explicitly in each domain's constraints.md to prevent future confusion
|
|
136
|
+
|
|
137
|
+
**Level 3 (Full Auto)**: If shared-core exists, move the duplicates there automatically. If not, add a task to the first affected domain's list: "Extract `{operation}` to shared-core — coordinate with {domain-B} before implementing".
|
|
138
|
+
|
|
139
|
+
**If no duplicates found:**
|
|
140
|
+
|
|
141
|
+
> ✅ No duplicate operations detected across domains.
|
|
142
|
+
|
|
143
|
+
### SharedCore Contract Compliance Check
|
|
144
|
+
|
|
145
|
+
If `.gsd-t/contracts/shared-services-contract.md` exists, run a second pass:
|
|
146
|
+
|
|
147
|
+
For each client-surface domain's task list, compare task operations against the SharedCore contract's "Shared Operations" table. Flag any task that implements an operation already owned by SharedCore:
|
|
148
|
+
|
|
149
|
+
> ⚠️ **SharedCore contract violation** — the following tasks reimplement operations owned by SharedCore:
|
|
150
|
+
> - {domain} Task {N}: implements `{operation}` — already owned by SharedCore per shared-services-contract.md
|
|
151
|
+
>
|
|
152
|
+
> Fix: Change these tasks to CALL the SharedCore function rather than implementing it independently.
|
|
153
|
+
|
|
154
|
+
If no violations: `✅ All client domains reference SharedCore correctly.`
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### REQ Traceability
|
|
159
|
+
|
|
160
|
+
After creating task lists, append a traceability table to `docs/requirements.md`:
|
|
161
|
+
|
|
162
|
+
```markdown
|
|
163
|
+
## Requirements Traceability (updated by plan phase)
|
|
164
|
+
| REQ-ID | Requirement Summary | Domain | Task(s) | Status |
|
|
165
|
+
|--------|---------------------|--------|---------|--------|
|
|
166
|
+
| REQ-001 | {summary} | {domain} | Task 1, Task 3 | pending |
|
|
167
|
+
| REQ-002 | {summary} | {domain} | Task 2 | pending |
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
- Every REQ-ID must map to at least one domain/task — orphaned requirements are a planning gap
|
|
171
|
+
- Every task group should trace back to at least one REQ-ID — tasks with no REQ reference may be scope creep
|
|
172
|
+
- Report: orphaned requirements (no task) and unanchored tasks (no REQ)
|
|
173
|
+
|
|
174
|
+
## Step 3: Map Cross-Domain Dependencies
|
|
175
|
+
|
|
176
|
+
Update `.gsd-t/contracts/integration-points.md` with the full dependency graph **and wave groupings**:
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
# Integration Points
|
|
180
|
+
|
|
181
|
+
## Dependency Graph
|
|
182
|
+
|
|
183
|
+
### Independent (can start immediately)
|
|
184
|
+
- data-layer: Tasks 1-3
|
|
185
|
+
- auth: Tasks 1-2
|
|
186
|
+
- ui: Tasks 1-2
|
|
187
|
+
|
|
188
|
+
### First Checkpoint
|
|
189
|
+
- GATE: data-layer Task 3 (schema migrations) must complete
|
|
190
|
+
- UNLOCKS: auth Task 3 (user lookup), ui Task 3 (data fetching)
|
|
191
|
+
- VERIFY: Lead confirms schema matches schema-contract.md
|
|
192
|
+
|
|
193
|
+
### Second Checkpoint
|
|
194
|
+
- GATE: auth Task 4 (auth middleware) must complete
|
|
195
|
+
- UNLOCKS: ui Task 5 (protected routes)
|
|
196
|
+
- VERIFY: Lead confirms auth endpoints match api-contract.md
|
|
197
|
+
|
|
198
|
+
## Wave Execution Groups
|
|
199
|
+
|
|
200
|
+
Waves allow parallel execution within a wave and sequential execution between waves.
|
|
201
|
+
Each wave contains domains/tasks that can safely run in parallel (no shared files, no cross-domain dependencies within the wave).
|
|
202
|
+
|
|
203
|
+
### Wave 1 — Independent (parallel)
|
|
204
|
+
- data-layer: Tasks 1-3
|
|
205
|
+
- auth: Tasks 1-2
|
|
206
|
+
- **Shared files**: NONE — safe to run in parallel
|
|
207
|
+
- **Completes when**: All listed tasks done
|
|
208
|
+
|
|
209
|
+
### Wave 2 — After Wave 1 Checkpoint (parallel)
|
|
210
|
+
- CHECKPOINT: Lead verifies schema-contract.md before Wave 2 starts
|
|
211
|
+
- auth: Tasks 3-4
|
|
212
|
+
- ui: Tasks 1-2
|
|
213
|
+
- **Shared files**: NONE — safe to run in parallel
|
|
214
|
+
- **Completes when**: All listed tasks done
|
|
215
|
+
|
|
216
|
+
### Wave 3 — After Wave 2 Checkpoint (sequential)
|
|
217
|
+
- CHECKPOINT: Lead verifies api-contract.md before Wave 3 starts
|
|
218
|
+
- ui: Tasks 3-5
|
|
219
|
+
- **Note**: Sequential — each task depends on the previous
|
|
220
|
+
|
|
221
|
+
### Integration
|
|
222
|
+
- INTEGRATION: Wire all domains together
|
|
223
|
+
|
|
224
|
+
## Execution Order (for solo mode)
|
|
225
|
+
1. data-layer Tasks 1-3
|
|
226
|
+
2. auth Tasks 1-2 (parallel-safe with data-layer)
|
|
227
|
+
3. CHECKPOINT: verify schema contract
|
|
228
|
+
4. auth Tasks 3-4
|
|
229
|
+
5. ui Tasks 1-2 (parallel-safe with auth 3-4)
|
|
230
|
+
6. CHECKPOINT: verify api contract
|
|
231
|
+
7. ui Tasks 3-5
|
|
232
|
+
8. INTEGRATION: wire everything together
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Wave Grouping Rules:
|
|
236
|
+
1. **Same wave** = no shared files, no dependency between them
|
|
237
|
+
2. **Different wave** = one depends on the other's output, OR they modify the same file
|
|
238
|
+
3. **CHECKPOINT between waves** = lead verifies contract compliance before unlocking next wave
|
|
239
|
+
4. Always check domain `scope.md` files for file ownership — overlapping files → different waves
|
|
240
|
+
|
|
241
|
+
## Step 4: Estimate Scope
|
|
242
|
+
|
|
243
|
+
Add to each domain's `tasks.md`:
|
|
244
|
+
```markdown
|
|
245
|
+
## Execution Estimate
|
|
246
|
+
- Total tasks: {N}
|
|
247
|
+
- Independent tasks (no blockers): {N}
|
|
248
|
+
- Blocked tasks (waiting on other domains): {N}
|
|
249
|
+
- Estimated checkpoints: {N}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Step 5: Document Ripple
|
|
253
|
+
|
|
254
|
+
After creating task lists and mapping dependencies, update affected documentation:
|
|
255
|
+
|
|
256
|
+
### Always update:
|
|
257
|
+
1. **`.gsd-t/progress.md`** — Updated in Step 5, but verify Decision Log includes planning decisions and rationale
|
|
258
|
+
|
|
259
|
+
### Check if affected:
|
|
260
|
+
2. **`docs/requirements.md`** — If planning revealed missing, ambiguous, or conflicting requirements, update them
|
|
261
|
+
3. **`docs/architecture.md`** — If the task breakdown reveals new components or clarifies data flow, update it
|
|
262
|
+
4. **`.gsd-t/contracts/`** — If planning revealed contract gaps or needed additional detail, update them
|
|
263
|
+
5. **Domain `constraints.md`** — If planning revealed new constraints (task ordering, shared resources), add them
|
|
264
|
+
|
|
265
|
+
### Skip what's not affected.
|
|
266
|
+
|
|
267
|
+
## Step 6: Test Verification
|
|
268
|
+
|
|
269
|
+
Before finalizing the plan:
|
|
270
|
+
|
|
271
|
+
1. **Run existing tests**: Execute the full test suite to confirm codebase state before execution begins
|
|
272
|
+
2. **Verify passing**: Document any pre-existing failures — assign them to appropriate domain tasks
|
|
273
|
+
3. **Include test tasks**: Ensure each domain's task list includes test creation/update tasks where acceptance criteria require verification
|
|
274
|
+
|
|
275
|
+
## Step 7: Plan Validation
|
|
276
|
+
|
|
277
|
+
Spawn a Task subagent to validate the plan before proceeding:
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
Task subagent (general-purpose, model: haiku):
|
|
281
|
+
"Validate this GSD-T plan. Read:
|
|
282
|
+
- .gsd-t/domains/*/tasks.md (all task lists)
|
|
283
|
+
- .gsd-t/contracts/ (all contracts)
|
|
284
|
+
- docs/requirements.md (including traceability table)
|
|
285
|
+
- .gsd-t/CONTEXT.md (if exists)
|
|
286
|
+
|
|
287
|
+
Check:
|
|
288
|
+
1. REQ coverage: every REQ-ID in requirements.md maps to at least one task
|
|
289
|
+
2. Locked Decisions (from CONTEXT.md if present): every Locked Decision maps to at least one task
|
|
290
|
+
3. Task completeness: every task has files, contract refs, and acceptance criteria
|
|
291
|
+
4. Cross-domain dependencies: all BLOCKED-BY references point to real tasks
|
|
292
|
+
5. Contract existence: every task referencing a contract has that contract file present
|
|
293
|
+
|
|
294
|
+
Report: PASS (all checks pass) or FAIL with specific gaps listed."
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**OBSERVABILITY LOGGING (MANDATORY):**
|
|
298
|
+
Before spawning — run via Bash:
|
|
299
|
+
`T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
|
|
300
|
+
After subagent returns — run via Bash:
|
|
301
|
+
`T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
|
|
302
|
+
Compute tokens and compaction:
|
|
303
|
+
- No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
|
|
304
|
+
- Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
|
|
305
|
+
Compute context utilization — run via Bash:
|
|
306
|
+
`if [ "${CLAUDE_CONTEXT_TOKENS_MAX:-0}" -gt 0 ]; then CTX_PCT=$(echo "scale=1; ${CLAUDE_CONTEXT_TOKENS_USED:-0} * 100 / ${CLAUDE_CONTEXT_TOKENS_MAX}" | bc); else CTX_PCT="N/A"; fi`
|
|
307
|
+
Alert on context thresholds (display to user inline):
|
|
308
|
+
- If CTX_PCT >= 85: `echo "🔴 CRITICAL: Context at ${CTX_PCT}% — compaction likely. Task MUST be split."`
|
|
309
|
+
- If CTX_PCT >= 70: `echo "⚠️ WARNING: Context at ${CTX_PCT}% — approaching compaction threshold. Consider splitting in plan."`
|
|
310
|
+
Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted | Domain | Task | Ctx% |` if missing):
|
|
311
|
+
`| {DT_START} | {DT_END} | gsd-t-plan | Step 7 | haiku | {DURATION}s | {PASS/FAIL}, iteration {N} | {TOKENS} | {COMPACTED} | | | {CTX_PCT} |`
|
|
312
|
+
If validation FAIL, append each gap to `.gsd-t/qa-issues.md` (create with header `| Date | Command | Step | Model | Duration(s) | Severity | Finding |` if missing):
|
|
313
|
+
`| {DT_START} | gsd-t-plan | Step 7 | haiku | {DURATION}s | medium | {gap description} |`
|
|
314
|
+
|
|
315
|
+
**If FAIL**: Fix the identified gaps (up to 3 iterations). If still failing after 3 iterations, STOP and report to user with the specific gaps. Plan cannot proceed until validation PASSES.
|
|
316
|
+
|
|
317
|
+
## Step 8: Update Progress
|
|
318
|
+
|
|
319
|
+
Update `.gsd-t/progress.md`:
|
|
320
|
+
- Set status to `PLANNED`
|
|
321
|
+
- Update domain table with task counts
|
|
322
|
+
- Record any planning decisions in the Decision Log
|
|
323
|
+
|
|
324
|
+
## Step 9: Report
|
|
325
|
+
|
|
326
|
+
### Autonomy Behavior
|
|
327
|
+
|
|
328
|
+
**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.
|
|
329
|
+
|
|
330
|
+
**Level 1–2**: Present to the user:
|
|
331
|
+
1. Task count per domain
|
|
332
|
+
2. Dependency graph (which domains block which)
|
|
333
|
+
3. Recommended execution mode:
|
|
334
|
+
- **Solo sequential**: < 8 total tasks or heavily interdependent
|
|
335
|
+
- **Solo interleaved**: 8-15 tasks with some independence
|
|
336
|
+
- **Team parallel**: 15+ tasks with 3+ independent starting points
|
|
337
|
+
4. Any ambiguities found during planning that need user input
|
|
338
|
+
|
|
339
|
+
Wait for confirmation before proceeding.
|
|
340
|
+
|
|
341
|
+
$ARGUMENTS
|
|
342
|
+
|
|
343
|
+
## Auto-Clear
|
|
344
|
+
|
|
345
|
+
All work is committed to project files. Execute `/clear` to free the context window for the next command.
|