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,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-oracle-patterns
|
|
3
|
+
description: PROACTIVELY activate khi tạo JPA entity, viết native query, hoặc thiết kế schema. Oracle naming conventions, sequences, NVARCHAR2, parameterized queries, view entities.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Oracle Database Patterns
|
|
7
|
+
|
|
8
|
+
Oracle DB patterns cho VETC E-Wallet system.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Tạo JPA entity mới
|
|
13
|
+
- Viết native query Oracle
|
|
14
|
+
- Thiết kế schema (bảng, index, sequence)
|
|
15
|
+
|
|
16
|
+
## Do NOT Activate When
|
|
17
|
+
|
|
18
|
+
- Sử dụng database không phải Oracle (PostgreSQL, MySQL, etc.)
|
|
19
|
+
- Chỉ làm frontend work (dùng `vetc-frontend-patterns`)
|
|
20
|
+
- CRUD đơn giản không cần complex query, native query, hay schema design
|
|
21
|
+
|
|
22
|
+
## Gotchas — Oracle Traps
|
|
23
|
+
|
|
24
|
+
1. **Quên `allocationSize = 1`** → Default là 50, ID nhảy cóc. Luôn set `@SequenceGenerator(allocationSize = 1)`.
|
|
25
|
+
|
|
26
|
+
2. **Native query không có `:param`** → String concat trong native query = SQL injection. Luôn dùng `@Param` placeholder.
|
|
27
|
+
|
|
28
|
+
3. **`VARCHAR2` vs `NVARCHAR2`** → VARCHAR2 không chứa tiếng Việt. Text tiếng Việt phải dùng `NVARCHAR2` + `@Nationalized`.
|
|
29
|
+
|
|
30
|
+
4. **Column name lowercase** → Oracle column name mặc định uppercase. `@Column(name = "my_column")` không match `MY_COLUMN` trong DB. Luôn UPPERCASE.
|
|
31
|
+
|
|
32
|
+
5. **Oracle DATE có time** → `DATE` trong Oracle chứa cả time, khác MySQL. Dùng `TIMESTAMP` cho full datetime.
|
|
33
|
+
|
|
34
|
+
6. **Pagination với native query** → `LIMIT/OFFSET` không hoạt động trong Oracle 11g. Dùng `ROWNUM` hoặc Oracle 12c+ `FETCH FIRST`.
|
|
35
|
+
|
|
36
|
+
7. **CLOB vs String** → Oracle VARCHAR2 max 4000 bytes. Text dài hơn phải dùng CLOB + `@Lob`.
|
|
37
|
+
|
|
38
|
+
## Oracle Naming Conventions
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Table: UPPER_SNAKE_CASE — WALLET_TRANSACTION, CUSTOMER_INFOS
|
|
42
|
+
Column: UPPER_SNAKE_CASE — CUSTOMER_ID, CREATED_DATE, AUTOID
|
|
43
|
+
Sequence: {TABLE_NAME}_SEQ — WALLET_TRANSACTION_SEQ
|
|
44
|
+
Index: IDX_{TABLE}_{COL} — IDX_WALLET_TRANS_CUST_ID
|
|
45
|
+
PK: AUTOID (Long)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## JPA Entity Template
|
|
49
|
+
|
|
50
|
+
PASS: Complete entity with Oracle conventions:
|
|
51
|
+
```java
|
|
52
|
+
@Builder @AllArgsConstructor @NoArgsConstructor @Getter @Setter
|
|
53
|
+
@Entity(name = "TABLE_NAME")
|
|
54
|
+
public class EntityName {
|
|
55
|
+
|
|
56
|
+
// Primary Key — Oracle Sequence (allocationSize = 1 là BẮT BUỘC)
|
|
57
|
+
@Id
|
|
58
|
+
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TABLE_NAME_SEQ")
|
|
59
|
+
@SequenceGenerator(name = "TABLE_NAME_SEQ", allocationSize = 1)
|
|
60
|
+
@Column(name = "AUTOID")
|
|
61
|
+
private Long id;
|
|
62
|
+
|
|
63
|
+
## Native Query Patterns
|
|
64
|
+
|
|
65
|
+
PASS: Parameterized native query — LUÔN LUÔN dùng `:param`:
|
|
66
|
+
```java
|
|
67
|
+
@Query(nativeQuery = true, value =
|
|
68
|
+
"SELECT t.* FROM WALLET_TRANSACTION t " +
|
|
69
|
+
"WHERE t.CUSTOMER_ID = :customerId " +
|
|
70
|
+
"AND t.STATUS = :status " +
|
|
71
|
+
"AND t.CREATED_DATE BETWEEN :fromDate AND :toDate " +
|
|
72
|
+
"ORDER BY t.CREATED_DATE DESC")
|
|
73
|
+
List findByFilter(
|
|
74
|
+
@Param("customerId") Long customerId,
|
|
75
|
+
@Param("status") String status,
|
|
76
|
+
@Param("fromDate") Date fromDate,
|
|
77
|
+
@Param("toDate") Date toDate);
|
|
78
|
+
|
|
79
|
+
## View Entity (Read-Only)
|
|
80
|
+
|
|
81
|
+
```java
|
|
82
|
+
// Entity không có sequence, không có @Id tự sinh
|
|
83
|
+
@Immutable
|
|
84
|
+
@Entity(name = "V_CUSTOMER_WALLET") // Oracle View
|
|
85
|
+
@Getter
|
|
86
|
+
public class VCustomerWallet {
|
|
87
|
+
@Id // dùng cột unique của view
|
|
88
|
+
@Column(name = "CUSTOMER_ID")
|
|
89
|
+
private Long customerId;
|
|
90
|
+
|
|
91
|
+
@Column(name = "WALLET_BALANCE")
|
|
92
|
+
private BigDecimal walletBalance;
|
|
93
|
+
// ...
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Stored Procedure Integration
|
|
98
|
+
|
|
99
|
+
```java
|
|
100
|
+
// VETC pattern: RepositoryServiceBase.callStoresProcedure
|
|
101
|
+
List results = repositoryServiceBase.callStoresProcedure(
|
|
102
|
+
"PROC_NAME",
|
|
103
|
+
List.of(
|
|
104
|
+
new ParameterDto("p_customer_id", customerId, ParameterType.IN),
|
|
105
|
+
new ParameterDto("p_status", status, ParameterType.IN)
|
|
106
|
+
),
|
|
107
|
+
Result.class
|
|
108
|
+
);
|
|
109
|
+
```
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-performance-testing
|
|
3
|
+
description: PROACTIVELY activate khi cần load/performance test cho API mới, regression test sau optimization, hoặc capacity planning. k6/JMeter integration, SLA thresholds, VETC-specific scenarios (transfer/reconcile/OTP).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Performance Testing — Load & Stress Validation
|
|
7
|
+
|
|
8
|
+
Viết và chạy performance tests cho VETC APIs với k6 (default) hoặc JMeter. Đảm bảo p95/p99 latency, throughput, error rate đạt SLA trước production.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- API mới cần load test trước go-live (SLA validation)
|
|
13
|
+
- Regression test sau performance optimization
|
|
14
|
+
- Capacity planning — xác định breakpoint (max RPS, CPU/memory ceiling)
|
|
15
|
+
- Suspect hot path issue — transfer/reconcile/eKYC endpoints
|
|
16
|
+
- Pre-release smoke performance check
|
|
17
|
+
- Baseline vs release comparison (p95 shift > 20% → investigate)
|
|
18
|
+
|
|
19
|
+
## Do NOT Activate When
|
|
20
|
+
|
|
21
|
+
- Code chưa merge — không load test on dev branch (noise)
|
|
22
|
+
- Không có staging environment — performance test trên prod = bad idea
|
|
23
|
+
- Không có rõ SLA target — đo gì để so sánh?
|
|
24
|
+
- Unit/integration test thất bại — fix correctness trước performance
|
|
25
|
+
|
|
26
|
+
## Core Concepts
|
|
27
|
+
|
|
28
|
+
### SLA Thresholds (VETC default)
|
|
29
|
+
|
|
30
|
+
| Tier | Endpoint Type | p95 Target | p99 Target | Error Rate |
|
|
31
|
+
|------|---------------|-----------|-----------|------------|
|
|
32
|
+
| **Tier 0 (critical)** | Payment/Transfer | < 300ms | < 800ms | < 0.1% |
|
|
33
|
+
| **Tier 1 (core)** | Balance/OTP/KYC | < 500ms | < 1500ms | < 0.5% |
|
|
34
|
+
| **Tier 2 (support)** | Report/Query | < 1500ms | < 3000ms | < 1% |
|
|
35
|
+
| **Batch** | Reconcile/Settlement | < 30min/batch | N/A | < 0.5% |
|
|
36
|
+
|
|
37
|
+
### Load Profiles
|
|
38
|
+
|
|
39
|
+
- **Smoke**: 1 VU × 1 minute — sanity check
|
|
40
|
+
- **Average**: 50 VU × 15 minutes — typical load
|
|
41
|
+
- **Stress**: ramp 0 → 500 VU × 30 minutes — find breakpoint
|
|
42
|
+
- **Spike**: 10 → 200 VU × 30s, hold 3 min, drop back — burst handling
|
|
43
|
+
- **Soak**: 100 VU × 2 hours — memory leak / connection pool exhaustion
|
|
44
|
+
|
|
45
|
+
## k6 Template Structure
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
perf-tests/
|
|
49
|
+
├── config/
|
|
50
|
+
│ ├── env.dev.json
|
|
51
|
+
│ ├── env.staging.json
|
|
52
|
+
│ └── thresholds.js
|
|
53
|
+
├── scenarios/
|
|
54
|
+
│ ├── transfer-smoke.js
|
|
55
|
+
│ ├── transfer-load.js
|
|
56
|
+
│ ├── reconcile-batch.js
|
|
57
|
+
│ └── otp-spike.js
|
|
58
|
+
├── helpers/
|
|
59
|
+
│ ├── auth.js (Keycloak token fetcher)
|
|
60
|
+
|
|
61
|
+
## Core k6 Template — Transfer Load Test
|
|
62
|
+
|
|
63
|
+
```javascript
|
|
64
|
+
import http from 'k6/http';
|
|
65
|
+
import { check, sleep } from 'k6';
|
|
66
|
+
import { Rate, Trend } from 'k6/metrics';
|
|
67
|
+
import { getToken } from '../helpers/auth.js';
|
|
68
|
+
import { randomTransferRequest } from '../helpers/data-generator.js';
|
|
69
|
+
|
|
70
|
+
// Custom metrics
|
|
71
|
+
const transferSuccessRate = new Rate('transfer_success');
|
|
72
|
+
const transferDuration = new Trend('transfer_duration', true);
|
|
73
|
+
|
|
74
|
+
export const options = {
|
|
75
|
+
scenarios: {
|
|
76
|
+
|
|
77
|
+
## Helpers — Auth & Data Generator
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
// helpers/auth.js
|
|
81
|
+
import http from 'k6/http';
|
|
82
|
+
export function getToken(username, password) {
|
|
83
|
+
const res = http.post(
|
|
84
|
+
`${__ENV.KEYCLOAK_URL}/realms/vetc/protocol/openid-connect/token`,
|
|
85
|
+
{
|
|
86
|
+
grant_type: 'password',
|
|
87
|
+
client_id: 'vetc-perf-test',
|
|
88
|
+
username: username,
|
|
89
|
+
password: password,
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
## Workflow
|
|
94
|
+
|
|
95
|
+
### Step 1 — Define SLA
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
Endpoint: POST /wallet/v1/transfer
|
|
99
|
+
Target SLA:
|
|
100
|
+
- p95 < 300ms (Tier 0)
|
|
101
|
+
- p99 < 800ms
|
|
102
|
+
- Error rate < 0.1%
|
|
103
|
+
|
|
104
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-pr-response
|
|
3
|
+
description: PROACTIVELY activate khi nhận review comments trên PR — classify từng comment (fix/defer/reject), craft response thoughtfully, không agree mù quáng. Pair với vetc-receiving-review cho quy trình nhận phê bình.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC PR Response — Thoughtful Review Handling
|
|
7
|
+
|
|
8
|
+
Khi reviewer để lại comments trên PR, không rush fix-all. Classify từng comment trước: fix ngay, defer sang issue mới, hay respectfully reject với lý do.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- PR có review comments cần process
|
|
13
|
+
- Multiple reviewers disagree — cần cân nhắc
|
|
14
|
+
- Reviewer blocking PR — cần hoặc fix hoặc justify
|
|
15
|
+
- Long review thread — cần sắp xếp + respond có cấu trúc
|
|
16
|
+
- After `vetc-receiving-review` — áp dụng nguyên tắc vào thực hành
|
|
17
|
+
|
|
18
|
+
## Do NOT Activate When
|
|
19
|
+
|
|
20
|
+
- No comments yet — không có gì để respond
|
|
21
|
+
- Single typo fix comment — just fix and push
|
|
22
|
+
- Self-review comments — rewrite before requesting review
|
|
23
|
+
|
|
24
|
+
## Classification Matrix
|
|
25
|
+
|
|
26
|
+
Mỗi comment classify thành 1 trong 5 loại:
|
|
27
|
+
|
|
28
|
+
| Loại | Khi nào | Action | Response Template |
|
|
29
|
+
|------|---------|--------|-------------------|
|
|
30
|
+
| **FIX-NOW** | Correct, critical, in scope | Fix in this PR | "Good catch, fixed in {commit-sha}" |
|
|
31
|
+
| **FIX-IN-FOLLOWUP** | Correct but scope-creep | Log issue, fix later | "Valid — created VETC-999 for follow-up" |
|
|
32
|
+
| **DEFER** | Valid but low priority | Add to tech-debt | "Noted — added to tech-debt/issues/TD-42" |
|
|
33
|
+
| **DISCUSS** | Unclear intent, ambiguous | Ask back | "Can you elaborate on {specific part}? I want to ensure I understand before changing." |
|
|
34
|
+
| **REJECT** | Disagree with evidence | Politely push back | "I disagree because {data/pattern/evidence}. Happy to discuss further." |
|
|
35
|
+
|
|
36
|
+
## Core Principles
|
|
37
|
+
|
|
38
|
+
### 1. Never Agree Blindly
|
|
39
|
+
|
|
40
|
+
If comment is unclear → ask. If you disagree → push back respectfully. Agreeing just to close PR = bad engineering. Code should be right, not popular.
|
|
41
|
+
|
|
42
|
+
### 2. Separate Signal from Noise
|
|
43
|
+
|
|
44
|
+
- **Nitpicks** (formatting, naming preference) → evaluate: does it improve readability?
|
|
45
|
+
- **Style** (subjective) → defer to team style guide; if unwritten, ask for vote
|
|
46
|
+
- **Correctness** (bug, edge case, security) → always address
|
|
47
|
+
- **Architecture** (major refactor suggestion) → usually FIX-IN-FOLLOWUP, not this PR
|
|
48
|
+
|
|
49
|
+
### 3. Scope Discipline
|
|
50
|
+
|
|
51
|
+
This PR = this feature. Drive-by refactor suggestions → separate PR. Politely decline:
|
|
52
|
+
|
|
53
|
+
> "Agreed this could be improved — but it's out of scope for VETC-123 (Smart OTP).
|
|
54
|
+
> I've created VETC-999 to track the refactor. Can we keep this PR focused?"
|
|
55
|
+
|
|
56
|
+
### 4. Evidence Over Authority
|
|
57
|
+
|
|
58
|
+
When reviewer says "just do X" without reasoning, ask why. Senior title ≠ automatic correctness.
|
|
59
|
+
|
|
60
|
+
> "Can you share the pattern/doc this is based on? I implemented based on {reference}
|
|
61
|
+
> and want to make sure we're aligned on the reasoning."
|
|
62
|
+
|
|
63
|
+
### 5. Batch Small Fixes
|
|
64
|
+
|
|
65
|
+
Don't push 20 commits each addressing 1 nit. Batch into 1-2 commits:
|
|
66
|
+
- `fix(review): address nits in WalletController`
|
|
67
|
+
- `refactor(review): rename per feedback`
|
|
68
|
+
|
|
69
|
+
## Workflow
|
|
70
|
+
|
|
71
|
+
### Step 1 — Read ALL Comments First
|
|
72
|
+
|
|
73
|
+
Before replying to any, read entire review thread. Understand big picture — maybe comments conflict, or reviewer has overarching concern.
|
|
74
|
+
|
|
75
|
+
### Step 2 — Classify Each Comment
|
|
76
|
+
|
|
77
|
+
Create local checklist (not committed):
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
# PR #123 Review Triage
|
|
81
|
+
|
|
82
|
+
## Reviewer: @alice (2026-04-17)
|
|
83
|
+
|
|
84
|
+
### Comment 1: Line 45 - "Extract this to private method"
|
|
85
|
+
Classification: FIX-NOW
|
|
86
|
+
Reason: Method is 30 lines, extraction improves readability
|
|
87
|
+
|
|
88
|
+
### Comment 2: Line 78 - "Why not use Stream.reduce?"
|
|
89
|
+
Classification: REJECT
|
|
90
|
+
Reason: Stream.reduce on 1M elements = slower than for-loop (benchmarked)
|
|
91
|
+
Response: "Good question — I benchmarked both. For-loop is 3x faster at our scale.
|
|
92
|
+
Saved benchmark results in `bench/loop-vs-reduce.md`"
|
|
93
|
+
|
|
94
|
+
### Comment 3: Line 120 - "Consider caching this"
|
|
95
|
+
Classification: FIX-IN-FOLLOWUP
|
|
96
|
+
Reason: Valid perf improvement but requires Redis setup config change
|
|
97
|
+
Response: "Great idea — out of scope for this PR. Created VETC-999."
|
|
98
|
+
|
|
99
|
+
### Comment 4: Line 200 - "Missing null check"
|
|
100
|
+
Classification: FIX-NOW
|
|
101
|
+
Reason: Real bug, caught before production
|
|
102
|
+
|
|
103
|
+
### Comment 5: "General: prefer functional style"
|
|
104
|
+
Classification: DISCUSS
|
|
105
|
+
Response: "Can you point to specific lines? Happy to refactor toward the team's style."
|
|
106
|
+
```
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-ralph
|
|
3
|
+
description: PROACTIVELY activate khi đã có approved plan từ vetc-ralplan và cần implement đến HOÀN THÀNH. Persistence loop không stop cho đến khi build pass + tests pass + coverage đạt + không OWASP HIGH.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Ralph — Persistence Loop
|
|
7
|
+
|
|
8
|
+
Implement và không dừng cho đến khi task thực sự xong: build pass, test pass, coverage đạt, security clean.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Đã có approved plan (từ `vetc-ralplan` hoặc `06-task-breakdown.md`)
|
|
13
|
+
- Muốn AI tự implement từng task, verify sau mỗi task, không cần confirm mỗi bước nhỏ
|
|
14
|
+
- Task đủ rõ để execute (có file path, task breakdown, acceptance criteria)
|
|
15
|
+
- User nói: "ralph", "cứ làm đến xong", "đừng dừng", "finish this", "keep going"
|
|
16
|
+
|
|
17
|
+
## Do NOT activate when
|
|
18
|
+
|
|
19
|
+
- Plan chưa có / chưa approved → dùng `vetc-ralplan` trước
|
|
20
|
+
- Requirement còn mơ hồ → dùng `vetc-deep-interview` trước
|
|
21
|
+
- User muốn manual control từng bước → dùng `vetc-analyze-ba` (có gates)
|
|
22
|
+
- Chỉ cần implement 1 file đơn giản → implement trực tiếp
|
|
23
|
+
|
|
24
|
+
## Do NOT Activate When
|
|
25
|
+
|
|
26
|
+
- Task quá nhỏ, chỉ cần thay đổi < 3 files (implement trực tiếp)
|
|
27
|
+
- Chỉ cần code review, không implement (dùng reviewer agents)
|
|
28
|
+
- User chưa confirm plan — chưa có approved task breakdown
|
|
29
|
+
|
|
30
|
+
## Bypass
|
|
31
|
+
|
|
32
|
+
Prefix `force:` để bypass gate: `force: ralph implement XxxService`
|
|
33
|
+
|
|
34
|
+
## Ralph Loop
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
[Pre-context Intake]
|
|
38
|
+
↓
|
|
39
|
+
[Task Breakdown] (từ plan đã approved)
|
|
40
|
+
↓
|
|
41
|
+
┌─────────────────────────────────────────────────┐
|
|
42
|
+
│ RALPH WAVE EXECUTION │
|
|
43
|
+
│ │
|
|
44
|
+
│ Wave 1: [T1, T2, T3] ← independent, PARALLEL │
|
|
45
|
+
│ Each task gets fresh focused context │
|
|
46
|
+
│ Build + Test + Coverage per task │
|
|
47
|
+
│ │
|
|
48
|
+
│ Wave 2: [T4, T5] ← depends on Wave 1 │
|
|
49
|
+
|
|
50
|
+
## Phase 0 — Pre-context Intake (bắt buộc)
|
|
51
|
+
|
|
52
|
+
Trước khi bắt đầu loop:
|
|
53
|
+
|
|
54
|
+
1. **Tạo Story Packet** cho mỗi task (từ `templates/story-packet.md`):
|
|
55
|
+
- Lite lane: skip story packet, trực tiếp implement
|
|
56
|
+
- Standard lane: tạo story packet với status, lane, acceptance criteria, validation plan
|
|
57
|
+
- Full lane: tạo high-risk story folder (`templates/high-risk-story/`) với overview + execplan + design + validation
|
|
58
|
+
2. Load hoặc tạo context snapshot:
|
|
59
|
+
|
|
60
|
+
1. Load hoặc tạo context snapshot:
|
|
61
|
+
```
|
|
62
|
+
specs/features/{feature}/ralph-context.md
|
|
63
|
+
├── Task statement
|
|
64
|
+
├── Approved plan path
|
|
65
|
+
|
|
66
|
+
## Wave Execution
|
|
67
|
+
|
|
68
|
+
Tasks được group thành waves dựa trên dependencies:
|
|
69
|
+
|
|
70
|
+
**Wave grouping rules:**
|
|
71
|
+
- Tasks KHÔNG phụ thuộc nhau → cùng wave (parallel)
|
|
72
|
+
- Tasks phụ thuộc task ở wave trước → wave tiếp theo (sequential)
|
|
73
|
+
- Mỗi wave chạy độc lập, kết quả được verify trước khi sang wave tiếp
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
Wave 1: [Entity] [Repository] [DTO] ← independent, PARALLEL
|
|
77
|
+
Wave 2: [Service] ← depends on Wave 1
|
|
78
|
+
Wave 3: [Controller] ← depends on Wave 2
|
|
79
|
+
Wave 4: [Unit Tests] [Integration Tests] ← depends on Wave 3, PARALLEL
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Task Format
|
|
83
|
+
|
|
84
|
+
See: `./(see docs)`
|
|
85
|
+
|
|
86
|
+
## Per-Task Implementation Loop
|
|
87
|
+
|
|
88
|
+
See: `./(see docs)` (7 bước: Build → Test → Coverage → Security → Health Check → Context → Progress Update)
|
|
89
|
+
|
|
90
|
+
### Per-Task Test Matrix Update
|
|
91
|
+
|
|
92
|
+
Sau mỗi task complete, cập nhật `docs/TEST_MATRIX.md` (tạo từ `templates/test-matrix.md` nếu chưa có):
|
|
93
|
+
|
|
94
|
+
1. Thêm/update row cho task với task ID + spec section
|
|
95
|
+
2. Set Status = "in_progress" khi bắt đầu task
|
|
96
|
+
3. Sau build pass → fill Build column = yes
|
|
97
|
+
4. Sau test pass → fill Unit/Integration columns = yes
|
|
98
|
+
5. Sau security scan → fill Security column = yes
|
|
99
|
+
6. Task DONE → set Status = "implemented", fill Evidence
|
|
100
|
+
|
|
101
|
+
## Parallel Execution
|
|
102
|
+
|
|
103
|
+
Task **độc lập** → run parallel:
|
|
104
|
+
```
|
|
105
|
+
Tốt: Entity + Repository + DTO (không phụ thuộc nhau)
|
|
106
|
+
Tốt: Test viết song song với Service implementation
|
|
107
|
+
Xấu: Service trước Controller (Controller phụ thuộc Service)
|
|
108
|
+
```
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-ralplan
|
|
3
|
+
description: PROACTIVELY activate khi có spec rõ nhưng cần review plan trước khi code, hoặc sau vetc-deep-interview. Planner + Architect + Critic consensus review. Đảm bảo plan được review từ nhiều góc.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Ralplan — Consensus Planning
|
|
7
|
+
|
|
8
|
+
Review và approve plan trước khi implement. Planner + Architect + Critic đồng thuận → implementation bắt đầu.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Có spec hoặc requirement rõ, cần plan trước khi code
|
|
13
|
+
- Task phức tạp: nhiều module, nhiều layer (Controller/Service/Repository/FE)
|
|
14
|
+
- Thay đổi ảnh hưởng Oracle schema, ACS integration, security
|
|
15
|
+
- Sau `vetc-deep-interview` — có spec, cần plan
|
|
16
|
+
- User nói: "lên kế hoạch trước", "review plan", "ralplan", "plan trước khi làm"
|
|
17
|
+
|
|
18
|
+
## Do NOT activate when
|
|
19
|
+
|
|
20
|
+
- Đã có `06-task-breakdown.md` rõ ràng → implement ngay với `vetc-analyze-ba`
|
|
21
|
+
- Task nhỏ (1 file, 1 function) → dùng `vetc-planner` agent hoặc implement trực tiếp
|
|
22
|
+
- User muốn quick path → `vetc-spec-driven` → `vetc-api-design` → `vetc-planner`
|
|
23
|
+
|
|
24
|
+
## Implementation Readiness Gate (từ BMAD)
|
|
25
|
+
|
|
26
|
+
Trước khi approve plan, verify TẤT CẢ artifacts đã aligned:
|
|
27
|
+
|
|
28
|
+
| Check | What to Verify | Block? |
|
|
29
|
+
|-------|---------------|--------|
|
|
30
|
+
| Spec completeness | All user scenarios (US-*) covered? Edge cases identified? | YES if CRITICAL gap |
|
|
31
|
+
| API design aligned | Plan references correct endpoints from api-design.md? | YES if mismatch |
|
|
32
|
+
| Data model consistent | Entity fields match spec requirements? | YES if conflict |
|
|
33
|
+
| Security accounted | PII handling specified? Auth requirements listed? | YES if missing |
|
|
34
|
+
| Test plan exists | Unit + integration scope defined per task? | WARN if missing |
|
|
35
|
+
| Non-goals explicit | "X nằm ngoài scope" documented? | WARN if vague |
|
|
36
|
+
|
|
37
|
+
**Readiness verdict:**
|
|
38
|
+
- `READY` — all checks pass, proceed to consensus planning
|
|
39
|
+
- `CONDITIONAL` — WARN items need acknowledgment before proceeding
|
|
40
|
+
- `NOT READY` — block, return to spec/design phase to fill gaps
|
|
41
|
+
|
|
42
|
+
## Pre-Execution Gate
|
|
43
|
+
|
|
44
|
+
**Ralplan chặn các requests vague trước khi vào implementation:**
|
|
45
|
+
|
|
46
|
+
| Tín hiệu PASS (đủ cụ thể) | Tín hiệu cần ralplan |
|
|
47
|
+
|---------------------------|---------------------|
|
|
48
|
+
| "Fix NullPointerException trong WalletService.java:45" | "Fix lỗi transfer" |
|
|
49
|
+
| "Implement API POST /wallet/transfer theo spec" | "Thêm chức năng transfer" |
|
|
50
|
+
| "Task list: 1. Entity 2. Repository 3. Service 4. Controller" | "Làm tính năng nạp tiền" |
|
|
51
|
+
| Có file path, function name, issue number cụ thể | Không có anchor cụ thể |
|
|
52
|
+
|
|
53
|
+
**Bypass gate:** prefix `force:` hoặc `!` trước prompt.
|
|
54
|
+
|
|
55
|
+
## Consensus Planning Workflow
|
|
56
|
+
|
|
57
|
+
### Step 1 — Planner: Draft Plan
|
|
58
|
+
|
|
59
|
+
Tạo Implementation Plan gồm:
|
|
60
|
+
|
|
61
|
+
# PLAN: {Feature Name}
|
|
62
|
+
|
|
63
|
+
## Summary (1 câu)
|
|
64
|
+
|
|
65
|
+
## VETC-DR Analysis
|
|
66
|
+
### Principles (3-5)
|
|
67
|
+
- [P1] Spec-First: không code khi chưa có spec
|
|
68
|
+
- [P2] Oracle-Safe: parameterized queries only
|
|
69
|
+
- [P3] Security: không log PII, JWT validate đúng
|
|
70
|
+
- ...
|
|
71
|
+
|
|
72
|
+
### Decision Drivers (top 3)
|
|
73
|
+
- [D1] ...
|
|
74
|
+
- [D2] ...
|
|
75
|
+
- [D3] ...
|
|
76
|
+
|
|
77
|
+
### Viable Options (>= 2)
|
|
78
|
+
| Option | Pros | Cons | Risk |
|
|
79
|
+
|--------|------|------|------|
|
|
80
|
+
| A | ... | ... | ... |
|
|
81
|
+
| B | ... | ... | ... |
|
|
82
|
+
|
|
83
|
+
### Recommended Option
|
|
84
|
+
[Option X] — vì [reason aligned với Drivers]
|
|
85
|
+
|
|
86
|
+
## Implementation Plan
|
|
87
|
+
|
|
88
|
+
### Phase 1: Database Layer
|
|
89
|
+
- [ ] SQL Migration: CREATE TABLE / ALTER TABLE
|
|
90
|
+
- [ ] JPA Entity: `src/.../entity/Xxx.java`
|
|
91
|
+
- [ ] Repository: `src/.../repository/XxxRepository.java`
|
|
92
|
+
|
|
93
|
+
### Phase 2: Business Layer
|
|
94
|
+
- [ ] Service interface: `XxxService.java`
|
|
95
|
+
- [ ] Implementation: `XxxServiceImpl.java` (với @Transactional)
|
|
96
|
+
|
|
97
|
+
### Phase 3: API Layer
|
|
98
|
+
- [ ] Controller: `XxxController.java` (extends ControllerBase)
|
|
99
|
+
- [ ] DTOs: `XxxRequest.java`, `XxxResponse.java`
|
|
100
|
+
|
|
101
|
+
### Phase 4: Tests
|
|
102
|
+
- [ ] Unit: `XxxServiceImplTest.java`
|
|
103
|
+
- [ ] Integration: `XxxControllerTest.java`
|
|
104
|
+
|
|
105
|
+
### Phase 5: Frontend (nếu có)
|
|
106
|
+
- [ ] API module: `src/api/xxxApi.ts`
|
|
107
|
+
- [ ] Component/Page
|
|
108
|
+
|
|
109
|
+
## Risk Assessment
|
|
110
|
+
| Risk | Probability | Impact | Mitigation |
|
|
111
|
+
|------|-------------|--------|------------|
|
|
112
|
+
| Oracle sequence gap | LOW | LOW | allocationSize=1 |
|
|
113
|
+
| ACS timeout | MEDIUM | HIGH | try-catch + ErrorCode |
|
|
114
|
+
| ... | | | |
|
|
115
|
+
|
|
116
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vetc-receiving-review
|
|
3
|
+
description: PROACTIVELY activate khi nhận code review feedback từ human reviewer, sau khi vetc-java-reviewer hoặc vetc-typescript-reviewer report findings, hoặc khi cần process review comments. Hướng dẫn cách nhận review đúng — không đồng ý mù quáng.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VETC Receiving Code Review — How to Handle Feedback Correctly
|
|
7
|
+
|
|
8
|
+
Nhận code review đúng cách. Không đồng ý performative. Verify trước khi implement. Push back khi cần.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
- Nhận review feedback từ human (PR comments, direct feedback)
|
|
13
|
+
- Sau khi `vetc-java-reviewer` hoặc `vetc-typescript-reviewer` report findings
|
|
14
|
+
- Sau khi `vetc-security-reviewer` report security issues
|
|
15
|
+
- User nói: "review xong rồi", "fix theo feedback", "xử lý review comments"
|
|
16
|
+
|
|
17
|
+
## Do NOT Activate When
|
|
18
|
+
|
|
19
|
+
- Đang viết code mới (không phải xử lý feedback) → dùng skill phù hợp
|
|
20
|
+
- Review feedback chỉ là style/formatting nhỏ → fix trực tiếp
|
|
21
|
+
- Chưa có review findings nào → chưa cần skill này
|
|
22
|
+
- Đang làm code review cho người khác → dùng `vetc-review` command
|
|
23
|
+
|
|
24
|
+
## Forbidden Responses
|
|
25
|
+
|
|
26
|
+
These responses indicate you are NOT properly processing feedback:
|
|
27
|
+
|
|
28
|
+
| Forbidden Response | Why It's Forbidden |
|
|
29
|
+
|-------------------|-------------------|
|
|
30
|
+
| "You're absolutely right!" | Performative agreement without understanding |
|
|
31
|
+
| "Good catch! Fixed." | Did you actually verify the fix addresses the root issue? |
|
|
32
|
+
| "Makes sense, changed." | "Makes sense" ≠ "I verified this is correct" |
|
|
33
|
+
| "Done!" without explanation | What did you change? Why? Does it work? |
|
|
34
|
+
| Implementing every suggestion blindly | Not all suggestions are correct or necessary |
|
|
35
|
+
| "I'll add that feature too" | Scope creep. Address the review, don't expand it. |
|
|
36
|
+
|
|
37
|
+
## Review Processing Workflow
|
|
38
|
+
|
|
39
|
+
### Step 1: Classify Each Finding
|
|
40
|
+
|
|
41
|
+
From reviewer output, classify each finding:
|
|
42
|
+
|
|
43
|
+
| Category | Action | Examples |
|
|
44
|
+
|----------|--------|---------|
|
|
45
|
+
| **Bug/Defect** | Fix immediately | Logic error, wrong condition, missing null check |
|
|
46
|
+
| **Security Issue** | Fix immediately, highest priority | SQL injection, sensitive data in log, missing auth check |
|
|
47
|
+
| **Design Problem** | Discuss before fixing | Wrong abstraction, missing error handling pattern |
|
|
48
|
+
| **Style/Naming** | Fix if trivial, discuss if contentious | Variable naming, method naming |
|
|
49
|
+
| **Suggestion** | Evaluate with YAGNI check | "What if we add...", "Could also handle..." |
|
|
50
|
+
| **Question** | Answer with evidence | "Why this approach?" — show alternatives considered |
|
|
51
|
+
|
|
52
|
+
### Step 2: YAGNI Check
|
|
53
|
+
|
|
54
|
+
For each suggestion, ask:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
Does this suggestion:
|
|
58
|
+
1. Fix a REAL problem that exists NOW? → Implement
|
|
59
|
+
2. Prevent a LIKELY problem? → Consider
|
|
60
|
+
3. Handle a HYPOTHETICAL future scenario? → Skip (YAGNI)
|
|
61
|
+
4. Add complexity without clear benefit? → Push back
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Step 3: Verify Before Implementing
|
|
65
|
+
|
|
66
|
+
Before implementing any feedback:
|
|
67
|
+
|
|
68
|
+
1. **Read the finding carefully** — understand the reviewer's reasoning
|
|
69
|
+
2. **Check the code** — is the reviewer's observation accurate?
|
|
70
|
+
3. **Consider alternatives** — is the suggested fix the best approach?
|
|
71
|
+
4. **Check for ripple effects** — will this fix break something else?
|
|
72
|
+
|
|
73
|
+
### Step 4: Implement or Push Back
|
|
74
|
+
|
|
75
|
+
#### When to Implement
|
|
76
|
+
|
|
77
|
+
- Finding is factually correct
|
|
78
|
+
- The fix is straightforward
|
|
79
|
+
- No design tradeoffs involved
|
|
80
|
+
|
|
81
|
+
Format your response:
|
|
82
|
+
```markdown
|
|
83
|
+
**Finding:** {quote the finding}
|
|
84
|
+
**Analysis:** {why it's correct}
|
|
85
|
+
**Fix:** {what you changed}
|
|
86
|
+
**Verification:** {test that confirms the fix}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Source-Specific Handling
|
|
90
|
+
|
|
91
|
+
### Human Reviewer Feedback
|
|
92
|
+
|
|
93
|
+
- Prioritize: Critical bugs > Security > Design > Style > Suggestions
|
|
94
|
+
- Ask clarifying questions if the feedback is ambiguous
|
|
95
|
+
- Don't assume the reviewer knows the full context — explain your reasoning
|
|
96
|
+
|
|
97
|
+
### VETC Reviewer Agent Output
|
|
98
|
+
|
|
99
|
+
Agent reviewers (`vetc-java-reviewer`, `vetc-typescript-reviewer`, `vetc-security-reviewer`) produce structured findings:
|
|
100
|
+
|
|
101
|
+
```markdown
|
|
102
|
+
## Finding: [CRITICAL|HIGH|MEDIUM|LOW] {title}
|
|
103
|
+
**File:** {path}:{line}
|
|
104
|
+
**Issue:** {description}
|
|
105
|
+
**Suggestion:** {how to fix}
|
|
106
|
+
```
|