@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
package/commands/generate-bdd.md
CHANGED
|
@@ -31,7 +31,7 @@ Display and wait for response:
|
|
|
31
31
|
```
|
|
32
32
|
⚙️ MODEL CHECK
|
|
33
33
|
──────────────────────────────────────────────────────────────────
|
|
34
|
-
Recommended : claude-opus-4
|
|
34
|
+
Recommended : claude-opus-4 (or latest Opus model)
|
|
35
35
|
Why needed : Spec analysis, architecture review, code generation
|
|
36
36
|
require deep reasoning. Smaller models miss edge cases.
|
|
37
37
|
|
|
@@ -129,6 +129,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
129
129
|
- `paths.core_entities` → path to core-entities.md
|
|
130
130
|
- `paths.tech_docs_dir` → technical documentation root
|
|
131
131
|
- `paths.trace_dir` → trace state directory
|
|
132
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
132
133
|
|
|
133
134
|
If `paths` section is absent, use these defaults:
|
|
134
135
|
- `specs_dir` = `specs/bdd`
|
|
@@ -138,13 +139,46 @@ If `paths` section is absent, use these defaults:
|
|
|
138
139
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
139
140
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
140
141
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
141
|
-
- `tech_docs_dir` = `tech-docs`
|
|
142
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
142
143
|
- `trace_dir` = `.trace`
|
|
144
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
143
145
|
|
|
144
146
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
145
147
|
|
|
146
148
|
---
|
|
147
149
|
|
|
150
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
151
|
+
|
|
152
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
153
|
+
|
|
154
|
+
If `services` section is present:
|
|
155
|
+
|
|
156
|
+
**1. Detect active domain** (in priority order):
|
|
157
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
158
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
159
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
160
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
161
|
+
|
|
162
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
163
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
164
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
165
|
+
- Store `active_service` = `services.{domain}.path`
|
|
166
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
167
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
168
|
+
|
|
169
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
170
|
+
- Keep default paths from Step 1
|
|
171
|
+
- Set `active_service = unresolved`
|
|
172
|
+
|
|
173
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
174
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
175
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
176
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
177
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
178
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
148
182
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
149
183
|
|
|
150
184
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -215,6 +249,26 @@ If the file does not exist → skip silently.
|
|
|
215
249
|
|
|
216
250
|
---
|
|
217
251
|
|
|
252
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
253
|
+
|
|
254
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
| `platform_type` | Modules |
|
|
261
|
+
|---|---|
|
|
262
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
263
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
264
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
265
|
+
|
|
266
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
267
|
+
|
|
268
|
+
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).
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
218
272
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
219
273
|
|
|
220
274
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -225,10 +279,12 @@ Output exactly this block:
|
|
|
225
279
|
```
|
|
226
280
|
[CTX LOADED]
|
|
227
281
|
Stack : {language} / {framework} / {database}
|
|
282
|
+
Platform : {active_module} ({platform_type})
|
|
228
283
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
229
284
|
Ticket : {ticket_prefix}-
|
|
230
285
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
231
286
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
287
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
232
288
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
233
289
|
```
|
|
234
290
|
|
|
@@ -270,6 +326,18 @@ After loading context, check if the target PRD is large enough to warrant sub-ag
|
|
|
270
326
|
|
|
271
327
|
---
|
|
272
328
|
|
|
329
|
+
## Sub-Agent Return Format
|
|
330
|
+
|
|
331
|
+
*This section applies when running as a sub-agent (Gate Step 0 detected `_agent_mode: true`).*
|
|
332
|
+
|
|
333
|
+
After generating all `.feature` and `.tsv` files for the assigned UC, return the structured result JSON (as specified in `steps/spawn-agent.md` Step E):
|
|
334
|
+
|
|
335
|
+
```json
|
|
336
|
+
{ "uc_id": "{TICKET-ID}-UC{N}", "files_created": ["path/to/file1", "path/to/file2"], "status": "success | error", "errors": [] }
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
273
341
|
## Version Check
|
|
274
342
|
|
|
275
343
|
Before generating, check for existing `.feature` files for this PRD:
|
|
@@ -383,15 +451,16 @@ For each UC, write `{paths.specs_dir}/{domain}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
|
383
451
|
# ============================================================
|
|
384
452
|
# @trace.id: {TICKET-ID}-UC{N}
|
|
385
453
|
# @trace.title: <Feature name>
|
|
386
|
-
# @trace.revision: 1
|
|
454
|
+
# @trace.revision: 1 ← static field; use @trace.bdd_version for version tracking (incremented by /review-context --fix or --resume)
|
|
387
455
|
# @trace.domain: <domain>
|
|
388
456
|
# @trace.service: <ServiceName>
|
|
457
|
+
# @trace.module: {tech_stack.module value — e.g. java-spring | react | flutter; write "unknown" if not set in project-context.yaml}
|
|
389
458
|
# @trace.status: draft
|
|
390
459
|
# @trace.author: AI-generated
|
|
391
460
|
# @trace.created_at: {YYYY-MM-DD}
|
|
392
461
|
# @trace.prd: {TICKET-ID}
|
|
393
462
|
# @trace.prd_version: {read from PRD metadata "| **Version** |"}
|
|
394
|
-
# @trace.bdd_version: {1 if fresh generation; increment by 1
|
|
463
|
+
# @trace.bdd_version: {1.0 if fresh generation; increment by 0.1 on re-generation — e.g. 1.0 → 1.1}
|
|
395
464
|
# @trace.business_rules: {TICKET-ID}-UC{N}-BR1, {TICKET-ID}-UC{N}-BR2
|
|
396
465
|
# @trace.dataset: {domain}.testdata.yaml
|
|
397
466
|
# ============================================================
|
|
@@ -499,7 +568,8 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
|
|
|
499
568
|
**Rules:**
|
|
500
569
|
- If file does not exist → create with header row + all scenario rows.
|
|
501
570
|
- If file exists (re-generation) → for each SC in the new `.feature`:
|
|
502
|
-
- SC already in `.tsv` → update only: `sc_title`, `
|
|
571
|
+
- SC already in `.tsv` AND `spec_ver` is unchanged → update only: `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Leave all other columns unchanged.
|
|
572
|
+
- SC already in `.tsv` AND `spec_ver` changed (scenario was modified) → update: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` AND set `status = DRIFT` immediately (so the TSV reflects drift without waiting for `/validate-traces`). Leave `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` unchanged.
|
|
503
573
|
- SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` all set to `—`.
|
|
504
574
|
- SC no longer in `.feature` (removed) → delete its row.
|
|
505
575
|
|
|
@@ -552,21 +622,23 @@ Suggest the logical next command based on workflow phase:
|
|
|
552
622
|
|
|
553
623
|
| Current command | Suggest next |
|
|
554
624
|
|-------------------------|-----------------------------------------------|
|
|
625
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
555
626
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
556
627
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
557
628
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
558
|
-
| /review-context (PRD) | `/generate-
|
|
629
|
+
| /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 |
|
|
630
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
559
631
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
560
632
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
561
633
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
562
634
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
563
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
635
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
564
636
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
565
637
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
566
638
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
567
639
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
568
640
|
| /smoke-test | Create PR and link to ticket |
|
|
569
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
641
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
570
642
|
| /fix-bug | Create PR and link to ticket |
|
|
571
643
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
572
644
|
|
|
@@ -587,5 +659,10 @@ Files:
|
|
|
587
659
|
Trace:
|
|
588
660
|
{paths.trace_dir}/{TICKET-ID}-UC1.tsv ({N} rows)
|
|
589
661
|
{paths.trace_dir}/{TICKET-ID}-UC2.tsv ({N} rows)
|
|
590
|
-
Next: /
|
|
662
|
+
Next: Run /review-context on EACH generated feature file (one per UC):
|
|
663
|
+
/review-context {paths.specs_dir}/{domain}/{TICKET-ID}-UC1-{slug}.feature
|
|
664
|
+
/review-context {paths.specs_dir}/{domain}/{TICKET-ID}-UC2-{slug}.feature
|
|
665
|
+
...
|
|
666
|
+
→ then per UC: /generate-tech-docs {feature-file} (if tech design required)
|
|
667
|
+
→ or per UC: /generate-code {feature-file} (if skipping tech design)
|
|
591
668
|
```
|
|
@@ -26,6 +26,18 @@ After loading context, check if the target PRD is large enough to warrant sub-ag
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
+
## Sub-Agent Return Format
|
|
30
|
+
|
|
31
|
+
*This section applies when running as a sub-agent (Gate Step 0 detected `_agent_mode: true`).*
|
|
32
|
+
|
|
33
|
+
After generating all `.feature` and `.tsv` files for the assigned UC, return the structured result JSON (as specified in `steps/spawn-agent.md` Step E):
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{ "uc_id": "{TICKET-ID}-UC{N}", "files_created": ["path/to/file1", "path/to/file2"], "status": "success | error", "errors": [] }
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
29
41
|
## Version Check
|
|
30
42
|
|
|
31
43
|
Before generating, check for existing `.feature` files for this PRD:
|
|
@@ -139,15 +151,16 @@ For each UC, write `{paths.specs_dir}/{domain}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
|
139
151
|
# ============================================================
|
|
140
152
|
# @trace.id: {TICKET-ID}-UC{N}
|
|
141
153
|
# @trace.title: <Feature name>
|
|
142
|
-
# @trace.revision: 1
|
|
154
|
+
# @trace.revision: 1 ← static field; use @trace.bdd_version for version tracking (incremented by /review-context --fix or --resume)
|
|
143
155
|
# @trace.domain: <domain>
|
|
144
156
|
# @trace.service: <ServiceName>
|
|
157
|
+
# @trace.module: {tech_stack.module value — e.g. java-spring | react | flutter; write "unknown" if not set in project-context.yaml}
|
|
145
158
|
# @trace.status: draft
|
|
146
159
|
# @trace.author: AI-generated
|
|
147
160
|
# @trace.created_at: {YYYY-MM-DD}
|
|
148
161
|
# @trace.prd: {TICKET-ID}
|
|
149
162
|
# @trace.prd_version: {read from PRD metadata "| **Version** |"}
|
|
150
|
-
# @trace.bdd_version: {1 if fresh generation; increment by 1
|
|
163
|
+
# @trace.bdd_version: {1.0 if fresh generation; increment by 0.1 on re-generation — e.g. 1.0 → 1.1}
|
|
151
164
|
# @trace.business_rules: {TICKET-ID}-UC{N}-BR1, {TICKET-ID}-UC{N}-BR2
|
|
152
165
|
# @trace.dataset: {domain}.testdata.yaml
|
|
153
166
|
# ============================================================
|
|
@@ -255,7 +268,8 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
|
|
|
255
268
|
**Rules:**
|
|
256
269
|
- If file does not exist → create with header row + all scenario rows.
|
|
257
270
|
- If file exists (re-generation) → for each SC in the new `.feature`:
|
|
258
|
-
- SC already in `.tsv` → update only: `sc_title`, `
|
|
271
|
+
- SC already in `.tsv` AND `spec_ver` is unchanged → update only: `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Leave all other columns unchanged.
|
|
272
|
+
- SC already in `.tsv` AND `spec_ver` changed (scenario was modified) → update: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` AND set `status = DRIFT` immediately (so the TSV reflects drift without waiting for `/validate-traces`). Leave `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` unchanged.
|
|
259
273
|
- SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision` all set to `—`.
|
|
260
274
|
- SC no longer in `.feature` (removed) → delete its row.
|
|
261
275
|
|
|
@@ -290,5 +304,10 @@ Files:
|
|
|
290
304
|
Trace:
|
|
291
305
|
{paths.trace_dir}/{TICKET-ID}-UC1.tsv ({N} rows)
|
|
292
306
|
{paths.trace_dir}/{TICKET-ID}-UC2.tsv ({N} rows)
|
|
293
|
-
Next: /
|
|
307
|
+
Next: Run /review-context on EACH generated feature file (one per UC):
|
|
308
|
+
/review-context {paths.specs_dir}/{domain}/{TICKET-ID}-UC1-{slug}.feature
|
|
309
|
+
/review-context {paths.specs_dir}/{domain}/{TICKET-ID}-UC2-{slug}.feature
|
|
310
|
+
...
|
|
311
|
+
→ then per UC: /generate-tech-docs {feature-file} (if tech design required)
|
|
312
|
+
→ or per UC: /generate-code {feature-file} (if skipping tech design)
|
|
294
313
|
```
|
|
@@ -31,7 +31,7 @@ Display and wait for response:
|
|
|
31
31
|
```
|
|
32
32
|
⚙️ MODEL CHECK
|
|
33
33
|
──────────────────────────────────────────────────────────────────
|
|
34
|
-
Recommended : claude-opus-4
|
|
34
|
+
Recommended : claude-opus-4 (or latest Opus model)
|
|
35
35
|
Why needed : Spec analysis, architecture review, code generation
|
|
36
36
|
require deep reasoning. Smaller models miss edge cases.
|
|
37
37
|
|
|
@@ -131,6 +131,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
131
131
|
- `paths.core_entities` → path to core-entities.md
|
|
132
132
|
- `paths.tech_docs_dir` → technical documentation root
|
|
133
133
|
- `paths.trace_dir` → trace state directory
|
|
134
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
134
135
|
|
|
135
136
|
If `paths` section is absent, use these defaults:
|
|
136
137
|
- `specs_dir` = `specs/bdd`
|
|
@@ -140,13 +141,46 @@ If `paths` section is absent, use these defaults:
|
|
|
140
141
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
141
142
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
142
143
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
143
|
-
- `tech_docs_dir` = `tech-docs`
|
|
144
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
144
145
|
- `trace_dir` = `.trace`
|
|
146
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
145
147
|
|
|
146
148
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
147
149
|
|
|
148
150
|
---
|
|
149
151
|
|
|
152
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
153
|
+
|
|
154
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
155
|
+
|
|
156
|
+
If `services` section is present:
|
|
157
|
+
|
|
158
|
+
**1. Detect active domain** (in priority order):
|
|
159
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
160
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
161
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
162
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
163
|
+
|
|
164
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
165
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
166
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
167
|
+
- Store `active_service` = `services.{domain}.path`
|
|
168
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
169
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
170
|
+
|
|
171
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
172
|
+
- Keep default paths from Step 1
|
|
173
|
+
- Set `active_service = unresolved`
|
|
174
|
+
|
|
175
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
176
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
177
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
178
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
179
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
180
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
150
184
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
151
185
|
|
|
152
186
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -217,6 +251,26 @@ If the file does not exist → skip silently.
|
|
|
217
251
|
|
|
218
252
|
---
|
|
219
253
|
|
|
254
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
255
|
+
|
|
256
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
257
|
+
|
|
258
|
+
```
|
|
259
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
| `platform_type` | Modules |
|
|
263
|
+
|---|---|
|
|
264
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
265
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
266
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
267
|
+
|
|
268
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
269
|
+
|
|
270
|
+
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).
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
220
274
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
221
275
|
|
|
222
276
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -227,10 +281,12 @@ Output exactly this block:
|
|
|
227
281
|
```
|
|
228
282
|
[CTX LOADED]
|
|
229
283
|
Stack : {language} / {framework} / {database}
|
|
284
|
+
Platform : {active_module} ({platform_type})
|
|
230
285
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
231
286
|
Ticket : {ticket_prefix}-
|
|
232
287
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
233
288
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
289
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
234
290
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
235
291
|
```
|
|
236
292
|
|
|
@@ -252,27 +308,88 @@ After completing all steps, you have loaded:
|
|
|
252
308
|
Proceed to the next step of the calling command.
|
|
253
309
|
|
|
254
310
|
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Scope Lock
|
|
314
|
+
|
|
315
|
+
This command is strictly scoped to the **single feature file** passed as `$ARGUMENTS`:
|
|
316
|
+
|
|
317
|
+
- Feature file: `{exact path from $ARGUMENTS}`
|
|
318
|
+
- UC: `{UC-ID}` (read from `@trace.id` in that file's header)
|
|
319
|
+
|
|
320
|
+
**Do NOT read or implement scenarios from any other `.feature` file** in the same domain folder, even if they share the same entity, domain concept, or service name.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Context Load (additional)
|
|
325
|
+
|
|
326
|
+
Read:
|
|
327
|
+
1. The scoped `.feature` file only
|
|
328
|
+
2. Tech-doc at `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md` (if exists)
|
|
329
|
+
3. CLAUDE.md §architecture + §coding_standards
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Read Trace State
|
|
334
|
+
|
|
335
|
+
Read `{paths.trace_dir}/{UC-ID}.tsv` if it exists. For each scenario row, note its current `status`:
|
|
336
|
+
|
|
337
|
+
| Status | Meaning | Action in this run |
|
|
338
|
+
|--------|---------|-------------------|
|
|
339
|
+
| `UNTRACKED` | `implemented_by == —` | Generate — scenario has no code yet |
|
|
340
|
+
| `DRIFT` | `spec_ver != gen_ver` | Regenerate — scenario updated since last codegen |
|
|
341
|
+
| `OK` | implemented + tested | Skip unless explicitly re-generating |
|
|
342
|
+
| `GAP` | implemented, no tests | Skip codegen — already coded; run `/generate-tests` instead |
|
|
343
|
+
|
|
344
|
+
Use these statuses to populate the **Scenarios** count in the CHECKPOINT plan (`{X} new, {Y} drifted, {Z} synced-skip`).
|
|
345
|
+
If `.tsv` does not exist → treat all scenarios as `UNTRACKED`.
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## File Scan
|
|
350
|
+
|
|
351
|
+
Before generating, determine which files will be needed for this UC's scenarios. Check whether each file already exists on disk.
|
|
352
|
+
|
|
353
|
+
Classify each file:
|
|
354
|
+
|
|
355
|
+
| Status | Meaning | Action |
|
|
356
|
+
|--------|---------|--------|
|
|
357
|
+
| `CREATE` | File does not exist | Generate full new file |
|
|
358
|
+
| `EXTEND` | File exists, new methods needed | Add new methods only — do NOT rewrite existing code |
|
|
359
|
+
| `SKIP` | File exists and already covers all UC scenarios | Leave untouched |
|
|
360
|
+
|
|
361
|
+
> **EXTEND rule:** Read the existing file fully. Locate the correct class/interface. Add only the methods required by `{UC-ID}` scenarios. Preserve all existing methods, fields, and annotations exactly as-is. Attach `@trace.implements={UC-ID}-SC{N}` on each new method.
|
|
362
|
+
|
|
255
363
|
---
|
|
256
364
|
|
|
257
365
|
## CHECKPOINT — Code Generation Plan
|
|
258
366
|
|
|
259
367
|
Before generating any code, show:
|
|
368
|
+
|
|
260
369
|
```
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
370
|
+
Code Generation Plan — {UC-ID}
|
|
371
|
+
──────────────────────────────────────────────────────
|
|
372
|
+
Feature : {name}
|
|
373
|
+
Ticket : {TICKET_ID if known}
|
|
374
|
+
Domain : {domain}
|
|
375
|
+
UC : {UC-ID} only ← other feature files in this folder are NOT read
|
|
376
|
+
Tech : {language} / {framework}
|
|
377
|
+
Scenarios: {N} total ({X} new, {Y} drifted, {Z} synced-skip)
|
|
378
|
+
Layer : {from CLAUDE.md §2}
|
|
379
|
+
|
|
380
|
+
Files:
|
|
381
|
+
CREATE {N} new files
|
|
382
|
+
+ {path/FileName.ext}
|
|
383
|
+
EXTEND {M} existing files (add methods only)
|
|
384
|
+
~ {path/FileName.ext} — adding: {methodA}, {methodB}
|
|
385
|
+
SKIP {K} files (no change needed)
|
|
386
|
+
= {path/FileName.ext}
|
|
387
|
+
──────────────────────────────────────────────────────
|
|
268
388
|
Proceed? (Y/N)
|
|
269
389
|
```
|
|
270
390
|
|
|
271
391
|
Wait for explicit "Y" before generating.
|
|
272
392
|
|
|
273
|
-
## Context Load (additional)
|
|
274
|
-
Read: `.feature` file, tech-doc (if exists at `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`), CLAUDE.md §architecture + §coding_standards, existing entity files.
|
|
275
|
-
|
|
276
393
|
## Branch
|
|
277
394
|
```bash
|
|
278
395
|
git checkout -b feature/{TICKET_ID}-{slug}
|
|
@@ -283,13 +400,17 @@ git checkout -b feature/{TICKET_ID}-{slug}
|
|
|
283
400
|
Default order (override from CLAUDE.md if different):
|
|
284
401
|
DTOs → Entity/Model → Repository → Service interface → Service impl → Facade (if applicable) → Controller
|
|
285
402
|
|
|
286
|
-
**
|
|
403
|
+
**For `CREATE` files:** generate the full file.
|
|
404
|
+
|
|
405
|
+
**For `EXTEND` files:** open the existing file → add only the new methods for `{UC-ID}` → do not touch anything else.
|
|
406
|
+
|
|
407
|
+
**Traceability tags on controller/handler (adapt to your language's comment syntax):**
|
|
287
408
|
```
|
|
288
409
|
@trace.implements={UC-ID}-SC{N}
|
|
289
410
|
@trace.prd_version={read @trace.prd_version from the .feature file header}
|
|
290
411
|
@trace.bdd_version={read @trace.bdd_version from the .feature file header}
|
|
291
412
|
@trace.tech_doc_revision={read @trace.revision from tech-doc header, or omit if no tech-doc}
|
|
292
|
-
@trace.source={paths.specs_dir}/{domain}/{UC-ID}.feature
|
|
413
|
+
@trace.source={paths.specs_dir}/{domain}/{UC-ID}-{slug}.feature
|
|
293
414
|
```
|
|
294
415
|
|
|
295
416
|
`@trace.prd_version` records which PRD version this code was written against.
|
|
@@ -297,6 +418,8 @@ DTOs → Entity/Model → Repository → Service interface → Service impl →
|
|
|
297
418
|
`@trace.tech_doc_revision` records which tech-design revision this code follows.
|
|
298
419
|
`/validate-traces` will flag drift if any upstream artifact is updated to a newer version.
|
|
299
420
|
|
|
421
|
+
> **Entry-point rule:** `@trace.implements` must appear on the **entry-point layer** as defined in `CLAUDE.md §2`. For REST APIs → Controller. For event-driven modules → event handler / consumer class. For context-engineering → the prompt orchestration function. Never put it only on an inner layer.
|
|
422
|
+
|
|
300
423
|
## Self-Review (3 rounds)
|
|
301
424
|
- [ ] Every scenario has a corresponding endpoint
|
|
302
425
|
- [ ] @trace.implements on every endpoint
|
|
@@ -360,21 +483,23 @@ Suggest the logical next command based on workflow phase:
|
|
|
360
483
|
|
|
361
484
|
| Current command | Suggest next |
|
|
362
485
|
|-------------------------|-----------------------------------------------|
|
|
486
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
363
487
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
364
488
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
365
489
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
366
|
-
| /review-context (PRD) | `/generate-
|
|
490
|
+
| /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 |
|
|
491
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
367
492
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
368
493
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
369
494
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
370
495
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
371
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
496
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
372
497
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
373
498
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
374
499
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
375
500
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
376
501
|
| /smoke-test | Create PR and link to ticket |
|
|
377
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
502
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
378
503
|
| /fix-bug | Create PR and link to ticket |
|
|
379
504
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
380
505
|
|
|
@@ -389,7 +514,9 @@ Next : {suggested command with example arguments}
|
|
|
389
514
|
|
|
390
515
|
```
|
|
391
516
|
/generate-code Complete — {UC-ID}
|
|
392
|
-
Files: created={N},
|
|
517
|
+
Files: created={N}, extended={M}, skipped={K} | Build: SUCCESS
|
|
393
518
|
Branch: feature/{TICKET_ID}-{slug}
|
|
394
|
-
Next:
|
|
519
|
+
Next:
|
|
520
|
+
First generation for this UC → /review-code {UC-ID} ← code review required before tests
|
|
521
|
+
Re-generation (already reviewed) → /generate-tests {UC-ID}
|
|
395
522
|
```
|
|
@@ -10,25 +10,86 @@
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
## Scope Lock
|
|
14
|
+
|
|
15
|
+
This command is strictly scoped to the **single feature file** passed as `$ARGUMENTS`:
|
|
16
|
+
|
|
17
|
+
- Feature file: `{exact path from $ARGUMENTS}`
|
|
18
|
+
- UC: `{UC-ID}` (read from `@trace.id` in that file's header)
|
|
19
|
+
|
|
20
|
+
**Do NOT read or implement scenarios from any other `.feature` file** in the same domain folder, even if they share the same entity, domain concept, or service name.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Context Load (additional)
|
|
25
|
+
|
|
26
|
+
Read:
|
|
27
|
+
1. The scoped `.feature` file only
|
|
28
|
+
2. Tech-doc at `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md` (if exists)
|
|
29
|
+
3. CLAUDE.md §architecture + §coding_standards
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Read Trace State
|
|
34
|
+
|
|
35
|
+
Read `{paths.trace_dir}/{UC-ID}.tsv` if it exists. For each scenario row, note its current `status`:
|
|
36
|
+
|
|
37
|
+
| Status | Meaning | Action in this run |
|
|
38
|
+
|--------|---------|-------------------|
|
|
39
|
+
| `UNTRACKED` | `implemented_by == —` | Generate — scenario has no code yet |
|
|
40
|
+
| `DRIFT` | `spec_ver != gen_ver` | Regenerate — scenario updated since last codegen |
|
|
41
|
+
| `OK` | implemented + tested | Skip unless explicitly re-generating |
|
|
42
|
+
| `GAP` | implemented, no tests | Skip codegen — already coded; run `/generate-tests` instead |
|
|
43
|
+
|
|
44
|
+
Use these statuses to populate the **Scenarios** count in the CHECKPOINT plan (`{X} new, {Y} drifted, {Z} synced-skip`).
|
|
45
|
+
If `.tsv` does not exist → treat all scenarios as `UNTRACKED`.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## File Scan
|
|
50
|
+
|
|
51
|
+
Before generating, determine which files will be needed for this UC's scenarios. Check whether each file already exists on disk.
|
|
52
|
+
|
|
53
|
+
Classify each file:
|
|
54
|
+
|
|
55
|
+
| Status | Meaning | Action |
|
|
56
|
+
|--------|---------|--------|
|
|
57
|
+
| `CREATE` | File does not exist | Generate full new file |
|
|
58
|
+
| `EXTEND` | File exists, new methods needed | Add new methods only — do NOT rewrite existing code |
|
|
59
|
+
| `SKIP` | File exists and already covers all UC scenarios | Leave untouched |
|
|
60
|
+
|
|
61
|
+
> **EXTEND rule:** Read the existing file fully. Locate the correct class/interface. Add only the methods required by `{UC-ID}` scenarios. Preserve all existing methods, fields, and annotations exactly as-is. Attach `@trace.implements={UC-ID}-SC{N}` on each new method.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
13
65
|
## CHECKPOINT — Code Generation Plan
|
|
14
66
|
|
|
15
67
|
Before generating any code, show:
|
|
68
|
+
|
|
16
69
|
```
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
70
|
+
Code Generation Plan — {UC-ID}
|
|
71
|
+
──────────────────────────────────────────────────────
|
|
72
|
+
Feature : {name}
|
|
73
|
+
Ticket : {TICKET_ID if known}
|
|
74
|
+
Domain : {domain}
|
|
75
|
+
UC : {UC-ID} only ← other feature files in this folder are NOT read
|
|
76
|
+
Tech : {language} / {framework}
|
|
77
|
+
Scenarios: {N} total ({X} new, {Y} drifted, {Z} synced-skip)
|
|
78
|
+
Layer : {from CLAUDE.md §2}
|
|
79
|
+
|
|
80
|
+
Files:
|
|
81
|
+
CREATE {N} new files
|
|
82
|
+
+ {path/FileName.ext}
|
|
83
|
+
EXTEND {M} existing files (add methods only)
|
|
84
|
+
~ {path/FileName.ext} — adding: {methodA}, {methodB}
|
|
85
|
+
SKIP {K} files (no change needed)
|
|
86
|
+
= {path/FileName.ext}
|
|
87
|
+
──────────────────────────────────────────────────────
|
|
24
88
|
Proceed? (Y/N)
|
|
25
89
|
```
|
|
26
90
|
|
|
27
91
|
Wait for explicit "Y" before generating.
|
|
28
92
|
|
|
29
|
-
## Context Load (additional)
|
|
30
|
-
Read: `.feature` file, tech-doc (if exists at `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`), CLAUDE.md §architecture + §coding_standards, existing entity files.
|
|
31
|
-
|
|
32
93
|
## Branch
|
|
33
94
|
```bash
|
|
34
95
|
git checkout -b feature/{TICKET_ID}-{slug}
|
|
@@ -39,13 +100,17 @@ git checkout -b feature/{TICKET_ID}-{slug}
|
|
|
39
100
|
Default order (override from CLAUDE.md if different):
|
|
40
101
|
DTOs → Entity/Model → Repository → Service interface → Service impl → Facade (if applicable) → Controller
|
|
41
102
|
|
|
42
|
-
**
|
|
103
|
+
**For `CREATE` files:** generate the full file.
|
|
104
|
+
|
|
105
|
+
**For `EXTEND` files:** open the existing file → add only the new methods for `{UC-ID}` → do not touch anything else.
|
|
106
|
+
|
|
107
|
+
**Traceability tags on controller/handler (adapt to your language's comment syntax):**
|
|
43
108
|
```
|
|
44
109
|
@trace.implements={UC-ID}-SC{N}
|
|
45
110
|
@trace.prd_version={read @trace.prd_version from the .feature file header}
|
|
46
111
|
@trace.bdd_version={read @trace.bdd_version from the .feature file header}
|
|
47
112
|
@trace.tech_doc_revision={read @trace.revision from tech-doc header, or omit if no tech-doc}
|
|
48
|
-
@trace.source={paths.specs_dir}/{domain}/{UC-ID}.feature
|
|
113
|
+
@trace.source={paths.specs_dir}/{domain}/{UC-ID}-{slug}.feature
|
|
49
114
|
```
|
|
50
115
|
|
|
51
116
|
`@trace.prd_version` records which PRD version this code was written against.
|
|
@@ -53,6 +118,8 @@ DTOs → Entity/Model → Repository → Service interface → Service impl →
|
|
|
53
118
|
`@trace.tech_doc_revision` records which tech-design revision this code follows.
|
|
54
119
|
`/validate-traces` will flag drift if any upstream artifact is updated to a newer version.
|
|
55
120
|
|
|
121
|
+
> **Entry-point rule:** `@trace.implements` must appear on the **entry-point layer** as defined in `CLAUDE.md §2`. For REST APIs → Controller. For event-driven modules → event handler / consumer class. For context-engineering → the prompt orchestration function. Never put it only on an inner layer.
|
|
122
|
+
|
|
56
123
|
## Self-Review (3 rounds)
|
|
57
124
|
- [ ] Every scenario has a corresponding endpoint
|
|
58
125
|
- [ ] @trace.implements on every endpoint
|
|
@@ -92,7 +159,9 @@ git commit -m "{commit_format}: {description}"
|
|
|
92
159
|
|
|
93
160
|
```
|
|
94
161
|
/generate-code Complete — {UC-ID}
|
|
95
|
-
Files: created={N},
|
|
162
|
+
Files: created={N}, extended={M}, skipped={K} | Build: SUCCESS
|
|
96
163
|
Branch: feature/{TICKET_ID}-{slug}
|
|
97
|
-
Next:
|
|
164
|
+
Next:
|
|
165
|
+
First generation for this UC → /review-code {UC-ID} ← code review required before tests
|
|
166
|
+
Re-generation (already reviewed) → /generate-tests {UC-ID}
|
|
98
167
|
```
|