@anhth2/spec-driven-dev-plugin 0.10.0 → 0.12.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 (207) hide show
  1. package/commands/debug.md +43 -8
  2. package/commands/define-product.md +43 -8
  3. package/commands/dev-gen-test.md +44 -9
  4. package/commands/dev-gen-test.tmpl +1 -1
  5. package/commands/dev-run-test.md +48 -10
  6. package/commands/dev-run-test.tmpl +5 -2
  7. package/commands/dev-smoke-test.md +43 -8
  8. package/commands/fix-bug.md +79 -14
  9. package/commands/fix-bug.tmpl +36 -6
  10. package/commands/generate-bdd.md +49 -10
  11. package/commands/generate-bdd.tmpl +6 -2
  12. package/commands/generate-code.md +44 -9
  13. package/commands/generate-code.tmpl +1 -1
  14. package/commands/generate-design-spec.md +43 -8
  15. package/commands/generate-prd.md +43 -8
  16. package/commands/generate-spec-manifest.md +43 -8
  17. package/commands/generate-tech-docs.md +43 -8
  18. package/commands/learn.md +43 -8
  19. package/commands/propose-scenario.md +74 -19
  20. package/commands/propose-scenario.tmpl +31 -11
  21. package/commands/qc-analyze.md +534 -0
  22. package/commands/qc-analyze.tmpl +86 -0
  23. package/commands/qc-design-test.md +515 -0
  24. package/commands/qc-design-test.tmpl +67 -0
  25. package/commands/qc-plan.md +497 -0
  26. package/commands/qc-plan.tmpl +49 -0
  27. package/commands/qc-report.md +508 -0
  28. package/commands/qc-report.tmpl +60 -0
  29. package/commands/qc-review.md +501 -0
  30. package/commands/qc-review.tmpl +53 -0
  31. package/commands/qc-run-test.md +549 -0
  32. package/commands/qc-run-test.tmpl +83 -0
  33. package/commands/refine-prd.md +43 -8
  34. package/commands/report-bug.md +59 -10
  35. package/commands/report-bug.tmpl +16 -2
  36. package/commands/review-code.md +43 -8
  37. package/commands/review-context.md +43 -8
  38. package/commands/review-tech-docs.md +43 -8
  39. package/commands/setup-ai-first.md +7 -0
  40. package/commands/sync.md +19 -9
  41. package/commands/sync.tmpl +12 -9
  42. package/commands/update-framework.md +7 -0
  43. package/commands/validate-traces.md +67 -12
  44. package/commands/validate-traces.tmpl +24 -4
  45. package/core/FRAMEWORK_VERSION +1 -1
  46. package/core/commands/debug.md +43 -8
  47. package/core/commands/define-product.md +43 -8
  48. package/core/commands/dev-gen-test.md +44 -9
  49. package/core/commands/dev-run-test.md +48 -10
  50. package/core/commands/dev-smoke-test.md +43 -8
  51. package/core/commands/fix-bug.md +79 -14
  52. package/core/commands/generate-bdd.md +49 -10
  53. package/core/commands/generate-code.md +44 -9
  54. package/core/commands/generate-design-spec.md +43 -8
  55. package/core/commands/generate-prd.md +43 -8
  56. package/core/commands/generate-spec-manifest.md +43 -8
  57. package/core/commands/generate-tech-docs.md +43 -8
  58. package/core/commands/learn.md +43 -8
  59. package/core/commands/propose-scenario.md +74 -19
  60. package/core/commands/qc-analyze.md +534 -0
  61. package/core/commands/qc-design-test.md +515 -0
  62. package/core/commands/qc-plan.md +497 -0
  63. package/core/commands/qc-report.md +508 -0
  64. package/core/commands/qc-review.md +501 -0
  65. package/core/commands/qc-run-test.md +549 -0
  66. package/core/commands/refine-prd.md +43 -8
  67. package/core/commands/report-bug.md +59 -10
  68. package/core/commands/review-code.md +43 -8
  69. package/core/commands/review-context.md +43 -8
  70. package/core/commands/review-tech-docs.md +43 -8
  71. package/core/commands/setup-ai-first.md +7 -0
  72. package/core/commands/sync.md +19 -9
  73. package/core/commands/update-framework.md +7 -0
  74. package/core/commands/validate-traces.md +67 -12
  75. package/core/modules/qc-playwright/stack-profile.yaml +65 -0
  76. package/core/skills/code/SKILL.md +50 -8
  77. package/core/skills/debug/SKILL.md +57 -8
  78. package/core/skills/design-spec/SKILL.md +43 -8
  79. package/core/skills/discovery/SKILL.md +43 -8
  80. package/core/skills/prd/SKILL.md +14 -0
  81. package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  82. package/core/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
  83. package/core/skills/qc/qa-analyst/business-rules.md +59 -0
  84. package/core/skills/qc/qa-analyst/data-flow.md +64 -0
  85. package/core/skills/qc/qa-analyst/spec-breakdown.md +61 -0
  86. package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
  87. package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
  88. package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  89. package/core/skills/qc/qa-designer/functional/api.md +45 -0
  90. package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  91. package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  92. package/core/skills/qc/qa-designer/integration/api.md +42 -0
  93. package/core/skills/qc/qa-designer/integration/db.md +39 -0
  94. package/core/skills/qc/qa-designer/integration/gui.md +40 -0
  95. package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
  96. package/core/skills/qc/qa-designer/non-functional.md +40 -0
  97. package/core/skills/qc/qa-planner/test-plan.md +120 -0
  98. package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
  99. package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  100. package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
  101. package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
  102. package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  103. package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  104. package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  105. package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  106. package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  107. package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  108. package/core/skills/qc/qa-runner/e2e.md +49 -0
  109. package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
  110. package/core/skills/qc/qa-runner/functional/api.md +35 -0
  111. package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  112. package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  113. package/core/skills/qc/qa-runner/integration.md +47 -0
  114. package/core/skills/qc/qa-runner/non-functional.md +49 -0
  115. package/core/skills/qc/qa-runner/report/report.md +37 -0
  116. package/core/skills/setup-ai-first/SKILL.md +7 -0
  117. package/core/skills/spec/SKILL.md +14 -0
  118. package/core/skills/test/SKILL.md +93 -16
  119. package/core/steps/context-loader.md +36 -8
  120. package/core/steps/report-footer.md +7 -0
  121. package/core/templates/project-context.yaml +27 -1
  122. package/docs/01-getting-started/README.md +19 -0
  123. package/docs/01-getting-started/core-concepts.md +102 -0
  124. package/docs/01-getting-started/installation.md +156 -0
  125. package/docs/01-getting-started/quickstart.md +85 -0
  126. package/docs/02-guides/README.md +27 -0
  127. package/docs/02-guides/developer/README.md +46 -0
  128. package/docs/02-guides/developer/bdd-and-trace.md +123 -0
  129. package/docs/02-guides/developer/commands.md +76 -0
  130. package/docs/02-guides/developer/pr-checklist.md +15 -0
  131. package/docs/02-guides/developer/scenarios.md +448 -0
  132. package/docs/02-guides/developer/workflow.md +61 -0
  133. package/docs/02-guides/product-owner/README.md +77 -0
  134. package/docs/02-guides/product-owner/commands.md +30 -0
  135. package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
  136. package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
  137. package/docs/02-guides/product-owner/scenarios.md +357 -0
  138. package/docs/02-guides/qc-automation.md +157 -0
  139. package/docs/02-guides/tester/README.md +74 -0
  140. package/docs/02-guides/tester/bug-reporting.md +117 -0
  141. package/docs/02-guides/tester/reading-specs.md +79 -0
  142. package/docs/02-guides/tester/scenarios.md +186 -0
  143. package/docs/02-guides/tester/spec-manifest.md +124 -0
  144. package/docs/02-guides/tester/test-checklist.md +31 -0
  145. package/docs/02-guides/tester/workflow.md +80 -0
  146. package/docs/03-concepts/README.md +19 -0
  147. package/docs/03-concepts/architecture.md +245 -0
  148. package/docs/03-concepts/pipeline.md +262 -0
  149. package/docs/03-concepts/traceability.md +149 -0
  150. package/docs/04-operations/README.md +33 -0
  151. package/docs/04-operations/bug-flow.md +362 -0
  152. package/docs/04-operations/publishing.md +137 -0
  153. package/docs/04-operations/sync-and-update.md +365 -0
  154. package/docs/05-reference/README.md +29 -0
  155. package/docs/05-reference/commands.md +229 -0
  156. package/docs/05-reference/modules.md +110 -0
  157. package/docs/05-reference/trace-schema.md +152 -0
  158. package/docs/README.md +51 -0
  159. package/modules/qc-playwright/stack-profile.yaml +65 -0
  160. package/package.json +2 -2
  161. package/skills/code/SKILL.md +50 -8
  162. package/skills/debug/SKILL.md +57 -8
  163. package/skills/design-spec/SKILL.md +43 -8
  164. package/skills/discovery/SKILL.md +43 -8
  165. package/skills/prd/SKILL.md +14 -0
  166. package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
  167. package/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
  168. package/skills/qc/qa-analyst/business-rules.md +59 -0
  169. package/skills/qc/qa-analyst/data-flow.md +64 -0
  170. package/skills/qc/qa-analyst/spec-breakdown.md +61 -0
  171. package/skills/qc/qa-designer/e2e/journey.md +41 -0
  172. package/skills/qc/qa-designer/exploratory/charter.md +68 -0
  173. package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
  174. package/skills/qc/qa-designer/functional/api.md +45 -0
  175. package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
  176. package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
  177. package/skills/qc/qa-designer/integration/api.md +42 -0
  178. package/skills/qc/qa-designer/integration/db.md +39 -0
  179. package/skills/qc/qa-designer/integration/gui.md +40 -0
  180. package/skills/qc/qa-designer/integration/kafka.md +40 -0
  181. package/skills/qc/qa-designer/non-functional.md +40 -0
  182. package/skills/qc/qa-planner/test-plan.md +120 -0
  183. package/skills/qc/qa-reviewer/script/e2e.md +87 -0
  184. package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
  185. package/skills/qc/qa-reviewer/script/functional.md +101 -0
  186. package/skills/qc/qa-reviewer/script/integration.md +91 -0
  187. package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
  188. package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
  189. package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
  190. package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
  191. package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
  192. package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
  193. package/skills/qc/qa-runner/e2e.md +49 -0
  194. package/skills/qc/qa-runner/exploratory/session.md +36 -0
  195. package/skills/qc/qa-runner/functional/api.md +35 -0
  196. package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
  197. package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
  198. package/skills/qc/qa-runner/integration.md +47 -0
  199. package/skills/qc/qa-runner/non-functional.md +49 -0
  200. package/skills/qc/qa-runner/report/report.md +37 -0
  201. package/skills/setup-ai-first/SKILL.md +7 -0
  202. package/skills/spec/SKILL.md +14 -0
  203. package/skills/test/SKILL.md +93 -16
  204. package/steps/context-loader.md +36 -8
  205. package/steps/report-footer.md +7 -0
  206. package/templates/project-context.yaml +27 -1
  207. package/ARCHITECTURE.md +0 -258
@@ -0,0 +1,508 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # /qc-report — QC Test Report & Evidence
8
+
9
+ > Stage 6 (final) 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-runner report step.
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. Generate the report from the latest `/qc-run-test` run. Uses the **qc-playwright** module (pytest-html + Playwright Trace — no Allure, no hand-written dashboard).*
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.qc_dir` → QC automation artifacts root (visible top-level, one subfolder per UC: `{qc_dir}/{UC-ID}/`)
137
+ - `paths.qc_skills_dir` → where qc-* commands load QC skills from (default bundled `.agent/skills/qc`; override to the QC team's own repo/submodule so framework upgrade won't overwrite them)
138
+ - `paths.product_definitions_dir` → product definitions root
139
+ - `paths.domain_knowledge_dir` → domain knowledge root
140
+ - `paths.business_dictionary` → path to business-dictionary.md
141
+ - `paths.core_entities` → path to core-entities.md
142
+ - `paths.tech_docs_dir` → technical documentation root
143
+ - `paths.trace_dir` → trace state directory
144
+ - `paths.design_spec_dir` → Design Spec documents root (FE/App only)
145
+
146
+ If `paths` section is absent, use these defaults:
147
+ - `specs_dir` = `specs/bdd`
148
+ - `prd_dir` = `specs/prd`
149
+ - `refinement_dir` = `.agent/review`
150
+ - `qc_dir` = `docs`
151
+ - `qc_skills_dir` = `.agent/skills/qc`
152
+ - `product_definitions_dir` = `specs/product-definition`
153
+ - `domain_knowledge_dir` = `specs/domain-knowledge`
154
+ - `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
155
+ - `core_entities` = `specs/domain-knowledge/core-entities.md`
156
+ - `tech_docs_dir` = `specs/tech-docs`
157
+ - `trace_dir` = `.trace`
158
+ - `design_spec_dir` = `specs/design-spec`
159
+
160
+ If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
161
+
162
+ ---
163
+
164
+ ## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
165
+
166
+ *Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
167
+
168
+ If `services` section is present:
169
+
170
+ **1. Detect active domain** (in priority order):
171
+ - Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
172
+ - Extract from target file path: segment immediately after `prd_dir` base path
173
+ *(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
174
+ - If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
175
+
176
+ **2. Route to service** — if active domain matches a key in `services`:
177
+ - Override `paths.specs_dir` → `services.{domain}.specs_dir`
178
+ - 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.
179
+ - Store `active_service` = `services.{domain}.path`
180
+ - Store `active_service_module` = `services.{domain}.module`
181
+ - If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
182
+
183
+ **3. Fallback** — if domain not detected or no matching service key:
184
+ - Keep default paths from Step 1
185
+ - Set `active_service = unresolved`
186
+
187
+ **4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
188
+ - Override `paths.prd_dir` → `{spec_source}/specs/prd`
189
+ - Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
190
+ - 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.)*
191
+ - Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
192
+ - Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
193
+ - Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
194
+ - Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
195
+ - Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
196
+ - Override `paths.prd_change_requests_dir` → `{spec_source}/feedback/prd-change-requests`
197
+
198
+ > **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.
199
+
200
+ ---
201
+
202
+ ## Step 1.6 — [SERVICE CONVENTIONS] Load service-specific conventions (umbrella mode)
203
+
204
+ *Skip this step entirely if `active_service` is `"unresolved"` or context is single-service mode.*
205
+
206
+ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-service/`):
207
+
208
+ **1. Locate service config** — try in priority order:
209
+ - `{active_service}/.agent/project-context.yaml`
210
+ - `{active_service}/project-context.yaml`
211
+
212
+ **2. If found, override with service-specific values:**
213
+
214
+ | Variable | Source |
215
+ |----------|--------|
216
+ | `conventions.test_command` | service's `conventions.test_command` |
217
+ | `conventions.build_command` | service's `conventions.build_command` |
218
+ | `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` — default: `{active_service}/.trace` |
219
+ | `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
220
+
221
+ **3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
222
+ - Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
223
+ - File write operations (test files, trace TSVs) use paths **relative to** `service_root`
224
+
225
+ **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).
226
+
227
+ ---
228
+
229
+ ## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
230
+
231
+ If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
232
+ Merge framework-specific conventions (layer patterns, test patterns, naming rules) into the loaded context.
233
+ If the file does not exist → skip silently.
234
+
235
+ ---
236
+
237
+ ## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
238
+
239
+ *This is the highest-priority context — it defines HOW to write code and documents for this project.*
240
+
241
+ CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
242
+ architecture/coding standards compose correctly. The agent always sits at the umbrella
243
+ root, but the implementation code lives in a service submodule with its OWN stack,
244
+ architecture, and conventions — so the service's CLAUDE.md must win for code generation.
245
+
246
+ **Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
247
+ Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
248
+ whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
249
+ single-service mode) the project's only architecture + coding standards.
250
+
251
+ **Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
252
+ *Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
253
+ Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
254
+ the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
255
+ Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
256
+ coding standards, and error handling. Layer-1 values that the service does not redefine
257
+ (e.g. git conventions, banned patterns shared org-wide) remain in effect.
258
+
259
+ From the **merged** result, extract and store:
260
+
261
+ - **§1 Project Overview** → project name, language, framework, build/test commands, domains
262
+ - **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
263
+ - **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
264
+ - **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
265
+ - **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
266
+
267
+ **Resolution rules:**
268
+ - If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
269
+ - If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
270
+ - 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).
271
+ - If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
272
+
273
+ ---
274
+
275
+ ## Step 4 — [SAFETY] Load Data Protection Rules
276
+
277
+ Read `.agent/rules/data-protection.md` (or `rules/data-protection.md` from the framework installation).
278
+
279
+ Store the sensitive file patterns — you must **never** read, write, display, or reference content from files matching those patterns for the entire session.
280
+
281
+ If neither file exists → apply built-in defaults: never access `.env*`, `*.key`, `*.pem`, `*secret*`, `*password*`, `*credential*`.
282
+
283
+ ---
284
+
285
+ ## Step 5 — [DOMAIN] Load Business Dictionary (conditional)
286
+
287
+ Check if the business dictionary file exists (use `paths.business_dictionary` resolved in Step 1).
288
+
289
+ If it exists, read it and extract:
290
+ - **Canonical Terms** → complete list of approved terms and their definitions
291
+ - **Banned Terms** → complete list of banned terms and their canonical replacements
292
+ - **Status / Enum Registry** → allowed enum values per entity
293
+
294
+ Store the banned terms list for **active enforcement** throughout the command session:
295
+ - When generating any text (PRD, BDD, code comments, tech docs), verify no banned terms appear
296
+ - Replace banned terms with their canonical equivalents automatically
297
+
298
+ If the file does not exist → skip silently. Do not warn or block.
299
+
300
+ ---
301
+
302
+ ## Step 6 — [DOMAIN] Load Core Entities (conditional)
303
+
304
+ Check if the core entities file exists at `paths.core_entities` (resolved in Step 1).
305
+ Default path: `specs/domain-knowledge/core-entities.md`.
306
+
307
+ If it exists, read it and store:
308
+ - **Entity catalog** → for each entity: its name, purpose, owner service, key fields (name + type), business invariants, and relationships
309
+ - **Field name registry** → canonical field names to use in generated code and documents
310
+ - **Relationship map** → how entities relate to each other (1:N, N:N, embedded, etc.)
311
+
312
+ **How to use this catalog:**
313
+ - When generating code: use the field names, types, and relationships defined here — do NOT infer from existing code
314
+ - When generating PRD/BDD: reference entity names from this catalog for consistency
315
+ - When generating tech-docs: use this catalog as the source-of-truth for entity definitions
316
+
317
+ If the file does not exist → skip silently.
318
+
319
+ ---
320
+
321
+ ## Step 6.5 — [PLATFORM] Derive active_module and platform_type
322
+
323
+ Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
324
+
325
+ ```
326
+ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
327
+ ```
328
+
329
+ | `platform_type` | Modules |
330
+ |---|---|
331
+ | `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
332
+ | `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
333
+ | `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
334
+
335
+ If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
336
+
337
+ 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).
338
+
339
+ ---
340
+
341
+ ## Step 6.7 — [GUARDRAILS] Load Project Lessons (conditional)
342
+
343
+ *Accumulated mistakes the AI must not repeat in this project. These are added over time via `/learn`
344
+ or accepted during `/review-code`, `/fix-bug`, `/debug`.*
345
+
346
+ Resolve the lessons file path:
347
+ - Use `paths.lessons_file` if set (may be service-overridden in umbrella mode, Step 1.6)
348
+ - Else default `specs/domain-knowledge/lessons-learned.md`
349
+ - In umbrella/service mode (when `service_root` is set), if `paths.lessons_file` is unset, default to `{service_root}/.agent/project-lessons.md`
350
+
351
+ If the file exists, read it and store ALL lessons as **ACTIVE GUARDRAILS** for the session:
352
+ - Treat each lesson's **Rule** as a hard constraint — same priority as CLAUDE.md coding standards (Step 3).
353
+ - 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).
354
+ - If a generated output would violate a lesson → correct it **before** presenting, and note which lesson (`L-NNN`) was applied.
355
+
356
+ If the file does not exist → skip silently (no lessons captured yet).
357
+
358
+ ---
359
+
360
+ ## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
361
+
362
+ After loading all context, synthesize and output a compact summary block.
363
+ This recap ensures the most critical facts are stated at the END of context loading
364
+ (recency effect — freshest in working memory when the task begins).
365
+
366
+ Output exactly this block:
367
+ ```
368
+ [CTX LOADED]
369
+ Stack : {language} / {framework} / {database}
370
+ Platform : {active_module} ({platform_type})
371
+ Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
372
+ CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
373
+ Ticket : {ticket_prefix}-
374
+ Dict : {loaded — N canonical terms, M banned terms | missing}
375
+ Entities : {loaded — EntityA, EntityB, EntityC | missing}
376
+ Lessons : {loaded — N guardrails | none yet}
377
+ Service : {active_service} ({active_service_module}) | single-service
378
+ Svc Root : {service_root} — conventions + trace_dir loaded from service config | —
379
+ Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
380
+ ```
381
+
382
+ If any CRITICAL file is missing (CLAUDE.md), flag it clearly so the user can decide whether to proceed.
383
+
384
+ ---
385
+
386
+ ## Context Load Complete
387
+
388
+ After completing all steps, you have loaded:
389
+ - Project identity, tech stack, module conventions
390
+ - Architecture rules and layer order ← **[CRITICAL — hold in working memory]**
391
+ - Coding standards and naming conventions ← **[CRITICAL — hold in working memory]**
392
+ - Data protection rules (sensitive file patterns to never access)
393
+ - Terminology rules with banned-term list ← **[DOMAIN — apply to every generated word]**
394
+ - Entity catalog (field names, types, invariants) ← **[DOMAIN — use for code generation]**
395
+ - All configured paths
396
+
397
+ Proceed to the next step of the calling command.
398
+
399
+
400
+ ---
401
+
402
+ ## Role
403
+
404
+ You are the **QC Report** stage — turn the latest run into a shareable report + evidence.
405
+
406
+ ## Skill (`{paths.qc_skills_dir}/qa-runner/report/`)
407
+
408
+ - `report.md` — self-contained: pytest-html (`--html=reports/<feature>/report.html
409
+ --self-contained-html`) + Playwright Trace (`test-results/<nodeid>/trace.zip`, viewed via
410
+ `python3 -m playwright show-trace <file>`), with screenshots/evidence attached on FAIL/SKIP.
411
+
412
+ ## Procedure
413
+
414
+ 1. Locate the latest run artifacts for `{UC-ID}` (pytest-html report + traces).
415
+ 2. Generate/refresh `reports/<feature>/report.html` (self-contained) and ensure each
416
+ FAIL/SKIP has a trace + screenshot attached.
417
+ 3. Summarize TOTAL / PASS / FAIL / SKIP; for each FAIL include the `show-trace` command and
418
+ whether it was classified script-bug or product-gap.
419
+ 4. **Hand off product-gaps to the specs (prompted).** For every FAIL classified **product-gap**
420
+ (a real defect, impl ≠ spec — not a script-bug), print a ready-to-run
421
+ `/report-bug {UC-ID} {one-line expected-vs-actual}` so QC files it to the shared spec repo.
422
+ `/report-bug`'s BUG_FLOW then routes the root cause (Code / BDD / PRD / Design / Env). Never
423
+ fake-pass a product-gap — it stays FAIL in `qc_status` until fixed + re-run. **script-bugs are
424
+ NOT filed** (QC fixes the script and re-runs). List the commands; do not auto-create the reports.
425
+
426
+ ## Report
427
+
428
+ # Report Footer — Standard Command Output Format
429
+
430
+ Every command report must end with this standard footer section.
431
+
432
+ ## Status Badge
433
+
434
+ Choose one based on outcome:
435
+ - `✅ Complete` — all steps succeeded, no issues found
436
+ - `❌ Failed` — command could not complete due to a blocking error
437
+ - `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
438
+
439
+ ## Output Artifacts
440
+
441
+ List every file created or modified by this command:
442
+ ```
443
+ Output Artifacts:
444
+ {created|updated} {file-path} ({brief description})
445
+ {created|updated} {file-path} ({brief description})
446
+ ```
447
+
448
+ If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
449
+
450
+ ## Next Command Suggestion
451
+
452
+ Suggest the logical next command based on workflow phase:
453
+
454
+ | Current command | Suggest next |
455
+ |-------------------------|-----------------------------------------------|
456
+ | /setup-ai-first | `/define-product` to start your first feature |
457
+ | /define-product | `/generate-prd {product-definition-file}` |
458
+ | /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
459
+ | /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
460
+ | /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 |
461
+ | /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
462
+ | /generate-bdd | `/review-context {feature-file}` to verify coverage |
463
+ | /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
464
+ | /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
465
+ | /qc-plan | `/qc-design-test {UC-ID}` |
466
+ | /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
467
+ | /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
468
+ | /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
469
+ | /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
470
+ | /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
471
+ | /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
472
+ | /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
473
+ | /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
474
+ | /dev-gen-test | `/dev-run-test {UC-ID}` |
475
+ | /dev-run-test (passing) | `/review-code {UC-ID}` |
476
+ | /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
477
+ | /review-code | `/dev-smoke-test {UC-ID}` or create PR |
478
+ | /dev-smoke-test | Create PR and link to ticket |
479
+ | /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
480
+ | /fix-bug | Create PR and link to ticket |
481
+ | /debug | `/fix-bug {ticket-id}` if fix needed |
482
+ | /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
483
+ | /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
484
+ | /learn | Continue working — lesson applies on next command |
485
+ | /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
486
+ | /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
487
+
488
+ Format the footer as:
489
+ ```
490
+ ---
491
+ Status : {badge}
492
+ {Output Artifacts block}
493
+ Next : {suggested command with example arguments}
494
+ ```
495
+
496
+
497
+ ```
498
+ /qc-report Complete — {UC-ID}
499
+ Report: reports/<feature>/report.html (TOTAL {N} · PASS {p} · FAIL {f} · SKIP {s})
500
+ Trace : test-results/<nodeid>/trace.zip (python3 -m playwright show-trace <file>)
501
+
502
+ Product-gaps to file ({g}): ← run these so PO/Dev see them on /sync (script-bugs excluded)
503
+ /report-bug {UC-ID} {gap 1 — expected vs actual}
504
+ /report-bug {UC-ID} {gap 2 …}
505
+ (none → skip)
506
+
507
+ Next: /validate-traces {UC-ID} ← refresh Living Docs (qc_status), then create PR
508
+ ```
@@ -0,0 +1,60 @@
1
+ ---
2
+ version: 1.0
3
+ updated: 2026-06-11
4
+ ported_from: ai-automation-qc-base
5
+ ---
6
+
7
+ # /qc-report — QC Test Report & Evidence
8
+
9
+ > Stage 6 (final) 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-runner report step.
10
+
11
+ ## Gate
12
+ {{include:steps/gate.md}}
13
+
14
+ *Note: For this command, the target in Step 1 is a UC-ID. Generate the report from the latest `/qc-run-test` run. Uses the **qc-playwright** module (pytest-html + Playwright Trace — no Allure, no hand-written dashboard).*
15
+
16
+ ## Context
17
+ {{include:steps/context-loader.md}}
18
+
19
+ ---
20
+
21
+ ## Role
22
+
23
+ You are the **QC Report** stage — turn the latest run into a shareable report + evidence.
24
+
25
+ ## Skill (`{paths.qc_skills_dir}/qa-runner/report/`)
26
+
27
+ - `report.md` — self-contained: pytest-html (`--html=reports/<feature>/report.html
28
+ --self-contained-html`) + Playwright Trace (`test-results/<nodeid>/trace.zip`, viewed via
29
+ `python3 -m playwright show-trace <file>`), with screenshots/evidence attached on FAIL/SKIP.
30
+
31
+ ## Procedure
32
+
33
+ 1. Locate the latest run artifacts for `{UC-ID}` (pytest-html report + traces).
34
+ 2. Generate/refresh `reports/<feature>/report.html` (self-contained) and ensure each
35
+ FAIL/SKIP has a trace + screenshot attached.
36
+ 3. Summarize TOTAL / PASS / FAIL / SKIP; for each FAIL include the `show-trace` command and
37
+ whether it was classified script-bug or product-gap.
38
+ 4. **Hand off product-gaps to the specs (prompted).** For every FAIL classified **product-gap**
39
+ (a real defect, impl ≠ spec — not a script-bug), print a ready-to-run
40
+ `/report-bug {UC-ID} {one-line expected-vs-actual}` so QC files it to the shared spec repo.
41
+ `/report-bug`'s BUG_FLOW then routes the root cause (Code / BDD / PRD / Design / Env). Never
42
+ fake-pass a product-gap — it stays FAIL in `qc_status` until fixed + re-run. **script-bugs are
43
+ NOT filed** (QC fixes the script and re-runs). List the commands; do not auto-create the reports.
44
+
45
+ ## Report
46
+
47
+ {{include:steps/report-footer.md}}
48
+
49
+ ```
50
+ /qc-report Complete — {UC-ID}
51
+ Report: reports/<feature>/report.html (TOTAL {N} · PASS {p} · FAIL {f} · SKIP {s})
52
+ Trace : test-results/<nodeid>/trace.zip (python3 -m playwright show-trace <file>)
53
+
54
+ Product-gaps to file ({g}): ← run these so PO/Dev see them on /sync (script-bugs excluded)
55
+ /report-bug {UC-ID} {gap 1 — expected vs actual}
56
+ /report-bug {UC-ID} {gap 2 …}
57
+ (none → skip)
58
+
59
+ Next: /validate-traces {UC-ID} ← refresh Living Docs (qc_status), then create PR
60
+ ```