@edupia-tutor/spec-driven-docs 0.14.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/bin/build.js +230 -0
- package/bin/index.js +598 -0
- package/commands/debug.md +830 -0
- package/commands/debug.tmpl +257 -0
- package/commands/define-product.md +652 -0
- package/commands/define-product.tmpl +158 -0
- package/commands/dev-gen-test.md +1010 -0
- package/commands/dev-gen-test.tmpl +490 -0
- package/commands/dev-run-test.md +744 -0
- package/commands/dev-run-test.tmpl +224 -0
- package/commands/dev-smoke-test.md +711 -0
- package/commands/dev-smoke-test.tmpl +217 -0
- package/commands/fix-bug.md +744 -0
- package/commands/fix-bug.tmpl +171 -0
- package/commands/generate-bdd.md +1054 -0
- package/commands/generate-bdd.tmpl +534 -0
- package/commands/generate-code.md +869 -0
- package/commands/generate-code.tmpl +349 -0
- package/commands/generate-design-spec.md +958 -0
- package/commands/generate-design-spec.tmpl +464 -0
- package/commands/generate-prd.md +748 -0
- package/commands/generate-prd.tmpl +254 -0
- package/commands/generate-spec-manifest.md +658 -0
- package/commands/generate-spec-manifest.tmpl +164 -0
- package/commands/generate-tech-docs.md +849 -0
- package/commands/generate-tech-docs.tmpl +355 -0
- package/commands/learn.md +636 -0
- package/commands/learn.tmpl +63 -0
- package/commands/map-testids.md +575 -0
- package/commands/map-testids.tmpl +81 -0
- package/commands/propose-scenario.md +623 -0
- package/commands/propose-scenario.tmpl +129 -0
- package/commands/qc-analyze.md +580 -0
- package/commands/qc-analyze.tmpl +86 -0
- package/commands/qc-design-test.md +562 -0
- package/commands/qc-design-test.tmpl +68 -0
- package/commands/qc-plan.md +543 -0
- package/commands/qc-plan.tmpl +49 -0
- package/commands/qc-report.md +554 -0
- package/commands/qc-report.tmpl +60 -0
- package/commands/qc-review.md +547 -0
- package/commands/qc-review.tmpl +53 -0
- package/commands/qc-run-test.md +604 -0
- package/commands/qc-run-test.tmpl +84 -0
- package/commands/refine-prd.md +772 -0
- package/commands/refine-prd.tmpl +140 -0
- package/commands/report-bug.md +639 -0
- package/commands/report-bug.tmpl +145 -0
- package/commands/review-code.md +677 -0
- package/commands/review-code.tmpl +104 -0
- package/commands/review-context.md +1047 -0
- package/commands/review-context.tmpl +415 -0
- package/commands/review-tech-docs.md +811 -0
- package/commands/review-tech-docs.tmpl +317 -0
- package/commands/setup-ai-first.md +545 -0
- package/commands/setup-ai-first.tmpl +358 -0
- package/commands/sync.md +451 -0
- package/commands/sync.tmpl +351 -0
- package/commands/update-framework.md +251 -0
- package/commands/update-framework.tmpl +151 -0
- package/commands/validate-traces.md +842 -0
- package/commands/validate-traces.tmpl +348 -0
- package/core/FRAMEWORK_VERSION +1 -0
- package/core/commands/debug.md +830 -0
- package/core/commands/define-product.md +652 -0
- package/core/commands/dev-gen-test.md +1010 -0
- package/core/commands/dev-run-test.md +744 -0
- package/core/commands/dev-smoke-test.md +711 -0
- package/core/commands/fix-bug.md +744 -0
- package/core/commands/generate-bdd.md +1054 -0
- package/core/commands/generate-code.md +869 -0
- package/core/commands/generate-design-spec.md +958 -0
- package/core/commands/generate-prd.md +748 -0
- package/core/commands/generate-spec-manifest.md +658 -0
- package/core/commands/generate-tech-docs.md +849 -0
- package/core/commands/learn.md +636 -0
- package/core/commands/map-testids.md +575 -0
- package/core/commands/propose-scenario.md +623 -0
- package/core/commands/qc-analyze.md +580 -0
- package/core/commands/qc-design-test.md +562 -0
- package/core/commands/qc-plan.md +543 -0
- package/core/commands/qc-report.md +554 -0
- package/core/commands/qc-review.md +547 -0
- package/core/commands/qc-run-test.md +604 -0
- package/core/commands/refine-prd.md +772 -0
- package/core/commands/report-bug.md +639 -0
- package/core/commands/review-code.md +677 -0
- package/core/commands/review-context.md +1047 -0
- package/core/commands/review-tech-docs.md +811 -0
- package/core/commands/setup-ai-first.md +545 -0
- package/core/commands/sync.md +451 -0
- package/core/commands/update-framework.md +251 -0
- package/core/commands/validate-traces.md +842 -0
- package/core/hooks/data-guard.js +141 -0
- package/core/hooks/settings.json +18 -0
- package/core/modules/android-compose/module.yaml +13 -0
- package/core/modules/android-compose/stack-profile.yaml +57 -0
- package/core/modules/angular/architecture-snippets/component-patterns.md +187 -0
- package/core/modules/angular/module.yaml +6 -0
- package/core/modules/angular/stack-profile.yaml +38 -0
- package/core/modules/context-engineering/architecture-snippets/context-design.md +119 -0
- package/core/modules/context-engineering/module.yaml +9 -0
- package/core/modules/context-engineering/stack-profile.yaml +61 -0
- package/core/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
- package/core/modules/dotnet/module.yaml +6 -0
- package/core/modules/dotnet/stack-profile.yaml +50 -0
- package/core/modules/flutter/module.yaml +14 -0
- package/core/modules/flutter/stack-profile.yaml +59 -0
- package/core/modules/golang/architecture-snippets/domain-layout.md +283 -0
- package/core/modules/golang/module.yaml +6 -0
- package/core/modules/golang/stack-profile.yaml +40 -0
- package/core/modules/ios-swiftui/module.yaml +13 -0
- package/core/modules/ios-swiftui/stack-profile.yaml +55 -0
- package/core/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
- package/core/modules/java-spring/module.yaml +15 -0
- package/core/modules/java-spring/stack-profile.yaml +28 -0
- package/core/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
- package/core/modules/nextjs/module.yaml +14 -0
- package/core/modules/nextjs/stack-profile.yaml +74 -0
- package/core/modules/nuxt/module.yaml +14 -0
- package/core/modules/nuxt/stack-profile.yaml +58 -0
- package/core/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
- package/core/modules/php-laravel/module.yaml +15 -0
- package/core/modules/php-laravel/stack-profile.yaml +56 -0
- package/core/modules/qc-playwright/stack-profile.yaml +66 -0
- package/core/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
- package/core/modules/react/module.yaml +14 -0
- package/core/modules/react/stack-profile.yaml +63 -0
- package/core/modules/react-native/module.yaml +14 -0
- package/core/modules/react-native/stack-profile.yaml +56 -0
- package/core/modules/vue/module.yaml +14 -0
- package/core/modules/vue/stack-profile.yaml +65 -0
- package/core/rules/data-protection.md +80 -0
- package/core/rules/workflow.md +44 -0
- package/core/skills/code/SKILL.md +770 -0
- package/core/skills/debug/SKILL.md +869 -0
- package/core/skills/design-spec/SKILL.md +589 -0
- package/core/skills/discovery/SKILL.md +554 -0
- package/core/skills/prd/SKILL.md +562 -0
- package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/core/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
- package/core/skills/qc/qa-analyst/business-rules.md +59 -0
- package/core/skills/qc/qa-analyst/data-flow.md +64 -0
- package/core/skills/qc/qa-analyst/spec-breakdown.md +61 -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 +216 -0
- package/core/skills/spec/SKILL.md +461 -0
- package/core/skills/test/SKILL.md +1297 -0
- package/core/steps/capture-lesson.md +79 -0
- package/core/steps/context-loader.md +307 -0
- package/core/steps/gate.md +87 -0
- package/core/steps/report-footer.md +100 -0
- package/core/steps/review-fanout.md +138 -0
- package/core/steps/spawn-agent.md +124 -0
- package/core/steps/trace-mirror.md +26 -0
- package/core/templates/architecture.template.md +113 -0
- package/core/templates/design-spec.template.md +217 -0
- package/core/templates/feature.template +259 -0
- package/core/templates/platform-guide.template.md +145 -0
- package/core/templates/prd.template.md +327 -0
- package/core/templates/product-definition.template.md +168 -0
- package/core/templates/project-context.yaml +161 -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 +156 -0
- package/docs/01-getting-started/quickstart.md +85 -0
- package/docs/02-guides/README.md +26 -0
- package/docs/02-guides/developer/README.md +46 -0
- package/docs/02-guides/developer/bdd-and-trace.md +125 -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 +460 -0
- package/docs/02-guides/developer/workflow.md +121 -0
- package/docs/02-guides/product-owner/README.md +79 -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 +436 -0
- package/docs/02-guides/tester/README.md +75 -0
- package/docs/02-guides/tester/bug-reporting.md +117 -0
- package/docs/02-guides/tester/qc-automation.md +165 -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 +130 -0
- package/docs/02-guides/tester/test-checklist.md +31 -0
- package/docs/02-guides/tester/workflow.md +77 -0
- package/docs/03-concepts/README.md +19 -0
- package/docs/03-concepts/architecture.md +248 -0
- package/docs/03-concepts/pipeline.md +274 -0
- package/docs/03-concepts/traceability.md +149 -0
- package/docs/04-operations/README.md +33 -0
- package/docs/04-operations/bug-flow.md +362 -0
- package/docs/04-operations/publishing.md +137 -0
- package/docs/04-operations/sync-and-update.md +522 -0
- package/docs/05-reference/README.md +32 -0
- package/docs/05-reference/command-cheatsheet.md +147 -0
- package/docs/05-reference/commands.md +232 -0
- package/docs/05-reference/modules.md +110 -0
- package/docs/05-reference/trace-schema.md +153 -0
- package/docs/README.md +49 -0
- package/hooks/data-guard.js +141 -0
- package/hooks/settings.json +18 -0
- package/modules/android-compose/module.yaml +13 -0
- package/modules/android-compose/stack-profile.yaml +57 -0
- package/modules/angular/architecture-snippets/component-patterns.md +187 -0
- package/modules/angular/module.yaml +6 -0
- package/modules/angular/stack-profile.yaml +38 -0
- package/modules/context-engineering/architecture-snippets/context-design.md +119 -0
- package/modules/context-engineering/module.yaml +9 -0
- package/modules/context-engineering/stack-profile.yaml +61 -0
- package/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
- package/modules/dotnet/module.yaml +6 -0
- package/modules/dotnet/stack-profile.yaml +50 -0
- package/modules/flutter/module.yaml +14 -0
- package/modules/flutter/stack-profile.yaml +59 -0
- package/modules/golang/architecture-snippets/domain-layout.md +283 -0
- package/modules/golang/module.yaml +6 -0
- package/modules/golang/stack-profile.yaml +40 -0
- package/modules/ios-swiftui/module.yaml +13 -0
- package/modules/ios-swiftui/stack-profile.yaml +55 -0
- package/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
- package/modules/java-spring/module.yaml +15 -0
- package/modules/java-spring/stack-profile.yaml +28 -0
- package/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
- package/modules/nextjs/module.yaml +14 -0
- package/modules/nextjs/stack-profile.yaml +74 -0
- package/modules/nuxt/module.yaml +14 -0
- package/modules/nuxt/stack-profile.yaml +58 -0
- package/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
- package/modules/php-laravel/module.yaml +15 -0
- package/modules/php-laravel/stack-profile.yaml +56 -0
- package/modules/qc-playwright/stack-profile.yaml +66 -0
- package/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
- package/modules/react/module.yaml +14 -0
- package/modules/react/stack-profile.yaml +63 -0
- package/modules/react-native/module.yaml +14 -0
- package/modules/react-native/stack-profile.yaml +56 -0
- package/modules/vue/module.yaml +14 -0
- package/modules/vue/stack-profile.yaml +65 -0
- package/package.json +49 -0
- package/rules/data-protection.md +80 -0
- package/rules/workflow.md +44 -0
- package/scripts/init.sh +49 -0
- package/scripts/migrate-specs.js +256 -0
- package/scripts/upgrade.sh +94 -0
- package/skills/code/SKILL.md +770 -0
- package/skills/code/SKILL.tmpl +176 -0
- package/skills/debug/SKILL.md +869 -0
- package/skills/debug/SKILL.tmpl +262 -0
- package/skills/design-spec/SKILL.md +589 -0
- package/skills/design-spec/SKILL.tmpl +95 -0
- package/skills/discovery/SKILL.md +554 -0
- package/skills/discovery/SKILL.tmpl +147 -0
- package/skills/prd/SKILL.md +562 -0
- package/skills/prd/SKILL.tmpl +188 -0
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
- package/skills/qc/qa-analyst/business-rules.md +59 -0
- package/skills/qc/qa-analyst/data-flow.md +64 -0
- package/skills/qc/qa-analyst/spec-breakdown.md +61 -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 +216 -0
- package/skills/setup-ai-first/SKILL.tmpl +116 -0
- package/skills/spec/SKILL.md +461 -0
- package/skills/spec/SKILL.tmpl +174 -0
- package/skills/test/SKILL.md +1297 -0
- package/skills/test/SKILL.tmpl +296 -0
- package/steps/capture-lesson.md +79 -0
- package/steps/context-loader.md +307 -0
- package/steps/gate.md +87 -0
- package/steps/report-footer.md +100 -0
- package/steps/review-fanout.md +138 -0
- package/steps/spawn-agent.md +124 -0
- package/steps/trace-mirror.md +26 -0
- package/templates/architecture.template.md +113 -0
- package/templates/design-spec.template.md +217 -0
- package/templates/feature.template +259 -0
- package/templates/platform-guide.template.md +145 -0
- package/templates/prd.template.md +327 -0
- package/templates/product-definition.template.md +168 -0
- package/templates/project-context.yaml +161 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Checklist Test Pass
|
|
2
|
+
|
|
3
|
+
# Checklist Trước Khi Báo "test pass"
|
|
4
|
+
|
|
5
|
+
**Spec & coverage:**
|
|
6
|
+
- [ ] Tất cả BDD scenarios đã được cover (happy path + edge + error)
|
|
7
|
+
- [ ] Mọi AC trong PRD đã được verify
|
|
8
|
+
- [ ] Manifest version khớp với PRD version đang deploy
|
|
9
|
+
- [ ] Không có scenarios bị skip mà không có lý do ghi chú
|
|
10
|
+
|
|
11
|
+
**Môi trường:**
|
|
12
|
+
- [ ] Test đã chạy trên đúng môi trường (staging, không phải local dev)
|
|
13
|
+
- [ ] Cross-service flows đã được verify (nếu feature span nhiều service)
|
|
14
|
+
|
|
15
|
+
**TSV & Living Docs:**
|
|
16
|
+
- [ ] `/qc-run-test` đã chạy → `qc_status` đã ghi vào `{spec_source}/.trace/{UC-ID}.tsv` (spec repo — một chỗ)
|
|
17
|
+
- [ ] TSV đã được commit vào **spec repo** (1 tầng, giống `feedback/`) + push — KHÔNG commit vào service submodule
|
|
18
|
+
- [ ] `/validate-traces` (hoặc `/sync`) đã chạy → Living Docs panel hiển thị `qc_status: pass`
|
|
19
|
+
- [ ] Không còn scenario nào `qc_status: not_run` trong UC đang test
|
|
20
|
+
- [ ] Nếu có `qc_status: fail` → đã `/report-bug` kèm path evidence (`reports/<feature>/report.html`)
|
|
21
|
+
|
|
22
|
+
## Xem Thêm
|
|
23
|
+
|
|
24
|
+
- [Guide › QC Automation](qc-automation.md) — pipeline `/qc-*` chi tiết, `qc_status`, stack `qc-playwright`
|
|
25
|
+
- [Operations › Bug Flow](../../04-operations/bug-flow.md) — flow phối hợp Tester ↔ Dev ↔ PO
|
|
26
|
+
- [Concepts › Traceability](../../03-concepts/traceability.md) — trace TSV, dev_selftest vs qc_status
|
|
27
|
+
- [Reference › Commands](../../05-reference/commands.md) — danh mục đầy đủ mọi command
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
← [Báo cáo bug](bug-reporting.md)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
[📚 Docs](../../README.md) › [Guides](../README.md) › [Tester](README.md) › Workflow
|
|
2
|
+
|
|
3
|
+
# Workflow Cơ Bản
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
Nhận task: "Test FT-042 — Checkout flow"
|
|
7
|
+
│
|
|
8
|
+
▼
|
|
9
|
+
git pull && git submodule update --remote --recursive
|
|
10
|
+
│
|
|
11
|
+
▼
|
|
12
|
+
/generate-spec-manifest
|
|
13
|
+
→ spec-manifest.yaml được refresh
|
|
14
|
+
│
|
|
15
|
+
▼
|
|
16
|
+
Lookup FT-042 trong spec-manifest.yaml
|
|
17
|
+
→ status: approved? ✅ (nếu draft → dừng, báo PO)
|
|
18
|
+
→ ghi lại paths (tất cả đều nằm trong submodule):
|
|
19
|
+
prd: {spec_source}/specs/{domain}/{prd-slug}/prd.md
|
|
20
|
+
bdd.system: {spec_source}/specs/{domain}/{prd-slug}/bdd/system/FT-042-*.feature
|
|
21
|
+
bdd.web: {spec_source}/specs/{domain}/{prd-slug}/bdd/web/FT-042-*.feature
|
|
22
|
+
tech_docs.be: {spec_source}/specs/{domain}/{prd-slug}/tech-docs/FT-042-*.md
|
|
23
|
+
tech_docs.fe: {spec_source}/specs/{domain}/{prd-slug}/tech-docs/FT-042-*-tech-design-web.md
|
|
24
|
+
│
|
|
25
|
+
▼
|
|
26
|
+
Đọc PRD tại path manifest.prd
|
|
27
|
+
→ file nằm trong SPEC submodule (shared — PO viết)
|
|
28
|
+
→ hiểu AC, UC, BR — đây là "ground truth"
|
|
29
|
+
│
|
|
30
|
+
▼
|
|
31
|
+
Đọc BDD tại path manifest.bdd.be / bdd.web
|
|
32
|
+
→ file nằm trong SPEC submodule (PO gen từ PRD — tất cả BDD web/app/system ở spec repo)
|
|
33
|
+
→ mỗi Scenario = 1 test case cần cover
|
|
34
|
+
→ BE có BDD riêng (system/), Web có BDD riêng (web/), App có BDD riêng (app/)
|
|
35
|
+
│
|
|
36
|
+
▼
|
|
37
|
+
Đọc Tech Docs tại path manifest.tech_docs.be / tech_docs.web
|
|
38
|
+
→ file nằm trong SPEC submodule (shared — Dev gen, SA sign-off)
|
|
39
|
+
→ BE: API endpoints, request/response schema, error codes
|
|
40
|
+
→ Web: screen flow, component states
|
|
41
|
+
│
|
|
42
|
+
▼
|
|
43
|
+
Chạy QC automation pipeline (6 bước — ghi kết quả chính thức vào TSV)
|
|
44
|
+
│
|
|
45
|
+
├─ /qc-analyze {UC-ID} → 2 file: REQUIREMENT_ANALYSIS.md + DOC_GAPS.md
|
|
46
|
+
├─ /qc-plan {UC-ID} → TEST_PLAN.md (risk + plan + questions-for-dev)
|
|
47
|
+
├─ /qc-design-test {UC-ID} → test-cases/*.Test.md
|
|
48
|
+
│ ⌙ artifact phân tích/thiết kế → {qc_dir}/{UC-ID}/ (mặc định docs/, VISIBLE)
|
|
49
|
+
├─ /qc-review {UC-ID} → review test design trước khi chạy
|
|
50
|
+
├─ /qc-run-test {UC-ID} → sinh + chạy pytest-playwright
|
|
51
|
+
│ → ghi qc_status (pass/fail/skip) per scenario
|
|
52
|
+
│ → vào {spec_source}/.trace/{domain}/{prd-slug}/{UC-ID}.tsv ← AUTHORITATIVE (spec repo)
|
|
53
|
+
└─ /qc-report {UC-ID} → report pytest-html + Playwright trace evidence
|
|
54
|
+
→ reports/<feature>/report.html ← LOCAL, gitignored
|
|
55
|
+
│
|
|
56
|
+
▼
|
|
57
|
+
Commit TSV vào spec repo (1 tầng — trace dồn về specs, giống feedback/)
|
|
58
|
+
cd {spec_source}
|
|
59
|
+
git add .trace/{domain}/{prd-slug}/{UC-ID}.tsv
|
|
60
|
+
git commit -m "qc: record qc_status for {UC-ID} — pass/fail"
|
|
61
|
+
git push
|
|
62
|
+
│
|
|
63
|
+
▼
|
|
64
|
+
/validate-traces (hoặc /sync)
|
|
65
|
+
→ đọc {spec_source}/.trace/ (một chỗ) → Living Docs cập nhật cột qc_status
|
|
66
|
+
│
|
|
67
|
+
▼
|
|
68
|
+
Kết quả:
|
|
69
|
+
qc_status: pass → done, Living Docs phản ánh coverage chính thức
|
|
70
|
+
qc_status: fail → /report-bug với BDD scenario + AC bị vi phạm
|
|
71
|
+
đính kèm path evidence: reports/<feature>/report.html
|
|
72
|
+
(evidence local — share file hoặc upload riêng nếu cần)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
← [Spec Manifest & Setup](spec-manifest.md) · Tiếp theo: [Đọc Spec Chain](reading-specs.md)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › Concepts
|
|
2
|
+
|
|
3
|
+
# Concepts
|
|
4
|
+
|
|
5
|
+
Hiểu **cách framework được xây dựng và vận hành** — kiến trúc nhiều lớp, pipeline các phase, và hệ thống traceability. Đọc section này khi bạn muốn biết *vì sao* mọi thứ hoạt động như vậy, không chỉ *cách dùng* lệnh.
|
|
6
|
+
|
|
7
|
+
## Mục lục (this section)
|
|
8
|
+
|
|
9
|
+
- [architecture.md](architecture.md) — 6 lớp (Protection → Output), module plug-in system, build pipeline (`*.tmpl` → `*.md` → `core/`), directory map, sub-agent orchestration, hook data-protection.
|
|
10
|
+
- [pipeline.md](pipeline.md) — các phase Discovery → PRD → Design-Spec → BDD → Tech-Docs → Code → Dev self-check → QC automation → Tester feedback; review gates; và step-architecture model (gate / context-loader / spawn-agent / report-footer) đằng sau mỗi command.
|
|
11
|
+
- [traceability.md](traceability.md) — `@trace.*` tags, trace TSV, hai tín hiệu `dev_selftest` vs `qc_status`, Living Docs (canonical trong spec-module + panel mirror), và `/validate-traces`.
|
|
12
|
+
|
|
13
|
+
## Đọc gì trước?
|
|
14
|
+
|
|
15
|
+
1. Muốn cái nhìn tổng thể? → [architecture.md](architecture.md) — file "đọc trước khi đọc bất kỳ file chi tiết nào".
|
|
16
|
+
2. Muốn hiểu luồng làm việc end-to-end? → [pipeline.md](pipeline.md).
|
|
17
|
+
3. Muốn hiểu coverage / drift / Living Docs? → [traceability.md](traceability.md).
|
|
18
|
+
|
|
19
|
+
> Tra cứu chi tiết schema và module thì sang [05 · Reference](../05-reference/) — [trace-schema.md](../05-reference/trace-schema.md) và [modules.md](../05-reference/modules.md).
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › [Concepts](README.md) › Architecture
|
|
2
|
+
|
|
3
|
+
# Architecture
|
|
4
|
+
|
|
5
|
+
> **Nguyên tắc**: Đọc file này để hiểu toàn bộ framework trước khi đọc bất kỳ file chi tiết nào.
|
|
6
|
+
|
|
7
|
+
Cách framework được xây dựng: 6 lớp runtime, build pipeline `*.tmpl → *.md → core/`, module plug-in system, hook data-protection, và sub-agent orchestration.
|
|
8
|
+
|
|
9
|
+
## Mục lục
|
|
10
|
+
|
|
11
|
+
- [Layer diagram (L0 → L5)](#layer-diagram-l0--l5)
|
|
12
|
+
- [Data flow — một command chạy như thế nào](#data-flow--một-command-chạy-như-thế-nào)
|
|
13
|
+
- [Build system](#build-system)
|
|
14
|
+
- [Module plug-in system](#module-plug-in-system)
|
|
15
|
+
- [Hook system — data protection](#hook-system--data-protection)
|
|
16
|
+
- [Sub-agent orchestration](#sub-agent-orchestration)
|
|
17
|
+
- [Directory map](#directory-map)
|
|
18
|
+
- [Maintenance guide](#maintenance-guide)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Layer diagram (L0 → L5)
|
|
23
|
+
|
|
24
|
+
Mỗi command chạy qua 6 lớp, từ bảo vệ dữ liệu đến sinh artifact:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
LAYER 0 — PROTECTION (luôn chạy trước)
|
|
28
|
+
hooks/data-guard.js → PreToolUse hook: chặn đọc file nhạy cảm
|
|
29
|
+
rules/data-protection.md → quy tắc declarative cho AI agent
|
|
30
|
+
│ safe ↓ blocked → ✋ STOP
|
|
31
|
+
LAYER 1 — ENTRY POINT (user trigger)
|
|
32
|
+
commands/*.tmpl (slash commands: /generate-bdd, /generate-code, …)
|
|
33
|
+
skills/*/SKILL.tmpl (auto-trigger theo description match)
|
|
34
|
+
│ cả hai build bởi bin/build.js
|
|
35
|
+
LAYER 2 — SHARED STEPS (DRY, injected)
|
|
36
|
+
steps/gate.md → resolve target file + CHECKPOINT
|
|
37
|
+
steps/context-loader.md → load project config + rules
|
|
38
|
+
steps/report-footer.md → standard output format
|
|
39
|
+
Injected ở build time qua {{include:steps/X.md}} (*.tmpl → *.md, gitignored)
|
|
40
|
+
│ context loaded
|
|
41
|
+
LAYER 3 — PROJECT CONTEXT (đọc từ consumer project)
|
|
42
|
+
.agent/project-context.yaml → paths, tech_stack, domains
|
|
43
|
+
CLAUDE.md (root) → umbrella-wide shared rules (base layer)
|
|
44
|
+
{service_root}/CLAUDE.md → service architecture + coding standards (overlay, wins)
|
|
45
|
+
rules/data-protection.md → AI không được đọc gì
|
|
46
|
+
.agent/modules/{stack}/ → stack rules (plug-in, optional)
|
|
47
|
+
│ context-aware
|
|
48
|
+
LAYER 4 — EXECUTION (command logic)
|
|
49
|
+
Discovery /define-product
|
|
50
|
+
PRD / BDD /generate-prd · /refine-prd · /generate-bdd · /generate-tech-docs
|
|
51
|
+
Code /generate-code · /review-code
|
|
52
|
+
Dev check /dev-gen-test · /dev-run-test · /dev-smoke-test → set dev_selftest
|
|
53
|
+
QC suite /qc-analyze → /qc-plan → /qc-design-test → /qc-review →
|
|
54
|
+
/qc-run-test → /qc-report → set qc_status
|
|
55
|
+
Trace/Debug /validate-traces · /fix-bug · /debug
|
|
56
|
+
│
|
|
57
|
+
LAYER 5 — OUTPUT (artifacts in consumer proj)
|
|
58
|
+
Spec module (cross-team, via {spec_source}):
|
|
59
|
+
specs/product-definition/
|
|
60
|
+
specs/{domain}/{prd-slug}/ — feature package gom mọi artifact của một PRD:
|
|
61
|
+
prd.md · bdd/ (web/app/system) · tech-docs/ (API contract + FE tech-design) · design-spec/
|
|
62
|
+
feedback/
|
|
63
|
+
.trace/{domain}/{prd-slug}/*.tsv (authoritative, committed — một chỗ cho PM) · .living-docs/ (gitignored)
|
|
64
|
+
Service submodule (per-service):
|
|
65
|
+
src/ (chỉ code) · .agent/review/
|
|
66
|
+
QC automation outputs:
|
|
67
|
+
QC test cases / scripts (Python pytest-playwright, Page Object)
|
|
68
|
+
→ QC analysis / test-cases ghi vào {qc_dir}/{UC-ID}/ (mặc định docs/,
|
|
69
|
+
visible — KHÔNG nằm trong .agent/)
|
|
70
|
+
→ guides per-layer ở skills/qc/<stage>/ · qc_status trong .trace/*.tsv
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> **Dev self-check vs QC chính thức:** `/dev-*` set `dev_selftest` (smoke, dev tự kiểm code của mình); 6 lệnh `/qc-*` là QC automation pipeline CHÍNH THỨC (port từ agent của team QC; QC repo nay chỉ còn reference) → set `qc_status`. Hai tín hiệu **orthogonal**, cả hai surface trong Living Docs. Chi tiết: [traceability.md](traceability.md).
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Data flow — một command chạy như thế nào
|
|
78
|
+
|
|
79
|
+
Ví dụ `/generate-bdd specs/payment/process-payment/prd.md`:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
User types: /generate-bdd specs/payment/process-payment/prd.md
|
|
83
|
+
│
|
|
84
|
+
[L0] data-guard.js check tool calls real-time → đọc .env/*.key → BLOCK + warn
|
|
85
|
+
│
|
|
86
|
+
[L1] commands/generate-bdd.md (assembled từ .tmpl + injected steps) được Claude đọc
|
|
87
|
+
│
|
|
88
|
+
[L2] gate.md → resolve file path từ $ARGUMENTS
|
|
89
|
+
context-loader.md → đọc project-context.yaml, CLAUDE.md,
|
|
90
|
+
rules/data-protection.md, modules/{stack}/stack-profile.yaml
|
|
91
|
+
│
|
|
92
|
+
[L3] Claude biết: tech_stack, domains, architecture rules, sensitive files, stack patterns
|
|
93
|
+
│
|
|
94
|
+
[L4] generate-bdd logic: đọc PRD → extract UC/BR/AC → apply BDD rules R1–R10
|
|
95
|
+
│
|
|
96
|
+
[L5] Output: specs/payment/process-payment/bdd/PAY-01-UC1.feature
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Chi tiết về step-architecture (gate / context-loader / report-footer) và sub-agent model: xem [pipeline.md](pipeline.md#command-internals--step-architecture).
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Build system
|
|
104
|
+
|
|
105
|
+
`*.tmpl` (committed) được assemble thành `*.md` (gitignored) bởi `bin/build.js`:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Source (committed) Build output (gitignored)
|
|
109
|
+
commands/*.tmpl ──┐
|
|
110
|
+
skills/**/SKILL.tmpl ──┤ node bin/build.js → commands/*.md · skills/**/SKILL.md
|
|
111
|
+
steps/*.md (shared) ──┘
|
|
112
|
+
|
|
113
|
+
Trigger:
|
|
114
|
+
npm run build ← manual
|
|
115
|
+
prepublishOnly hook ← auto trước npm publish
|
|
116
|
+
bin/index.js install ← auto khi user chạy npx
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
> Build output cũng bao gồm `core/` — bản distributable được copy vào `.agent/` của consumer khi `--init`.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Module plug-in system
|
|
124
|
+
|
|
125
|
+
Stack module là plug-in tùy chọn: cài qua `--module`, đọc ở runtime bởi `context-loader.md`.
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
Available modules (modules/):
|
|
129
|
+
java-spring, angular, react, nextjs, vue, nuxt, dotnet, golang,
|
|
130
|
+
php-laravel, flutter, react-native, ios-swiftui, android-compose,
|
|
131
|
+
context-engineering, qc-playwright
|
|
132
|
+
|
|
133
|
+
Usage:
|
|
134
|
+
npx @edupia-tutor/spec-driven-docs --module java-spring
|
|
135
|
+
└─ copies modules/java-spring/ → consumer/.agent/modules/java-spring/
|
|
136
|
+
|
|
137
|
+
Runtime, context-loader.md đọc:
|
|
138
|
+
.agent/modules/{tech_stack.module}/stack-profile.yaml
|
|
139
|
+
.agent/modules/{tech_stack.module}/architecture-snippets/
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
> **`qc-playwright`** là stack module cho native QC pipeline (`/qc-run-test`, `/qc-report`) — Python + pytest-playwright + Page Object — **ĐỘC LẬP** với dev implementation module (java-spring / react / flutter / …). Per-layer guides ở `skills/qc/<stage>/`. Danh sách module đầy đủ: [../05-reference/modules.md](../05-reference/modules.md).
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Hook system — data protection
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
Consumer project setup:
|
|
150
|
+
.claude/settings.json ← registers hook (template)
|
|
151
|
+
hooks/data-guard.js ← copied khi install
|
|
152
|
+
|
|
153
|
+
Runtime — mỗi tool use (Read, Write, Edit, Bash):
|
|
154
|
+
data-guard.js checks:
|
|
155
|
+
.env* · *.key · *.pem · *secret* · *password* · *credential*
|
|
156
|
+
application-prod.* · appsettings.Production.*
|
|
157
|
+
│
|
|
158
|
+
safe → allow blocked → exit(2) + warn user
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Sub-agent orchestration
|
|
164
|
+
|
|
165
|
+
Khi một command quá nặng cho single context window, orchestrator spawn các sub-agent độc lập (mỗi agent có context window riêng):
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
Main session (orchestrator — lightweight, chỉ coordinate)
|
|
169
|
+
├─ spawn spec-agent ──→ /refine-prd analysis → returns findings.yaml
|
|
170
|
+
├─ spawn codegen-agent ──→ /generate-code UC1 → returns src/ changes
|
|
171
|
+
└─ spawn test-agent ──→ /dev-gen-test UC1 → returns self-check test files
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Lợi ích:** main session không bị bloat bởi large file reads · mỗi agent focus 1 task, ít hallucination · parallel cho nhiều UC.
|
|
175
|
+
|
|
176
|
+
Pattern này được hiện thực hóa qua `steps/spawn-agent.md` và tự kích hoạt cho `/generate-bdd`, `/generate-code`, `/dev-gen-test` khi PRD vượt ngưỡng phức tạp (> 3 UC hoặc > 300 dòng). Chi tiết flow + tiết kiệm context: [pipeline.md](pipeline.md#spawn-agentmd--sub-agent-orchestration).
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Directory map
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
spec-driven-docs/
|
|
184
|
+
├── docs/ ← Toàn bộ tài liệu (bắt đầu ở docs/README.md) ◀◀◀
|
|
185
|
+
│ ├── 01-getting-started/
|
|
186
|
+
│ ├── 02-guides/
|
|
187
|
+
│ ├── 03-concepts/ ← file này (architecture.md)
|
|
188
|
+
│ ├── 04-operations/
|
|
189
|
+
│ └── 05-reference/
|
|
190
|
+
├── bin/
|
|
191
|
+
│ ├── build.js ← assembles *.tmpl → *.md
|
|
192
|
+
│ └── index.js ← npm installer + hook installer
|
|
193
|
+
├── commands/
|
|
194
|
+
│ └── *.tmpl ← slash commands
|
|
195
|
+
├── hooks/
|
|
196
|
+
│ ├── data-guard.js ← PreToolUse sensitive file protection
|
|
197
|
+
│ └── settings.json ← hook registration template
|
|
198
|
+
├── modules/
|
|
199
|
+
│ └── {stack}/ ← java-spring, react, …, qc-playwright
|
|
200
|
+
│ ├── module.yaml
|
|
201
|
+
│ ├── stack-profile.yaml
|
|
202
|
+
│ └── architecture-snippets/
|
|
203
|
+
├── rules/
|
|
204
|
+
│ ├── data-protection.md ← what AI must NEVER read/write
|
|
205
|
+
│ └── workflow.md ← general AI behavior rules
|
|
206
|
+
├── skills/
|
|
207
|
+
│ ├── {name}/SKILL.tmpl ← Claude plugin skills
|
|
208
|
+
│ └── qc/<stage>/ ← per-layer QC automation guides
|
|
209
|
+
├── steps/
|
|
210
|
+
│ ├── gate.md ← shared: file resolve + checkpoint
|
|
211
|
+
│ ├── context-loader.md ← shared: load all project context
|
|
212
|
+
│ ├── spawn-agent.md ← shared: sub-agent orchestration
|
|
213
|
+
│ ├── capture-lesson.md ← shared: record a guardrail (/learn etc.)
|
|
214
|
+
│ └── report-footer.md ← shared: standard output format
|
|
215
|
+
└── templates/
|
|
216
|
+
├── project-context.yaml ← consumer project config template
|
|
217
|
+
├── architecture.template.md
|
|
218
|
+
└── platform-guide.template.md
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
> **Build output (gitignored):** `commands/*.md`, `skills/**/SKILL.md`, và `core/`. Consumer-side tester artifacts nằm trong shared spec repo tại `feedback/bug-reports/` và `feedback/bdd-proposals/`.
|
|
222
|
+
|
|
223
|
+
> **Umbrella mode — API contract (tech-docs) là cross-team artifact:** khi `setup.spec_source` được set, tech-docs LUÔN route về spec repo tại `{spec_source}/specs/{domain}/{prd-slug}/tech-docs/` (cùng feature-package với PRD / BDD / design-spec), KHÔNG per-service — để FE/App đọc contract qua spec submodule ở `/generate-code --phase=integration`. Chỉ khi không có `spec_source` thì tech-docs mới nằm per-service.
|
|
224
|
+
|
|
225
|
+
> **Living Docs / trace data location:** khi `spec_source` set, `.trace/*.tsv` **authoritative** nằm **một chỗ** ở `{spec_source}/.trace/` (committed trong spec repo — PM quản lý tập trung; mỗi scenario mang `@trace.service`). Report `trace-report.json` sinh vào `{spec_source}/.living-docs/` (gitignored) + panel mirror cục bộ `./.trace`. Chỉ khi không có `spec_source` thì `.trace` mới per-service. Chi tiết: [traceability.md](traceability.md#living-docs--canonical-trong-spec-module--panel-mirror).
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Maintenance guide
|
|
230
|
+
|
|
231
|
+
| Muốn thay đổi gì | Sửa file nào |
|
|
232
|
+
|------------------|-------------|
|
|
233
|
+
| Logic của 1 command cụ thể | `commands/{name}.tmpl` |
|
|
234
|
+
| Logic của 1 skill cụ thể | `skills/{name}/SKILL.tmpl` |
|
|
235
|
+
| Gate / checkpoint pattern | `steps/gate.md` |
|
|
236
|
+
| Context loading | `steps/context-loader.md` |
|
|
237
|
+
| Report format | `steps/report-footer.md` |
|
|
238
|
+
| Sensitive file patterns | `hooks/data-guard.js` + `rules/data-protection.md` |
|
|
239
|
+
| Stack-specific rules | `modules/{stack}/stack-profile.yaml` |
|
|
240
|
+
| QC automation rules (per-layer) | `skills/qc/<stage>/` + `modules/qc-playwright/` |
|
|
241
|
+
| Project setup template | `templates/project-context.yaml` |
|
|
242
|
+
| Build system | `bin/build.js` |
|
|
243
|
+
| Installer | `bin/index.js` |
|
|
244
|
+
|
|
245
|
+
Sau khi sửa bất kỳ `.tmpl` hoặc `steps/*.md`:
|
|
246
|
+
```bash
|
|
247
|
+
npm run build # regenerate tất cả *.md
|
|
248
|
+
```
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › [Concepts](README.md) › Pipeline
|
|
2
|
+
|
|
3
|
+
# Pipeline
|
|
4
|
+
|
|
5
|
+
Vòng đời feature đi qua các phase, mỗi transition có một **AI review gate**:
|
|
6
|
+
**Discovery → PRD → Design-Spec → BDD → Tech-Docs → Code → Dev self-check → QC automation → Tester feedback.** Phần sau mô tả từng phase và **step-architecture model** đằng sau mỗi command.
|
|
7
|
+
|
|
8
|
+
## Mục lục
|
|
9
|
+
|
|
10
|
+
- [Phase overview](#phase-overview)
|
|
11
|
+
- [Workflow chi tiết](#workflow-chi-tiết)
|
|
12
|
+
- [QC automation pipeline (Phase 5b)](#qc-automation-pipeline-phase-5b)
|
|
13
|
+
- [Command internals — step architecture](#command-internals--step-architecture)
|
|
14
|
+
- [gate.md — universal entry](#gatemd--universal-entry)
|
|
15
|
+
- [context-loader.md — context loading sequence](#context-loadermd--context-loading-sequence)
|
|
16
|
+
- [spawn-agent.md — sub-agent orchestration](#spawn-agentmd--sub-agent-orchestration)
|
|
17
|
+
- [report-footer.md — standard output format](#report-footermd--standard-output-format)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Phase overview
|
|
22
|
+
|
|
23
|
+
| Phase | Who | Commands | Output |
|
|
24
|
+
|-------|-----|----------|--------|
|
|
25
|
+
| **0. Setup** *(one-time)* | Tech Lead | `/setup-ai-first`, `/sync`, `/sync-figma-*` | Config files, submodules, component catalog |
|
|
26
|
+
| **1. Discovery** | PO + AI | `/define-product` | `specs/product-definition/{TICKET-ID}-{slug}.md` |
|
|
27
|
+
| **2. PRD** | AI → SA/PO review | `/generate-prd`, `/refine-prd`, `/review-context` | `specs/{domain}/{prd-slug}/prd.md` |
|
|
28
|
+
| **2b. Design Spec** *(FE/App only)* | AI → Designer/PO sign-off | `/generate-design-spec` | `specs/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{platform}.md` |
|
|
29
|
+
| **3. BDD Spec** | AI → SA/Dev review | `/generate-bdd`, `/review-context` | `specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature` |
|
|
30
|
+
| **4. Tech Design** *(platform-aware)* | AI → SA/Lead review | `/generate-tech-docs`, `/review-tech-docs` | BE: `specs/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md` (API contract) · FE/App: `{UC-ID}-tech-design-{platform}.md` (client design — **gated** trên System BDD + BE contract) |
|
|
31
|
+
| **5. Code** | AI → Dev review | `/generate-code` *(FE: `--phase=ui`/`--phase=integration`)*, `/review-code` | `src/...` |
|
|
32
|
+
| **6. Dev Self-Check** | Dev (own code) | `/dev-gen-test`, `/dev-run-test`, `/dev-smoke-test` | `src/test/...` — dev smoke (`dev_selftest`), tách khỏi QC suite |
|
|
33
|
+
| **6b. QC Automation** *(official QC suite)* | QC | `/qc-analyze` → `/qc-plan` → `/qc-design-test` → `/qc-review` → `/qc-run-test` → `/qc-report` | QC test designs + run results — set `qc_status` (`qc-playwright` module) |
|
|
34
|
+
| **7. Trace** | Tech Lead | `/validate-traces` | Coverage matrix + drift report |
|
|
35
|
+
| **8. Tester Feedback** | QA → PO/Dev | `/report-bug`, `/propose-scenario` → `/sync` surfaces | `{spec}/feedback/...` → bug fix / new scenario / PRD update |
|
|
36
|
+
| **Cross-cutting** | Any role | `/sync`, `/learn`, `/update-framework` | Synced repo · project guardrails · upgraded tooling |
|
|
37
|
+
|
|
38
|
+
> **PRD là platform-agnostic (Option C):** Một PRD phục vụ mọi platform — chỉ mô tả business outcome, không UI/API. FE/App: PRD → Design Spec (2b) → BDD. BE: PRD → BDD (skip 2b). Thêm platform sau không cần đổi PRD.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Workflow chi tiết
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
Phase 1: Discovery
|
|
46
|
+
/define-product ──────────→ specs/product-definition/{slug}.md
|
|
47
|
+
(7 phase Q&A: knowledge sync → feature def → user flow → clarify →
|
|
48
|
+
business rules → business logic → AC → validation matrix)
|
|
49
|
+
|
|
50
|
+
Phase 2: PRD
|
|
51
|
+
/generate-prd ────────────→ specs/{domain}/{prd-slug}/prd.md
|
|
52
|
+
/refine-prd ──────────────→ .agent/review/{prd-slug}-findings.yaml
|
|
53
|
+
[Review Board: Accept/Modify/Reject]
|
|
54
|
+
/refine-prd --resume → apply + bump version
|
|
55
|
+
/review-context {prd} ────→ .agent/review/{prd-slug}-review-context-findings.yaml
|
|
56
|
+
--fix (auto-fixable) | Review Board → --resume (apply + bump)
|
|
57
|
+
Checks: banned terms (P1) · ambiguity AC/BR (P2) · conflicts (P3) · completeness (P4)
|
|
58
|
+
✅ APPROVED → Phase 3 · ❌ NEEDS_FIX → fix + re-run
|
|
59
|
+
|
|
60
|
+
Phase 2b/3: Design Spec & BDD
|
|
61
|
+
/generate-design-spec ────→ specs/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{platform}.md
|
|
62
|
+
(FE/App only — PO supplies node-level Figma link ?node-id= per screen;
|
|
63
|
+
AI fetches each frame via Figma MCP. Screen with no readable link → ❌ Missing;
|
|
64
|
+
sign-off + /generate-bdd blocked tới khi mọi screen có link)
|
|
65
|
+
[Designer review + PO sign-off]
|
|
66
|
+
/generate-bdd ────────────→ specs/{domain}/{prd-slug}/bdd/{UC-ID}.feature
|
|
67
|
+
THỨ TỰ OUTSIDE-IN (khi có client): web → app → system
|
|
68
|
+
System BDD được TỔNG HỢP từ web+app BDD (client-facing trước → BE/system suy ra để phục vụ)
|
|
69
|
+
(project chỉ-BE, không web/app: system gen thẳng từ PRD)
|
|
70
|
+
(apply platform vocabulary: web "clicks" / mobile "taps" / backend "submits a request")
|
|
71
|
+
/review-context {feature} → .agent/review/{uc-id}-review-bdd-findings.yaml
|
|
72
|
+
Checks: PRD coverage (mỗi AC + BR bullet → ≥1 scenario) · Gherkin R1–R10 · compliance C1–C5
|
|
73
|
+
✅ APPROVED → Phase 4
|
|
74
|
+
|
|
75
|
+
Phase 4: Tech Design (platform-aware — đọc @trace.platform)
|
|
76
|
+
BE (system):
|
|
77
|
+
/generate-tech-docs {system .feature} → specs/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design.md
|
|
78
|
+
API contract: endpoints, data model, DB, caching (brownfield: reverse-document)
|
|
79
|
+
FE/App (web|app) — GATED, cần CÓ trước: System BDD + BE contract (approved):
|
|
80
|
+
/generate-tech-docs {web|app .feature} → specs/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design-{platform}.md
|
|
81
|
+
client design: components, state, API-integration map theo BE contract, routing,
|
|
82
|
+
§2b Test Selectors (test-id ổn định cho element có action → QC locate khỏi scan)
|
|
83
|
+
(thiếu System BDD hoặc BE contract → HALT, in hướng dẫn)
|
|
84
|
+
/review-tech-docs ────────→ .agent/review/{uc-id}-tech-review-findings.yaml
|
|
85
|
+
[Review Board] → --resume (apply + bump revision)
|
|
86
|
+
✅ APPROVED → Phase 5
|
|
87
|
+
|
|
88
|
+
Phase 5: Code
|
|
89
|
+
/generate-code ───────────→ src/... (@trace.implements tags)
|
|
90
|
+
FE: --phase=ui (UI + mock adapter, tester-ready)
|
|
91
|
+
mock shape: BE contract nếu có (chuẩn) → else System BDD (tạm, warn) — fixture values luôn từ System BDD
|
|
92
|
+
→ khi BE contract approved → /generate-tech-docs {web|app} (FE design, Phase 4)
|
|
93
|
+
→ --phase=integration (wire real API theo §4 của FE tech-design)
|
|
94
|
+
(component enforcement: ✅ existing / ⚠️ TODO blocked / ❌ NEW confirm)
|
|
95
|
+
/review-code ─────────────→ Report: Critical / Major / Minor → fix CRITICAL/MAJOR
|
|
96
|
+
|
|
97
|
+
Phase 5 (cont): Dev Self-Check (dev verifies their OWN code — NOT the official QC suite)
|
|
98
|
+
/dev-gen-test ────────────→ src/test/... (@trace.verifies tags)
|
|
99
|
+
/dev-run-test ────────────→ records dev_selftest (pass/fail/not_run) + dev_selftest_at in trace
|
|
100
|
+
/dev-smoke-test ──────────→ live endpoint check (optional)
|
|
101
|
+
/validate-traces {domain} → coverage matrix + drift detection
|
|
102
|
+
|
|
103
|
+
Phase 5b: QC Automation (the OFFICIAL QC suite — see below)
|
|
104
|
+
|
|
105
|
+
Phase 6: Tester / QC Feedback (QA/QC → PO/Dev, closes the loop)
|
|
106
|
+
/report-bug {UC-ID} ──────→ {spec}/feedback/bug-reports/{BUG-ID}.md (State: Open) → push
|
|
107
|
+
/propose-scenario {UC-ID} → behavior ∈ AC → {spec}/feedback/bdd-proposals/{...}.md → push
|
|
108
|
+
behavior MỚI → {spec}/feedback/prd-change-requests/{...}.md → push
|
|
109
|
+
QC nguồn: /qc-run-test FAIL & /qc-analyze DOC_GAPS cũng route vào đây
|
|
110
|
+
PO/Dev: /sync → "📥 State: Open" → /fix-bug {BUG-ID} (Open→Fixed) · add BDD · update PRD
|
|
111
|
+
QC: /qc-run-test re-verify pass → bug Closed (qc_owner/qc_blocked_by clear)
|
|
112
|
+
|
|
113
|
+
Cross-cutting (any role, anytime)
|
|
114
|
+
/sync ────────────────────→ git pull + submodules + Living Docs + surface feedback
|
|
115
|
+
/learn "AI does X, should Y" → project guardrail (loaded vào mọi command)
|
|
116
|
+
/update-framework ────────→ upgrade framework tooling từ npm
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
> **Large PRD (> 3 UC hoặc > 300 dòng):** `/generate-bdd`, `/generate-code`, `/dev-gen-test` tự chuyển sang **orchestration mode** — spawn 1 sub-agent/UC (xem [spawn-agent.md](#spawn-agentmd--sub-agent-orchestration)).
|
|
120
|
+
|
|
121
|
+
> **Phase 7 — `/validate-traces` statuses:** ✅ OK (code version khớp spec) · ⚠️ DRIFT (code gen từ PRD/BDD cũ → re-generate) · 🔴 GAP (scenario có trong spec nhưng không có code) · — UNTRACKED (scenario ghi nhận nhưng chưa code-gen). Chi tiết: [traceability.md](traceability.md).
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## QC automation pipeline (Phase 5b)
|
|
126
|
+
|
|
127
|
+
Bộ test QC **chính thức** — native pipeline, chạy như một **branch sau khi BDD được approve** (`/review-context` (BDD) APPROVED), song song / sau khi dev `/generate-code`. 6 stage tuần tự, port từ agent của team QC (QC repo nay chỉ còn reference):
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
BDD approved (specs/{domain}/{prd-slug}/bdd/*.feature)
|
|
131
|
+
▼
|
|
132
|
+
/qc-analyze → /qc-plan → /qc-design-test → /qc-review → /qc-run-test → /qc-report
|
|
133
|
+
(đọc UC/SC, phân tích) chạy test → set qc_status
|
|
134
|
+
▼ ▼
|
|
135
|
+
QC analysis + test cases .trace/*.tsv: qc_status
|
|
136
|
+
→ {qc_dir}/{UC-ID}/ (visible, mặc định docs/) (pass/fail/skip/not_run)
|
|
137
|
+
REQUIREMENT_ANALYSIS.md · DOC_GAPS.md · + qc_owner / qc_blocked_by
|
|
138
|
+
TEST_PLAN.md · test-cases/*.Test.md (skills load từ {qc_skills_dir})
|
|
139
|
+
|
|
140
|
+
── Feedback loop về spec (đóng vòng) ───────────────────────────────────
|
|
141
|
+
/qc-analyze DOC_GAPS blocker (spec sai/mơ hồ) ┐
|
|
142
|
+
/qc-run-test FAIL = product-gap ├─▶ /report-bug · /propose-scenario
|
|
143
|
+
/qc-report tổng hợp gap → in sẵn lệnh ┘ │ (cùng flow tester)
|
|
144
|
+
▼
|
|
145
|
+
feedback/ trong spec repo (State: Open)
|
|
146
|
+
→ commit+push → PO/Dev thấy qua /sync (xem bug-flow.md)
|
|
147
|
+
|
|
148
|
+
Mapping: mỗi QC test → scenario qua @trace.verifies={UC-ID}-SC{N}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- **Implementation module:** `qc-playwright` (Python + pytest-playwright + Page Object; Playwright Trace + pytest-html, KHÔNG dùng Allure). ĐỘC LẬP với dev implementation module — dùng bởi `/qc-run-test` & `/qc-report`.
|
|
152
|
+
- **Khác biệt với dev self-check:** dev self-check (`/dev-*`) → `dev_selftest` (smoke, dev tự kiểm); QC automation (`/qc-*`) → `qc_status` (coverage QC chính thức). Hai tín hiệu **orthogonal**, cả hai surface trong Living Docs → xem [traceability.md](traceability.md).
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Command internals — step architecture
|
|
157
|
+
|
|
158
|
+
Mỗi command trong `.agent/commands/` được compose từ các **step file** dùng chung trong `.agent/steps/`. Đây là nền tảng — mọi command gọi chúng theo thứ tự trước khi chạy logic riêng.
|
|
159
|
+
|
|
160
|
+
| File | Role | Called by |
|
|
161
|
+
|------|------|-----------|
|
|
162
|
+
| `gate.md` | Universal entry — model check, file resolution, context load, user checkpoint | Mọi command |
|
|
163
|
+
| `context-loader.md` | Multi-step context loading (stack → service routing → conventions → arch → safety → domain → UI → recap) | `gate.md` Step 2 |
|
|
164
|
+
| `spawn-agent.md` | Sub-agent orchestration cho PRD lớn | `generate-bdd`, `generate-code`, `dev-gen-test` |
|
|
165
|
+
| `capture-lesson.md` | Append/refine guardrail trong project lessons file | `learn`, `review-code`, `fix-bug`, `debug` |
|
|
166
|
+
| `report-footer.md` | Standard output format (status badge, artifact list, next command) | Mọi command |
|
|
167
|
+
|
|
168
|
+
### gate.md — universal entry
|
|
169
|
+
|
|
170
|
+
Mọi command bắt đầu ở đây, theo thứ tự:
|
|
171
|
+
|
|
172
|
+
| Step | What it does |
|
|
173
|
+
|------|-------------|
|
|
174
|
+
| **Step 0** | Sub-agent mode check — nếu `$ARGUMENTS` là JSON payload với `_agent_mode: true`, skip Step 1–3, dùng slim context trực tiếp |
|
|
175
|
+
| **Step 0-B** | Model check — prompt switch sang `claude-opus` cho generation phức tạp; `S` để skip |
|
|
176
|
+
| **Step 1** | Resolve target file từ `$ARGUMENTS`; nếu thiếu, liệt kê candidate và hỏi user chọn |
|
|
177
|
+
| **Step 2** | Execute `context-loader.md` — load toàn bộ project context vào working memory |
|
|
178
|
+
| **Step 3** | CHECKPOINT — hiển thị summary (target file, stack, module, domains), chờ `Y` |
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
CHECKPOINT
|
|
182
|
+
-----------
|
|
183
|
+
Target : specs/auth/FEAT-042-login/prd.md
|
|
184
|
+
Project : My App
|
|
185
|
+
Tech stack : TypeScript / React 18
|
|
186
|
+
Module : react
|
|
187
|
+
Domains : auth, profile
|
|
188
|
+
|
|
189
|
+
Proceed? (Y/N)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### context-loader.md — context loading sequence
|
|
193
|
+
|
|
194
|
+
Load toàn bộ project context vào working memory theo thứ tự ưu tiên nghiêm ngặt:
|
|
195
|
+
|
|
196
|
+
| Step | Priority | What loads |
|
|
197
|
+
|------|----------|-----------|
|
|
198
|
+
| 1 | PROJECT-CONFIG | `project-context.yaml` → stack, conventions, domains, services, paths |
|
|
199
|
+
| 1.5 | SERVICE ROUTING | *(umbrella only)* detect active domain, route `trace_dir` (+ code) tới service submodule, store `service_root`. Khi `spec_source` set: `specs_dir` (BDD) / `tech_docs_dir` / PRD / design-spec / domain-knowledge / feedback → **spec repo** (cross-team), KHÔNG per-service |
|
|
200
|
+
| 1.6 | SERVICE CONVENTIONS | *(umbrella only)* load `{service_root}/.agent/project-context.yaml` → override `test_command`, `build_command`, `paths.trace_dir` |
|
|
201
|
+
| 2 | PROJECT-CONFIG | `.agent/modules/{module}/stack-profile.yaml` → layer patterns |
|
|
202
|
+
| 3 | **CRITICAL** | `CLAUDE.md` → architecture layers, coding standards, naming |
|
|
203
|
+
| 4 | SAFETY | `.agent/rules/data-protection.md` → sensitive file patterns |
|
|
204
|
+
| 5 | DOMAIN | `business-dictionary.md` → canonical + banned terms |
|
|
205
|
+
| 6 | DOMAIN | `core-entities.md` → entity catalog |
|
|
206
|
+
| 6.7 | **GUARDRAILS** | `lessons_file` → mistakes tích lũy (via `/learn`) loaded như hard constraints |
|
|
207
|
+
| 6-B | UI COMPONENTS | `figma-components/{module}.md` → Figma name → code component + import path |
|
|
208
|
+
| 6-C | UI TOKENS | `figma-tokens.md` → design tokens |
|
|
209
|
+
| 7 | **RECAP** | `[CTX LOADED]` block — lock critical facts vào working memory |
|
|
210
|
+
|
|
211
|
+
**Anti-lost-in-middle:** critical facts (Step 3) load đầu tiên; RECAP (Step 7) restate ở cuối để fresh khi generation bắt đầu (recency effect).
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
[CTX LOADED]
|
|
215
|
+
Stack : TypeScript / React 18 / PostgreSQL
|
|
216
|
+
Layers : Controller → Facade → Service → Repository
|
|
217
|
+
Services : 2 services: web-admin(react), api-backend(java-spring)
|
|
218
|
+
Svc Root : api-backend — conventions + trace_dir loaded from service config
|
|
219
|
+
Dict : loaded — 42 canonical terms, 8 banned terms
|
|
220
|
+
Entities : loaded — User, Order, Product
|
|
221
|
+
Lessons : loaded — 6 guardrails
|
|
222
|
+
Components : loaded — web-admin (react) — 23 components mapped
|
|
223
|
+
Tokens : loaded — colors: 18, spacing: 12, typography: 6
|
|
224
|
+
Status : FULL
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Status values: `FULL` · `PARTIAL — missing: {list}` · `MINIMAL` (chỉ project-context.yaml).
|
|
228
|
+
|
|
229
|
+
### spawn-agent.md — sub-agent orchestration
|
|
230
|
+
|
|
231
|
+
Khi PRD vượt ngưỡng phức tạp, `generate-bdd`, `generate-code`, `dev-gen-test` tự chuyển từ single-session sang orchestration mode.
|
|
232
|
+
|
|
233
|
+
**Complexity thresholds:**
|
|
234
|
+
|
|
235
|
+
| Signal | Threshold | Action |
|
|
236
|
+
|--------|-----------|--------|
|
|
237
|
+
| UC count trong PRD | > 3 UC | Spawn 1 sub-agent / UC |
|
|
238
|
+
| PRD length | > 300 dòng | Spawn agents bất kể UC count |
|
|
239
|
+
|
|
240
|
+
**Orchestration flow:**
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
Main session (orchestrator)
|
|
244
|
+
├─ Step A: Build slim context JSON (stack + active_service + active_module + paths + arch summary + banned_terms)
|
|
245
|
+
├─ Step B: Scan PRD → extract UC list [{uc_id, line_start, line_end}]
|
|
246
|
+
├─ Step C: Announce plan → "Spawning N sub-agents..."
|
|
247
|
+
├─ Step D: Spawn 1 sub-agent / UC (parallel)
|
|
248
|
+
│ mỗi agent nhận: { _agent_mode: true, uc_id, target_file, uc_section, context }
|
|
249
|
+
│ mỗi agent đọc CHỈ UC section của mình (không phải full PRD)
|
|
250
|
+
└─ Step E: Collect results → merge → { uc_id, files_created, status, errors }
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Tiết kiệm context window:**
|
|
254
|
+
|
|
255
|
+
| Mode | What loads per agent |
|
|
256
|
+
|------|---------------------|
|
|
257
|
+
| Single session (≤ 3 UC) | Full context + full PRD + all UCs |
|
|
258
|
+
| Orchestrator | Slim context + UC heading list only |
|
|
259
|
+
| Each sub-agent | Slim context + **1 UC section only** |
|
|
260
|
+
|
|
261
|
+
### report-footer.md — standard output format
|
|
262
|
+
|
|
263
|
+
Mọi command kết thúc với footer này:
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
---
|
|
267
|
+
Status : ✅ Complete
|
|
268
|
+
Output Artifacts:
|
|
269
|
+
created specs/auth/FEAT-042-login/bdd/FEAT-042-UC1-login.feature (3 scenarios)
|
|
270
|
+
updated .trace/auth/FEAT-042-login/FEAT-042.tsv
|
|
271
|
+
Next : /review-context specs/auth/FEAT-042-login/bdd/FEAT-042-UC1-login.feature
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**Status badges:** `✅ Complete` · `⚠️ Warnings` · `❌ Failed`. Field **Next** luôn gợi ý command tiếp theo hợp lý — không phải tra cứu.
|