@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-quick.md
CHANGED
|
@@ -1,234 +1,357 @@
|
|
|
1
|
-
# GSD-T: Quick — Fast Task Execution with Contract Awareness
|
|
2
|
-
|
|
3
|
-
You are executing a small, focused task that doesn't need full phase planning. This is for bug fixes, config changes, small features, and ad-hoc work.
|
|
4
|
-
|
|
5
|
-
## Step 0: Launch via Subagent
|
|
6
|
-
|
|
7
|
-
To give this task a fresh context window and prevent compaction during consecutive quick runs, always execute via a Task subagent.
|
|
8
|
-
|
|
9
|
-
**If you are the orchestrating agent** (you received the slash command directly):
|
|
10
|
-
|
|
11
|
-
**OBSERVABILITY LOGGING (MANDATORY):**
|
|
12
|
-
Before spawning — run via Bash:
|
|
13
|
-
`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}`
|
|
14
|
-
|
|
15
|
-
**
|
|
16
|
-
|
|
17
|
-
Run via Bash
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
grep -q '"
|
|
41
|
-
grep -q '"
|
|
42
|
-
grep -q '"
|
|
43
|
-
grep -
|
|
44
|
-
grep -
|
|
45
|
-
grep -qE '"(
|
|
46
|
-
grep -
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
[ -f "
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
1
|
+
# GSD-T: Quick — Fast Task Execution with Contract Awareness
|
|
2
|
+
|
|
3
|
+
You are executing a small, focused task that doesn't need full phase planning. This is for bug fixes, config changes, small features, and ad-hoc work.
|
|
4
|
+
|
|
5
|
+
## Step 0: Launch via Subagent
|
|
6
|
+
|
|
7
|
+
To give this task a fresh context window and prevent compaction during consecutive quick runs, always execute via a Task subagent.
|
|
8
|
+
|
|
9
|
+
**If you are the orchestrating agent** (you received the slash command directly):
|
|
10
|
+
|
|
11
|
+
**OBSERVABILITY LOGGING (MANDATORY):**
|
|
12
|
+
Before spawning — run via Bash:
|
|
13
|
+
`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}`
|
|
14
|
+
|
|
15
|
+
**Token Budget Check (before spawning subagent):**
|
|
16
|
+
|
|
17
|
+
Run via Bash:
|
|
18
|
+
`node -e "const tb = require('./bin/token-budget.js'); const s = tb.getSessionStatus('.'); process.stdout.write(s.threshold);" 2>/dev/null`
|
|
19
|
+
|
|
20
|
+
Apply the result:
|
|
21
|
+
- `normal` or file missing → proceed with default model (sonnet)
|
|
22
|
+
- `downgrade` → downgrade subagent model from sonnet to haiku for non-critical tasks; apply `getDegradationActions()` model overrides
|
|
23
|
+
- `conserve` → run quick task inline (skip subagent spawn overhead); skip Red Team and doc-ripple
|
|
24
|
+
- `stop` → output: "Token budget exhausted — quick task deferred. Resume after session reset." and halt
|
|
25
|
+
|
|
26
|
+
**Stack Rules Detection (before spawning subagent):**
|
|
27
|
+
|
|
28
|
+
Run via Bash to detect project stack and collect matching rules. Local overrides in `.gsd-t/stacks/` take precedence over global templates.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
GSD_T_DIR=$(npm root -g 2>/dev/null)/@tekyzinc/gsd-t
|
|
32
|
+
STACKS_DIR="$GSD_T_DIR/templates/stacks"
|
|
33
|
+
LOCAL_STACKS=".gsd-t/stacks"
|
|
34
|
+
STACK_RULES=""
|
|
35
|
+
_sf() { local n=$(basename "$1"); [ -f "$LOCAL_STACKS/$n" ] && cat "$LOCAL_STACKS/$n" || cat "$1"; }
|
|
36
|
+
_add() { [ -f "$STACKS_DIR/$1" ] && STACK_RULES="${STACK_RULES}$(_sf "$STACKS_DIR/$1")"$'\n\n'; }
|
|
37
|
+
if [ -d "$STACKS_DIR" ]; then
|
|
38
|
+
for f in "$STACKS_DIR"/_*.md; do [ -f "$f" ] && STACK_RULES="${STACK_RULES}$(_sf "$f")"$'\n\n'; done
|
|
39
|
+
if [ -f "package.json" ]; then
|
|
40
|
+
grep -q '"react-native"' package.json 2>/dev/null && _add react-native.md
|
|
41
|
+
grep -q '"react"' package.json 2>/dev/null && ! grep -q '"react-native"' package.json 2>/dev/null && _add react.md
|
|
42
|
+
grep -q '"next"' package.json 2>/dev/null && _add nextjs.md
|
|
43
|
+
grep -q '"vue"' package.json 2>/dev/null && _add vue.md
|
|
44
|
+
(grep -q '"typescript"' package.json 2>/dev/null || [ -f "tsconfig.json" ]) && _add typescript.md
|
|
45
|
+
grep -qE '"(express|fastify|hono|koa)"' package.json 2>/dev/null && _add node-api.md && _add rest-api.md
|
|
46
|
+
grep -q '"tailwindcss"' package.json 2>/dev/null && _add tailwind.md
|
|
47
|
+
grep -q '"vite"' package.json 2>/dev/null && _add vite.md
|
|
48
|
+
grep -q '"@supabase/supabase-js"' package.json 2>/dev/null && _add supabase.md
|
|
49
|
+
grep -q '"firebase"' package.json 2>/dev/null && _add firebase.md
|
|
50
|
+
grep -qE '"(graphql|@apollo/client|urql)"' package.json 2>/dev/null && _add graphql.md
|
|
51
|
+
grep -q '"zustand"' package.json 2>/dev/null && _add zustand.md
|
|
52
|
+
grep -q '"@reduxjs/toolkit"' package.json 2>/dev/null && _add redux.md
|
|
53
|
+
grep -q '"neo4j-driver"' package.json 2>/dev/null && _add neo4j.md
|
|
54
|
+
grep -qE '"(pg|prisma|drizzle-orm|knex)"' package.json 2>/dev/null && _add postgresql.md
|
|
55
|
+
grep -qE '"(prisma|@prisma/client)"' package.json 2>/dev/null && _add prisma.md
|
|
56
|
+
grep -qE '"(bullmq|bull|amqplib|@aws-sdk/client-sqs|bee-queue|agenda)"' package.json 2>/dev/null && _add queues.md
|
|
57
|
+
grep -qE '"(openai|anthropic|@anthropic-ai/sdk|langchain|llama-index|@google/generative-ai)"' package.json 2>/dev/null && _add llm.md
|
|
58
|
+
fi
|
|
59
|
+
([ -f "requirements.txt" ] || [ -f "pyproject.toml" ] || [ -f "Pipfile" ]) && _add python.md
|
|
60
|
+
([ -f "requirements.txt" ] && grep -q "psycopg" requirements.txt 2>/dev/null || [ -f "pyproject.toml" ] && grep -q "psycopg" pyproject.toml 2>/dev/null) && _add postgresql.md
|
|
61
|
+
([ -f "requirements.txt" ] && grep -q "neo4j" requirements.txt 2>/dev/null) && _add neo4j.md
|
|
62
|
+
([ -f "requirements.txt" ] && grep -q "fastapi" requirements.txt 2>/dev/null || [ -f "pyproject.toml" ] && grep -q "fastapi" pyproject.toml 2>/dev/null) && _add fastapi.md
|
|
63
|
+
([ -f "requirements.txt" ] && grep -qE "(celery|dramatiq|rq|arq)" requirements.txt 2>/dev/null || [ -f "pyproject.toml" ] && grep -qE "(celery|dramatiq|rq|arq)" pyproject.toml 2>/dev/null) && _add queues.md
|
|
64
|
+
([ -f "requirements.txt" ] && grep -qE "(openai|anthropic|langchain|llama.index)" requirements.txt 2>/dev/null || [ -f "pyproject.toml" ] && grep -qE "(openai|anthropic|langchain|llama.index)" pyproject.toml 2>/dev/null) && _add llm.md
|
|
65
|
+
[ -f "pubspec.yaml" ] && _add flutter.md
|
|
66
|
+
[ -f "Dockerfile" ] && _add docker.md
|
|
67
|
+
[ -d ".github/workflows" ] && _add github-actions.md
|
|
68
|
+
([ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]) && _add playwright.md
|
|
69
|
+
[ -f "go.mod" ] && _add go.md
|
|
70
|
+
[ -f "Cargo.toml" ] && _add rust.md
|
|
71
|
+
fi
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If STACK_RULES is non-empty, append to the subagent prompt:
|
|
75
|
+
```
|
|
76
|
+
## Stack Rules (MANDATORY — violations fail this task)
|
|
77
|
+
|
|
78
|
+
{STACK_RULES}
|
|
79
|
+
|
|
80
|
+
These standards have the same enforcement weight as contract compliance.
|
|
81
|
+
Violations are task failures, not warnings.
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
If STACK_RULES is empty (no templates/stacks/ dir or no matches), skip silently.
|
|
85
|
+
|
|
86
|
+
Spawn a fresh subagent using the Task tool:
|
|
87
|
+
```
|
|
88
|
+
subagent_type: general-purpose
|
|
89
|
+
prompt: "You are running gsd-t-quick for this request: {$ARGUMENTS}
|
|
90
|
+
Working directory: {current project root}
|
|
91
|
+
Read CLAUDE.md and .gsd-t/progress.md for project context, then execute gsd-t-quick starting at Step 1.
|
|
92
|
+
{STACK_RULES block — if non-empty, append the ## Stack Rules section defined above; omit if empty}"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
After subagent returns — run via Bash:
|
|
96
|
+
`T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
|
|
97
|
+
Compute tokens and compaction:
|
|
98
|
+
- No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
|
|
99
|
+
- Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
|
|
100
|
+
Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
|
|
101
|
+
`| {DT_START} | {DT_END} | gsd-t-quick | Step 0 | sonnet | {DURATION}s | quick: {task summary} | {TOKENS} | {COMPACTED} |`
|
|
102
|
+
|
|
103
|
+
Relay the subagent's summary to the user. **Do not execute Steps 1–5 yourself.**
|
|
104
|
+
|
|
105
|
+
**If you are the spawned subagent** (your prompt says "starting at Step 1"):
|
|
106
|
+
Continue to Step 1 below.
|
|
107
|
+
|
|
108
|
+
## Step 1: Load Context (Fast)
|
|
109
|
+
|
|
110
|
+
Read:
|
|
111
|
+
1. `CLAUDE.md`
|
|
112
|
+
2. `.gsd-t/progress.md` (if exists)
|
|
113
|
+
3. `.gsd-t/contracts/` (if exists) — scan for relevant contracts
|
|
114
|
+
|
|
115
|
+
## Step 1.5: Graph-Enhanced Scope Check
|
|
116
|
+
|
|
117
|
+
If `.gsd-t/graph/meta.json` exists (graph index is available):
|
|
118
|
+
1. Query `getDomainOwner` for the target function/file to verify it belongs to the expected domain
|
|
119
|
+
2. Query `getDomainBoundaryViolations` to check if the quick change would cross domain boundaries
|
|
120
|
+
3. If violations found, warn the user before proceeding — the change may need the full execute workflow
|
|
121
|
+
|
|
122
|
+
If graph is not available, skip this step.
|
|
123
|
+
|
|
124
|
+
## Step 2: Scope Check
|
|
125
|
+
|
|
126
|
+
Based on $ARGUMENTS, determine:
|
|
127
|
+
- Which domain does this touch? (check `.gsd-t/domains/*/scope.md` if available)
|
|
128
|
+
- Does it cross a domain boundary?
|
|
129
|
+
- Does it affect any existing contract?
|
|
130
|
+
|
|
131
|
+
### If it crosses boundaries or affects contracts:
|
|
132
|
+
Warn the user:
|
|
133
|
+
"This change touches {domain-1} and {domain-2} and may affect {contract}.
|
|
134
|
+
Should I proceed with quick mode or use the full execute workflow?"
|
|
135
|
+
|
|
136
|
+
### If it's within a single domain or pre-partition:
|
|
137
|
+
Proceed.
|
|
138
|
+
|
|
139
|
+
## Step 3: Execute
|
|
140
|
+
|
|
141
|
+
### Deviation Rules
|
|
142
|
+
|
|
143
|
+
When you encounter unexpected situations:
|
|
144
|
+
1. **Bug blocking progress** → Fix it, up to 3 attempts. If still blocked, add to `.gsd-t/deferred-items.md` and skip.
|
|
145
|
+
2. **Missing dependency clearly needed** → Add minimum required code to unblock. Note in commit.
|
|
146
|
+
3. **Blocker (missing file, wrong API)** → Fix blocker and continue. Log if non-trivial.
|
|
147
|
+
4. **Architectural change required** → STOP. Apply Destructive Action Guard. Never self-approve.
|
|
148
|
+
|
|
149
|
+
**3-attempt limit**: Stop looping after 3 failed fix attempts. Log and move on.
|
|
150
|
+
|
|
151
|
+
1. Identify exactly which files need to change
|
|
152
|
+
2. **Destructive Action Guard**: Check if this task involves destructive or structural changes (DROP TABLE, removing columns, deleting data, replacing architecture patterns, removing working modules, changing schema in ways that conflict with existing data). If YES → STOP and present the change to the user with what exists today, what will change, what will break, and a safe migration path. Wait for explicit approval.
|
|
153
|
+
3. If a contract exists for the relevant interface, implement to match it
|
|
154
|
+
4. Make the change — **adapt new code to existing structures**, not the other way around
|
|
155
|
+
5. Verify it works
|
|
156
|
+
6. Commit: `[quick] {description}`
|
|
157
|
+
|
|
158
|
+
## Step 3.5: Emit Task Metrics
|
|
159
|
+
|
|
160
|
+
After committing, emit a task-metrics record for this quick task — run via Bash:
|
|
161
|
+
`node bin/metrics-collector.js --milestone {current-milestone-or-none} --domain {domain-or-quick} --task quick-{timestamp} --command quick --duration_s {elapsed} --tokens_used {estimated} --context_pct ${CTX_PCT:-0} --pass {true|false} --fix_cycles {0|N} --signal_type {pass-through|fix-cycle} --notes "[quick] {description}" 2>/dev/null || true`
|
|
162
|
+
|
|
163
|
+
Signal type: `pass-through` if task completed on first attempt; `fix-cycle` if rework was needed.
|
|
164
|
+
|
|
165
|
+
Emit task_complete event — run via Bash:
|
|
166
|
+
`node ~/.claude/scripts/gsd-t-event-writer.js --type task_complete --command gsd-t-quick --reasoning "signal_type={signal_type}, domain={domain}" --outcome {success|failure} || true`
|
|
167
|
+
|
|
168
|
+
## Step 4: Document Ripple (if GSD-T is active)
|
|
169
|
+
|
|
170
|
+
If `.gsd-t/progress.md` exists, assess what documentation was affected and update ALL relevant files:
|
|
171
|
+
|
|
172
|
+
### Always update:
|
|
173
|
+
1. **`.gsd-t/progress.md`** — Log the quick task in the Decision Log with date and description
|
|
174
|
+
|
|
175
|
+
### Check if affected:
|
|
176
|
+
2. **`.gsd-t/contracts/`** — Did you change an API endpoint, schema, or component interface? Update the contract
|
|
177
|
+
3. **Domain `scope.md`** — Did you add new files? Update the owning domain's scope
|
|
178
|
+
4. **Domain `constraints.md`** — Did you establish a new pattern or discover a "must not"? Add it
|
|
179
|
+
5. **`docs/requirements.md`** — Did this task add, change, or clarify a requirement? Update it
|
|
180
|
+
6. **`docs/architecture.md`** — Did this task change how components connect or data flows? Update it
|
|
181
|
+
7. **`docs/schema.md`** — Did this task modify the database? Update it
|
|
182
|
+
8. **`.gsd-t/techdebt.md`** — Did this task resolve a debt item? Mark it done. Did it reveal new debt? Add it
|
|
183
|
+
9. **`CLAUDE.md`** — Did this task establish a convention future work should follow? Add it
|
|
184
|
+
|
|
185
|
+
### Scan Doc Micro-Update (if `.gsd-t/scan/` exists):
|
|
186
|
+
Patch structural metadata in scan docs so they stay fresh between full scans. Near-zero cost — no LLM re-analysis.
|
|
187
|
+
|
|
188
|
+
For each scan doc that exists, apply only the relevant patches:
|
|
189
|
+
- **`.gsd-t/scan/architecture.md`** — Update file/directory counts, add new files/modules created
|
|
190
|
+
- **`.gsd-t/scan/quality.md`** — Mark resolved TODOs/FIXMEs, update test counts, append new files to Consumer Surfaces if applicable
|
|
191
|
+
- **`.gsd-t/scan/security.md`** — If a security finding was fixed, mark it `[RESOLVED]`
|
|
192
|
+
- **`.gsd-t/scan/business-rules.md`** — Append any new validation/auth/workflow rules added
|
|
193
|
+
- **`.gsd-t/scan/contract-drift.md`** — If contracts were updated, mark resolved drift items
|
|
194
|
+
|
|
195
|
+
Skip scan docs not affected by this task. Skip analytical sections — those require a full scan.
|
|
196
|
+
|
|
197
|
+
### Skip what's not affected — most quick tasks will only touch 1-2 of these.
|
|
198
|
+
|
|
199
|
+
## Step 5: Test & Verify (MANDATORY)
|
|
200
|
+
|
|
201
|
+
**QA Calibration Injection** — Before evaluating test results, check for known weak spots:
|
|
202
|
+
|
|
203
|
+
Run via Bash:
|
|
204
|
+
`node -e "const qc = require('./bin/qa-calibrator.js'); const inj = qc.generateQAInjection('.'); if(inj) process.stdout.write(inj);" 2>/dev/null`
|
|
205
|
+
|
|
206
|
+
If the command produces output, treat it as a preamble to your QA evaluation — pay extra attention to the flagged weak-spot categories when writing and reviewing tests. If the file doesn't exist or returns empty, skip silently.
|
|
207
|
+
|
|
208
|
+
Quick does not mean skip testing. Before committing:
|
|
209
|
+
|
|
210
|
+
1. **Write/update tests for every new or changed code path**:
|
|
211
|
+
- Unit tests: happy path + common edge cases + error cases
|
|
212
|
+
- Playwright E2E specs (if UI/routes/flows/modes changed): create new specs for new functionality, update existing specs for changed behavior
|
|
213
|
+
- Cover all modes/flags affected by this change
|
|
214
|
+
- "No feature code without test code" applies to quick tasks too
|
|
215
|
+
- **Functional tests only** — every E2E assertion must verify an action produced the correct outcome (state changed, data loaded, content updated). Tests that only check element existence (`isVisible`, `toBeEnabled`) are shallow/layout tests and are not acceptable. If a test would pass on an empty HTML page with the right IDs, rewrite it.
|
|
216
|
+
2. **Run ALL configured test suites** — not just affected tests, not just one suite:
|
|
217
|
+
a. Detect all runners: check for vitest/jest config, playwright.config.*, cypress.config.*
|
|
218
|
+
b. Run EVERY detected suite. Unit tests alone are NEVER sufficient when E2E exists.
|
|
219
|
+
c. If `playwright.config.*` exists → `npx playwright test` (full suite)
|
|
220
|
+
d. Report ALL results: "Unit: X/Y pass | E2E: X/Y pass"
|
|
221
|
+
- Fix any failures before proceeding (up to 2 attempts)
|
|
222
|
+
3. **Verify against requirements**:
|
|
223
|
+
- Does the change satisfy its intended requirement?
|
|
224
|
+
- Did the change break any existing functionality? (the full test run catches this)
|
|
225
|
+
- If a contract exists for the interface touched, does the code still match?
|
|
226
|
+
4. **No test framework?**: Set one up, or at minimum manually verify and document how in the commit message
|
|
227
|
+
|
|
228
|
+
### Exploratory Testing (if Playwright MCP available)
|
|
229
|
+
|
|
230
|
+
After all scripted tests pass:
|
|
231
|
+
1. Check if Playwright MCP is registered in Claude Code settings (look for "playwright" in mcpServers)
|
|
232
|
+
2. If available: spend 3 minutes on interactive exploration using Playwright MCP
|
|
233
|
+
- Try variations of happy paths with unexpected inputs
|
|
234
|
+
- Probe for race conditions, double-submits, empty states
|
|
235
|
+
- Test accessibility (keyboard navigation, screen reader flow)
|
|
236
|
+
3. Tag all findings [EXPLORATORY] in reports and append to .gsd-t/qa-issues.md
|
|
237
|
+
4. If Playwright MCP is not available: skip this section silently
|
|
238
|
+
Note: Exploratory findings do NOT count against the scripted test pass/fail ratio.
|
|
239
|
+
|
|
240
|
+
## Step 5.5: Red Team — Adversarial QA (MANDATORY)
|
|
241
|
+
|
|
242
|
+
After tests pass, spawn an adversarial Red Team agent. This agent's sole purpose is to BREAK the code that was just changed. Its success is measured by bugs found, not tests passed.
|
|
243
|
+
|
|
244
|
+
⚙ [{model}] Red Team → adversarial validation of quick task
|
|
245
|
+
|
|
246
|
+
**OBSERVABILITY LOGGING (MANDATORY):**
|
|
247
|
+
Before spawning — run via Bash:
|
|
248
|
+
`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}`
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
Task subagent (general-purpose, model: opus):
|
|
252
|
+
"You are a Red Team QA adversary. Your job is to BREAK the code that was just changed.
|
|
253
|
+
|
|
254
|
+
Your value is measured by REAL bugs found. More bugs = more value.
|
|
255
|
+
If you find zero bugs, you must prove you were thorough — list every
|
|
256
|
+
attack vector you tried and why it didn't break. A short list means
|
|
257
|
+
you didn't try hard enough.
|
|
258
|
+
|
|
259
|
+
Rules:
|
|
260
|
+
- False positives DESTROY your credibility. If you report something
|
|
261
|
+
as a bug and it's actually correct behavior, that's worse than
|
|
262
|
+
missing a real bug. Never report something you haven't reproduced.
|
|
263
|
+
- Style opinions are not bugs. Theoretical concerns are not bugs.
|
|
264
|
+
A bug is: 'I did X, expected Y, got Z.' With proof.
|
|
265
|
+
- You are done ONLY when you have exhausted every category below
|
|
266
|
+
and either found a bug or documented exactly what you tried.
|
|
267
|
+
|
|
268
|
+
## Attack Categories (exhaust ALL of these)
|
|
269
|
+
|
|
270
|
+
1. **Contract Violations**: Read .gsd-t/contracts/. Does the code EXACTLY
|
|
271
|
+
match every contract? Test each endpoint/interface/schema shape.
|
|
272
|
+
2. **Boundary Inputs**: Empty strings, null, undefined, huge payloads,
|
|
273
|
+
special characters, SQL injection attempts, XSS payloads, path traversal.
|
|
274
|
+
3. **State Transitions**: What happens when actions are performed out of
|
|
275
|
+
order? Double-submit? Concurrent access? Refresh mid-flow?
|
|
276
|
+
4. **Error Paths**: Remove env vars. Kill the database. Send malformed
|
|
277
|
+
requests. Does the code handle failures gracefully or crash?
|
|
278
|
+
5. **Missing Flows**: Read docs/requirements.md. Are there user flows that
|
|
279
|
+
exist in requirements but have NO test coverage? Write tests for them.
|
|
280
|
+
6. **Regression**: Run the FULL test suite. Did any existing tests break?
|
|
281
|
+
7. **E2E Functional Gaps**: Review ALL Playwright specs. Do they test actual
|
|
282
|
+
behavior (state changes, data loaded, navigation works) or just check
|
|
283
|
+
that elements exist? Flag and rewrite any shallow/layout tests.
|
|
284
|
+
|
|
285
|
+
## Exploratory Testing (if Playwright MCP available)
|
|
286
|
+
|
|
287
|
+
After all scripted tests pass:
|
|
288
|
+
1. Check if Playwright MCP is registered in Claude Code settings (look for "playwright" in mcpServers)
|
|
289
|
+
2. If available: spend 5 minutes on adversarial interactive exploration using Playwright MCP
|
|
290
|
+
- Attempt race conditions, double-submits, concurrent access patterns
|
|
291
|
+
- Try unexpected input sequences, boundary values, rapid state transitions
|
|
292
|
+
- Probe error recovery: does the app recover after failures or get stuck?
|
|
293
|
+
3. Tag all findings [EXPLORATORY] in your report
|
|
294
|
+
4. If Playwright MCP is not available: skip this section silently
|
|
295
|
+
Note: Exploratory findings are additive — they do not replace scripted test results.
|
|
296
|
+
|
|
297
|
+
## Report Format
|
|
298
|
+
|
|
299
|
+
For each bug found:
|
|
300
|
+
- **BUG-{N}**: {severity: CRITICAL/HIGH/MEDIUM/LOW}
|
|
301
|
+
- **Reproduction**: {exact steps to reproduce}
|
|
302
|
+
- **Expected**: {what should happen}
|
|
303
|
+
- **Actual**: {what actually happens}
|
|
304
|
+
- **Proof**: {test file or command that demonstrates the bug}
|
|
305
|
+
|
|
306
|
+
Summary:
|
|
307
|
+
- BUGS FOUND: {count} (with severity breakdown)
|
|
308
|
+
- COVERAGE GAPS: {untested flows from requirements}
|
|
309
|
+
- SHALLOW TESTS REWRITTEN: {count}
|
|
310
|
+
- CONTRACTS VERIFIED: {N}/{total}
|
|
311
|
+
- ATTACK VECTORS TRIED: {list every category attempted and results}
|
|
312
|
+
- VERDICT: FAIL ({N} bugs found) | GRUDGING PASS (exhaustive search, nothing found)
|
|
313
|
+
|
|
314
|
+
Write all findings to .gsd-t/red-team-report.md.
|
|
315
|
+
If bugs found, also append to .gsd-t/qa-issues.md."
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
After subagent returns — run via Bash:
|
|
319
|
+
`T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
|
|
320
|
+
Compute tokens and compaction:
|
|
321
|
+
- No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
|
|
322
|
+
- Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
|
|
323
|
+
Append to `.gsd-t/token-log.md`:
|
|
324
|
+
`| {DT_START} | {DT_END} | gsd-t-quick | Red Team | sonnet | {DURATION}s | {VERDICT} — {N} bugs found | {TOKENS} | {COMPACTED} | | | {CTX_PCT} |`
|
|
325
|
+
|
|
326
|
+
**If Red Team VERDICT is FAIL:**
|
|
327
|
+
1. Fix all CRITICAL and HIGH bugs immediately (up to 2 fix attempts per bug)
|
|
328
|
+
2. Re-run Red Team after fixes
|
|
329
|
+
3. If bugs persist after 2 fix cycles, log to `.gsd-t/deferred-items.md` and present to user
|
|
330
|
+
|
|
331
|
+
**If Red Team VERDICT is GRUDGING PASS:** Proceed to doc-ripple.
|
|
332
|
+
|
|
333
|
+
## Step 6: Doc-Ripple (Automated)
|
|
334
|
+
|
|
335
|
+
After all work is committed but before reporting completion:
|
|
336
|
+
|
|
337
|
+
1. Run threshold check — read `git diff --name-only HEAD~1` and evaluate against doc-ripple-contract.md trigger conditions
|
|
338
|
+
2. If SKIP: log "Doc-ripple: SKIP — {reason}" and proceed to completion
|
|
339
|
+
3. If FIRE: spawn doc-ripple agent:
|
|
340
|
+
|
|
341
|
+
⚙ [{model}] gsd-t-doc-ripple → blast radius analysis + parallel updates
|
|
342
|
+
|
|
343
|
+
Task subagent (general-purpose, model: sonnet):
|
|
344
|
+
"Execute the doc-ripple workflow per commands/gsd-t-doc-ripple.md.
|
|
345
|
+
Git diff context: {files changed list}
|
|
346
|
+
Command that triggered: quick
|
|
347
|
+
Produce manifest at .gsd-t/doc-ripple-manifest.md.
|
|
348
|
+
Update all affected documents.
|
|
349
|
+
Report: 'Doc-ripple: {N} checked, {N} updated, {N} skipped'"
|
|
350
|
+
|
|
351
|
+
4. After doc-ripple returns, verify manifest exists and report summary inline
|
|
352
|
+
|
|
353
|
+
$ARGUMENTS
|
|
354
|
+
|
|
355
|
+
## Auto-Clear
|
|
356
|
+
|
|
357
|
+
All work is committed to project files. Execute `/clear` to free the context window for the next command.
|