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.
Files changed (299) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE +21 -0
  3. package/README.md +97 -0
  4. package/index.ts +163 -0
  5. package/package.json +48 -0
  6. package/skills/adaptyv/SKILL.md +92 -0
  7. package/skills/add-community-extension/SKILL.md +85 -0
  8. package/skills/aeon/SKILL.md +111 -0
  9. package/skills/ai-slop-cleaner/SKILL.md +118 -0
  10. package/skills/anndata/SKILL.md +83 -0
  11. package/skills/arboreto/SKILL.md +107 -0
  12. package/skills/ask/SKILL.md +55 -0
  13. package/skills/astropy/SKILL.md +30 -0
  14. package/skills/async-worker-recovery/SKILL.md +44 -0
  15. package/skills/autopilot/SKILL.md +63 -0
  16. package/skills/autoresearch/SKILL.md +64 -0
  17. package/skills/autoskill/SKILL.md +116 -0
  18. package/skills/babysit/SKILL.md +43 -0
  19. package/skills/benchling-integration/SKILL.md +106 -0
  20. package/skills/bgpt-paper-search/SKILL.md +67 -0
  21. package/skills/biopython/SKILL.md +29 -0
  22. package/skills/bioservices/SKILL.md +96 -0
  23. package/skills/brainstorming/SKILL.md +104 -0
  24. package/skills/cancel/SKILL.md +85 -0
  25. package/skills/ccg/SKILL.md +87 -0
  26. package/skills/celery-pipeline/SKILL.md +30 -0
  27. package/skills/cellxgene-census/SKILL.md +104 -0
  28. package/skills/child-pi-spawning/SKILL.md +85 -0
  29. package/skills/cirq/SKILL.md +113 -0
  30. package/skills/citation-management/SKILL.md +91 -0
  31. package/skills/clinical-decision-support/SKILL.md +117 -0
  32. package/skills/clinical-reports/SKILL.md +118 -0
  33. package/skills/clinical-trial/SKILL.md +28 -0
  34. package/skills/cobrapy/SKILL.md +116 -0
  35. package/skills/configure-notifications/SKILL.md +85 -0
  36. package/skills/consciousness-council/SKILL.md +120 -0
  37. package/skills/context-artifact-hygiene/SKILL.md +85 -0
  38. package/skills/context-mode-ops/SKILL.md +87 -0
  39. package/skills/dask/SKILL.md +85 -0
  40. package/skills/database-lookup/SKILL.md +118 -0
  41. package/skills/datamol/SKILL.md +108 -0
  42. package/skills/debug/SKILL.md +32 -0
  43. package/skills/deep-dive/SKILL.md +114 -0
  44. package/skills/deep-interview/SKILL.md +90 -0
  45. package/skills/deepchem/SKILL.md +117 -0
  46. package/skills/deepinit/SKILL.md +100 -0
  47. package/skills/deeptools/SKILL.md +118 -0
  48. package/skills/delegation-patterns/SKILL.md +56 -0
  49. package/skills/depmap/SKILL.md +94 -0
  50. package/skills/dhdna-profiler/SKILL.md +86 -0
  51. package/skills/diffdock/SKILL.md +101 -0
  52. package/skills/dispatching-parallel-agents/SKILL.md +119 -0
  53. package/skills/dnanexus-integration/SKILL.md +118 -0
  54. package/skills/do/SKILL.md +48 -0
  55. package/skills/docker-sandbox/SKILL.md +29 -0
  56. package/skills/docx/SKILL.md +119 -0
  57. package/skills/esm/SKILL.md +116 -0
  58. package/skills/etetoolkit/SKILL.md +103 -0
  59. package/skills/event-log-tracing/SKILL.md +85 -0
  60. package/skills/exa-search/SKILL.md +72 -0
  61. package/skills/executing-plans/SKILL.md +69 -0
  62. package/skills/exploratory-data-analysis/SKILL.md +118 -0
  63. package/skills/external-context/SKILL.md +80 -0
  64. package/skills/fastapi/SKILL.md +30 -0
  65. package/skills/finishing-a-development-branch/SKILL.md +106 -0
  66. package/skills/flowio/SKILL.md +114 -0
  67. package/skills/fluidsim/SKILL.md +108 -0
  68. package/skills/generate-image/SKILL.md +108 -0
  69. package/skills/geniml/SKILL.md +117 -0
  70. package/skills/geomaster/SKILL.md +109 -0
  71. package/skills/geopandas/SKILL.md +114 -0
  72. package/skills/get-available-resources/SKILL.md +100 -0
  73. package/skills/gget/SKILL.md +111 -0
  74. package/skills/ginkgo-cloud-lab/SKILL.md +52 -0
  75. package/skills/git-master/SKILL.md +85 -0
  76. package/skills/glycoengineering/SKILL.md +104 -0
  77. package/skills/gtars/SKILL.md +104 -0
  78. package/skills/hackernews-frontpage/SKILL.md +46 -0
  79. package/skills/histolab/SKILL.md +98 -0
  80. package/skills/how-it-works/SKILL.md +25 -0
  81. package/skills/hud/SKILL.md +86 -0
  82. package/skills/hugging-science/SKILL.md +93 -0
  83. package/skills/huggingface/SKILL.md +30 -0
  84. package/skills/hypogenic/SKILL.md +107 -0
  85. package/skills/hypothesis-generation/SKILL.md +118 -0
  86. package/skills/imaging-data-commons/SKILL.md +119 -0
  87. package/skills/infographics/SKILL.md +102 -0
  88. package/skills/iso-13485-certification/SKILL.md +114 -0
  89. package/skills/knowledge-agent/SKILL.md +83 -0
  90. package/skills/labarchive-integration/SKILL.md +98 -0
  91. package/skills/lamindb/SKILL.md +119 -0
  92. package/skills/landsat/SKILL.md +29 -0
  93. package/skills/latchbio-integration/SKILL.md +118 -0
  94. package/skills/latex-posters/SKILL.md +112 -0
  95. package/skills/learn-codebase/SKILL.md +24 -0
  96. package/skills/learner/SKILL.md +118 -0
  97. package/skills/literature-review/SKILL.md +118 -0
  98. package/skills/live-agent-lifecycle/SKILL.md +85 -0
  99. package/skills/mailbox-interactive/SKILL.md +85 -0
  100. package/skills/make-plan/SKILL.md +59 -0
  101. package/skills/markdown-mermaid-writing/SKILL.md +118 -0
  102. package/skills/market-research-reports/SKILL.md +119 -0
  103. package/skills/markitdown/SKILL.md +111 -0
  104. package/skills/markitdown-docs/SKILL.md +28 -0
  105. package/skills/matchms/SKILL.md +91 -0
  106. package/skills/matlab/SKILL.md +118 -0
  107. package/skills/matplotlib/SKILL.md +30 -0
  108. package/skills/mcp-setup/SKILL.md +84 -0
  109. package/skills/medchem/SKILL.md +109 -0
  110. package/skills/mem-search/SKILL.md +96 -0
  111. package/skills/modal/SKILL.md +104 -0
  112. package/skills/model-routing-context/SKILL.md +85 -0
  113. package/skills/molecular-dynamics/SKILL.md +116 -0
  114. package/skills/molfeat/SKILL.md +110 -0
  115. package/skills/multi-perspective-review/SKILL.md +85 -0
  116. package/skills/networkx/SKILL.md +111 -0
  117. package/skills/neurokit2/SKILL.md +114 -0
  118. package/skills/neuropixels-analysis/SKILL.md +112 -0
  119. package/skills/nilearn/SKILL.md +29 -0
  120. package/skills/observability-reliability/SKILL.md +43 -0
  121. package/skills/omc-doctor/SKILL.md +86 -0
  122. package/skills/omc-reference/SKILL.md +119 -0
  123. package/skills/omc-setup/SKILL.md +82 -0
  124. package/skills/omc-teams/SKILL.md +81 -0
  125. package/skills/omero-integration/SKILL.md +111 -0
  126. package/skills/open-notebook/SKILL.md +100 -0
  127. package/skills/openephys/SKILL.md +28 -0
  128. package/skills/opentrons-integration/SKILL.md +110 -0
  129. package/skills/optimize-for-gpu/SKILL.md +119 -0
  130. package/skills/orchestration/SKILL.md +85 -0
  131. package/skills/ownership-session-security/SKILL.md +43 -0
  132. package/skills/paper-lookup/SKILL.md +119 -0
  133. package/skills/paperzilla/SKILL.md +114 -0
  134. package/skills/parallel-web/SKILL.md +64 -0
  135. package/skills/pathfinder/SKILL.md +114 -0
  136. package/skills/pathml/SKILL.md +98 -0
  137. package/skills/pdf/SKILL.md +113 -0
  138. package/skills/peer-review/SKILL.md +119 -0
  139. package/skills/pennylane/SKILL.md +119 -0
  140. package/skills/phylogenetics/SKILL.md +102 -0
  141. package/skills/pi-extension-lifecycle/SKILL.md +41 -0
  142. package/skills/plan/SKILL.md +66 -0
  143. package/skills/polars/SKILL.md +114 -0
  144. package/skills/polars-bio/SKILL.md +84 -0
  145. package/skills/pptx/SKILL.md +118 -0
  146. package/skills/pptx-posters/SKILL.md +112 -0
  147. package/skills/primekg/SKILL.md +97 -0
  148. package/skills/project-session-manager/SKILL.md +85 -0
  149. package/skills/protocolsio-integration/SKILL.md +119 -0
  150. package/skills/pubmed-search/SKILL.md +29 -0
  151. package/skills/pufferlib/SKILL.md +103 -0
  152. package/skills/pydeseq2/SKILL.md +106 -0
  153. package/skills/pydicom/SKILL.md +115 -0
  154. package/skills/pyhealth/SKILL.md +117 -0
  155. package/skills/pylabrobot/SKILL.md +100 -0
  156. package/skills/pymatgen/SKILL.md +28 -0
  157. package/skills/pymc/SKILL.md +108 -0
  158. package/skills/pymoo/SKILL.md +90 -0
  159. package/skills/pyopenms/SKILL.md +119 -0
  160. package/skills/pysam/SKILL.md +118 -0
  161. package/skills/pyspark/SKILL.md +30 -0
  162. package/skills/pytdc/SKILL.md +102 -0
  163. package/skills/pytorch/SKILL.md +31 -0
  164. package/skills/pytorch-lightning/SKILL.md +119 -0
  165. package/skills/pyzotero/SKILL.md +104 -0
  166. package/skills/qiskit/SKILL.md +119 -0
  167. package/skills/qutip/SKILL.md +111 -0
  168. package/skills/ralph/SKILL.md +23 -0
  169. package/skills/ralplan/SKILL.md +105 -0
  170. package/skills/rdflib/SKILL.md +29 -0
  171. package/skills/rdkit/SKILL.md +30 -0
  172. package/skills/read-only-explorer/SKILL.md +85 -0
  173. package/skills/receiving-code-review/SKILL.md +103 -0
  174. package/skills/release/SKILL.md +117 -0
  175. package/skills/remember/SKILL.md +39 -0
  176. package/skills/requesting-code-review/SKILL.md +85 -0
  177. package/skills/requirements-to-task-packet/SKILL.md +65 -0
  178. package/skills/research-grants/SKILL.md +118 -0
  179. package/skills/research-lookup/SKILL.md +117 -0
  180. package/skills/research-reproducibility/SKILL.md +28 -0
  181. package/skills/resource-discovery-config/SKILL.md +43 -0
  182. package/skills/rowan/SKILL.md +100 -0
  183. package/skills/runtime-state-reader/SKILL.md +46 -0
  184. package/skills/safe-bash/SKILL.md +85 -0
  185. package/skills/scanpy/SKILL.md +32 -0
  186. package/skills/scholar-evaluation/SKILL.md +115 -0
  187. package/skills/scientific-brainstorming/SKILL.md +118 -0
  188. package/skills/scientific-critical-thinking/SKILL.md +119 -0
  189. package/skills/scientific-schematics/SKILL.md +116 -0
  190. package/skills/scientific-slides/SKILL.md +117 -0
  191. package/skills/scientific-visualization/SKILL.md +109 -0
  192. package/skills/scientific-writing/SKILL.md +119 -0
  193. package/skills/scikit-bio/SKILL.md +92 -0
  194. package/skills/scikit-learn/SKILL.md +99 -0
  195. package/skills/scikit-survival/SKILL.md +110 -0
  196. package/skills/sciomc/SKILL.md +86 -0
  197. package/skills/scvelo/SKILL.md +106 -0
  198. package/skills/scvi-tools/SKILL.md +114 -0
  199. package/skills/seaborn/SKILL.md +97 -0
  200. package/skills/secure-agent-orchestration-review/SKILL.md +47 -0
  201. package/skills/self-improve/SKILL.md +119 -0
  202. package/skills/semantic-compression/SKILL.md +62 -0
  203. package/skills/setup/SKILL.md +42 -0
  204. package/skills/shap/SKILL.md +103 -0
  205. package/skills/simpy/SKILL.md +116 -0
  206. package/skills/skill/SKILL.md +117 -0
  207. package/skills/skill-search/SKILL.md +67 -0
  208. package/skills/skillify/SKILL.md +46 -0
  209. package/skills/smart-explore/SKILL.md +94 -0
  210. package/skills/sqlite-pandas/SKILL.md +30 -0
  211. package/skills/stable-baselines3/SKILL.md +86 -0
  212. package/skills/state-mutation-locking/SKILL.md +44 -0
  213. package/skills/statistical-analysis/SKILL.md +108 -0
  214. package/skills/statsmodels/SKILL.md +29 -0
  215. package/skills/subagent-driven-development/SKILL.md +89 -0
  216. package/skills/sympy/SKILL.md +115 -0
  217. package/skills/system-prompts/SKILL.md +116 -0
  218. package/skills/systematic-debugging/SKILL.md +119 -0
  219. package/skills/team/SKILL.md +85 -0
  220. package/skills/test-driven-development/SKILL.md +84 -0
  221. package/skills/tiledbvcf/SKILL.md +119 -0
  222. package/skills/timeline-report/SKILL.md +85 -0
  223. package/skills/timesfm-forecasting/SKILL.md +112 -0
  224. package/skills/torch-geometric/SKILL.md +118 -0
  225. package/skills/torchdrug/SKILL.md +118 -0
  226. package/skills/trace/SKILL.md +118 -0
  227. package/skills/transformers/SKILL.md +110 -0
  228. package/skills/treatment-plans/SKILL.md +119 -0
  229. package/skills/ui-render-performance/SKILL.md +41 -0
  230. package/skills/ultragoal/SKILL.md +63 -0
  231. package/skills/ultraqa/SKILL.md +85 -0
  232. package/skills/ultrawork/SKILL.md +20 -0
  233. package/skills/umap-learn/SKILL.md +119 -0
  234. package/skills/usfiscaldata/SKILL.md +118 -0
  235. package/skills/using-git-worktrees/SKILL.md +112 -0
  236. package/skills/using-superpowers/SKILL.md +85 -0
  237. package/skills/using-vetc/SKILL.md +92 -0
  238. package/skills/vaex/SKILL.md +111 -0
  239. package/skills/venue-templates/SKILL.md +113 -0
  240. package/skills/verification-before-completion/SKILL.md +88 -0
  241. package/skills/verification-before-done/SKILL.md +68 -0
  242. package/skills/verify/SKILL.md +33 -0
  243. package/skills/version-bump/SKILL.md +54 -0
  244. package/skills/vetc-analyze-ba/SKILL.md +117 -0
  245. package/skills/vetc-analyze-codebase/SKILL.md +118 -0
  246. package/skills/vetc-api-design/SKILL.md +103 -0
  247. package/skills/vetc-brainstorming/SKILL.md +116 -0
  248. package/skills/vetc-change-proposal/SKILL.md +111 -0
  249. package/skills/vetc-cicd/SKILL.md +113 -0
  250. package/skills/vetc-continuous-learning/SKILL.md +115 -0
  251. package/skills/vetc-deep-interview/SKILL.md +103 -0
  252. package/skills/vetc-docgen/SKILL.md +108 -0
  253. package/skills/vetc-frontend-patterns/SKILL.md +99 -0
  254. package/skills/vetc-iterative-retrieval/SKILL.md +110 -0
  255. package/skills/vetc-java-patterns/SKILL.md +113 -0
  256. package/skills/vetc-meta-skill-creator/SKILL.md +99 -0
  257. package/skills/vetc-oracle-patterns/SKILL.md +109 -0
  258. package/skills/vetc-performance-testing/SKILL.md +104 -0
  259. package/skills/vetc-pr-response/SKILL.md +106 -0
  260. package/skills/vetc-ralph/SKILL.md +108 -0
  261. package/skills/vetc-ralplan/SKILL.md +116 -0
  262. package/skills/vetc-receiving-review/SKILL.md +106 -0
  263. package/skills/vetc-reconcile-patterns/SKILL.md +117 -0
  264. package/skills/vetc-refactoring/SKILL.md +96 -0
  265. package/skills/vetc-runbook/SKILL.md +118 -0
  266. package/skills/vetc-sast/SKILL.md +118 -0
  267. package/skills/vetc-sdlc/SKILL.md +97 -0
  268. package/skills/vetc-security/SKILL.md +117 -0
  269. package/skills/vetc-spec-driven/SKILL.md +111 -0
  270. package/skills/vetc-spec-quality/SKILL.md +117 -0
  271. package/skills/vetc-systematic-debugging/SKILL.md +74 -0
  272. package/skills/vetc-tdd/SKILL.md +96 -0
  273. package/skills/vetc-thinking-pm/SKILL.md +110 -0
  274. package/skills/vetc-ui-visual-qa/SKILL.md +117 -0
  275. package/skills/vetc-verify/SKILL.md +101 -0
  276. package/skills/visual-verdict/SKILL.md +59 -0
  277. package/skills/what-if-oracle/SKILL.md +87 -0
  278. package/skills/widget-rendering/SKILL.md +85 -0
  279. package/skills/wiki/SKILL.md +69 -0
  280. package/skills/workspace-isolation/SKILL.md +85 -0
  281. package/skills/worktree-isolation/SKILL.md +85 -0
  282. package/skills/wowerpoint/SKILL.md +101 -0
  283. package/skills/writer-memory/SKILL.md +82 -0
  284. package/skills/writing-plans/SKILL.md +115 -0
  285. package/skills/writing-skills/SKILL.md +115 -0
  286. package/skills/xgboost/SKILL.md +29 -0
  287. package/skills/xgboost-ts/SKILL.md +28 -0
  288. package/skills/xlsx/SKILL.md +111 -0
  289. package/skills/zarr-python/SKILL.md +101 -0
  290. package/src/categories.ts +383 -0
  291. package/src/format.ts +104 -0
  292. package/src/indexer.ts +101 -0
  293. package/src/proactive.ts +51 -0
  294. package/src/scanner.ts +85 -0
  295. package/src/search.ts +89 -0
  296. package/src/strip.ts +29 -0
  297. package/src/synonyms.ts +83 -0
  298. package/src/text.ts +118 -0
  299. 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
+ ```