@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.
- package/commands/debug.md +50 -20
- package/commands/define-product.md +49 -19
- package/commands/{generate-tests.md → dev-gen-test.md} +85 -23
- package/commands/{generate-tests.tmpl → dev-gen-test.tmpl} +18 -4
- package/{core/commands/run-tests.md → commands/dev-run-test.md} +102 -21
- package/commands/{run-tests.tmpl → dev-run-test.tmpl} +35 -2
- package/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
- package/commands/{smoke-test.tmpl → dev-smoke-test.tmpl} +5 -5
- package/commands/fix-bug.md +50 -20
- package/commands/generate-bdd.md +78 -21
- package/commands/generate-bdd.tmpl +11 -2
- package/commands/generate-code.md +123 -23
- package/commands/generate-code.tmpl +56 -4
- package/commands/generate-design-spec.md +142 -47
- package/commands/generate-design-spec.tmpl +93 -28
- package/commands/generate-prd.md +49 -19
- package/commands/generate-spec-manifest.md +49 -19
- package/commands/generate-tech-docs.md +50 -20
- package/commands/generate-tech-docs.tmpl +1 -1
- package/commands/learn.md +50 -20
- package/commands/propose-scenario.md +50 -20
- package/commands/propose-scenario.tmpl +1 -1
- package/commands/qc-analyze.md +514 -0
- package/commands/qc-analyze.tmpl +71 -0
- package/commands/qc-design-test.md +510 -0
- package/commands/qc-design-test.tmpl +67 -0
- package/commands/qc-plan.md +492 -0
- package/commands/qc-plan.tmpl +49 -0
- package/commands/qc-report.md +491 -0
- package/commands/qc-report.tmpl +48 -0
- package/commands/qc-review.md +496 -0
- package/commands/qc-review.tmpl +53 -0
- package/commands/qc-run-test.md +538 -0
- package/commands/qc-run-test.tmpl +77 -0
- package/commands/refine-prd.md +203 -24
- package/commands/refine-prd.tmpl +16 -5
- package/commands/report-bug.md +49 -19
- package/commands/review-code.md +51 -21
- package/commands/review-code.tmpl +1 -1
- package/commands/review-context.md +198 -20
- package/commands/review-context.tmpl +11 -1
- package/commands/review-tech-docs.md +49 -19
- package/commands/setup-ai-first.md +14 -7
- package/commands/sync.md +30 -20
- package/commands/sync.tmpl +16 -13
- package/commands/update-framework.md +14 -7
- package/commands/validate-traces.md +106 -45
- package/commands/validate-traces.tmpl +57 -26
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +50 -20
- package/core/commands/define-product.md +49 -19
- package/core/commands/{generate-tests.md → dev-gen-test.md} +85 -23
- package/{commands/run-tests.md → core/commands/dev-run-test.md} +102 -21
- package/core/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
- package/core/commands/fix-bug.md +50 -20
- package/core/commands/generate-bdd.md +78 -21
- package/core/commands/generate-code.md +123 -23
- package/core/commands/generate-design-spec.md +142 -47
- package/core/commands/generate-prd.md +49 -19
- package/core/commands/generate-spec-manifest.md +49 -19
- package/core/commands/generate-tech-docs.md +50 -20
- package/core/commands/learn.md +50 -20
- package/core/commands/propose-scenario.md +50 -20
- package/core/commands/qc-analyze.md +514 -0
- package/core/commands/qc-design-test.md +510 -0
- package/core/commands/qc-plan.md +492 -0
- package/core/commands/qc-report.md +491 -0
- package/core/commands/qc-review.md +496 -0
- package/core/commands/qc-run-test.md +538 -0
- package/core/commands/refine-prd.md +203 -24
- package/core/commands/report-bug.md +49 -19
- package/core/commands/review-code.md +51 -21
- package/core/commands/review-context.md +198 -20
- package/core/commands/review-tech-docs.md +49 -19
- package/core/commands/setup-ai-first.md +14 -7
- package/core/commands/sync.md +30 -20
- package/core/commands/update-framework.md +14 -7
- package/core/commands/validate-traces.md +106 -45
- package/core/modules/qc-playwright/stack-profile.yaml +65 -0
- package/core/skills/code/SKILL.md +63 -26
- package/core/skills/debug/SKILL.md +78 -34
- package/core/skills/design-spec/SKILL.md +49 -19
- package/core/skills/discovery/SKILL.md +49 -19
- package/core/skills/prd/SKILL.md +28 -14
- package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/core/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
- package/core/skills/qc/qa-analyst/business-rules.md +55 -0
- package/core/skills/qc/qa-analyst/data-flow.md +60 -0
- package/core/skills/qc/qa-analyst/spec-breakdown.md +57 -0
- package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
- package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
- package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
- package/core/skills/qc/qa-designer/functional/api.md +45 -0
- package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
- package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
- package/core/skills/qc/qa-designer/integration/api.md +42 -0
- package/core/skills/qc/qa-designer/integration/db.md +39 -0
- package/core/skills/qc/qa-designer/integration/gui.md +40 -0
- package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
- package/core/skills/qc/qa-designer/non-functional.md +40 -0
- package/core/skills/qc/qa-planner/test-plan.md +120 -0
- package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
- package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
- package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
- package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
- package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
- package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
- package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
- package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
- package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
- package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
- package/core/skills/qc/qa-runner/e2e.md +49 -0
- package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
- package/core/skills/qc/qa-runner/functional/api.md +35 -0
- package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
- package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
- package/core/skills/qc/qa-runner/integration.md +47 -0
- package/core/skills/qc/qa-runner/non-functional.md +49 -0
- package/core/skills/qc/qa-runner/report/report.md +37 -0
- package/core/skills/setup-ai-first/SKILL.md +14 -7
- package/core/skills/spec/SKILL.md +28 -14
- package/core/skills/test/SKILL.md +121 -54
- package/core/steps/capture-lesson.md +1 -1
- package/core/steps/context-loader.md +35 -12
- package/core/steps/report-footer.md +14 -7
- package/core/steps/review-fanout.md +138 -0
- package/core/steps/spawn-agent.md +1 -1
- package/core/steps/trace-mirror.md +18 -0
- package/core/templates/design-spec.template.md +16 -8
- package/core/templates/project-context.yaml +8 -0
- package/docs/01-getting-started/README.md +19 -0
- package/docs/01-getting-started/core-concepts.md +102 -0
- package/docs/01-getting-started/installation.md +154 -0
- package/docs/01-getting-started/quickstart.md +85 -0
- package/docs/02-guides/README.md +27 -0
- package/docs/02-guides/developer/README.md +46 -0
- package/docs/02-guides/developer/bdd-and-trace.md +123 -0
- package/docs/02-guides/developer/commands.md +76 -0
- package/docs/02-guides/developer/pr-checklist.md +15 -0
- package/docs/02-guides/developer/scenarios.md +448 -0
- package/docs/02-guides/developer/workflow.md +59 -0
- package/docs/02-guides/product-owner/README.md +77 -0
- package/docs/02-guides/product-owner/commands.md +30 -0
- package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
- package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
- package/docs/02-guides/product-owner/scenarios.md +357 -0
- package/docs/02-guides/qc-automation.md +92 -0
- package/docs/02-guides/tester/README.md +72 -0
- package/docs/02-guides/tester/bug-reporting.md +117 -0
- package/docs/02-guides/tester/reading-specs.md +79 -0
- package/docs/02-guides/tester/scenarios.md +186 -0
- package/docs/02-guides/tester/spec-manifest.md +124 -0
- package/docs/02-guides/tester/test-checklist.md +31 -0
- package/docs/02-guides/tester/workflow.md +79 -0
- package/docs/03-concepts/README.md +19 -0
- package/docs/03-concepts/architecture.md +243 -0
- package/docs/03-concepts/pipeline.md +249 -0
- package/docs/03-concepts/traceability.md +148 -0
- package/docs/04-operations/README.md +33 -0
- package/docs/04-operations/bug-flow.md +321 -0
- package/docs/04-operations/publishing.md +137 -0
- package/docs/04-operations/sync-and-update.md +328 -0
- package/docs/05-reference/README.md +29 -0
- package/docs/05-reference/commands.md +229 -0
- package/docs/05-reference/modules.md +110 -0
- package/docs/05-reference/trace-schema.md +146 -0
- package/docs/README.md +51 -0
- package/modules/qc-playwright/stack-profile.yaml +65 -0
- package/package.json +2 -2
- package/skills/code/SKILL.md +63 -26
- package/skills/debug/SKILL.md +78 -34
- package/skills/debug/SKILL.tmpl +1 -1
- package/skills/design-spec/SKILL.md +49 -19
- package/skills/discovery/SKILL.md +49 -19
- package/skills/prd/SKILL.md +28 -14
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
- package/skills/qc/qa-analyst/business-rules.md +55 -0
- package/skills/qc/qa-analyst/data-flow.md +60 -0
- package/skills/qc/qa-analyst/spec-breakdown.md +57 -0
- package/skills/qc/qa-designer/e2e/journey.md +41 -0
- package/skills/qc/qa-designer/exploratory/charter.md +68 -0
- package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
- package/skills/qc/qa-designer/functional/api.md +45 -0
- package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
- package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
- package/skills/qc/qa-designer/integration/api.md +42 -0
- package/skills/qc/qa-designer/integration/db.md +39 -0
- package/skills/qc/qa-designer/integration/gui.md +40 -0
- package/skills/qc/qa-designer/integration/kafka.md +40 -0
- package/skills/qc/qa-designer/non-functional.md +40 -0
- package/skills/qc/qa-planner/test-plan.md +120 -0
- package/skills/qc/qa-reviewer/script/e2e.md +87 -0
- package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
- package/skills/qc/qa-reviewer/script/functional.md +101 -0
- package/skills/qc/qa-reviewer/script/integration.md +91 -0
- package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
- package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
- package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
- package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
- package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
- package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
- package/skills/qc/qa-runner/e2e.md +49 -0
- package/skills/qc/qa-runner/exploratory/session.md +36 -0
- package/skills/qc/qa-runner/functional/api.md +35 -0
- package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
- package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
- package/skills/qc/qa-runner/integration.md +47 -0
- package/skills/qc/qa-runner/non-functional.md +49 -0
- package/skills/qc/qa-runner/report/report.md +37 -0
- package/skills/setup-ai-first/SKILL.md +14 -7
- package/skills/spec/SKILL.md +28 -14
- package/skills/test/SKILL.md +121 -54
- package/skills/test/SKILL.tmpl +9 -9
- package/steps/capture-lesson.md +1 -1
- package/steps/context-loader.md +35 -12
- package/steps/report-footer.md +14 -7
- package/steps/review-fanout.md +138 -0
- package/steps/spawn-agent.md +1 -1
- package/steps/trace-mirror.md +18 -0
- package/templates/design-spec.template.md +16 -8
- package/templates/project-context.yaml +8 -0
- package/ARCHITECTURE.md +0 -247
|
@@ -74,7 +74,7 @@ If `services` section is present:
|
|
|
74
74
|
|
|
75
75
|
**2. Route to service** — if active domain matches a key in `services`:
|
|
76
76
|
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
77
|
-
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
77
|
+
- 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.
|
|
78
78
|
- Store `active_service` = `services.{domain}.path`
|
|
79
79
|
- Store `active_service_module` = `services.{domain}.module`
|
|
80
80
|
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
@@ -86,7 +86,7 @@ If `services` section is present:
|
|
|
86
86
|
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
87
87
|
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
88
88
|
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
89
|
-
- Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **
|
|
89
|
+
- 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.)*
|
|
90
90
|
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
91
91
|
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
92
92
|
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
@@ -117,7 +117,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
|
|
|
117
117
|
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
118
118
|
|
|
119
119
|
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
120
|
-
- Shell commands (`/run-
|
|
120
|
+
- Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
|
|
121
121
|
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
122
122
|
|
|
123
123
|
**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).
|
|
@@ -132,19 +132,41 @@ If the file does not exist → skip silently.
|
|
|
132
132
|
|
|
133
133
|
---
|
|
134
134
|
|
|
135
|
-
## Step 3 — [CRITICAL] Load CLAUDE.md
|
|
135
|
+
## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
|
|
136
136
|
|
|
137
137
|
*This is the highest-priority context — it defines HOW to write code and documents for this project.*
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
|
|
140
|
+
architecture/coding standards compose correctly. The agent always sits at the umbrella
|
|
141
|
+
root, but the implementation code lives in a service submodule with its OWN stack,
|
|
142
|
+
architecture, and conventions — so the service's CLAUDE.md must win for code generation.
|
|
143
|
+
|
|
144
|
+
**Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
|
|
145
|
+
Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
|
|
146
|
+
whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
|
|
147
|
+
single-service mode) the project's only architecture + coding standards.
|
|
148
|
+
|
|
149
|
+
**Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
|
|
150
|
+
*Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
|
|
151
|
+
Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
|
|
152
|
+
the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
|
|
153
|
+
Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
|
|
154
|
+
coding standards, and error handling. Layer-1 values that the service does not redefine
|
|
155
|
+
(e.g. git conventions, banned patterns shared org-wide) remain in effect.
|
|
156
|
+
|
|
157
|
+
From the **merged** result, extract and store:
|
|
140
158
|
|
|
141
159
|
- **§1 Project Overview** → project name, language, framework, build/test commands, domains
|
|
142
|
-
- **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
|
|
143
|
-
- **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
|
|
144
|
-
- **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
|
|
145
|
-
- **§7 Git Conventions** → branch naming pattern, commit message format
|
|
160
|
+
- **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
|
|
161
|
+
- **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
|
|
162
|
+
- **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
|
|
163
|
+
- **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
|
|
146
164
|
|
|
147
|
-
|
|
165
|
+
**Resolution rules:**
|
|
166
|
+
- If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
|
|
167
|
+
- If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
|
|
168
|
+
- 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).
|
|
169
|
+
- If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
|
|
148
170
|
|
|
149
171
|
---
|
|
150
172
|
|
|
@@ -210,7 +232,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
|
210
232
|
|
|
211
233
|
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
212
234
|
|
|
213
|
-
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (
|
|
235
|
+
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).
|
|
214
236
|
|
|
215
237
|
---
|
|
216
238
|
|
|
@@ -244,7 +266,8 @@ Output exactly this block:
|
|
|
244
266
|
[CTX LOADED]
|
|
245
267
|
Stack : {language} / {framework} / {database}
|
|
246
268
|
Platform : {active_module} ({platform_type})
|
|
247
|
-
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
269
|
+
Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
270
|
+
CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
|
|
248
271
|
Ticket : {ticket_prefix}-
|
|
249
272
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
250
273
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
@@ -34,15 +34,22 @@ Suggest the logical next command based on workflow phase:
|
|
|
34
34
|
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
35
35
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
36
36
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
37
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
38
|
+
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
39
|
+
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
40
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
41
|
+
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
42
|
+
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
43
|
+
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
37
44
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
38
45
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
39
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
40
|
-
| /
|
|
41
|
-
| /run-
|
|
42
|
-
| /run-
|
|
43
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
44
|
-
| /smoke-test | Create PR and link to ticket |
|
|
45
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
46
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
47
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
48
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
49
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
50
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
51
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
52
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
46
53
|
| /fix-bug | Create PR and link to ticket |
|
|
47
54
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
48
55
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Exhaustive Review Fan-Out + Completeness Convergence
|
|
2
|
+
|
|
3
|
+
**Why this exists:** A single-pass review never lists every issue at once — the model
|
|
4
|
+
stops at "enough" findings, so each later review round surfaces *new* problems
|
|
5
|
+
(whack-a-mole). This procedure forces the review to **converge in one command run**:
|
|
6
|
+
fan out across review dimensions in parallel, then loop a completeness critic until a
|
|
7
|
+
round produces nothing new, *before* writing the findings file.
|
|
8
|
+
|
|
9
|
+
The calling command supplies two things:
|
|
10
|
+
- **DIMENSIONS** — the list of review dimensions to fan out over
|
|
11
|
+
(`/refine-prd` → the 4 lenses; `/review-context` → the P-checks or B-checks).
|
|
12
|
+
- **FINDINGS SCHEMA** — the YAML shape each finding must follow (defined in the command).
|
|
13
|
+
|
|
14
|
+
> **Sub-agent mode bypass:** If Gate Step 0 set `_agent_mode: true`, this whole
|
|
15
|
+
> procedure is **skipped** — the orchestrator is already running one dimension/UC per
|
|
16
|
+
> sub-agent. Run the command's checks directly on the scoped section and return findings.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Phase 1 — Parallel dimension scan
|
|
21
|
+
|
|
22
|
+
**How many sub-agents:** the agent *count* is not the completeness lever — breadth is
|
|
23
|
+
fixed by the DIMENSION taxonomy (adding agents to the same dimension just re-finds the
|
|
24
|
+
same issues), and *depth* is owned by the Phase 2 critic loop. Pick the **fan-out
|
|
25
|
+
granularity** by target size, reusing the `steps/spawn-agent.md` thresholds:
|
|
26
|
+
|
|
27
|
+
| Target size | Granularity | Agent count |
|
|
28
|
+
|-------------|-------------|-------------|
|
|
29
|
+
| ≤ 3 UCs **and** ≤ 300 lines | one agent per DIMENSION over the whole file | = number of dimensions |
|
|
30
|
+
| > 3 UCs **or** > 300 lines | one agent per **DIMENSION × UC-scope** (UCs + a PRD-global scope), batched to fit the agent cap | `dimensions × (UCs + 1)`, capped (see below) |
|
|
31
|
+
|
|
32
|
+
The larger granularity keeps each sub-agent's context small and its scan exhaustive on a
|
|
33
|
+
single UC — which is what prevents misses on big PRDs.
|
|
34
|
+
|
|
35
|
+
> **Global (non-UC) sections — required in `DIMENSION × UC` mode.** Per-UC agents only
|
|
36
|
+
> see one UC each, so PRD-wide sections that belong to no UC (scope, success metrics,
|
|
37
|
+
> problem statement, terminology, glossary, changelog) would go unscanned. Whenever you
|
|
38
|
+
> fan out per UC, also include a **"PRD-global"** scope (the non-UC sections, findings get
|
|
39
|
+
> `uc_id: ""`) alongside the UC list. So the natural agent count is `dimensions × (UCs + 1)`.
|
|
40
|
+
> (Not needed in the whole-file mode — there each agent already sees the global sections.)
|
|
41
|
+
|
|
42
|
+
### Agent cap — batch UCs when the fan-out gets too wide
|
|
43
|
+
|
|
44
|
+
`dimensions × (UCs + 1)` can explode on large PRDs (e.g. 6 checks × (8 UCs + 1) = 54
|
|
45
|
+
agents). Cap the wave at **`AGENT_CAP = 12`** agents and batch UC scopes to fit:
|
|
46
|
+
|
|
47
|
+
1. Build the scope list = `[UC1, UC2, …, UCn, PRD-global]` (length `UCs + 1`).
|
|
48
|
+
2. Compute scopes-per-agent-bucket: `groups = max(1, floor(AGENT_CAP / dimensions))`.
|
|
49
|
+
- If `groups ≥ UCs + 1` → no batching needed, run one agent per `DIMENSION × scope`.
|
|
50
|
+
- Else split the scope list into `groups` contiguous buckets of roughly equal size
|
|
51
|
+
(keep `PRD-global` in its own bucket if it fits; otherwise append it to the last
|
|
52
|
+
bucket). Each agent then handles **one DIMENSION over one bucket of UCs**.
|
|
53
|
+
3. Resulting wave size = `dimensions × groups ≤ AGENT_CAP`.
|
|
54
|
+
|
|
55
|
+
A batched agent reviews several UCs at once — still scoped far tighter than the whole
|
|
56
|
+
file, so coverage stays high. `AGENT_CAP` is the only knob; raise it if the host allows
|
|
57
|
+
more concurrency, lower it to save tokens. Whole-file mode (≤ 3 UCs) never hits the cap.
|
|
58
|
+
|
|
59
|
+
Spawn the chosen sub-agents using the Agent tool (send them in a single message so they
|
|
60
|
+
run concurrently). Each sub-agent gets a **fresh context window** and scans its scope
|
|
61
|
+
through its **one** dimension only — deeper coverage than one session juggling every
|
|
62
|
+
dimension at once (avoids lost-in-the-middle).
|
|
63
|
+
|
|
64
|
+
Sub-agent prompt template (fill the braces):
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
You are a {DIMENSION_NAME} reviewer. Read the full target file at {target_file}.
|
|
68
|
+
Scope: review ONLY through the {DIMENSION_NAME} lens/check — {DIMENSION_DESCRIPTION}.
|
|
69
|
+
Be exhaustive: scan every section, every UC, every AC/BR/scenario. Do not stop early.
|
|
70
|
+
Project context (terminology, entities, architecture):
|
|
71
|
+
{slim_context — banned terms, canonical entities, layer order, domains}
|
|
72
|
+
|
|
73
|
+
Return a JSON array of findings, each:
|
|
74
|
+
{ "dimension": "{DIMENSION_NAME}", "severity": "critical|major|minor",
|
|
75
|
+
"section": "...", "uc_id": "...", "quote": "<verbatim ≤120 chars>",
|
|
76
|
+
"finding": "...", "suggestion": "...", "auto_fixable": true|false }
|
|
77
|
+
Return [] if this dimension is clean. Return ONLY the JSON array.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Collect every sub-agent's array into one consolidated list `ALL_FINDINGS`.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Phase 2 — Completeness-critic convergence loop
|
|
85
|
+
|
|
86
|
+
This is the anti-whack-a-mole step. Repeat until **two consecutive rounds add zero new
|
|
87
|
+
findings**, or a hard cap of **3 rounds**, whichever comes first:
|
|
88
|
+
|
|
89
|
+
1. Spawn one **completeness-critic** sub-agent with the Agent tool. Give it:
|
|
90
|
+
- the full target file (`{target_file}`),
|
|
91
|
+
- the current `ALL_FINDINGS` list (so it knows what is already captured),
|
|
92
|
+
- the same slim context.
|
|
93
|
+
Prompt it:
|
|
94
|
+
```
|
|
95
|
+
Here is a document and a list of issues already found. Read the WHOLE document.
|
|
96
|
+
List ONLY real, additional issues NOT already in the list — gaps, ambiguities,
|
|
97
|
+
contradictions, missing edge/negative paths, coverage holes, terminology drift,
|
|
98
|
+
structural omissions, and any issue that a fix to an existing finding would expose.
|
|
99
|
+
Do NOT repeat anything already listed. Return the same finding JSON shape, or [] if
|
|
100
|
+
nothing new.
|
|
101
|
+
```
|
|
102
|
+
2. Append any genuinely new findings (not already in `ALL_FINDINGS`) to the list.
|
|
103
|
+
3. If this round returned 0 new → increment the dry-round counter; else reset it to 0.
|
|
104
|
+
4. Stop when dry-round counter reaches 2, or after 3 rounds total.
|
|
105
|
+
|
|
106
|
+
Record `convergence_rounds` (how many critic rounds ran) for the report.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Phase 3 — Dedup, resolve conflicts, merge
|
|
111
|
+
|
|
112
|
+
Sub-agents run **blind to each other** (independence = diverse coverage). They never
|
|
113
|
+
talk or reconcile among themselves — all duplicate/conflict resolution happens **here in
|
|
114
|
+
the orchestrator**, where the full set is visible.
|
|
115
|
+
|
|
116
|
+
1. **Deduplicate** `ALL_FINDINGS`: two findings are duplicates if they target the same
|
|
117
|
+
`section` + `uc_id` and describe the same underlying issue. Keep the one with the
|
|
118
|
+
richer `suggestion`; if they differ on severity, keep the **higher** severity.
|
|
119
|
+
2. **Resolve conflicts** — group remaining findings by `section` + `uc_id` and check for
|
|
120
|
+
contradictions (two findings whose `suggestion`s cannot both be applied, or that
|
|
121
|
+
propose opposite fixes for the same spot):
|
|
122
|
+
- If the two suggestions can be **merged** into one coherent fix → merge them into a
|
|
123
|
+
single finding.
|
|
124
|
+
- If they are **mutually exclusive** → emit **one** finding that states both options
|
|
125
|
+
and set `auto_fixable: false` with `status: "needs_discussion"` (PRD) /
|
|
126
|
+
`status: "pending"` (review) so a human picks — never silently drop one side.
|
|
127
|
+
- If a finding is **invalidated** by another (e.g. a structural finding says a section
|
|
128
|
+
is missing, but another quotes content from it) → drop the invalid one.
|
|
129
|
+
3. **Sort** by severity (critical → major → minor), then by `section` order in the file.
|
|
130
|
+
4. **Assign stable IDs** `F001, F002, …` in that sorted order.
|
|
131
|
+
5. Map each finding's `dimension` into the command's schema field
|
|
132
|
+
(`lens` for `/refine-prd`; `check_id` for `/review-context`).
|
|
133
|
+
6. Write the **single** findings file in the FINDINGS SCHEMA the command defines.
|
|
134
|
+
|
|
135
|
+
In the command's final report, add one line:
|
|
136
|
+
```
|
|
137
|
+
Convergence: {convergence_rounds} critic round(s) — findings file is complete; re-running should surface 0 new issues.
|
|
138
|
+
```
|
|
@@ -80,7 +80,7 @@ Build payload and invoke Agent tool for each UC:
|
|
|
80
80
|
}
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
> **Command scope**: Only `/generate-bdd` initiates orchestration mode. `/generate-code` and `/
|
|
83
|
+
> **Command scope**: Only `/generate-bdd` initiates orchestration mode. `/generate-code` and `/dev-gen-test` can run as sub-agents (they respect `_agent_mode: true` from Gate Step 0), but they do not spawn further sub-agents — their scope is already a single UC.
|
|
84
84
|
|
|
85
85
|
Serialize this JSON and pass as `$ARGUMENTS` when invoking the sub-agent command.
|
|
86
86
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Refresh Living Docs panel mirror *(local, umbrella mode)*
|
|
2
|
+
|
|
3
|
+
*Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
|
|
4
|
+
the service `.trace/` IS the panel location, so nothing to mirror.*
|
|
5
|
+
|
|
6
|
+
After updating the authoritative service TSV(s) at `{paths.trace_dir}`:
|
|
7
|
+
|
|
8
|
+
1. Resolve `panel_mirror = ./.trace` at the **current workspace root** (where this command runs).
|
|
9
|
+
2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
|
|
10
|
+
just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
|
|
11
|
+
(create the dir; overwrite). Use `active_service` for `{service-name}`.
|
|
12
|
+
|
|
13
|
+
This keeps the open workspace's Living Docs panel current **between syncs** — it is a
|
|
14
|
+
**local convenience mirror only**. The *canonical* report in the spec module
|
|
15
|
+
(`{spec_source}/.living-docs/`) and the merged `trace-report.json` are rebuilt by
|
|
16
|
+
`/sync` or `/validate-traces` (those need every service's data, so a single per-UC
|
|
17
|
+
command cannot produce them). For orchestrated commands, do this once in the orchestrator
|
|
18
|
+
after all sub-agents return — not inside each sub-agent.
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
- ⚠️ TODO → đánh dấu [TODO — chưa implement]
|
|
15
15
|
- ❌ Chưa có → đánh dấu [NEW — cần confirm với designer]
|
|
16
16
|
|
|
17
|
+
FIGMA LINKS (bắt buộc mỗi màn):
|
|
18
|
+
- Mỗi screen PHẢI có link Figma node-level (URL chứa ?node-id=...) — lấy bằng
|
|
19
|
+
right-click frame → "Copy link to selection". Đây là link AI đọc được qua Figma MCP.
|
|
20
|
+
- Link file trần (không có node-id) KHÔNG hợp lệ — AI không định vị được frame.
|
|
21
|
+
- Screen chưa có design → đánh dấu ❌ Missing; spec giữ Status "draft", chặn sign-off
|
|
22
|
+
và /generate-bdd cho tới khi đủ link.
|
|
23
|
+
|
|
17
24
|
SCREEN STATES (bắt buộc mỗi màn):
|
|
18
25
|
- Tối thiểu: default, loading, error
|
|
19
26
|
- Thêm "empty" nếu màn có thể hiển thị trạng thái không có dữ liệu
|
|
@@ -34,7 +41,7 @@
|
|
|
34
41
|
| **Service** | {active_service} |
|
|
35
42
|
| **Domain** | {domain} |
|
|
36
43
|
| **Business PRD** | [{TICKET-ID}](./{TICKET-ID}-slug.md) |
|
|
37
|
-
| **Figma** | {
|
|
44
|
+
| **Figma** | {feature file link} ({linked}/{N} frames linked) |
|
|
38
45
|
| **Author** | {PO name or "AI-assisted"} |
|
|
39
46
|
| **Created** | {YYYY-MM-DD} |
|
|
40
47
|
| **Updated** | {YYYY-MM-DD} |
|
|
@@ -43,10 +50,10 @@
|
|
|
43
50
|
|
|
44
51
|
# 1. Screen Inventory
|
|
45
52
|
|
|
46
|
-
| # | Screen Name | Entry Point | Figma Frame | Notes |
|
|
47
|
-
|
|
48
|
-
| 1 | {Screen 1} | {how user arrives} | [Frame]({
|
|
49
|
-
| 2 | {Screen 2} | {entry point} |
|
|
53
|
+
| # | Screen Name | Entry Point | Figma Frame (node-level link) | Notes |
|
|
54
|
+
|---|-------------|-------------|-------------------------------|-------|
|
|
55
|
+
| 1 | {Screen 1} | {how user arrives} | [Frame]({node-level url}) | |
|
|
56
|
+
| 2 | {Screen 2} | {entry point} | ❌ Missing — add node-id link | |
|
|
50
57
|
|
|
51
58
|
---
|
|
52
59
|
|
|
@@ -181,9 +188,10 @@
|
|
|
181
188
|
|
|
182
189
|
## Figma Summary
|
|
183
190
|
|
|
184
|
-
| Screen | Figma Frame
|
|
185
|
-
|
|
186
|
-
| {Screen 1} | [Link]({url})
|
|
191
|
+
| Screen | Figma Frame (node-level) | Link / Fetch Status |
|
|
192
|
+
|------------|--------------------------|--------------------------------|
|
|
193
|
+
| {Screen 1} | [Link]({node-level url}) | ✅ Linked & fetched |
|
|
194
|
+
| {Screen 2} | — | ❌ Missing — no node-id link |
|
|
187
195
|
|
|
188
196
|
## Design Tokens Referenced
|
|
189
197
|
|
|
@@ -106,6 +106,14 @@ domains:
|
|
|
106
106
|
# module: "{{STACK_MODULE}}" # e.g., java-spring, nextjs, flutter
|
|
107
107
|
# specs_dir: "{{SERVICE_SUBMODULE_DIR}}/specs/bdd"
|
|
108
108
|
# tech_docs_dir: "{{SERVICE_SUBMODULE_DIR}}/specs/tech-docs"
|
|
109
|
+
#
|
|
110
|
+
# IMPORTANT — per-service CLAUDE.md:
|
|
111
|
+
# Each service submodule should have its OWN CLAUDE.md ({path}/CLAUDE.md) defining its
|
|
112
|
+
# architecture + coding standards for ITS stack. context-loader loads CLAUDE.md in two
|
|
113
|
+
# layers: root CLAUDE.md (umbrella-wide shared rules) + {service}/CLAUDE.md (overlay,
|
|
114
|
+
# wins on conflict for architecture/coding-standards). The agent sits at the umbrella
|
|
115
|
+
# root, so without a service CLAUDE.md, code generation falls back to umbrella defaults
|
|
116
|
+
# (likely the wrong stack). Generate one per service via /setup-ai-first inside each.
|
|
109
117
|
# {{DOMAIN_2}}:
|
|
110
118
|
# path: "{{SERVICE_2_DIR}}"
|
|
111
119
|
# module: "{{STACK_MODULE}}"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › Getting Started
|
|
2
|
+
|
|
3
|
+
# Getting Started
|
|
4
|
+
|
|
5
|
+
Bắt đầu với spec-driven-dev framework — cài đặt, chạy feature đầu tiên, và nắm các khái niệm cốt lõi trong vài phút.
|
|
6
|
+
|
|
7
|
+
## Mục lục (this section)
|
|
8
|
+
|
|
9
|
+
- [installation.md](installation.md) — Cài framework, prerequisites (Node, Claude Code), QC automation stack, và VS Code extension (Review Board + Living Docs panels).
|
|
10
|
+
- [quickstart.md](quickstart.md) — Chạy feature đầu tiên end-to-end: Discovery → PRD → BDD → Tech Design → Code → Dev self-check.
|
|
11
|
+
- [core-concepts.md](core-concepts.md) — Khái niệm trong 5 phút: spec-as-source-of-truth, pipeline phases, traceability, dev_selftest vs qc_status, umbrella/spec-module.
|
|
12
|
+
|
|
13
|
+
## Đọc gì trước?
|
|
14
|
+
|
|
15
|
+
1. Mới hoàn toàn? → bắt đầu ở [core-concepts.md](core-concepts.md) để hiểu triết lý.
|
|
16
|
+
2. Sẵn sàng cài? → [installation.md](installation.md).
|
|
17
|
+
3. Đã cài xong? → [quickstart.md](quickstart.md) để chạy feature đầu tiên.
|
|
18
|
+
|
|
19
|
+
> Cần đào sâu hơn? Xem các section khác trong [📚 Docs](../README.md) — concepts, multi-repo/umbrella, QC pipeline, command reference, architecture.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › [Getting Started](README.md) › Core Concepts
|
|
2
|
+
|
|
3
|
+
# Core Concepts
|
|
4
|
+
|
|
5
|
+
Các khái niệm cốt lõi trong 5 phút. Đào sâu hơn ở [../03-concepts](../03-concepts).
|
|
6
|
+
|
|
7
|
+
## Mục lục
|
|
8
|
+
|
|
9
|
+
- [Spec là source of truth](#spec-là-source-of-truth)
|
|
10
|
+
- [Pipeline phases](#pipeline-phases)
|
|
11
|
+
- [Traceability](#traceability)
|
|
12
|
+
- [dev_selftest vs qc_status](#dev_selftest-vs-qc_status)
|
|
13
|
+
- [Umbrella & spec module](#umbrella--spec-module)
|
|
14
|
+
|
|
15
|
+
## Spec là source of truth
|
|
16
|
+
|
|
17
|
+
> **Write the spec first. Generate the code from the spec. Trace everything.**
|
|
18
|
+
|
|
19
|
+
- Con người định nghĩa *WHAT* — acceptance criteria, business rules, platform requirements.
|
|
20
|
+
- AI sinh ra *HOW* — BDD scenarios, tech design, code, tests — thích ứng theo platform.
|
|
21
|
+
- Mỗi artifact được review trước khi sang phase kế tiếp (AI review gate ở mọi transition).
|
|
22
|
+
- Mỗi dòng code truy ngược về một scenario trong file `.feature`.
|
|
23
|
+
|
|
24
|
+
**PRD platform-agnostic (Option C):** một PRD phục vụ mọi platform — chỉ mô tả nghiệp vụ, không có chi tiết UI hay API. FE/App đọc PRD → Design Spec → BDD; BE đọc PRD trực tiếp → BDD. Thêm platform mới sau không cần sửa PRD.
|
|
25
|
+
|
|
26
|
+
## Pipeline phases
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Discovery → PRD → BDD Spec → Tech Design → Code → Dev Self-Check
|
|
30
|
+
(+ QC suite chính thức song song)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| Phase | Ai | Lệnh chính | Output |
|
|
34
|
+
|-------|-----|-----------|--------|
|
|
35
|
+
| Discovery | PO + AI | `/define-product` | `specs/product-definition/{slug}.md` |
|
|
36
|
+
| PRD | AI → SA/PO | `/generate-prd`, `/refine-prd`, `/review-context` | `specs/prd/{domain}/{slug}.md` |
|
|
37
|
+
| Design Spec *(FE/App)* | AI → Designer/PO | `/generate-design-spec` | `specs/design-spec/...` |
|
|
38
|
+
| BDD Spec | AI → SA/Dev | `/generate-bdd`, `/review-context` | `specs/bdd/{domain}/{UC-ID}.feature` |
|
|
39
|
+
| Tech Design | AI → SA/Lead | `/generate-tech-docs`, `/review-tech-docs` | `tech-docs/{domain}/{UC-ID}-tech-design.md` |
|
|
40
|
+
| Code | AI → Dev | `/generate-code`, `/review-code` | `src/...` |
|
|
41
|
+
| Dev Self-Check | Dev | `/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test` | `src/test/...` |
|
|
42
|
+
| QC Automation | QC | `/qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report` | QC designs + run results |
|
|
43
|
+
| Trace audit | Tech Lead | `/validate-traces {domain}` | Coverage + drift report |
|
|
44
|
+
|
|
45
|
+
Chi tiết từng phase + happy-path lệnh: [quickstart.md](quickstart.md).
|
|
46
|
+
|
|
47
|
+
## Traceability
|
|
48
|
+
|
|
49
|
+
Mỗi artifact link tới artifact khác qua `@trace.*` tags:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
product-definition.md
|
|
53
|
+
└─► PRD.md (Service, Module trong metadata)
|
|
54
|
+
└─► {UC-ID}.feature (@trace.service, @trace.module, @trace.prd_version)
|
|
55
|
+
└─► tech-design.md (@trace.bdd_version)
|
|
56
|
+
└─► src/ code (@trace.implements, @trace.prd_version, @trace.bdd_version)
|
|
57
|
+
└─► src/test/ (@trace.verifies, @trace.service)
|
|
58
|
+
└─► .trace/{UC-ID}.tsv (drift tracking)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`/validate-traces {domain}` đọc các `.trace/{UC-ID}.tsv` và báo cáo:
|
|
62
|
+
|
|
63
|
+
| Status | Nghĩa |
|
|
64
|
+
|--------|-------|
|
|
65
|
+
| ✅ OK | Code version khớp spec version |
|
|
66
|
+
| ⚠️ DRIFT | Code sinh từ PRD/BDD version cũ — cần re-generate |
|
|
67
|
+
| 🔴 GAP | Scenario có trong spec nhưng chưa có code implement |
|
|
68
|
+
| — UNTRACKED | Scenario ghi nhận nhưng chưa code-gen |
|
|
69
|
+
|
|
70
|
+
Chi tiết tags + chain: [../03-concepts/traceability.md](../03-concepts/traceability.md).
|
|
71
|
+
|
|
72
|
+
## dev_selftest vs qc_status
|
|
73
|
+
|
|
74
|
+
Hai signal **độc lập** trong trace TSV — đừng nhầm lẫn:
|
|
75
|
+
|
|
76
|
+
| Signal | Set bởi | Ý nghĩa |
|
|
77
|
+
|--------|---------|---------|
|
|
78
|
+
| `dev_selftest` (+ `dev_selftest_at`) | `/dev-run-test` | Dev tự verify code của mình (smoke / self-check). **KHÔNG phải** official coverage. |
|
|
79
|
+
| `qc_status` (+ `qc_run_at`) | `/qc-run-test` | Bộ QC suite chính thức (native `/qc-*` pipeline), keyed theo `@trace.verifies={UC-ID}-SC{N}`. |
|
|
80
|
+
|
|
81
|
+
QC owns `qc_status`; dev owns `dev_selftest`. Living Docs panel hiển thị cả hai cạnh nhau. `/qc-run-test` & `/qc-report` dùng stack `qc-playwright` (độc lập với dev module — xem [installation.md](installation.md)).
|
|
82
|
+
|
|
83
|
+
## Umbrella & spec module
|
|
84
|
+
|
|
85
|
+
Cho project có nhiều service repo riêng (microservices, multi-platform): pattern khuyến nghị là **umbrella repo** — repo tổng chứa các service repo dưới dạng git submodule.
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
my-project-umbrella/ ← mở Claude Code ở đây
|
|
89
|
+
├── .agent/project-context.yaml ← routing config (domain → service)
|
|
90
|
+
├── my-project-specs/ ← submodule: spec module của PO (PRD, design-spec, tech-docs)
|
|
91
|
+
├── user-service/ ← submodule: microservice
|
|
92
|
+
└── web-app/ ← submodule: FE app
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- **Spec module** (`{spec_source}/`): chứa PRD, Design Spec, và tech-docs (API contract) — shared để mọi umbrella đọc cùng contract. Report canonical của Living Docs cũng sinh tại `{spec_source}/.living-docs/`.
|
|
96
|
+
- **Routing:** context-loader đọc `@trace.domain` từ PRD → tra trong `services` config → route BDD/code vào đúng service submodule. PRD phải có `@trace.domain` khớp một key trong `services`.
|
|
97
|
+
|
|
98
|
+
Setup umbrella đầy đủ, file ownership, two-layer commit, multi-platform → [Operations › Sync & Update §4 Umbrella mode](../04-operations/sync-and-update.md#4-umbrella-mode--git-submodule).
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
Sẵn sàng chạy? → [quickstart.md](quickstart.md).
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › [Getting Started](README.md) › Installation
|
|
2
|
+
|
|
3
|
+
# Installation
|
|
4
|
+
|
|
5
|
+
Cài đặt framework vào project và (tùy chọn) VS Code extension.
|
|
6
|
+
|
|
7
|
+
## Mục lục
|
|
8
|
+
|
|
9
|
+
- [Prerequisites](#prerequisites)
|
|
10
|
+
- [Cài framework](#cài-framework)
|
|
11
|
+
- [Kiểm tra cài đặt](#kiểm-tra-cài-đặt)
|
|
12
|
+
- [Upgrade](#upgrade)
|
|
13
|
+
- [QC automation stack (tùy chọn)](#qc-automation-stack-tùy-chọn)
|
|
14
|
+
- [VS Code extension (khuyến nghị)](#vs-code-extension-khuyến-nghị)
|
|
15
|
+
- [Uninstall](#uninstall)
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
| Tool | Version | Link |
|
|
20
|
+
|------|---------|------|
|
|
21
|
+
| Node.js | bất kỳ (check: `node -v`) | [nodejs.org](https://nodejs.org) |
|
|
22
|
+
| Claude Code CLI | Latest | [claude.ai/code](https://claude.ai/code) |
|
|
23
|
+
| VS Code | ≥ 1.85 | [code.visualstudio.com](https://code.visualstudio.com) |
|
|
24
|
+
| Git | bất kỳ | |
|
|
25
|
+
|
|
26
|
+
> Claude Code cần subscription (Claude Pro / Team / API key).
|
|
27
|
+
|
|
28
|
+
## Cài framework
|
|
29
|
+
|
|
30
|
+
Chạy từ **thư mục root của project**. Cách khuyến nghị là `--init` — cài framework vào `.agent/` (commit vào git, cả team dùng chung) và tạo shortcut trong `.claude/commands/`.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Single-service project:
|
|
34
|
+
npx @anhth2/spec-driven-dev-plugin --init --module java-spring
|
|
35
|
+
|
|
36
|
+
# Multi-service monorepo (cài vào từng subfolder trong 1 lệnh):
|
|
37
|
+
npx @anhth2/spec-driven-dev-plugin --init \
|
|
38
|
+
--services backend:java-spring,web-admin:react,app-mobile:flutter
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Kết quả:
|
|
42
|
+
- `.agent/` — toàn bộ framework files (commit vào git, shared với team)
|
|
43
|
+
- `.claude/commands/` — shortcut trỏ về `.agent/commands/`
|
|
44
|
+
- `.agent/FRAMEWORK_VERSION` — tracking version để upgrade
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git add .agent/ .claude/commands/
|
|
48
|
+
git commit -m "chore: init spec-driven-dev"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> **Multi-repo / umbrella?** Xem hướng dẫn umbrella setup chi tiết trong [Operations › Sync & Update §4 Umbrella mode](../04-operations/sync-and-update.md#4-umbrella-mode--git-submodule).
|
|
52
|
+
|
|
53
|
+
### Legacy install (global / per-project)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx @anhth2/spec-driven-dev-plugin # global: ~/.claude/commands/
|
|
57
|
+
npx @anhth2/spec-driven-dev-plugin --project # project: ./.claude/commands/
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Kiểm tra cài đặt
|
|
61
|
+
|
|
62
|
+
Mở Claude Code tại project, gõ `/` — bạn sẽ thấy các lệnh:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
/setup-ai-first
|
|
66
|
+
/define-product
|
|
67
|
+
/generate-prd
|
|
68
|
+
/generate-bdd
|
|
69
|
+
...
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
> Không thấy lệnh? Chạy lại lệnh cài (global lưu tại `~/.claude/commands/`, trên Windows: `ls "$env:USERPROFILE\.claude\commands\"`).
|
|
73
|
+
|
|
74
|
+
## Upgrade
|
|
75
|
+
|
|
76
|
+
Từ **trong Claude Code** (khuyến nghị — check version, xử lý umbrella mode, review diff):
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
/update-framework
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Hoặc từ terminal:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
bash scripts/upgrade.sh
|
|
86
|
+
# hoặc:
|
|
87
|
+
npx @anhth2/spec-driven-dev-plugin@latest --init
|
|
88
|
+
git diff .agent/ && git add .agent/ && git commit -m "chore: upgrade framework"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
> Chỉ upgrade framework command files. `project-context.yaml`, `CLAUDE.md`, domain-knowledge, và `.trace/` không bao giờ bị ghi đè. Để sync *content* của project (submodule code/specs) dùng `/sync`.
|
|
92
|
+
|
|
93
|
+
## QC automation stack (tùy chọn)
|
|
94
|
+
|
|
95
|
+
Bộ QC suite chính thức (`/qc-*`) là **native** trong framework. Hai lệnh cuối — `/qc-run-test` và `/qc-report` — dùng stack module **`qc-playwright`**, **độc lập với dev module**. Cài riêng:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# 1. Python 3 + pytest-playwright
|
|
99
|
+
pip install pytest-playwright
|
|
100
|
+
|
|
101
|
+
# 2. Cài browsers
|
|
102
|
+
python3 -m playwright install
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`qc-playwright` = Python + pytest-playwright + Page Object (output: Playwright Trace + pytest-html). Chi tiết pipeline: [../02-guides/qc-automation.md](../02-guides/qc-automation.md).
|
|
106
|
+
|
|
107
|
+
## VS Code extension (khuyến nghị)
|
|
108
|
+
|
|
109
|
+
**Spec Driven Dev** là VS Code extension với 2 panels. Không bắt buộc nhưng khuyến nghị. VS Code tự cập nhật khi có version mới.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
code --install-extension edupia-team.spec-driven-dev-team
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Hoặc: `Ctrl+Shift+P` → **"Extensions: Install from Marketplace"** → search **Spec Driven Dev**.
|
|
116
|
+
|
|
117
|
+
### Panel 1 — Review Board
|
|
118
|
+
|
|
119
|
+
Đọc `*-findings.yaml` từ `.agent/review/` — hỗ trợ findings từ mọi review command (`/refine-prd`, `/review-context`, `/review-tech-docs`).
|
|
120
|
+
|
|
121
|
+
- Lens tabs: All / QA / DEV / SA / PO hoặc PRD / BDD / TECH.
|
|
122
|
+
- Mỗi finding có badge `⚡ auto-fix` / `👤 human`.
|
|
123
|
+
- 4 actions: Accept · Modify (có note) · Defer · Reject — kèm progress bar, full-text search.
|
|
124
|
+
- **Smart Apply** spawn terminal chạy đúng lệnh `--resume`.
|
|
125
|
+
|
|
126
|
+
Mở Review Board: sidebar panel (Activity Bar), hoặc right-click file `*-findings.yaml` → "Open Review Board", hoặc Command Palette. Nếu panel trống: file phải có đuôi `-findings.yaml`, nằm trong `.agent/review/`, và đóng hẳn rồi mở lại VS Code.
|
|
127
|
+
|
|
128
|
+
### Panel 2 — Living Documentation
|
|
129
|
+
|
|
130
|
+
Đọc `.trace/*.tsv` — dashboard traceability health toàn project.
|
|
131
|
+
|
|
132
|
+
- Stat cards: PRDs, Use Cases, Scenarios, Code Cov%, Test Cov%, Drift, Gap.
|
|
133
|
+
- Drill-down: PRD → UC → per-scenario table (Spec ver, Gen ver, Code, Tests, `dev_selftest`, `qc_status`, Status).
|
|
134
|
+
- Status badges: ✅ OK · ⚠️ DRIFT · 🔴 GAP · — UNTRACKED. Filter + search + live reload.
|
|
135
|
+
|
|
136
|
+
Mở: `Ctrl+Shift+P` → **"Spec Driven Dev: Open Living Documentation"**. Mở được cả ở umbrella root lẫn trong một service submodule riêng lẻ. Nếu trống, chạy `/generate-bdd` cho ≥1 feature để tạo file `.trace/{UC-ID}.tsv` đầu tiên.
|
|
137
|
+
|
|
138
|
+
> Report canonical sinh vào spec module tại `{spec_source}/.living-docs/` (gitignored); bản mirror cục bộ ở `./.trace`. Chi tiết traceability: [core-concepts.md](core-concepts.md) và [../03-concepts/traceability.md](../03-concepts/traceability.md).
|
|
139
|
+
|
|
140
|
+
## Uninstall
|
|
141
|
+
|
|
142
|
+
**Mac/Linux:**
|
|
143
|
+
```bash
|
|
144
|
+
rm -rf .agent/ .claude/commands/
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Windows (PowerShell):**
|
|
148
|
+
```powershell
|
|
149
|
+
Remove-Item -Recurse -Force .agent, .claude\commands
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
Cài xong? → [quickstart.md](quickstart.md) để chạy feature đầu tiên.
|