@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,522 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › [Operations](README.md) › Sync & Update
|
|
2
|
+
|
|
3
|
+
# Sync & Update — Vận hành hằng ngày
|
|
4
|
+
|
|
5
|
+
> Cách đồng bộ nội dung dự án (`/sync`), nâng cấp framework (`/update-framework`), làm việc ở umbrella mode với git submodule, đồng bộ Living Docs, và workflow hằng ngày theo từng role.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Mục lục
|
|
10
|
+
|
|
11
|
+
1. [Hai loại "update" — đừng nhầm](#1-hai-loại-update--đừng-nhầm)
|
|
12
|
+
2. [`/sync` — đồng bộ nội dung dự án](#2-sync--đồng-bộ-nội-dung-dự-án)
|
|
13
|
+
3. [`/update-framework` — nâng cấp framework](#3-update-framework--nâng-cấp-framework)
|
|
14
|
+
3.5. [`--migrate-specs` — chuyển specs cũ sang feature-package layout](#35---migrate-specs--chuyển-specs-cũ-sang-feature-package-layout-một-lần)
|
|
15
|
+
4. [Umbrella mode & git submodule](#4-umbrella-mode--git-submodule)
|
|
16
|
+
5. [Living Docs sync](#5-living-docs-sync)
|
|
17
|
+
6. [Workflow hằng ngày theo role](#6-workflow-hằng-ngày-theo-role)
|
|
18
|
+
7. [Project Lessons — không để AI lặp lỗi](#7-project-lessons--không-để-ai-lặp-lỗi)
|
|
19
|
+
8. [Câu hỏi thường gặp](#8-câu-hỏi-thường-gặp)
|
|
20
|
+
|
|
21
|
+
> Pipeline QC native (`/qc-*`) có trang riêng — xem [chương QC Automation](../02-guides/tester/qc-automation.md). Ở đây chỉ điểm qua chỗ `/sync` chạm vào QC.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 1. Hai loại "update" — đừng nhầm
|
|
26
|
+
|
|
27
|
+
Có 2 thứ cần update, **nguồn khác nhau, tần suất khác nhau**:
|
|
28
|
+
|
|
29
|
+
| | `/sync` | `/update-framework` |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| **Update cái gì** | Nội dung dự án: code/specs trong submodule + Living Docs | Bản thân framework: `.agent/commands/`, steps/, modules/ |
|
|
32
|
+
| **Nguồn** | Git remote của các submodule | npm registry |
|
|
33
|
+
| **Tần suất** | Mỗi sáng / trước khi work | Khi có version framework mới (hiếm) |
|
|
34
|
+
| **Đụng `project-context.yaml` / `CLAUDE.md`?** | Không | Không (chỉ refresh file framework) |
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Update nội dung dự án — chạy thường xuyên
|
|
38
|
+
/sync
|
|
39
|
+
|
|
40
|
+
# Nâng cấp framework — chạy khi có bản mới
|
|
41
|
+
/update-framework
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 2. `/sync` — đồng bộ nội dung dự án
|
|
47
|
+
|
|
48
|
+
`/sync` gộp `git pull` + cập nhật submodule + refresh Living Docs vào **1 lệnh duy nhất**, chạy từ umbrella root:
|
|
49
|
+
|
|
50
|
+
- Pull specs (spec submodule) + services (service submodules).
|
|
51
|
+
- Refresh Living Docs panel (regenerate trace report — xem [§5](#5-living-docs-sync)).
|
|
52
|
+
- Liệt kê **📥 New tester feedback** — bug report / scenario proposal mới từ tester trong vùng `feedback/` của spec repo. Chỉ surface bug có `State: Open` là đang chờ; `State: Fixed` (chờ QC re-verify) / `Closed` liệt kê riêng để không làm nhiễu view của PO/PM. Vòng đời đầy đủ: [bug-flow.md §10](bug-flow.md).
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
/sync
|
|
56
|
+
# hoặc override branch của spec submodule một lần:
|
|
57
|
+
/sync develop
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Branch nào được kéo?** `/sync` đọc `submodule.<spec>.branch` trong `.gitmodules`; nếu không khai báo → lấy **default branch của remote** (`origin/HEAD`, thường `main`). PO làm trên branch khác (vd `develop`) → pin một lần cho cả team:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git config -f .gitmodules submodule.my-project-specs.branch develop
|
|
64
|
+
git add .gitmodules && git commit -m "chore: pin spec submodule branch = develop"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Service submodules không bị ảnh hưởng — luôn checkout đúng SHA mà umbrella ghi, không phụ thuộc branch.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 3. `/update-framework` — nâng cấp framework
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
/update-framework
|
|
75
|
+
# → đọc .agent/FRAMEWORK_VERSION, so với npm
|
|
76
|
+
# → chạy npx @latest --init
|
|
77
|
+
# → review `git diff .agent/` rồi commit
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
> **Umbrella mode:** `/update-framework` chỉ cần chạy ở **umbrella root**. Service submodule chỉ chứa `.agent/project-context.yaml` (config), không có command files → không cần nâng cấp riêng.
|
|
81
|
+
|
|
82
|
+
> ⚠️ **`--init` ghi đè TOÀN BỘ `.agent/`** (gồm cả `.agent/skills/qc/`) — KHÔNG đụng `.agent/project-context.yaml` (config của bạn) và mọi thứ **ngoài** `.agent/`.
|
|
83
|
+
> **Hệ quả với skill QC:** nếu QC sửa skill **trực tiếp trong `.agent/skills/qc/`** thì sẽ **mất sau upgrade**. Để skill QC tồn tại độc lập, trỏ `paths.qc_skills_dir` (trong `.agent/project-context.yaml`) tới **repo QC riêng / submodule** (vd `qc-base/.claude/skills`) — `qc_skills_dir` nằm ngoài `.agent/` nên upgrade không bao giờ chạm. Chi tiết: [chương QC Automation](../02-guides/tester/qc-automation.md#skill-sourcing--upgrade-safety).
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 3.5. `--migrate-specs` — chuyển specs cũ sang feature-package layout (một lần)
|
|
88
|
+
|
|
89
|
+
Từ phiên bản dùng **feature-package layout**, mọi artifact của một PRD nằm chung một thư mục
|
|
90
|
+
`specs/{domain}/{prd-slug}/` thay vì tách theo loại (`specs/prd/`, `specs/bdd/`, …). Dự án **đã có
|
|
91
|
+
specs theo layout cũ** chạy lệnh sau **một lần** để di chuyển:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# DRY-RUN — chỉ in kế hoạch, không đổi gì (chạy trước để review)
|
|
95
|
+
npx @edupia-tutor/spec-driven-docs --migrate-specs
|
|
96
|
+
|
|
97
|
+
# Thực thi
|
|
98
|
+
npx @edupia-tutor/spec-driven-docs --migrate-specs --apply
|
|
99
|
+
# hoặc trực tiếp: node scripts/migrate-specs.js --apply
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Lệnh sẽ:
|
|
103
|
+
- Di chuyển `specs/prd/{domain}/{slug}.md` → `specs/{domain}/{slug}/prd.md`, và `specs/bdd|tech-docs|design-spec/{domain}/…` → `specs/{domain}/{prd-slug}/{bdd|tech-docs|design-spec}/…`; flat `.trace/{UC-ID}.tsv` → `.trace/{domain}/{prd-slug}/{UC-ID}.tsv`.
|
|
104
|
+
- Suy ra `{prd-slug}` cho mỗi file BDD/tech-doc/design-spec/trace bằng cách đọc header `@trace.source` (PRD nguồn) hoặc tag `@trace.uc` (map qua index `.feature`).
|
|
105
|
+
- Dùng `git mv` cho file đã track (giữ history), `fs.rename` cho phần còn lại.
|
|
106
|
+
- Rewrite các tham chiếu nội bộ (`@trace.source`, đường dẫn `specs/…`) trong những file vừa move.
|
|
107
|
+
- File **không resolve được** prd-slug sẽ **để nguyên** và liệt kê trong report — không bao giờ move vào chỗ đoán.
|
|
108
|
+
|
|
109
|
+
> ⚠️ **Phạm vi:** lệnh chỉ đụng `specs/` và `.trace/`. Tham chiếu `@trace.source=specs/bdd/…` trong **code** (file `src/`) không được sửa tự động — sau khi migrate, grep codebase:
|
|
110
|
+
> ```bash
|
|
111
|
+
> grep -rn "specs/\(prd\|bdd\|tech-docs\|design-spec\)/" src/
|
|
112
|
+
> ```
|
|
113
|
+
> rồi cập nhật thủ công, và chạy `/validate-traces` để xác nhận coverage vẫn resolve trước khi commit.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 4. Umbrella mode & git submodule
|
|
118
|
+
|
|
119
|
+
Claude Code luôn mở ở **umbrella repo** (không mở trong service submodule). Umbrella thấy được cả spec submodule (read-only) lẫn service submodule (code).
|
|
120
|
+
|
|
121
|
+
### Ai commit vào repo nào? (git flow theo role)
|
|
122
|
+
|
|
123
|
+
3 repo độc lập (mỗi cái có origin riêng), umbrella chỉ giữ **pointer**. Mỗi role ghi vào repo khác nhau → số "tầng push" khác nhau:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
UMBRELLA REPO (Claude Code mở ở đây · .gitmodules + docs/)
|
|
127
|
+
│ giữ pointer (SHA) tới từng submodule
|
|
128
|
+
┌─────────────┴──────────────┐
|
|
129
|
+
▼ ▼
|
|
130
|
+
SPEC SUBMODULE SERVICE SUBMODULE(s)
|
|
131
|
+
(PO sở hữu · origin riêng) (Dev sở hữu · origin riêng)
|
|
132
|
+
specs/{domain}/{prd-slug}/ src/ (chỉ code + tooling)
|
|
133
|
+
prd.md · bdd/ (web/app/system)
|
|
134
|
+
design-spec/ · tech-docs/
|
|
135
|
+
feedback/ (bug · proposal · prd-change)
|
|
136
|
+
.trace/{domain}/{prd-slug}/*.tsv (qc_status + dev_selftest — write area của dev/QC)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
> **Tất cả spec + `.trace/` ở SPEC repo; service submodule chỉ chứa code.** PRD/BDD/design-spec/tech-docs read-only với dev/QC; `feedback/` và `.trace/` là vùng dev/QC được ghi.
|
|
140
|
+
|
|
141
|
+
| Role | Tạo gì | Repo đích | Push mấy tầng |
|
|
142
|
+
|------|--------|-----------|---------------|
|
|
143
|
+
| **PO** | PRD · BDD (web/app/system) · design-spec · sửa PRD theo change-request | SPEC repo | **1 tầng** (spec repo) |
|
|
144
|
+
| **Dev (FE/BE)** | tech-docs · code · dev test (`dev_selftest`) | tech-docs → SPEC repo · `dev_selftest` → SPEC `.trace/` · code → SERVICE | code: **2 tầng** (service → umbrella pointer) · tech-docs + trace: 1 tầng ở spec repo (cross-repo write) |
|
|
145
|
+
| **QC / Tester (QA)** | QC pipeline (analysis/test-cases · `qc_status`) · bug report · scenario proposal · prd-change-request | artifacts → `{qc_dir}/{UC-ID}/` (umbrella `docs/`) · `qc_status` → SPEC `.trace/` · bug/proposal/change-request → SPEC `feedback/` | artifacts: 1 tầng (umbrella) · trace + feedback: **1 tầng** (spec repo) — read-only trên specs/code |
|
|
146
|
+
|
|
147
|
+
> **QC = Tester (một vai trò QA):** cùng một người chạy pipeline `/qc-*` (sinh `qc_status` chính thức) **và** `/report-bug` · `/propose-scenario`. Phân biệt thật sự là **Dev self-test (`dev_selftest`) vs QC/Tester authoritative (`qc_status`)** — không phải QC vs Tester.
|
|
148
|
+
|
|
149
|
+
Thứ tự bàn giao (mỗi mũi tên = `git push` rồi role kế tiếp `/sync`):
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
PO ─push spec─▶ Dev /sync ─code 2 tầng─▶ QC/Tester /sync ─qc_status + bug 1 tầng (spec)─▶ PO/Dev /sync
|
|
153
|
+
BDD approved tech-docs + src test + report fix code / sửa PRD → /generate-bdd lại
|
|
154
|
+
(vòng feedback: xem Bug Flow §9)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
> **`qc_status` ở spec repo nhưng QC analysis docs ở umbrella root:** `qc_status` ghi vào `.trace/` (đã dồn về `{spec_source}/.trace`), còn `qc_dir` (analysis/test-cases, mặc định `docs/`) **không** auto-route — nằm ở umbrella root. Muốn artifacts QC nằm chỗ khác → set `paths.qc_dir` trong `.agent/project-context.yaml`, hoặc trỏ ra repo QC riêng.
|
|
158
|
+
|
|
159
|
+
> **Git flow `git` cụ thể cho từng role** (ví dụ end-to-end một feature, kèm `cd`/`add`/`commit`/`push` thực tế): [§4.7](#47--git-flow-cụ-thể-theo-role-ví-dụ-feature-ft-042-checkout-domain-payment).
|
|
160
|
+
|
|
161
|
+
### 4.1 — Clone lần đầu
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
git clone --recurse-submodules https://gitlab.company.com/my-project-web.git
|
|
165
|
+
|
|
166
|
+
# Hoặc nếu đã clone mà submodule trống:
|
|
167
|
+
git submodule update --init --recursive
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 4.2 — Kiểm tra trạng thái submodule
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
git submodule status
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
| Ký hiệu | Ý nghĩa | Cách xử lý |
|
|
177
|
+
|---|---|---|
|
|
178
|
+
| `abc1234 my-project-specs` | Bình thường | — |
|
|
179
|
+
| `+abc1234 …` | Umbrella có thay đổi chưa commit | `git add <sub> && git commit` |
|
|
180
|
+
| `-abc1234 …` | Chưa init | `git submodule update --init` |
|
|
181
|
+
| `Uabc1234 …` | Conflict | Giải quyết conflict rồi commit |
|
|
182
|
+
|
|
183
|
+
### 4.3 — Cập nhật spec submodule (lấy PRD mới từ PO)
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Cách 1: kéo version mới nhất của branch (thường dùng nhất)
|
|
187
|
+
git submodule update --remote my-project-specs
|
|
188
|
+
|
|
189
|
+
# Cách 2: kéo version mà umbrella đang trỏ (sau git pull)
|
|
190
|
+
git submodule update my-project-specs
|
|
191
|
+
|
|
192
|
+
# Commit lại pointer để cả team cùng version
|
|
193
|
+
git add my-project-specs
|
|
194
|
+
git commit -m "chore: update spec submodule to latest"
|
|
195
|
+
git push
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
> **Khác biệt:** `--remote` lấy commit mới nhất từ remote branch (khi PO vừa push); không có `--remote` → sync về đúng commit umbrella đang trỏ. `/sync` xử lý việc này tự động.
|
|
199
|
+
|
|
200
|
+
### 4.4 — Commit 2 tầng (thay đổi trong service submodule)
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Tầng 1: commit trong service submodule (CHỈ code — BDD, tech-docs, .trace đều ở spec repo)
|
|
204
|
+
cd user-service
|
|
205
|
+
git add src/
|
|
206
|
+
git commit -m "feat(FEAT-01): implementation"
|
|
207
|
+
git push origin main
|
|
208
|
+
cd ..
|
|
209
|
+
|
|
210
|
+
# Tầng 2: update pointer ở umbrella
|
|
211
|
+
git add user-service
|
|
212
|
+
git commit -m "chore: update user-service submodule to FEAT-01"
|
|
213
|
+
git push
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
> ⚠️ **PHẢI push cả 2 tầng.** Push umbrella mà quên push submodule → người khác pull về bị lỗi "commit không tồn tại".
|
|
217
|
+
>
|
|
218
|
+
> **Tech-docs (API contract):** khi `setup.spec_source` được set, tech-design **luôn** nằm ở `{spec_source}/specs/tech-docs` (spec repo chung) — commit + push riêng trong spec submodule, FE/App đọc qua `/sync`. Per-service tech-docs chỉ dùng khi **không** có `spec_source`.
|
|
219
|
+
>
|
|
220
|
+
> **`.trace/` cũng ở spec repo:** khi `spec_source` set, `/generate-code` · `/dev-run-test` · `/qc-run-test` chạy trong service nhưng ghi trace vào `{spec_source}/.trace` → commit + push **trong spec submodule** (1 tầng, cross-repo, giống `feedback/`). Service submodule **không** còn `.trace/`.
|
|
221
|
+
|
|
222
|
+
### 4.5 — Lỡ tay sửa **spec** trong spec submodule (PRD/BDD/design-spec/tech-docs read-only)
|
|
223
|
+
|
|
224
|
+
PRD/BDD/design-spec/tech-docs trong spec submodule là **read-only** cho dev/tester (chỉ PO sửa). `feedback/` và `.trace/` thì dev/QC được ghi. Nếu lỡ sửa spec → bỏ thay đổi:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
cd my-project-specs
|
|
228
|
+
git checkout . # hoặc: git restore .
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Muốn cập nhật PRD → báo PO sửa trong spec repo của họ rồi push.
|
|
232
|
+
|
|
233
|
+
### 4.6 — Troubleshooting
|
|
234
|
+
|
|
235
|
+
| Lỗi | Nguyên nhân | Cách xử lý |
|
|
236
|
+
|---|---|---|
|
|
237
|
+
| Thư mục submodule trống | Chưa init | `git submodule update --init` |
|
|
238
|
+
| `fatal: not a git repository` | Sai thư mục | `cd` về đúng chỗ |
|
|
239
|
+
| `object not found` sau pull | Push umbrella nhưng quên push submodule | Người commit submodule chạy `cd <sub> && git push` |
|
|
240
|
+
| Submodule ở `detached HEAD` | Bình thường khi dùng submodule | Không cần lo nếu không sửa file trong đó |
|
|
241
|
+
| Conflict trong submodule pointer | 2 người cùng update submodule | `git checkout --theirs <sub> && git add <sub>` |
|
|
242
|
+
|
|
243
|
+
### 4.7 — Git flow cụ thể theo role (ví dụ feature **FT-042 Checkout**, domain `payment`)
|
|
244
|
+
|
|
245
|
+
Topology giả định cho mọi ví dụ dưới đây:
|
|
246
|
+
|
|
247
|
+
| Repo | Vai trò | Ai sở hữu |
|
|
248
|
+
|------|---------|-----------|
|
|
249
|
+
| `my-project/` | **umbrella** — Claude Code mở ở đây, giữ pointer | team |
|
|
250
|
+
| `my-project-specs/` | **spec** submodule — PRD/BDD/design-spec/tech-docs + `.trace/` + `feedback/` | PO |
|
|
251
|
+
| `payment-be/` | **service** submodule — chỉ code BE | BE dev |
|
|
252
|
+
| `my-project-web/` | **service** submodule — chỉ code FE | FE dev |
|
|
253
|
+
|
|
254
|
+
> **Quy tắc 1 dòng:** chỉ **code** mới push **2 tầng** (service → umbrella pointer). Mọi thứ khác — PRD/BDD/tech-docs/`.trace/`/`feedback/` ở spec repo, và QC artifacts ở umbrella — đều **1 tầng**.
|
|
255
|
+
|
|
256
|
+
**① PO — 1 tầng (spec repo)**
|
|
257
|
+
```bash
|
|
258
|
+
cd my-project-specs && git pull
|
|
259
|
+
# /generate-prd · /generate-design-spec · /generate-bdd (web/app/system) · set @trace.status: approved
|
|
260
|
+
git add specs/payment/checkout/prd.md \
|
|
261
|
+
specs/payment/checkout/design-spec/FT-042-checkout-design.md \
|
|
262
|
+
specs/payment/checkout/bdd/system/FT-042-UC1-checkout-system.feature \
|
|
263
|
+
specs/payment/checkout/bdd/web/FT-042-UC1-checkout-web.feature \
|
|
264
|
+
specs/payment/checkout/bdd/app/FT-042-UC1-checkout-app.feature
|
|
265
|
+
git commit -m "feat(payment): FT-042 checkout — PRD + design-spec + BDD (web/app/system)"
|
|
266
|
+
git push origin main # → báo Dev team chạy /sync
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**② BE Dev — code 2 tầng · tech-docs + trace 1 tầng (cross-repo)**
|
|
270
|
+
```bash
|
|
271
|
+
cd my-project && /sync # umbrella root: pull spec + services + Living Docs
|
|
272
|
+
|
|
273
|
+
# (a) tech-docs (API contract) → SPEC repo [1 tầng]
|
|
274
|
+
# /generate-tech-docs payment/system/FT-042-UC1 ghi vào my-project-specs/specs/payment/checkout/tech-docs/
|
|
275
|
+
cd my-project-specs
|
|
276
|
+
git add specs/payment/checkout/tech-docs/FT-042-UC1-tech-design.md
|
|
277
|
+
git commit -m "docs(payment): FT-042 UC1 BE API contract"
|
|
278
|
+
git push origin main
|
|
279
|
+
cd ..
|
|
280
|
+
|
|
281
|
+
# (b) code → SERVICE repo [Tầng 1]
|
|
282
|
+
# /generate-code payment/system/FT-042-UC1 ghi vào payment-be/src/
|
|
283
|
+
cd payment-be
|
|
284
|
+
git checkout -b feat/FT-042-checkout
|
|
285
|
+
git add src/
|
|
286
|
+
git commit -m "feat(payment): FT-042 UC1 checkout endpoint + service"
|
|
287
|
+
git push origin feat/FT-042-checkout # → mở MR trong payment-be
|
|
288
|
+
cd ..
|
|
289
|
+
|
|
290
|
+
# (c) dev_selftest → SPEC repo .trace [1 tầng, cross-repo]
|
|
291
|
+
# /dev-run-test ghi my-project-specs/.trace/payment/checkout/FT-042.tsv
|
|
292
|
+
cd my-project-specs
|
|
293
|
+
git add .trace/payment/checkout/FT-042.tsv
|
|
294
|
+
git commit -m "chore(trace): FT-042 dev_selftest=pass"
|
|
295
|
+
git push origin main
|
|
296
|
+
cd ..
|
|
297
|
+
|
|
298
|
+
# (d) sau khi MR payment-be merge → bump umbrella pointer [Tầng 2]
|
|
299
|
+
cd payment-be && git checkout main && git pull && cd ..
|
|
300
|
+
git add payment-be
|
|
301
|
+
git commit -m "chore: bump payment-be → FT-042 checkout"
|
|
302
|
+
git push origin main
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**③ FE/Web Dev — 2 phase; push giống BE (code 2 tầng · tech-docs + trace 1 tầng)**
|
|
306
|
+
```bash
|
|
307
|
+
cd my-project && /sync
|
|
308
|
+
|
|
309
|
+
# Phase 1 — UI + mock (chưa cần BE deploy)
|
|
310
|
+
# /generate-code payment/web/FT-042-UC1 --phase=ui → code trong my-project-web
|
|
311
|
+
cd my-project-web
|
|
312
|
+
git checkout -b feat/FT-042-checkout-ui
|
|
313
|
+
git add src/
|
|
314
|
+
git commit -m "feat(payment): FT-042 checkout UI + mock adapter"
|
|
315
|
+
git push origin feat/FT-042-checkout-ui
|
|
316
|
+
cd ..
|
|
317
|
+
|
|
318
|
+
# Phase 2 — khi BE System BDD + contract approved:
|
|
319
|
+
# (a) FE tech-design (§2b test-ids + §4 API map) → SPEC repo [1 tầng]
|
|
320
|
+
cd my-project-specs
|
|
321
|
+
git add specs/payment/checkout/tech-docs/FT-042-UC1-tech-design-web.md
|
|
322
|
+
git commit -m "docs(payment): FT-042 UC1 FE web tech-design (§2b test-ids + §4 API)"
|
|
323
|
+
git push origin main
|
|
324
|
+
cd ..
|
|
325
|
+
# (b) /generate-code payment/web/FT-042-UC1 --phase=integration → wire API thật [Tầng 1]
|
|
326
|
+
cd my-project-web
|
|
327
|
+
git add src/
|
|
328
|
+
git commit -m "feat(payment): FT-042 wire real checkout API"
|
|
329
|
+
git push origin feat/FT-042-checkout-ui
|
|
330
|
+
cd ..
|
|
331
|
+
# (c) dev_selftest → spec .trace + (d) bump umbrella pointer sau merge — giống BE bước (c)(d)
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
**④ QC / Tester (một vai trò QA) — artifacts 1 tầng (umbrella) · qc_status + bug/proposal 1 tầng (spec repo)**
|
|
335
|
+
|
|
336
|
+
> QC và Tester là **cùng một người**: vừa chạy pipeline `/qc-*` (sinh `qc_status` chính thức) vừa `/report-bug` · `/propose-scenario`. Read-only trên specs + code.
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
cd my-project && /sync # đọc specs read-only
|
|
340
|
+
# /qc-analyze · /qc-plan · /qc-design-test · /qc-review · /qc-run-test · /qc-report
|
|
341
|
+
|
|
342
|
+
# (a) artifacts phân tích/test-case → {qc_dir}/{UC-ID}/ (qc_dir mặc định = docs/) → commit UMBRELLA [1 tầng]
|
|
343
|
+
git add docs/FT-042/ # REQUIREMENT_ANALYSIS.md · TEST_PLAN.md · test-cases/*.Test.md
|
|
344
|
+
git commit -m "qc(payment): FT-042 analysis + test design"
|
|
345
|
+
git push origin main
|
|
346
|
+
|
|
347
|
+
# (b) qc_status → SPEC .trace + bug/proposal/change-request → SPEC feedback/ [1 tầng, cross-repo]
|
|
348
|
+
cd my-project-specs
|
|
349
|
+
git add .trace/payment/checkout/FT-042.tsv
|
|
350
|
+
git add feedback/bugs/FT-042-UC1-SC3-bug.md # /report-bug khi qc_status=fail
|
|
351
|
+
# hoặc: feedback/bdd-proposals/FT-042-new-scenario.md # /propose-scenario (edge case ngoài BDD)
|
|
352
|
+
# hoặc: feedback/prd-change-requests/FT-042-change.md # đề xuất sửa PRD
|
|
353
|
+
git commit -m "qc(payment): FT-042 qc_status=fail (SC3) + bug report"
|
|
354
|
+
git push origin main # → PO/Dev /sync thấy '📥 New tester feedback' → /fix-bug · promote
|
|
355
|
+
cd ..
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
> **Tóm tắt số tầng push:** chỉ **code = 2 tầng** (service → umbrella pointer); PRD/BDD/tech-docs/`.trace`/`feedback` (spec repo) = **1 tầng**; QC artifacts `qc_dir` (umbrella) = **1 tầng**. Lỡ tay sửa spec read-only → §4.5.
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
## 5. Living Docs sync
|
|
363
|
+
|
|
364
|
+
Living Docs panel hiển thị trạng thái trace của toàn bộ feature. Refresh nó bằng `/validate-traces` (hoặc tự động qua `/sync`):
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
/validate-traces
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
- Đọc TSVs từ **một nơi duy nhất** `{spec_source}/.trace/*.tsv` (authoritative — commit trong spec repo; mỗi scenario mang `@trace.service` để biết service nào). KHÔNG còn quét/merge từng service.
|
|
371
|
+
- Cập nhật cột `dev_selftest` (pass/fail/not_run) + `dev_selftest_at`.
|
|
372
|
+
- Ghi `trace-report.json` → `{spec_source}/.living-docs/` (generated, gitignored).
|
|
373
|
+
- Mirror thêm về `./.trace` của workspace hiện tại → panel không rỗng kể cả khi đứng trong 1 service submodule đơn lẻ.
|
|
374
|
+
|
|
375
|
+
> **Report nằm ở đâu:** authoritative `.trace/*.tsv` ở **spec module** `{spec_source}/.trace/` (committed — một chỗ cho PM). Report `trace-report.json` ở `{spec_source}/.living-docs/` + panel mirror `./.trace` đều **generated, gitignored** — regenerate bởi `/sync` hoặc `/validate-traces`.
|
|
376
|
+
>
|
|
377
|
+
> **.gitignore:** thêm `.trace/` trong repo hiện tại **và** `.living-docs/` trong spec module — đều là mirror read-only, không commit.
|
|
378
|
+
|
|
379
|
+
### `dev_selftest` vs `qc_status` — đừng nhầm
|
|
380
|
+
|
|
381
|
+
| Cột | Set bởi | Ý nghĩa |
|
|
382
|
+
|---|---|---|
|
|
383
|
+
| `dev_selftest` (+ `dev_selftest_at`) | `/dev-run-test` | Dev tự kiểm tra code mình viết (self-check / smoke). **KHÔNG** phải coverage QC chính thức. |
|
|
384
|
+
| `qc_status` (+ `qc_run_at`) | `/qc-run-test` (keyed theo `@trace.verifies={UC-ID}-SC{N}`) | Kết quả QC chính thức của framework. |
|
|
385
|
+
|
|
386
|
+
Sau khi chạy `/qc-run-test` rồi `/validate-traces` (hoặc `/sync`), `qc_status` hiện lên Living Docs cạnh `dev_selftest`.
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## 6. Workflow hằng ngày theo role
|
|
391
|
+
|
|
392
|
+
### PO — Viết tài liệu cho tính năng mới
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
cd my-project-spec
|
|
396
|
+
git pull
|
|
397
|
+
# Mở Claude Code tại thư mục này:
|
|
398
|
+
/define-product # khởi tạo product definition
|
|
399
|
+
/generate-prd {product-definition-file}
|
|
400
|
+
/refine-prd {prd-file} # review 4 lens: QA/DEV/SA/PO
|
|
401
|
+
/review-context {prd-file} # chất lượng + P0 check
|
|
402
|
+
/review-context --fix {prd-file} # auto-fix vấn đề nhỏ
|
|
403
|
+
# → update @trace.status: approved khi PRD sẵn sàng
|
|
404
|
+
/generate-design-spec {prd-file} # FE/App
|
|
405
|
+
/generate-bdd {prd-file} # outside-in: web → app → system (System BDD tổng hợp từ web+app)
|
|
406
|
+
|
|
407
|
+
git add specs/
|
|
408
|
+
git commit -m "feat({domain}): add {TICKET-ID} PRD, design spec, and BDD"
|
|
409
|
+
git push
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### FE/Web Dev — Nhận task mới
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
cd my-project-web
|
|
416
|
+
/sync # pull + submodule + Living Docs
|
|
417
|
+
git add my-project-specs && git commit -m "chore: sync specs" && git push
|
|
418
|
+
|
|
419
|
+
/review-context my-project-specs/specs/{domain}/{prd-slug}/prd.md
|
|
420
|
+
# → P0: @trace.domain khớp services config? @trace.status: approved?
|
|
421
|
+
# Đọc Web BDD do PO generate (KHÔNG tự generate BDD):
|
|
422
|
+
# my-project-specs/specs/{domain}/{prd-slug}/bdd/web/{TICKET-ID}-UC*.feature
|
|
423
|
+
|
|
424
|
+
# ── BE chưa deploy API → làm UI trước ──
|
|
425
|
+
/generate-code {domain}/web/{TICKET-ID}-UC1 --phase=ui # UI + mock (shape: BE contract nếu có, else System BDD + warn)
|
|
426
|
+
/dev-gen-test {domain}/{TICKET-ID}-UC1
|
|
427
|
+
/review-code {files-changed}
|
|
428
|
+
/dev-run-test # dev self-check (dev_selftest)
|
|
429
|
+
|
|
430
|
+
# ── Khi BE đã có System BDD + tech-docs (API contract) approved ──
|
|
431
|
+
/generate-tech-docs {domain}/web/{TICKET-ID}-UC1 # FE client design — GATED: cần System BDD + BE contract
|
|
432
|
+
/review-tech-docs {domain}/{TICKET-ID}-UC1-web # SA/Lead review (bump revision)
|
|
433
|
+
# → sau khi sign-off gate approved:
|
|
434
|
+
/generate-code {domain}/web/{TICKET-ID}-UC1 --phase=integration # wire API thật theo §4 FE tech-design
|
|
435
|
+
|
|
436
|
+
# ── API đã có sẵn ──
|
|
437
|
+
/generate-code {domain}/{TICKET-ID}-UC1 # không cần --phase
|
|
438
|
+
/dev-gen-test {domain}/{TICKET-ID}-UC1
|
|
439
|
+
/review-code {files-changed}
|
|
440
|
+
/dev-run-test
|
|
441
|
+
|
|
442
|
+
# Commit 2 tầng (code) + 1 tầng (tech-docs/trace) — git flow cụ thể: §4.7 ②③
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### BE Dev — Nhận task mới
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
cd my-project-be
|
|
449
|
+
/sync
|
|
450
|
+
# → cũng liệt kê "📥 New tester feedback" → /fix-bug · promote proposal · báo PO
|
|
451
|
+
|
|
452
|
+
/review-context my-project-specs/specs/{domain}/{prd-slug}/prd.md
|
|
453
|
+
# Đọc System BDD: my-project-specs/specs/{domain}/{prd-slug}/bdd/system/{TICKET-ID}-UC*.feature
|
|
454
|
+
|
|
455
|
+
/generate-tech-docs {domain}/{TICKET-ID}-UC1
|
|
456
|
+
/review-tech-docs {domain}/{TICKET-ID}-UC1
|
|
457
|
+
/generate-code {domain}/{TICKET-ID}-UC1
|
|
458
|
+
/dev-gen-test {domain}/{TICKET-ID}-UC1
|
|
459
|
+
/review-code {files-changed} # AI lặp lỗi → accept "Record as lesson?"
|
|
460
|
+
/dev-run-test
|
|
461
|
+
|
|
462
|
+
# Commit 2 tầng vào service submodule theo domain + tech-docs/trace 1 tầng — git flow cụ thể: §4.7 ②
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### QC / Tester — Chạy native QC pipeline (tóm tắt)
|
|
466
|
+
|
|
467
|
+
QC và Tester là **một vai trò QA** (xem [Tester guide](../02-guides/tester/README.md)) — cùng người chạy pipeline `/qc-*` **và** `/report-bug` · `/propose-scenario`. Điều kiện: BDD đã `approved`. Module `qc-playwright` (Python + pytest-playwright + Page Object).
|
|
468
|
+
|
|
469
|
+
```bash
|
|
470
|
+
cd my-project-web
|
|
471
|
+
/sync
|
|
472
|
+
/qc-analyze · /qc-plan · /qc-design-test · /qc-review · /qc-run-test · /qc-report
|
|
473
|
+
/validate-traces # refresh dashboard → qc_status hiện trên Living Docs
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
> `/qc-run-test` ghi `qc_status` + `qc_run_at` vào trace TSV. Chi tiết từng layer: [chương QC Automation](../02-guides/tester/qc-automation.md). Git flow cụ thể (artifacts umbrella + qc_status/bug/proposal → spec): §4.7 ④ (QC/Tester là một role).
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
## 7. Project Lessons — không để AI lặp lỗi
|
|
481
|
+
|
|
482
|
+
Khi AI lặp đi lặp lại một lỗi, ghi lại thành **lesson** thay vì sửa thủ công mỗi lần. context-loader nạp lesson vào đầu **mọi** lệnh như ràng buộc cứng.
|
|
483
|
+
|
|
484
|
+
```bash
|
|
485
|
+
# Cách 1 — chủ động:
|
|
486
|
+
/learn "AI hay gọi repository thẳng từ controller, phải đi qua service layer"
|
|
487
|
+
|
|
488
|
+
# Cách 2 — tự động: /review-code, /fix-bug, /debug hỏi "Record as a project lesson? (Y/N)" → Y
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
- **Lưu ở:** `paths.lessons_file` (mặc định `specs/domain-knowledge/lessons-learned.md`; umbrella: `.agent/project-lessons.md` mỗi service).
|
|
492
|
+
- **Commit file lessons** để cả team cùng được bảo vệ — đây là **bộ nhớ dự án**, không phải fine-tune model.
|
|
493
|
+
- Kiểm tra `[CTX LOADED]` có dòng `Lessons: loaded — N guardrails`.
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## 8. Câu hỏi thường gặp
|
|
498
|
+
|
|
499
|
+
**Q: Có cần cài framework vào từng service submodule không?**
|
|
500
|
+
A: Không. Chỉ cài ở umbrella repo. Service submodule là git repo thường chứa code + specs (+ `.agent/project-context.yaml` config).
|
|
501
|
+
|
|
502
|
+
**Q: Claude Code nên mở ở đâu?**
|
|
503
|
+
A: Luôn ở **umbrella repo** — có config và thấy được cả spec submodule lẫn service submodule.
|
|
504
|
+
|
|
505
|
+
**Q: Generate BDD ra file ở đâu?**
|
|
506
|
+
A: Khi có `spec_source` (umbrella) → **spec repo**: `{spec_source}/specs/{domain}/{prd-slug}/bdd/…` (tất cả BDD web/app/system đều ở đây, cross-team). Trace `.tsv` **cũng** ở spec repo (`{spec_source}/.trace`) — một chỗ cho PM. Service submodule chỉ chứa code. Chỉ khi KHÔNG có `spec_source` thì BDD + trace mới per-service.
|
|
507
|
+
|
|
508
|
+
**Q: Quên push service submodule, chỉ push umbrella, người khác báo lỗi?**
|
|
509
|
+
A: `cd <service> && git push origin main` — xong, người khác pull lại hết lỗi.
|
|
510
|
+
|
|
511
|
+
**Q: PO sửa PRD, có cần generate lại BDD?**
|
|
512
|
+
A: Chạy `/review-context {feature-file}` (B1 check) xem có coverage gap không. Có → `/review-context --resume`. Không cần viết lại toàn bộ BDD.
|
|
513
|
+
|
|
514
|
+
**Q: Mở nhiều Claude Code cho nhiều umbrella cùng lúc được không?**
|
|
515
|
+
A: Được. Mỗi umbrella là session riêng, hoàn toàn độc lập.
|
|
516
|
+
|
|
517
|
+
**Q: Đang ở `detached HEAD` trong submodule, có sao không?**
|
|
518
|
+
A: Bình thường — submodule trỏ tới một commit cụ thể. Chỉ lo nếu định sửa file (phải checkout branch trước). Chỉ đọc thì không sao.
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
*Xem thêm:* [Bug Flow](bug-flow.md) · [Publishing](publishing.md) · [02 · Guides](../02-guides/) · [03 · Concepts — Traceability](../03-concepts/traceability.md).
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › Reference
|
|
2
|
+
|
|
3
|
+
# 05 · Reference
|
|
4
|
+
|
|
5
|
+
> Tra cứu nhanh: mọi slash command, schema của trace TSV, và danh sách stack module. Đây là phần "đọc khi cần" — không phải hướng dẫn tuần tự.
|
|
6
|
+
|
|
7
|
+
Dùng mục này khi bạn đã biết mình muốn làm gì và chỉ cần tra input/output, tên cột, hoặc module phù hợp với stack.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Trong mục này
|
|
12
|
+
|
|
13
|
+
| Trang | Nội dung |
|
|
14
|
+
|-------|----------|
|
|
15
|
+
| [Command Cheat-Sheet](command-cheatsheet.md) | **Bắt đầu ở đây nếu bối rối:** bản đồ 1 trang — luồng end-to-end (ai chạy gì), chọn lệnh review nào, vòng review→Board→resume, giải mã flag `--fix`/`--resume`. |
|
|
16
|
+
| [Command Reference](commands.md) | Bảng đầy đủ MỌI slash command — gom theo phase, kèm input/output/when. Cộng phần Command Internals (step architecture). |
|
|
17
|
+
| [Trace TSV Schema](trace-schema.md) | Header chuẩn của `.trace/{UC-ID}.tsv`, ý nghĩa từng cột (gồm `dev_selftest`, `qc_status`…), các `@trace.*` tag, và JSON report. |
|
|
18
|
+
| [Stack Modules](modules.md) | 15 module dưới `modules/`, cách gom theo `platform_type` (backend / web-frontend / mobile), và module QC `qc-playwright`. |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Điều hướng nhanh
|
|
23
|
+
|
|
24
|
+
- **"Tôi nên chạy lệnh nào / theo thứ tự nào?"** → [Command Cheat-Sheet](command-cheatsheet.md)
|
|
25
|
+
- **"Review PRD/BDD/tech/code dùng lệnh nào? `--fix` vs `--resume`?"** → [Command Cheat-Sheet](command-cheatsheet.md)
|
|
26
|
+
- **"Lệnh này nhận gì, sinh ra gì?"** → [Command Reference](commands.md)
|
|
27
|
+
- **"Cột `qc_status` vs `dev_selftest` khác nhau thế nào?"** → [Trace TSV Schema](trace-schema.md)
|
|
28
|
+
- **"Stack của tôi map sang module nào?"** → [Stack Modules](modules.md)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
*Xem thêm:* [02 · Guides](../02-guides/) (theo vai trò) · [03 · Concepts](../03-concepts/) (kiến trúc & traceability) · [04 · Operations](../04-operations/) (vận hành).
|