pi-skill-search 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/CHANGELOG.md +20 -0
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/index.ts +163 -0
- package/package.json +48 -0
- package/skills/adaptyv/SKILL.md +92 -0
- package/skills/add-community-extension/SKILL.md +85 -0
- package/skills/aeon/SKILL.md +111 -0
- package/skills/ai-slop-cleaner/SKILL.md +118 -0
- package/skills/anndata/SKILL.md +83 -0
- package/skills/arboreto/SKILL.md +107 -0
- package/skills/ask/SKILL.md +55 -0
- package/skills/astropy/SKILL.md +30 -0
- package/skills/async-worker-recovery/SKILL.md +44 -0
- package/skills/autopilot/SKILL.md +63 -0
- package/skills/autoresearch/SKILL.md +64 -0
- package/skills/autoskill/SKILL.md +116 -0
- package/skills/babysit/SKILL.md +43 -0
- package/skills/benchling-integration/SKILL.md +106 -0
- package/skills/bgpt-paper-search/SKILL.md +67 -0
- package/skills/biopython/SKILL.md +29 -0
- package/skills/bioservices/SKILL.md +96 -0
- package/skills/brainstorming/SKILL.md +104 -0
- package/skills/cancel/SKILL.md +85 -0
- package/skills/ccg/SKILL.md +87 -0
- package/skills/celery-pipeline/SKILL.md +30 -0
- package/skills/cellxgene-census/SKILL.md +104 -0
- package/skills/child-pi-spawning/SKILL.md +85 -0
- package/skills/cirq/SKILL.md +113 -0
- package/skills/citation-management/SKILL.md +91 -0
- package/skills/clinical-decision-support/SKILL.md +117 -0
- package/skills/clinical-reports/SKILL.md +118 -0
- package/skills/clinical-trial/SKILL.md +28 -0
- package/skills/cobrapy/SKILL.md +116 -0
- package/skills/configure-notifications/SKILL.md +85 -0
- package/skills/consciousness-council/SKILL.md +120 -0
- package/skills/context-artifact-hygiene/SKILL.md +85 -0
- package/skills/context-mode-ops/SKILL.md +87 -0
- package/skills/dask/SKILL.md +85 -0
- package/skills/database-lookup/SKILL.md +118 -0
- package/skills/datamol/SKILL.md +108 -0
- package/skills/debug/SKILL.md +32 -0
- package/skills/deep-dive/SKILL.md +114 -0
- package/skills/deep-interview/SKILL.md +90 -0
- package/skills/deepchem/SKILL.md +117 -0
- package/skills/deepinit/SKILL.md +100 -0
- package/skills/deeptools/SKILL.md +118 -0
- package/skills/delegation-patterns/SKILL.md +56 -0
- package/skills/depmap/SKILL.md +94 -0
- package/skills/dhdna-profiler/SKILL.md +86 -0
- package/skills/diffdock/SKILL.md +101 -0
- package/skills/dispatching-parallel-agents/SKILL.md +119 -0
- package/skills/dnanexus-integration/SKILL.md +118 -0
- package/skills/do/SKILL.md +48 -0
- package/skills/docker-sandbox/SKILL.md +29 -0
- package/skills/docx/SKILL.md +119 -0
- package/skills/esm/SKILL.md +116 -0
- package/skills/etetoolkit/SKILL.md +103 -0
- package/skills/event-log-tracing/SKILL.md +85 -0
- package/skills/exa-search/SKILL.md +72 -0
- package/skills/executing-plans/SKILL.md +69 -0
- package/skills/exploratory-data-analysis/SKILL.md +118 -0
- package/skills/external-context/SKILL.md +80 -0
- package/skills/fastapi/SKILL.md +30 -0
- package/skills/finishing-a-development-branch/SKILL.md +106 -0
- package/skills/flowio/SKILL.md +114 -0
- package/skills/fluidsim/SKILL.md +108 -0
- package/skills/generate-image/SKILL.md +108 -0
- package/skills/geniml/SKILL.md +117 -0
- package/skills/geomaster/SKILL.md +109 -0
- package/skills/geopandas/SKILL.md +114 -0
- package/skills/get-available-resources/SKILL.md +100 -0
- package/skills/gget/SKILL.md +111 -0
- package/skills/ginkgo-cloud-lab/SKILL.md +52 -0
- package/skills/git-master/SKILL.md +85 -0
- package/skills/glycoengineering/SKILL.md +104 -0
- package/skills/gtars/SKILL.md +104 -0
- package/skills/hackernews-frontpage/SKILL.md +46 -0
- package/skills/histolab/SKILL.md +98 -0
- package/skills/how-it-works/SKILL.md +25 -0
- package/skills/hud/SKILL.md +86 -0
- package/skills/hugging-science/SKILL.md +93 -0
- package/skills/huggingface/SKILL.md +30 -0
- package/skills/hypogenic/SKILL.md +107 -0
- package/skills/hypothesis-generation/SKILL.md +118 -0
- package/skills/imaging-data-commons/SKILL.md +119 -0
- package/skills/infographics/SKILL.md +102 -0
- package/skills/iso-13485-certification/SKILL.md +114 -0
- package/skills/knowledge-agent/SKILL.md +83 -0
- package/skills/labarchive-integration/SKILL.md +98 -0
- package/skills/lamindb/SKILL.md +119 -0
- package/skills/landsat/SKILL.md +29 -0
- package/skills/latchbio-integration/SKILL.md +118 -0
- package/skills/latex-posters/SKILL.md +112 -0
- package/skills/learn-codebase/SKILL.md +24 -0
- package/skills/learner/SKILL.md +118 -0
- package/skills/literature-review/SKILL.md +118 -0
- package/skills/live-agent-lifecycle/SKILL.md +85 -0
- package/skills/mailbox-interactive/SKILL.md +85 -0
- package/skills/make-plan/SKILL.md +59 -0
- package/skills/markdown-mermaid-writing/SKILL.md +118 -0
- package/skills/market-research-reports/SKILL.md +119 -0
- package/skills/markitdown/SKILL.md +111 -0
- package/skills/markitdown-docs/SKILL.md +28 -0
- package/skills/matchms/SKILL.md +91 -0
- package/skills/matlab/SKILL.md +118 -0
- package/skills/matplotlib/SKILL.md +30 -0
- package/skills/mcp-setup/SKILL.md +84 -0
- package/skills/medchem/SKILL.md +109 -0
- package/skills/mem-search/SKILL.md +96 -0
- package/skills/modal/SKILL.md +104 -0
- package/skills/model-routing-context/SKILL.md +85 -0
- package/skills/molecular-dynamics/SKILL.md +116 -0
- package/skills/molfeat/SKILL.md +110 -0
- package/skills/multi-perspective-review/SKILL.md +85 -0
- package/skills/networkx/SKILL.md +111 -0
- package/skills/neurokit2/SKILL.md +114 -0
- package/skills/neuropixels-analysis/SKILL.md +112 -0
- package/skills/nilearn/SKILL.md +29 -0
- package/skills/observability-reliability/SKILL.md +43 -0
- package/skills/omc-doctor/SKILL.md +86 -0
- package/skills/omc-reference/SKILL.md +119 -0
- package/skills/omc-setup/SKILL.md +82 -0
- package/skills/omc-teams/SKILL.md +81 -0
- package/skills/omero-integration/SKILL.md +111 -0
- package/skills/open-notebook/SKILL.md +100 -0
- package/skills/openephys/SKILL.md +28 -0
- package/skills/opentrons-integration/SKILL.md +110 -0
- package/skills/optimize-for-gpu/SKILL.md +119 -0
- package/skills/orchestration/SKILL.md +85 -0
- package/skills/ownership-session-security/SKILL.md +43 -0
- package/skills/paper-lookup/SKILL.md +119 -0
- package/skills/paperzilla/SKILL.md +114 -0
- package/skills/parallel-web/SKILL.md +64 -0
- package/skills/pathfinder/SKILL.md +114 -0
- package/skills/pathml/SKILL.md +98 -0
- package/skills/pdf/SKILL.md +113 -0
- package/skills/peer-review/SKILL.md +119 -0
- package/skills/pennylane/SKILL.md +119 -0
- package/skills/phylogenetics/SKILL.md +102 -0
- package/skills/pi-extension-lifecycle/SKILL.md +41 -0
- package/skills/plan/SKILL.md +66 -0
- package/skills/polars/SKILL.md +114 -0
- package/skills/polars-bio/SKILL.md +84 -0
- package/skills/pptx/SKILL.md +118 -0
- package/skills/pptx-posters/SKILL.md +112 -0
- package/skills/primekg/SKILL.md +97 -0
- package/skills/project-session-manager/SKILL.md +85 -0
- package/skills/protocolsio-integration/SKILL.md +119 -0
- package/skills/pubmed-search/SKILL.md +29 -0
- package/skills/pufferlib/SKILL.md +103 -0
- package/skills/pydeseq2/SKILL.md +106 -0
- package/skills/pydicom/SKILL.md +115 -0
- package/skills/pyhealth/SKILL.md +117 -0
- package/skills/pylabrobot/SKILL.md +100 -0
- package/skills/pymatgen/SKILL.md +28 -0
- package/skills/pymc/SKILL.md +108 -0
- package/skills/pymoo/SKILL.md +90 -0
- package/skills/pyopenms/SKILL.md +119 -0
- package/skills/pysam/SKILL.md +118 -0
- package/skills/pyspark/SKILL.md +30 -0
- package/skills/pytdc/SKILL.md +102 -0
- package/skills/pytorch/SKILL.md +31 -0
- package/skills/pytorch-lightning/SKILL.md +119 -0
- package/skills/pyzotero/SKILL.md +104 -0
- package/skills/qiskit/SKILL.md +119 -0
- package/skills/qutip/SKILL.md +111 -0
- package/skills/ralph/SKILL.md +23 -0
- package/skills/ralplan/SKILL.md +105 -0
- package/skills/rdflib/SKILL.md +29 -0
- package/skills/rdkit/SKILL.md +30 -0
- package/skills/read-only-explorer/SKILL.md +85 -0
- package/skills/receiving-code-review/SKILL.md +103 -0
- package/skills/release/SKILL.md +117 -0
- package/skills/remember/SKILL.md +39 -0
- package/skills/requesting-code-review/SKILL.md +85 -0
- package/skills/requirements-to-task-packet/SKILL.md +65 -0
- package/skills/research-grants/SKILL.md +118 -0
- package/skills/research-lookup/SKILL.md +117 -0
- package/skills/research-reproducibility/SKILL.md +28 -0
- package/skills/resource-discovery-config/SKILL.md +43 -0
- package/skills/rowan/SKILL.md +100 -0
- package/skills/runtime-state-reader/SKILL.md +46 -0
- package/skills/safe-bash/SKILL.md +85 -0
- package/skills/scanpy/SKILL.md +32 -0
- package/skills/scholar-evaluation/SKILL.md +115 -0
- package/skills/scientific-brainstorming/SKILL.md +118 -0
- package/skills/scientific-critical-thinking/SKILL.md +119 -0
- package/skills/scientific-schematics/SKILL.md +116 -0
- package/skills/scientific-slides/SKILL.md +117 -0
- package/skills/scientific-visualization/SKILL.md +109 -0
- package/skills/scientific-writing/SKILL.md +119 -0
- package/skills/scikit-bio/SKILL.md +92 -0
- package/skills/scikit-learn/SKILL.md +99 -0
- package/skills/scikit-survival/SKILL.md +110 -0
- package/skills/sciomc/SKILL.md +86 -0
- package/skills/scvelo/SKILL.md +106 -0
- package/skills/scvi-tools/SKILL.md +114 -0
- package/skills/seaborn/SKILL.md +97 -0
- package/skills/secure-agent-orchestration-review/SKILL.md +47 -0
- package/skills/self-improve/SKILL.md +119 -0
- package/skills/semantic-compression/SKILL.md +62 -0
- package/skills/setup/SKILL.md +42 -0
- package/skills/shap/SKILL.md +103 -0
- package/skills/simpy/SKILL.md +116 -0
- package/skills/skill/SKILL.md +117 -0
- package/skills/skill-search/SKILL.md +67 -0
- package/skills/skillify/SKILL.md +46 -0
- package/skills/smart-explore/SKILL.md +94 -0
- package/skills/sqlite-pandas/SKILL.md +30 -0
- package/skills/stable-baselines3/SKILL.md +86 -0
- package/skills/state-mutation-locking/SKILL.md +44 -0
- package/skills/statistical-analysis/SKILL.md +108 -0
- package/skills/statsmodels/SKILL.md +29 -0
- package/skills/subagent-driven-development/SKILL.md +89 -0
- package/skills/sympy/SKILL.md +115 -0
- package/skills/system-prompts/SKILL.md +116 -0
- package/skills/systematic-debugging/SKILL.md +119 -0
- package/skills/team/SKILL.md +85 -0
- package/skills/test-driven-development/SKILL.md +84 -0
- package/skills/tiledbvcf/SKILL.md +119 -0
- package/skills/timeline-report/SKILL.md +85 -0
- package/skills/timesfm-forecasting/SKILL.md +112 -0
- package/skills/torch-geometric/SKILL.md +118 -0
- package/skills/torchdrug/SKILL.md +118 -0
- package/skills/trace/SKILL.md +118 -0
- package/skills/transformers/SKILL.md +110 -0
- package/skills/treatment-plans/SKILL.md +119 -0
- package/skills/ui-render-performance/SKILL.md +41 -0
- package/skills/ultragoal/SKILL.md +63 -0
- package/skills/ultraqa/SKILL.md +85 -0
- package/skills/ultrawork/SKILL.md +20 -0
- package/skills/umap-learn/SKILL.md +119 -0
- package/skills/usfiscaldata/SKILL.md +118 -0
- package/skills/using-git-worktrees/SKILL.md +112 -0
- package/skills/using-superpowers/SKILL.md +85 -0
- package/skills/using-vetc/SKILL.md +92 -0
- package/skills/vaex/SKILL.md +111 -0
- package/skills/venue-templates/SKILL.md +113 -0
- package/skills/verification-before-completion/SKILL.md +88 -0
- package/skills/verification-before-done/SKILL.md +68 -0
- package/skills/verify/SKILL.md +33 -0
- package/skills/version-bump/SKILL.md +54 -0
- package/skills/vetc-analyze-ba/SKILL.md +117 -0
- package/skills/vetc-analyze-codebase/SKILL.md +118 -0
- package/skills/vetc-api-design/SKILL.md +103 -0
- package/skills/vetc-brainstorming/SKILL.md +116 -0
- package/skills/vetc-change-proposal/SKILL.md +111 -0
- package/skills/vetc-cicd/SKILL.md +113 -0
- package/skills/vetc-continuous-learning/SKILL.md +115 -0
- package/skills/vetc-deep-interview/SKILL.md +103 -0
- package/skills/vetc-docgen/SKILL.md +108 -0
- package/skills/vetc-frontend-patterns/SKILL.md +99 -0
- package/skills/vetc-iterative-retrieval/SKILL.md +110 -0
- package/skills/vetc-java-patterns/SKILL.md +113 -0
- package/skills/vetc-meta-skill-creator/SKILL.md +99 -0
- package/skills/vetc-oracle-patterns/SKILL.md +109 -0
- package/skills/vetc-performance-testing/SKILL.md +104 -0
- package/skills/vetc-pr-response/SKILL.md +106 -0
- package/skills/vetc-ralph/SKILL.md +108 -0
- package/skills/vetc-ralplan/SKILL.md +116 -0
- package/skills/vetc-receiving-review/SKILL.md +106 -0
- package/skills/vetc-reconcile-patterns/SKILL.md +117 -0
- package/skills/vetc-refactoring/SKILL.md +96 -0
- package/skills/vetc-runbook/SKILL.md +118 -0
- package/skills/vetc-sast/SKILL.md +118 -0
- package/skills/vetc-sdlc/SKILL.md +97 -0
- package/skills/vetc-security/SKILL.md +117 -0
- package/skills/vetc-spec-driven/SKILL.md +111 -0
- package/skills/vetc-spec-quality/SKILL.md +117 -0
- package/skills/vetc-systematic-debugging/SKILL.md +74 -0
- package/skills/vetc-tdd/SKILL.md +96 -0
- package/skills/vetc-thinking-pm/SKILL.md +110 -0
- package/skills/vetc-ui-visual-qa/SKILL.md +117 -0
- package/skills/vetc-verify/SKILL.md +101 -0
- package/skills/visual-verdict/SKILL.md +59 -0
- package/skills/what-if-oracle/SKILL.md +87 -0
- package/skills/widget-rendering/SKILL.md +85 -0
- package/skills/wiki/SKILL.md +69 -0
- package/skills/workspace-isolation/SKILL.md +85 -0
- package/skills/worktree-isolation/SKILL.md +85 -0
- package/skills/wowerpoint/SKILL.md +101 -0
- package/skills/writer-memory/SKILL.md +82 -0
- package/skills/writing-plans/SKILL.md +115 -0
- package/skills/writing-skills/SKILL.md +115 -0
- package/skills/xgboost/SKILL.md +29 -0
- package/skills/xgboost-ts/SKILL.md +28 -0
- package/skills/xlsx/SKILL.md +111 -0
- package/skills/zarr-python/SKILL.md +101 -0
- package/src/categories.ts +383 -0
- package/src/format.ts +104 -0
- package/src/indexer.ts +101 -0
- package/src/proactive.ts +51 -0
- package/src/scanner.ts +85 -0
- package/src/search.ts +89 -0
- package/src/strip.ts +29 -0
- package/src/synonyms.ts +83 -0
- package/src/text.ts +118 -0
- package/src/types.ts +64 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-spec-driven
|
|
3
|
+
description: PROACTIVELY activate khi user mô tả tính năng nhưng chưa có spec, hoặc requirement còn mơ hồ. Biến yêu cầu thành Structured Spec với edge cases, acceptance criteria, success criteria. Dùng trước vetc-api-design.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Spec-Driven Development
|
|
7
|
+
|
|
8
|
+
Spec rõ ràng → AI sinh code đúng ngay lần đầu. **Code serves specs, not the other way.**
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- User mô tả tính năng bằng tiếng Việt hoặc tiếng Anh, chưa có spec
|
|
13
|
+
- Requirement còn mơ hồ, chưa có edge case
|
|
14
|
+
- Trước khi dùng `vetc-api-design` hoặc `vetc-planner`
|
|
15
|
+
- Khi cần validate logic với BA/PO trước khi code
|
|
16
|
+
|
|
17
|
+
## Do NOT Activate When
|
|
18
|
+
|
|
19
|
+
- Requirement đã rất rõ ràng, có spec chi tiết → dùng `vetc-planner` trực tiếp
|
|
20
|
+
- Bug fix đơn giản, không cần spec → dùng `vetc-systematic-debugging`
|
|
21
|
+
- Chỉ refactor code, không thêm feature mới
|
|
22
|
+
- Đang implement code theo spec đã approved → dùng `vetc-java-patterns` hoặc `vetc-frontend-patterns`
|
|
23
|
+
- Task quá nhỏ (< 1 giờ) → code trực tiếp, không cần spec
|
|
24
|
+
|
|
25
|
+
## Feature Directory Convention
|
|
26
|
+
|
|
27
|
+
Mỗi feature có thư mục riêng để persist artifacts:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
specs/{NNN}-{slug}/
|
|
31
|
+
├── spec.md ← Structured Spec (output của skill này)
|
|
32
|
+
├── api-design.md ← từ vetc-api-design
|
|
33
|
+
├── plan.md ← từ vetc-planner
|
|
34
|
+
├── tasks.md ← task list chi tiết
|
|
35
|
+
├── state.md ← feature state tracking (lifecycle)
|
|
36
|
+
├── checklists/ ← từ vetc-spec-quality
|
|
37
|
+
│ ├── ux.md
|
|
38
|
+
│ ├── security.md
|
|
39
|
+
│ └── api.md
|
|
40
|
+
|
|
41
|
+
## Spec Lifecycle (từ OpenSpec)
|
|
42
|
+
|
|
43
|
+
Specs có lifecycle rõ ràng — không phải static document:
|
|
44
|
+
|
|
45
|
+
| Phase | Status | Description |
|
|
46
|
+
|-------|--------|-------------|
|
|
47
|
+
| DRAFT | `spec.md` mới tạo | Chưa review, có thể thay đổi tự do |
|
|
48
|
+
| PROPOSED | Spec đã được clarify | Đã qua deep-interview hoặc socratic clarification |
|
|
49
|
+
| APPROVED | Plan đã được ralplan approve | Locked — changes cần delta spec |
|
|
50
|
+
| IMPLEMENTING | Ralph đang implement | Spec là source of truth, code follows |
|
|
51
|
+
| APPLIED | Implementation done + verified | Spec merged vào codebase-spec |
|
|
52
|
+
| ARCHIVED | Feature shipped | Delta changes merged, spec đóng |
|
|
53
|
+
|
|
54
|
+
**State transitions:**
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
# State: {Feature Name}
|
|
58
|
+
## Lifecycle Phase: DRAFT
|
|
59
|
+
## Last Updated: [date]
|
|
60
|
+
## Changes: [list of delta changes applied]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Delta Spec Convention
|
|
64
|
+
|
|
65
|
+
See: `./(see docs)`
|
|
66
|
+
|
|
67
|
+
## How It Works
|
|
68
|
+
|
|
69
|
+
### Step 0 — Risk Checklist (bắt buộc)
|
|
70
|
+
|
|
71
|
+
Trước khi bắt đầu spec, chạy risk checklist để xác định lane:
|
|
72
|
+
|
|
73
|
+
| Flag | Touches |
|
|
74
|
+
|------|---------|
|
|
75
|
+
| Auth | JWT, Smart OTP, session, refresh token |
|
|
76
|
+
| Authorization | Role, permission, wallet ownership |
|
|
77
|
+
| Data model | Oracle DDL, JPA entity, migration |
|
|
78
|
+
| Audit/security | Audit log, CCCD, balance |
|
|
79
|
+
| External systems | Bank GW, eKYC provider, payment gateway |
|
|
80
|
+
| Public contracts | REST API shape, ResultResp |
|
|
81
|
+
| Cross-module | >1 domain changes |
|
|
82
|
+
| Existing behavior | Code đã test/covered |
|
|
83
|
+
| Weak proof | Khu vực chưa có test |
|
|
84
|
+
|
|
85
|
+
### Step 1 — Socratic Clarification
|
|
86
|
+
|
|
87
|
+
Hỏi tối đa 5 câu tập trung:
|
|
88
|
+
- **Actor**: ai thực hiện? (customer, agent, admin, system, external service)
|
|
89
|
+
- **Happy path**: luồng chính là gì?
|
|
90
|
+
- **Failure modes**: điều gì xảy ra khi thất bại? (timeout, duplicate, insufficient balance)
|
|
91
|
+
- **Business constraints**: giới hạn tiền? thời gian? role? frequency?
|
|
92
|
+
- **Integrations**: hệ thống nào liên quan? (ACS, Bank GW, eKYC, ...)
|
|
93
|
+
|
|
94
|
+
### Step 2 — Structured Spec Output
|
|
95
|
+
|
|
96
|
+
Ghi vào `specs/{NNN}-{slug}/spec.md`. See template: `./(see docs)`
|
|
97
|
+
|
|
98
|
+
## [NEEDS CLARIFICATION] Rules
|
|
99
|
+
|
|
100
|
+
1. **Max 3 items** — không hơn. Mọi thứ khác → Assumptions (informed guess).
|
|
101
|
+
2. **Priority order**: scope > security > UX > technical.
|
|
102
|
+
3. **Format**: câu hỏi + options table + recommended option với reasoning.
|
|
103
|
+
4. **Resolution**: user chọn option → update spec, move to Assumptions hoặc Accepted.
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
- [NEEDS CLARIFICATION-01] (scope): Timeout QR payment bao lâu?
|
|
107
|
+
→ Options:
|
|
108
|
+
A) 5 minutes (chuẩn VNPAY) — Recommended: phổ biến nhất
|
|
109
|
+
B) 15 minutes (thân thiện hơn)
|
|
110
|
+
|
|
111
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-spec-quality
|
|
3
|
+
description: PROACTIVELY activate sau khi tạo spec — validate spec quality như "Unit Tests for English". Kiểm tra Completeness, Clarity, Consistency, Measurability, Coverage. Dùng sau vetc-spec-driven hoặc vetc-deep-interview, trước vetc-planner.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Spec Quality — "Unit Tests for Requirements"
|
|
7
|
+
|
|
8
|
+
Checklists test **REQUIREMENTS QUALITY**, NOT implementation. Giống unit tests nhưng cho English text.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Sau khi `vetc-spec-driven` hoặc `vetc-deep-interview` tạo spec
|
|
13
|
+
- Trước khi `vetc-planner` tạo implementation plan
|
|
14
|
+
- Khi review spec từ BA/PO
|
|
15
|
+
- User nói: "check spec", "validate requirements", "spec quality"
|
|
16
|
+
- Trước `/vetc-ship` — spec quality gate
|
|
17
|
+
|
|
18
|
+
## Do NOT activate when
|
|
19
|
+
|
|
20
|
+
- Chưa có spec file → dùng `vetc-spec-driven` trước
|
|
21
|
+
- Đang implement code → dùng `vetc-verify` thay
|
|
22
|
+
- Chỉ cần syntax/formatting → manual review đủ
|
|
23
|
+
|
|
24
|
+
## Core Concept
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
WRONG: "Verify button clicks work correctly" ← tests implementation
|
|
28
|
+
RIGHT: "Are click requirements defined?" ← tests requirements quality
|
|
29
|
+
|
|
30
|
+
WRONG: "Test API returns 200" ← tests code behavior
|
|
31
|
+
RIGHT: "Is API success criteria specified?" ← tests spec completeness
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 5 Quality Dimensions
|
|
35
|
+
|
|
36
|
+
| Dimension | What It Tests | Threshold |
|
|
37
|
+
|-----------|---------------|-----------|
|
|
38
|
+
| **Completeness** | Có thiếu thông tin quan trọng không? | ≥80% items addressed |
|
|
39
|
+
| **Clarity** | Có ambiguity hoặc vague language không? | No unresolved ambiguity |
|
|
40
|
+
| **Consistency** | Có mâu thuẫn giữa các sections không? | 0 contradictions |
|
|
41
|
+
| **Measurability** | Success criteria có measurable không? | All criteria measurable |
|
|
42
|
+
| **Coverage** | Mọi aspect của feature được cover chưa? | ≥80% traceability |
|
|
43
|
+
|
|
44
|
+
## Checklist Categories
|
|
45
|
+
|
|
46
|
+
### Category 1: Functional Completeness
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
## CHK-101: Actor Identification
|
|
50
|
+
- [ ] Are ALL actors identified? [Spec §2]
|
|
51
|
+
- [ ] Is each actor's role clear? [Spec §2]
|
|
52
|
+
- [ ] Are actor permissions defined? [Spec §2]
|
|
53
|
+
|
|
54
|
+
## CHK-102: Happy Path Coverage
|
|
55
|
+
- [ ] Is the primary flow described step-by-step? [Spec §4]
|
|
56
|
+
- [ ] Does each step have a clear actor and action? [Spec §4]
|
|
57
|
+
- [ ] Are preconditions stated? [Spec §4]
|
|
58
|
+
|
|
59
|
+
## CHK-103: Edge Case Coverage
|
|
60
|
+
- [ ] Are error scenarios listed? [Spec §5]
|
|
61
|
+
- [ ] Is each edge case tied to a trigger + expected behavior? [Spec §5]
|
|
62
|
+
- [ ] Are timeout/retry scenarios covered? [Spec §5]
|
|
63
|
+
|
|
64
|
+
## CHK-104: Scope Boundaries
|
|
65
|
+
- [ ] Is in-scope explicitly listed? [Spec §2]
|
|
66
|
+
- [ ] Is out-of-scope explicitly listed? [Spec §2]
|
|
67
|
+
- [ ] Are non-goals stated? [Spec §2]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Category 2: Clarity & Precision
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
## CHK-201: Language Precision
|
|
74
|
+
- [ ] Are there vague words ("fast", "good", "simple", "easy")? [Spec §all]
|
|
75
|
+
- [ ] Are all terms defined or commonly understood? [Spec §all]
|
|
76
|
+
- [ ] Are ambiguous requirements marked [NEEDS CLARIFICATION]? [Spec §12]
|
|
77
|
+
|
|
78
|
+
## CHK-202: Measurable Success Criteria
|
|
79
|
+
- [ ] Are success criteria measurable (not subjective)? [Spec §6]
|
|
80
|
+
- [ ] Are criteria technology-agnostic? [Spec §6]
|
|
81
|
+
- [ ] Are criteria user-focused (not developer-focused)? [Spec §6]
|
|
82
|
+
|
|
83
|
+
## CHK-203: Acceptance Criteria Quality
|
|
84
|
+
- [ ] Are Gherkin scenarios complete (Given/When/Then)? [Spec §7]
|
|
85
|
+
- [ ] Does each scenario test ONE behavior? [Spec §7]
|
|
86
|
+
- [ ] Are negative scenarios included? [Spec §7]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Category 3: Consistency
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
## CHK-301: Internal Consistency
|
|
93
|
+
- [ ] Do edge cases align with happy path? [Spec §4 vs §5]
|
|
94
|
+
- [ ] Do acceptance criteria match user scenarios? [Spec §3 vs §7]
|
|
95
|
+
- [ ] Do data model hints match API contract sketch? [Spec §9 vs §10]
|
|
96
|
+
|
|
97
|
+
## CHK-302: VETC Domain Consistency
|
|
98
|
+
- [ ] Are VETC integrations correctly referenced? [Spec §10]
|
|
99
|
+
- [ ] Do business rules match VETC constraints? [Spec §5]
|
|
100
|
+
- [ ] Are sensitive data handling rules consistent? [Spec §5, §8]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Category 4: Security & Compliance
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
## CHK-401: Security Requirements
|
|
107
|
+
- [ ] Are authentication requirements stated? [Spec §2, §10]
|
|
108
|
+
- [ ] Are authorization rules defined per actor? [Spec §2]
|
|
109
|
+
- [ ] Is sensitive data identified and handling specified? [Spec §5, §9]
|
|
110
|
+
- [ ] Are PII fields listed with masking rules? [Spec §9]
|
|
111
|
+
|
|
112
|
+
## CHK-402: VETC-Specific Security
|
|
113
|
+
- [ ] Is OTP handling specified (if applicable)? [Spec §4, §5]
|
|
114
|
+
- [ ] Are amount limits defined? [Spec §5, §7]
|
|
115
|
+
- [ ] Are transaction idempotency requirements stated? [Spec §4]
|
|
116
|
+
- [ ] Is audit logging requirement stated? [Spec §14]
|
|
117
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-systematic-debugging
|
|
3
|
+
description: PROACTIVELY activate khi gặp bug, runtime error, build failure, hoặc unexpected behavior. 4-phase root cause analysis — KHÔNG fix trước khi có root cause. "3+ fixes failed = architectural problem."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Systematic Debugging — 4-Phase Root Cause Analysis
|
|
7
|
+
|
|
8
|
+
Debug có hệ thống. Không guess-and-check. Tìm root cause TRƯỚC khi fix.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## When to Activate
|
|
13
|
+
|
|
14
|
+
- Runtime error, exception, stack trace
|
|
15
|
+
- Build failure (compile, test, package)
|
|
16
|
+
- Unexpected behavior (wrong data, wrong response, wrong state)
|
|
17
|
+
- Performance degradation
|
|
18
|
+
- User reports: "không work", "lỗi", "sai data"
|
|
19
|
+
- Sau khi `vetc-build-resolver` diagnose nhưng cần deeper analysis
|
|
20
|
+
|
|
21
|
+
## Do NOT Activate When
|
|
22
|
+
|
|
23
|
+
- Build error đơn giản (missing import, syntax error) → dùng `vetc-build-resolver`
|
|
24
|
+
- Bug đã biết root cause, chỉ cần fix → implement trực tiếp
|
|
25
|
+
- Lỗi chỉ cần đọc error message là hiểu → không cần 4-phase process
|
|
26
|
+
- Task không liên quan debugging (implementation, refactoring, review)
|
|
27
|
+
|
|
28
|
+
## Rationalization Prevention
|
|
29
|
+
|
|
30
|
+
| Thought | Reality |
|
|
31
|
+
|---------|---------|
|
|
32
|
+
| "I know what the bug is, let me just fix it" | You think you know. Prove it with evidence. |
|
|
33
|
+
| "Let me try this fix and see if it works" | That's guessing, not debugging. Investigate first. |
|
|
34
|
+
| "The error message tells me everything" | Error messages describe symptoms, not root causes. |
|
|
35
|
+
| "I'll add a try-catch to handle it" | Hiding the error ≠ fixing the error. |
|
|
36
|
+
| "It works on my machine" | Then something in the environment differs. Find what. |
|
|
37
|
+
| "This is probably a timing issue" | "Probably" is not a root cause. Reproduce it reliably. |
|
|
38
|
+
| "Let me restart the service" | Restarting masks the symptom. The bug will return. |
|
|
39
|
+
| "The tests are flaky, ignore them" | Flaky tests reveal real race conditions. Fix them. |
|
|
40
|
+
|
|
41
|
+
## Phase 1: Root Cause Investigation
|
|
42
|
+
|
|
43
|
+
**Goal:** Understand WHAT happened and WHERE.
|
|
44
|
+
|
|
45
|
+
### Step 1.1 — Reproduce
|
|
46
|
+
|
|
47
|
+
- Reproduce the error reliably (not "sometimes")
|
|
48
|
+
- Note exact steps to trigger
|
|
49
|
+
- Check: does it reproduce in dev? staging? only prod?
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Reproduce backend error
|
|
53
|
+
mvn test -Dtest=XxxServiceImplTest#testSpecificCase -q
|
|
54
|
+
|
|
55
|
+
# Reproduce frontend error
|
|
56
|
+
npm test -- --testPathPattern=XxxComponent
|
|
57
|
+
|
|
58
|
+
# Check recent changes
|
|
59
|
+
git log --oneline -20
|
|
60
|
+
git diff HEAD~5 --stat
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Step 1.2 — Read the Error
|
|
64
|
+
|
|
65
|
+
- Full stack trace, not just first line
|
|
66
|
+
- Error message → error code → HTTP status
|
|
67
|
+
- Which layer threw it? (Controller / Service / Repository / External)
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Error: NullPointerException
|
|
71
|
+
at WalletServiceImpl.transfer(WalletServiceImpl.java:145) ← HERE
|
|
72
|
+
at WalletController.handleTransfer(WalletController.java:67)
|
|
73
|
+
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native)
|
|
74
|
+
```
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-tdd
|
|
3
|
+
description: PROACTIVELY activate khi viết test cho service/controller/component mới, fix regression, hoặc khi cần tăng coverage. JUnit + Mockito + WireMock + RestAssured. Target 80%+ coverage.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Test-Driven Development
|
|
7
|
+
|
|
8
|
+
Viết test trước implementation. Test từ Spec → code đúng ngay lần đầu.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Viết test cho service, controller, hoặc component mới
|
|
13
|
+
- Fix regression — thêm test trước khi sửa bug
|
|
14
|
+
- Code review yêu cầu thêm test
|
|
15
|
+
- Cần boost coverage
|
|
16
|
+
|
|
17
|
+
## Do NOT Activate When
|
|
18
|
+
|
|
19
|
+
- Spike/prototype code (chưa cần test) → nhưng phải add tests trước khi merge
|
|
20
|
+
- Config files, documentation changes → không cần unit test
|
|
21
|
+
- Hotfix khẩn cấp (fix trước, add test ngay sau) → nhưng PHẢI add test trong cùng PR
|
|
22
|
+
- Chỉ sửa styling/CSS, không affect logic
|
|
23
|
+
|
|
24
|
+
## Rationalization Prevention
|
|
25
|
+
|
|
26
|
+
See: `./(see docs)` (11 common TDD rationalizations and why they're wrong)
|
|
27
|
+
|
|
28
|
+
## Good vs Bad Test Patterns
|
|
29
|
+
|
|
30
|
+
```java
|
|
31
|
+
// GOOD: Test name describes behavior, not implementation
|
|
32
|
+
@Test
|
|
33
|
+
public void givenInsufficientBalance_whenTransfer_thenThrowWithCorrectErrorCode() {
|
|
34
|
+
// Arrange
|
|
35
|
+
Wallet wallet = Wallet.builder().balance(BigDecimal.ZERO).build();
|
|
36
|
+
when(walletRepo.findByUserId(USER_ID)).thenReturn(Optional.of(wallet));
|
|
37
|
+
|
|
38
|
+
// Act & Assert
|
|
39
|
+
assertThatThrownBy(() -> service.transfer(transferRequest))
|
|
40
|
+
.isInstanceOf(CustomizeException.class)
|
|
41
|
+
.hasFieldOrPropertyWithValue("errorCode", "INSUFFICIENT_BALANCE");
|
|
42
|
+
|
|
43
|
+
## Testing Anti-Patterns
|
|
44
|
+
|
|
45
|
+
| Anti-Pattern | Why It's Bad | Fix |
|
|
46
|
+
|-------------|-------------|-----|
|
|
47
|
+
| Testing private methods | Breaks on refactor | Test through public API |
|
|
48
|
+
| Mocking what you own | Couples test to impl | Use real instances or fakes |
|
|
49
|
+
| `verify(mock).call()` everywhere | Over-specified mocks | Only verify interactions that matter |
|
|
50
|
+
| `Thread.sleep()` in tests | Flaky, slow | Use `awaitility` or `assertEventually` |
|
|
51
|
+
| Ignoring test failures | False confidence | Fix the test, fix the code, or delete the test |
|
|
52
|
+
| Snapshot testing everything | Brittle, meaningless | Snapshot only stable output (contracts) |
|
|
53
|
+
|
|
54
|
+
## VETC Test Infrastructure
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
Backend:
|
|
58
|
+
JUnit 4 hoặc 5 (detect từ pom.xml)
|
|
59
|
+
Mockito — mock dependencies
|
|
60
|
+
Spring Boot Test — integration slice
|
|
61
|
+
RestAssured — HTTP testing
|
|
62
|
+
WireMock — mock external services (port 8488)
|
|
63
|
+
AssertJ — fluent assertions
|
|
64
|
+
|
|
65
|
+
Frontend:
|
|
66
|
+
Jest + React Testing Library
|
|
67
|
+
@testing-library/jest-dom
|
|
68
|
+
User-event — simulate interactions
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Goal Transformation (từ Karpathy)
|
|
72
|
+
|
|
73
|
+
Trước khi bắt đầu TDD, biến task mơ hồ thành verifiable goals:
|
|
74
|
+
|
|
75
|
+
| Imperative Task | Verifiable Goal |
|
|
76
|
+
|----------------|-----------------|
|
|
77
|
+
| "Add validation" | "Write tests cho invalid inputs, then make them pass" |
|
|
78
|
+
| "Fix the bug" | "Write a test reproduces the bug, then make it pass" |
|
|
79
|
+
| "Add error handling" | "Write tests cho mỗi error scenario trong spec, then handle" |
|
|
80
|
+
| "Refactor X" | "Tests hiện tại vẫn pass sau khi refactor" |
|
|
81
|
+
| "Improve performance" | "Benchmark trước/sau: Xms → Yms, tests vẫn pass" |
|
|
82
|
+
|
|
83
|
+
**Multi-step Verification Plan** (cho mỗi task):
|
|
84
|
+
```
|
|
85
|
+
1. [Step] → verify: [check]
|
|
86
|
+
|
|
87
|
+
## TDD Workflow
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
RED → Write failing test (từ Spec acceptance criteria)
|
|
91
|
+
SEE IT FAIL — confirm failure reason is correct
|
|
92
|
+
GREEN → Write MINIMAL implementation để pass test
|
|
93
|
+
No gold-plating. No "might need later."
|
|
94
|
+
REFACTOR → Clean up, verify coverage ≥ 80%
|
|
95
|
+
Run ALL tests after refactor. Every time.
|
|
96
|
+
```
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-thinking-pm
|
|
3
|
+
description: PROACTIVELY activate khi BA gửi file Word/PDF/Jira/BRD cần chuẩn hóa, hoặc khi có tài liệu đối tác cần tích hợp. Biến tài liệu đa dạng thành raw-ba-requirements.md chuẩn. Dùng trước vetc-analyze-ba.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Thinking Like Product Manager
|
|
7
|
+
|
|
8
|
+
Chuẩn hóa mọi loại tài liệu BA thành `raw-ba-requirements.md` — format chuẩn, sẵn sàng cho `vetc-analyze-ba`.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- BA gửi file Word/PDF/text/Jira, cần chuẩn hóa trước khi phân tích
|
|
13
|
+
- Có tài liệu đối tác (partner API docs, sequence diagrams) cần tích hợp với yêu cầu nội bộ
|
|
14
|
+
- Cần làm rõ scope, phân biệt "đối tác làm gì" vs "hệ thống VETC sẽ làm gì"
|
|
15
|
+
- User paste text requirement trực tiếp vào chat (không có file)
|
|
16
|
+
- Trước khi chạy `vetc-analyze-ba`
|
|
17
|
+
|
|
18
|
+
## Do NOT Activate When
|
|
19
|
+
|
|
20
|
+
- Requirement đã rõ ràng, có spec chi tiết → dùng `vetc-analyze-ba` hoặc `vetc-spec-driven`
|
|
21
|
+
- Chỉ implement theo spec sẵn có → dùng `vetc-java-patterns` hoặc `vetc-frontend-patterns`
|
|
22
|
+
- Bug fix không cần phân tích requirement
|
|
23
|
+
- Code review, không phải requirement analysis
|
|
24
|
+
|
|
25
|
+
## Thứ tự dùng
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
1. vetc-analyze-codebase (1 lần cho project — tạo codebase-spec.md)
|
|
29
|
+
2. vetc-thinking-pm (chuẩn hóa input BA) ← skill này
|
|
30
|
+
3. vetc-analyze-ba (phân tích + implement 13 bước)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Cấu trúc thư mục
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
design/thinking/{feature-name}/
|
|
37
|
+
├── source/ ← user bỏ file vào đây (Word, PDF, YAML, text...)
|
|
38
|
+
├── converted/ ← AI đọc từ đây (chạy convert-file source/ để tạo)
|
|
39
|
+
│ ├── partner_*.md ← tài liệu đối tác (API spec, sequence flow)
|
|
40
|
+
│ └── internal_*.md ← tài liệu nội bộ (requirements, notes)
|
|
41
|
+
└── raw-ba-requirements.md ← OUTPUT
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Quy ước đặt tên:**
|
|
45
|
+
- `partner_{mô-tả}.ext` — tài liệu từ đối tác/third party
|
|
46
|
+
- `internal_{mô-tả}.ext` — tài liệu nội bộ VETC
|
|
47
|
+
|
|
48
|
+
## Workflow (5 Phases)
|
|
49
|
+
|
|
50
|
+
### Phase 0 — Chuẩn bị
|
|
51
|
+
|
|
52
|
+
**Mode A — File-based (có Word/PDF):**
|
|
53
|
+
1. Parse feature name từ command argument (kebab-case)
|
|
54
|
+
2. Kiểm tra `design/thinking/{feature}/converted/` tồn tại
|
|
55
|
+
3. List files trong converted/, phân loại `partner_*` vs `internal_*`
|
|
56
|
+
4. Nếu `converted/` chưa có → hướng dẫn convert:
|
|
57
|
+
- Dùng pandoc: `pandoc source/spec.docx -o converted/internal_spec.md`
|
|
58
|
+
- Hoặc dùng công cụ convert khác, đặt output vào `converted/`
|
|
59
|
+
|
|
60
|
+
**Mode B — Direct Text (không có file):**
|
|
61
|
+
1. User paste text requirement trực tiếp → skip Phase 0-1 file scanning
|
|
62
|
+
2. Coi toàn bộ text là `internal_*` source
|
|
63
|
+
3. Tiếp tục từ Phase 2 (Phân tích)
|
|
64
|
+
|
|
65
|
+
### Phase 1 — Thu thập
|
|
66
|
+
- Đọc file `.md`, `.txt` từ `converted/` (gắn nhãn Partner/Internal theo prefix)
|
|
67
|
+
- Parse `.yaml/.yml` (OpenAPI) → paths, schemas; phân biệt API đối tác vs API dự kiến nội bộ
|
|
68
|
+
- Parse `.puml` (PlantUML) và `.mmd/.mermaid` → actors, flows
|
|
69
|
+
- Gộp nội dung, gắn mỗi phần với Source (`converted/{file}:{line_range}`)
|
|
70
|
+
|
|
71
|
+
### Phase 2 — Phân tích
|
|
72
|
+
- Tách REQ, BR, AC, UC từ mọi nguồn
|
|
73
|
+
- Mỗi mục phải có Source — KHÔNG đoán, KHÔNG suy diễn không có nguồn
|
|
74
|
+
- Ánh xạ REQ ↔ AC ↔ UC
|
|
75
|
+
- Phân loại delta: ADDED / MODIFIED / REMOVED
|
|
76
|
+
- Xác định GAPs — thiếu thông tin, mâu thuẫn, mơ hồ
|
|
77
|
+
- Từ `internal_*`: rút ra "góc nhìn hệ thống VETC sẽ làm" (product deliverables, system responsibilities)
|
|
78
|
+
- Từ `partner_*`: suy ra API/luồng dự kiến hệ thống ta sẽ build
|
|
79
|
+
|
|
80
|
+
### Phase 3 — Chuẩn hóa (OpenSpec + spec-kit schema)
|
|
81
|
+
Điền vào template `../../templates/raw-ba-requirements-template.md`:
|
|
82
|
+
|
|
83
|
+
| Section | Schema nguồn | Nội dung |
|
|
84
|
+
|---------|-------------|---------|
|
|
85
|
+
| 0. Execution Log | — | Ghi lại từng Phase đã làm |
|
|
86
|
+
| 1. Context | OpenSpec | Why, What Changes, Impact |
|
|
87
|
+
| 1b. System View | Internal | Hệ thống VETC sẽ làm gì, out of scope |
|
|
88
|
+
| 2. Capabilities | OpenSpec | New/Modified capabilities |
|
|
89
|
+
| 3. User Stories | spec-kit | Priority P1/P2/P3, Given/When/Then |
|
|
90
|
+
| 4. Requirements | Cả hai | REQ với delta ADDED/MODIFIED/REMOVED |
|
|
91
|
+
| 5. Business Rules | Cả hai | BR với Source |
|
|
92
|
+
| 6. Scenarios | OpenSpec | WHEN/THEN format |
|
|
93
|
+
| 7. Acceptance Criteria | Cả hai | AC map REQ/UC |
|
|
94
|
+
| 8. Data/API | API draft | Partner APIs + Planned Internal APIs |
|
|
95
|
+
|
|
96
|
+
### Phase 4 — Validation
|
|
97
|
+
- Checklist: User stories có Priority + Given/When/Then?
|
|
98
|
+
- Mọi AC map tới REQ/UC?
|
|
99
|
+
- Error scenarios đã liệt kê?
|
|
100
|
+
- Mọi mục có Source?
|
|
101
|
+
|
|
102
|
+
### Phase 5 — Output & Handoff
|
|
103
|
+
1. Ghi `design/thinking/{feature}/raw-ba-requirements.md` (bao gồm Execution Log)
|
|
104
|
+
2. Dừng → chờ user review
|
|
105
|
+
3. Sau user confirm → hỏi: "Sẵn sàng move sang `specs/features/{feature}/`?"
|
|
106
|
+
4. Dừng → chờ confirm
|
|
107
|
+
5. Khi user confirm → copy file (đề xuất lệnh trước khi thực thi)
|
|
108
|
+
|
|
109
|
+
## Anti-Hallucination Rules (BẮT BUỘC)
|
|
110
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-ui-visual-qa
|
|
3
|
+
description: PROACTIVELY activate khi implement/change React component, thay đổi styling, release candidate cho agency-portal hoặc ops-ui. Validate WCAG 2.2 AA, responsive, dark mode (nếu có), focus management, screen reader compatibility.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC UI Visual QA — Accessibility + Visual Consistency
|
|
7
|
+
|
|
8
|
+
Đảm bảo UI VETC (agency-portal, ops-ui) tuân thủ WCAG 2.2 AA, responsive (320px-1920px), focus management đúng, screen reader navigable. Không dừng ở "looks OK on my laptop".
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Component mới implement — accessibility + visual sweep
|
|
13
|
+
- Style change (color/font/spacing) — verify contrast & consistency
|
|
14
|
+
- Form/input component — keyboard + SR navigation
|
|
15
|
+
- Modal/dropdown/drawer — focus trap + escape handling
|
|
16
|
+
- Release candidate — full a11y audit
|
|
17
|
+
- Bug report: "screen reader can't read X" / "keyboard stuck"
|
|
18
|
+
|
|
19
|
+
## Do NOT Activate When
|
|
20
|
+
|
|
21
|
+
- Backend-only change — no UI
|
|
22
|
+
- Internal tool with 1-2 users, no a11y requirement (still recommended but lower priority)
|
|
23
|
+
- Component still WIP — wait for completion
|
|
24
|
+
|
|
25
|
+
## WCAG 2.2 AA Checklist — VETC Focus
|
|
26
|
+
|
|
27
|
+
### Perceivable (can users sense content?)
|
|
28
|
+
|
|
29
|
+
- [ ] **Text contrast ≥ 4.5:1** for normal text, ≥ 3:1 for large text (≥24px or 18.66px bold)
|
|
30
|
+
- [ ] **UI control contrast ≥ 3:1** (buttons, form borders, focus indicators) — WCAG 2.2 new
|
|
31
|
+
- [ ] **No color-only info** (e.g., red = error must have icon + label too)
|
|
32
|
+
- [ ] **Alt text on images** — `<img alt="...">`, `aria-label` on icon buttons
|
|
33
|
+
- [ ] **Captions on videos** (if any)
|
|
34
|
+
- [ ] **Resize to 200%** without loss of content/function
|
|
35
|
+
- [ ] **Reflow at 320px** wide — no horizontal scroll (except tables/code)
|
|
36
|
+
- [ ] **Text spacing** adjustable: line 1.5x, paragraph 2x, letter 0.12x, word 0.16x
|
|
37
|
+
|
|
38
|
+
### Operable (can users interact?)
|
|
39
|
+
|
|
40
|
+
- [ ] **Keyboard accessible** — every interactive element reachable via Tab
|
|
41
|
+
- [ ] **Visible focus indicator** — ≥ 3:1 contrast (WCAG 2.2)
|
|
42
|
+
- [ ] **Focus not obscured** by sticky header/footer (WCAG 2.2 new)
|
|
43
|
+
- [ ] **No keyboard trap** — Tab always moves forward, Shift+Tab backward
|
|
44
|
+
- [ ] **Escape closes modal/dropdown** — restores focus to trigger
|
|
45
|
+
- [ ] **Target size ≥ 24×24px** (WCAG 2.2 new, was 44×44 in 2.1)
|
|
46
|
+
- [ ] **Skip link** to main content (for screen reader users)
|
|
47
|
+
- [ ] **No auto-play** media without controls
|
|
48
|
+
- [ ] **Enough time** — warn before session timeout (15min warning)
|
|
49
|
+
|
|
50
|
+
### Understandable (can users comprehend?)
|
|
51
|
+
|
|
52
|
+
- [ ] **Language declared**: `<html lang="vi">`
|
|
53
|
+
- [ ] **Form labels** — every input has visible label or `aria-label`
|
|
54
|
+
- [ ] **Error messages** — identify field + describe fix (not "invalid")
|
|
55
|
+
- [ ] **Help text** associated via `aria-describedby`
|
|
56
|
+
- [ ] **Consistent navigation** — same menu position across pages
|
|
57
|
+
- [ ] **Consistent identification** — same icon = same function everywhere
|
|
58
|
+
- [ ] **Input suggestion on error** — "Amount must be between 1,000 and 10,000,000"
|
|
59
|
+
|
|
60
|
+
### Robust (can assistive tech parse?)
|
|
61
|
+
|
|
62
|
+
- [ ] **Valid HTML** — no duplicate IDs, proper nesting
|
|
63
|
+
- [ ] **ARIA roles** where semantic HTML insufficient (`role="dialog"`, `role="tab"`)
|
|
64
|
+
- [ ] **ARIA states/props** updated dynamically (`aria-expanded`, `aria-selected`)
|
|
65
|
+
- [ ] **Status messages** announced — `role="status"` or `role="alert"` for async updates
|
|
66
|
+
- [ ] **Name, Role, Value exposed** — every UI component testable via accessibility tree
|
|
67
|
+
|
|
68
|
+
## VETC-Specific Checks
|
|
69
|
+
|
|
70
|
+
### Ant Design / MUI Components
|
|
71
|
+
|
|
72
|
+
- [ ] Use Ant Design 5.x+ (built-in a11y better than 4.x)
|
|
73
|
+
- [ ] Don't override `tabindex` unless necessary
|
|
74
|
+
- [ ] Custom icons must have `aria-label` or `aria-hidden="true"` (if decorative)
|
|
75
|
+
- [ ] Modal `closable={true}` → Escape key works
|
|
76
|
+
- [ ] Form.Item `label` prop provides label association
|
|
77
|
+
|
|
78
|
+
### Vietnamese Text
|
|
79
|
+
|
|
80
|
+
- [ ] Font supports Vietnamese diacritics (most modern fonts OK, but test: "Nguyễn", "Đặng", "Ớt")
|
|
81
|
+
- [ ] No broken ligatures
|
|
82
|
+
- [ ] Vietnamese locale for date/number formatters (`vi-VN`)
|
|
83
|
+
- [ ] Long text (VN often 20% longer than EN) — no truncation in UI labels
|
|
84
|
+
|
|
85
|
+
### Currency & Numbers
|
|
86
|
+
|
|
87
|
+
- [ ] Use Intl.NumberFormat with `vi-VN` locale: `1.234.567 đ`
|
|
88
|
+
- [ ] Thousand separator: `.` (VN standard), not `,`
|
|
89
|
+
- [ ] Currency position: after amount (`100.000 đ`)
|
|
90
|
+
- [ ] Never truncate currency (10,000,000 → "10M" loses precision)
|
|
91
|
+
- [ ] Sign amounts clearly: debit `-100.000 đ` (red + minus), credit `+100.000 đ` (green + plus)
|
|
92
|
+
|
|
93
|
+
### Sensitive Data
|
|
94
|
+
|
|
95
|
+
- [ ] CCCD displayed partially masked by default: `001***999`
|
|
96
|
+
- [ ] Phone partially masked: `0912***345`
|
|
97
|
+
- [ ] Balance hidden until user clicks "Show" — for public terminals
|
|
98
|
+
- [ ] No sensitive data in URL query string (visible in browser history)
|
|
99
|
+
- [ ] No sensitive data in page title (visible in tab name)
|
|
100
|
+
|
|
101
|
+
## Workflow
|
|
102
|
+
|
|
103
|
+
### Step 1 — Static Check (axe-core)
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# In dev mode, enable axe
|
|
107
|
+
if (process.env.NODE_ENV === 'development') {
|
|
108
|
+
import('@axe-core/react').then(axe => axe.default(React, ReactDOM, 1000));
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Run dev server, open browser DevTools Console — axe reports violations.
|
|
113
|
+
|
|
114
|
+
Or use CLI:
|
|
115
|
+
```bash
|
|
116
|
+
npx @axe-core/cli https://localhost:3000/wallet/transfer
|
|
117
|
+
```
|