@anhth2/spec-driven-dev-plugin 0.9.2 → 0.11.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 (223) hide show
  1. package/commands/debug.md +50 -20
  2. package/commands/define-product.md +49 -19
  3. package/commands/{generate-tests.md → dev-gen-test.md} +85 -23
  4. package/commands/{generate-tests.tmpl → dev-gen-test.tmpl} +18 -4
  5. package/{core/commands/run-tests.md → commands/dev-run-test.md} +102 -21
  6. package/commands/{run-tests.tmpl → dev-run-test.tmpl} +35 -2
  7. package/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
  8. package/commands/{smoke-test.tmpl → dev-smoke-test.tmpl} +5 -5
  9. package/commands/fix-bug.md +50 -20
  10. package/commands/generate-bdd.md +78 -21
  11. package/commands/generate-bdd.tmpl +11 -2
  12. package/commands/generate-code.md +123 -23
  13. package/commands/generate-code.tmpl +56 -4
  14. package/commands/generate-design-spec.md +142 -47
  15. package/commands/generate-design-spec.tmpl +93 -28
  16. package/commands/generate-prd.md +49 -19
  17. package/commands/generate-spec-manifest.md +49 -19
  18. package/commands/generate-tech-docs.md +50 -20
  19. package/commands/generate-tech-docs.tmpl +1 -1
  20. package/commands/learn.md +50 -20
  21. package/commands/propose-scenario.md +50 -20
  22. package/commands/propose-scenario.tmpl +1 -1
  23. package/commands/qc-analyze.md +514 -0
  24. package/commands/qc-analyze.tmpl +71 -0
  25. package/commands/qc-design-test.md +510 -0
  26. package/commands/qc-design-test.tmpl +67 -0
  27. package/commands/qc-plan.md +492 -0
  28. package/commands/qc-plan.tmpl +49 -0
  29. package/commands/qc-report.md +491 -0
  30. package/commands/qc-report.tmpl +48 -0
  31. package/commands/qc-review.md +496 -0
  32. package/commands/qc-review.tmpl +53 -0
  33. package/commands/qc-run-test.md +538 -0
  34. package/commands/qc-run-test.tmpl +77 -0
  35. package/commands/refine-prd.md +203 -24
  36. package/commands/refine-prd.tmpl +16 -5
  37. package/commands/report-bug.md +49 -19
  38. package/commands/review-code.md +51 -21
  39. package/commands/review-code.tmpl +1 -1
  40. package/commands/review-context.md +198 -20
  41. package/commands/review-context.tmpl +11 -1
  42. package/commands/review-tech-docs.md +49 -19
  43. package/commands/setup-ai-first.md +14 -7
  44. package/commands/sync.md +30 -20
  45. package/commands/sync.tmpl +16 -13
  46. package/commands/update-framework.md +14 -7
  47. package/commands/validate-traces.md +106 -45
  48. package/commands/validate-traces.tmpl +57 -26
  49. package/core/FRAMEWORK_VERSION +1 -1
  50. package/core/commands/debug.md +50 -20
  51. package/core/commands/define-product.md +49 -19
  52. package/core/commands/{generate-tests.md → dev-gen-test.md} +85 -23
  53. package/{commands/run-tests.md → core/commands/dev-run-test.md} +102 -21
  54. package/core/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
  55. package/core/commands/fix-bug.md +50 -20
  56. package/core/commands/generate-bdd.md +78 -21
  57. package/core/commands/generate-code.md +123 -23
  58. package/core/commands/generate-design-spec.md +142 -47
  59. package/core/commands/generate-prd.md +49 -19
  60. package/core/commands/generate-spec-manifest.md +49 -19
  61. package/core/commands/generate-tech-docs.md +50 -20
  62. package/core/commands/learn.md +50 -20
  63. package/core/commands/propose-scenario.md +50 -20
  64. package/core/commands/qc-analyze.md +514 -0
  65. package/core/commands/qc-design-test.md +510 -0
  66. package/core/commands/qc-plan.md +492 -0
  67. package/core/commands/qc-report.md +491 -0
  68. package/core/commands/qc-review.md +496 -0
  69. package/core/commands/qc-run-test.md +538 -0
  70. package/core/commands/refine-prd.md +203 -24
  71. package/core/commands/report-bug.md +49 -19
  72. package/core/commands/review-code.md +51 -21
  73. package/core/commands/review-context.md +198 -20
  74. package/core/commands/review-tech-docs.md +49 -19
  75. package/core/commands/setup-ai-first.md +14 -7
  76. package/core/commands/sync.md +30 -20
  77. package/core/commands/update-framework.md +14 -7
  78. package/core/commands/validate-traces.md +106 -45
  79. package/core/modules/qc-playwright/stack-profile.yaml +65 -0
  80. package/core/skills/code/SKILL.md +63 -26
  81. package/core/skills/debug/SKILL.md +78 -34
  82. package/core/skills/design-spec/SKILL.md +49 -19
  83. package/core/skills/discovery/SKILL.md +49 -19
  84. package/core/skills/prd/SKILL.md +28 -14
  85. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  86. package/core/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  87. package/core/skills/qc/qa-analyst/business-rules.md +55 -0
  88. package/core/skills/qc/qa-analyst/data-flow.md +60 -0
  89. package/core/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  90. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  91. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  92. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  93. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  94. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  95. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  96. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  97. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  98. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  99. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  100. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  101. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  102. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  103. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  104. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  105. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  106. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  107. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  108. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  109. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  110. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  111. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  112. package/core/skills/qc/qa-runner/e2e.md +49 -0
  113. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  114. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  115. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  116. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  117. package/core/skills/qc/qa-runner/integration.md +47 -0
  118. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  119. package/core/skills/qc/qa-runner/report/report.md +37 -0
  120. package/core/skills/setup-ai-first/SKILL.md +14 -7
  121. package/core/skills/spec/SKILL.md +28 -14
  122. package/core/skills/test/SKILL.md +121 -54
  123. package/core/steps/capture-lesson.md +1 -1
  124. package/core/steps/context-loader.md +35 -12
  125. package/core/steps/report-footer.md +14 -7
  126. package/core/steps/review-fanout.md +138 -0
  127. package/core/steps/spawn-agent.md +1 -1
  128. package/core/steps/trace-mirror.md +18 -0
  129. package/core/templates/design-spec.template.md +16 -8
  130. package/core/templates/project-context.yaml +8 -0
  131. package/docs/01-getting-started/README.md +19 -0
  132. package/docs/01-getting-started/core-concepts.md +102 -0
  133. package/docs/01-getting-started/installation.md +154 -0
  134. package/docs/01-getting-started/quickstart.md +85 -0
  135. package/docs/02-guides/README.md +27 -0
  136. package/docs/02-guides/developer/README.md +46 -0
  137. package/docs/02-guides/developer/bdd-and-trace.md +123 -0
  138. package/docs/02-guides/developer/commands.md +76 -0
  139. package/docs/02-guides/developer/pr-checklist.md +15 -0
  140. package/docs/02-guides/developer/scenarios.md +448 -0
  141. package/docs/02-guides/developer/workflow.md +59 -0
  142. package/docs/02-guides/product-owner/README.md +77 -0
  143. package/docs/02-guides/product-owner/commands.md +30 -0
  144. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  145. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  146. package/docs/02-guides/product-owner/scenarios.md +357 -0
  147. package/docs/02-guides/qc-automation.md +92 -0
  148. package/docs/02-guides/tester/README.md +72 -0
  149. package/docs/02-guides/tester/bug-reporting.md +117 -0
  150. package/docs/02-guides/tester/reading-specs.md +79 -0
  151. package/docs/02-guides/tester/scenarios.md +186 -0
  152. package/docs/02-guides/tester/spec-manifest.md +124 -0
  153. package/docs/02-guides/tester/test-checklist.md +31 -0
  154. package/docs/02-guides/tester/workflow.md +79 -0
  155. package/docs/03-concepts/README.md +19 -0
  156. package/docs/03-concepts/architecture.md +243 -0
  157. package/docs/03-concepts/pipeline.md +249 -0
  158. package/docs/03-concepts/traceability.md +148 -0
  159. package/docs/04-operations/README.md +33 -0
  160. package/docs/04-operations/bug-flow.md +321 -0
  161. package/docs/04-operations/publishing.md +137 -0
  162. package/docs/04-operations/sync-and-update.md +328 -0
  163. package/docs/05-reference/README.md +29 -0
  164. package/docs/05-reference/commands.md +229 -0
  165. package/docs/05-reference/modules.md +110 -0
  166. package/docs/05-reference/trace-schema.md +146 -0
  167. package/docs/README.md +51 -0
  168. package/modules/qc-playwright/stack-profile.yaml +65 -0
  169. package/package.json +2 -2
  170. package/skills/code/SKILL.md +63 -26
  171. package/skills/debug/SKILL.md +78 -34
  172. package/skills/debug/SKILL.tmpl +1 -1
  173. package/skills/design-spec/SKILL.md +49 -19
  174. package/skills/discovery/SKILL.md +49 -19
  175. package/skills/prd/SKILL.md +28 -14
  176. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  177. package/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
  178. package/skills/qc/qa-analyst/business-rules.md +55 -0
  179. package/skills/qc/qa-analyst/data-flow.md +60 -0
  180. package/skills/qc/qa-analyst/spec-breakdown.md +57 -0
  181. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  182. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  183. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  184. package/skills/qc/qa-designer/functional/api.md +45 -0
  185. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  186. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  187. package/skills/qc/qa-designer/integration/api.md +42 -0
  188. package/skills/qc/qa-designer/integration/db.md +39 -0
  189. package/skills/qc/qa-designer/integration/gui.md +40 -0
  190. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  191. package/skills/qc/qa-designer/non-functional.md +40 -0
  192. package/skills/qc/qa-planner/test-plan.md +120 -0
  193. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  194. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  195. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  196. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  197. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  198. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  199. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  200. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  201. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  202. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  203. package/skills/qc/qa-runner/e2e.md +49 -0
  204. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  205. package/skills/qc/qa-runner/functional/api.md +35 -0
  206. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  207. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  208. package/skills/qc/qa-runner/integration.md +47 -0
  209. package/skills/qc/qa-runner/non-functional.md +49 -0
  210. package/skills/qc/qa-runner/report/report.md +37 -0
  211. package/skills/setup-ai-first/SKILL.md +14 -7
  212. package/skills/spec/SKILL.md +28 -14
  213. package/skills/test/SKILL.md +121 -54
  214. package/skills/test/SKILL.tmpl +9 -9
  215. package/steps/capture-lesson.md +1 -1
  216. package/steps/context-loader.md +35 -12
  217. package/steps/report-footer.md +14 -7
  218. package/steps/review-fanout.md +138 -0
  219. package/steps/spawn-agent.md +1 -1
  220. package/steps/trace-mirror.md +18 -0
  221. package/templates/design-spec.template.md +16 -8
  222. package/templates/project-context.yaml +8 -0
  223. package/ARCHITECTURE.md +0 -247
@@ -0,0 +1,496 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # /qc-review — QC Review Gate (test cases & scripts)
8
+
9
+ > Stage 4 of the native QC automation pipeline (qc-analyze → qc-plan → qc-design-test → qc-review → qc-run-test → qc-report). Ported from the QC team's qa-reviewer. A two-way gate: reviews test cases (after qc-design-test) AND scripts (after qc-run-test).
10
+
11
+ ## Gate
12
+ # Gate — Universal Entry Procedure
13
+
14
+ Every command must execute this gate before proceeding with its specific logic.
15
+
16
+ ## Step 0 — Sub-Agent Mode Check
17
+
18
+ Before anything else, check if `$ARGUMENTS` is a JSON payload from an orchestrator:
19
+
20
+ 1. Attempt to parse `$ARGUMENTS` as JSON.
21
+ 2. If it parses successfully **and** contains `"_agent_mode": true`:
22
+ - **Skip Steps 1, 2, and 3 of this Gate entirely.**
23
+ - Set target file = `payload.target_file`
24
+ - Set loaded context = `payload.context` (do NOT run context-loader.md)
25
+ - Set UC scope = `payload.uc_id` (process only this UC)
26
+ - Set line range = `payload.uc_section` (read only that PRD section)
27
+ - Proceed directly to the command-specific logic.
28
+ 3. If `$ARGUMENTS` is not JSON or `_agent_mode` is absent → continue to Step 1 (normal mode).
29
+
30
+ ## Step 0-B — Model Check
31
+
32
+ *Skip this step if `_agent_mode: true` (sub-agent — orchestrator already validated).*
33
+
34
+ Complex generation and review commands require strong reasoning.
35
+ Using a smaller model risks missed edge cases, incomplete spec analysis, and architecture violations.
36
+
37
+ Display and wait for response:
38
+
39
+ ```
40
+ ⚙️ MODEL CHECK
41
+ ──────────────────────────────────────────────────────────────────
42
+ Recommended : claude-opus-4 (or latest Opus model)
43
+ Why needed : Spec analysis, architecture review, code generation
44
+ require deep reasoning. Smaller models miss edge cases.
45
+
46
+ To switch in Claude Code:
47
+ • Settings → Model → select "claude-opus"
48
+ • or: /model → choose claude-opus
49
+
50
+ Running on claude-opus?
51
+ Y — yes, on claude-opus → proceed
52
+ S — skip check (I accept lower quality risk with current model)
53
+ ──────────────────────────────────────────────────────────────────
54
+ ```
55
+
56
+ - "Y" → proceed to Step 1.
57
+ - "S" → proceed to Step 1 (user accepts risk, add ⚠️ to final report).
58
+ - "N" or anything else → **STOP.** Output: "Please switch to claude-opus, then re-run this command."
59
+
60
+ ## Step 1 — Resolve Target File
61
+
62
+ 1. If `$ARGUMENTS` is provided and points to an existing file → use it directly as the target.
63
+ 2. If `$ARGUMENTS` is a UC-ID, ticket ID, or partial name → search for matching files in the relevant directory.
64
+ 3. If `$ARGUMENTS` is empty or no match found:
65
+ - List files in the relevant directory for this command (e.g., `specs/prd/**/*.md` for PRD commands, `specs/bdd/**/*.feature` for BDD commands).
66
+ - Present the list to the user and ask: "Which file do you want to work with? (Enter number or filename)"
67
+ - Wait for user selection before continuing.
68
+
69
+ ## Step 2 — Execute Context Loader
70
+
71
+ Load all project context by following the procedure in `steps/context-loader.md`.
72
+ Store all loaded context in memory for use throughout this command session.
73
+
74
+ ## Step 3 — CHECKPOINT
75
+
76
+ After completing Steps 1 and 2, display a summary and wait for confirmation:
77
+
78
+ ```
79
+ CHECKPOINT
80
+ -----------
81
+ Target : {resolved file path}
82
+ Project : {project.name from project-context.yaml}
83
+ Tech stack : {language} / {framework}
84
+ Module : {module if set, else "not configured"}
85
+ Domains : {comma-separated domain list}
86
+
87
+ Proceed? (Y/N)
88
+ ```
89
+
90
+ Wait for explicit "Y" or "N" from the user before continuing.
91
+ - "Y" → proceed to the command-specific steps below.
92
+ - "N" → stop and ask what the user wants to change.
93
+
94
+
95
+ *Note: For this command, the target in Step 1 is a UC-ID. Detect review mode from `$ARGUMENTS`/context: review test-case `.Test.md` (after design) or review Python scripts (after run). Read artifacts from `{paths.refinement_dir}/qc/{UC-ID}/` and the generated test/page-object source.*
96
+
97
+ ## Context
98
+ # Context Loader — Load All Project Context
99
+
100
+ Execute these steps in order. Store everything in memory for the duration of the command session.
101
+
102
+ **Priority guide (anti-lost-in-middle):**
103
+ - Steps 1–2 are PROJECT-CONFIG — loaded first, resolve all paths and metadata.
104
+ - Step 3 is CRITICAL — architecture + coding standards, the highest-priority facts for generation.
105
+ - Step 4 is SAFETY — data protection rules, enforced silently for the entire session.
106
+ - Steps 5–6 are DOMAIN KNOWLEDGE — terminology and entity definitions.
107
+ - Step 7 is the WORKING MEMORY RECAP — locks critical facts into the top of working memory.
108
+
109
+ ---
110
+
111
+ ## Step 1 — [PROJECT-CONFIG] Load project-context.yaml
112
+
113
+ Read `.agent/project-context.yaml`. Extract and store:
114
+
115
+ **Tech Stack:**
116
+ - `tech_stack.language` → active language (e.g., Java 17, TypeScript, C#, Go)
117
+ - `tech_stack.framework` → active framework (e.g., Spring Boot 3.2, Angular 17, .NET 8)
118
+ - `tech_stack.build_tool` → build tool (e.g., Maven, npm, dotnet, go)
119
+ - `tech_stack.test_framework` → test framework (e.g., JUnit 5 + Mockito, Jest, xUnit)
120
+ - `tech_stack.database` → database (e.g., PostgreSQL, MySQL, MongoDB)
121
+ - `tech_stack.module` → active module profile (e.g., java-spring, angular, dotnet, golang, context-engineering)
122
+
123
+ **Conventions:**
124
+ - `conventions.build_command` → how to compile/build
125
+ - `conventions.test_command` → how to run tests
126
+ - `conventions.service_run` → how to start the service
127
+ - `conventions.ticket_prefix` → ticket ID prefix (e.g., PROJ, FEAT, UC)
128
+
129
+ **Domains:**
130
+ - `domains` → list of active business domains
131
+
132
+ **Paths (if present):**
133
+ - `paths.specs_dir` → BDD specs root
134
+ - `paths.prd_dir` → PRD documents root
135
+ - `paths.refinement_dir` → findings/review output dir
136
+ - `paths.product_definitions_dir` → product definitions root
137
+ - `paths.domain_knowledge_dir` → domain knowledge root
138
+ - `paths.business_dictionary` → path to business-dictionary.md
139
+ - `paths.core_entities` → path to core-entities.md
140
+ - `paths.tech_docs_dir` → technical documentation root
141
+ - `paths.trace_dir` → trace state directory
142
+ - `paths.design_spec_dir` → Design Spec documents root (FE/App only)
143
+
144
+ If `paths` section is absent, use these defaults:
145
+ - `specs_dir` = `specs/bdd`
146
+ - `prd_dir` = `specs/prd`
147
+ - `refinement_dir` = `.agent/review`
148
+ - `product_definitions_dir` = `specs/product-definition`
149
+ - `domain_knowledge_dir` = `specs/domain-knowledge`
150
+ - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
151
+ - `core_entities` = `specs/domain-knowledge/core-entities.md`
152
+ - `tech_docs_dir` = `specs/tech-docs`
153
+ - `trace_dir` = `.trace`
154
+ - `design_spec_dir` = `specs/design-spec`
155
+
156
+ If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
157
+
158
+ ---
159
+
160
+ ## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
161
+
162
+ *Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
163
+
164
+ If `services` section is present:
165
+
166
+ **1. Detect active domain** (in priority order):
167
+ - Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
168
+ - Extract from target file path: segment immediately after `prd_dir` base path
169
+ *(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
170
+ - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
171
+
172
+ **2. Route to service** — if active domain matches a key in `services`:
173
+ - Override `paths.specs_dir` → `services.{domain}.specs_dir`
174
+ - Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
175
+ - Store `active_service` = `services.{domain}.path`
176
+ - Store `active_service_module` = `services.{domain}.module`
177
+ - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
178
+
179
+ **3. Fallback** — if domain not detected or no matching service key:
180
+ - Keep default paths from Step 1
181
+ - Set `active_service = unresolved`
182
+
183
+ **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
184
+ - Override `paths.prd_dir` → `{spec_source}/specs/prd`
185
+ - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
186
+ - Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
187
+ - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
188
+ - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
189
+ - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
190
+ - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
191
+ - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
192
+
193
+ > **Why under `spec_source`:** PRD, design-spec, domain knowledge, the **API contract (tech-docs)**, and tester feedback are all **cross-team artifacts** — they must live in the **shared spec repo** so every umbrella (FE/App/BE) reads the same source via `/sync`. Tech-docs specifically: BE authors the tech-design (API contract), commits + pushes it into the spec submodule (2-layer commit), and FE/App pull it on their next `/sync` to wire the real API in `/generate-code --phase=integration`. In single-service mode (no `spec_source`), these default under the repo root — still shared, same repo.
194
+
195
+ ---
196
+
197
+ ## Step 1.6 — [SERVICE CONVENTIONS] Load service-specific conventions (umbrella mode)
198
+
199
+ *Skip this step entirely if `active_service` is `"unresolved"` or context is single-service mode.*
200
+
201
+ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-service/`):
202
+
203
+ **1. Locate service config** — try in priority order:
204
+ - `{active_service}/.agent/project-context.yaml`
205
+ - `{active_service}/project-context.yaml`
206
+
207
+ **2. If found, override with service-specific values:**
208
+
209
+ | Variable | Source |
210
+ |----------|--------|
211
+ | `conventions.test_command` | service's `conventions.test_command` |
212
+ | `conventions.build_command` | service's `conventions.build_command` |
213
+ | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` — default: `{active_service}/.trace` |
214
+ | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
215
+
216
+ **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
217
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
218
+ - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
219
+
220
+ **4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
221
+
222
+ ---
223
+
224
+ ## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
225
+
226
+ If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
227
+ Merge framework-specific conventions (layer patterns, test patterns, naming rules) into the loaded context.
228
+ If the file does not exist → skip silently.
229
+
230
+ ---
231
+
232
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
233
+
234
+ *This is the highest-priority context — it defines HOW to write code and documents for this project.*
235
+
236
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
237
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
238
+ root, but the implementation code lives in a service submodule with its OWN stack,
239
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
240
+
241
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
242
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
243
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
244
+ single-service mode) the project's only architecture + coding standards.
245
+
246
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
247
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
248
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
249
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
250
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
251
+ coding standards, and error handling. Layer-1 values that the service does not redefine
252
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
253
+
254
+ From the **merged** result, extract and store:
255
+
256
+ - **§1 Project Overview** → project name, language, framework, build/test commands, domains
257
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
258
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
259
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
260
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
261
+
262
+ **Resolution rules:**
263
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
264
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
265
+ - If `service_root` is set but `{service_root}/CLAUDE.md` is **missing** → fall back to root CLAUDE.md and flag ⚠️ in the Step 7 recap (the service has no architecture/coding-standards definition — code generation will use umbrella defaults, which may be the wrong stack).
266
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
267
+
268
+ ---
269
+
270
+ ## Step 4 — [SAFETY] Load Data Protection Rules
271
+
272
+ Read `.agent/rules/data-protection.md` (or `rules/data-protection.md` from the framework installation).
273
+
274
+ Store the sensitive file patterns — you must **never** read, write, display, or reference content from files matching those patterns for the entire session.
275
+
276
+ If neither file exists → apply built-in defaults: never access `.env*`, `*.key`, `*.pem`, `*secret*`, `*password*`, `*credential*`.
277
+
278
+ ---
279
+
280
+ ## Step 5 — [DOMAIN] Load Business Dictionary (conditional)
281
+
282
+ Check if the business dictionary file exists (use `paths.business_dictionary` resolved in Step 1).
283
+
284
+ If it exists, read it and extract:
285
+ - **Canonical Terms** → complete list of approved terms and their definitions
286
+ - **Banned Terms** → complete list of banned terms and their canonical replacements
287
+ - **Status / Enum Registry** → allowed enum values per entity
288
+
289
+ Store the banned terms list for **active enforcement** throughout the command session:
290
+ - When generating any text (PRD, BDD, code comments, tech docs), verify no banned terms appear
291
+ - Replace banned terms with their canonical equivalents automatically
292
+
293
+ If the file does not exist → skip silently. Do not warn or block.
294
+
295
+ ---
296
+
297
+ ## Step 6 — [DOMAIN] Load Core Entities (conditional)
298
+
299
+ Check if the core entities file exists at `paths.core_entities` (resolved in Step 1).
300
+ Default path: `specs/domain-knowledge/core-entities.md`.
301
+
302
+ If it exists, read it and store:
303
+ - **Entity catalog** → for each entity: its name, purpose, owner service, key fields (name + type), business invariants, and relationships
304
+ - **Field name registry** → canonical field names to use in generated code and documents
305
+ - **Relationship map** → how entities relate to each other (1:N, N:N, embedded, etc.)
306
+
307
+ **How to use this catalog:**
308
+ - When generating code: use the field names, types, and relationships defined here — do NOT infer from existing code
309
+ - When generating PRD/BDD: reference entity names from this catalog for consistency
310
+ - When generating tech-docs: use this catalog as the source-of-truth for entity definitions
311
+
312
+ If the file does not exist → skip silently.
313
+
314
+ ---
315
+
316
+ ## Step 6.5 — [PLATFORM] Derive active_module and platform_type
317
+
318
+ Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
319
+
320
+ ```
321
+ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
322
+ ```
323
+
324
+ | `platform_type` | Modules |
325
+ |---|---|
326
+ | `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
327
+ | `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
328
+ | `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
329
+
330
+ If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
331
+
332
+ These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (dev-gen-test, debug, fix-bug, dev-smoke-test).
333
+
334
+ ---
335
+
336
+ ## Step 6.7 — [GUARDRAILS] Load Project Lessons (conditional)
337
+
338
+ *Accumulated mistakes the AI must not repeat in this project. These are added over time via `/learn`
339
+ or accepted during `/review-code`, `/fix-bug`, `/debug`.*
340
+
341
+ Resolve the lessons file path:
342
+ - Use `paths.lessons_file` if set (may be service-overridden in umbrella mode, Step 1.6)
343
+ - Else default `specs/domain-knowledge/lessons-learned.md`
344
+ - In umbrella/service mode (when `service_root` is set), if `paths.lessons_file` is unset, default to `{service_root}/.agent/project-lessons.md`
345
+
346
+ If the file exists, read it and store ALL lessons as **ACTIVE GUARDRAILS** for the session:
347
+ - Treat each lesson's **Rule** as a hard constraint — same priority as CLAUDE.md coding standards (Step 3).
348
+ - Before generating or modifying any artifact (PRD, BDD, tech-doc, code, test), check the output against every lesson whose `category` matches the current command AND whose `scope` matches the target (domain / file).
349
+ - If a generated output would violate a lesson → correct it **before** presenting, and note which lesson (`L-NNN`) was applied.
350
+
351
+ If the file does not exist → skip silently (no lessons captured yet).
352
+
353
+ ---
354
+
355
+ ## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
356
+
357
+ After loading all context, synthesize and output a compact summary block.
358
+ This recap ensures the most critical facts are stated at the END of context loading
359
+ (recency effect — freshest in working memory when the task begins).
360
+
361
+ Output exactly this block:
362
+ ```
363
+ [CTX LOADED]
364
+ Stack : {language} / {framework} / {database}
365
+ Platform : {active_module} ({platform_type})
366
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
367
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
368
+ Ticket : {ticket_prefix}-
369
+ Dict : {loaded — N canonical terms, M banned terms | missing}
370
+ Entities : {loaded — EntityA, EntityB, EntityC | missing}
371
+ Lessons : {loaded — N guardrails | none yet}
372
+ Service : {active_service} ({active_service_module}) | single-service
373
+ Svc Root : {service_root} — conventions + trace_dir loaded from service config | —
374
+ Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
375
+ ```
376
+
377
+ If any CRITICAL file is missing (CLAUDE.md), flag it clearly so the user can decide whether to proceed.
378
+
379
+ ---
380
+
381
+ ## Context Load Complete
382
+
383
+ After completing all steps, you have loaded:
384
+ - Project identity, tech stack, module conventions
385
+ - Architecture rules and layer order ← **[CRITICAL — hold in working memory]**
386
+ - Coding standards and naming conventions ← **[CRITICAL — hold in working memory]**
387
+ - Data protection rules (sensitive file patterns to never access)
388
+ - Terminology rules with banned-term list ← **[DOMAIN — apply to every generated word]**
389
+ - Entity catalog (field names, types, invariants) ← **[DOMAIN — use for code generation]**
390
+ - All configured paths
391
+
392
+ Proceed to the next step of the calling command.
393
+
394
+
395
+ ---
396
+
397
+ ## Role
398
+
399
+ You are the **QC Reviewer** — the shared review gate, run twice in the pipeline:
400
+ 1. **After qc-design-test** → review the test-case `.Test.md` (coverage, clarity, trace).
401
+ 2. **After qc-run-test** → review the generated Python scripts / Page Objects.
402
+
403
+ Detect mode: if the target artifacts are `.Test.md` → test-case review; if Python test/PO
404
+ files exist for the UC and are newer → script review. If ambiguous, ask.
405
+
406
+ ## Skills (`skills/qc/qa-reviewer/`)
407
+
408
+ Pick by mode + layer, load ONE file:
409
+ - Test-case review: `test-case/{functional,e2e,integration,non-functional,exploratory}.md`
410
+ - Script review: `script/{functional,e2e,integration,non-functional,exploratory}.md`
411
+
412
+ ## Review focus
413
+
414
+ - **Test-case:** every `{UC-ID}-SC{N}` covered? happy + negative + boundary? concrete expected? trace (`BR-xx` + `@trace.verifies` SC) present? no orphan TC?
415
+ - **Script:** matches the `.Test.md` 1-1? Page Object 3-layer + slim BasePage? `expect()` not bare assert? no hard-coded URL/cred/timeout, no `time.sleep`, no Allure? selectors per priority (data-testid→role→…)? 100% of TCs scripted (none left Draft)?
416
+
417
+ Produce findings (severity + location + fix). Verdict APPROVED or NEEDS_FIX.
418
+
419
+ ## Report
420
+
421
+ # Report Footer — Standard Command Output Format
422
+
423
+ Every command report must end with this standard footer section.
424
+
425
+ ## Status Badge
426
+
427
+ Choose one based on outcome:
428
+ - `✅ Complete` — all steps succeeded, no issues found
429
+ - `❌ Failed` — command could not complete due to a blocking error
430
+ - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
431
+
432
+ ## Output Artifacts
433
+
434
+ List every file created or modified by this command:
435
+ ```
436
+ Output Artifacts:
437
+ {created|updated} {file-path} ({brief description})
438
+ {created|updated} {file-path} ({brief description})
439
+ ```
440
+
441
+ If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
442
+
443
+ ## Next Command Suggestion
444
+
445
+ Suggest the logical next command based on workflow phase:
446
+
447
+ | Current command | Suggest next |
448
+ |-------------------------|-----------------------------------------------|
449
+ | /setup-ai-first | `/define-product` to start your first feature |
450
+ | /define-product | `/generate-prd {product-definition-file}` |
451
+ | /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
452
+ | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
453
+ | /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 |
454
+ | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
455
+ | /generate-bdd | `/review-context {feature-file}` to verify coverage |
456
+ | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
457
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
458
+ | /qc-plan | `/qc-design-test {UC-ID}` |
459
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
460
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
461
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
462
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
463
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
464
+ | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
465
+ | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
466
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
467
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
468
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
469
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
470
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
471
+ | /dev-smoke-test | Create PR and link to ticket |
472
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
473
+ | /fix-bug | Create PR and link to ticket |
474
+ | /debug | `/fix-bug {ticket-id}` if fix needed |
475
+ | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
476
+ | /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
477
+ | /learn | Continue working — lesson applies on next command |
478
+ | /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
479
+ | /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
480
+
481
+ Format the footer as:
482
+ ```
483
+ ---
484
+ Status : {badge}
485
+ {Output Artifacts block}
486
+ Next : {suggested command with example arguments}
487
+ ```
488
+
489
+
490
+ ```
491
+ /qc-review Complete — {UC-ID} ({test-case | script} review)
492
+ Verdict: {APPROVED | NEEDS_FIX} — {N} findings ({crit} critical)
493
+ Next (test-case APPROVED): /qc-run-test {UC-ID}
494
+ Next (script APPROVED) : /qc-report {UC-ID} then create PR
495
+ (NEEDS_FIX → fix the flagged artifact, then re-run /qc-review {UC-ID})
496
+ ```
@@ -0,0 +1,53 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # /qc-review — QC Review Gate (test cases & scripts)
8
+
9
+ > Stage 4 of the native QC automation pipeline (qc-analyze → qc-plan → qc-design-test → qc-review → qc-run-test → qc-report). Ported from the QC team's qa-reviewer. A two-way gate: reviews test cases (after qc-design-test) AND scripts (after qc-run-test).
10
+
11
+ ## Gate
12
+ {{include:steps/gate.md}}
13
+
14
+ *Note: For this command, the target in Step 1 is a UC-ID. Detect review mode from `$ARGUMENTS`/context: review test-case `.Test.md` (after design) or review Python scripts (after run). Read artifacts from `{paths.refinement_dir}/qc/{UC-ID}/` and the generated test/page-object source.*
15
+
16
+ ## Context
17
+ {{include:steps/context-loader.md}}
18
+
19
+ ---
20
+
21
+ ## Role
22
+
23
+ You are the **QC Reviewer** — the shared review gate, run twice in the pipeline:
24
+ 1. **After qc-design-test** → review the test-case `.Test.md` (coverage, clarity, trace).
25
+ 2. **After qc-run-test** → review the generated Python scripts / Page Objects.
26
+
27
+ Detect mode: if the target artifacts are `.Test.md` → test-case review; if Python test/PO
28
+ files exist for the UC and are newer → script review. If ambiguous, ask.
29
+
30
+ ## Skills (`skills/qc/qa-reviewer/`)
31
+
32
+ Pick by mode + layer, load ONE file:
33
+ - Test-case review: `test-case/{functional,e2e,integration,non-functional,exploratory}.md`
34
+ - Script review: `script/{functional,e2e,integration,non-functional,exploratory}.md`
35
+
36
+ ## Review focus
37
+
38
+ - **Test-case:** every `{UC-ID}-SC{N}` covered? happy + negative + boundary? concrete expected? trace (`BR-xx` + `@trace.verifies` SC) present? no orphan TC?
39
+ - **Script:** matches the `.Test.md` 1-1? Page Object 3-layer + slim BasePage? `expect()` not bare assert? no hard-coded URL/cred/timeout, no `time.sleep`, no Allure? selectors per priority (data-testid→role→…)? 100% of TCs scripted (none left Draft)?
40
+
41
+ Produce findings (severity + location + fix). Verdict APPROVED or NEEDS_FIX.
42
+
43
+ ## Report
44
+
45
+ {{include:steps/report-footer.md}}
46
+
47
+ ```
48
+ /qc-review Complete — {UC-ID} ({test-case | script} review)
49
+ Verdict: {APPROVED | NEEDS_FIX} — {N} findings ({crit} critical)
50
+ Next (test-case APPROVED): /qc-run-test {UC-ID}
51
+ Next (script APPROVED) : /qc-report {UC-ID} then create PR
52
+ (NEEDS_FIX → fix the flagged artifact, then re-run /qc-review {UC-ID})
53
+ ```