@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,366 @@
1
+ # /smoke-test — Test Live API Endpoints
2
+
3
+ Use when service is **already running**. Different from `/run-tests` (no live server needed).
4
+
5
+ ## Gate
6
+ # Gate — Universal Entry Procedure
7
+
8
+ Every command must execute this gate before proceeding with its specific logic.
9
+
10
+ ## Step 0 — Sub-Agent Mode Check
11
+
12
+ Before anything else, check if `$ARGUMENTS` is a JSON payload from an orchestrator:
13
+
14
+ 1. Attempt to parse `$ARGUMENTS` as JSON.
15
+ 2. If it parses successfully **and** contains `"_agent_mode": true`:
16
+ - **Skip Steps 1, 2, and 3 of this Gate entirely.**
17
+ - Set target file = `payload.target_file`
18
+ - Set loaded context = `payload.context` (do NOT run context-loader.md)
19
+ - Set UC scope = `payload.uc_id` (process only this UC)
20
+ - Set line range = `payload.uc_section` (read only that PRD section)
21
+ - Proceed directly to the command-specific logic.
22
+ 3. If `$ARGUMENTS` is not JSON or `_agent_mode` is absent → continue to Step 1 (normal mode).
23
+
24
+ ## Step 0-B — Model Check
25
+
26
+ *Skip this step if `_agent_mode: true` (sub-agent — orchestrator already validated).*
27
+
28
+ Complex generation and review commands require strong reasoning.
29
+ Using a smaller model risks missed edge cases, incomplete spec analysis, and architecture violations.
30
+
31
+ Display and wait for response:
32
+
33
+ ```
34
+ ⚙️ MODEL CHECK
35
+ ──────────────────────────────────────────────────────────────────
36
+ Recommended : claude-opus-4-5 (or claude-opus-4)
37
+ Why needed : Spec analysis, architecture review, code generation
38
+ require deep reasoning. Smaller models miss edge cases.
39
+
40
+ To switch in Claude Code:
41
+ • Settings → Model → select "claude-opus"
42
+ • or: /model → choose claude-opus
43
+
44
+ Running on claude-opus?
45
+ Y — yes, on claude-opus → proceed
46
+ S — skip check (I accept lower quality risk with current model)
47
+ ──────────────────────────────────────────────────────────────────
48
+ ```
49
+
50
+ - "Y" → proceed to Step 1.
51
+ - "S" → proceed to Step 1 (user accepts risk, add ⚠️ to final report).
52
+ - "N" or anything else → **STOP.** Output: "Please switch to claude-opus, then re-run this command."
53
+
54
+ ## Step 1 — Resolve Target File
55
+
56
+ 1. If `$ARGUMENTS` is provided and points to an existing file → use it directly as the target.
57
+ 2. If `$ARGUMENTS` is a UC-ID, ticket ID, or partial name → search for matching files in the relevant directory.
58
+ 3. If `$ARGUMENTS` is empty or no match found:
59
+ - List files in the relevant directory for this command (e.g., `specs/prd/**/*.md` for PRD commands, `specs/bdd/**/*.feature` for BDD commands).
60
+ - Present the list to the user and ask: "Which file do you want to work with? (Enter number or filename)"
61
+ - Wait for user selection before continuing.
62
+
63
+ ## Step 2 — Execute Context Loader
64
+
65
+ Load all project context by following the procedure in `steps/context-loader.md`.
66
+ Store all loaded context in memory for use throughout this command session.
67
+
68
+ ## Step 3 — CHECKPOINT
69
+
70
+ After completing Steps 1 and 2, display a summary and wait for confirmation:
71
+
72
+ ```
73
+ CHECKPOINT
74
+ -----------
75
+ Target : {resolved file path}
76
+ Project : {project.name from project-context.yaml}
77
+ Tech stack : {language} / {framework}
78
+ Module : {module if set, else "not configured"}
79
+ Domains : {comma-separated domain list}
80
+
81
+ Proceed? (Y/N)
82
+ ```
83
+
84
+ Wait for explicit "Y" or "N" from the user before continuing.
85
+ - "Y" → proceed to the command-specific steps below.
86
+ - "N" → stop and ask what the user wants to change.
87
+
88
+
89
+ *Note: For this command, the target in Step 1 is a UC-ID from `$ARGUMENTS`. Context loading provides `conventions.service_run` and port information.*
90
+
91
+ ## Context
92
+ # Context Loader — Load All Project Context
93
+
94
+ Execute these steps in order. Store everything in memory for the duration of the command session.
95
+
96
+ **Priority guide (anti-lost-in-middle):**
97
+ - Steps 1–2 are PROJECT-CONFIG — loaded first, resolve all paths and metadata.
98
+ - Step 3 is CRITICAL — architecture + coding standards, the highest-priority facts for generation.
99
+ - Step 4 is SAFETY — data protection rules, enforced silently for the entire session.
100
+ - Steps 5–6 are DOMAIN KNOWLEDGE — terminology and entity definitions.
101
+ - Step 7 is the WORKING MEMORY RECAP — locks critical facts into the top of working memory.
102
+
103
+ ---
104
+
105
+ ## Step 1 — [PROJECT-CONFIG] Load project-context.yaml
106
+
107
+ Read `.agent/project-context.yaml`. Extract and store:
108
+
109
+ **Tech Stack:**
110
+ - `tech_stack.language` → active language (e.g., Java 17, TypeScript, C#, Go)
111
+ - `tech_stack.framework` → active framework (e.g., Spring Boot 3.2, Angular 17, .NET 8)
112
+ - `tech_stack.build_tool` → build tool (e.g., Maven, npm, dotnet, go)
113
+ - `tech_stack.test_framework` → test framework (e.g., JUnit 5 + Mockito, Jest, xUnit)
114
+ - `tech_stack.database` → database (e.g., PostgreSQL, MySQL, MongoDB)
115
+ - `tech_stack.module` → active module profile (e.g., java-spring, angular, dotnet, golang, context-engineering)
116
+
117
+ **Conventions:**
118
+ - `conventions.build_command` → how to compile/build
119
+ - `conventions.test_command` → how to run tests
120
+ - `conventions.service_run` → how to start the service
121
+ - `conventions.ticket_prefix` → ticket ID prefix (e.g., PROJ, FEAT, UC)
122
+
123
+ **Domains:**
124
+ - `domains` → list of active business domains
125
+
126
+ **Paths (if present):**
127
+ - `paths.specs_dir` → BDD specs root
128
+ - `paths.prd_dir` → PRD documents root
129
+ - `paths.refinement_dir` → findings/review output dir
130
+ - `paths.product_definitions_dir` → product definitions root
131
+ - `paths.domain_knowledge_dir` → domain knowledge root
132
+ - `paths.business_dictionary` → path to business-dictionary.md
133
+ - `paths.core_entities` → path to core-entities.md
134
+ - `paths.tech_docs_dir` → technical documentation root
135
+ - `paths.trace_dir` → trace state directory
136
+
137
+ If `paths` section is absent, use these defaults:
138
+ - `specs_dir` = `specs/bdd`
139
+ - `prd_dir` = `specs/prd`
140
+ - `refinement_dir` = `.agent/review`
141
+ - `product_definitions_dir` = `specs/product-definition`
142
+ - `domain_knowledge_dir` = `specs/domain-knowledge`
143
+ - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
144
+ - `core_entities` = `specs/domain-knowledge/core-entities.md`
145
+ - `tech_docs_dir` = `tech-docs`
146
+ - `trace_dir` = `.trace`
147
+
148
+ If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
149
+
150
+ ---
151
+
152
+ ## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
153
+
154
+ If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
155
+ Merge framework-specific conventions (layer patterns, test patterns, naming rules) into the loaded context.
156
+ If the file does not exist → skip silently.
157
+
158
+ ---
159
+
160
+ ## Step 3 — [CRITICAL] Load CLAUDE.md
161
+
162
+ *This is the highest-priority context — it defines HOW to write code and documents for this project.*
163
+
164
+ Read `CLAUDE.md`. Extract and store:
165
+
166
+ - **§1 Project Overview** → project name, language, framework, build/test commands, domains
167
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
168
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
169
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
170
+ - **§7 Git Conventions** → branch naming pattern, commit message format
171
+
172
+ If `CLAUDE.md` does not exist → note it as missing and continue with project-context.yaml data only.
173
+
174
+ ---
175
+
176
+ ## Step 4 — [SAFETY] Load Data Protection Rules
177
+
178
+ Read `.agent/rules/data-protection.md` (or `rules/data-protection.md` from the framework installation).
179
+
180
+ Store the sensitive file patterns — you must **never** read, write, display, or reference content from files matching those patterns for the entire session.
181
+
182
+ If neither file exists → apply built-in defaults: never access `.env*`, `*.key`, `*.pem`, `*secret*`, `*password*`, `*credential*`.
183
+
184
+ ---
185
+
186
+ ## Step 5 — [DOMAIN] Load Business Dictionary (conditional)
187
+
188
+ Check if the business dictionary file exists (use `paths.business_dictionary` resolved in Step 1).
189
+
190
+ If it exists, read it and extract:
191
+ - **Canonical Terms** → complete list of approved terms and their definitions
192
+ - **Banned Terms** → complete list of banned terms and their canonical replacements
193
+ - **Status / Enum Registry** → allowed enum values per entity
194
+
195
+ Store the banned terms list for **active enforcement** throughout the command session:
196
+ - When generating any text (PRD, BDD, code comments, tech docs), verify no banned terms appear
197
+ - Replace banned terms with their canonical equivalents automatically
198
+
199
+ If the file does not exist → skip silently. Do not warn or block.
200
+
201
+ ---
202
+
203
+ ## Step 6 — [DOMAIN] Load Core Entities (conditional)
204
+
205
+ Check if the core entities file exists at `paths.core_entities` (resolved in Step 1).
206
+ Default path: `specs/domain-knowledge/core-entities.md`.
207
+
208
+ If it exists, read it and store:
209
+ - **Entity catalog** → for each entity: its name, purpose, owner service, key fields (name + type), business invariants, and relationships
210
+ - **Field name registry** → canonical field names to use in generated code and documents
211
+ - **Relationship map** → how entities relate to each other (1:N, N:N, embedded, etc.)
212
+
213
+ **How to use this catalog:**
214
+ - When generating code: use the field names, types, and relationships defined here — do NOT infer from existing code
215
+ - When generating PRD/BDD: reference entity names from this catalog for consistency
216
+ - When generating tech-docs: use this catalog as the source-of-truth for entity definitions
217
+
218
+ If the file does not exist → skip silently.
219
+
220
+ ---
221
+
222
+ ## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
223
+
224
+ After loading all context, synthesize and output a compact summary block.
225
+ This recap ensures the most critical facts are stated at the END of context loading
226
+ (recency effect — freshest in working memory when the task begins).
227
+
228
+ Output exactly this block:
229
+ ```
230
+ [CTX LOADED]
231
+ Stack : {language} / {framework} / {database}
232
+ Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
233
+ Ticket : {ticket_prefix}-
234
+ Dict : {loaded — N canonical terms, M banned terms | missing}
235
+ Entities : {loaded — EntityA, EntityB, EntityC | missing}
236
+ Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
237
+ ```
238
+
239
+ If any CRITICAL file is missing (CLAUDE.md), flag it clearly so the user can decide whether to proceed.
240
+
241
+ ---
242
+
243
+ ## Context Load Complete
244
+
245
+ After completing all steps, you have loaded:
246
+ - Project identity, tech stack, module conventions
247
+ - Architecture rules and layer order ← **[CRITICAL — hold in working memory]**
248
+ - Coding standards and naming conventions ← **[CRITICAL — hold in working memory]**
249
+ - Data protection rules (sensitive file patterns to never access)
250
+ - Terminology rules with banned-term list ← **[DOMAIN — apply to every generated word]**
251
+ - Entity catalog (field names, types, invariants) ← **[DOMAIN — use for code generation]**
252
+ - All configured paths
253
+
254
+ Proceed to the next step of the calling command.
255
+
256
+
257
+ ---
258
+
259
+ ## Phase 1 — Find Service URL
260
+ Read `conventions.service_run` from project-context.yaml to determine port.
261
+ ```bash
262
+ curl -s http://localhost:{port}/health
263
+ ```
264
+ If not running: "Start with `{conventions.service_run}` from project root."
265
+
266
+ ## Phase 2 — Identify Endpoints
267
+ From UC-ID (or `$ARGUMENTS`) → find controller with `@trace.implements={UC-ID}`.
268
+ List: method, path, required auth/role.
269
+
270
+ ## Phase 3 — Get Auth Token (if needed)
271
+ Ask:
272
+ ```
273
+ Endpoint requires auth. Options:
274
+ 1. Paste Bearer token (from Postman/DevTools)
275
+ 2. Use test/dev token from local config
276
+ 3. Skip — test public endpoints only
277
+ ```
278
+
279
+ ## Phase 4 — Run Smoke Test
280
+ ```bash
281
+ # GET
282
+ curl -s -X GET "http://localhost:{port}/v1/{resource}?page=0&size=5" \
283
+ -H "Authorization: Bearer {token}" | {JSON_FORMATTER}
284
+
285
+ # POST
286
+ curl -s -X POST "http://localhost:{port}/v1/{resource}" \
287
+ -H "Authorization: Bearer {token}" \
288
+ -H "Content-Type: application/json" \
289
+ -d '{"field1": "test_value"}'
290
+ ```
291
+
292
+ ## Interpret Results
293
+ | Result | Meaning |
294
+ |--------|---------|
295
+ | 200/201 + correct data | ✅ OK |
296
+ | 200 + wrong data | ⚠️ Logic bug → /debug |
297
+ | 400 | Wrong request body → check required fields |
298
+ | 401 | Token expired or wrong config |
299
+ | 403 | Wrong role → check auth rules |
300
+ | 500 | Server error → paste into /debug |
301
+ | Connection refused | Service not running |
302
+
303
+ ## Output
304
+
305
+ # Report Footer — Standard Command Output Format
306
+
307
+ Every command report must end with this standard footer section.
308
+
309
+ ## Status Badge
310
+
311
+ Choose one based on outcome:
312
+ - `✅ Complete` — all steps succeeded, no issues found
313
+ - `❌ Failed` — command could not complete due to a blocking error
314
+ - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
315
+
316
+ ## Output Artifacts
317
+
318
+ List every file created or modified by this command:
319
+ ```
320
+ Output Artifacts:
321
+ {created|updated} {file-path} ({brief description})
322
+ {created|updated} {file-path} ({brief description})
323
+ ```
324
+
325
+ If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
326
+
327
+ ## Next Command Suggestion
328
+
329
+ Suggest the logical next command based on workflow phase:
330
+
331
+ | Current command | Suggest next |
332
+ |-------------------------|-----------------------------------------------|
333
+ | /define-product | `/generate-prd {product-definition-file}` |
334
+ | /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
335
+ | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
336
+ | /review-context (PRD) | `/generate-bdd {prd-file}` if APPROVED; fix PRD if NEEDS_FIX |
337
+ | /generate-bdd | `/review-context {feature-file}` to verify coverage |
338
+ | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
339
+ | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
340
+ | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
341
+ | /generate-code | `/generate-tests {UC-ID}` |
342
+ | /generate-tests | `/run-tests {UC-ID}` |
343
+ | /run-tests (passing) | `/review-code {UC-ID}` |
344
+ | /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
345
+ | /review-code | `/smoke-test {UC-ID}` or create PR |
346
+ | /smoke-test | Create PR and link to ticket |
347
+ | /validate-traces | `/generate-code {UC-ID}` for gaps |
348
+ | /fix-bug | Create PR and link to ticket |
349
+ | /debug | `/fix-bug {ticket-id}` if fix needed |
350
+
351
+ Format the footer as:
352
+ ```
353
+ ---
354
+ Status : {badge}
355
+ {Output Artifacts block}
356
+ Next : {suggested command with example arguments}
357
+ ```
358
+
359
+
360
+ ```
361
+ /smoke-test Report — {UC-ID}
362
+ | Method | Path | Status | Result |
363
+ |--------|------|--------|--------|
364
+ Issues: {describe any failures}
365
+ Next: /debug {stacktrace} OR /fix-bug {TICKET_ID} OR ready to PR
366
+ ```