@anhth2/spec-driven-dev-plugin 0.6.0 → 0.8.0
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/bin/index.js +285 -11
- package/commands/debug.md +233 -11
- package/commands/debug.tmpl +170 -6
- package/commands/define-product.md +68 -6
- package/commands/define-product.tmpl +5 -1
- package/commands/fix-bug.md +111 -11
- package/commands/fix-bug.tmpl +48 -6
- package/commands/generate-bdd.md +86 -9
- package/commands/generate-bdd.tmpl +23 -4
- package/commands/generate-code.md +146 -19
- package/commands/generate-code.tmpl +83 -14
- package/commands/generate-design-spec.md +754 -0
- package/commands/generate-design-spec.tmpl +399 -0
- package/commands/generate-prd.md +91 -7
- package/commands/generate-prd.tmpl +28 -2
- package/commands/generate-spec-manifest.md +519 -0
- package/commands/generate-spec-manifest.tmpl +164 -0
- package/commands/generate-tech-docs.md +122 -9
- package/commands/generate-tech-docs.tmpl +59 -4
- package/commands/generate-tests.md +491 -37
- package/commands/generate-tests.tmpl +428 -32
- package/commands/refine-prd.md +76 -8
- package/commands/refine-prd.tmpl +13 -3
- package/commands/review-code.md +94 -6
- package/commands/review-code.tmpl +31 -1
- package/commands/review-context.md +118 -12
- package/commands/review-context.tmpl +55 -7
- package/commands/review-tech-docs.md +76 -9
- package/commands/review-tech-docs.tmpl +13 -4
- package/commands/run-tests.md +196 -18
- package/commands/run-tests.tmpl +133 -13
- package/commands/setup-ai-first.md +192 -6
- package/commands/setup-ai-first.tmpl +136 -5
- package/commands/smoke-test.md +228 -22
- package/commands/smoke-test.tmpl +165 -17
- package/commands/validate-traces.md +77 -8
- package/commands/validate-traces.tmpl +14 -3
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +233 -11
- package/core/commands/define-product.md +68 -6
- package/core/commands/fix-bug.md +111 -11
- package/core/commands/generate-bdd.md +86 -9
- package/core/commands/generate-code.md +146 -19
- package/core/commands/generate-design-spec.md +754 -0
- package/core/commands/generate-prd.md +91 -7
- package/core/commands/generate-spec-manifest.md +519 -0
- package/core/commands/generate-tech-docs.md +122 -9
- package/core/commands/generate-tests.md +491 -37
- package/core/commands/refine-prd.md +76 -8
- package/core/commands/review-code.md +94 -6
- package/core/commands/review-context.md +118 -12
- package/core/commands/review-tech-docs.md +76 -9
- package/core/commands/run-tests.md +196 -18
- package/core/commands/setup-ai-first.md +192 -6
- package/core/commands/smoke-test.md +228 -22
- package/core/commands/validate-traces.md +77 -8
- package/core/skills/code/SKILL.md +68 -8
- package/core/skills/debug/SKILL.md +72 -10
- package/core/skills/design-spec/SKILL.md +450 -0
- package/core/skills/discovery/SKILL.md +62 -4
- package/core/skills/prd/SKILL.md +12 -8
- package/core/skills/setup-ai-first/SKILL.md +5 -3
- package/core/skills/spec/SKILL.md +11 -7
- package/core/skills/test/SKILL.md +130 -12
- package/core/steps/context-loader.md +57 -1
- package/core/steps/gate.md +1 -1
- package/core/steps/report-footer.md +5 -3
- package/core/steps/spawn-agent.md +3 -1
- package/core/templates/design-spec.template.md +209 -0
- package/core/templates/project-context.yaml +29 -0
- package/package.json +1 -1
- package/skills/code/SKILL.md +68 -8
- package/skills/debug/SKILL.md +72 -10
- package/skills/design-spec/SKILL.md +450 -0
- package/skills/design-spec/SKILL.tmpl +95 -0
- package/skills/discovery/SKILL.md +62 -4
- package/skills/prd/SKILL.md +12 -8
- package/skills/setup-ai-first/SKILL.md +5 -3
- package/skills/spec/SKILL.md +11 -7
- package/skills/test/SKILL.md +130 -12
- package/steps/context-loader.md +57 -1
- package/steps/gate.md +1 -1
- package/steps/report-footer.md +5 -3
- package/steps/spawn-agent.md +3 -1
- package/templates/design-spec.template.md +209 -0
- package/templates/project-context.yaml +29 -0
|
@@ -33,7 +33,7 @@ Display and wait for response:
|
|
|
33
33
|
```
|
|
34
34
|
⚙️ MODEL CHECK
|
|
35
35
|
──────────────────────────────────────────────────────────────────
|
|
36
|
-
Recommended : claude-opus-4
|
|
36
|
+
Recommended : claude-opus-4 (or latest Opus model)
|
|
37
37
|
Why needed : Spec analysis, architecture review, code generation
|
|
38
38
|
require deep reasoning. Smaller models miss edge cases.
|
|
39
39
|
|
|
@@ -133,6 +133,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
133
133
|
- `paths.core_entities` → path to core-entities.md
|
|
134
134
|
- `paths.tech_docs_dir` → technical documentation root
|
|
135
135
|
- `paths.trace_dir` → trace state directory
|
|
136
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
136
137
|
|
|
137
138
|
If `paths` section is absent, use these defaults:
|
|
138
139
|
- `specs_dir` = `specs/bdd`
|
|
@@ -142,13 +143,46 @@ If `paths` section is absent, use these defaults:
|
|
|
142
143
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
143
144
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
144
145
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
145
|
-
- `tech_docs_dir` = `tech-docs`
|
|
146
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
146
147
|
- `trace_dir` = `.trace`
|
|
148
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
147
149
|
|
|
148
150
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
149
151
|
|
|
150
152
|
---
|
|
151
153
|
|
|
154
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
155
|
+
|
|
156
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
157
|
+
|
|
158
|
+
If `services` section is present:
|
|
159
|
+
|
|
160
|
+
**1. Detect active domain** (in priority order):
|
|
161
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
162
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
163
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
164
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
165
|
+
|
|
166
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
167
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
168
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
169
|
+
- Store `active_service` = `services.{domain}.path`
|
|
170
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
171
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
172
|
+
|
|
173
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
174
|
+
- Keep default paths from Step 1
|
|
175
|
+
- Set `active_service = unresolved`
|
|
176
|
+
|
|
177
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
178
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
179
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
180
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
181
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
182
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
152
186
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
153
187
|
|
|
154
188
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -219,6 +253,26 @@ If the file does not exist → skip silently.
|
|
|
219
253
|
|
|
220
254
|
---
|
|
221
255
|
|
|
256
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
257
|
+
|
|
258
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
| `platform_type` | Modules |
|
|
265
|
+
|---|---|
|
|
266
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
267
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
268
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
269
|
+
|
|
270
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
271
|
+
|
|
272
|
+
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (generate-tests, debug, fix-bug, smoke-test).
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
222
276
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
223
277
|
|
|
224
278
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -229,10 +283,12 @@ Output exactly this block:
|
|
|
229
283
|
```
|
|
230
284
|
[CTX LOADED]
|
|
231
285
|
Stack : {language} / {framework} / {database}
|
|
286
|
+
Platform : {active_module} ({platform_type})
|
|
232
287
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
233
288
|
Ticket : {ticket_prefix}-
|
|
234
289
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
235
290
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
291
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
236
292
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
237
293
|
```
|
|
238
294
|
|
|
@@ -263,6 +319,13 @@ Proceed to the next step of the calling command.
|
|
|
263
319
|
Read all `{paths.trace_dir}/{UC-ID}.tsv` files matching the target domain (or all domains if no domain filter).
|
|
264
320
|
Each file gives the persisted trace state for that UC.
|
|
265
321
|
|
|
322
|
+
**If no `.tsv` files found** in `{paths.trace_dir}`:
|
|
323
|
+
- Scan all `{paths.specs_dir}/**/*.feature` files in the target domain to build an in-memory list of all scenarios.
|
|
324
|
+
- Treat all scenarios as `UNTRACKED` (no code generated yet).
|
|
325
|
+
- Print: "⚠️ No trace files found. All {N} scenarios across {M} UCs are UNTRACKED."
|
|
326
|
+
- Suggest: "Run `/generate-bdd {prd-file}` to initialize trace state, or `/generate-code {feature-file}` to generate code."
|
|
327
|
+
- **Skip Steps 2–6 entirely.** Proceed directly to Step 7 using this in-memory state — do NOT abort.
|
|
328
|
+
|
|
266
329
|
### Step 2 — Reconcile with current `.feature` files
|
|
267
330
|
|
|
268
331
|
For each `.tsv` row, read the corresponding `.feature` file and get the **current** `@trace.sc_version` for that SC.
|
|
@@ -300,6 +363,8 @@ If code was generated from an older revision → flag `TECHDOC_DRIFT`.
|
|
|
300
363
|
|
|
301
364
|
### Step 6 — Write status back to TSV
|
|
302
365
|
|
|
366
|
+
*Skip this step if no TSV files existed (handled by Step 1 no-TSV path).*
|
|
367
|
+
|
|
303
368
|
For each `.tsv` file processed: write updated `spec_ver`, `status`, `last_updated` back to disk.
|
|
304
369
|
|
|
305
370
|
### Step 7 — Compute dashboard aggregates
|
|
@@ -309,6 +374,7 @@ total_prds = count distinct PRD files in {paths.prd_dir}/{domain}/
|
|
|
309
374
|
approved_prds = PRDs with | Status | approved
|
|
310
375
|
total_ucs = count distinct UC-IDs across all .tsv files
|
|
311
376
|
approved_ucs = UCs with uc_status == approved
|
|
377
|
+
draft_ucs = UCs with uc_status == draft
|
|
312
378
|
total_scs = total rows across all .tsv files
|
|
313
379
|
code_coverage = rows where implemented_by != — / total_scs
|
|
314
380
|
test_coverage = rows where test_count > 0 / total_scs
|
|
@@ -320,7 +386,7 @@ tech_docs_count = count .md files in {paths.tech_docs_dir}/{domain}/
|
|
|
320
386
|
|
|
321
387
|
### Step 8 — Write JSON report
|
|
322
388
|
|
|
323
|
-
Write
|
|
389
|
+
Write `{paths.trace_dir}/trace-report.json` (overwrite if exists). This file is the single source of truth for web dashboards — it contains the full snapshot at the time `/validate-traces` was last run.
|
|
324
390
|
|
|
325
391
|
Schema:
|
|
326
392
|
|
|
@@ -430,7 +496,8 @@ Schema:
|
|
|
430
496
|
- `test_classes`: use `[]` (not `"—"`) when no test classes
|
|
431
497
|
- `tech_doc_revision`: use integer; `0` if not yet generated
|
|
432
498
|
- `code_coverage_pct` / `test_coverage_pct`: round to nearest integer (0–100)
|
|
433
|
-
- Always write to
|
|
499
|
+
- Always write to `{paths.trace_dir}/trace-report.json` regardless of domain filter — if a domain filter was applied, include only those PRDs in `prds[]` but note the domain in the `domain` field
|
|
500
|
+
- **TSV `"—"` mapping**: when reading TSV files, map dash values to JSON types: `implemented_by: "—"` → `null`; `test_count: "—"` → `0`; `test_classes: "—"` → `[]`; `tech_doc_revision: "—"` → `0`
|
|
434
501
|
|
|
435
502
|
## Output
|
|
436
503
|
|
|
@@ -462,21 +529,23 @@ Suggest the logical next command based on workflow phase:
|
|
|
462
529
|
|
|
463
530
|
| Current command | Suggest next |
|
|
464
531
|
|-------------------------|-----------------------------------------------|
|
|
532
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
465
533
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
466
534
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
467
535
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
468
|
-
| /review-context (PRD) | `/generate-
|
|
536
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
537
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
469
538
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
470
539
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
471
540
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
472
541
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
473
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
542
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
474
543
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
475
544
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
476
545
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
477
546
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
478
547
|
| /smoke-test | Create PR and link to ticket |
|
|
479
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
548
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
480
549
|
| /fix-bug | Create PR and link to ticket |
|
|
481
550
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
482
551
|
|
|
@@ -492,7 +561,7 @@ Next : {suggested command with example arguments}
|
|
|
492
561
|
```
|
|
493
562
|
/validate-traces — {domain}
|
|
494
563
|
|
|
495
|
-
📄 .
|
|
564
|
+
📄 {paths.trace_dir}/trace-report.json ← updated
|
|
496
565
|
|
|
497
566
|
┌─────────────────────────────────────────────────────────────────────────────────────┐
|
|
498
567
|
│ PRDs Use Cases Scenarios Code Cov. Test Cov. Drift Untracked Gap │
|
|
@@ -43,7 +43,7 @@ Display and wait for response:
|
|
|
43
43
|
```
|
|
44
44
|
⚙️ MODEL CHECK
|
|
45
45
|
──────────────────────────────────────────────────────────────────
|
|
46
|
-
Recommended : claude-opus-4
|
|
46
|
+
Recommended : claude-opus-4 (or latest Opus model)
|
|
47
47
|
Why needed : Spec analysis, architecture review, code generation
|
|
48
48
|
require deep reasoning. Smaller models miss edge cases.
|
|
49
49
|
|
|
@@ -158,6 +158,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
158
158
|
- `paths.core_entities` → path to core-entities.md
|
|
159
159
|
- `paths.tech_docs_dir` → technical documentation root
|
|
160
160
|
- `paths.trace_dir` → trace state directory
|
|
161
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
161
162
|
|
|
162
163
|
If `paths` section is absent, use these defaults:
|
|
163
164
|
- `specs_dir` = `specs/bdd`
|
|
@@ -167,13 +168,46 @@ If `paths` section is absent, use these defaults:
|
|
|
167
168
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
168
169
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
169
170
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
170
|
-
- `tech_docs_dir` = `tech-docs`
|
|
171
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
171
172
|
- `trace_dir` = `.trace`
|
|
173
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
172
174
|
|
|
173
175
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
174
176
|
|
|
175
177
|
---
|
|
176
178
|
|
|
179
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
180
|
+
|
|
181
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
182
|
+
|
|
183
|
+
If `services` section is present:
|
|
184
|
+
|
|
185
|
+
**1. Detect active domain** (in priority order):
|
|
186
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
187
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
188
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
189
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
190
|
+
|
|
191
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
192
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
193
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
194
|
+
- Store `active_service` = `services.{domain}.path`
|
|
195
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
196
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
197
|
+
|
|
198
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
199
|
+
- Keep default paths from Step 1
|
|
200
|
+
- Set `active_service = unresolved`
|
|
201
|
+
|
|
202
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
203
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
204
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
205
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
206
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
207
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
177
211
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
178
212
|
|
|
179
213
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -244,6 +278,26 @@ If the file does not exist → skip silently.
|
|
|
244
278
|
|
|
245
279
|
---
|
|
246
280
|
|
|
281
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
282
|
+
|
|
283
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
| `platform_type` | Modules |
|
|
290
|
+
|---|---|
|
|
291
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
292
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
293
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
294
|
+
|
|
295
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
296
|
+
|
|
297
|
+
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (generate-tests, debug, fix-bug, smoke-test).
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
247
301
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
248
302
|
|
|
249
303
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -254,10 +308,12 @@ Output exactly this block:
|
|
|
254
308
|
```
|
|
255
309
|
[CTX LOADED]
|
|
256
310
|
Stack : {language} / {framework} / {database}
|
|
311
|
+
Platform : {active_module} ({platform_type})
|
|
257
312
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
258
313
|
Ticket : {ticket_prefix}-
|
|
259
314
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
260
315
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
316
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
261
317
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
262
318
|
```
|
|
263
319
|
|
|
@@ -387,21 +443,23 @@ Suggest the logical next command based on workflow phase:
|
|
|
387
443
|
|
|
388
444
|
| Current command | Suggest next |
|
|
389
445
|
|-------------------------|-----------------------------------------------|
|
|
446
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
390
447
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
391
448
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
392
449
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
393
|
-
| /review-context (PRD) | `/generate-
|
|
450
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
451
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
394
452
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
395
453
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
396
454
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
397
455
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
398
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
456
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
399
457
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
400
458
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
401
459
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
402
460
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
403
461
|
| /smoke-test | Create PR and link to ticket |
|
|
404
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
462
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
405
463
|
| /fix-bug | Create PR and link to ticket |
|
|
406
464
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
407
465
|
|
|
@@ -498,21 +556,23 @@ Suggest the logical next command based on workflow phase:
|
|
|
498
556
|
|
|
499
557
|
| Current command | Suggest next |
|
|
500
558
|
|-------------------------|-----------------------------------------------|
|
|
559
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
501
560
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
502
561
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
503
562
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
504
|
-
| /review-context (PRD) | `/generate-
|
|
563
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
564
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
505
565
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
506
566
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
507
567
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
508
568
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
509
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
569
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
510
570
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
511
571
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
512
572
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
513
573
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
514
574
|
| /smoke-test | Create PR and link to ticket |
|
|
515
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
575
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
516
576
|
| /fix-bug | Create PR and link to ticket |
|
|
517
577
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
518
578
|
|
|
@@ -73,6 +73,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
73
73
|
- `paths.core_entities` → path to core-entities.md
|
|
74
74
|
- `paths.tech_docs_dir` → technical documentation root
|
|
75
75
|
- `paths.trace_dir` → trace state directory
|
|
76
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
76
77
|
|
|
77
78
|
If `paths` section is absent, use these defaults:
|
|
78
79
|
- `specs_dir` = `specs/bdd`
|
|
@@ -82,13 +83,46 @@ If `paths` section is absent, use these defaults:
|
|
|
82
83
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
83
84
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
84
85
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
85
|
-
- `tech_docs_dir` = `tech-docs`
|
|
86
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
86
87
|
- `trace_dir` = `.trace`
|
|
88
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
87
89
|
|
|
88
90
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
89
91
|
|
|
90
92
|
---
|
|
91
93
|
|
|
94
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
95
|
+
|
|
96
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
97
|
+
|
|
98
|
+
If `services` section is present:
|
|
99
|
+
|
|
100
|
+
**1. Detect active domain** (in priority order):
|
|
101
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
102
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
103
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
104
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
105
|
+
|
|
106
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
107
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
108
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
109
|
+
- Store `active_service` = `services.{domain}.path`
|
|
110
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
111
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
112
|
+
|
|
113
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
114
|
+
- Keep default paths from Step 1
|
|
115
|
+
- Set `active_service = unresolved`
|
|
116
|
+
|
|
117
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
118
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
119
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
120
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
121
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
122
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
92
126
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
93
127
|
|
|
94
128
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -159,6 +193,26 @@ If the file does not exist → skip silently.
|
|
|
159
193
|
|
|
160
194
|
---
|
|
161
195
|
|
|
196
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
197
|
+
|
|
198
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
| `platform_type` | Modules |
|
|
205
|
+
|---|---|
|
|
206
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
207
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
208
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
209
|
+
|
|
210
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
211
|
+
|
|
212
|
+
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (generate-tests, debug, fix-bug, smoke-test).
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
162
216
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
163
217
|
|
|
164
218
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -169,10 +223,12 @@ Output exactly this block:
|
|
|
169
223
|
```
|
|
170
224
|
[CTX LOADED]
|
|
171
225
|
Stack : {language} / {framework} / {database}
|
|
226
|
+
Platform : {active_module} ({platform_type})
|
|
172
227
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
173
228
|
Ticket : {ticket_prefix}-
|
|
174
229
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
175
230
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
231
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
176
232
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
177
233
|
```
|
|
178
234
|
|
|
@@ -325,21 +381,23 @@ Suggest the logical next command based on workflow phase:
|
|
|
325
381
|
|
|
326
382
|
| Current command | Suggest next |
|
|
327
383
|
|-------------------------|-----------------------------------------------|
|
|
384
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
328
385
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
329
386
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
330
387
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
331
|
-
| /review-context (PRD) | `/generate-
|
|
388
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
389
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
332
390
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
333
391
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
334
392
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
335
393
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
336
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
394
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
337
395
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
338
396
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
339
397
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
340
398
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
341
399
|
| /smoke-test | Create PR and link to ticket |
|
|
342
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
400
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
343
401
|
| /fix-bug | Create PR and link to ticket |
|
|
344
402
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
345
403
|
|
|
@@ -462,21 +520,23 @@ Suggest the logical next command based on workflow phase:
|
|
|
462
520
|
|
|
463
521
|
| Current command | Suggest next |
|
|
464
522
|
|-------------------------|-----------------------------------------------|
|
|
523
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
465
524
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
466
525
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
467
526
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
468
|
-
| /review-context (PRD) | `/generate-
|
|
527
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
528
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
469
529
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
470
530
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
471
531
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
472
532
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
473
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
533
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
474
534
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
475
535
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
476
536
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
477
537
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
478
538
|
| /smoke-test | Create PR and link to ticket |
|
|
479
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
539
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
480
540
|
| /fix-bug | Create PR and link to ticket |
|
|
481
541
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
482
542
|
|
|
@@ -556,21 +616,23 @@ Suggest the logical next command based on workflow phase:
|
|
|
556
616
|
|
|
557
617
|
| Current command | Suggest next |
|
|
558
618
|
|-------------------------|-----------------------------------------------|
|
|
619
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
559
620
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
560
621
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
561
622
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
562
|
-
| /review-context (PRD) | `/generate-
|
|
623
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
624
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
563
625
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
564
626
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
565
627
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
566
628
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
567
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
629
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
568
630
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
569
631
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
570
632
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
571
633
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
572
634
|
| /smoke-test | Create PR and link to ticket |
|
|
573
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
635
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
574
636
|
| /fix-bug | Create PR and link to ticket |
|
|
575
637
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
576
638
|
|