@anhth2/spec-driven-dev-plugin 0.9.2 → 0.11.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/commands/debug.md +50 -20
- package/commands/define-product.md +49 -19
- package/commands/{generate-tests.md → dev-gen-test.md} +85 -23
- package/commands/{generate-tests.tmpl → dev-gen-test.tmpl} +18 -4
- package/{core/commands/run-tests.md → commands/dev-run-test.md} +102 -21
- package/commands/{run-tests.tmpl → dev-run-test.tmpl} +35 -2
- package/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
- package/commands/{smoke-test.tmpl → dev-smoke-test.tmpl} +5 -5
- package/commands/fix-bug.md +50 -20
- package/commands/generate-bdd.md +78 -21
- package/commands/generate-bdd.tmpl +11 -2
- package/commands/generate-code.md +123 -23
- package/commands/generate-code.tmpl +56 -4
- package/commands/generate-design-spec.md +142 -47
- package/commands/generate-design-spec.tmpl +93 -28
- package/commands/generate-prd.md +49 -19
- package/commands/generate-spec-manifest.md +49 -19
- package/commands/generate-tech-docs.md +50 -20
- package/commands/generate-tech-docs.tmpl +1 -1
- package/commands/learn.md +50 -20
- package/commands/propose-scenario.md +50 -20
- package/commands/propose-scenario.tmpl +1 -1
- package/commands/qc-analyze.md +514 -0
- package/commands/qc-analyze.tmpl +71 -0
- package/commands/qc-design-test.md +510 -0
- package/commands/qc-design-test.tmpl +67 -0
- package/commands/qc-plan.md +492 -0
- package/commands/qc-plan.tmpl +49 -0
- package/commands/qc-report.md +491 -0
- package/commands/qc-report.tmpl +48 -0
- package/commands/qc-review.md +496 -0
- package/commands/qc-review.tmpl +53 -0
- package/commands/qc-run-test.md +538 -0
- package/commands/qc-run-test.tmpl +77 -0
- package/commands/refine-prd.md +203 -24
- package/commands/refine-prd.tmpl +16 -5
- package/commands/report-bug.md +49 -19
- package/commands/review-code.md +51 -21
- package/commands/review-code.tmpl +1 -1
- package/commands/review-context.md +198 -20
- package/commands/review-context.tmpl +11 -1
- package/commands/review-tech-docs.md +49 -19
- package/commands/setup-ai-first.md +14 -7
- package/commands/sync.md +30 -20
- package/commands/sync.tmpl +16 -13
- package/commands/update-framework.md +14 -7
- package/commands/validate-traces.md +106 -45
- package/commands/validate-traces.tmpl +57 -26
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +50 -20
- package/core/commands/define-product.md +49 -19
- package/core/commands/{generate-tests.md → dev-gen-test.md} +85 -23
- package/{commands/run-tests.md → core/commands/dev-run-test.md} +102 -21
- package/core/commands/{smoke-test.md → dev-smoke-test.md} +54 -24
- package/core/commands/fix-bug.md +50 -20
- package/core/commands/generate-bdd.md +78 -21
- package/core/commands/generate-code.md +123 -23
- package/core/commands/generate-design-spec.md +142 -47
- package/core/commands/generate-prd.md +49 -19
- package/core/commands/generate-spec-manifest.md +49 -19
- package/core/commands/generate-tech-docs.md +50 -20
- package/core/commands/learn.md +50 -20
- package/core/commands/propose-scenario.md +50 -20
- package/core/commands/qc-analyze.md +514 -0
- package/core/commands/qc-design-test.md +510 -0
- package/core/commands/qc-plan.md +492 -0
- package/core/commands/qc-report.md +491 -0
- package/core/commands/qc-review.md +496 -0
- package/core/commands/qc-run-test.md +538 -0
- package/core/commands/refine-prd.md +203 -24
- package/core/commands/report-bug.md +49 -19
- package/core/commands/review-code.md +51 -21
- package/core/commands/review-context.md +198 -20
- package/core/commands/review-tech-docs.md +49 -19
- package/core/commands/setup-ai-first.md +14 -7
- package/core/commands/sync.md +30 -20
- package/core/commands/update-framework.md +14 -7
- package/core/commands/validate-traces.md +106 -45
- package/core/modules/qc-playwright/stack-profile.yaml +65 -0
- package/core/skills/code/SKILL.md +63 -26
- package/core/skills/debug/SKILL.md +78 -34
- package/core/skills/design-spec/SKILL.md +49 -19
- package/core/skills/discovery/SKILL.md +49 -19
- package/core/skills/prd/SKILL.md +28 -14
- package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/core/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
- package/core/skills/qc/qa-analyst/business-rules.md +55 -0
- package/core/skills/qc/qa-analyst/data-flow.md +60 -0
- package/core/skills/qc/qa-analyst/spec-breakdown.md +57 -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 +14 -7
- package/core/skills/spec/SKILL.md +28 -14
- package/core/skills/test/SKILL.md +121 -54
- package/core/steps/capture-lesson.md +1 -1
- package/core/steps/context-loader.md +35 -12
- package/core/steps/report-footer.md +14 -7
- package/core/steps/review-fanout.md +138 -0
- package/core/steps/spawn-agent.md +1 -1
- package/core/steps/trace-mirror.md +18 -0
- package/core/templates/design-spec.template.md +16 -8
- package/core/templates/project-context.yaml +8 -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 +154 -0
- package/docs/01-getting-started/quickstart.md +85 -0
- package/docs/02-guides/README.md +27 -0
- package/docs/02-guides/developer/README.md +46 -0
- package/docs/02-guides/developer/bdd-and-trace.md +123 -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 +448 -0
- package/docs/02-guides/developer/workflow.md +59 -0
- package/docs/02-guides/product-owner/README.md +77 -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 +357 -0
- package/docs/02-guides/qc-automation.md +92 -0
- package/docs/02-guides/tester/README.md +72 -0
- package/docs/02-guides/tester/bug-reporting.md +117 -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 +124 -0
- package/docs/02-guides/tester/test-checklist.md +31 -0
- package/docs/02-guides/tester/workflow.md +79 -0
- package/docs/03-concepts/README.md +19 -0
- package/docs/03-concepts/architecture.md +243 -0
- package/docs/03-concepts/pipeline.md +249 -0
- package/docs/03-concepts/traceability.md +148 -0
- package/docs/04-operations/README.md +33 -0
- package/docs/04-operations/bug-flow.md +321 -0
- package/docs/04-operations/publishing.md +137 -0
- package/docs/04-operations/sync-and-update.md +328 -0
- package/docs/05-reference/README.md +29 -0
- package/docs/05-reference/commands.md +229 -0
- package/docs/05-reference/modules.md +110 -0
- package/docs/05-reference/trace-schema.md +146 -0
- package/docs/README.md +51 -0
- package/modules/qc-playwright/stack-profile.yaml +65 -0
- package/package.json +2 -2
- package/skills/code/SKILL.md +63 -26
- package/skills/debug/SKILL.md +78 -34
- package/skills/debug/SKILL.tmpl +1 -1
- package/skills/design-spec/SKILL.md +49 -19
- package/skills/discovery/SKILL.md +49 -19
- package/skills/prd/SKILL.md +28 -14
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/skills/qc/qa-analyst/acceptance-criteria.md +56 -0
- package/skills/qc/qa-analyst/business-rules.md +55 -0
- package/skills/qc/qa-analyst/data-flow.md +60 -0
- package/skills/qc/qa-analyst/spec-breakdown.md +57 -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 +14 -7
- package/skills/spec/SKILL.md +28 -14
- package/skills/test/SKILL.md +121 -54
- package/skills/test/SKILL.tmpl +9 -9
- package/steps/capture-lesson.md +1 -1
- package/steps/context-loader.md +35 -12
- package/steps/report-footer.md +14 -7
- package/steps/review-fanout.md +138 -0
- package/steps/spawn-agent.md +1 -1
- package/steps/trace-mirror.md +18 -0
- package/templates/design-spec.template.md +16 -8
- package/templates/project-context.yaml +8 -0
- package/ARCHITECTURE.md +0 -247
|
@@ -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.
|
|
@@ -140,15 +140,22 @@ Suggest the logical next command based on workflow phase:
|
|
|
140
140
|
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
141
141
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
142
142
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
143
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
144
|
+
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
145
|
+
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
146
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
147
|
+
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
148
|
+
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
149
|
+
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
143
150
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
144
151
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
145
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
146
|
-
| /
|
|
147
|
-
| /run-
|
|
148
|
-
| /run-
|
|
149
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
150
|
-
| /smoke-test | Create PR and link to ticket |
|
|
151
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
152
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
153
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
154
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
155
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
156
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
157
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
158
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
152
159
|
| /fix-bug | Create PR and link to ticket |
|
|
153
160
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
154
161
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
package/skills/spec/SKILL.md
CHANGED
|
@@ -211,15 +211,22 @@ Suggest the logical next command based on workflow phase:
|
|
|
211
211
|
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
212
212
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
213
213
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
214
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
215
|
+
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
216
|
+
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
217
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
218
|
+
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
219
|
+
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
220
|
+
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
214
221
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
215
222
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
216
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
217
|
-
| /
|
|
218
|
-
| /run-
|
|
219
|
-
| /run-
|
|
220
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
221
|
-
| /smoke-test | Create PR and link to ticket |
|
|
222
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
223
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
224
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
225
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
226
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
227
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
228
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
229
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
223
230
|
| /fix-bug | Create PR and link to ticket |
|
|
224
231
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
225
232
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
@@ -348,15 +355,22 @@ Suggest the logical next command based on workflow phase:
|
|
|
348
355
|
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
349
356
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
350
357
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
358
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
359
|
+
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
360
|
+
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
361
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
362
|
+
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
363
|
+
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
364
|
+
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
351
365
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
352
366
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
353
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
354
|
-
| /
|
|
355
|
-
| /run-
|
|
356
|
-
| /run-
|
|
357
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
358
|
-
| /smoke-test | Create PR and link to ticket |
|
|
359
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
367
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
368
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
369
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
370
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
371
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
372
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
373
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
360
374
|
| /fix-bug | Create PR and link to ticket |
|
|
361
375
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
362
376
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
package/skills/test/SKILL.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or smoke-tests live API endpoints on a running service. Trigger when: "/
|
|
2
|
+
description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or dev-smoke-tests live API endpoints on a running service. Trigger when: "/dev-gen-test", "/dev-run-test", "/dev-smoke-test", "tạo test", "viết test", "chạy test", "generate tests", "run tests", "test kết quả", "smoke test", "test API", "kiểm tra endpoint đang chạy".
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Test Skills — Generate, Run & Smoke Test
|
|
6
6
|
|
|
7
|
-
This skill handles three commands: `/
|
|
7
|
+
This skill handles three commands: `/dev-gen-test`, `/dev-run-test`, and `/dev-smoke-test`.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
## /
|
|
11
|
+
## /dev-gen-test — Generate Unit & Integration Tests
|
|
12
12
|
|
|
13
13
|
### Gate
|
|
14
14
|
|
|
@@ -212,7 +212,7 @@ src/test/{language}/{package}/
|
|
|
212
212
|
### Output
|
|
213
213
|
|
|
214
214
|
```
|
|
215
|
-
/
|
|
215
|
+
/dev-gen-test Complete — {UC-ID}:
|
|
216
216
|
✅ service/{Service}Test.{ext} ({M} tests)
|
|
217
217
|
✅ facade/{Facade}Test.{ext} ({M} tests)
|
|
218
218
|
✅ controller/{Controller}Test.{ext} ({M} tests)
|
|
@@ -254,15 +254,22 @@ Suggest the logical next command based on workflow phase:
|
|
|
254
254
|
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
255
255
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
256
256
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
257
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
258
|
+
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
259
|
+
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
260
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
261
|
+
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
262
|
+
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
263
|
+
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
257
264
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
258
265
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
259
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
260
|
-
| /
|
|
261
|
-
| /run-
|
|
262
|
-
| /run-
|
|
263
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
264
|
-
| /smoke-test | Create PR and link to ticket |
|
|
265
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
266
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
267
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
268
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
269
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
270
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
271
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
272
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
266
273
|
| /fix-bug | Create PR and link to ticket |
|
|
267
274
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
268
275
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
@@ -282,7 +289,7 @@ Next : {suggested command with example arguments}
|
|
|
282
289
|
|
|
283
290
|
---
|
|
284
291
|
|
|
285
|
-
## /run-
|
|
292
|
+
## /dev-run-test — Run Tests & Report Results
|
|
286
293
|
|
|
287
294
|
### Gate
|
|
288
295
|
|
|
@@ -362,7 +369,7 @@ If `services` section is present:
|
|
|
362
369
|
|
|
363
370
|
**2. Route to service** — if active domain matches a key in `services`:
|
|
364
371
|
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
365
|
-
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
372
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
|
|
366
373
|
- Store `active_service` = `services.{domain}.path`
|
|
367
374
|
- Store `active_service_module` = `services.{domain}.module`
|
|
368
375
|
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
@@ -374,7 +381,7 @@ If `services` section is present:
|
|
|
374
381
|
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
375
382
|
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
376
383
|
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
377
|
-
- Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **
|
|
384
|
+
- Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
|
|
378
385
|
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
379
386
|
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
380
387
|
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
@@ -405,7 +412,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
|
|
|
405
412
|
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
406
413
|
|
|
407
414
|
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
408
|
-
- Shell commands (`/run-
|
|
415
|
+
- Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
|
|
409
416
|
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
410
417
|
|
|
411
418
|
**4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
|
|
@@ -420,19 +427,41 @@ If the file does not exist → skip silently.
|
|
|
420
427
|
|
|
421
428
|
---
|
|
422
429
|
|
|
423
|
-
## Step 3 — [CRITICAL] Load CLAUDE.md
|
|
430
|
+
## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
|
|
424
431
|
|
|
425
432
|
*This is the highest-priority context — it defines HOW to write code and documents for this project.*
|
|
426
433
|
|
|
427
|
-
|
|
434
|
+
CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
|
|
435
|
+
architecture/coding standards compose correctly. The agent always sits at the umbrella
|
|
436
|
+
root, but the implementation code lives in a service submodule with its OWN stack,
|
|
437
|
+
architecture, and conventions — so the service's CLAUDE.md must win for code generation.
|
|
438
|
+
|
|
439
|
+
**Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
|
|
440
|
+
Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
|
|
441
|
+
whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
|
|
442
|
+
single-service mode) the project's only architecture + coding standards.
|
|
443
|
+
|
|
444
|
+
**Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
|
|
445
|
+
*Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
|
|
446
|
+
Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
|
|
447
|
+
the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
|
|
448
|
+
Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
|
|
449
|
+
coding standards, and error handling. Layer-1 values that the service does not redefine
|
|
450
|
+
(e.g. git conventions, banned patterns shared org-wide) remain in effect.
|
|
451
|
+
|
|
452
|
+
From the **merged** result, extract and store:
|
|
428
453
|
|
|
429
454
|
- **§1 Project Overview** → project name, language, framework, build/test commands, domains
|
|
430
|
-
- **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
|
|
431
|
-
- **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
|
|
432
|
-
- **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
|
|
433
|
-
- **§7 Git Conventions** → branch naming pattern, commit message format
|
|
455
|
+
- **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
|
|
456
|
+
- **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
|
|
457
|
+
- **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
|
|
458
|
+
- **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
|
|
434
459
|
|
|
435
|
-
|
|
460
|
+
**Resolution rules:**
|
|
461
|
+
- If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
|
|
462
|
+
- If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
|
|
463
|
+
- If `service_root` is set but `{service_root}/CLAUDE.md` is **missing** → fall back to root CLAUDE.md and flag ⚠️ in the Step 7 recap (the service has no architecture/coding-standards definition — code generation will use umbrella defaults, which may be the wrong stack).
|
|
464
|
+
- If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
|
|
436
465
|
|
|
437
466
|
---
|
|
438
467
|
|
|
@@ -498,7 +527,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
|
498
527
|
|
|
499
528
|
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
500
529
|
|
|
501
|
-
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (
|
|
530
|
+
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (dev-gen-test, debug, fix-bug, dev-smoke-test).
|
|
502
531
|
|
|
503
532
|
---
|
|
504
533
|
|
|
@@ -532,7 +561,8 @@ Output exactly this block:
|
|
|
532
561
|
[CTX LOADED]
|
|
533
562
|
Stack : {language} / {framework} / {database}
|
|
534
563
|
Platform : {active_module} ({platform_type})
|
|
535
|
-
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
564
|
+
Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
565
|
+
CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
|
|
536
566
|
Ticket : {ticket_prefix}-
|
|
537
567
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
538
568
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
@@ -603,7 +633,7 @@ Read stack trace and analyze:
|
|
|
603
633
|
### Output
|
|
604
634
|
|
|
605
635
|
```
|
|
606
|
-
/run-
|
|
636
|
+
/dev-run-test Report — {service}
|
|
607
637
|
Run at: {datetime}
|
|
608
638
|
|
|
609
639
|
## Summary
|
|
@@ -655,15 +685,22 @@ Suggest the logical next command based on workflow phase:
|
|
|
655
685
|
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
656
686
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
657
687
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
688
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
689
|
+
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
690
|
+
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
691
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
692
|
+
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
693
|
+
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
694
|
+
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
658
695
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
659
696
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
660
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
661
|
-
| /
|
|
662
|
-
| /run-
|
|
663
|
-
| /run-
|
|
664
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
665
|
-
| /smoke-test | Create PR and link to ticket |
|
|
666
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
697
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
698
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
699
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
700
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
701
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
702
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
703
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
667
704
|
| /fix-bug | Create PR and link to ticket |
|
|
668
705
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
669
706
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
@@ -683,10 +720,10 @@ Next : {suggested command with example arguments}
|
|
|
683
720
|
|
|
684
721
|
---
|
|
685
722
|
|
|
686
|
-
## /smoke-test — Test Live API Endpoints
|
|
723
|
+
## /dev-smoke-test — Test Live API Endpoints
|
|
687
724
|
|
|
688
725
|
Use when the service is **already running** to verify endpoints work correctly.
|
|
689
|
-
Different from `/run-
|
|
726
|
+
Different from `/dev-run-test` (which runs unit/integration tests without a live server).
|
|
690
727
|
|
|
691
728
|
### Phase 1 — Find Service URL
|
|
692
729
|
|
|
@@ -766,7 +803,7 @@ If `services` section is present:
|
|
|
766
803
|
|
|
767
804
|
**2. Route to service** — if active domain matches a key in `services`:
|
|
768
805
|
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
769
|
-
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
806
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir` — **only if `setup.spec_source` is NOT set.** When `spec_source` IS set, the tech-design (API contract) is a cross-team artifact and must live in the shared spec repo (handled in step 4), so leave `tech_docs_dir` for step 4 to route — do NOT pin it per-service here.
|
|
770
807
|
- Store `active_service` = `services.{domain}.path`
|
|
771
808
|
- Store `active_service_module` = `services.{domain}.module`
|
|
772
809
|
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
@@ -778,7 +815,7 @@ If `services` section is present:
|
|
|
778
815
|
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
779
816
|
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
780
817
|
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
781
|
-
- Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **
|
|
818
|
+
- Override `paths.tech_docs_dir` → `{spec_source}/specs/tech-docs` — **always when `spec_source` is set** (step 2 no longer pins tech-docs per-service in this case). The tech-design IS the cross-team API contract: BE authors it here, and FE/App read it from the same spec submodule at `/generate-code --phase=integration`. *(Per-service tech-docs only happen when there is no `spec_source` — a pure multi-service BE repo with no shared spec module.)*
|
|
782
819
|
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
783
820
|
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
784
821
|
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
@@ -809,7 +846,7 @@ When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-
|
|
|
809
846
|
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
810
847
|
|
|
811
848
|
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
812
|
-
- Shell commands (`/run-
|
|
849
|
+
- Shell commands (`/dev-run-test`, `/dev-gen-test`) run **from within** `service_root`
|
|
813
850
|
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
814
851
|
|
|
815
852
|
**4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
|
|
@@ -824,19 +861,41 @@ If the file does not exist → skip silently.
|
|
|
824
861
|
|
|
825
862
|
---
|
|
826
863
|
|
|
827
|
-
## Step 3 — [CRITICAL] Load CLAUDE.md
|
|
864
|
+
## Step 3 — [CRITICAL] Load CLAUDE.md (layered: root + service overlay)
|
|
828
865
|
|
|
829
866
|
*This is the highest-priority context — it defines HOW to write code and documents for this project.*
|
|
830
867
|
|
|
831
|
-
|
|
868
|
+
CLAUDE.md is loaded in **two layers** so umbrella-wide rules and service-specific
|
|
869
|
+
architecture/coding standards compose correctly. The agent always sits at the umbrella
|
|
870
|
+
root, but the implementation code lives in a service submodule with its OWN stack,
|
|
871
|
+
architecture, and conventions — so the service's CLAUDE.md must win for code generation.
|
|
872
|
+
|
|
873
|
+
**Layer 1 — [BASE] Root CLAUDE.md (umbrella-wide).**
|
|
874
|
+
Read `CLAUDE.md` at the repo root. Treat its contents as the **shared baseline** for the
|
|
875
|
+
whole umbrella — git conventions, data-protection posture, cross-cutting rules, and (in
|
|
876
|
+
single-service mode) the project's only architecture + coding standards.
|
|
877
|
+
|
|
878
|
+
**Layer 2 — [OVERLAY] Service CLAUDE.md (umbrella mode only).**
|
|
879
|
+
*Run only if `service_root` was set in Step 1.6 (i.e. a real service was routed to).*
|
|
880
|
+
Read `{service_root}/CLAUDE.md`. This file defines the architecture + coding standards of
|
|
881
|
+
the **actual stack being implemented** (e.g. `user-service` = java-spring, `web` = nextjs).
|
|
882
|
+
Overlay it on top of Layer 1: **on any conflict, the service value WINS** for architecture,
|
|
883
|
+
coding standards, and error handling. Layer-1 values that the service does not redefine
|
|
884
|
+
(e.g. git conventions, banned patterns shared org-wide) remain in effect.
|
|
885
|
+
|
|
886
|
+
From the **merged** result, extract and store:
|
|
832
887
|
|
|
833
888
|
- **§1 Project Overview** → project name, language, framework, build/test commands, domains
|
|
834
|
-
- **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules
|
|
835
|
-
- **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns
|
|
836
|
-
- **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name
|
|
837
|
-
- **§7 Git Conventions** → branch naming pattern, commit message format
|
|
889
|
+
- **§2 Architecture** → layer order (e.g., Controller → Facade → Service → Repository), architectural rules — *service overlay wins*
|
|
890
|
+
- **§3 Coding Standards** → naming conventions (classes, methods), response wrapper type, forbidden patterns — *service overlay wins*
|
|
891
|
+
- **§5 Error Handling** → exception types, HTTP status code mapping, not-found exception class name — *service overlay wins*
|
|
892
|
+
- **§7 Git Conventions** → branch naming pattern, commit message format — *root baseline unless service redefines*
|
|
838
893
|
|
|
839
|
-
|
|
894
|
+
**Resolution rules:**
|
|
895
|
+
- If both layers exist → merge as above; record `claude_md_source = root + {service_root}`.
|
|
896
|
+
- If only the service overlay exists (no root CLAUDE.md) → use the service file alone; `claude_md_source = {service_root}`.
|
|
897
|
+
- If `service_root` is set but `{service_root}/CLAUDE.md` is **missing** → fall back to root CLAUDE.md and flag ⚠️ in the Step 7 recap (the service has no architecture/coding-standards definition — code generation will use umbrella defaults, which may be the wrong stack).
|
|
898
|
+
- If neither exists → note CLAUDE.md as missing and continue with project-context.yaml data only.
|
|
840
899
|
|
|
841
900
|
---
|
|
842
901
|
|
|
@@ -902,7 +961,7 @@ active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
|
902
961
|
|
|
903
962
|
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
904
963
|
|
|
905
|
-
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (
|
|
964
|
+
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (dev-gen-test, debug, fix-bug, dev-smoke-test).
|
|
906
965
|
|
|
907
966
|
---
|
|
908
967
|
|
|
@@ -936,7 +995,8 @@ Output exactly this block:
|
|
|
936
995
|
[CTX LOADED]
|
|
937
996
|
Stack : {language} / {framework} / {database}
|
|
938
997
|
Platform : {active_module} ({platform_type})
|
|
939
|
-
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
998
|
+
Layers : {layer order from merged CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
999
|
+
CLAUDE.md : {root + {service_root} | {service_root} only | root only | ⚠️ service overlay MISSING — using root | missing}
|
|
940
1000
|
Ticket : {ticket_prefix}-
|
|
941
1001
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
942
1002
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
@@ -1024,7 +1084,7 @@ tail -n 100 {LOG_FILE_PATH}
|
|
|
1024
1084
|
### Output
|
|
1025
1085
|
|
|
1026
1086
|
```
|
|
1027
|
-
/smoke-test Report — {UC-ID}
|
|
1087
|
+
/dev-smoke-test Report — {UC-ID}
|
|
1028
1088
|
Tested at: {datetime}
|
|
1029
1089
|
Base URL: http://localhost:{port}
|
|
1030
1090
|
|
|
@@ -1074,15 +1134,22 @@ Suggest the logical next command based on workflow phase:
|
|
|
1074
1134
|
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
1075
1135
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
1076
1136
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
1137
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
1138
|
+
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
1139
|
+
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
1140
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
1141
|
+
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
1142
|
+
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
1143
|
+
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
1077
1144
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
1078
1145
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
1079
|
-
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/
|
|
1080
|
-
| /
|
|
1081
|
-
| /run-
|
|
1082
|
-
| /run-
|
|
1083
|
-
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
1084
|
-
| /smoke-test | Create PR and link to ticket |
|
|
1085
|
-
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/
|
|
1146
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
1147
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
1148
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
1149
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
1150
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
1151
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
1152
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
1086
1153
|
| /fix-bug | Create PR and link to ticket |
|
|
1087
1154
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
1088
1155
|
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
package/skills/test/SKILL.tmpl
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or smoke-tests live API endpoints on a running service. Trigger when: "/
|
|
2
|
+
description: Generates unit and integration tests from BDD specs, runs the test suite and reports results, or dev-smoke-tests live API endpoints on a running service. Trigger when: "/dev-gen-test", "/dev-run-test", "/dev-smoke-test", "tạo test", "viết test", "chạy test", "generate tests", "run tests", "test kết quả", "smoke test", "test API", "kiểm tra endpoint đang chạy".
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Test Skills — Generate, Run & Smoke Test
|
|
6
6
|
|
|
7
|
-
This skill handles three commands: `/
|
|
7
|
+
This skill handles three commands: `/dev-gen-test`, `/dev-run-test`, and `/dev-smoke-test`.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
## /
|
|
11
|
+
## /dev-gen-test — Generate Unit & Integration Tests
|
|
12
12
|
|
|
13
13
|
### Gate
|
|
14
14
|
|
|
@@ -131,7 +131,7 @@ src/test/{language}/{package}/
|
|
|
131
131
|
### Output
|
|
132
132
|
|
|
133
133
|
```
|
|
134
|
-
/
|
|
134
|
+
/dev-gen-test Complete — {UC-ID}:
|
|
135
135
|
✅ service/{Service}Test.{ext} ({M} tests)
|
|
136
136
|
✅ facade/{Facade}Test.{ext} ({M} tests)
|
|
137
137
|
✅ controller/{Controller}Test.{ext} ({M} tests)
|
|
@@ -141,7 +141,7 @@ src/test/{language}/{package}/
|
|
|
141
141
|
|
|
142
142
|
---
|
|
143
143
|
|
|
144
|
-
## /run-
|
|
144
|
+
## /dev-run-test — Run Tests & Report Results
|
|
145
145
|
|
|
146
146
|
### Gate
|
|
147
147
|
|
|
@@ -190,7 +190,7 @@ Read stack trace and analyze:
|
|
|
190
190
|
### Output
|
|
191
191
|
|
|
192
192
|
```
|
|
193
|
-
/run-
|
|
193
|
+
/dev-run-test Report — {service}
|
|
194
194
|
Run at: {datetime}
|
|
195
195
|
|
|
196
196
|
## Summary
|
|
@@ -210,10 +210,10 @@ Duration: {X}s
|
|
|
210
210
|
|
|
211
211
|
---
|
|
212
212
|
|
|
213
|
-
## /smoke-test — Test Live API Endpoints
|
|
213
|
+
## /dev-smoke-test — Test Live API Endpoints
|
|
214
214
|
|
|
215
215
|
Use when the service is **already running** to verify endpoints work correctly.
|
|
216
|
-
Different from `/run-
|
|
216
|
+
Different from `/dev-run-test` (which runs unit/integration tests without a live server).
|
|
217
217
|
|
|
218
218
|
### Phase 1 — Find Service URL
|
|
219
219
|
|
|
@@ -279,7 +279,7 @@ tail -n 100 {LOG_FILE_PATH}
|
|
|
279
279
|
### Output
|
|
280
280
|
|
|
281
281
|
```
|
|
282
|
-
/smoke-test Report — {UC-ID}
|
|
282
|
+
/dev-smoke-test Report — {UC-ID}
|
|
283
283
|
Tested at: {datetime}
|
|
284
284
|
Base URL: http://localhost:{port}
|
|
285
285
|
|
package/steps/capture-lesson.md
CHANGED
|
@@ -54,7 +54,7 @@ If `lessons_path` does not exist, create it with this header first:
|
|
|
54
54
|
| code-gen | /generate-code output |
|
|
55
55
|
| bdd | /generate-bdd output |
|
|
56
56
|
| tech-docs | /generate-tech-docs output |
|
|
57
|
-
| tests | /
|
|
57
|
+
| tests | /dev-gen-test output |
|
|
58
58
|
| prd | /generate-prd, /refine-prd output |
|
|
59
59
|
| general | every command |
|
|
60
60
|
|