@educa-corp/sdd-framework 0.1.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 +609 -0
- package/commands/debug.md +835 -0
- package/commands/debug.tmpl +257 -0
- package/commands/define-product.md +746 -0
- package/commands/define-product.tmpl +191 -0
- package/commands/dev-gen-test.md +1015 -0
- package/commands/dev-gen-test.tmpl +490 -0
- package/commands/dev-run-test.md +749 -0
- package/commands/dev-run-test.tmpl +224 -0
- package/commands/dev-smoke-test.md +716 -0
- package/commands/dev-smoke-test.tmpl +217 -0
- package/commands/fix-bug.md +749 -0
- package/commands/fix-bug.tmpl +171 -0
- package/commands/generate-bdd.md +1144 -0
- package/commands/generate-bdd.tmpl +499 -0
- package/commands/generate-code.md +1038 -0
- package/commands/generate-code.tmpl +513 -0
- package/commands/generate-design-spec.md +1079 -0
- package/commands/generate-design-spec.tmpl +524 -0
- package/commands/generate-prd.md +945 -0
- package/commands/generate-prd.tmpl +166 -0
- package/commands/generate-spec-manifest.md +663 -0
- package/commands/generate-spec-manifest.tmpl +164 -0
- package/commands/generate-tech-docs.md +1249 -0
- package/commands/generate-tech-docs.tmpl +252 -0
- package/commands/learn.md +641 -0
- package/commands/learn.tmpl +63 -0
- package/commands/map-testids.md +580 -0
- package/commands/map-testids.tmpl +81 -0
- package/commands/propose-scenario.md +632 -0
- package/commands/propose-scenario.tmpl +133 -0
- package/commands/qc-analyze.md +611 -0
- package/commands/qc-analyze.tmpl +112 -0
- package/commands/qc-design-test.md +567 -0
- package/commands/qc-design-test.tmpl +68 -0
- package/commands/qc-plan.md +548 -0
- package/commands/qc-plan.tmpl +49 -0
- package/commands/qc-report.md +559 -0
- package/commands/qc-report.tmpl +60 -0
- package/commands/qc-review.md +552 -0
- package/commands/qc-review.tmpl +53 -0
- package/commands/qc-run-test.md +609 -0
- package/commands/qc-run-test.tmpl +84 -0
- package/commands/refine-prd.md +992 -0
- package/commands/refine-prd.tmpl +278 -0
- package/commands/report-bug.md +647 -0
- package/commands/report-bug.tmpl +148 -0
- package/commands/review-code.md +682 -0
- package/commands/review-code.tmpl +104 -0
- package/commands/review-context.md +1202 -0
- package/commands/review-context.tmpl +488 -0
- package/commands/review-tech-docs.md +871 -0
- package/commands/review-tech-docs.tmpl +372 -0
- package/commands/setup-ai-first.md +546 -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 +928 -0
- package/commands/validate-traces.tmpl +429 -0
- package/core/FRAMEWORK_VERSION +1 -0
- package/core/commands/debug.md +835 -0
- package/core/commands/define-product.md +746 -0
- package/core/commands/dev-gen-test.md +1015 -0
- package/core/commands/dev-run-test.md +749 -0
- package/core/commands/dev-smoke-test.md +716 -0
- package/core/commands/fix-bug.md +749 -0
- package/core/commands/generate-bdd.md +1144 -0
- package/core/commands/generate-code.md +1038 -0
- package/core/commands/generate-design-spec.md +1079 -0
- package/core/commands/generate-prd.md +945 -0
- package/core/commands/generate-spec-manifest.md +663 -0
- package/core/commands/generate-tech-docs.md +1249 -0
- package/core/commands/learn.md +641 -0
- package/core/commands/map-testids.md +580 -0
- package/core/commands/propose-scenario.md +632 -0
- package/core/commands/qc-analyze.md +611 -0
- package/core/commands/qc-design-test.md +567 -0
- package/core/commands/qc-plan.md +548 -0
- package/core/commands/qc-report.md +559 -0
- package/core/commands/qc-review.md +552 -0
- package/core/commands/qc-run-test.md +609 -0
- package/core/commands/refine-prd.md +992 -0
- package/core/commands/report-bug.md +647 -0
- package/core/commands/review-code.md +682 -0
- package/core/commands/review-context.md +1202 -0
- package/core/commands/review-tech-docs.md +871 -0
- package/core/commands/setup-ai-first.md +546 -0
- package/core/commands/sync.md +451 -0
- package/core/commands/update-framework.md +251 -0
- package/core/commands/validate-traces.md +928 -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 +19 -0
- package/core/skills/debug/SKILL.md +19 -0
- package/core/skills/design-spec/SKILL.md +11 -0
- package/core/skills/discovery/SKILL.md +14 -0
- package/core/skills/prd/SKILL.md +19 -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 +11 -0
- package/core/skills/spec/SKILL.md +19 -0
- package/core/skills/test/SKILL.md +18 -0
- package/core/steps/business-language.md +56 -0
- package/core/steps/capture-lesson.md +79 -0
- package/core/steps/context-loader.md +311 -0
- package/core/steps/gate.md +88 -0
- package/core/steps/report-footer.md +100 -0
- package/core/steps/review-fanout.md +159 -0
- package/core/steps/spawn-agent.md +129 -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 +120 -0
- package/core/templates/platform-guide.template.md +145 -0
- package/core/templates/prd.template.md +224 -0
- package/core/templates/product-definition.template.md +188 -0
- package/core/templates/project-context.yaml +161 -0
- package/core/templates/tech-design.template.md +498 -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 +86 -0
- package/docs/02-guides/README.md +26 -0
- package/docs/02-guides/bdd-input-checklist.md +68 -0
- package/docs/02-guides/developer/README.md +49 -0
- package/docs/02-guides/developer/bdd-and-trace.md +126 -0
- package/docs/02-guides/developer/commands.md +76 -0
- package/docs/02-guides/developer/pr-checklist.md +16 -0
- package/docs/02-guides/developer/scenarios.md +460 -0
- package/docs/02-guides/developer/workflow.md +121 -0
- package/docs/02-guides/prd-input-checklist.md +94 -0
- package/docs/02-guides/product-owner/README.md +81 -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 +438 -0
- package/docs/02-guides/tech-docs-input-checklist.md +109 -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 +20 -0
- package/docs/03-concepts/architecture.md +248 -0
- package/docs/03-concepts/mechanisms-explained.md +124 -0
- package/docs/03-concepts/pipeline.md +278 -0
- package/docs/03-concepts/traceability.md +152 -0
- package/docs/04-operations/README.md +33 -0
- package/docs/04-operations/bug-flow.md +364 -0
- package/docs/04-operations/publishing.md +154 -0
- package/docs/04-operations/sync-and-update.md +522 -0
- package/docs/05-reference/README.md +34 -0
- package/docs/05-reference/command-cheatsheet.md +147 -0
- package/docs/05-reference/commands.md +234 -0
- package/docs/05-reference/model-selection.md +74 -0
- package/docs/05-reference/modules.md +110 -0
- package/docs/05-reference/trace-schema.md +154 -0
- package/docs/06-commands/README.md +75 -0
- package/docs/06-commands/explain-debug.md +32 -0
- package/docs/06-commands/explain-define-product.md +43 -0
- package/docs/06-commands/explain-dev-gen-test.md +28 -0
- package/docs/06-commands/explain-dev-run-test.md +24 -0
- package/docs/06-commands/explain-dev-smoke-test.md +25 -0
- package/docs/06-commands/explain-fix-bug.md +28 -0
- package/docs/06-commands/explain-generate-bdd.md +45 -0
- package/docs/06-commands/explain-generate-code.md +53 -0
- package/docs/06-commands/explain-generate-design-spec.md +54 -0
- package/docs/06-commands/explain-generate-prd.md +45 -0
- package/docs/06-commands/explain-generate-spec-manifest.md +20 -0
- package/docs/06-commands/explain-generate-tech-docs.md +56 -0
- package/docs/06-commands/explain-learn.md +21 -0
- package/docs/06-commands/explain-map-testids.md +28 -0
- package/docs/06-commands/explain-propose-scenario.md +24 -0
- package/docs/06-commands/explain-qc-analyze.md +22 -0
- package/docs/06-commands/explain-qc-design-test.md +20 -0
- package/docs/06-commands/explain-qc-plan.md +21 -0
- package/docs/06-commands/explain-qc-report.md +23 -0
- package/docs/06-commands/explain-qc-review.md +24 -0
- package/docs/06-commands/explain-qc-run-test.md +27 -0
- package/docs/06-commands/explain-refine-prd.md +51 -0
- package/docs/06-commands/explain-report-bug.md +24 -0
- package/docs/06-commands/explain-review-code.md +45 -0
- package/docs/06-commands/explain-review-context.md +68 -0
- package/docs/06-commands/explain-review-tech-docs.md +45 -0
- package/docs/06-commands/explain-setup-ai-first.md +25 -0
- package/docs/06-commands/explain-sync.md +24 -0
- package/docs/06-commands/explain-update-framework.md +22 -0
- package/docs/06-commands/explain-validate-traces.md +25 -0
- package/docs/README.md +53 -0
- package/docs/t-sample.md +826 -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/readme.txt +1 -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 +258 -0
- package/scripts/rename-prd-files.js +174 -0
- package/scripts/upgrade.sh +94 -0
- package/skills/code/SKILL.md +19 -0
- package/skills/code/SKILL.tmpl +19 -0
- package/skills/debug/SKILL.md +19 -0
- package/skills/debug/SKILL.tmpl +19 -0
- package/skills/design-spec/SKILL.md +11 -0
- package/skills/design-spec/SKILL.tmpl +11 -0
- package/skills/discovery/SKILL.md +14 -0
- package/skills/discovery/SKILL.tmpl +14 -0
- package/skills/prd/SKILL.md +19 -0
- package/skills/prd/SKILL.tmpl +19 -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 +11 -0
- package/skills/setup-ai-first/SKILL.tmpl +11 -0
- package/skills/spec/SKILL.md +19 -0
- package/skills/spec/SKILL.tmpl +19 -0
- package/skills/test/SKILL.md +18 -0
- package/skills/test/SKILL.tmpl +18 -0
- package/steps/business-language.md +56 -0
- package/steps/capture-lesson.md +79 -0
- package/steps/context-loader.md +311 -0
- package/steps/gate.md +88 -0
- package/steps/report-footer.md +100 -0
- package/steps/review-fanout.md +159 -0
- package/steps/spawn-agent.md +129 -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 +120 -0
- package/templates/platform-guide.template.md +145 -0
- package/templates/prd.template.md +224 -0
- package/templates/product-definition.template.md +188 -0
- package/templates/project-context.yaml +161 -0
- package/templates/tech-design.template.md +498 -0
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
# /generate-design-spec — Sinh Design Specification (FE / App)
|
|
2
|
+
|
|
3
|
+
## Gate
|
|
4
|
+
{{include:steps/gate.md}}
|
|
5
|
+
|
|
6
|
+
*Lưu ý: Với lệnh này, target file là một Business PRD (`{TICKET-ID}-{prd-slug}.md` — file `.md` ở gốc feature folder) dưới `{paths.specs_dir}/{domain}/{prd-slug}/`. Phân giải từ `$ARGUMENTS` hoặc liệt kê thư mục và hỏi. Chỉ hỗ trợ PRD của FE và mobile — PRD của BE sẽ bị từ chối ở bước Platform Check.*
|
|
7
|
+
|
|
8
|
+
## Context
|
|
9
|
+
{{include:steps/context-loader.md}}
|
|
10
|
+
|
|
11
|
+
*Context bổ sung cho lệnh này: Đọc toàn bộ PRD target. Trích xuất: **TICKET-ID**, **domain**, **tên feature**, **Service** và **Module** từ metadata PRD (row `| **Service** |` và `| **Module** |`), User Flow (Section 4a), và tên màn hình Wireframe (Section 4b).*
|
|
12
|
+
|
|
13
|
+
*Quy tắc trích xuất Service (giống /generate-prd):*
|
|
14
|
+
- *Nếu metadata PRD có `| **Service** |` → dùng làm `active_service` và `| **Module** |` làm `active_module`.*
|
|
15
|
+
- *Nếu vắng VÀ `services` được định nghĩa trong `project-context.yaml` → hỏi: "Design Spec này dành cho service nào?" (chỉ liệt kê service FE/App, chờ chọn).*
|
|
16
|
+
- *Nếu dự án single-service → `active_service = "default"`, `active_module = tech_stack.module`.*
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Guard — PRD đã duyệt chưa
|
|
21
|
+
|
|
22
|
+
Đọc `| **Status** |` từ bảng Metadata của Business PRD nguồn:
|
|
23
|
+
- `Status: approved` → tiếp tục bình thường.
|
|
24
|
+
- `Status: draft` (hoặc khác `approved`) → **CHECKPOINT cảnh báo mềm** (không chặn cứng — cho phép prototype song song):
|
|
25
|
+
```
|
|
26
|
+
⚠️ Business PRD đang ở Status: {status} (chưa duyệt). Design Spec dựng trên PRD chưa chốt có thể phải làm lại theo PRD.
|
|
27
|
+
Khuyến nghị: PO duyệt PRD (đặt `| **Status** | approved |`) rồi mới sinh Design Spec.
|
|
28
|
+
Vẫn sinh Design Spec bây giờ? (Y/N)
|
|
29
|
+
```
|
|
30
|
+
Chỉ tiếp tục khi người dùng chọn Y.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Platform Check
|
|
35
|
+
|
|
36
|
+
Dùng `active_module` và `platform_type` suy ra từ context loading:
|
|
37
|
+
|
|
38
|
+
1. Nếu `platform_type = "backend"` → **STOP**. Xuất:
|
|
39
|
+
```
|
|
40
|
+
❌ Design Spec chỉ dành cho platform FE và mobile.
|
|
41
|
+
Với service BE, API contract thuộc về Business PRD (Use Case → section Business Logic).
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2. Nếu `platform_type = "web-frontend"` → set `active_platform = "web"`.
|
|
45
|
+
|
|
46
|
+
3. Nếu `platform_type = "mobile"`:
|
|
47
|
+
- `flutter` hoặc `react-native` → set `active_platform = "app"`
|
|
48
|
+
- `ios-swiftui` → set `active_platform = "app-ios"`
|
|
49
|
+
- `android-compose` → set `active_platform = "app-android"`
|
|
50
|
+
|
|
51
|
+
4. Nếu `platform_type = "unknown"` → hỏi: "Design Spec này dành cho platform nào?"
|
|
52
|
+
```
|
|
53
|
+
Options:
|
|
54
|
+
1 — web (React / Next.js / Vue / Angular)
|
|
55
|
+
2 — app (Flutter / React Native)
|
|
56
|
+
3 — app-ios (iOS SwiftUI)
|
|
57
|
+
4 — app-android (Android Compose)
|
|
58
|
+
```
|
|
59
|
+
Chờ chọn. Map lựa chọn sang `active_platform` và suy ra `active_module` nếu được.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Version Check (PRD drift)
|
|
64
|
+
|
|
65
|
+
Trước khi sinh, kiểm tra design-spec đã tồn tại cho platform này:
|
|
66
|
+
`{paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md`
|
|
67
|
+
Đọc `| **Version** |` hiện tại của PRD từ Metadata (vd `1.3`).
|
|
68
|
+
|
|
69
|
+
- **Không tồn tại** → sinh mới; ghi `| **Built from PRD** | v{prd_version hiện tại} |`.
|
|
70
|
+
- **Tồn tại** → đọc row `| **Built from PRD** |` của nó, so với `| **Version** |` PRD hiện tại:
|
|
71
|
+
- **Bằng nhau** → hỏi: "Design Spec đã dựng từ PRD v{x}. Sinh lại? (Y/N)".
|
|
72
|
+
- **Khác** (PRD đã đổi) → CHECKPOINT drift:
|
|
73
|
+
```
|
|
74
|
+
⚠️ Phát hiện PRD version drift
|
|
75
|
+
Design Spec dựng từ PRD v{old}; PRD giờ ở v{new}.
|
|
76
|
+
Thay đổi kể từ v{old} (đọc # Change Log của PRD):
|
|
77
|
+
{changelog rows}
|
|
78
|
+
Options:
|
|
79
|
+
Y — cập nhật phần ảnh hưởng (màn / flow đổi)
|
|
80
|
+
F — sinh lại toàn bộ
|
|
81
|
+
N — huỷ
|
|
82
|
+
```
|
|
83
|
+
- Khi sinh / sinh lại → cập nhật `| **Built from PRD** | v{prd_version hiện tại} |`, bump `| **Version** |` Design Spec, **reset `| **Status** | draft |`** (design đổi → sign-off lại), thêm row Changelog.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Screen Discovery
|
|
88
|
+
|
|
89
|
+
Từ Section 4 của PRD (User Flow + Wireframe), trích xuất mọi tên screen / page / modal được nhắc tới.
|
|
90
|
+
|
|
91
|
+
Trình bày danh sách và hỏi PO xác nhận:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Screens detected from PRD:
|
|
95
|
+
1. {Screen name 1}
|
|
96
|
+
2. {Screen name 2}
|
|
97
|
+
...
|
|
98
|
+
|
|
99
|
+
Đây đã đủ các màn cho platform {active_platform} chưa?
|
|
100
|
+
Thêm màn còn thiếu, bỏ màn không áp dụng, hoặc xác nhận bằng Y.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Chờ xác nhận. Lưu danh sách đã xác nhận là `screen_list`.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Figma Frame Links *(bắt buộc — một link node-level đọc được cho mỗi màn)*
|
|
108
|
+
|
|
109
|
+
Một Design Spec chỉ tốt ngang với design mà nó trỏ tới. AI **không đọc được link file
|
|
110
|
+
trần** (`figma.com/design/{fileKey}/...` không có `node-id`) — nó cần một
|
|
111
|
+
**link node-level tới từng frame cụ thể** để fetch layout, component, và token thật của
|
|
112
|
+
frame đó qua Figma MCP. Vậy nên thu thập một link **mỗi màn**, không phải một
|
|
113
|
+
link cho cả feature.
|
|
114
|
+
|
|
115
|
+
**Hỏi PO, liệt kê mọi màn trong `screen_list`:**
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
Dán link Figma frame cho từng màn bên dưới.
|
|
119
|
+
|
|
120
|
+
Trong Figma: chọn frame → chuột phải → "Copy link to selection"
|
|
121
|
+
(URL phải chứa ?node-id=... — đó là link per-frame mà AI đọc được)
|
|
122
|
+
|
|
123
|
+
1. {Screen 1} : ____
|
|
124
|
+
2. {Screen 2} : ____
|
|
125
|
+
...
|
|
126
|
+
|
|
127
|
+
Nếu một màn chưa có design, gõ none cho màn đó.
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Với mỗi câu trả lời:**
|
|
131
|
+
|
|
132
|
+
1. **Validate format** — URL phải khớp `figma.com/design/{fileKey}/...?node-id={nodeId}`.
|
|
133
|
+
- Hợp lệ → lưu thành `figma_frames[{screen}] = {url}`, parse ra `fileKey` + `nodeId`.
|
|
134
|
+
- Link file **không có `node-id`** → từ chối: "Link này trỏ tới cả file, không phải một frame. Copy lại qua chuột phải → Copy link to selection." Hỏi lại màn đó.
|
|
135
|
+
- `none` → `figma_frames[{screen}] = "TBD"`, đánh dấu màn đó ❌ Missing.
|
|
136
|
+
|
|
137
|
+
2. **Fetch frame qua Figma MCP** (chỉ với link hợp lệ) — gọi `get_design_context`
|
|
138
|
+
(và `get_screenshot` khi hữu ích) với `fileKey` + `nodeId` đã parse để đọc
|
|
139
|
+
layout, tên component, và design token thật. Đặt mọi Screen Spec dựa trên dữ liệu
|
|
140
|
+
đã fetch này; **đừng** bịa layout mà frame không thể hiện. Nếu fetch thất bại
|
|
141
|
+
(permission / not found) → coi màn đó là ❌ Missing và ghi chú lỗi fetch.
|
|
142
|
+
|
|
143
|
+
3. Suy ra `figma_url` mức feature = link file (không có `node-id`) chung của các
|
|
144
|
+
frame, cho row Metadata. Nếu các frame trải nhiều file, liệt kê từng cái.
|
|
145
|
+
|
|
146
|
+
**Gate bắt buộc (không abort — sinh ra draft):**
|
|
147
|
+
- Nếu **bất kỳ** màn nào ❌ Missing → spec được sinh dưới dạng **draft** với các màn đó
|
|
148
|
+
được gắn cờ, `Status` giữ `draft` cho tới khi mọi màn có link frame đọc được, đã fetch.
|
|
149
|
+
`/generate-bdd` FE/App sẽ **cảnh báo mềm** (đồng bộ Guard PRD) nếu sinh BDD khi design-spec chưa `approved`. Ghi `missing_frames = [screens]`.
|
|
150
|
+
- Thêm một AI Assumption cho mỗi màn thiếu: "Không có Figma frame đọc được cho {screen} — spec
|
|
151
|
+
của màn này chỉ là text và không được sign off cho tới khi thêm link `node-id`."
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## CHECKPOINT
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
CHECKPOINT — Design Spec
|
|
159
|
+
-------------------------
|
|
160
|
+
Target PRD : {prd-file-path}
|
|
161
|
+
Platform : {active_platform}
|
|
162
|
+
Module : {active_module}
|
|
163
|
+
Service : {active_service}
|
|
164
|
+
Domain : {domain}
|
|
165
|
+
Screens : {N} — {screen_list ngăn cách bởi dấu phẩy}
|
|
166
|
+
Figma : {linked}/{N} màn có link frame đọc được{; missing: missing_frames ngăn cách bởi dấu phẩy}
|
|
167
|
+
Output path : {paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md
|
|
168
|
+
|
|
169
|
+
{Nếu missing_frames khác rỗng}:
|
|
170
|
+
⚠️ {count} màn không có link Figma frame đọc được — các màn này sẽ được sinh dưới dạng
|
|
171
|
+
draft chỉ-text và spec không thể sign off cho tới khi thêm link node-id.
|
|
172
|
+
|
|
173
|
+
Generate? (Y/N)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Chờ Y rõ ràng trước khi tiếp tục.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Ngôn ngữ — Language Guard *(áp khi viết mọi section)*
|
|
181
|
+
{{include:steps/business-language.md}}
|
|
182
|
+
|
|
183
|
+
**Design Language Guard — phân tầng bề mặt (bổ sung cho guard trên):**
|
|
184
|
+
|
|
185
|
+
Design Spec là cầu nối PRD → code, có **hai loại bề mặt** với ngôn ngữ khác nhau. Nguyên tắc: **không xoá chi tiết kỹ thuật — dồn về đúng tầng** (giống altitude AC/BR ở PRD).
|
|
186
|
+
|
|
187
|
+
- **Tầng A — bề mặt đọc (BẮT ngôn ngữ nghiệp vụ/UX):** §1 Screen Inventory (mọi cột), §2 Layout, cột "Hành vi UI" của Screen States, Actions & Navigation, blockquote mục đích màn, §5 AC-UI. Mô tả theo **vai trò/ý đồ** ("thanh tiến độ", "nút chính", "trạng thái chưa chọn đáp án"). **CẤM ở tầng này:** tên layer/variant Figma (`Q1--Selected`, `Base Design`), mã token/màu hex/số đo px-pt (`Primary/500 #0876B1`, `padding 16px`), định danh code, và ẩn dụ dữ liệu (Nhóm 4 của guard trên: cờ/giá trị/đọc-ghi khi là artifact).
|
|
188
|
+
- **Tầng B — cột/phụ lục kỹ thuật chuyên dụng (được giữ code):** Component Inventory (`Code Component`, `Import Path`), cột **Figma Frame** (link), bảng **Design Token** (phụ lục). Định danh Figma/code/token **chỉ** được xuất hiện ở đây.
|
|
189
|
+
|
|
190
|
+
Một state mô tả ở tầng A bằng lời ("chưa chọn đáp án → nút vô hiệu"); tên variant Figma của state đó (nếu cần) nằm ở cột Figma Frame / Component Inventory, KHÔNG lẫn vào prose.
|
|
191
|
+
|
|
192
|
+
## Generation Rules
|
|
193
|
+
|
|
194
|
+
Áp dụng các quy tắc này nhất quán khi sinh mọi section:
|
|
195
|
+
|
|
196
|
+
**Component mapping (C.M — bắt buộc):**
|
|
197
|
+
- Với mỗi component được tham chiếu, kiểm tra `figma-components/{active_module}.md` (đã nạp trong context).
|
|
198
|
+
- ✅ Matched → dùng đúng `Code Component` và `Import Path` từ catalog.
|
|
199
|
+
- ⚠️ Matched nhưng `[TODO]` → đánh dấu ô component là `[TODO — implementation pending]`.
|
|
200
|
+
- ❌ Không có trong catalog → đánh dấu `[NEW — confirm with designer before generating code]`.
|
|
201
|
+
- Không bao giờ bịa tên component hay import path.
|
|
202
|
+
|
|
203
|
+
**Section thích ứng theo platform:**
|
|
204
|
+
- Section 3 (Interaction Patterns) và Section 4 (Platform Considerations) thích ứng theo `active_platform`:
|
|
205
|
+
- `web` → gồm responsive breakpoint, trạng thái hover/focus, keyboard navigation, accessibility.
|
|
206
|
+
- `app` / `app-ios` / `app-android` → gồm gesture, safe area, touch target tối thiểu, navigation pattern, deep link, permission, hành vi offline.
|
|
207
|
+
- Chỉ sinh section liên quan tới `active_platform`. Bỏ hẳn section của platform kia.
|
|
208
|
+
|
|
209
|
+
**Figma grounding (bắt buộc):**
|
|
210
|
+
- Với mỗi màn có frame đã fetch (`figma_frames[screen]` là link hợp lệ), dựa Layout,
|
|
211
|
+
Component Inventory, và Screen States trên **dữ liệu Figma đã fetch** — tên component thật,
|
|
212
|
+
token thật, cấu trúc frame thật. Đừng mâu thuẫn hay bịa layout.
|
|
213
|
+
- Dùng đúng URL `figma_frames[screen]` từng-màn trong Screen Inventory, header mỗi Screen
|
|
214
|
+
Spec, và Figma Summary — không bao giờ dùng fragment giả `{figma_url}#screen1`.
|
|
215
|
+
- Với màn ❌ Missing: sinh draft chỉ-text từ PRD, thêm tiền tố vào Screen Spec
|
|
216
|
+
`> [DRAFT — no Figma frame; do not sign off]`, và để ô Figma là ❌ Missing.
|
|
217
|
+
|
|
218
|
+
**Screen states (bắt buộc mỗi màn):**
|
|
219
|
+
- Mỗi màn phải mô tả tối thiểu: `default`, `loading`, `error`.
|
|
220
|
+
- Thêm `empty` khi màn có thể hiển thị trạng thái không dữ liệu.
|
|
221
|
+
- Thêm `success` khi một action hoàn tất tạo ra trạng thái xác nhận riêng biệt.
|
|
222
|
+
- Nếu một state không áp dụng → đánh dấu `N/A` kèm lý do ngắn.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Generate
|
|
227
|
+
|
|
228
|
+
Ghi `{paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md`:
|
|
229
|
+
|
|
230
|
+
````markdown
|
|
231
|
+
# {TICKET-ID} {Feature Name} — Design Spec [{active_platform}]
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Metadata
|
|
236
|
+
|
|
237
|
+
| Field | Value |
|
|
238
|
+
|--------------------|---------------------------------------------------------------|
|
|
239
|
+
| **Spec ID** | {TICKET-ID}-DS-{active_platform} |
|
|
240
|
+
| **Version** | 1.0 |
|
|
241
|
+
| **Status** | draft |
|
|
242
|
+
| **Platform** | {active_platform} |
|
|
243
|
+
| **Module** | {active_module} |
|
|
244
|
+
| **Service** | {active_service} |
|
|
245
|
+
| **Domain** | {domain} |
|
|
246
|
+
| **Business PRD** | [{TICKET-ID}](../{TICKET-ID}-{prd-slug}.md) |
|
|
247
|
+
| **Built from PRD** | v{prd_version — `\| **Version** \|` của PRD lúc sinh; dùng phát hiện drift} |
|
|
248
|
+
| **Figma** | {figma_url — link file feature} ({linked}/{N} frame đã link) |
|
|
249
|
+
| **Author** | {tên PO hoặc "AI-assisted"} |
|
|
250
|
+
| **Created** | {YYYY-MM-DD} |
|
|
251
|
+
| **Updated** | {YYYY-MM-DD} |
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
# 1. Danh mục màn hình (Screen Inventory)
|
|
256
|
+
|
|
257
|
+
> **Tầng A:** cột **Điểm vào** và **Ghi chú** viết bằng ngôn ngữ nghiệp vụ — mô tả điều kiện/ý đồ. KHÔNG liệt kê states, KHÔNG tên component/variant Figma (states thuộc §2; tên Figma thuộc cột Figma Frame / §2). Vd Điểm vào: "khi con *chưa làm khảo sát* và có ít nhất một câu hỏi" — KHÔNG "cờ tình trạng = `chưa làm`".
|
|
258
|
+
|
|
259
|
+
| # | Tên màn hình | Điểm vào | Figma Frame | Ghi chú |
|
|
260
|
+
|---|-------------|-------------|-------------|-------|
|
|
261
|
+
| 1 | {Màn hình 1} | {điều kiện nghiệp vụ để vào màn — vd: "sau khi hoàn tất Nhập thông tin con và con chưa làm khảo sát"} | [Frame]({figma_frames[Screen 1]}) | {ghi chú nghiệp vụ nếu có — KHÔNG states/tên Figma} |
|
|
262
|
+
| 2 | {Màn hình 2} | {điểm vào — ngôn ngữ nghiệp vụ} | [Frame]({figma_frames[Screen 2]}) / ❌ Missing | |
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
# 2. Đặc tả màn hình (Screen Specs)
|
|
267
|
+
|
|
268
|
+
<!--
|
|
269
|
+
Lặp lại block này cho mỗi màn trong Screen Inventory.
|
|
270
|
+
Mỗi màn phải có: Layout, Component Inventory, Screen States, Actions & Navigation.
|
|
271
|
+
-->
|
|
272
|
+
|
|
273
|
+
## Màn hình 1: {Tên màn hình}
|
|
274
|
+
|
|
275
|
+
**Figma**: [{Tên frame}]({figma_frames[Screen 1]}) <!-- ❌ Missing → thêm tiền tố cho màn này `> [DRAFT — no Figma frame; do not sign off]` -->
|
|
276
|
+
|
|
277
|
+
### Layout
|
|
278
|
+
|
|
279
|
+
{Mô tả layout theo CẤU TRÚC & Ý ĐỒ bằng lời: thứ tự section trên→dưới, vai trò từng vùng, hệ phân cấp thị giác, hành vi co giãn. **KHÔNG rải mã token / màu hex / số đo px** trong văn xuôi — số đo & token cụ thể đặt ở cột Component Inventory và bảng Design Token (phụ lục, Tầng B). Vd: "một cột dọc, thanh tiến độ ở đầu, khu nội dung chính giữa, nút hành động cố định đáy màn".}
|
|
280
|
+
|
|
281
|
+
### Component Inventory
|
|
282
|
+
|
|
283
|
+
| Component (Figma) | Code Component | Import Path | States | Ghi chú |
|
|
284
|
+
|---------------------|-----------------|------------------------|---------------------------------|--------------------|
|
|
285
|
+
| {Figma/Button/Primary} | Button | @/components/ui/Button | default, loading, disabled | |
|
|
286
|
+
| {Figma/Input/Text} | TextInput | @/components/ui/Input | default, focus, error, disabled | |
|
|
287
|
+
| {Figma/Card/Order} | OrderCard | @/features/{domain}/components/OrderCard | default, skeleton | |
|
|
288
|
+
|
|
289
|
+
### Screen States
|
|
290
|
+
|
|
291
|
+
<!-- Tầng A: Trigger & Hành vi UI mô tả bằng lời quan sát được. KHÔNG tên variant Figma (Q1--Selected), KHÔNG "API/render/spinner" (→ "đang tải / hiển thị lại / vùng chờ"). Tên component/variant nếu cần → cột Figma / Component Inventory. -->
|
|
292
|
+
|
|
293
|
+
| State | Trigger | Hành vi UI (mô tả quan sát được) |
|
|
294
|
+
|-----------|---------------------------------------------|------------------------------------------------------|
|
|
295
|
+
| default | Màn đã hiển thị, có dữ liệu | {Mô tả giao diện người dùng thấy} |
|
|
296
|
+
| loading | Đang tải dữ liệu | {Vùng chờ / vị trí báo đang tải} |
|
|
297
|
+
| error | Tải dữ liệu thất bại / dữ liệu không hợp lệ | {Thông báo lỗi + hành động khôi phục} |
|
|
298
|
+
| empty | Không có dữ liệu để hiển thị | {Trạng thái trống + lời mời hành động} |
|
|
299
|
+
| success | Thao tác hoàn tất (nếu có) | {Xác nhận / chuyển màn / đổi trạng thái} |
|
|
300
|
+
|
|
301
|
+
### Actions & Navigation
|
|
302
|
+
|
|
303
|
+
| Action | Trigger | Kết quả |
|
|
304
|
+
|-----------------|--------------------------------|-------------------------------------------------|
|
|
305
|
+
| {Tên action} | Tap/click {tên phần tử} | Điều hướng tới {Màn hình N} / Mở {Tên modal} |
|
|
306
|
+
| {Tên action} | Swipe trái trên {list item} | Hiện xác nhận xoá |
|
|
307
|
+
| {Back / Cancel} | Cử chỉ back / nút Cancel | Quay lại {màn trước} mà không lưu |
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
<!-- Lặp lại block ## Màn hình N cho mỗi màn bổ sung -->
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
# 3. Pattern tương tác (Interaction Patterns)
|
|
316
|
+
|
|
317
|
+
<!--
|
|
318
|
+
Platform web: gồm section A + B. Bỏ section C.
|
|
319
|
+
Platform app: gồm section C. Bỏ section A + B.
|
|
320
|
+
-->
|
|
321
|
+
|
|
322
|
+
<!-- ═══════════════════════════ CHỈ WEB ═══════════════════════════ -->
|
|
323
|
+
|
|
324
|
+
## A. Hành vi Responsive *(chỉ web)*
|
|
325
|
+
|
|
326
|
+
| Breakpoint | Width | Thay đổi layout |
|
|
327
|
+
|------------|------------|----------------------------------------------------|
|
|
328
|
+
| Mobile | < 768px | {1 cột, bottom navigation bar, CTA full-width} |
|
|
329
|
+
| Tablet | 768–1279px | {grid 2 cột, sidebar thu gọn, tab navigation} |
|
|
330
|
+
| Desktop | ≥ 1280px | {layout đầy đủ, sidebar hiển thị, max-width 1440px}|
|
|
331
|
+
|
|
332
|
+
## B. Hover / Focus / Keyboard *(chỉ web)*
|
|
333
|
+
|
|
334
|
+
| Phần tử | Trạng thái Hover | Trạng thái Focus | Phím tắt |
|
|
335
|
+
|----------------|-------------------------------|---------------------------------|-------------------|
|
|
336
|
+
| Primary button | Background → {color.hover} | Outline 2px {color.focus} | Enter / Space |
|
|
337
|
+
| Text input | Border → {color.border.hover} | Border → {color.primary}, label nổi | Tab to focus |
|
|
338
|
+
| Dropdown | Highlight nền | Giống hover + ring | Phím mũi tên điều hướng |
|
|
339
|
+
|
|
340
|
+
<!-- ═══════════════════════════ CHỈ APP ═══════════════════════════ -->
|
|
341
|
+
|
|
342
|
+
## C. Cử chỉ & Điều hướng *(chỉ app)*
|
|
343
|
+
|
|
344
|
+
| Cử chỉ | Màn / Phần tử | Hành vi |
|
|
345
|
+
|-------------------|---------------------------|-------------------------------------------------------|
|
|
346
|
+
| Cử chỉ back (iOS swipe-right / Android back) | Mọi màn | {Quay lại màn trước / Hiện dialog "Discard changes?"} |
|
|
347
|
+
| Pull-to-refresh | {Tên màn} | Refresh dữ liệu, spinner ở trên cùng |
|
|
348
|
+
| Swipe trái trên row | {Tên list item} | Hiện action {Delete / Archive} |
|
|
349
|
+
| Long press | {Tên phần tử} | {Context menu / chế độ chọn} |
|
|
350
|
+
| Pinch / zoom | {Image viewer} | Scale ảnh, double-tap để reset |
|
|
351
|
+
|
|
352
|
+
### Navigation Pattern *(chỉ app)*
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
{Vẽ navigation stack cho feature này, vd:
|
|
356
|
+
BottomTab(Home) → FeatureListPage → FeatureDetailPage → EditPage
|
|
357
|
+
BottomTab(Home) → FeatureListPage ↘ (modal) CreatePage
|
|
358
|
+
}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Entry: {người dùng vào feature này thế nào — tab / deeplink / push từ màn khác}
|
|
362
|
+
Exit: {người dùng rời thế nào — back stack / chuyển tab / deeplink out}
|
|
363
|
+
|
|
364
|
+
### Platform Conventions *(chỉ app)*
|
|
365
|
+
|
|
366
|
+
| Khía cạnh | Hành vi iOS | Hành vi Android |
|
|
367
|
+
|--------------------------|-----------------------------------------|-----------------------------------------|
|
|
368
|
+
| Navigation bar | {Nút back trên-trái, title canh giữa} | {Mũi tên Up trên-trái, title canh trái} |
|
|
369
|
+
| Sheet / bottom modal | {UISheetPresentation, hiện grabber} | {BottomSheet, drag handle} |
|
|
370
|
+
| Alert / confirm dialog | {UIAlertController, action canh phải} | {Material AlertDialog, action canh trái}|
|
|
371
|
+
| Loading indicator | {UIActivityIndicatorView, center} | {CircularProgressIndicator} |
|
|
372
|
+
| Toast / snackbar | {Custom toast, bottom center} | {Material Snackbar, bottom} |
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
# 4. Cân nhắc theo Platform (Platform Considerations)
|
|
377
|
+
|
|
378
|
+
<!--
|
|
379
|
+
Web: gồm section A. App: gồm section B. Bỏ section không áp dụng.
|
|
380
|
+
-->
|
|
381
|
+
|
|
382
|
+
<!-- ═══════════════════════════ CHỈ WEB ═══════════════════════════ -->
|
|
383
|
+
|
|
384
|
+
## A. Accessibility *(chỉ web)*
|
|
385
|
+
|
|
386
|
+
- [ ] Mọi phần tử tương tác tới được bằng phím Tab — không có keyboard trap
|
|
387
|
+
- [ ] Focus trap bên trong modal dialog (Tab chỉ chạy vòng trong modal)
|
|
388
|
+
- [ ] Nút chỉ-icon có `aria-label` mô tả hành động
|
|
389
|
+
- [ ] Cập nhật nội dung động (loading → loaded) thông báo qua `aria-live`
|
|
390
|
+
- [ ] Tương phản màu đạt WCAG AA: text ≥ 4.5:1, text lớn ≥ 3:1
|
|
391
|
+
- [ ] Input form có label hiển thị (không chỉ placeholder)
|
|
392
|
+
- [ ] Message lỗi liên kết với input qua `aria-describedby`
|
|
393
|
+
|
|
394
|
+
<!-- ═══════════════════════════ CHỉ APP ═══════════════════════════ -->
|
|
395
|
+
|
|
396
|
+
## B. Thiết bị & OS *(chỉ app)*
|
|
397
|
+
|
|
398
|
+
- [ ] Áp dụng safe area insets ở mọi màn — trên (status bar) và dưới (home indicator)
|
|
399
|
+
- [ ] Touch target tối thiểu: 44×44pt (iOS) / 48×48dp (Android)
|
|
400
|
+
- [ ] Đã test trên màn nhỏ: rộng 375pt (iPhone SE) / rộng 360dp (Android phổ biến)
|
|
401
|
+
- [ ] Deep link entry: `{scheme}://{host}/{path}` → vào {tên màn} với {param} đã điền sẵn
|
|
402
|
+
- [ ] Permission gate: {liệt kê permission cần — Camera / Location / Notification}
|
|
403
|
+
- {Permission}: yêu cầu ở {tên màn} với copy lý do: "{copy TBD}"
|
|
404
|
+
- [ ] Hành vi offline / không mạng:
|
|
405
|
+
- {Tên màn}: hiện dữ liệu cache + banner offline
|
|
406
|
+
- {Tên action}: disable nút, hiện tooltip "Requires connection"
|
|
407
|
+
- [ ] Dark mode: mọi màn đã test dark mode — không có màu hardcode
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
# 5. AC-UI — Tiêu chí chấp nhận về Design
|
|
412
|
+
|
|
413
|
+
> Được **PO + Designer** cùng review và sign off trước khi sinh BDD.
|
|
414
|
+
> Bổ sung cho (không thay thế) AC mức nghiệp vụ trong [Business PRD]({prd-path}).
|
|
415
|
+
|
|
416
|
+
| ID | Tiêu chí chấp nhận | Verified by |
|
|
417
|
+
|--------|--------------------------------------------------------------------------------|-----------------|
|
|
418
|
+
| AC-UI1 | Mọi màn khớp frame Figma đã duyệt trong dung sai design-system | Designer |
|
|
419
|
+
| AC-UI2 | Trạng thái đang tải xuất hiện gần như tức thì (≤200ms) khi màn bắt đầu tải dữ liệu | QA |
|
|
420
|
+
| AC-UI3 | Mọi message lỗi đều hiển thị, rõ ràng, và kèm action khôi phục | PO |
|
|
421
|
+
| AC-UI4 | Empty state có illustration và call-to-action rõ ràng | PO + Designer |
|
|
422
|
+
| AC-UI5 | {Riêng platform — vd web: "Mọi màn pass kiểm tra tương phản WCAG AA"} | QA |
|
|
423
|
+
| AC-UI6 | {Riêng platform — vd app: "Cử chỉ back ở mọi màn quay về đúng màn trước"} | QA |
|
|
424
|
+
| AC-UI7 | {Tiêu chí UI riêng của feature từ section wireframe của Business PRD} | PO |
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
# Appendix
|
|
429
|
+
|
|
430
|
+
## Tóm tắt Figma
|
|
431
|
+
|
|
432
|
+
| Màn hình | Figma Frame | Trạng thái Link / Fetch |
|
|
433
|
+
|-----------------|--------------------------------------|--------------------------------------|
|
|
434
|
+
| {Màn hình 1} | [Link]({figma_frames[Screen 1]}) | ✅ Đã link & fetch |
|
|
435
|
+
| {Màn hình 2} | — | ❌ Missing — không có link node-id |
|
|
436
|
+
|
|
437
|
+
## Design Token đã tham chiếu
|
|
438
|
+
|
|
439
|
+
| Token | Value | Dùng ở |
|
|
440
|
+
|-----------------------|---------------|---------------------------------|
|
|
441
|
+
| `color.primary` | {#hex} | Primary button, link, active state |
|
|
442
|
+
| `color.surface` | {#hex} | Nền card |
|
|
443
|
+
| `spacing.md` | {16px / 4} | Khoảng cách dọc tiêu chuẩn |
|
|
444
|
+
| `typography.heading2` | {font/size} | Title màn hình |
|
|
445
|
+
|
|
446
|
+
## Tài liệu tham khảo
|
|
447
|
+
|
|
448
|
+
- [{TICKET-ID}]({prd-path}) — Business PRD (nguồn của AC, UC, BR)
|
|
449
|
+
- {[Design Spec khác](./other-ds.md) — nếu feature này dùng chung màn}
|
|
450
|
+
|
|
451
|
+
## Giả định AI
|
|
452
|
+
|
|
453
|
+
> Mỗi giả định dưới đây được đưa ra vì input PO chưa đầy đủ.
|
|
454
|
+
> PO phải review và confirm trước khi sign-off.
|
|
455
|
+
|
|
456
|
+
- {Giả định 1 — [AI DRAFT]}
|
|
457
|
+
- {Một dòng cho mỗi màn ❌ Missing: "Không có Figma frame đọc được cho {screen} — draft chỉ-text; chặn sign-off cho tới khi thêm link node-id."}
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
## Changelog
|
|
462
|
+
|
|
463
|
+
| Version | Date | Changes |
|
|
464
|
+
|---------|--------------|-----------------|
|
|
465
|
+
| 1.0 | {YYYY-MM-DD} | Initial version |
|
|
466
|
+
|
|
467
|
+
<!--
|
|
468
|
+
NEXT STEPS:
|
|
469
|
+
1. Điền các link Figma frame còn ❌ Missing (link node-id) — chạy lại để fetch & ground chúng.
|
|
470
|
+
2. Chia sẻ với Designer — xác minh link Figma, cập nhật component inventory.
|
|
471
|
+
3. PO + Designer sign off: đổi Status → "approved" (chỉ cho phép khi 0 màn ❌ Missing).
|
|
472
|
+
4. Chạy /generate-bdd "{prd-file}" — BDD dùng AC-UI từ spec này cho FE scenario.
|
|
473
|
+
-->
|
|
474
|
+
````
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## Self-Review Gate *(cổng tự-rà — bắt buộc chạy trước khi ghi)*
|
|
479
|
+
|
|
480
|
+
- [ ] Mọi màn trong Screen Inventory có Screen Spec đầy đủ ở Section 2
|
|
481
|
+
- [ ] Mọi màn có tối thiểu các state: default, loading, error
|
|
482
|
+
- [ ] Mọi component Figma đã map trong Component Inventory — chưa map thì gắn cờ `[NEW]` hoặc `[TODO]`
|
|
483
|
+
- [ ] Chỉ sinh section liên quan platform ở Section 3 (không có section web trong doc app, và ngược lại)
|
|
484
|
+
- [ ] Chỉ sinh section liên quan platform ở Section 4
|
|
485
|
+
- [ ] Các mục AC-UI testable (pass/fail rõ ràng, không phải "looks good")
|
|
486
|
+
- [ ] Link cross-reference Business PRD là relative path hợp lệ
|
|
487
|
+
- [ ] Mọi màn có link Figma frame node-level (`?node-id=`) — và các màn có link đã được fetch qua Figma MCP và dùng để ground spec
|
|
488
|
+
- [ ] Mỗi màn ❌ Missing được gắn cờ trong spec (`> [DRAFT — no Figma frame...]`), liệt kê trong Figma Summary, và có một AI Assumption
|
|
489
|
+
- [ ] Nếu bất kỳ màn nào ❌ Missing → Status giữ `draft` (generate-bdd FE/App cảnh báo mềm, không chặn cứng)
|
|
490
|
+
- [ ] **Ngôn ngữ Tầng A sạch:** không tên layer/variant Figma, mã token/hex/px, hay ẩn dụ dữ liệu (cờ/giá trị/đọc-ghi khi là artifact) lọt vào §1, Layout, Screen States, Actions, AC-UI — định danh kỹ thuật chỉ ở Component Inventory / Design Token / cột Figma. Backtick không bọc giá trị nghiệp vụ. Khái niệm đã có trong business-dictionary dùng đúng term chuẩn.
|
|
491
|
+
|
|
492
|
+
> **Đây là CỔNG, không phải nhắc nhở:** chạy từng mục trên TRƯỚC khi ghi file. Mục nào **FAIL** → **bắt buộc**:
|
|
493
|
+
> 1. ghi một dòng `⚠️ {mục thiếu — màn/section cụ thể}` vào section **"Giả định AI"** của file (đừng để lọt im lặng), VÀ
|
|
494
|
+
> 2. giữ `| **Status** | draft |` (chưa đủ điều kiện để PO+Designer sign-off `approved`).
|
|
495
|
+
> KHÔNG xuất design-spec như "hoàn chỉnh" khi còn mục fail chưa gắn cờ.
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
## Output
|
|
500
|
+
|
|
501
|
+
{{include:steps/report-footer.md}}
|
|
502
|
+
|
|
503
|
+
{Nếu missing_frames rỗng}:
|
|
504
|
+
```
|
|
505
|
+
/generate-design-spec Hoàn tất — {TICKET-ID} [{active_platform}]
|
|
506
|
+
---
|
|
507
|
+
Status : ✅ Complete — cả {N} màn đã link & fetch từ Figma
|
|
508
|
+
Output Artifacts:
|
|
509
|
+
created {paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md (v1.0)
|
|
510
|
+
Next : Chia sẻ với Designer → PO + Designer sign-off (Status: approved)
|
|
511
|
+
→ /generate-bdd {prd-file} (sinh BDD theo service; đọc AC-UI từ Design Spec)
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
{Nếu missing_frames khác rỗng}:
|
|
515
|
+
```
|
|
516
|
+
/generate-design-spec Hoàn tất (DRAFT) — {TICKET-ID} [{active_platform}]
|
|
517
|
+
---
|
|
518
|
+
Status : ⚠️ Warnings — {count} màn không có link Figma frame đọc được: {missing_frames ngăn cách bởi dấu phẩy}
|
|
519
|
+
Output Artifacts:
|
|
520
|
+
created {paths.specs_dir}/{domain}/{prd-slug}/design-spec/{TICKET-ID}-design-spec-{active_platform}-{slug}.md (v1.0, draft)
|
|
521
|
+
Next : 🔒 Khuyến nghị hoàn tất sign-off trước (đủ link Figma node-id); /generate-bdd FE/App sẽ cảnh báo nếu design-spec chưa approved.
|
|
522
|
+
1. Trong Figma: chọn mỗi frame còn thiếu → chuột phải → Copy link to selection
|
|
523
|
+
2. Chạy lại /generate-design-spec {prd-file} → AI fetch & ground các frame mới
|
|
524
|
+
```
|