@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,149 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › [Concepts](README.md) › Traceability
|
|
2
|
+
|
|
3
|
+
# Traceability & Living Docs
|
|
4
|
+
|
|
5
|
+
Mỗi artifact link tới mọi artifact khác qua `@trace.*` tags, và trạng thái coverage/drift được tổng hợp vào **trace TSV** rồi surface trong **Living Docs**. Đây là cách framework đảm bảo *mọi dòng code trace về một scenario*, và phân biệt hai tín hiệu test độc lập: **`dev_selftest`** (dev tự kiểm) vs **`qc_status`** (QC chính thức).
|
|
6
|
+
|
|
7
|
+
## Mục lục
|
|
8
|
+
|
|
9
|
+
- [Artifact chain & @trace tags](#artifact-chain--trace-tags)
|
|
10
|
+
- [Trace TSV — coverage & drift](#trace-tsv--coverage--drift)
|
|
11
|
+
- [Hai tín hiệu test: dev_selftest vs qc_status](#hai-tín-hiệu-test-dev_selftest-vs-qc_status)
|
|
12
|
+
- [Living Docs — canonical trong spec-module + panel mirror](#living-docs--canonical-trong-spec-module--panel-mirror)
|
|
13
|
+
- [/validate-traces](#validate-traces)
|
|
14
|
+
|
|
15
|
+
> Schema TSV đầy đủ (mọi cột) và full danh sách trace tag: xem [../05-reference/trace-schema.md](../05-reference/trace-schema.md). Trang này tập trung vào **khái niệm** và cách hai tín hiệu hoạt động.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Artifact chain & @trace tags
|
|
20
|
+
|
|
21
|
+
Mỗi artifact mang `@trace.*` metadata liên kết về artifact trước nó:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
product-definition.md
|
|
25
|
+
└─► PRD.md (@trace.domain, @trace.status; Service/Module trong metadata)
|
|
26
|
+
└─► specs/{domain}/{prd-slug}/bdd/{web|app|system}/{UC-ID}.feature (@trace.prd_version, @trace.module)
|
|
27
|
+
└─► specs/{domain}/{prd-slug}/tech-docs/{UC-ID}-tech-design*.md (@trace.bdd_version)
|
|
28
|
+
└─► src/ code — service submodule (@trace.implements)
|
|
29
|
+
└─► src/test/ (@trace.verifies, @trace.service)
|
|
30
|
+
════► {spec_source}/.trace/{domain}/{prd-slug}/{UC-ID}.tsv — TSV authoritative ở SPEC repo (coverage/drift)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Các trace field quan trọng:**
|
|
34
|
+
|
|
35
|
+
| Field | Vị trí | Ý nghĩa |
|
|
36
|
+
|-------|--------|---------|
|
|
37
|
+
| `@trace.domain` | PRD frontmatter | Domain của feature (auth, payment, …) — route vào đúng service submodule |
|
|
38
|
+
| `@trace.status` | PRD frontmatter | `draft` / `approved` — dev team chỉ code khi `approved` |
|
|
39
|
+
| `@trace.service` / `@trace.module` | BDD / Tech Doc header | Service + module sẽ implement |
|
|
40
|
+
| `@trace.prd_version` / `@trace.bdd_version` | BDD / code / test | Version của spec mà artifact được sinh từ — base cho drift detection |
|
|
41
|
+
| `@trace.implements` | Code comment | Scenario mà code này implement: `={UC-ID}-SC{N}` |
|
|
42
|
+
| `@trace.verifies` | Test / QC test | Scenario mà test này verify: `={UC-ID}` hoặc `={UC-ID}-SC{N}` |
|
|
43
|
+
| `@trace.api_source: existing` | BDD header | Brownfield — API đã tồn tại, contract lấy từ PRD |
|
|
44
|
+
|
|
45
|
+
Ví dụ tags trong `.feature`, code, và test:
|
|
46
|
+
|
|
47
|
+
```gherkin
|
|
48
|
+
# @trace.id: FEAT-001-UC1
|
|
49
|
+
# @trace.service: web-admin
|
|
50
|
+
# @trace.module: react
|
|
51
|
+
# @trace.prd_version: 1.2
|
|
52
|
+
# @trace.bdd_version: 3
|
|
53
|
+
```
|
|
54
|
+
```java
|
|
55
|
+
// @trace.implements=FEAT-001-UC1-SC2 // @trace.verifies=FEAT-001-UC1
|
|
56
|
+
// @trace.prd_version=1.2 // @trace.service=api-backend
|
|
57
|
+
// @trace.bdd_version=3 // @trace.test_type=integration
|
|
58
|
+
// @trace.tech_doc_revision=2
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Trace TSV — coverage & drift
|
|
64
|
+
|
|
65
|
+
`.trace/{domain}/{prd-slug}/{UC-ID}.tsv` là nguồn sự thật per-scenario về trạng thái implement/test. Được **ghi** bởi `/generate-bdd`, `/generate-code`, `/dev-gen-test`, `/qc-run-test`, và **update** bởi `/validate-traces`. Khi `spec_source` set, file `.trace/**/*.tsv` authoritative **được commit ở một chỗ** trong spec repo (`{spec_source}/.trace/`) — một nơi cho PM quản lý; mỗi scenario mang `@trace.service`. (Không có `spec_source` → `.trace` per-service.)
|
|
66
|
+
|
|
67
|
+
Status coverage per scenario:
|
|
68
|
+
|
|
69
|
+
| Status | Meaning |
|
|
70
|
+
|--------|---------|
|
|
71
|
+
| ✅ OK | Code version khớp spec version |
|
|
72
|
+
| ⚠️ DRIFT | Code gen từ PRD/BDD cũ hơn — re-generate |
|
|
73
|
+
| 🔴 GAP | Scenario có trong spec nhưng không tìm thấy code implement |
|
|
74
|
+
| — UNTRACKED | Scenario ghi nhận nhưng chưa code-gen |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Hai tín hiệu test: dev_selftest vs qc_status
|
|
79
|
+
|
|
80
|
+
Trace TSV mang **hai cột độc lập**, cả hai **orthogonal** với cột `status` (coverage) ở trên:
|
|
81
|
+
|
|
82
|
+
| Cột | Set bởi | Giá trị | Ý nghĩa |
|
|
83
|
+
|-----|---------|---------|---------|
|
|
84
|
+
| `dev_selftest` (+ `dev_selftest_at`) | `/dev-run-test` | `pass` / `fail` / `not_run` | **Dev self-check** — dev tự chạy bộ self-check test của mình trên scenario đó. **KHÔNG** phải coverage QC chính thức. |
|
|
85
|
+
| `qc_status` (+ `qc_run_at`) | `/qc-run-test` | `pass` / `fail` / `skip` / `not_run` | **QC chính thức** — kết quả native QC pipeline (do QC chạy, không phải dev), keyed theo `@trace.verifies={UC-ID}-SC{N}`. |
|
|
86
|
+
|
|
87
|
+
- **`dev_selftest`** là tín hiệu để QC **thấy** rằng developer đã smoke/self-check qua scenario đó. `dev_selftest: pass` chỉ nghĩa "dev đã tự kiểm" — không phải tuyên bố coverage.
|
|
88
|
+
- **`qc_status`** là coverage QC chính thức từ pipeline `/qc-analyze → … → /qc-run-test → /qc-report` (xem [pipeline.md](pipeline.md#qc-automation-pipeline-phase-5b)). `/qc-run-test` dùng stack module `qc-playwright`, độc lập với dev implementation module.
|
|
89
|
+
- Hai tín hiệu **sit side by side** trong Living Docs để dễ phân biệt hai luồng. Tester vẫn nên verify độc lập theo BDD + PRD ở phần chưa được automation cover.
|
|
90
|
+
|
|
91
|
+
> Phân biệt rõ: `/dev-*` (dev self-check, `dev_selftest`) ≠ `/qc-*` (official QC suite, `qc_status`). Đừng coi output của `/dev-*` là coverage chính thức.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Living Docs — canonical trong spec-module + panel mirror
|
|
96
|
+
|
|
97
|
+
Living Docs (VS Code panel) đọc trace TSV và hiển thị traceability health toàn dự án:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
┌──────────────────────────────────────────────────────────────────┐
|
|
101
|
+
│ PRDs Use Cases Scenarios Code Cov. Test Cov. Drift Gap │
|
|
102
|
+
│ 19 86 1077 93% 89% 212 93 │
|
|
103
|
+
└──────────────────────────────────────────────────────────────────┘
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- Drill down: PRD → UC → per-scenario table (Spec ver, Gen ver, Code, Tests, **Dev Self-Check**, **QC Status**, **Waiting on**, Status)
|
|
107
|
+
- **Waiting on** (cột `qc_owner` + `qc_blocked_by`): cho PO/PM thấy case chưa pass đang **chờ dev** (product-gap → `BUG-{id}`) hay **chờ PO** confirm/clarify (spec gap → `GAP-{id}`). Aggregates `waiting_dev` / `waiting_po` ở header dashboard.
|
|
108
|
+
- Status badges: ✅ OK · ⚠️ DRIFT · 🔴 GAP · — UNTRACKED · filter theo domain/PRD status/doc status · search theo UC/SC ID.
|
|
109
|
+
|
|
110
|
+
**Ba nơi chứa trace data — phân biệt authoritative vs mirror:**
|
|
111
|
+
|
|
112
|
+
| Vị trí | Vai trò | Commit? |
|
|
113
|
+
|--------|---------|---------|
|
|
114
|
+
| `{spec_source}/.trace/*.tsv` | **Authoritative** — nguồn sự thật, một chỗ cho cả team/PM (mỗi row mang `@trace.service`) | ✅ Committed trong spec repo |
|
|
115
|
+
| `{spec_source}/.living-docs/trace-report.json` | **Report** — dashboard tổng hợp, regenerate bởi `/sync` hoặc `/validate-traces` | ❌ Gitignored |
|
|
116
|
+
| `./.trace` của workspace hiện tại | **Panel mirror** — giữ Living Docs panel không trống khi mở Claude Code/VS Code ở một repo không phải spec repo | ❌ Gitignored |
|
|
117
|
+
|
|
118
|
+
**Vì sao authoritative + report nằm ở spec module?** Spec module được mount vào mọi umbrella/service workspace, nên là nơi chung luôn resolve được cho cross-team dashboard, và là **một chỗ duy nhất** để PM/PO quản lý trạng thái. Code-side commands (`/generate-code`, `/dev-run-test`, `/qc-run-test`) chạy trong service nhưng ghi trace cross-repo vào đây (giống `feedback/`). Panel mirror `./.trace` chỉ để panel không trống khi mở một repo lẻ.
|
|
119
|
+
|
|
120
|
+
Thêm vào `.gitignore` (report + mirror là read-only generated, không commit; `.trace/*.tsv` thì commit trong spec repo):
|
|
121
|
+
```
|
|
122
|
+
# spec module
|
|
123
|
+
.living-docs/
|
|
124
|
+
# workspace không phải spec repo (panel mirror)
|
|
125
|
+
.trace/
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
> **Prerequisite cho data chính xác:** umbrella cần `setup.spec_source` trỏ đúng spec submodule → framework ghi mọi trace TSV vào `{spec_source}/.trace`. (Chế độ không có `spec_source` mới cần `paths.trace_dir` per-service.)
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## /validate-traces
|
|
133
|
+
|
|
134
|
+
Chạy `/validate-traces {domain}` bất cứ lúc nào (đặc biệt **sau mỗi codegen session trong umbrella mode**) để:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
/validate-traces {domain}
|
|
138
|
+
→ Reads .trace/*.tsv authoritative (committed) từ MỘT chỗ: {spec_source}/.trace/
|
|
139
|
+
(mỗi scenario mang @trace.service — không cần quét/merge từng service)
|
|
140
|
+
→ Writes trace-report.json → {spec_source}/.living-docs/ (generated, gitignored)
|
|
141
|
+
→ Writes panel mirror → ./.trace của workspace hiện tại (non-empty khi mở repo lẻ)
|
|
142
|
+
→ Living Docs panel cập nhật ngay
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Báo cáo: scenario nào chưa có code (GAP) · code nào gen từ PRD/BDD cũ (DRIFT) · broken links / orphan BDD (không có PRD) / dead code traces · coverage % per domain.
|
|
146
|
+
|
|
147
|
+
**Khi nào chạy:** sau refactor đổi tên file/function · sau khi PO cập nhật PRD (version mới) · trước PR lớn · khi CI báo trace validation fail · sau mỗi codegen session (umbrella).
|
|
148
|
+
|
|
149
|
+
> **Nguyên tắc:** không merge code khi traces broken — fix traces trước. `/sync` cũng regenerate Living Docs như một bước phụ; `/validate-traces` là lệnh chuyên trách kiểm tra trace chain.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › Operations
|
|
2
|
+
|
|
3
|
+
# 04 · Operations
|
|
4
|
+
|
|
5
|
+
> Vận hành hằng ngày với framework: đồng bộ nội dung & nâng cấp framework, quy trình xử lý bug, và publish package lên npm.
|
|
6
|
+
|
|
7
|
+
Mục này dành cho cả team (PO · Dev · QC/Tester) và người maintain framework.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Trong mục này
|
|
12
|
+
|
|
13
|
+
| Trang | Nội dung |
|
|
14
|
+
|-------|----------|
|
|
15
|
+
| [Sync & Update](sync-and-update.md) | `/sync` vs `/update-framework`, umbrella mode, đồng bộ Living Docs, workflow hằng ngày theo role |
|
|
16
|
+
| [Bug Flow](bug-flow.md) | Phân loại bug theo spec layer (Code/BDD/PRD/Design/Env), 6 case, format thông báo, checklist đóng bug |
|
|
17
|
+
| [Publishing](publishing.md) | Build + publish `@edupia-tutor/spec-driven-docs` lên npm, versioning, transfer ownership |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Hai loại "update" — đừng nhầm
|
|
22
|
+
|
|
23
|
+
| | `/sync` | `/update-framework` |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| Update cái gì | Nội dung dự án: code/specs trong submodule + Living Docs | Bản thân framework: commands, steps, modules |
|
|
26
|
+
| Nguồn | Git remote của submodule | npm registry |
|
|
27
|
+
| Tần suất | Mỗi sáng / trước khi work | Khi có version framework mới (hiếm) |
|
|
28
|
+
|
|
29
|
+
Chi tiết: [Sync & Update](sync-and-update.md).
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
*Xem thêm:* [02 · Guides](../02-guides/) (theo vai trò) · [03 · Concepts](../03-concepts/) (kiến trúc) · [05 · Reference](../05-reference/) (tra cứu lệnh).
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › [Operations](README.md) › Bug Flow
|
|
2
|
+
|
|
3
|
+
# Bug Flow — PO · Dev · QC/Tester
|
|
4
|
+
|
|
5
|
+
> Cách **PO, Dev, và QC/Tester phối hợp** khi phát hiện bug. Mọi bug đều được trace về spec layer để fix đúng chỗ và tránh lặp lại.
|
|
6
|
+
|
|
7
|
+
> **QC cũng là nguồn bug.** Pipeline `/qc-*` đẩy vào **cùng** flow này: `/qc-run-test` FAIL = `product-gap` → `/report-bug {UC-ID}`; `/qc-analyze` `DOC_GAPS` blocker (spec sai/mơ hồ) → `/report-bug` (Case 2/3) hoặc thiếu coverage → `/propose-scenario`. Cùng phân loại Case 1–6 bên dưới. Chi tiết: [chương QC Automation](../02-guides/tester/qc-automation.md#khi-qc-tìm-thấy-bug--spec-gap--đẩy-lên-specs).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Mục lục
|
|
12
|
+
|
|
13
|
+
1. [Bug thuộc layer nào?](#1-bug-thuộc-layer-nào)
|
|
14
|
+
2. [Bảng quyết định nhanh](#2-bảng-quyết-định-nhanh)
|
|
15
|
+
3. [Case 1 — Code Bug (Code ≠ BDD)](#3-case-1--code-bug-code--bdd)
|
|
16
|
+
4. [Case 2 — BDD Bug (BDD ≠ PRD)](#4-case-2--bdd-bug-bdd--prd)
|
|
17
|
+
5. [Case 3 — PRD Ambiguity (PRD không rõ)](#5-case-3--prd-ambiguity-prd-không-rõ)
|
|
18
|
+
6. [Case 4 — PRD Change (yêu cầu thay đổi)](#6-case-4--prd-change-yêu-cầu-thay-đổi)
|
|
19
|
+
7. [Case 5 — Design Spec Bug (UI ≠ Design Spec)](#7-case-5--design-spec-bug-ui--design-spec)
|
|
20
|
+
8. [Case 6 — Environment / Data Bug](#8-case-6--environment--data-bug)
|
|
21
|
+
9. [Giao tiếp hiệu quả — các format thông báo](#9-giao-tiếp-hiệu-quả--các-format-thông-báo)
|
|
22
|
+
10. [Checklist đóng bug](#10-checklist-đóng-bug)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 1. Bug thuộc layer nào?
|
|
27
|
+
|
|
28
|
+
Tester đọc spec chain **PRD → BDD → Code** để xác định layer của bug:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
┌─────────────────────────────┐
|
|
32
|
+
│ Bug được phát hiện │
|
|
33
|
+
└──────────────┬──────────────┘
|
|
34
|
+
┌──────────────▼──────────────┐
|
|
35
|
+
│ Tester đọc PRD → BDD → Code │
|
|
36
|
+
└──────────────┬──────────────┘
|
|
37
|
+
┌────────────────────┼────────────────────┐
|
|
38
|
+
┌───────▼───────┐ ┌─────────▼─────────┐ ┌────────▼────────┐
|
|
39
|
+
│ PRD mơ hồ / │ │ BDD sai so PRD / │ │ Code sai so BDD │
|
|
40
|
+
│ yêu cầu đổi │ │ thiếu scenario │ │ (phổ biến nhất) │
|
|
41
|
+
└───────┬───────┘ └─────────┬─────────┘ └────────┬────────┘
|
|
42
|
+
→ PO xử lý → Dev xử lý → Dev xử lý
|
|
43
|
+
(Case 3, 4) (Case 2) (Case 1)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 2. Bảng quyết định nhanh
|
|
49
|
+
|
|
50
|
+
| PRD | BDD | Code | Chẩn đoán | Ai fix | Re-test |
|
|
51
|
+
|---|---|---|---|---|---|
|
|
52
|
+
| ✅ rõ ràng | ✅ đúng | ❌ sai | **Code bug** | Dev | Tester |
|
|
53
|
+
| ✅ rõ ràng | ❌ sai | ❌ sai | **BDD bug** | Dev | Tester |
|
|
54
|
+
| ❌ mơ hồ | bất kỳ | bất kỳ | **PRD ambiguity** | PO → Dev | Tester |
|
|
55
|
+
| ✅ rõ ràng | ✅ đúng | ✅ đúng | **Env / data bug** | DevOps / Dev | Tester |
|
|
56
|
+
| Yêu cầu thay đổi | cũ | cũ | **PRD change** | PO → Dev | Tester |
|
|
57
|
+
| ✅ rõ ràng | ✅ đúng | ❌ UI sai | **Design Spec bug** | PO/Designer → Dev | Tester |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 3. Case 1 — Code Bug (Code ≠ BDD)
|
|
62
|
+
|
|
63
|
+
> Phổ biến nhất. Spec đúng, code implement sai.
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Tester Dev
|
|
67
|
+
────── ────────────────────────────────────────────
|
|
68
|
+
Gửi bug report
|
|
69
|
+
(kèm spec context:
|
|
70
|
+
PRD path, BDD path,
|
|
71
|
+
AC bị vi phạm,
|
|
72
|
+
BDD scenario fail)
|
|
73
|
+
Nhận bug report; đọc BDD scenario được chỉ định
|
|
74
|
+
/fix-bug "{BUG-ID}: {mô tả}"
|
|
75
|
+
→ agent tìm divergence code vs BDD → propose fix
|
|
76
|
+
Review + apply fix
|
|
77
|
+
/dev-run-test → dev self-check pass ✅
|
|
78
|
+
(dev_selftest — smoke check, KHÔNG phải official QC;
|
|
79
|
+
QC pipeline /qc-run-test set qc_status ở flow riêng)
|
|
80
|
+
/validate-traces → no broken
|
|
81
|
+
Tạo PR + notify tester:
|
|
82
|
+
"Fixed — root cause: {X}; Re-test: {BDD scenario}"
|
|
83
|
+
Nhận thông báo; re-test scenario
|
|
84
|
+
→ PASS: đóng bug
|
|
85
|
+
→ FAIL: gửi lại với actual behavior mới
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Ví dụ:**
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Bug: FT-001 — tài khoản khoá sau 6 lần sai, không phải 5
|
|
92
|
+
PRD AC3 : "5 lần sai → khoá" ✅
|
|
93
|
+
BDD SC3 : "When 5 failures, Then 423" ✅
|
|
94
|
+
Code : if failCount > 5: lock() ❌ ← > thay vì >=
|
|
95
|
+
Fix: đổi > thành >= → chạy BDD test → pass
|
|
96
|
+
→ notify: "Case 1 fixed, re-test FT-001-UC2-SC3"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
> **Nếu root cause là lỗi AI hay lặp khi gen code** (vd dùng `>` thay vì `>=` cho boundary, hay gọi repository thẳng từ controller): `/fix-bug` sẽ hỏi *"Record as a project lesson? (Y/N)"* → chọn **Y**. Lesson được nạp vào mọi lần gen sau. Hoặc chủ động `/learn "AI hay X, đúng phải Y"`.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 4. Case 2 — BDD Bug (BDD ≠ PRD)
|
|
104
|
+
|
|
105
|
+
> Dev gen BDD sai từ đầu, hoặc PRD đã update nhưng BDD chưa.
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Tester Dev PO/BA
|
|
109
|
+
────── ──────────── ──────
|
|
110
|
+
Gửi bug report
|
|
111
|
+
(BDD scenario mâu
|
|
112
|
+
thuẫn với PRD AC)
|
|
113
|
+
Đọc PRD → BDD: xác nhận BDD sai
|
|
114
|
+
Nếu PRD rõ ràng:
|
|
115
|
+
→ update BDD scenario + code nếu cần
|
|
116
|
+
→ /dev-run-test → dev self-check pass
|
|
117
|
+
→ /validate-traces → PR + notify
|
|
118
|
+
Nếu PRD chưa đủ rõ → báo PO
|
|
119
|
+
Clarify PRD
|
|
120
|
+
(không đổi version
|
|
121
|
+
nếu chỉ làm rõ)
|
|
122
|
+
Update BDD + code → PR + notify
|
|
123
|
+
Re-test
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Ví dụ:**
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
Bug: FT-001 — BDD ghi "3 lần sai → khoá", PRD ghi "5 lần"
|
|
130
|
+
PRD AC3 : "5 lần sai → khoá" ✅
|
|
131
|
+
BDD SC3 : "When 3 failures, Then 423" ❌ ← dev gen BDD sai
|
|
132
|
+
Code : if failCount >= 3: lock() ❌ ← code theo BDD sai
|
|
133
|
+
Fix: 1) BDD 3→5 2) code >=3 → >=5 3) update test data
|
|
134
|
+
→ notify: "BDD + code fixed, re-test với 5 lần"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 5. Case 3 — PRD Ambiguity (PRD không rõ)
|
|
140
|
+
|
|
141
|
+
> Không ai sai — PRD viết thiếu, dev và tester hiểu khác nhau.
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Tester Dev PO/BA
|
|
145
|
+
────── ──────────── ──────
|
|
146
|
+
Gửi bug report
|
|
147
|
+
(AC mơ hồ: dev hiểu
|
|
148
|
+
X, tester expect Y)
|
|
149
|
+
Đọc PRD → xác nhận AC chưa đủ rõ
|
|
150
|
+
KHÔNG tự fix code
|
|
151
|
+
Báo PO: "AC3 mơ hồ: dev assume 5 lần,
|
|
152
|
+
tester expect 3. Đúng là bao nhiêu?"
|
|
153
|
+
Quyết định: 5 lần
|
|
154
|
+
Update PRD AC3
|
|
155
|
+
Bump version nếu
|
|
156
|
+
thay đổi behavior
|
|
157
|
+
Notify dev + tester
|
|
158
|
+
Nhận PRD mới; update BDD/code nếu cần
|
|
159
|
+
/validate-traces → PR + notify
|
|
160
|
+
Re-test theo PRD mới
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Ví dụ:**
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
PRD AC3: "Sai password nhiều lần → khoá tài khoản" ← "nhiều lần" = bao nhiêu?
|
|
167
|
+
Dev assume 5 lần; Tester expect 3 lần (thông lệ ngân hàng)
|
|
168
|
+
→ Không phải bug code/BDD — là PRD thiếu thông tin
|
|
169
|
+
→ PO quyết định 5 lần: "Sai password 5 lần liên tiếp → khoá 30 phút"
|
|
170
|
+
→ BDD đã đúng → chỉ close bug, không fix code
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 6. Case 4 — PRD Change (yêu cầu thay đổi)
|
|
176
|
+
|
|
177
|
+
> Không phải bug — business requirement thay đổi sau khi đã implement.
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
Tester Dev PO/BA
|
|
181
|
+
────── ──────────── ──────
|
|
182
|
+
Gửi bug report
|
|
183
|
+
(behavior đổi theo
|
|
184
|
+
yêu cầu business mới)
|
|
185
|
+
So sánh PRD version: code theo v1.0,
|
|
186
|
+
tester expect v1.1 → báo PO xác nhận
|
|
187
|
+
Xác nhận: PRD change,
|
|
188
|
+
không phải bug
|
|
189
|
+
Update PRD v1.1
|
|
190
|
+
Notify dev + tester
|
|
191
|
+
Nhận PRD v1.1
|
|
192
|
+
/review-context → xem diff
|
|
193
|
+
Update BDD + code + tests
|
|
194
|
+
/validate-traces → PR + notify:
|
|
195
|
+
"Implemented per PRD v1.1; re-test behavior mới"
|
|
196
|
+
Re-test theo PRD v1.1
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Lưu ý quan trọng:** Bug report phải được **re-classify** thành "PRD Change Request" trước khi xử lý — không đưa vào bug backlog.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 7. Case 5 — Design Spec Bug (UI ≠ Design Spec)
|
|
204
|
+
|
|
205
|
+
> Chỉ áp dụng cho FE/App. Code không khớp Design Spec.
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
Tester Dev (FE/App) PO/BA + Designer
|
|
209
|
+
────── ──────────── ──────────────────
|
|
210
|
+
Gửi bug report
|
|
211
|
+
(screen X không khớp
|
|
212
|
+
Design Spec section Y)
|
|
213
|
+
Đọc Design Spec → xác nhận spec nói gì
|
|
214
|
+
Nếu code sai Design Spec:
|
|
215
|
+
→ fix code theo spec → PR + notify
|
|
216
|
+
Nếu Design Spec sai/lỗi thời:
|
|
217
|
+
→ báo PO/Designer
|
|
218
|
+
Review + update Design Spec
|
|
219
|
+
Notify dev
|
|
220
|
+
Nhận Design Spec mới → fix code → PR + notify
|
|
221
|
+
Re-test UI
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 8. Case 6 — Environment / Data Bug
|
|
227
|
+
|
|
228
|
+
> Spec đúng hết, code đúng hết — lỗi ở infra hoặc test data.
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
Dấu hiệu nhận biết:
|
|
232
|
+
- Bug chỉ xảy ra trên staging, không reproduce local
|
|
233
|
+
- Bug xảy ra với 1 user cụ thể, không với user khác
|
|
234
|
+
- Bug xảy ra sau deploy, không trước
|
|
235
|
+
- /dev-run-test (dev_selftest — dev self-check) pass nhưng manual / QC test fail
|
|
236
|
+
|
|
237
|
+
Xử lý:
|
|
238
|
+
Tester → cung cấp: environment, user ID, timestamp, request ID
|
|
239
|
+
Dev → check logs, config, database state
|
|
240
|
+
DevOps → check infra, env vars, deploy artifacts
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## 9. Giao tiếp hiệu quả — các format thông báo
|
|
246
|
+
|
|
247
|
+
### Git flow của feedback loop (2 repo, 1 vòng)
|
|
248
|
+
|
|
249
|
+
Mọi feedback đi qua **git**, không qua chat: file được ghi vào spec repo, commit+push, rồi PO/Dev kéo về bằng `/sync`. Đây là đường đi đầy đủ — từ lúc QC/Tester phát hiện tới lúc bug `Closed`:
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
QC / Tester SPEC REPO (PO sở hữu) SERVICE SUBMODULE (Dev sở hữu)
|
|
253
|
+
───────────── ───────────────────── ──────────────────────────────
|
|
254
|
+
/report-bug read-only
|
|
255
|
+
/propose-scenario specs/code
|
|
256
|
+
(QC: /qc-run-test FAIL,
|
|
257
|
+
/qc-analyze DOC_GAPS)
|
|
258
|
+
│ ghi file ──────────────▶ feedback/bug-reports/*.md (KHÔNG sửa specs/code trực tiếp)
|
|
259
|
+
feedback/bdd-proposals/*.md
|
|
260
|
+
feedback/prd-change-requests/*.md
|
|
261
|
+
State: Open
|
|
262
|
+
│ git commit + push (tầng spec repo)
|
|
263
|
+
▼
|
|
264
|
+
origin(spec) ──── /sync (PO/Dev pull) ────┐
|
|
265
|
+
▼
|
|
266
|
+
┌──────────────── phân loại (Case 1–6) ───────────────┐
|
|
267
|
+
▼ ▼
|
|
268
|
+
PRD/BDD gap → PO sửa PRD + bump Code bug → Dev /fix-bug {BUG-ID}
|
|
269
|
+
→ commit+push spec repo → set State: Fixed
|
|
270
|
+
→ /generate-bdd lại → commit+push service (tầng 1)
|
|
271
|
+
│ + umbrella pointer (tầng 2)
|
|
272
|
+
└───────────────────┬──────────────────┘
|
|
273
|
+
▼
|
|
274
|
+
QC /qc-run-test re-verify ──── pass ──▶ State: Closed
|
|
275
|
+
(qc_owner / qc_blocked_by tự clear)
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
- **2 tầng push** chỉ áp dụng phía service submodule (xem [Sync & Update §4.4](sync-and-update.md#44--commit-2-tầng-thay-đổi-trong-service-submodule)); feedback file nằm trong **spec repo** nên chỉ cần push 1 tầng ở đó.
|
|
279
|
+
- `/sync` chỉ surface bug `State: Open`; `Fixed`/`Closed` để riêng (xem [§10](#10-checklist-đóng-bug)).
|
|
280
|
+
|
|
281
|
+
### Bug report (Tester → Dev)
|
|
282
|
+
|
|
283
|
+
Tester chạy `/report-bug {UC-ID} {mô tả}` → tự sinh report theo format dưới (gồm phân loại layer + phát hiện coverage gap), commit+push vào **spec repo** `feedback/bug-reports/{BUG-ID}.md`. PO/Dev thấy khi chạy `/sync` (dòng `📥 New tester feedback`):
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
[BUG-{ID}] {Feature} — {mô tả ngắn}
|
|
287
|
+
|
|
288
|
+
Spec: {PRD path} v{x.x} | AC{N}: "{AC text}"
|
|
289
|
+
BDD: {BDD path} → "{Scenario title}" (hoặc: ⚠️ no scenario covers this)
|
|
290
|
+
Layer: Code / BDD / PRD / Env ← Tester đề xuất, Dev xác nhận
|
|
291
|
+
|
|
292
|
+
Expected: {theo spec}
|
|
293
|
+
Actual: {thực tế}
|
|
294
|
+
Repro: {steps}
|
|
295
|
+
Env: staging / {date deploy}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
> **Nếu Layer = "coverage gap"** (behavior đúng nhưng chưa scenario nào cover): tester chạy `/propose-scenario {UC-ID}` → draft scenario vào `bdd-proposals/` cho PO/Dev duyệt. Xem [Case 2](#4-case-2--bdd-bug-bdd--prd).
|
|
299
|
+
|
|
300
|
+
### Fix xong (Dev → Tester)
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
[BUG-{ID}] Fixed ✅
|
|
304
|
+
|
|
305
|
+
Root cause: Case {1..6} — {mô tả ngắn}
|
|
306
|
+
Changed:
|
|
307
|
+
- {file/component}: {what changed}
|
|
308
|
+
- BDD: {updated / unchanged}
|
|
309
|
+
- PRD: {unchanged / clarified by PO}
|
|
310
|
+
|
|
311
|
+
Deploy: staging @ {time} — {commit/PR link}
|
|
312
|
+
Re-test: {BDD scenario ID hoặc AC number}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Cần PO clarify (Dev → PO)
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
[PRD-CLARIFY] {Feature} — AC{N} mơ hồ
|
|
319
|
+
|
|
320
|
+
Tình huống:
|
|
321
|
+
Dev implement: {X}
|
|
322
|
+
Tester expect: {Y}
|
|
323
|
+
Triggered by: BUG-{ID}
|
|
324
|
+
|
|
325
|
+
PRD AC hiện tại: "{AC text}"
|
|
326
|
+
|
|
327
|
+
Câu hỏi: {câu hỏi cụ thể — 1 câu}
|
|
328
|
+
Cần trả lời trước: {date} để unblock tester
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## 10. Checklist đóng bug
|
|
334
|
+
|
|
335
|
+
Trước khi đánh "Resolved":
|
|
336
|
+
|
|
337
|
+
**Dev:**
|
|
338
|
+
- [ ] Root cause xác định rõ (Case 1/2/3/4/5/6)
|
|
339
|
+
- [ ] Fix đúng layer — không patch code khi lỗi ở BDD hoặc PRD
|
|
340
|
+
- [ ] `/validate-traces` → no broken traces
|
|
341
|
+
- [ ] `/dev-run-test` → dev self-check pass (`dev_selftest` — smoke check, KHÔNG thay official QC `qc_status` do `/qc-run-test` set)
|
|
342
|
+
- [ ] Nếu root cause là lỗi AI gen hay lặp → đã `/learn` (hoặc accept prompt khi `/fix-bug`)
|
|
343
|
+
- [ ] Notify tester với đầy đủ thông tin re-test
|
|
344
|
+
|
|
345
|
+
**Tester / QC:**
|
|
346
|
+
- [ ] Re-test đúng scenario được chỉ định (QC: `/qc-run-test {UC-ID}` lại → `qc_status` flip `fail → pass`)
|
|
347
|
+
- [ ] Kiểm tra regression: các AC khác của cùng PRD không bị ảnh hưởng
|
|
348
|
+
- [ ] Confirm PASS trước khi close
|
|
349
|
+
|
|
350
|
+
**Vòng đời bug report (đừng để `feedback/` phình mãi):**
|
|
351
|
+
- [ ] `State` của `feedback/bug-reports/{BUG-ID}.md`: `🟢 Open` → `🟡 Fixed` (set bởi `/fix-bug {BUG-ID}`) → `🟢 Closed` (sau khi `/qc-run-test` re-verify pass).
|
|
352
|
+
- [ ] Khi `Closed`: `/qc-run-test` clear `qc_owner`/`qc_blocked_by` của SC (tự động khi `qc_status=pass`); tuỳ chọn move file sang `feedback/bug-reports/archive/`.
|
|
353
|
+
- [ ] `/sync` chỉ surface bug `State: Open` là "đang chờ" — Fixed/Closed không làm nhiễu PO/PM.
|
|
354
|
+
|
|
355
|
+
**PO** *(nếu PRD được cập nhật)*:
|
|
356
|
+
- [ ] PRD version mới đã được bump
|
|
357
|
+
- [ ] Changelog có entry cho thay đổi
|
|
358
|
+
- [ ] Notify dev và tester về version mới
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
*Xem thêm:* [Sync & Update](sync-and-update.md) · [Guide · Tester](../02-guides/tester/README.md) · [chương QC Automation](../02-guides/tester/qc-automation.md).
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
[📚 Docs](../README.md) › [Operations](README.md) › Publishing
|
|
2
|
+
|
|
3
|
+
# Publishing — Publish lên npm
|
|
4
|
+
|
|
5
|
+
> Hướng dẫn publish package `@edupia-tutor/spec-driven-docs` lên npm: setup lần đầu, publish version mới, kiểm tra sau publish, và transfer ownership.
|
|
6
|
+
|
|
7
|
+
Package: `@edupia-tutor/spec-driven-docs`
|
|
8
|
+
Registry: <https://www.npmjs.com/package/@edupia-tutor/spec-driven-docs>
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Mục lục
|
|
13
|
+
|
|
14
|
+
1. [Yêu cầu](#1-yêu-cầu)
|
|
15
|
+
2. [Setup lần đầu](#2-setup-lần-đầu)
|
|
16
|
+
3. [Publish version mới](#3-publish-version-mới)
|
|
17
|
+
4. [Kiểm tra sau khi publish](#4-kiểm-tra-sau-khi-publish)
|
|
18
|
+
5. [Transfer package sang account khác](#5-transfer-package-sang-account-khác)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. Yêu cầu
|
|
23
|
+
|
|
24
|
+
- Node.js đã cài (`node -v`)
|
|
25
|
+
- Tài khoản npm: <https://www.npmjs.com> — account có quyền publish vào scope `@edupia-tutor`
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Setup lần đầu
|
|
30
|
+
|
|
31
|
+
### 2.1 — Đăng nhập npm
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
npm login
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Trình duyệt sẽ mở trang xác thực npm. Đăng nhập bằng account có quyền publish vào scope `@edupia-tutor`, sau đó quay lại terminal. Kiểm tra:
|
|
38
|
+
|
|
39
|
+
```powershell
|
|
40
|
+
npm whoami
|
|
41
|
+
# output: <npm-username>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2.2 — Tạo Access Token (nếu cần dùng CI hoặc tránh 2FA mỗi lần)
|
|
45
|
+
|
|
46
|
+
1. Vào <https://www.npmjs.com> → Avatar → **Access Tokens**
|
|
47
|
+
2. **Generate New Token** → **Granular Access Token**
|
|
48
|
+
3. Điền:
|
|
49
|
+
- Name: `publish-spec-driven-docs`
|
|
50
|
+
- Expiration: 1 year
|
|
51
|
+
- Packages: chọn `@edupia-tutor/spec-driven-docs` → **Read and write**
|
|
52
|
+
4. Copy token, lưu vào nơi an toàn
|
|
53
|
+
|
|
54
|
+
Publish với token:
|
|
55
|
+
|
|
56
|
+
```powershell
|
|
57
|
+
npm publish --token <your-token>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 3. Publish version mới
|
|
63
|
+
|
|
64
|
+
### Bước 1 — Cập nhật nội dung commands (nếu có thay đổi)
|
|
65
|
+
|
|
66
|
+
Sửa các file trong thư mục `commands/`.
|
|
67
|
+
|
|
68
|
+
### Bước 2 — Tăng version trong `package.json` (semver)
|
|
69
|
+
|
|
70
|
+
| Loại thay đổi | Lệnh | Ví dụ |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| Fix nhỏ, sửa lỗi | `npm version patch` | 0.1.0 → 0.1.1 |
|
|
73
|
+
| Thêm command mới | `npm version minor` | 0.1.0 → 0.2.0 |
|
|
74
|
+
| Thay đổi lớn, breaking | `npm version major` | 0.1.0 → 1.0.0 |
|
|
75
|
+
|
|
76
|
+
```powershell
|
|
77
|
+
# Ví dụ: thêm command mới
|
|
78
|
+
npm version minor
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Lệnh này tự động cập nhật `version` trong `package.json` và tạo git commit + tag.
|
|
82
|
+
|
|
83
|
+
### Bước 3 — Publish
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
npm publish
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Bước 4 — Push git (bao gồm tag vừa tạo)
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
git push && git push --tags
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 4. Kiểm tra sau khi publish
|
|
98
|
+
|
|
99
|
+
```powershell
|
|
100
|
+
# Xem version mới trên npm
|
|
101
|
+
npm view @edupia-tutor/spec-driven-docs version
|
|
102
|
+
|
|
103
|
+
# Chạy thử
|
|
104
|
+
npx @edupia-tutor/spec-driven-docs@latest
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 5. Transfer package sang account khác
|
|
110
|
+
|
|
111
|
+
Khi cần chuyển quyền sở hữu package cho người khác (ví dụ: sang account `edupia-tutor`):
|
|
112
|
+
|
|
113
|
+
### Thêm maintainer
|
|
114
|
+
|
|
115
|
+
```powershell
|
|
116
|
+
npm owner add <npm-username> @edupia-tutor/spec-driven-docs
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Transfer toàn bộ
|
|
120
|
+
|
|
121
|
+
```powershell
|
|
122
|
+
npm access grant read-write <npm-username> @edupia-tutor/spec-driven-docs
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Hoặc làm thủ công trên website:
|
|
126
|
+
|
|
127
|
+
1. Vào <https://www.npmjs.com/package/@edupia-tutor/spec-driven-docs>
|
|
128
|
+
2. Tab **Settings** → **Maintainers** → thêm username mới
|
|
129
|
+
|
|
130
|
+
> **Lưu ý:** Nếu muốn đổi tên package, cần publish lại với tên mới vì npm không cho đổi tên package đã publish. Sau đó deprecate package cũ:
|
|
131
|
+
> ```powershell
|
|
132
|
+
> npm deprecate @edupia-tutor/spec-driven-docs "Moved to <new-package-name>"
|
|
133
|
+
> ```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
*Xem thêm:* [Sync & Update](sync-and-update.md) (`/update-framework` kéo version mới từ npm về project) · [Bug Flow](bug-flow.md).
|