@anhth2/spec-driven-dev-plugin 0.5.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.
Files changed (152) hide show
  1. package/ARCHITECTURE.md +243 -0
  2. package/bin/build.js +230 -0
  3. package/bin/index.js +311 -0
  4. package/commands/debug.md +374 -0
  5. package/commands/debug.tmpl +77 -0
  6. package/commands/define-product.md +451 -0
  7. package/commands/define-product.tmpl +154 -0
  8. package/commands/fix-bug.md +379 -0
  9. package/commands/fix-bug.tmpl +82 -0
  10. package/commands/generate-bdd.md +591 -0
  11. package/commands/generate-bdd.tmpl +294 -0
  12. package/commands/generate-code.md +395 -0
  13. package/commands/generate-code.tmpl +98 -0
  14. package/commands/generate-prd.md +488 -0
  15. package/commands/generate-prd.tmpl +191 -0
  16. package/commands/generate-tech-docs.md +362 -0
  17. package/commands/generate-tech-docs.tmpl +65 -0
  18. package/commands/generate-tests.md +377 -0
  19. package/commands/generate-tests.tmpl +80 -0
  20. package/commands/refine-prd.md +408 -0
  21. package/commands/refine-prd.tmpl +111 -0
  22. package/commands/review-code.md +354 -0
  23. package/commands/review-code.tmpl +57 -0
  24. package/commands/review-context.md +646 -0
  25. package/commands/review-context.tmpl +349 -0
  26. package/commands/review-tech-docs.md +518 -0
  27. package/commands/review-tech-docs.tmpl +221 -0
  28. package/commands/run-tests.md +343 -0
  29. package/commands/run-tests.tmpl +46 -0
  30. package/commands/setup-ai-first.md +278 -0
  31. package/commands/setup-ai-first.tmpl +197 -0
  32. package/commands/smoke-test.md +366 -0
  33. package/commands/smoke-test.tmpl +69 -0
  34. package/commands/validate-traces.md +529 -0
  35. package/commands/validate-traces.tmpl +232 -0
  36. package/core/FRAMEWORK_VERSION +1 -0
  37. package/core/commands/debug.md +374 -0
  38. package/core/commands/define-product.md +451 -0
  39. package/core/commands/fix-bug.md +379 -0
  40. package/core/commands/generate-bdd.md +591 -0
  41. package/core/commands/generate-code.md +395 -0
  42. package/core/commands/generate-prd.md +488 -0
  43. package/core/commands/generate-tech-docs.md +362 -0
  44. package/core/commands/generate-tests.md +377 -0
  45. package/core/commands/refine-prd.md +408 -0
  46. package/core/commands/review-code.md +354 -0
  47. package/core/commands/review-context.md +646 -0
  48. package/core/commands/review-tech-docs.md +518 -0
  49. package/core/commands/run-tests.md +343 -0
  50. package/core/commands/setup-ai-first.md +278 -0
  51. package/core/commands/smoke-test.md +366 -0
  52. package/core/commands/validate-traces.md +529 -0
  53. package/core/hooks/data-guard.js +141 -0
  54. package/core/hooks/settings.json +18 -0
  55. package/core/modules/angular/architecture-snippets/component-patterns.md +187 -0
  56. package/core/modules/angular/module.yaml +6 -0
  57. package/core/modules/angular/stack-profile.yaml +38 -0
  58. package/core/modules/context-engineering/architecture-snippets/context-design.md +119 -0
  59. package/core/modules/context-engineering/module.yaml +9 -0
  60. package/core/modules/context-engineering/stack-profile.yaml +61 -0
  61. package/core/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
  62. package/core/modules/dotnet/module.yaml +6 -0
  63. package/core/modules/dotnet/stack-profile.yaml +50 -0
  64. package/core/modules/golang/architecture-snippets/domain-layout.md +283 -0
  65. package/core/modules/golang/module.yaml +6 -0
  66. package/core/modules/golang/stack-profile.yaml +40 -0
  67. package/core/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
  68. package/core/modules/java-spring/module.yaml +15 -0
  69. package/core/modules/java-spring/stack-profile.yaml +28 -0
  70. package/core/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
  71. package/core/modules/nextjs/module.yaml +14 -0
  72. package/core/modules/nextjs/stack-profile.yaml +74 -0
  73. package/core/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
  74. package/core/modules/php-laravel/module.yaml +15 -0
  75. package/core/modules/php-laravel/stack-profile.yaml +56 -0
  76. package/core/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
  77. package/core/modules/react/module.yaml +14 -0
  78. package/core/modules/react/stack-profile.yaml +63 -0
  79. package/core/rules/data-protection.md +80 -0
  80. package/core/rules/workflow.md +44 -0
  81. package/core/skills/code/SKILL.md +526 -0
  82. package/core/skills/debug/SKILL.md +584 -0
  83. package/core/skills/discovery/SKILL.md +363 -0
  84. package/core/skills/prd/SKILL.md +456 -0
  85. package/core/skills/setup-ai-first/SKILL.md +160 -0
  86. package/core/skills/spec/SKILL.md +361 -0
  87. package/core/skills/test/SKILL.md +862 -0
  88. package/core/steps/context-loader.md +163 -0
  89. package/core/steps/gate.md +81 -0
  90. package/core/steps/report-footer.md +53 -0
  91. package/core/steps/spawn-agent.md +123 -0
  92. package/core/templates/architecture.template.md +113 -0
  93. package/core/templates/feature.template +259 -0
  94. package/core/templates/platform-guide.template.md +145 -0
  95. package/core/templates/prd.template.md +312 -0
  96. package/core/templates/product-definition.template.md +168 -0
  97. package/core/templates/project-context.yaml +78 -0
  98. package/hooks/data-guard.js +141 -0
  99. package/hooks/settings.json +18 -0
  100. package/modules/angular/architecture-snippets/component-patterns.md +187 -0
  101. package/modules/angular/module.yaml +6 -0
  102. package/modules/angular/stack-profile.yaml +38 -0
  103. package/modules/context-engineering/architecture-snippets/context-design.md +119 -0
  104. package/modules/context-engineering/module.yaml +9 -0
  105. package/modules/context-engineering/stack-profile.yaml +61 -0
  106. package/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
  107. package/modules/dotnet/module.yaml +6 -0
  108. package/modules/dotnet/stack-profile.yaml +50 -0
  109. package/modules/golang/architecture-snippets/domain-layout.md +283 -0
  110. package/modules/golang/module.yaml +6 -0
  111. package/modules/golang/stack-profile.yaml +40 -0
  112. package/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
  113. package/modules/java-spring/module.yaml +15 -0
  114. package/modules/java-spring/stack-profile.yaml +28 -0
  115. package/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
  116. package/modules/nextjs/module.yaml +14 -0
  117. package/modules/nextjs/stack-profile.yaml +74 -0
  118. package/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
  119. package/modules/php-laravel/module.yaml +15 -0
  120. package/modules/php-laravel/stack-profile.yaml +56 -0
  121. package/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
  122. package/modules/react/module.yaml +14 -0
  123. package/modules/react/stack-profile.yaml +63 -0
  124. package/package.json +42 -0
  125. package/rules/data-protection.md +80 -0
  126. package/rules/workflow.md +44 -0
  127. package/scripts/init.sh +49 -0
  128. package/scripts/upgrade.sh +94 -0
  129. package/skills/code/SKILL.md +526 -0
  130. package/skills/code/SKILL.tmpl +176 -0
  131. package/skills/debug/SKILL.md +584 -0
  132. package/skills/debug/SKILL.tmpl +262 -0
  133. package/skills/discovery/SKILL.md +363 -0
  134. package/skills/discovery/SKILL.tmpl +147 -0
  135. package/skills/prd/SKILL.md +456 -0
  136. package/skills/prd/SKILL.tmpl +188 -0
  137. package/skills/setup-ai-first/SKILL.md +160 -0
  138. package/skills/setup-ai-first/SKILL.tmpl +107 -0
  139. package/skills/spec/SKILL.md +361 -0
  140. package/skills/spec/SKILL.tmpl +174 -0
  141. package/skills/test/SKILL.md +862 -0
  142. package/skills/test/SKILL.tmpl +296 -0
  143. package/steps/context-loader.md +163 -0
  144. package/steps/gate.md +81 -0
  145. package/steps/report-footer.md +53 -0
  146. package/steps/spawn-agent.md +123 -0
  147. package/templates/architecture.template.md +113 -0
  148. package/templates/feature.template +259 -0
  149. package/templates/platform-guide.template.md +145 -0
  150. package/templates/prd.template.md +312 -0
  151. package/templates/product-definition.template.md +168 -0
  152. package/templates/project-context.yaml +78 -0
@@ -0,0 +1,395 @@
1
+ # /generate-code — Generate Implementation Code
2
+
3
+ ## Gate
4
+ # Gate — Universal Entry Procedure
5
+
6
+ Every command must execute this gate before proceeding with its specific logic.
7
+
8
+ ## Step 0 — Sub-Agent Mode Check
9
+
10
+ Before anything else, check if `$ARGUMENTS` is a JSON payload from an orchestrator:
11
+
12
+ 1. Attempt to parse `$ARGUMENTS` as JSON.
13
+ 2. If it parses successfully **and** contains `"_agent_mode": true`:
14
+ - **Skip Steps 1, 2, and 3 of this Gate entirely.**
15
+ - Set target file = `payload.target_file`
16
+ - Set loaded context = `payload.context` (do NOT run context-loader.md)
17
+ - Set UC scope = `payload.uc_id` (process only this UC)
18
+ - Set line range = `payload.uc_section` (read only that PRD section)
19
+ - Proceed directly to the command-specific logic.
20
+ 3. If `$ARGUMENTS` is not JSON or `_agent_mode` is absent → continue to Step 1 (normal mode).
21
+
22
+ ## Step 0-B — Model Check
23
+
24
+ *Skip this step if `_agent_mode: true` (sub-agent — orchestrator already validated).*
25
+
26
+ Complex generation and review commands require strong reasoning.
27
+ Using a smaller model risks missed edge cases, incomplete spec analysis, and architecture violations.
28
+
29
+ Display and wait for response:
30
+
31
+ ```
32
+ ⚙️ MODEL CHECK
33
+ ──────────────────────────────────────────────────────────────────
34
+ Recommended : claude-opus-4-5 (or claude-opus-4)
35
+ Why needed : Spec analysis, architecture review, code generation
36
+ require deep reasoning. Smaller models miss edge cases.
37
+
38
+ To switch in Claude Code:
39
+ • Settings → Model → select "claude-opus"
40
+ • or: /model → choose claude-opus
41
+
42
+ Running on claude-opus?
43
+ Y — yes, on claude-opus → proceed
44
+ S — skip check (I accept lower quality risk with current model)
45
+ ──────────────────────────────────────────────────────────────────
46
+ ```
47
+
48
+ - "Y" → proceed to Step 1.
49
+ - "S" → proceed to Step 1 (user accepts risk, add ⚠️ to final report).
50
+ - "N" or anything else → **STOP.** Output: "Please switch to claude-opus, then re-run this command."
51
+
52
+ ## Step 1 — Resolve Target File
53
+
54
+ 1. If `$ARGUMENTS` is provided and points to an existing file → use it directly as the target.
55
+ 2. If `$ARGUMENTS` is a UC-ID, ticket ID, or partial name → search for matching files in the relevant directory.
56
+ 3. If `$ARGUMENTS` is empty or no match found:
57
+ - List files in the relevant directory for this command (e.g., `specs/prd/**/*.md` for PRD commands, `specs/bdd/**/*.feature` for BDD commands).
58
+ - Present the list to the user and ask: "Which file do you want to work with? (Enter number or filename)"
59
+ - Wait for user selection before continuing.
60
+
61
+ ## Step 2 — Execute Context Loader
62
+
63
+ Load all project context by following the procedure in `steps/context-loader.md`.
64
+ Store all loaded context in memory for use throughout this command session.
65
+
66
+ ## Step 3 — CHECKPOINT
67
+
68
+ After completing Steps 1 and 2, display a summary and wait for confirmation:
69
+
70
+ ```
71
+ CHECKPOINT
72
+ -----------
73
+ Target : {resolved file path}
74
+ Project : {project.name from project-context.yaml}
75
+ Tech stack : {language} / {framework}
76
+ Module : {module if set, else "not configured"}
77
+ Domains : {comma-separated domain list}
78
+
79
+ Proceed? (Y/N)
80
+ ```
81
+
82
+ Wait for explicit "Y" or "N" from the user before continuing.
83
+ - "Y" → proceed to the command-specific steps below.
84
+ - "N" → stop and ask what the user wants to change.
85
+
86
+
87
+ *Note: For this command, the target in Step 1 is a `.feature` file or UC-ID. If `$ARGUMENTS` is a UC-ID, find the matching feature file under `{paths.specs_dir}/`. Also check `{paths.trace_dir}/{UC-ID}.tsv` for drift (new vs drifted vs synced).*
88
+
89
+ ## Context
90
+ # Context Loader — Load All Project Context
91
+
92
+ Execute these steps in order. Store everything in memory for the duration of the command session.
93
+
94
+ **Priority guide (anti-lost-in-middle):**
95
+ - Steps 1–2 are PROJECT-CONFIG — loaded first, resolve all paths and metadata.
96
+ - Step 3 is CRITICAL — architecture + coding standards, the highest-priority facts for generation.
97
+ - Step 4 is SAFETY — data protection rules, enforced silently for the entire session.
98
+ - Steps 5–6 are DOMAIN KNOWLEDGE — terminology and entity definitions.
99
+ - Step 7 is the WORKING MEMORY RECAP — locks critical facts into the top of working memory.
100
+
101
+ ---
102
+
103
+ ## Step 1 — [PROJECT-CONFIG] Load project-context.yaml
104
+
105
+ Read `.agent/project-context.yaml`. Extract and store:
106
+
107
+ **Tech Stack:**
108
+ - `tech_stack.language` → active language (e.g., Java 17, TypeScript, C#, Go)
109
+ - `tech_stack.framework` → active framework (e.g., Spring Boot 3.2, Angular 17, .NET 8)
110
+ - `tech_stack.build_tool` → build tool (e.g., Maven, npm, dotnet, go)
111
+ - `tech_stack.test_framework` → test framework (e.g., JUnit 5 + Mockito, Jest, xUnit)
112
+ - `tech_stack.database` → database (e.g., PostgreSQL, MySQL, MongoDB)
113
+ - `tech_stack.module` → active module profile (e.g., java-spring, angular, dotnet, golang, context-engineering)
114
+
115
+ **Conventions:**
116
+ - `conventions.build_command` → how to compile/build
117
+ - `conventions.test_command` → how to run tests
118
+ - `conventions.service_run` → how to start the service
119
+ - `conventions.ticket_prefix` → ticket ID prefix (e.g., PROJ, FEAT, UC)
120
+
121
+ **Domains:**
122
+ - `domains` → list of active business domains
123
+
124
+ **Paths (if present):**
125
+ - `paths.specs_dir` → BDD specs root
126
+ - `paths.prd_dir` → PRD documents root
127
+ - `paths.refinement_dir` → findings/review output dir
128
+ - `paths.product_definitions_dir` → product definitions root
129
+ - `paths.domain_knowledge_dir` → domain knowledge root
130
+ - `paths.business_dictionary` → path to business-dictionary.md
131
+ - `paths.core_entities` → path to core-entities.md
132
+ - `paths.tech_docs_dir` → technical documentation root
133
+ - `paths.trace_dir` → trace state directory
134
+
135
+ If `paths` section is absent, use these defaults:
136
+ - `specs_dir` = `specs/bdd`
137
+ - `prd_dir` = `specs/prd`
138
+ - `refinement_dir` = `.agent/review`
139
+ - `product_definitions_dir` = `specs/product-definition`
140
+ - `domain_knowledge_dir` = `specs/domain-knowledge`
141
+ - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
142
+ - `core_entities` = `specs/domain-knowledge/core-entities.md`
143
+ - `tech_docs_dir` = `tech-docs`
144
+ - `trace_dir` = `.trace`
145
+
146
+ If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
147
+
148
+ ---
149
+
150
+ ## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
151
+
152
+ If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
153
+ Merge framework-specific conventions (layer patterns, test patterns, naming rules) into the loaded context.
154
+ If the file does not exist → skip silently.
155
+
156
+ ---
157
+
158
+ ## Step 3 — [CRITICAL] Load CLAUDE.md
159
+
160
+ *This is the highest-priority context — it defines HOW to write code and documents for this project.*
161
+
162
+ Read `CLAUDE.md`. Extract and store:
163
+
164
+ - **§1 Project Overview** → project name, language, framework, build/test commands, domains
165
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
166
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
167
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
168
+ - **§7 Git Conventions** → branch naming pattern, commit message format
169
+
170
+ If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
171
+
172
+ ---
173
+
174
+ ## Step 4 — [SAFETY] Load Data Protection Rules
175
+
176
+ Read `.agent/rules/data-protection.md` (or `rules/data-protection.md` from the framework installation).
177
+
178
+ Store the sensitive file patterns — you must **never** read, write, display, or reference content from files matching those patterns for the entire session.
179
+
180
+ If neither file exists → apply built-in defaults: never access `.env*`, `*.key`, `*.pem`, `*secret*`, `*password*`, `*credential*`.
181
+
182
+ ---
183
+
184
+ ## Step 5 — [DOMAIN] Load Business Dictionary (conditional)
185
+
186
+ Check if the business dictionary file exists (use `paths.business_dictionary` resolved in Step 1).
187
+
188
+ If it exists, read it and extract:
189
+ - **Canonical Terms** → complete list of approved terms and their definitions
190
+ - **Banned Terms** → complete list of banned terms and their canonical replacements
191
+ - **Status / Enum Registry** → allowed enum values per entity
192
+
193
+ Store the banned terms list for **active enforcement** throughout the command session:
194
+ - When generating any text (PRD, BDD, code comments, tech docs), verify no banned terms appear
195
+ - Replace banned terms with their canonical equivalents automatically
196
+
197
+ If the file does not exist → skip silently. Do not warn or block.
198
+
199
+ ---
200
+
201
+ ## Step 6 — [DOMAIN] Load Core Entities (conditional)
202
+
203
+ Check if the core entities file exists at `paths.core_entities` (resolved in Step 1).
204
+ Default path: `specs/domain-knowledge/core-entities.md`.
205
+
206
+ If it exists, read it and store:
207
+ - **Entity catalog** → for each entity: its name, purpose, owner service, key fields (name + type), business invariants, and relationships
208
+ - **Field name registry** → canonical field names to use in generated code and documents
209
+ - **Relationship map** → how entities relate to each other (1:N, N:N, embedded, etc.)
210
+
211
+ **How to use this catalog:**
212
+ - When generating code: use the field names, types, and relationships defined here — do NOT infer from existing code
213
+ - When generating PRD/BDD: reference entity names from this catalog for consistency
214
+ - When generating tech-docs: use this catalog as the source-of-truth for entity definitions
215
+
216
+ If the file does not exist → skip silently.
217
+
218
+ ---
219
+
220
+ ## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
221
+
222
+ After loading all context, synthesize and output a compact summary block.
223
+ This recap ensures the most critical facts are stated at the END of context loading
224
+ (recency effect — freshest in working memory when the task begins).
225
+
226
+ Output exactly this block:
227
+ ```
228
+ [CTX LOADED]
229
+ Stack : {language} / {framework} / {database}
230
+ Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
231
+ Ticket : {ticket_prefix}-
232
+ Dict : {loaded — N canonical terms, M banned terms | missing}
233
+ Entities : {loaded — EntityA, EntityB, EntityC | missing}
234
+ Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
235
+ ```
236
+
237
+ If any CRITICAL file is missing (CLAUDE.md), flag it clearly so the user can decide whether to proceed.
238
+
239
+ ---
240
+
241
+ ## Context Load Complete
242
+
243
+ After completing all steps, you have loaded:
244
+ - Project identity, tech stack, module conventions
245
+ - Architecture rules and layer order ← **[CRITICAL — hold in working memory]**
246
+ - Coding standards and naming conventions ← **[CRITICAL — hold in working memory]**
247
+ - Data protection rules (sensitive file patterns to never access)
248
+ - Terminology rules with banned-term list ← **[DOMAIN — apply to every generated word]**
249
+ - Entity catalog (field names, types, invariants) ← **[DOMAIN — use for code generation]**
250
+ - All configured paths
251
+
252
+ Proceed to the next step of the calling command.
253
+
254
+
255
+ ---
256
+
257
+ ## CHECKPOINT — Code Generation Plan
258
+
259
+ Before generating any code, show:
260
+ ```
261
+ I understand:
262
+ - Feature: {name} | Ticket: {ID if known}
263
+ - UC: {UC-ID} | Domain: {domain}
264
+ - Scenarios: {N} total ({X} new, {Y} drifted, {Z} synced-skip)
265
+ - Layer order: {from CLAUDE.md §2 architecture}
266
+ - Tech stack: {language} / {framework}
267
+ - Files to create: [list]
268
+ Proceed? (Y/N)
269
+ ```
270
+
271
+ Wait for explicit "Y" before generating.
272
+
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
+ ## Branch
277
+ ```bash
278
+ git checkout -b feature/{TICKET_ID}-{slug}
279
+ ```
280
+
281
+ ## Generate (layer order from CLAUDE.md §2)
282
+
283
+ Default order (override from CLAUDE.md if different):
284
+ DTOs → Entity/Model → Repository → Service interface → Service impl → Facade (if applicable) → Controller
285
+
286
+ **Controller must have traceability tags (adapt to your language's comment syntax):**
287
+ ```
288
+ @trace.implements={UC-ID}-SC{N}
289
+ @trace.prd_version={read @trace.prd_version from the .feature file header}
290
+ @trace.bdd_version={read @trace.bdd_version from the .feature file header}
291
+ @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
293
+ ```
294
+
295
+ `@trace.prd_version` records which PRD version this code was written against.
296
+ `@trace.bdd_version` records which BDD version this code was generated from.
297
+ `@trace.tech_doc_revision` records which tech-design revision this code follows.
298
+ `/validate-traces` will flag drift if any upstream artifact is updated to a newer version.
299
+
300
+ ## Self-Review (3 rounds)
301
+ - [ ] Every scenario has a corresponding endpoint
302
+ - [ ] @trace.implements on every endpoint
303
+ - [ ] Architecture layer rules respected (CLAUDE.md §2)
304
+ - [ ] Error handling matches CLAUDE.md §5
305
+ - [ ] No magic numbers, no debug logging
306
+
307
+ ## Build Verify
308
+ ```bash
309
+ {conventions.build_command} # from project-context.yaml, max 3 retries
310
+ ```
311
+
312
+ ## Write Trace State
313
+
314
+ Update `{paths.trace_dir}/{UC-ID}.tsv` — for each implemented scenario, find the existing row by `sc_id` and update only these columns:
315
+
316
+ | Column | Value |
317
+ |--------|-------|
318
+ | `gen_ver` | copy `spec_ver` from the current `.tsv` row (= scenario version at time of codegen) |
319
+ | `implemented_by` | `{ControllerClass}.{methodName}` |
320
+ | `bdd_version` | `@trace.bdd_version` from `.feature` header |
321
+ | `tech_doc_revision` | `@trace.revision` from tech-doc header, or `—` if no tech-doc |
322
+ | `last_updated` | today `YYYY-MM-DD` |
323
+
324
+ Leave all other columns (`sc_title`, `spec_ver`, `prd_version`, `prd_status`, `uc_status`, `test_count`, `test_classes`) unchanged.
325
+ `status` is computed by `/validate-traces` — do not set here.
326
+
327
+ ## Commit
328
+ ```bash
329
+ git add {files}
330
+ git commit -m "{commit_format}: {description}"
331
+ ```
332
+
333
+ ## Output
334
+
335
+ # Report Footer — Standard Command Output Format
336
+
337
+ Every command report must end with this standard footer section.
338
+
339
+ ## Status Badge
340
+
341
+ Choose one based on outcome:
342
+ - `✅ Complete` — all steps succeeded, no issues found
343
+ - `❌ Failed` — command could not complete due to a blocking error
344
+ - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
345
+
346
+ ## Output Artifacts
347
+
348
+ List every file created or modified by this command:
349
+ ```
350
+ Output Artifacts:
351
+ {created|updated} {file-path} ({brief description})
352
+ {created|updated} {file-path} ({brief description})
353
+ ```
354
+
355
+ If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
356
+
357
+ ## Next Command Suggestion
358
+
359
+ Suggest the logical next command based on workflow phase:
360
+
361
+ | Current command | Suggest next |
362
+ |-------------------------|-----------------------------------------------|
363
+ | /define-product | `/generate-prd {product-definition-file}` |
364
+ | /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
365
+ | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
366
+ | /review-context (PRD) | `/generate-bdd {prd-file}` if APPROVED; fix PRD if NEEDS_FIX |
367
+ | /generate-bdd | `/review-context {feature-file}` to verify coverage |
368
+ | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
369
+ | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
370
+ | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
371
+ | /generate-code | `/generate-tests {UC-ID}` |
372
+ | /generate-tests | `/run-tests {UC-ID}` |
373
+ | /run-tests (passing) | `/review-code {UC-ID}` |
374
+ | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
375
+ | /review-code | `/smoke-test {UC-ID}` or create PR |
376
+ | /smoke-test | Create PR and link to ticket |
377
+ | /validate-traces | `/generate-code {UC-ID}` for gaps |
378
+ | /fix-bug | Create PR and link to ticket |
379
+ | /debug | `/fix-bug {ticket-id}` if fix needed |
380
+
381
+ Format the footer as:
382
+ ```
383
+ ---
384
+ Status : {badge}
385
+ {Output Artifacts block}
386
+ Next : {suggested command with example arguments}
387
+ ```
388
+
389
+
390
+ ```
391
+ /generate-code Complete — {UC-ID}
392
+ Files: created={N}, updated={M} | Build: SUCCESS
393
+ Branch: feature/{TICKET_ID}-{slug}
394
+ Next: /review-code OR /generate-tests {UC-ID}
395
+ ```