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,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-analyze-codebase
|
|
3
|
+
description: PROACTIVELY activate khi mới vào project, cần bản đồ kiến trúc, hoặc trước khi thiết kế API. Scan codebase → codebase-spec.md + data-model.md. Chạy 1 lần per project.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Analyze Codebase
|
|
7
|
+
|
|
8
|
+
Tạo "bản đồ kiến trúc machine-readable" của toàn bộ VETC project — để các skill khác (vetc-analyze-ba, vetc-api-design, vetc-java-patterns) bám theo khi implement.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Vào project VETC mới lần đầu
|
|
13
|
+
- Trước khi chạy `vetc-analyze-ba` (Phase 4 yêu cầu có codebase-spec.md)
|
|
14
|
+
- Trước khi thiết kế API mới hoặc refactor kiến trúc lớn
|
|
15
|
+
- Khi muốn có bản đồ codebase để AI không đoán mò về patterns, packages, conventions
|
|
16
|
+
|
|
17
|
+
## Do NOT Activate When
|
|
18
|
+
|
|
19
|
+
- Chỉ cần sửa 1 file đơn giản, không cần hiểu toàn bộ kiến trúc
|
|
20
|
+
- Requirement đã cụ thể và rõ ràng, không cần codebase analysis
|
|
21
|
+
- Chỉ fix bug cụ thể (dùng `vetc-runbook` hoặc `vetc-build-resolver`)
|
|
22
|
+
|
|
23
|
+
## Output Files
|
|
24
|
+
|
|
25
|
+
- `docs/architecture/codebase-spec.md` — Kiến trúc + conventions + modules + APIs
|
|
26
|
+
- `docs/architecture/data-model.md` — 5 Mermaid diagrams
|
|
27
|
+
- `docs/architecture/project-knowledge.md` — Entity registry, pattern catalog, lessons learned (optional, enhance over time)
|
|
28
|
+
|
|
29
|
+
## Workflow (7 Phases)
|
|
30
|
+
|
|
31
|
+
### Phase 1 — LOAD-SPEC
|
|
32
|
+
Nếu `docs/architecture/codebase-spec.md` đã tồn tại → đọc và merge (incremental). Tôn trọng sections đã đánh dấu completed.
|
|
33
|
+
|
|
34
|
+
### Phase 2 — COLLECT
|
|
35
|
+
```bash
|
|
36
|
+
# Tìm project config
|
|
37
|
+
Glob("**/pom.xml", "**/build.gradle", "**/application*.yml")
|
|
38
|
+
|
|
39
|
+
# Tìm Java classes
|
|
40
|
+
Grep("@RestController", src/main/java/) → danh sách controllers
|
|
41
|
+
Grep("@Service", src/main/java/) → danh sách services
|
|
42
|
+
Grep("@Repository", src/main/java/) → danh sách repositories
|
|
43
|
+
Grep("@Entity", src/main/java/) → danh sách entities
|
|
44
|
+
Grep("@ControllerAdvice", src/main/java/) → exception handlers
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Phase 3 — INFER-ARCH
|
|
48
|
+
Từ kết quả collect, suy luận:
|
|
49
|
+
- `LAYERED` nếu có `controller/ + service/ + repository/` (flat packages)
|
|
50
|
+
- `HEXAGONAL` nếu có `application/ + domain/ + infrastructure/`
|
|
51
|
+
- Conventions: naming suffix, REST base path, response wrapper, injection style
|
|
52
|
+
|
|
53
|
+
#### 3.1 INFER-SECURITY
|
|
54
|
+
Detect auth pattern chi tiết:
|
|
55
|
+
```
|
|
56
|
+
Grep("SecurityFilterChain|WebSecurityConfigurerAdapter", src/) → filter chain class
|
|
57
|
+
Grep("@PreAuthorize|@Secured|@RolesAllowed", src/) → method-level auth
|
|
58
|
+
Grep("x-api-key|X-API-KEY|apiKey", src/) → API key auth
|
|
59
|
+
Grep("jwt|JWT|Bearer", src/) → JWT auth
|
|
60
|
+
Grep("OAuth2|oauth2", src/) → OAuth2 auth
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Phase 4 — INFER-MODULES & APIS
|
|
64
|
+
Đọc từng controller → group theo base path → tạo module list:
|
|
65
|
+
| Module | Base Path | Controllers | APIs count |
|
|
66
|
+
|
|
67
|
+
Với mỗi API: method, path, summary, request_dto, response_dto, auth_required
|
|
68
|
+
|
|
69
|
+
### Phase 5 — INFER-DATA-MODEL
|
|
70
|
+
```bash
|
|
71
|
+
Grep("@Entity", src/main/java/) → phân loại theo package:
|
|
72
|
+
entities/ → primary_datasource (Oracle)
|
|
73
|
+
secondsource.* → secondary_datasource
|
|
74
|
+
tertiarysource.* → tertiary_datasource
|
|
75
|
+
|
|
76
|
+
### Phase 6 — INFER-BUSINESS-CONTEXTS
|
|
77
|
+
Từ modules → tạo business contexts: tên, mô tả, modules liên quan, capabilities (use case)
|
|
78
|
+
|
|
79
|
+
### Phase 7 — VALIDATE & PERSIST
|
|
80
|
+
|
|
81
|
+
#### 7.1 Validation
|
|
82
|
+
Trước khi ghi output, cross-check:
|
|
83
|
+
- Declared vs used dependencies: flag deps trong pom.xml mà không có import nào dùng
|
|
84
|
+
- Commented-out code: flag `@KafkaListener`, `@Entity`, `@Scheduled` bị comment → không tính active
|
|
85
|
+
- Empty stubs: flag interface/class không có implementation
|
|
86
|
+
- Entity/sequence naming: verify UPPER_SNAKE_CASE tables, AUTOID PK, allocationSize=1
|
|
87
|
+
|
|
88
|
+
#### 7.2 Persist
|
|
89
|
+
Ghi 2 files output theo template chuẩn.
|
|
90
|
+
|
|
91
|
+
### Phase 8 — KNOWLEDGE EXTRACTION (Optional, enhance over time)
|
|
92
|
+
|
|
93
|
+
Tạo `docs/architecture/project-knowledge.md` — persistent knowledge base:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
# Project Knowledge: {Project Name}
|
|
97
|
+
|
|
98
|
+
## Entity Registry
|
|
99
|
+
| Entity | Table | Key Fields | Business Domain |
|
|
100
|
+
|--------|-------|------------|-----------------|
|
|
101
|
+
| Wallet | WALLET | userId, balance, status | E-Wallet |
|
|
102
|
+
| Transaction | WALLET_TRANSACTION | walletId, amount, type | E-Wallet |
|
|
103
|
+
| ... | | | |
|
|
104
|
+
|
|
105
|
+
## Pattern Catalog
|
|
106
|
+
| Pattern | Where Used | Notes |
|
|
107
|
+
|---------|-----------|-------|
|
|
108
|
+
| ResultResp<T> wrapper | All controllers | Standard response format |
|
|
109
|
+
| CustomizeException | All services | Error handling with code |
|
|
110
|
+
| ... | | |
|
|
111
|
+
|
|
112
|
+
## VETC Domain Terms
|
|
113
|
+
| Term | Meaning | Domain |
|
|
114
|
+
|------|---------|--------|
|
|
115
|
+
| Bút toán | Journal entry | ACS |
|
|
116
|
+
| Đối soát | Reconciliation | Reconcile |
|
|
117
|
+
|
|
118
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-api-design
|
|
3
|
+
description: PROACTIVELY activate khi có Structured Spec cần thiết kế DB + API. Dùng sau vetc-spec-driven, trước vetc-planner. Sinh ERD, Entity skeleton, API contract, data flow.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC API Design
|
|
7
|
+
|
|
8
|
+
Từ Spec → ERD + API Contract → sẵn sàng để implement.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Có Structured Spec (từ vetc-spec-driven), cần thiết kế DB + API
|
|
13
|
+
- Thiết kế schema mới cho tính năng
|
|
14
|
+
- Cần API contract để team FE/BE đồng bộ trước khi code
|
|
15
|
+
- Design review trước implementation
|
|
16
|
+
|
|
17
|
+
## Do NOT Activate When
|
|
18
|
+
|
|
19
|
+
- Chỉ fix bug trong API đã tồn tại, không thay đổi contract
|
|
20
|
+
- Chỉ làm UI/frontend work, không liên quan API design
|
|
21
|
+
- Spec đã finalized và API contract đã được sign-off
|
|
22
|
+
|
|
23
|
+
## Workflow
|
|
24
|
+
|
|
25
|
+
1. Đọc spec (Section 7 Data Model, Section 8 API Sketch)
|
|
26
|
+
2. Thiết kế ERD → Entity skeletons
|
|
27
|
+
3. Thiết kế API contract chi tiết
|
|
28
|
+
4. Vẽ data flow diagram
|
|
29
|
+
|
|
30
|
+
## ERD Format
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
## ERD: [Feature Name]
|
|
34
|
+
|
|
35
|
+
TABLE: TABLE_NAME
|
|
36
|
+
| Column | Type | Nullable | Notes |
|
|
37
|
+
|-------------|------------------|----------|--------------------------|
|
|
38
|
+
| AUTOID | NUMBER | NO | PK, sequence |
|
|
39
|
+
| CUSTOMER_ID | NUMBER | NO | FK → CUSTOMER_INFOS |
|
|
40
|
+
| AMOUNT | NUMBER(20,4) | NO | monetary value |
|
|
41
|
+
| STATUS | NVARCHAR2(20) | NO | PENDING/ACTIVE/FAILED |
|
|
42
|
+
| DESCRIPTION | NVARCHAR2(500) | YES | Vietnamese text |
|
|
43
|
+
| CREATED_DATE| DATE | NO | audit |
|
|
44
|
+
|
|
45
|
+
Status transitions: PENDING → ACTIVE → FAILED/CANCELLED
|
|
46
|
+
|
|
47
|
+
Relationships:
|
|
48
|
+
|
|
49
|
+
## API Contract Format
|
|
50
|
+
|
|
51
|
+
```yaml
|
|
52
|
+
# Feature: [Name]
|
|
53
|
+
# Base: /api/v{N}/{domain}
|
|
54
|
+
|
|
55
|
+
POST /endpoint:
|
|
56
|
+
auth: Bearer JWT (Keycloak)
|
|
57
|
+
request:
|
|
58
|
+
customerId: Long, required
|
|
59
|
+
amount: BigDecimal, required, > 0
|
|
60
|
+
description: String, optional, max 500 chars
|
|
61
|
+
responses:
|
|
62
|
+
200: { code: "00", data: { id: Long, status: "PENDING" } }
|
|
63
|
+
400: { code: "VALIDATION_ERROR", field: "amount", message: "..." }
|
|
64
|
+
404: { code: "CUSTOMER_NOT_FOUND" }
|
|
65
|
+
422: { code: "INSUFFICIENT_BALANCE" }
|
|
66
|
+
429: { code: "RATE_LIMIT_EXCEEDED" }
|
|
67
|
+
notes:
|
|
68
|
+
|
|
69
|
+
## Data Flow Diagram
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
[React Client]
|
|
73
|
+
→ POST /api/v1/wallet/transfer
|
|
74
|
+
→ [WalletTransferController] validate (JWT + @Valid)
|
|
75
|
+
→ [WalletTransferService]
|
|
76
|
+
↓ check balance [WalletRepository]
|
|
77
|
+
↓ debit source [WalletRepository] @Transactional
|
|
78
|
+
↓ credit target [WalletRepository]
|
|
79
|
+
↓ create journal entry [ACS REST Client] (external)
|
|
80
|
+
↓ save transaction [TransactionRepository]
|
|
81
|
+
↓ publish event [RabbitMQ] "TransferCompleted" (async)
|
|
82
|
+
→ [WalletTransferController] → ResultResp.success(result)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Design Checklist
|
|
86
|
+
|
|
87
|
+
- [ ] Tất cả FK đã được xác định
|
|
88
|
+
- [ ] Status transition diagram (nếu có state machine)
|
|
89
|
+
- [ ] Index cho query phổ biến
|
|
90
|
+
- [ ] Backward compatibility với API version hiện tại
|
|
91
|
+
- [ ] Idempotency key nếu endpoint có thể retry
|
|
92
|
+
- [ ] Rate limiting cho sensitive endpoints (OTP, transfer)
|
|
93
|
+
- [ ] External dependencies và failure mode
|
|
94
|
+
|
|
95
|
+
## References
|
|
96
|
+
|
|
97
|
+
- API design chuẩn: `../../shared/api-design.md`
|
|
98
|
+
- Architecture profiles: `../../shared/architecture-profiles.md`
|
|
99
|
+
- Java patterns: `../../shared/java-spring-boot.md`
|
|
100
|
+
|
|
101
|
+
## After Design
|
|
102
|
+
|
|
103
|
+
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-brainstorming
|
|
3
|
+
description: PROACTIVELY activate khi user cần khám phá ý tưởng trước khi spec — open-ended exploration, trade-off analysis, viable options, không phải clarification. Pre-spec phase. Dùng TRƯỚC vetc-spec-driven hoặc vetc-deep-interview.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Brainstorming — Pre-Spec Exploration
|
|
7
|
+
|
|
8
|
+
Khám phá không gian giải pháp trước khi commit vào spec. Generate options, explore trade-offs, find hidden opportunities. Inspired by superpowers `brainstorming` skill.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- User muốn "explore ý tưởng", "cho tôi vài options", "có cách khác không?"
|
|
13
|
+
- Problem chưa đủ định hình để spec — cần explore solution space
|
|
14
|
+
- Trade-off analysis giữa nhiều approaches khả thi
|
|
15
|
+
- Pre-feasibility: "có khả thi không?", "ballpark effort?"
|
|
16
|
+
- Stakeholder hỏi "nên làm gì tiếp theo?" (roadmap decision)
|
|
17
|
+
- Trước cả `vetc-deep-interview` khi requirement chưa form
|
|
18
|
+
|
|
19
|
+
## Do NOT Activate When
|
|
20
|
+
|
|
21
|
+
- User đã có requirement rõ → dùng `vetc-spec-driven` hoặc `vetc-deep-interview`
|
|
22
|
+
- Đang trong implementation phase → skill này làm mất focus
|
|
23
|
+
- Chỉ cần 1 answer cụ thể → trả lời trực tiếp, không brainstorm
|
|
24
|
+
- Bug fix / debugging → dùng `vetc-systematic-debugging`
|
|
25
|
+
- Review feedback đã rõ → dùng `vetc-receiving-review`
|
|
26
|
+
|
|
27
|
+
## Core Pattern: Divergent → Convergent
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
[Problem statement]
|
|
31
|
+
↓
|
|
32
|
+
DIVERGENT (expand)
|
|
33
|
+
- Generate 5-8 options (fair, not straw-man)
|
|
34
|
+
- Consider: dùng existing, build new, buy, hybrid, punt
|
|
35
|
+
- Include unusual options (AI-assist, low-tech fallback, manual)
|
|
36
|
+
↓
|
|
37
|
+
ANALYZE (understand)
|
|
38
|
+
- Each option: effort, risk, strategic fit, user impact
|
|
39
|
+
- Surface hidden tradeoffs
|
|
40
|
+
- Find unasked questions
|
|
41
|
+
↓
|
|
42
|
+
|
|
43
|
+
## Workflow
|
|
44
|
+
|
|
45
|
+
### Step 1 — Frame the Problem
|
|
46
|
+
|
|
47
|
+
Không hỏi requirement — hỏi motivation (from GSD Dream Extraction):
|
|
48
|
+
|
|
49
|
+
- "Điều gì thúc đẩy câu hỏi này?" (motivation)
|
|
50
|
+
- "Thành công trông như thế nào?" (outcome)
|
|
51
|
+
- "Cái gì đang block user hiện tại?" (pain)
|
|
52
|
+
|
|
53
|
+
Output: 1 paragraph problem statement.
|
|
54
|
+
|
|
55
|
+
### Step 2 — Divergent Thinking (Generate Options)
|
|
56
|
+
|
|
57
|
+
Aim for **5-8 options**. Types to cover:
|
|
58
|
+
|
|
59
|
+
| Option Type | Example |
|
|
60
|
+
|-------------|---------|
|
|
61
|
+
| **Do nothing** | Keep status quo, measure actual pain |
|
|
62
|
+
| **Existing tool** | Use Spring Actuator for health check instead of custom |
|
|
63
|
+
| **Build minimal** | MVP version covering 60% cases |
|
|
64
|
+
| **Build full** | Complete version covering 95% cases |
|
|
65
|
+
| **Buy / Integrate** | Third-party OTP service (Twilio) vs self-hosted |
|
|
66
|
+
| **Hybrid** | Self-host core, third-party for edge cases |
|
|
67
|
+
| **AI-assisted** | Let LLM handle classification/routing |
|
|
68
|
+
| **Defer / Punt** | Wait for v2, ship without this |
|
|
69
|
+
| **Simplify requirement** | Challenge: do we really need X, or can we drop it? |
|
|
70
|
+
|
|
71
|
+
### Step 3 — Analyze Each Option
|
|
72
|
+
|
|
73
|
+
Per option, surface:
|
|
74
|
+
|
|
75
|
+
| Dimension | Questions |
|
|
76
|
+
|-----------|-----------|
|
|
77
|
+
| **Effort** | Dev hours? Testing hours? Migration cost? |
|
|
78
|
+
| **Risk** | What could go wrong? Probability × Impact |
|
|
79
|
+
| **User impact** | Does user notice? Is change positive? |
|
|
80
|
+
| **Strategic fit** | Align with VETC Ewallet vision? Fintech compliance? |
|
|
81
|
+
| **Reversibility** | Can we back out? Cost of reversal? |
|
|
82
|
+
| **Dependencies** | Blocks on other teams? External systems? |
|
|
83
|
+
| **Hidden cost** | Operational overhead? Support burden? Training? |
|
|
84
|
+
|
|
85
|
+
Output matrix:
|
|
86
|
+
|
|
87
|
+
### Step 4 — Convergent Thinking (Narrow Down)
|
|
88
|
+
|
|
89
|
+
Apply **VETC-DR** (Drivers + Recommendation):
|
|
90
|
+
|
|
91
|
+
**Drivers (top 3)** - what matters most for THIS decision:
|
|
92
|
+
1. {Driver 1, e.g. compliance deadline}
|
|
93
|
+
2. {Driver 2, e.g. engineering bandwidth}
|
|
94
|
+
3. {Driver 3, e.g. user experience quality}
|
|
95
|
+
|
|
96
|
+
**Recommend top 2-3** options with explicit rationale:
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
## Recommended: Twilio Integration
|
|
100
|
+
|
|
101
|
+
**Why**: Addresses compliance deadline (Driver 1), minimal eng bandwidth (Driver 2), faster OTP delivery improves UX (Driver 3).
|
|
102
|
+
|
|
103
|
+
**Trade-offs acknowledged**:
|
|
104
|
+
- Vendor lock-in (mitigated: abstract through OtpProvider interface)
|
|
105
|
+
- Monthly cost ~$500/month (acceptable within ops budget)
|
|
106
|
+
|
|
107
|
+
## Runner-up: Hybrid
|
|
108
|
+
|
|
109
|
+
**Why**: Better long-term architecture, graceful degradation.
|
|
110
|
+
**Why not top choice**: Effort XL exceeds compliance deadline. Can retrofit later.
|
|
111
|
+
|
|
112
|
+
## Explicitly Rejected: Self-hosted OTP
|
|
113
|
+
|
|
114
|
+
**Why rejected**: Effort L + new infra risk + distraction from core features. LOW strategic fit.
|
|
115
|
+
|
|
116
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-change-proposal
|
|
3
|
+
description: PROACTIVELY activate khi spec đã APPROVED nhưng cần thay đổi — compliance update, new edge case, scope adjustment. Tạo delta spec (OpenSpec-style) thay vì sửa trực tiếp. Lifecycle DRAFT → PROPOSED → APPROVED → APPLIED → ARCHIVED.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Change Proposal — OpenSpec-Style Delta Management
|
|
7
|
+
|
|
8
|
+
Quản lý spec changes có cấu trúc. Spec đã APPROVED KHÔNG được sửa trực tiếp — tạo change proposal với impact analysis, review, và archive.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Spec status = APPROVED hoặc IMPLEMENTING, cần thay đổi
|
|
13
|
+
- User: "sửa spec", "thêm requirement", "loại requirement X"
|
|
14
|
+
- Compliance update (SBV, NHNN, internal policy)
|
|
15
|
+
- New edge case discovered during implementation
|
|
16
|
+
- External system contract changed (Bank GW update, ACS API v2)
|
|
17
|
+
- Feature scope adjustment mid-development
|
|
18
|
+
|
|
19
|
+
## Do NOT Activate When
|
|
20
|
+
|
|
21
|
+
- Spec ở DRAFT status → sửa spec trực tiếp
|
|
22
|
+
- Bug fix không thay đổi requirements → không cần change proposal
|
|
23
|
+
- Typo / formatting fix → sửa trực tiếp
|
|
24
|
+
- Implementation detail clarification (không thay behavior) → sửa plan.md, không cần change proposal
|
|
25
|
+
|
|
26
|
+
## Core Pattern: Delta Spec Lifecycle
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
[Spec APPROVED]
|
|
30
|
+
↓
|
|
31
|
+
CREATE PROPOSAL (DRAFT)
|
|
32
|
+
↓
|
|
33
|
+
IMPACT ANALYSIS
|
|
34
|
+
↓
|
|
35
|
+
REVIEW (architect + critic)
|
|
36
|
+
↓
|
|
37
|
+
[PROPOSAL APPROVED]
|
|
38
|
+
↓
|
|
39
|
+
IMPLEMENT CHANGES (vetc-ralph)
|
|
40
|
+
↓
|
|
41
|
+
|
|
42
|
+
## Workflow
|
|
43
|
+
|
|
44
|
+
### Step 1 — Classify Change
|
|
45
|
+
|
|
46
|
+
| Change Type | When | Example |
|
|
47
|
+
|-------------|------|---------|
|
|
48
|
+
| **ADDED** | New requirement/section | "Add OTP verification for > 500K" |
|
|
49
|
+
| **MODIFIED** | Change existing requirement | "Change timeout from 5min to 15min" |
|
|
50
|
+
| **REMOVED** | Drop requirement | "Remove QR refresh button (moved to separate feature)" |
|
|
51
|
+
|
|
52
|
+
**Impact level** quyết định rigor:
|
|
53
|
+
|
|
54
|
+
| Level | Tasks affected | Rigor |
|
|
55
|
+
|-------|----------------|-------|
|
|
56
|
+
| LOW | 0-1 task, no rework | Quick proposal, inline review |
|
|
57
|
+
| MEDIUM | 2-5 tasks, some rework | Full proposal + architect review |
|
|
58
|
+
| HIGH | 5+ tasks, significant rework | Full proposal + Planner+Architect+Critic consensus |
|
|
59
|
+
| CRITICAL | Fundamental scope shift | Pause implementation, re-spec with `vetc-deep-interview` |
|
|
60
|
+
|
|
61
|
+
### Step 2 — Create Proposal Directory
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
specs/{NNN}-{slug}/changes/
|
|
65
|
+
├── 001-add-otp-verification/
|
|
66
|
+
│ ├── proposal.md ← From templates/change-proposal-template.md
|
|
67
|
+
│ └── delta.md ← Section-by-section diff
|
|
68
|
+
├── 002-adjust-timeout/
|
|
69
|
+
│ ├── proposal.md
|
|
70
|
+
│ └── delta.md
|
|
71
|
+
└── archive.md ← Applied changes summary
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Numbering: sequential (001, 002, ...).
|
|
75
|
+
|
|
76
|
+
### Step 3 — Fill Proposal Template
|
|
77
|
+
|
|
78
|
+
Use `templates/change-proposal-template.md`. Required sections:
|
|
79
|
+
|
|
80
|
+
1. **Why** — Motivation, external driver (compliance, user feedback, tech debt)
|
|
81
|
+
2. **What Changed** — Section-level changes table (Before / After)
|
|
82
|
+
3. **Impact Analysis** — Tasks affected, data model changes, API contract, security, performance
|
|
83
|
+
4. **Risk Assessment** — Probability × Impact table with mitigation
|
|
84
|
+
5. **Acceptance Criteria** — How to verify change is correctly applied
|
|
85
|
+
6. **Review Sign-offs** — Spec Author / Planner / Architect / Critic / Security / PO
|
|
86
|
+
|
|
87
|
+
### Step 4 — Create Delta.md
|
|
88
|
+
|
|
89
|
+
Section-by-section diff format:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
# Delta: {Change Title}
|
|
93
|
+
|
|
94
|
+
## §4 Happy Path — MODIFIED
|
|
95
|
+
|
|
96
|
+
**Before**:
|
|
97
|
+
1. Customer scans QR
|
|
98
|
+
2. System validates QR
|
|
99
|
+
3. Customer confirms amount
|
|
100
|
+
4. Transaction processed
|
|
101
|
+
|
|
102
|
+
**After**:
|
|
103
|
+
1. Customer scans QR
|
|
104
|
+
2. System validates QR
|
|
105
|
+
3. Customer confirms amount
|
|
106
|
+
4. **(NEW)** If amount > 500K: system requests OTP
|
|
107
|
+
5. **(NEW)** Customer enters OTP (60s timeout)
|
|
108
|
+
6. **(NEW)** System validates OTP
|
|
109
|
+
|
|
110
|
+
## §5 Edge Cases — ADDED
|
|
111
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-cicd
|
|
3
|
+
description: PROACTIVELY activate khi cần setup CI/CD, tạo build pipeline, thêm GitHub Actions, hoặc troubleshoot build/deploy. Maven/Gradle/npm build commands, coverage, Docker.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC CI/CD — Build, Test, Deploy
|
|
7
|
+
|
|
8
|
+
Commands và templates cho CI/CD workflows trong VETC project.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Cần build/test/deploy commands
|
|
13
|
+
- Tạo hoặc update GitHub Actions workflow
|
|
14
|
+
- Chạy coverage report
|
|
15
|
+
- Debug CI pipeline failure
|
|
16
|
+
- Setup Docker build
|
|
17
|
+
|
|
18
|
+
## Do NOT Activate When
|
|
19
|
+
|
|
20
|
+
- Viết business logic / application code (dùng `vetc-java-patterns` hoặc `vetc-frontend-patterns`)
|
|
21
|
+
- Chỉ cần code review (dùng reviewer agents)
|
|
22
|
+
- CI/CD đã configured và đang hoạt động ổn định, không cần thay đổi
|
|
23
|
+
|
|
24
|
+
## Build Commands
|
|
25
|
+
|
|
26
|
+
### Maven (Backend)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Compile only (fast check)
|
|
30
|
+
mvn clean compile -q
|
|
31
|
+
|
|
32
|
+
# Compile + tests
|
|
33
|
+
mvn clean test -q
|
|
34
|
+
|
|
35
|
+
# Full package (jar/war)
|
|
36
|
+
mvn clean package -DskipTests -q
|
|
37
|
+
|
|
38
|
+
# Multi-module — specific module
|
|
39
|
+
mvn clean compile -pl wallet-service -am -q
|
|
40
|
+
|
|
41
|
+
# With profile
|
|
42
|
+
mvn clean package -Pprod -DskipTests -q
|
|
43
|
+
|
|
44
|
+
# Check dependencies
|
|
45
|
+
mvn dependency:tree | grep <dependency>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### npm (Frontend)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Type check
|
|
52
|
+
npx tsc --noEmit
|
|
53
|
+
|
|
54
|
+
# Build production
|
|
55
|
+
npm run build
|
|
56
|
+
|
|
57
|
+
# Test with coverage
|
|
58
|
+
npm test -- --coverage
|
|
59
|
+
|
|
60
|
+
# Lint
|
|
61
|
+
npx eslint src/ --ext .ts,.tsx
|
|
62
|
+
|
|
63
|
+
# Bundle analysis
|
|
64
|
+
npx vite-bundle-visualizer
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## GitHub Actions Templates
|
|
68
|
+
|
|
69
|
+
### Backend CI
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
name: Backend CI
|
|
73
|
+
on:
|
|
74
|
+
push:
|
|
75
|
+
paths: ['backend/**']
|
|
76
|
+
pull_request:
|
|
77
|
+
paths: ['backend/**']
|
|
78
|
+
jobs:
|
|
79
|
+
build:
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
steps:
|
|
82
|
+
- uses: actions/checkout@v4
|
|
83
|
+
- uses: actions/setup-java@v4
|
|
84
|
+
|
|
85
|
+
### Frontend CI
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
name: Frontend CI
|
|
89
|
+
on:
|
|
90
|
+
push:
|
|
91
|
+
paths: ['frontend/**']
|
|
92
|
+
pull_request:
|
|
93
|
+
paths: ['frontend/**']
|
|
94
|
+
jobs:
|
|
95
|
+
build:
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
steps:
|
|
98
|
+
- uses: actions/checkout@v4
|
|
99
|
+
- uses: actions/setup-node@v4
|
|
100
|
+
|
|
101
|
+
## Coverage Commands
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Backend — JaCoCo report
|
|
105
|
+
mvn verify -pl <module> -q
|
|
106
|
+
open <module>/target/site/jacoco/index.html
|
|
107
|
+
|
|
108
|
+
# Backend — check threshold
|
|
109
|
+
mvn verify -Djacoco.threshold=0.80
|
|
110
|
+
|
|
111
|
+
# Frontend — Jest coverage
|
|
112
|
+
npm test -- --coverage --watchAll=false
|
|
113
|
+
```
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-continuous-learning
|
|
3
|
+
description: PROACTIVELY extract reusable patterns từ sessions — khi phát hiện recurring bug, project-specific workaround, hoặc debugging technique hiệu quả. Instinct-based learning v2 với confidence scoring, project scoping, và automatic promotion.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Continuous Learning v2
|
|
7
|
+
|
|
8
|
+
Instinct-based learning system: observe → detect → create/update → evolve. Biến session knowledge thành atomic "instincts" với confidence scoring.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Phát hiện recurring bug pattern (xuất hiện 2+ lần)
|
|
13
|
+
- Tìm workaround cho framework issue
|
|
14
|
+
- Discover VETC domain-specific pattern đáng nhớ
|
|
15
|
+
- Debugging technique hiệu quả cần reuse
|
|
16
|
+
- Configuration pattern phức tạp đã giải quyết
|
|
17
|
+
- Instinct observer hook phát hiện pattern tự động
|
|
18
|
+
- **HARNESS_BACKLOG entries** có status `accepted` → candidate for skill creation
|
|
19
|
+
|
|
20
|
+
## Do NOT Activate When
|
|
21
|
+
|
|
22
|
+
- Bug chỉ xuất hiện 1 lần, chưa recurrent → dùng `vetc-systematic-debugging`
|
|
23
|
+
- Pattern chỉ áp dụng cho 1 project cụ thể, không reusable
|
|
24
|
+
- Đã có skill chính thức cover pattern đó → extend skill, không tạo instinct
|
|
25
|
+
- Đang implement code, chưa ở phase review/reflection
|
|
26
|
+
|
|
27
|
+
## V2 Architecture: Instincts
|
|
28
|
+
|
|
29
|
+
### What is an Instinct?
|
|
30
|
+
|
|
31
|
+
Instinct là atomic learned behavior — nhỏ hơn skill, lớn hơn rule. Mỗi instinct có:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
{
|
|
35
|
+
id: "inst_1713288000000_abc123",
|
|
36
|
+
pattern: "Oracle NVARCHAR2 cần @Nationalized annotation",
|
|
37
|
+
action: "Thêm @Nationalized cho Oracle NVARCHAR2 columns",
|
|
38
|
+
category: "code", // code | debug | workflow | domain
|
|
39
|
+
scope: "project", // project | global
|
|
40
|
+
projectId: "abc123", // hash của git remote URL
|
|
41
|
+
confidence: 0.7, // 0.3-0.9
|
|
42
|
+
source: "edit-observation", // session | edit-observation | bash-observation | manual
|
|
43
|
+
uses: 3, // times applied
|
|
44
|
+
|
|
45
|
+
### Confidence Scoring
|
|
46
|
+
|
|
47
|
+
| Score | Meaning | Trigger |
|
|
48
|
+
|-------|---------|---------|
|
|
49
|
+
| 0.3 | Tentative — observed once, unverified | First observation |
|
|
50
|
+
| 0.5 | Noted — observed, seems useful | 2 observations |
|
|
51
|
+
| 0.7 | Reliable — used successfully 3+ times | 3+ uses with ≥60% hit rate |
|
|
52
|
+
| 0.9 | Core — consistently useful, promoted to global | 5+ uses with ≥80% hit rate |
|
|
53
|
+
|
|
54
|
+
### Scopes
|
|
55
|
+
|
|
56
|
+
- **project**: Instinct chỉ apply cho current project (stored in `~/.vetc/instincts/project-{id}.json`)
|
|
57
|
+
- **global**: Instinct apply cho tất cả projects (stored in `~/.vetc/instincts/global.json`)
|
|
58
|
+
|
|
59
|
+
### Promotion Pipeline
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Observation → project instinct (0.3) → use → confidence grows → promote to global (0.7+)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Instinct tự động promote khi:
|
|
66
|
+
- Confidence ≥ 0.7
|
|
67
|
+
- Uses ≥ 5
|
|
68
|
+
- Hit rate ≥ 70%
|
|
69
|
+
|
|
70
|
+
## Learning Sources
|
|
71
|
+
|
|
72
|
+
### 1. Hook Observation (Automatic)
|
|
73
|
+
|
|
74
|
+
`instinct-observer.js` hook tự động detect patterns từ Edit/Write/Bash tool use:
|
|
75
|
+
- Edit patterns: @Nationalized, @Transactional, validation annotations, parameterized queries
|
|
76
|
+
- Write patterns: new Controller/Service/Repository creation
|
|
77
|
+
- Bash patterns: dependency investigation, git grep, curl testing
|
|
78
|
+
|
|
79
|
+
Rate limit: max 5 new instincts per session (avoid noise).
|
|
80
|
+
|
|
81
|
+
### 2. Manual Extraction (`/vetc-learn`)
|
|
82
|
+
|
|
83
|
+
User-triggered pattern extraction:
|
|
84
|
+
1. Scan conversation cho patterns
|
|
85
|
+
2. Classify theo 4 types
|
|
86
|
+
3. Tìm unique insight
|
|
87
|
+
4. Create instinct với higher confidence (0.5)
|
|
88
|
+
|
|
89
|
+
### 3. Session End Review
|
|
90
|
+
|
|
91
|
+
Khi session kết thúc, review instincts created:
|
|
92
|
+
- Show summary: new instincts, reinforced instincts
|
|
93
|
+
- Suggest promotions if applicable
|
|
94
|
+
|
|
95
|
+
## Instinct Categories
|
|
96
|
+
|
|
97
|
+
| Category | Trigger | Example |
|
|
98
|
+
|----------|---------|---------|
|
|
99
|
+
| **code** | Implementation pattern | Oracle NVARCHAR2 cần @Nationalized |
|
|
100
|
+
| **debug** | Troubleshooting technique | Feign 503 → check ACS health endpoint |
|
|
101
|
+
| **workflow** | Process/procedure | Journal entry: validate → reserve → create → confirm |
|
|
102
|
+
| **domain** | Business logic insight | Smart OTP có 2 phases với khác session type |
|
|
103
|
+
| **security** | Security pattern | Sensitive URL params cần encode |
|
|
104
|
+
|
|
105
|
+
## Commands
|
|
106
|
+
|
|
107
|
+
### Check Status
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
/instinct-status
|
|
111
|
+
```
|
|
112
|
+
Show: total instincts, by category, avg confidence, top 5 instincts.
|
|
113
|
+
|
|
114
|
+
### Evolve Instincts
|
|
115
|
+
```
|