@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,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 1.0
|
|
3
|
+
updated: 2026-06-11
|
|
4
|
+
ported_from: ai-automation-qc-base
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Gen Script — Non-Functional
|
|
8
|
+
|
|
9
|
+
Skill **tự chứa**: convert TC non-functional (performance/security/accessibility/compatibility) → script/đo. Chỉ cần load file này.
|
|
10
|
+
|
|
11
|
+
## Khi nào trigger
|
|
12
|
+
- Convert TC non-functional (output qa-designer non-functional) sang script/kịch bản đo; TC đã Reviewed
|
|
13
|
+
|
|
14
|
+
## Khi KHÔNG trigger
|
|
15
|
+
- Kiểm thử chức năng → `functional/*` · tích hợp → `integration.md`
|
|
16
|
+
|
|
17
|
+
## Quy ước script (bám CLAUDE.md)
|
|
18
|
+
- Tiền đề: `.Test.md` đã Reviewed, có **ngưỡng đo cụ thể**. KHÔNG hardcode → `Env.*`/`CONFIG`.
|
|
19
|
+
- Mỗi loại dùng công cụ phù hợp, gói trong fixture/helper:
|
|
20
|
+
- **Performance:** đo response time / throughput (pytest + timer, hoặc tích hợp k6/locust); assert ngưỡng.
|
|
21
|
+
- **Security:** test authZ (role không quyền → 403), input injection, PII không lộ, session/timeout, rate limit.
|
|
22
|
+
- **Accessibility:** axe-core/lighthouse qua Playwright; assert vi phạm = 0 ở mức WCAG mục tiêu.
|
|
23
|
+
- **Compatibility:** parametrize trình duyệt/thiết bị.
|
|
24
|
+
- Assert theo **ngưỡng pass** trong TC bằng `expect()`/`assert`; bọc bước `with step("…")` (`from utils.steps import step`, **KHÔNG Allure**); marker `@pytest.mark.{performance,security,accessibility}`.
|
|
25
|
+
|
|
26
|
+
## Phase 1 — Clarify
|
|
27
|
+
Đọc `.Test.md` · loại + ngưỡng + công cụ · môi trường/tải mẫu · data đặc biệt.
|
|
28
|
+
|
|
29
|
+
## Phase 2 — Generate
|
|
30
|
+
Mỗi TC → 1 test đo + assert ngưỡng; đánh dấu test cần môi trường/tải riêng (`@pytest.mark.slow`).
|
|
31
|
+
|
|
32
|
+
## Phase 3 — Verify
|
|
33
|
+
`py_compile` + collect · chạy (môi trường phù hợp) · cập nhật Status TC + số đo thực tế.
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
Script `tests/<project>/non_functional/test_<feature>.py` + helper đo/scan. Bàn giao `qa-reviewer`.
|
|
37
|
+
|
|
38
|
+
## Phase 4 — Report (bắt buộc sau khi chạy test)
|
|
39
|
+
Report = **Playwright Trace viewer + pytest-html** (KHÔNG Allure, KHÔNG dashboard tự viết).
|
|
40
|
+
|
|
41
|
+
1. Chạy test kèm pytest-html (trace đã bật sẵn ở conftest → mỗi test có `test-results/<nodeid>/trace.zip`):
|
|
42
|
+
```bash
|
|
43
|
+
pytest tests/<project>/non_functional/test_<feature>.py --html=reports/<feature>/report.html --self-contained-html
|
|
44
|
+
```
|
|
45
|
+
2. Gửi cho người dùng:
|
|
46
|
+
- HTML report: `reports/<feature>/report.html` (self-contained, mở trực tiếp) + số đo thực tế.
|
|
47
|
+
- Trace từng test (debug step-by-step): `python3 -m playwright show-trace test-results/<nodeid>/trace.zip`.
|
|
48
|
+
- Tóm tắt: **TOTAL / PASS / FAIL / SKIP** + duration.
|
|
49
|
+
3. TC Fail → mở trace tương ứng để xem timeline/DOM snapshot/network, phân loại script-bug vs product-gap; ghi mô tả lỗi tiếng Việt dễ hiểu + số đo vào Status/khối kết quả của `.Test.md`.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 1.1
|
|
3
|
+
updated: 2026-06-11
|
|
4
|
+
ported_from: ai-automation-qc-base
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Report — Playwright Trace + pytest-html (stack chuẩn)
|
|
8
|
+
|
|
9
|
+
Skill **tự chứa**: sinh report sau khi chạy test. Stack chuẩn dự án dùng **Playwright
|
|
10
|
+
Trace viewer** + **pytest-html** (KHÔNG Allure, KHÔNG dashboard tự viết). Chỉ cần load file này.
|
|
11
|
+
|
|
12
|
+
## Khi nào trigger
|
|
13
|
+
- Sau khi chạy test cần xuất report / xem lại bằng chứng (trace, screenshot).
|
|
14
|
+
|
|
15
|
+
## Cơ chế (đã dựng sẵn ở tests/conftest.py)
|
|
16
|
+
- **Trace viewer**: fixture `context` (root conftest) gọi `context.tracing.start(screenshots=True, snapshots=True, sources=True)`; teardown lưu `test-results/<nodeid>/trace.zip`.
|
|
17
|
+
- Xem: `python3 -m playwright show-trace test-results/<...>/trace.zip` → timeline + DOM snapshot + network + console (UI giống Playwright report bản JS).
|
|
18
|
+
- **pytest-html**: 1 file HTML self-contained. Hook `pytest_runtest_makereport` (root conftest) đính screenshot full-page khi FAIL/SKIP.
|
|
19
|
+
- Mặc định `reports/report.html` (pytest.ini). Theo feature: `--html=reports/<feature>/report.html --self-contained-html`.
|
|
20
|
+
|
|
21
|
+
## Quy trình
|
|
22
|
+
1. Chạy test với report theo feature:
|
|
23
|
+
```
|
|
24
|
+
python3 -m pytest tests/<project>/<file>.py \
|
|
25
|
+
--html=reports/<feature>/report.html --self-contained-html
|
|
26
|
+
```
|
|
27
|
+
(Trace tự bật trong conftest → test-results/<nodeid>/trace.zip cho mọi test.)
|
|
28
|
+
2. Báo path:
|
|
29
|
+
- HTML: `reports/<feature>/report.html` (on WSL, the Windows-accessible path is `\\wsl.localhost\<distro>\<repo-path>\reports\<feature>\report.html`).
|
|
30
|
+
- Trace TC fail: `test-results/<nodeid>/trace.zip` + lệnh `playwright show-trace`.
|
|
31
|
+
- Tóm tắt TOTAL / PASS / FAIL / SKIP + duration.
|
|
32
|
+
|
|
33
|
+
## Nguyên tắc
|
|
34
|
+
- KHÔNG dùng Allure, KHÔNG sinh dashboard HTML tự viết (đã bỏ utils/html_report.py & cộng sự).
|
|
35
|
+
- Evidence trung thực: trace + screenshot phản ánh đúng lần run; FAIL/gap giữ nguyên.
|
|
36
|
+
- `reports/` và `test-results/` đã gitignore (artifact nặng) — không commit.
|
|
37
|
+
- Interpreter `python3`; browser = the system/installed Chromium configured via `browser_type_launch_args` in the root conftest (see the qc-playwright module) — do not hard-code a binary path.
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Sets up the Spec-Driven Development framework in any backend project from scratch. Trigger when: "/setup-ai-first", "setup spec-driven workflow", "initialize ai-first framework", "cài đặt framework", "khởi tạo spec-driven", "set up this workflow", "how do I start using this framework".
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /setup-ai-first — Initialize Spec-Driven Docs in a Project
|
|
6
|
+
|
|
7
|
+
Walk the user through a one-time setup that creates all required directories, installs CLAUDE.md, and verifies the environment.
|
|
8
|
+
|
|
9
|
+
## Precondition Check
|
|
10
|
+
|
|
11
|
+
First, ask: "Bạn đang ở project nào? Cho tôi đường dẫn root của project."
|
|
12
|
+
|
|
13
|
+
Check if already set up:
|
|
14
|
+
- If `.claude/commands/` exists with `.md` files → report "Already set up. Run `/validate-traces` to check status."
|
|
15
|
+
- If `specs/` exists → offer to re-initialize or skip
|
|
16
|
+
|
|
17
|
+
## Step 1 — Create Directory Structure
|
|
18
|
+
|
|
19
|
+
Create the following directories (skip if already exist):
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
{project-root}/
|
|
23
|
+
├── specs/
|
|
24
|
+
│ ├── product-definition/ # Output of /define-product
|
|
25
|
+
│ └── domain-knowledge/ # Business dictionary + core entities
|
|
26
|
+
├── .trace/ # Traceability state (.trace/{domain}/{prd-slug}/{UC-ID}.tsv)
|
|
27
|
+
└── .agent/
|
|
28
|
+
└── review/ # Output of /refine-prd ({prd-slug}-findings.yaml)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Feature-package layout** — per-feature artifacts are NOT pre-created here; each command
|
|
32
|
+
creates its own folder on demand under `specs/{domain}/{prd-slug}/`:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
specs/{domain}/{prd-slug}/
|
|
36
|
+
├── prd.md # /generate-prd
|
|
37
|
+
├── bdd/ # /generate-bdd (.feature files)
|
|
38
|
+
├── tech-docs/ # /generate-tech-docs
|
|
39
|
+
└── design-spec/ # /generate-design-spec (FE/App only)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Report each directory created or already existing.
|
|
43
|
+
|
|
44
|
+
## Step 2 — Copy Slash Commands
|
|
45
|
+
|
|
46
|
+
Tell the user:
|
|
47
|
+
|
|
48
|
+
> "Framework này đã cài slash commands vào Claude tự động qua skill system.
|
|
49
|
+
> Nếu bạn muốn dùng commands trực tiếp trong Claude Code project (`.claude/commands/`), chạy lệnh sau:"
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Copy all commands from plugin to project
|
|
53
|
+
mkdir -p {project-root}/.claude/commands
|
|
54
|
+
cp {plugin-dir}/commands/*.md {project-root}/.claude/commands/
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Note: The `.claude/commands/` copies are optional. Skills in this framework work without them.
|
|
58
|
+
|
|
59
|
+
## Step 3 — Create CLAUDE.md
|
|
60
|
+
|
|
61
|
+
Check if `{project-root}/CLAUDE.md` exists:
|
|
62
|
+
- If yes: ask "CLAUDE.md đã tồn tại. Merge template vào hay bỏ qua?"
|
|
63
|
+
- If no: create from template in `templates/architecture.template.md`
|
|
64
|
+
|
|
65
|
+
After creating, instruct:
|
|
66
|
+
> "Mở CLAUDE.md và điền vào các placeholder `{{...}}` với thông tin dự án của bạn.
|
|
67
|
+
> Đặc biệt quan trọng: §1 (project overview) và §3 (coding standards)."
|
|
68
|
+
|
|
69
|
+
## Step 4 — Create project-context.yaml
|
|
70
|
+
|
|
71
|
+
Create `{project-root}/.agent/project-context.yaml`:
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
# Project context for AI-First workflow
|
|
75
|
+
# Fill in all fields before starting
|
|
76
|
+
|
|
77
|
+
project:
|
|
78
|
+
name: "{{PROJECT_NAME}}"
|
|
79
|
+
description: "{{ONE_LINE_DESCRIPTION}}"
|
|
80
|
+
|
|
81
|
+
tech_stack:
|
|
82
|
+
language: "{{LANGUAGE}}" # e.g. Java 21, Python 3.12, Node.js 20
|
|
83
|
+
framework: "{{FRAMEWORK}}" # e.g. Spring Boot 3.x, FastAPI, NestJS
|
|
84
|
+
build_tool: "{{BUILD_TOOL}}" # e.g. Gradle, Maven, npm
|
|
85
|
+
test_framework: "{{TEST_FW}}" # e.g. JUnit 5, pytest, Jest
|
|
86
|
+
orm: "{{ORM}}" # e.g. Hibernate/JPA, SQLAlchemy, Prisma
|
|
87
|
+
database: "{{DATABASE}}" # e.g. PostgreSQL, MySQL, MongoDB
|
|
88
|
+
|
|
89
|
+
conventions:
|
|
90
|
+
build_command: "{{BUILD_COMMAND}}" # e.g. ./gradlew build -x test
|
|
91
|
+
test_command: "{{TEST_COMMAND}}" # e.g. ./gradlew test
|
|
92
|
+
service_run: "{{RUN_COMMAND}}" # e.g. ./gradlew bootRun
|
|
93
|
+
ticket_prefix: "{{TICKET_PREFIX}}" # e.g. PROJ, FEAT, PD
|
|
94
|
+
|
|
95
|
+
domains: [] # List your business domains, e.g. [rental, payment, user]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Step 5 — Verify Setup
|
|
99
|
+
|
|
100
|
+
Run a quick check:
|
|
101
|
+
- [ ] `specs/` directory exists
|
|
102
|
+
- [ ] `.trace/` directory exists
|
|
103
|
+
- [ ] `.agent/project-context.yaml` exists
|
|
104
|
+
- [ ] `CLAUDE.md` exists
|
|
105
|
+
|
|
106
|
+
Report:
|
|
107
|
+
```
|
|
108
|
+
/setup-ai-first Complete ✅
|
|
109
|
+
|
|
110
|
+
Directories created: {N}
|
|
111
|
+
Files created:
|
|
112
|
+
✅ CLAUDE.md (needs customization)
|
|
113
|
+
✅ .agent/project-context.yaml (needs customization)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
# Report Footer — Standard Command Output Format
|
|
117
|
+
|
|
118
|
+
Every command report must end with this standard footer section.
|
|
119
|
+
|
|
120
|
+
## Status Badge
|
|
121
|
+
|
|
122
|
+
Choose one based on outcome:
|
|
123
|
+
- `✅ Complete` — all steps succeeded, no issues found
|
|
124
|
+
- `❌ Failed` — command could not complete due to a blocking error
|
|
125
|
+
- `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
|
|
126
|
+
|
|
127
|
+
## Output Artifacts
|
|
128
|
+
|
|
129
|
+
List every file created or modified by this command:
|
|
130
|
+
```
|
|
131
|
+
Output Artifacts:
|
|
132
|
+
{created|updated} {file-path} ({brief description})
|
|
133
|
+
{created|updated} {file-path} ({brief description})
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
|
|
137
|
+
|
|
138
|
+
## Pipeline Position
|
|
139
|
+
|
|
140
|
+
Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
|
|
141
|
+
so the user always sees where this command sits in the end-to-end flow:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Find the current command in this phase legend and mark **its** phase in the map above:
|
|
148
|
+
|
|
149
|
+
| Phase | Commands |
|
|
150
|
+
|-------|----------|
|
|
151
|
+
| Discovery | `/define-product` |
|
|
152
|
+
| PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
|
|
153
|
+
| Design Spec | `/generate-design-spec` |
|
|
154
|
+
| BDD | `/generate-bdd` · `/review-context` (BDD) |
|
|
155
|
+
| Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
|
|
156
|
+
| Code | `/generate-code` · `/review-code` |
|
|
157
|
+
| Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
|
|
158
|
+
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
159
|
+
| Trace Audit | `/validate-traces` |
|
|
160
|
+
|
|
161
|
+
For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
|
|
162
|
+
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
163
|
+
|
|
164
|
+
**Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
|
|
165
|
+
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
|
|
166
|
+
**omit the Pipeline line entirely** for these (do not force-fit them onto the map).
|
|
167
|
+
|
|
168
|
+
## Next Command Suggestion
|
|
169
|
+
|
|
170
|
+
Suggest the logical next command based on workflow phase:
|
|
171
|
+
|
|
172
|
+
| Current command | Suggest next |
|
|
173
|
+
|-------------------------|-----------------------------------------------|
|
|
174
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
175
|
+
| /define-product | `/generate-prd {product-definition-file}` |
|
|
176
|
+
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
177
|
+
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
178
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
179
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
180
|
+
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
181
|
+
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
182
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
183
|
+
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
184
|
+
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
185
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
186
|
+
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
187
|
+
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
188
|
+
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
189
|
+
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
190
|
+
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
191
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
192
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
193
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
194
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
195
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
196
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
197
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
198
|
+
| /fix-bug | Create PR and link to ticket |
|
|
199
|
+
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
200
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
201
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
202
|
+
| /learn | Continue working — lesson applies on next command |
|
|
203
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
204
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
205
|
+
|
|
206
|
+
Format the footer as:
|
|
207
|
+
```
|
|
208
|
+
---
|
|
209
|
+
Status : {badge}
|
|
210
|
+
{Output Artifacts block}
|
|
211
|
+
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
212
|
+
(review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
|
|
213
|
+
Next : {suggested command with example arguments}
|
|
214
|
+
```
|
|
215
|
+
*(Omit the `Pipeline` line for cross-cutting commands listed above.)*
|
|
216
|
+
|