@anhth2/spec-driven-dev-plugin 0.6.0 → 0.7.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 +180 -11
- package/commands/debug.md +196 -10
- package/commands/debug.tmpl +170 -6
- package/commands/define-product.md +31 -5
- package/commands/define-product.tmpl +5 -1
- package/commands/fix-bug.md +74 -10
- package/commands/fix-bug.tmpl +48 -6
- package/commands/generate-bdd.md +49 -8
- package/commands/generate-bdd.tmpl +23 -4
- package/commands/generate-code.md +109 -18
- package/commands/generate-code.tmpl +83 -14
- package/commands/generate-prd.md +33 -6
- package/commands/generate-prd.tmpl +7 -2
- package/commands/generate-tech-docs.md +85 -8
- package/commands/generate-tech-docs.tmpl +59 -4
- package/commands/generate-tests.md +454 -36
- package/commands/generate-tests.tmpl +428 -32
- package/commands/refine-prd.md +39 -7
- package/commands/refine-prd.tmpl +13 -3
- package/commands/review-code.md +57 -5
- package/commands/review-code.tmpl +31 -1
- package/commands/review-context.md +41 -11
- package/commands/review-context.tmpl +15 -7
- package/commands/review-tech-docs.md +39 -8
- package/commands/review-tech-docs.tmpl +13 -4
- package/commands/run-tests.md +159 -17
- package/commands/run-tests.tmpl +133 -13
- package/commands/setup-ai-first.md +61 -3
- package/commands/setup-ai-first.tmpl +6 -2
- package/commands/smoke-test.md +191 -21
- package/commands/smoke-test.tmpl +165 -17
- package/commands/validate-traces.md +40 -7
- package/commands/validate-traces.tmpl +14 -3
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +196 -10
- package/core/commands/define-product.md +31 -5
- package/core/commands/fix-bug.md +74 -10
- package/core/commands/generate-bdd.md +49 -8
- package/core/commands/generate-code.md +109 -18
- package/core/commands/generate-prd.md +33 -6
- package/core/commands/generate-tech-docs.md +85 -8
- package/core/commands/generate-tests.md +454 -36
- package/core/commands/refine-prd.md +39 -7
- package/core/commands/review-code.md +57 -5
- package/core/commands/review-context.md +41 -11
- package/core/commands/review-tech-docs.md +39 -8
- package/core/commands/run-tests.md +159 -17
- package/core/commands/setup-ai-first.md +61 -3
- package/core/commands/smoke-test.md +191 -21
- package/core/commands/validate-traces.md +40 -7
- package/core/skills/code/SKILL.md +29 -6
- package/core/skills/debug/SKILL.md +31 -7
- package/core/skills/discovery/SKILL.md +25 -3
- package/core/skills/prd/SKILL.md +8 -6
- package/core/skills/setup-ai-first/SKILL.md +3 -2
- package/core/skills/spec/SKILL.md +7 -5
- package/core/skills/test/SKILL.md +54 -9
- package/core/steps/context-loader.md +22 -1
- package/core/steps/gate.md +1 -1
- package/core/steps/report-footer.md +3 -2
- package/core/steps/spawn-agent.md +3 -1
- package/package.json +1 -1
- package/skills/code/SKILL.md +29 -6
- package/skills/debug/SKILL.md +31 -7
- package/skills/discovery/SKILL.md +25 -3
- package/skills/prd/SKILL.md +8 -6
- package/skills/setup-ai-first/SKILL.md +3 -2
- package/skills/spec/SKILL.md +7 -5
- package/skills/test/SKILL.md +54 -9
- package/steps/context-loader.md +22 -1
- package/steps/gate.md +1 -1
- package/steps/report-footer.md +3 -2
- package/steps/spawn-agent.md +3 -1
|
@@ -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
|
|
|
@@ -138,7 +138,7 @@ If `paths` section is absent, use these defaults:
|
|
|
138
138
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
139
139
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
140
140
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
141
|
-
- `tech_docs_dir` = `tech-docs`
|
|
141
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
142
142
|
- `trace_dir` = `.trace`
|
|
143
143
|
|
|
144
144
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
@@ -215,6 +215,26 @@ If the file does not exist → skip silently.
|
|
|
215
215
|
|
|
216
216
|
---
|
|
217
217
|
|
|
218
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
219
|
+
|
|
220
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
| `platform_type` | Modules |
|
|
227
|
+
|---|---|
|
|
228
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
229
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
230
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
231
|
+
|
|
232
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
233
|
+
|
|
234
|
+
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).
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
218
238
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
219
239
|
|
|
220
240
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -225,6 +245,7 @@ Output exactly this block:
|
|
|
225
245
|
```
|
|
226
246
|
[CTX LOADED]
|
|
227
247
|
Stack : {language} / {framework} / {database}
|
|
248
|
+
Platform : {active_module} ({platform_type})
|
|
228
249
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
229
250
|
Ticket : {ticket_prefix}-
|
|
230
251
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
@@ -270,6 +291,18 @@ After loading context, check if the target PRD is large enough to warrant sub-ag
|
|
|
270
291
|
|
|
271
292
|
---
|
|
272
293
|
|
|
294
|
+
## Sub-Agent Return Format
|
|
295
|
+
|
|
296
|
+
*This section applies when running as a sub-agent (Gate Step 0 detected `_agent_mode: true`).*
|
|
297
|
+
|
|
298
|
+
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):
|
|
299
|
+
|
|
300
|
+
```json
|
|
301
|
+
{ "uc_id": "{TICKET-ID}-UC{N}", "files_created": ["path/to/file1", "path/to/file2"], "status": "success | error", "errors": [] }
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
273
306
|
## Version Check
|
|
274
307
|
|
|
275
308
|
Before generating, check for existing `.feature` files for this PRD:
|
|
@@ -383,15 +416,16 @@ For each UC, write `{paths.specs_dir}/{domain}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
|
383
416
|
# ============================================================
|
|
384
417
|
# @trace.id: {TICKET-ID}-UC{N}
|
|
385
418
|
# @trace.title: <Feature name>
|
|
386
|
-
# @trace.revision: 1
|
|
419
|
+
# @trace.revision: 1 ← static field; use @trace.bdd_version for version tracking (incremented by /review-context --fix or --resume)
|
|
387
420
|
# @trace.domain: <domain>
|
|
388
421
|
# @trace.service: <ServiceName>
|
|
422
|
+
# @trace.module: {tech_stack.module value — e.g. java-spring | react | flutter; write "unknown" if not set in project-context.yaml}
|
|
389
423
|
# @trace.status: draft
|
|
390
424
|
# @trace.author: AI-generated
|
|
391
425
|
# @trace.created_at: {YYYY-MM-DD}
|
|
392
426
|
# @trace.prd: {TICKET-ID}
|
|
393
427
|
# @trace.prd_version: {read from PRD metadata "| **Version** |"}
|
|
394
|
-
# @trace.bdd_version: {1 if fresh generation; increment by 1
|
|
428
|
+
# @trace.bdd_version: {1.0 if fresh generation; increment by 0.1 on re-generation — e.g. 1.0 → 1.1}
|
|
395
429
|
# @trace.business_rules: {TICKET-ID}-UC{N}-BR1, {TICKET-ID}-UC{N}-BR2
|
|
396
430
|
# @trace.dataset: {domain}.testdata.yaml
|
|
397
431
|
# ============================================================
|
|
@@ -499,7 +533,8 @@ sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tpr
|
|
|
499
533
|
**Rules:**
|
|
500
534
|
- If file does not exist → create with header row + all scenario rows.
|
|
501
535
|
- If file exists (re-generation) → for each SC in the new `.feature`:
|
|
502
|
-
- SC already in `.tsv` → update only: `sc_title`, `
|
|
536
|
+
- 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.
|
|
537
|
+
- 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
538
|
- 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
539
|
- SC no longer in `.feature` (removed) → delete its row.
|
|
505
540
|
|
|
@@ -552,6 +587,7 @@ Suggest the logical next command based on workflow phase:
|
|
|
552
587
|
|
|
553
588
|
| Current command | Suggest next |
|
|
554
589
|
|-------------------------|-----------------------------------------------|
|
|
590
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
555
591
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
556
592
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
557
593
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
@@ -560,13 +596,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
560
596
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
561
597
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
562
598
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
563
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
599
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
564
600
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
565
601
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
566
602
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
567
603
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
568
604
|
| /smoke-test | Create PR and link to ticket |
|
|
569
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
605
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
570
606
|
| /fix-bug | Create PR and link to ticket |
|
|
571
607
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
572
608
|
|
|
@@ -587,5 +623,10 @@ Files:
|
|
|
587
623
|
Trace:
|
|
588
624
|
{paths.trace_dir}/{TICKET-ID}-UC1.tsv ({N} rows)
|
|
589
625
|
{paths.trace_dir}/{TICKET-ID}-UC2.tsv ({N} rows)
|
|
590
|
-
Next: /
|
|
626
|
+
Next: Run /review-context on EACH generated feature file (one per UC):
|
|
627
|
+
/review-context {paths.specs_dir}/{domain}/{TICKET-ID}-UC1-{slug}.feature
|
|
628
|
+
/review-context {paths.specs_dir}/{domain}/{TICKET-ID}-UC2-{slug}.feature
|
|
629
|
+
...
|
|
630
|
+
→ then per UC: /generate-tech-docs {feature-file} (if tech design required)
|
|
631
|
+
→ or per UC: /generate-code {feature-file} (if skipping tech design)
|
|
591
632
|
```
|
|
@@ -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
|
|
|
@@ -140,7 +140,7 @@ If `paths` section is absent, use these defaults:
|
|
|
140
140
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
141
141
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
142
142
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
143
|
-
- `tech_docs_dir` = `tech-docs`
|
|
143
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
144
144
|
- `trace_dir` = `.trace`
|
|
145
145
|
|
|
146
146
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
@@ -217,6 +217,26 @@ If the file does not exist → skip silently.
|
|
|
217
217
|
|
|
218
218
|
---
|
|
219
219
|
|
|
220
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
221
|
+
|
|
222
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
| `platform_type` | Modules |
|
|
229
|
+
|---|---|
|
|
230
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
231
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
232
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
233
|
+
|
|
234
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
235
|
+
|
|
236
|
+
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).
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
220
240
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
221
241
|
|
|
222
242
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -227,6 +247,7 @@ Output exactly this block:
|
|
|
227
247
|
```
|
|
228
248
|
[CTX LOADED]
|
|
229
249
|
Stack : {language} / {framework} / {database}
|
|
250
|
+
Platform : {active_module} ({platform_type})
|
|
230
251
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
231
252
|
Ticket : {ticket_prefix}-
|
|
232
253
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
@@ -252,27 +273,88 @@ After completing all steps, you have loaded:
|
|
|
252
273
|
Proceed to the next step of the calling command.
|
|
253
274
|
|
|
254
275
|
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Scope Lock
|
|
279
|
+
|
|
280
|
+
This command is strictly scoped to the **single feature file** passed as `$ARGUMENTS`:
|
|
281
|
+
|
|
282
|
+
- Feature file: `{exact path from $ARGUMENTS}`
|
|
283
|
+
- UC: `{UC-ID}` (read from `@trace.id` in that file's header)
|
|
284
|
+
|
|
285
|
+
**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.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Context Load (additional)
|
|
290
|
+
|
|
291
|
+
Read:
|
|
292
|
+
1. The scoped `.feature` file only
|
|
293
|
+
2. Tech-doc at `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md` (if exists)
|
|
294
|
+
3. CLAUDE.md §architecture + §coding_standards
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Read Trace State
|
|
299
|
+
|
|
300
|
+
Read `{paths.trace_dir}/{UC-ID}.tsv` if it exists. For each scenario row, note its current `status`:
|
|
301
|
+
|
|
302
|
+
| Status | Meaning | Action in this run |
|
|
303
|
+
|--------|---------|-------------------|
|
|
304
|
+
| `UNTRACKED` | `implemented_by == —` | Generate — scenario has no code yet |
|
|
305
|
+
| `DRIFT` | `spec_ver != gen_ver` | Regenerate — scenario updated since last codegen |
|
|
306
|
+
| `OK` | implemented + tested | Skip unless explicitly re-generating |
|
|
307
|
+
| `GAP` | implemented, no tests | Skip codegen — already coded; run `/generate-tests` instead |
|
|
308
|
+
|
|
309
|
+
Use these statuses to populate the **Scenarios** count in the CHECKPOINT plan (`{X} new, {Y} drifted, {Z} synced-skip`).
|
|
310
|
+
If `.tsv` does not exist → treat all scenarios as `UNTRACKED`.
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## File Scan
|
|
315
|
+
|
|
316
|
+
Before generating, determine which files will be needed for this UC's scenarios. Check whether each file already exists on disk.
|
|
317
|
+
|
|
318
|
+
Classify each file:
|
|
319
|
+
|
|
320
|
+
| Status | Meaning | Action |
|
|
321
|
+
|--------|---------|--------|
|
|
322
|
+
| `CREATE` | File does not exist | Generate full new file |
|
|
323
|
+
| `EXTEND` | File exists, new methods needed | Add new methods only — do NOT rewrite existing code |
|
|
324
|
+
| `SKIP` | File exists and already covers all UC scenarios | Leave untouched |
|
|
325
|
+
|
|
326
|
+
> **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.
|
|
327
|
+
|
|
255
328
|
---
|
|
256
329
|
|
|
257
330
|
## CHECKPOINT — Code Generation Plan
|
|
258
331
|
|
|
259
332
|
Before generating any code, show:
|
|
333
|
+
|
|
260
334
|
```
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
335
|
+
Code Generation Plan — {UC-ID}
|
|
336
|
+
──────────────────────────────────────────────────────
|
|
337
|
+
Feature : {name}
|
|
338
|
+
Ticket : {TICKET_ID if known}
|
|
339
|
+
Domain : {domain}
|
|
340
|
+
UC : {UC-ID} only ← other feature files in this folder are NOT read
|
|
341
|
+
Tech : {language} / {framework}
|
|
342
|
+
Scenarios: {N} total ({X} new, {Y} drifted, {Z} synced-skip)
|
|
343
|
+
Layer : {from CLAUDE.md §2}
|
|
344
|
+
|
|
345
|
+
Files:
|
|
346
|
+
CREATE {N} new files
|
|
347
|
+
+ {path/FileName.ext}
|
|
348
|
+
EXTEND {M} existing files (add methods only)
|
|
349
|
+
~ {path/FileName.ext} — adding: {methodA}, {methodB}
|
|
350
|
+
SKIP {K} files (no change needed)
|
|
351
|
+
= {path/FileName.ext}
|
|
352
|
+
──────────────────────────────────────────────────────
|
|
268
353
|
Proceed? (Y/N)
|
|
269
354
|
```
|
|
270
355
|
|
|
271
356
|
Wait for explicit "Y" before generating.
|
|
272
357
|
|
|
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
358
|
## Branch
|
|
277
359
|
```bash
|
|
278
360
|
git checkout -b feature/{TICKET_ID}-{slug}
|
|
@@ -283,13 +365,17 @@ git checkout -b feature/{TICKET_ID}-{slug}
|
|
|
283
365
|
Default order (override from CLAUDE.md if different):
|
|
284
366
|
DTOs → Entity/Model → Repository → Service interface → Service impl → Facade (if applicable) → Controller
|
|
285
367
|
|
|
286
|
-
**
|
|
368
|
+
**For `CREATE` files:** generate the full file.
|
|
369
|
+
|
|
370
|
+
**For `EXTEND` files:** open the existing file → add only the new methods for `{UC-ID}` → do not touch anything else.
|
|
371
|
+
|
|
372
|
+
**Traceability tags on controller/handler (adapt to your language's comment syntax):**
|
|
287
373
|
```
|
|
288
374
|
@trace.implements={UC-ID}-SC{N}
|
|
289
375
|
@trace.prd_version={read @trace.prd_version from the .feature file header}
|
|
290
376
|
@trace.bdd_version={read @trace.bdd_version from the .feature file header}
|
|
291
377
|
@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
|
|
378
|
+
@trace.source={paths.specs_dir}/{domain}/{UC-ID}-{slug}.feature
|
|
293
379
|
```
|
|
294
380
|
|
|
295
381
|
`@trace.prd_version` records which PRD version this code was written against.
|
|
@@ -297,6 +383,8 @@ DTOs → Entity/Model → Repository → Service interface → Service impl →
|
|
|
297
383
|
`@trace.tech_doc_revision` records which tech-design revision this code follows.
|
|
298
384
|
`/validate-traces` will flag drift if any upstream artifact is updated to a newer version.
|
|
299
385
|
|
|
386
|
+
> **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.
|
|
387
|
+
|
|
300
388
|
## Self-Review (3 rounds)
|
|
301
389
|
- [ ] Every scenario has a corresponding endpoint
|
|
302
390
|
- [ ] @trace.implements on every endpoint
|
|
@@ -360,6 +448,7 @@ Suggest the logical next command based on workflow phase:
|
|
|
360
448
|
|
|
361
449
|
| Current command | Suggest next |
|
|
362
450
|
|-------------------------|-----------------------------------------------|
|
|
451
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
363
452
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
364
453
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
365
454
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
@@ -368,13 +457,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
368
457
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
369
458
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
370
459
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
371
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
460
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
372
461
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
373
462
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
374
463
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
375
464
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
376
465
|
| /smoke-test | Create PR and link to ticket |
|
|
377
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
466
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
378
467
|
| /fix-bug | Create PR and link to ticket |
|
|
379
468
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
380
469
|
|
|
@@ -389,7 +478,9 @@ Next : {suggested command with example arguments}
|
|
|
389
478
|
|
|
390
479
|
```
|
|
391
480
|
/generate-code Complete — {UC-ID}
|
|
392
|
-
Files: created={N},
|
|
481
|
+
Files: created={N}, extended={M}, skipped={K} | Build: SUCCESS
|
|
393
482
|
Branch: feature/{TICKET_ID}-{slug}
|
|
394
|
-
Next:
|
|
483
|
+
Next:
|
|
484
|
+
First generation for this UC → /review-code {UC-ID} ← code review required before tests
|
|
485
|
+
Re-generation (already reviewed) → /generate-tests {UC-ID}
|
|
395
486
|
```
|
|
@@ -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
|
|
|
@@ -140,7 +140,7 @@ If `paths` section is absent, use these defaults:
|
|
|
140
140
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
141
141
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
142
142
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
143
|
-
- `tech_docs_dir` = `tech-docs`
|
|
143
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
144
144
|
- `trace_dir` = `.trace`
|
|
145
145
|
|
|
146
146
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
@@ -217,6 +217,26 @@ If the file does not exist → skip silently.
|
|
|
217
217
|
|
|
218
218
|
---
|
|
219
219
|
|
|
220
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
221
|
+
|
|
222
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
| `platform_type` | Modules |
|
|
229
|
+
|---|---|
|
|
230
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
231
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
232
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
233
|
+
|
|
234
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
235
|
+
|
|
236
|
+
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).
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
220
240
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
221
241
|
|
|
222
242
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -227,6 +247,7 @@ Output exactly this block:
|
|
|
227
247
|
```
|
|
228
248
|
[CTX LOADED]
|
|
229
249
|
Stack : {language} / {framework} / {database}
|
|
250
|
+
Platform : {active_module} ({platform_type})
|
|
230
251
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
231
252
|
Ticket : {ticket_prefix}-
|
|
232
253
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
@@ -455,6 +476,7 @@ Suggest the logical next command based on workflow phase:
|
|
|
455
476
|
|
|
456
477
|
| Current command | Suggest next |
|
|
457
478
|
|-------------------------|-----------------------------------------------|
|
|
479
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
458
480
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
459
481
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
460
482
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
@@ -463,13 +485,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
463
485
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
464
486
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
465
487
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
466
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
488
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
467
489
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
468
490
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
469
491
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
470
492
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
471
493
|
| /smoke-test | Create PR and link to ticket |
|
|
472
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
494
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
473
495
|
| /fix-bug | Create PR and link to ticket |
|
|
474
496
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
475
497
|
|
|
@@ -483,6 +505,11 @@ Next : {suggested command with example arguments}
|
|
|
483
505
|
|
|
484
506
|
|
|
485
507
|
```
|
|
486
|
-
|
|
487
|
-
|
|
508
|
+
/generate-prd Complete — {TICKET-ID}
|
|
509
|
+
---
|
|
510
|
+
Status : ✅ Complete
|
|
511
|
+
Output Artifacts:
|
|
512
|
+
created {paths.prd_dir}/{domain}/{TICKET-ID}-{slug}.md (PRD v1.0)
|
|
513
|
+
Next : /refine-prd {paths.prd_dir}/{domain}/{TICKET-ID}-{slug}.md
|
|
514
|
+
→ then /review-context {prd-file} ← verify PRD quality before generating BDD
|
|
488
515
|
```
|
|
@@ -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
|
|
|
@@ -84,7 +84,28 @@ Wait for explicit "Y" or "N" from the user before continuing.
|
|
|
84
84
|
- "N" → stop and ask what the user wants to change.
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
*Note: For this command, the target in Step 1 is a `.feature` file or UC-ID under `{paths.specs_dir}
|
|
87
|
+
*Note: For this command, the target in Step 1 is a `.feature` file or UC-ID under `{paths.specs_dir}/`.*
|
|
88
|
+
|
|
89
|
+
**Quality Gate**: Before generating, check the BDD findings file:
|
|
90
|
+
|
|
91
|
+
1. Look for `{paths.refinement_dir}/{uc-id}-review-bdd-findings.yaml`.
|
|
92
|
+
2. **If file does not exist** → warn and ask:
|
|
93
|
+
```
|
|
94
|
+
⚠️ /review-context has not been run for this feature file.
|
|
95
|
+
Recommended: run /review-context {feature-file} first to verify BDD quality.
|
|
96
|
+
Continue without review? (Y/N)
|
|
97
|
+
```
|
|
98
|
+
- Y → proceed (accept risk)
|
|
99
|
+
- N → stop; run `/review-context {feature-file}` first
|
|
100
|
+
3. **If file exists** → check for unresolved `status: "pending"` critical findings.
|
|
101
|
+
If any found → **HALT** and print:
|
|
102
|
+
```
|
|
103
|
+
❌ Quality Gate Failed — {feature-file}
|
|
104
|
+
Unresolved critical BDD findings detected.
|
|
105
|
+
Run: /review-context --fix {feature-file} ← auto-fix what's possible
|
|
106
|
+
Then: /review-context --resume {feature-file} ← apply remaining accepted findings
|
|
107
|
+
Then re-run: /generate-tech-docs {feature-file}
|
|
108
|
+
```
|
|
88
109
|
|
|
89
110
|
## Context
|
|
90
111
|
# Context Loader — Load All Project Context
|
|
@@ -140,7 +161,7 @@ If `paths` section is absent, use these defaults:
|
|
|
140
161
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
141
162
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
142
163
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
143
|
-
- `tech_docs_dir` = `tech-docs`
|
|
164
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
144
165
|
- `trace_dir` = `.trace`
|
|
145
166
|
|
|
146
167
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
@@ -217,6 +238,26 @@ If the file does not exist → skip silently.
|
|
|
217
238
|
|
|
218
239
|
---
|
|
219
240
|
|
|
241
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
242
|
+
|
|
243
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
| `platform_type` | Modules |
|
|
250
|
+
|---|---|
|
|
251
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
252
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
253
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
254
|
+
|
|
255
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
256
|
+
|
|
257
|
+
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).
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
220
261
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
221
262
|
|
|
222
263
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -227,6 +268,7 @@ Output exactly this block:
|
|
|
227
268
|
```
|
|
228
269
|
[CTX LOADED]
|
|
229
270
|
Stack : {language} / {framework} / {database}
|
|
271
|
+
Platform : {active_module} ({platform_type})
|
|
230
272
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
231
273
|
Ticket : {ticket_prefix}-
|
|
232
274
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
@@ -252,6 +294,38 @@ After completing all steps, you have loaded:
|
|
|
252
294
|
Proceed to the next step of the calling command.
|
|
253
295
|
|
|
254
296
|
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## CHECKPOINT — Tech Design Plan
|
|
300
|
+
|
|
301
|
+
Before generating, scan the feature file for scenario count, referenced BRs, and entities. Display and wait for Y:
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
Tech Design Plan — {UC-ID}
|
|
305
|
+
──────────────────────────────────────────────────────
|
|
306
|
+
UC : {UC-ID} — {feature title}
|
|
307
|
+
Service : {trace.service}
|
|
308
|
+
Module : {trace.module}
|
|
309
|
+
Scenarios: {N} scenarios
|
|
310
|
+
BDD ver : {trace.bdd_version}
|
|
311
|
+
Output : {paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md
|
|
312
|
+
|
|
313
|
+
Sections to generate:
|
|
314
|
+
§1 Overview
|
|
315
|
+
§2 API Endpoints ({N} endpoints inferred from scenarios)
|
|
316
|
+
§3 Data Model ({entities from core-entities.md relevant to this UC})
|
|
317
|
+
§4 Service Flow
|
|
318
|
+
§5 Business Rules ({N} BRs from feature header)
|
|
319
|
+
§6 Error Handling
|
|
320
|
+
§7 Database Changes
|
|
321
|
+
§8 Caching Strategy
|
|
322
|
+
§9 Cross-Service Dependencies
|
|
323
|
+
──────────────────────────────────────────────────────
|
|
324
|
+
Proceed? (Y/N)
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Wait for explicit "Y" before generating.
|
|
328
|
+
|
|
255
329
|
---
|
|
256
330
|
|
|
257
331
|
## Generate
|
|
@@ -264,6 +338,8 @@ Write `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`:
|
|
|
264
338
|
---
|
|
265
339
|
@trace.id: {UC-ID}
|
|
266
340
|
@trace.domain: {domain}
|
|
341
|
+
@trace.service: {read @trace.service from the .feature file header}
|
|
342
|
+
@trace.module: {read @trace.module from the .feature file header}
|
|
267
343
|
@trace.prd: {TICKET-ID}
|
|
268
344
|
@trace.bdd_version: {read @trace.bdd_version from the .feature file header}
|
|
269
345
|
@trace.revision: 1
|
|
@@ -296,8 +372,6 @@ Write `{paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md`:
|
|
|
296
372
|
| 1 | {YYYY-MM-DD} | Initial generation from {UC-ID}.feature (BDD v{bdd_version}) |
|
|
297
373
|
```
|
|
298
374
|
|
|
299
|
-
SA/Lead should review and approve before running `/generate-code`.
|
|
300
|
-
|
|
301
375
|
## Output
|
|
302
376
|
|
|
303
377
|
# Report Footer — Standard Command Output Format
|
|
@@ -328,6 +402,7 @@ Suggest the logical next command based on workflow phase:
|
|
|
328
402
|
|
|
329
403
|
| Current command | Suggest next |
|
|
330
404
|
|-------------------------|-----------------------------------------------|
|
|
405
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
331
406
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
332
407
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
333
408
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
@@ -336,13 +411,13 @@ Suggest the logical next command based on workflow phase:
|
|
|
336
411
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
337
412
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
338
413
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
339
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
414
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
340
415
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
341
416
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
342
417
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
343
418
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
344
419
|
| /smoke-test | Create PR and link to ticket |
|
|
345
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
420
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
346
421
|
| /fix-bug | Create PR and link to ticket |
|
|
347
422
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
348
423
|
|
|
@@ -358,5 +433,7 @@ Next : {suggested command with example arguments}
|
|
|
358
433
|
```
|
|
359
434
|
/generate-tech-docs Complete — {UC-ID}
|
|
360
435
|
File: {paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md
|
|
361
|
-
Next: /
|
|
436
|
+
Next: /review-tech-docs {paths.tech_docs_dir}/{domain}/{UC-ID}-tech-design.md
|
|
437
|
+
← SA/Lead review required before code generation
|
|
438
|
+
→ after approved: /generate-code {paths.specs_dir}/{domain}/{UC-ID}-{slug}.feature
|
|
362
439
|
```
|