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,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-deep-interview
|
|
3
|
+
description: Kích hoạt khi requirement còn mơ hồ, chưa rõ scope/actor/edge cases. Socratic clarification với ambiguity scoring. Output ra specs/interviews/{slug}.md rồi handoff vetc-ralplan hoặc vetc-analyze-ba.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Deep Interview — Socratic Clarification
|
|
7
|
+
|
|
8
|
+
Làm rõ yêu cầu trước khi plan hoặc implement. Tránh rework từ misaligned implementation.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## When to Activate
|
|
13
|
+
|
|
14
|
+
- User mô tả tính năng ngắn gọn, chưa rõ scope ("thêm chức năng X", "fix vấn đề Y")
|
|
15
|
+
- Requirement còn ambiguous — thiếu actor, business rules, edge cases, acceptance criteria
|
|
16
|
+
- Cần validate hiểu biết với BA/PO trước khi commit vào implementation
|
|
17
|
+
- Trước khi dùng `vetc-ralplan` hoặc `vetc-analyze-ba`
|
|
18
|
+
- User nói: "hỏi tôi về requirement", "làm rõ trước", "deep interview"
|
|
19
|
+
|
|
20
|
+
## Red Flags — Stop and Re-Evaluate
|
|
21
|
+
|
|
22
|
+
These thoughts mean you are about to bypass this skill incorrectly:
|
|
23
|
+
|
|
24
|
+
| Thought | Reality |
|
|
25
|
+
|---------|---------|
|
|
26
|
+
| "This feature is simple, no need for clarification" | "Simple" features have the worst rework rates. |
|
|
27
|
+
| "I can guess what they want" | Your guess is wrong. Ask. |
|
|
28
|
+
| "The user seems impatient, skip to coding" | Rework takes 10x longer than clarification. |
|
|
29
|
+
| "I've seen this pattern before in VETC" | Similar ≠ same. E-Wallet vs ACS vs eKYC differ critically. |
|
|
30
|
+
| "The spec will become clear during implementation" | It won't. It will become a mess. |
|
|
31
|
+
| "One question is enough" | One question gives one answer. You need the full picture. |
|
|
32
|
+
|
|
33
|
+
## Do NOT activate when
|
|
34
|
+
|
|
35
|
+
- Đã có `raw-ba-requirements.md` rõ ràng → dùng `vetc-analyze-ba`
|
|
36
|
+
- Đã có Structured Spec → dùng `vetc-ralplan` hoặc `vetc-planner`
|
|
37
|
+
- User cung cấp file path / function name cụ thể → implement ngay
|
|
38
|
+
|
|
39
|
+
## Recommended Pipeline
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
vetc-deep-interview → vetc-ralplan → vetc-analyze-ba (hoặc vetc-java-patterns)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Ambiguity Dimensions (VETC-adapted)
|
|
46
|
+
|
|
47
|
+
| Dimension | Weight (New) | Weight (Change) | Focus |
|
|
48
|
+
|-----------|-------------|-----------------|-------|
|
|
49
|
+
| Intent | 0.25 | 0.25 | Tại sao cần tính năng này? Business goal? |
|
|
50
|
+
| Outcome | 0.20 | 0.20 | End state mong đợi là gì? |
|
|
51
|
+
| Scope | 0.20 | 0.20 | Phạm vi: module nào, role nào, flow nào? |
|
|
52
|
+
| Business Rules | 0.15 | 0.15 | Ràng buộc nghiệp vụ (amount limits, timing, roles) |
|
|
53
|
+
| Success Criteria | 0.10 | 0.10 | Làm sao biết là xong? Test case nào? |
|
|
54
|
+
| Integrations | 0.10 | 0.10 | ACS, Bank GW, eKYC, RabbitMQ ảnh hưởng gì? |
|
|
55
|
+
|
|
56
|
+
**Ambiguity score** = `1 - weighted_sum_of_clarity_scores`
|
|
57
|
+
|
|
58
|
+
Threshold: `<= 0.20` (Standard) | `<= 0.30` (Quick) | `<= 0.15` (Deep)
|
|
59
|
+
|
|
60
|
+
## Ambiguity Taxonomy (Spec-Kit adapted)
|
|
61
|
+
|
|
62
|
+
10+ category taxonomy để scan ambiguity có hệ thống:
|
|
63
|
+
|
|
64
|
+
| # | Category | Probing Questions | VETC Examples |
|
|
65
|
+
|---|----------|-------------------|---------------|
|
|
66
|
+
| 1 | Functional Scope | Tính năng làm gì? Không làm gì? | Nạp tiền qua QR: chỉ top-up hay cả thanh toán? |
|
|
67
|
+
| 2 | Domain & Data Model | Entity nào? Relationship? | Transaction có link Wallet không? Journal entry loại gì? |
|
|
68
|
+
| 3 | Interaction & UX | User thấy gì? Click gì? | Confirm screen trước hay sau scan QR? |
|
|
69
|
+
| 4 | Non-Functional Quality | Performance? Availability? | 100 concurrent users? 99.9% uptime? |
|
|
70
|
+
| 5 | Integration | External systems? Protocols? | Bank GW đồng bộ hay async? Retry policy? |
|
|
71
|
+
| 6 | Edge Cases & Error Handling | Lỗi thì sao? Recovery? | QR expired → refresh hay tạo mới? |
|
|
72
|
+
| 7 | Constraints & Limits | Amount? Frequency? Timing? | Min/max top-up? Daily limit? |
|
|
73
|
+
| 8 | Security & Auth | Role? Permission? Data sensitivity? | Agent top-up hộ customer được không? |
|
|
74
|
+
| 9 | Terminology & Concepts | Term đồng nghĩa? Ambiguous? | "Balance" = available hay including frozen? |
|
|
75
|
+
|
|
76
|
+
## Workflow
|
|
77
|
+
|
|
78
|
+
### Phase 0 — Preflight
|
|
79
|
+
|
|
80
|
+
1. Parse feature slug từ input (kebab-case)
|
|
81
|
+
2. Kiểm tra `specs/interviews/{slug}-*.md` — nếu có, load context và resume
|
|
82
|
+
3. Tạo context snapshot:
|
|
83
|
+
```
|
|
84
|
+
specs/interviews/{slug}-{YYYYMMDD}.md
|
|
85
|
+
├── Task statement
|
|
86
|
+
├── Probable intent hypothesis
|
|
87
|
+
├── Known facts
|
|
88
|
+
├── Open questions
|
|
89
|
+
└── VETC integrations likely involved
|
|
90
|
+
```
|
|
91
|
+
4. Thông báo: ambiguity hiện tại, mode (Quick/Standard/Deep), max rounds
|
|
92
|
+
|
|
93
|
+
### Phase 1 — Socratic Interview Loop
|
|
94
|
+
|
|
95
|
+
**Quy tắc:**
|
|
96
|
+
- Hỏi **1 câu** mỗi round — không batch
|
|
97
|
+
- Ưu tiên Intent → Scope → Business Rules → Success Criteria → Integrations
|
|
98
|
+
- Sau mỗi câu trả lời: pressure test (counterexample, hidden assumption, tradeoff)
|
|
99
|
+
- Research codebase trước khi hỏi user về internals
|
|
100
|
+
|
|
101
|
+
**Round format:**
|
|
102
|
+
|
|
103
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-docgen
|
|
3
|
+
description: PROACTIVELY activate khi implement xong API mới và trước khi merge — sinh Swagger/OpenAPI annotations, update CHANGELOG, generate technical note từ spec + code diff. Đảm bảo docs luôn đồng bộ với implementation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC DocGen — Keep Docs in Sync with Code
|
|
7
|
+
|
|
8
|
+
Sau khi implement xong, tự động sinh Swagger annotations, CHANGELOG entry, technical notes từ spec + code diff. Không để docs drift khỏi implementation.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- API mới implement xong, chuẩn bị merge — cần Swagger docs
|
|
13
|
+
- Breaking change / API contract thay đổi — CHANGELOG entry
|
|
14
|
+
- Release chuẩn bị cut — generate release notes từ commits
|
|
15
|
+
- Onboarding doc cho service mới — technical overview
|
|
16
|
+
- Post-implementation documentation catch-up
|
|
17
|
+
|
|
18
|
+
## Do NOT Activate When
|
|
19
|
+
|
|
20
|
+
- Code chưa implement xong — docs sẽ lệch
|
|
21
|
+
- Pure refactor không thay signature — no new API doc needed
|
|
22
|
+
- Internal helper class — không cần javadoc đầy đủ
|
|
23
|
+
- Spec chưa approved — doc content sẽ thay đổi
|
|
24
|
+
|
|
25
|
+
## Scope of DocGen
|
|
26
|
+
|
|
27
|
+
### 1. Swagger / OpenAPI Annotations
|
|
28
|
+
|
|
29
|
+
For Spring Boot Controllers:
|
|
30
|
+
|
|
31
|
+
```java
|
|
32
|
+
@RestController
|
|
33
|
+
@RequestMapping("/wallet/v1")
|
|
34
|
+
@Tag(name = "Wallet", description = "Wallet transfer and balance operations")
|
|
35
|
+
public class WalletController {
|
|
36
|
+
|
|
37
|
+
@Operation(
|
|
38
|
+
summary = "Transfer money between wallets",
|
|
39
|
+
description = "Debit source wallet and credit target wallet atomically. " +
|
|
40
|
+
"Requires Smart OTP for amounts > 500,000 VND.",
|
|
41
|
+
responses = {
|
|
42
|
+
|
|
43
|
+
## [1.2.0] - 2026-04-17
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- `POST /wallet/v1/transfer` — atomic transfer between wallets with idempotency (VETC-123)
|
|
47
|
+
- Smart OTP integration for transfers > 500K VND (VETC-128)
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
- `POST /wallet/v1/balance` response now includes `availableBalance` field (VETC-135)
|
|
51
|
+
- **Breaking for consumers** relying on exact field list — add `availableBalance` handler
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
- Race condition in `ReconcileService.matchTransactions()` when duplicate keys (VETC-142)
|
|
55
|
+
|
|
56
|
+
### Security
|
|
57
|
+
- Upgraded Spring Boot 3.2.0 → 3.2.4 (CVE-2024-XXXX patched)
|
|
58
|
+
|
|
59
|
+
### Deprecated
|
|
60
|
+
- `POST /wallet/v1/transfer-simple` — will be removed in 2.0.0. Use `/transfer` with `skipOtp=false`.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 3. Technical Note (from Spec + Diff)
|
|
64
|
+
|
|
65
|
+
When implementing non-trivial feature, generate:
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
# Technical Note: Smart OTP for High-Value Transfers
|
|
69
|
+
|
|
70
|
+
**Feature**: VETC-128
|
|
71
|
+
**Author**: {dev}
|
|
72
|
+
**Date**: 2026-04-17
|
|
73
|
+
**Status**: Implemented
|
|
74
|
+
|
|
75
|
+
## Context
|
|
76
|
+
Transfer > 500K VND requires 2FA. Previous impl used SMS OTP (cost + delay).
|
|
77
|
+
New: Smart OTP via app push (free, <2s delivery).
|
|
78
|
+
|
|
79
|
+
## Implementation Summary
|
|
80
|
+
- New `SmartOtpService` generates TOTP seed on device registration
|
|
81
|
+
- Transfer endpoint validates OTP via Redis-stored challenge
|
|
82
|
+
- Fallback to SMS if Smart OTP unavailable (device offline > 5min)
|
|
83
|
+
|
|
84
|
+
## Key Files
|
|
85
|
+
- `wallet-service/src/main/java/vn/vetc/wallet/service/SmartOtpService.java` (new)
|
|
86
|
+
- `wallet-service/src/main/java/vn/vetc/wallet/controller/WalletController.java` (modified)
|
|
87
|
+
- `infra-service/src/main/java/vn/vetc/infra/OtpConfig.java` (modified)
|
|
88
|
+
|
|
89
|
+
## API Changes
|
|
90
|
+
| Endpoint | Change | Breaking? |
|
|
91
|
+
|----------|--------|-----------|
|
|
92
|
+
| POST /wallet/v1/transfer | Added `otpType: SMART\|SMS` | No (default: SMART) |
|
|
93
|
+
| POST /otp/v1/verify | Added `challengeId` field | No |
|
|
94
|
+
|
|
95
|
+
## Database Changes
|
|
96
|
+
- New table: `WALLET_OTP_CHALLENGE` (Redis-backed, TTL 300s)
|
|
97
|
+
- No schema migration needed
|
|
98
|
+
|
|
99
|
+
## Rollout Plan
|
|
100
|
+
1. Feature flag `vetc.feature.smart-otp.enabled=false` in prod
|
|
101
|
+
2. Enable for 5% users (A/B test)
|
|
102
|
+
3. Monitor error rate, OTP delivery success
|
|
103
|
+
4. Full rollout after 48h stable
|
|
104
|
+
|
|
105
|
+
## Rollback
|
|
106
|
+
- Disable feature flag → falls back to SMS OTP
|
|
107
|
+
- No schema rollback needed
|
|
108
|
+
```
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-frontend-patterns
|
|
3
|
+
description: PROACTIVELY activate khi implement React/TypeScript feature, thêm page/component/API module, hoặc fix TS error. Auto-detect version từ package.json. Bao gồm Axios interceptor, Redux, Ant Design/MUI patterns.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Frontend Patterns
|
|
7
|
+
|
|
8
|
+
React/TypeScript implementation patterns cho VETC frontend apps.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Implement React/TypeScript feature cho agency portal hoặc ops-ui
|
|
13
|
+
- Thêm page, component, API module, Redux slice
|
|
14
|
+
- Fix TypeScript error hoặc React warning
|
|
15
|
+
|
|
16
|
+
## Do NOT Activate When
|
|
17
|
+
|
|
18
|
+
- Đang làm backend/Java/Spring Boot work (dùng `vetc-java-patterns`)
|
|
19
|
+
- Chỉ làm database work — schema, migration, query (dùng `vetc-oracle-patterns`)
|
|
20
|
+
- Chỉ viết API contract/design (dùng `vetc-api-design`)
|
|
21
|
+
|
|
22
|
+
## Gotchas — Frontend Traps
|
|
23
|
+
|
|
24
|
+
1. **Raw `axios` thay vì `axiosInstance`** → Bypass interceptor (auth token, refresh token). Luôn import từ `AxiosInterceptor`.
|
|
25
|
+
|
|
26
|
+
2. **`useEffect` thiếu dependency** → Stale closure bug. React strict mode sẽ catch nhưng production thì không. Luôn check deps.
|
|
27
|
+
|
|
28
|
+
3. **`any` type leakage** → TypeScript mất giá trị. Dùng `unknown` + type guard thay vì `any`.
|
|
29
|
+
|
|
30
|
+
4. **Token trong localStorage** → XSS có thể steal. Dùng httpOnly cookie hoặc in-memory storage.
|
|
31
|
+
|
|
32
|
+
5. **`console.log` với sensitive data** → Token, balance, CCCD lọt vào browser console. Remove tất cả debug logs trước ship.
|
|
33
|
+
|
|
34
|
+
6. **Base64 encode nhầm encrypt** → `btoa(customerId)` chỉ encoding, không bảo mật. Không dùng thay thế encryption.
|
|
35
|
+
|
|
36
|
+
7. **`useAppSelector` vs `useSelector`** → Phải dùng typed hooks từ store, không dùng raw Redux hooks. Mất type safety.
|
|
37
|
+
|
|
38
|
+
## Step 0 — Auto-Detect Stack (luôn làm trước)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Detect versions
|
|
42
|
+
cat package.json | grep -E '"react"|"typescript"|"@reduxjs|"react-query"|"antd"|"@mui|"vite"'
|
|
43
|
+
|
|
44
|
+
# Detect build tool (CRA vs Vite)
|
|
45
|
+
ls vite.config.* package.json
|
|
46
|
+
|
|
47
|
+
# Read 2-3 nearby files để mirror exact style
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Xác định:
|
|
51
|
+
- React version → hooks patterns, concurrent features
|
|
52
|
+
- Build tool: CRA (`react-scripts`) hay Vite
|
|
53
|
+
- UI lib: Ant Design v4/v5 hay MUI v5
|
|
54
|
+
- State: Redux Toolkit, Zustand hay Context
|
|
55
|
+
- Query: react-query v3, TanStack v4/v5 hay SWR
|
|
56
|
+
|
|
57
|
+
## TypeScript Conventions (official)
|
|
58
|
+
|
|
59
|
+
**Naming conventions:**
|
|
60
|
+
```typescript
|
|
61
|
+
// Interface/Type/Class/Enum: PascalCase
|
|
62
|
+
interface CustomerData { id: number; name: string }
|
|
63
|
+
type ApiResponse<T> = { code: string; data: T; message: string }
|
|
64
|
+
enum TransactionStatus { PENDING = 'PENDING', SUCCESS = 'SUCCESS' }
|
|
65
|
+
|
|
66
|
+
// Variable/Function: camelCase
|
|
67
|
+
const customerData = fetchCustomer(id);
|
|
68
|
+
|
|
69
|
+
// Component: PascalCase matching filename
|
|
70
|
+
const CustomerDetailPage: React.FC = ({ id }) => { };
|
|
71
|
+
|
|
72
|
+
## API Module Pattern
|
|
73
|
+
|
|
74
|
+
PASS: Use shared axiosInstance with interceptors (auth token, refresh):
|
|
75
|
+
```typescript
|
|
76
|
+
import axiosInstance from '../../config/AxiosInterceptor';
|
|
77
|
+
|
|
78
|
+
// Sensitive params: base64 encode (custId, custNo, mobiNumber, walletId, accountNo)
|
|
79
|
+
export const getWallet = async (custId: number) => {
|
|
80
|
+
const { data } = await axiosInstance.get(`/api/v1/wallet/${btoa(String(custId))}`);
|
|
81
|
+
return data;
|
|
82
|
+
};
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
FAIL: Raw axios bypasses auth interceptor:
|
|
86
|
+
```typescript
|
|
87
|
+
|
|
88
|
+
## React Query — Version-Adaptive
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
// v3: useQuery(['key', id], () => fn(id))
|
|
92
|
+
// v4/v5 TanStack: useQuery({ queryKey: ['key', id], queryFn: () => fn(id) })
|
|
93
|
+
|
|
94
|
+
// Invalidate cache sau mutation:
|
|
95
|
+
const client = useQueryClient();
|
|
96
|
+
useMutation(createFn, {
|
|
97
|
+
onSuccess: () => client.invalidateQueries(['list-key'])
|
|
98
|
+
});
|
|
99
|
+
```
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-iterative-retrieval
|
|
3
|
+
description: PROACTIVELY activate khi subagent cần progressive context refinement — khi kết quả ban đầu không đủ thông tin, cần tìm kiếm sâu hơn. 4-phase DISPATCH→EVALUATE→REFINE→LOOP pattern cho high-quality context retrieval.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Iterative Retrieval
|
|
7
|
+
|
|
8
|
+
Structured pattern cho progressive context refinement trong subagents. Thay vì tìm kiếm 1 lần và chấp nhận kết quả, iterative retrieval cho phép refine queries dựa trên kết quả trước.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Subagent trả về kết quả surface-level, cần deep-dive
|
|
13
|
+
- Research task cần cross-reference multiple sources
|
|
14
|
+
- Code search trả về quá nhiều hoặc quá ít kết quả
|
|
15
|
+
- Cần verify thông tin từ nhiều góc độ
|
|
16
|
+
- Agent nhận được kết quả nhưng relevance thấp
|
|
17
|
+
|
|
18
|
+
## Do NOT Activate When
|
|
19
|
+
|
|
20
|
+
- Single search đã trả về kết quả chính xác → không cần iterative loop
|
|
21
|
+
- Đã biết chính xác file/function cần xem → đọc trực tiếp
|
|
22
|
+
- Task không liên quan research/explore (code implementation, bug fix)
|
|
23
|
+
- Timeline gấp, không có thời gian cho multi-pass retrieval
|
|
24
|
+
|
|
25
|
+
## Core Pattern: DISPATCH → EVALUATE → REFINE → LOOP
|
|
26
|
+
|
|
27
|
+
### Phase 1: DISPATCH
|
|
28
|
+
|
|
29
|
+
Gửi initial query đến data source (code search, web search, file read).
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Input: { query, sources, context }
|
|
33
|
+
Output: { rawResults, metadata }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Rules:**
|
|
37
|
+
- Query phải specific, include context về WHY cần thông tin
|
|
38
|
+
- Chỉ định sources rõ ràng: `codebase`, `web`, `docs`, `memory`
|
|
39
|
+
- Include rejection criteria: kết quả nào KHÔNG chấp nhận được
|
|
40
|
+
|
|
41
|
+
### Phase 2: EVALUATE
|
|
42
|
+
|
|
43
|
+
Đánh giá relevance của kết quả từ Phase 1.
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Scoring:
|
|
47
|
+
1.0 = Exactly what needed, complete answer
|
|
48
|
+
0.7+ = Good match, partial answer, need minor bổ sung
|
|
49
|
+
0.4+ = Related but tangential, need to narrow focus
|
|
50
|
+
<0.4 = Not relevant, need completely different query
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Evaluation Criteria:**
|
|
54
|
+
- [ ] Kết quả trả lời trực tiếp câu hỏi?
|
|
55
|
+
- [ ] Code examples (nếu cần) present và runnable?
|
|
56
|
+
|
|
57
|
+
### Phase 3: REFINE
|
|
58
|
+
|
|
59
|
+
Nếu EVALUATE score < 0.7, refine query.
|
|
60
|
+
|
|
61
|
+
**Refinement Strategies:**
|
|
62
|
+
|
|
63
|
+
| Strategy | Khi nào dùng | Ví dụ |
|
|
64
|
+
|----------|-------------|-------|
|
|
65
|
+
| **Narrow** | Quá nhiều kết quả | "Spring Boot 3.2 JWT filter" → "Spring Boot 3.2 JwtAuthenticationFilter OncePerRequestFilter" |
|
|
66
|
+
| **Broaden** | Quá ít kết quả | "Oracle NVARCHAR2 @Nationalized VETC" → "Oracle NVARCHAR2 Hibernate annotation" |
|
|
67
|
+
| **Reframe** | Sai góc nhìn | "How to fix Feign 503" → "Feign client circuit breaker configuration" |
|
|
68
|
+
| **Decompose** | Query quá complex | "Implement payment reconciliation" → "1) Batch processing pattern 2) Mismatch detection 3) Settlement logic" |
|
|
69
|
+
| **Cross-ref** | Cần verify | Tìm trong codebase X, verify bằng docs Y |
|
|
70
|
+
|
|
71
|
+
### Phase 4: LOOP
|
|
72
|
+
|
|
73
|
+
Quay lại Phase 1 với refined query.
|
|
74
|
+
|
|
75
|
+
**Rules:**
|
|
76
|
+
- **Max 3 cycles** — sau 3 lần vẫn score < 0.7 → accept best result + flag gaps
|
|
77
|
+
- Mỗi cycle PHẢI thay đổi query — KHÔNG retry identical query
|
|
78
|
+
- Mỗi cycle ghi nhận: what changed, why, expected improvement
|
|
79
|
+
|
|
80
|
+
## Anti-Patterns (KHÔNG LÀM)
|
|
81
|
+
|
|
82
|
+
| Anti-Pattern | Tại sao sai | Thay thế |
|
|
83
|
+
|-------------|-------------|----------|
|
|
84
|
+
| Infinite loop | Waste tokens, no progress | Max 3 cycles |
|
|
85
|
+
| Same query retry | Won't produce different result | REFINE before re-dispatch |
|
|
86
|
+
| Accept first result blindly | Miss better answers | Always EVALUATE |
|
|
87
|
+
| Over-refine | Chase perfection | 0.7+ is good enough |
|
|
88
|
+
| Skip evaluation | Don't know if results help | Score every result |
|
|
89
|
+
|
|
90
|
+
## Agent Integration
|
|
91
|
+
|
|
92
|
+
### Khi spawn subagent cho research
|
|
93
|
+
|
|
94
|
+
```markdown
|
|
95
|
+
## Task
|
|
96
|
+
{mô tả task}
|
|
97
|
+
|
|
98
|
+
## Retrieval Protocol
|
|
99
|
+
Use iterative retrieval (max 3 cycles):
|
|
100
|
+
1. DISPATCH: search with specific query
|
|
101
|
+
2. EVALUATE: score results 0-1 (need 0.7+)
|
|
102
|
+
3. REFINE: adjust query if < 0.7
|
|
103
|
+
4. LOOP: retry with refined query
|
|
104
|
+
|
|
105
|
+
## Rejection Criteria
|
|
106
|
+
- Generic advice without VETC context
|
|
107
|
+
- Outdated patterns (pre-2024)
|
|
108
|
+
- No code examples for implementation tasks
|
|
109
|
+
- Only theoretical without practical application
|
|
110
|
+
```
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-java-patterns
|
|
3
|
+
description: PROACTIVELY activate khi implement backend Java/Spring Boot, thêm endpoint/service/entity, hoặc code review Java. Auto-detect version từ pom.xml. Bao gồm Controller/Service/Repository/Entity/Exception/Cache/RabbitMQ patterns.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Java Patterns
|
|
7
|
+
|
|
8
|
+
Java/Spring Boot implementation patterns cho VETC E-Wallet.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Implement backend Java/Spring Boot feature
|
|
13
|
+
- Thêm endpoint, service, entity, repository
|
|
14
|
+
- Tích hợp external service (ACS, Bank GW, eKYC)
|
|
15
|
+
- Fix Java compile error hoặc logic bug
|
|
16
|
+
- Code review Java code
|
|
17
|
+
|
|
18
|
+
## Do NOT Activate When
|
|
19
|
+
|
|
20
|
+
- Đang làm việc trên code không phải Java (frontend, script, config file)
|
|
21
|
+
- Chỉ làm frontend React/TypeScript work (dùng `vetc-frontend-patterns`)
|
|
22
|
+
- Chỉ viết test, không implement business logic
|
|
23
|
+
|
|
24
|
+
## Step 0 — Auto-Detect Stack (luôn làm trước)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Detect Java version và Spring Boot version
|
|
28
|
+
grep -E "<java.version>|<spring-boot.version>" pom.xml
|
|
29
|
+
|
|
30
|
+
# Detect dependencies
|
|
31
|
+
grep -E "springfox|springdoc|junit|lombok|mapstruct" pom.xml
|
|
32
|
+
|
|
33
|
+
# Read 2-3 nearby implementation files để mirror style
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Kết quả → xác định:
|
|
37
|
+
- `javax.*` (Spring Boot 2.x) hay `jakarta.*` (Spring Boot 3.x)
|
|
38
|
+
- JUnit 4 hay JUnit 5
|
|
39
|
+
- Springfox (Swagger 2) hay springdoc (OpenAPI 3)
|
|
40
|
+
- Field injection (`@Autowired`) hay constructor injection
|
|
41
|
+
|
|
42
|
+
## Core Patterns
|
|
43
|
+
|
|
44
|
+
### Layered Architecture (bất biến)
|
|
45
|
+
```
|
|
46
|
+
Controller (thin: validate → delegate → return)
|
|
47
|
+
↓
|
|
48
|
+
Service (business logic + @Transactional)
|
|
49
|
+
↓
|
|
50
|
+
Repository (data access only)
|
|
51
|
+
↓
|
|
52
|
+
Entity (JPA mapping to Oracle)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Controller
|
|
56
|
+
```java
|
|
57
|
+
@RestController
|
|
58
|
+
@RequestMapping("api/v{N}/{domain}")
|
|
59
|
+
public class XxxController extends ControllerBase {
|
|
60
|
+
@Autowired // hoặc constructor inject — mirror nearby code
|
|
61
|
+
private XxxService service;
|
|
62
|
+
|
|
63
|
+
@PostMapping("/endpoint")
|
|
64
|
+
public ResultResp<?> create(
|
|
65
|
+
@AuthenticationPrincipal Jwt token,
|
|
66
|
+
@Valid @RequestBody XxxRequest request) {
|
|
67
|
+
return ResultResp.success(service.create(request));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Service
|
|
73
|
+
```java
|
|
74
|
+
@Service
|
|
75
|
+
@Slf4j
|
|
76
|
+
public class XxxServiceImpl implements XxxService {
|
|
77
|
+
@Override
|
|
78
|
+
@Transactional // chỉ ở service layer
|
|
79
|
+
public XxxResponse create(XxxRequest request) {
|
|
80
|
+
// 1. Business validation → throw CustomizeException
|
|
81
|
+
// 2. Business logic
|
|
82
|
+
// 3. Save entity
|
|
83
|
+
// 4. Publish event (RabbitMQ nếu cần)
|
|
84
|
+
// 5. Return DTO — không expose entity
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Entity — Oracle Conventions
|
|
90
|
+
```java
|
|
91
|
+
@Builder @AllArgsConstructor @NoArgsConstructor @Getter @Setter
|
|
92
|
+
@Entity(name = "TABLE_NAME") // UPPERCASE
|
|
93
|
+
public class Xxx {
|
|
94
|
+
@Id
|
|
95
|
+
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TABLE_NAME_SEQ")
|
|
96
|
+
@SequenceGenerator(name = "TABLE_NAME_SEQ", allocationSize = 1)
|
|
97
|
+
@Column(name = "AUTOID")
|
|
98
|
+
private Long id;
|
|
99
|
+
|
|
100
|
+
@Column(name = "AMOUNT", precision = 20, scale = 4)
|
|
101
|
+
private BigDecimal amount; // KHÔNG dùng double/float cho tiền
|
|
102
|
+
|
|
103
|
+
@Nationalized // NVARCHAR2 — tiếng Việt
|
|
104
|
+
|
|
105
|
+
### Repository — Parameterized queries ONLY
|
|
106
|
+
|
|
107
|
+
FAIL: SQL injection via string concatenation:
|
|
108
|
+
```java
|
|
109
|
+
// KHÔNG BAO GIỜ làm thế này
|
|
110
|
+
@Query(nativeQuery = true, value =
|
|
111
|
+
"SELECT * FROM TABLE WHERE STATUS = '" + status + "'")
|
|
112
|
+
|
|
113
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-meta-skill-creator
|
|
3
|
+
description: PROACTIVELY activate khi user muốn tạo skill mới, distill pattern từ session, hoặc promote instinct thành skill. Scaffold skill với YAML frontmatter chuẩn, references folder, và integration checklist.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Meta Skill Creator
|
|
7
|
+
|
|
8
|
+
Skill để tạo skill mới. Inspired by superpowers `create-skill` pattern. Giúp maintain consistency + quality cho toàn bộ skill library.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- User muốn tạo skill mới: "tạo skill vetc-xxx", "make a skill for yyy"
|
|
13
|
+
- Distill pattern từ session hiện tại thành reusable skill
|
|
14
|
+
- Promote instinct có confidence cao thành formal skill
|
|
15
|
+
- `/vetc-learn` detected pattern đủ mature để skill-ize
|
|
16
|
+
- User nói: "this should be a skill", "convert this to skill"
|
|
17
|
+
|
|
18
|
+
## Do NOT Activate When
|
|
19
|
+
|
|
20
|
+
- Skill tương đương đã tồn tại — search trước khi tạo
|
|
21
|
+
- Pattern chỉ áp dụng 1 lần — instinct đủ rồi, không cần skill
|
|
22
|
+
- User muốn sửa skill hiện có → dùng Edit trực tiếp
|
|
23
|
+
- Generic best practice đã có trong `rules/*.md`
|
|
24
|
+
|
|
25
|
+
## Skill Quality Criteria
|
|
26
|
+
|
|
27
|
+
Skill MỚI chỉ nên tạo khi thỏa mãn:
|
|
28
|
+
|
|
29
|
+
- [ ] **Specific**: có trigger rõ ràng, không overlap skill khác
|
|
30
|
+
- [ ] **Actionable**: user follow được từ trigger đến output
|
|
31
|
+
- [ ] **Reusable**: áp dụng cho >= 3 scenarios khác nhau
|
|
32
|
+
- [ ] **VETC-flavored**: có VETC domain context (không generic)
|
|
33
|
+
- [ ] **Testable**: output có thể verify
|
|
34
|
+
- [ ] **Non-duplicate**: không trùng với 32 skills hiện có
|
|
35
|
+
|
|
36
|
+
## Workflow
|
|
37
|
+
|
|
38
|
+
### Step 1 — Validate Proposal
|
|
39
|
+
|
|
40
|
+
Trước khi tạo file:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Search existing skills for similar scope:
|
|
44
|
+
- grep -r "{keyword}" skills/*/SKILL.md
|
|
45
|
+
- List overlapping skills, justify differentiation
|
|
46
|
+
- Check rules/*.md — không duplicate generic rule
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Nếu overlap > 70% → DO NOT CREATE, recommend extend existing skill.
|
|
50
|
+
|
|
51
|
+
### Step 2 — Define Skill Metadata
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
---
|
|
55
|
+
name: vetc-{kebab-case-name}
|
|
56
|
+
description: PROACTIVELY activate khi {specific trigger}. {What it does in 1 sentence.}
|
|
57
|
+
effort: low | medium | high
|
|
58
|
+
allowed-tools: # optional - restrict tools if needed
|
|
59
|
+
paths: # optional - auto-activate when working in these paths
|
|
60
|
+
---
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Naming rules:**
|
|
64
|
+
- Prefix `vetc-` mandatory
|
|
65
|
+
- Kebab-case, all lowercase
|
|
66
|
+
|
|
67
|
+
### Step 3 — Scaffold Skill Files
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Create skill directory
|
|
71
|
+
mkdir -p skills/vetc-{name}/references/
|
|
72
|
+
|
|
73
|
+
# Create SKILL.md with template
|
|
74
|
+
# (use content from Step 4 below)
|
|
75
|
+
|
|
76
|
+
# Create first reference file if needed
|
|
77
|
+
touch skills/vetc-{name}/(see docs)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Step 4 — SKILL.md Structure
|
|
81
|
+
|
|
82
|
+
See full template: `./(see docs)`
|
|
83
|
+
|
|
84
|
+
Quick rules:
|
|
85
|
+
- **Naming**: `vetc-{verb}-{noun}` hoặc `vetc-{domain}`, 10-40 chars, prefix `vetc-` mandatory
|
|
86
|
+
- **Description**: Start with "PROACTIVELY activate khi...", 1-2 sentences, unique
|
|
87
|
+
- **Effort**: `low` (<5min), `medium` (10-30min), `high` (30+ min)
|
|
88
|
+
|
|
89
|
+
### Step 5 — Optional: Create Reference Files
|
|
90
|
+
|
|
91
|
+
For progressive disclosure (from superpowers pattern):
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
skills/vetc-{name}/references/
|
|
95
|
+
├── code-snippets.md ← Language-specific examples (PASS/FAIL pattern)
|
|
96
|
+
├── checklist.md ← Step-by-step validation checklist
|
|
97
|
+
├── anti-patterns.md ← Detailed anti-patterns with examples
|
|
98
|
+
└── advanced.md ← Expert-level usage
|
|
99
|
+
```
|