evnict-kit 0.2.1

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 (138) hide show
  1. package/README.md +19 -0
  2. package/bin/cli.js +38 -0
  3. package/package.json +48 -0
  4. package/src/commands/add.js +129 -0
  5. package/src/commands/init-check.js +19 -0
  6. package/src/commands/init-context.js +37 -0
  7. package/src/commands/init-rules.js +42 -0
  8. package/src/commands/init-workflow.js +36 -0
  9. package/src/commands/init.js +722 -0
  10. package/src/utils/config.js +167 -0
  11. package/src/utils/file.js +53 -0
  12. package/templates/GETTING-STARTED.md +196 -0
  13. package/templates/content/context/AGENTS.md.template +462 -0
  14. package/templates/content/rules/01-evnict-kit-general-rules.md +303 -0
  15. package/templates/content/rules/02-evnict-kit-security-rules.md +423 -0
  16. package/templates/content/rules/03-evnict-kit-backend-conventions.md +383 -0
  17. package/templates/content/rules/04-evnict-kit-frontend-conventions.md +402 -0
  18. package/templates/content/rules/05-evnict-kit-project-conventions.md +228 -0
  19. package/templates/content/skills/evnict-kit-brainstorm/SKILL.md +140 -0
  20. package/templates/content/skills/evnict-kit-bug-fix/SKILL.md +108 -0
  21. package/templates/content/skills/evnict-kit-checkpoint/SKILL.md +156 -0
  22. package/templates/content/skills/evnict-kit-code-review/SKILL.md +158 -0
  23. package/templates/content/skills/evnict-kit-coordinate/SKILL.md +274 -0
  24. package/templates/content/skills/evnict-kit-create-api/SKILL.md +281 -0
  25. package/templates/content/skills/evnict-kit-create-component/SKILL.md +263 -0
  26. package/templates/content/skills/evnict-kit-create-page/SKILL.md +247 -0
  27. package/templates/content/skills/evnict-kit-database-migration/SKILL.md +164 -0
  28. package/templates/content/skills/evnict-kit-doc-postmortem/SKILL.md +93 -0
  29. package/templates/content/skills/evnict-kit-finish-branch/SKILL.md +87 -0
  30. package/templates/content/skills/evnict-kit-fix-attt/SKILL.md +129 -0
  31. package/templates/content/skills/evnict-kit-fix-business-logic/SKILL.md +89 -0
  32. package/templates/content/skills/evnict-kit-git-worktrees/SKILL.md +104 -0
  33. package/templates/content/skills/evnict-kit-merge-checklist/SKILL.md +108 -0
  34. package/templates/content/skills/evnict-kit-onboard/SKILL.md +143 -0
  35. package/templates/content/skills/evnict-kit-prompt-standard/SKILL.md +103 -0
  36. package/templates/content/skills/evnict-kit-receiving-review/SKILL.md +89 -0
  37. package/templates/content/skills/evnict-kit-security-audit/SKILL.md +190 -0
  38. package/templates/content/skills/evnict-kit-spec/SKILL.md +237 -0
  39. package/templates/content/skills/evnict-kit-tdd/SKILL.md +413 -0
  40. package/templates/content/skills/evnict-kit-wiki/SKILL.md +412 -0
  41. package/templates/content/workflows/evnict-kit-archive-wiki.md +100 -0
  42. package/templates/content/workflows/evnict-kit-attt.md +100 -0
  43. package/templates/content/workflows/evnict-kit-bug-fix.md +107 -0
  44. package/templates/content/workflows/evnict-kit-feature-large.md +393 -0
  45. package/templates/content/workflows/evnict-kit-feature-small.md +86 -0
  46. package/templates/content/workflows/evnict-kit-handoff.md +243 -0
  47. package/templates/content/workflows/evnict-kit-implement.md +247 -0
  48. package/templates/content/workflows/evnict-kit-init-check.md +76 -0
  49. package/templates/content/workflows/evnict-kit-init-context.md +58 -0
  50. package/templates/content/workflows/evnict-kit-init-rules.md +114 -0
  51. package/templates/content/workflows/evnict-kit-init-wiki.md +80 -0
  52. package/templates/content/workflows/evnict-kit-plan.md +308 -0
  53. package/templates/content/workflows/evnict-kit-review.md +53 -0
  54. package/templates/content/workflows/evnict-kit-spec-archive.md +53 -0
  55. package/templates/content/workflows/evnict-kit-wiki-archive-feature.md +164 -0
  56. package/templates/content/workflows/evnict-kit-wiki-query.md +91 -0
  57. package/templates/content/workflows/evnict-kit-wiki-scan-project.md +272 -0
  58. package/templates/context/AGENT.md.template +9 -0
  59. package/templates/context/AGENTS.md.template +462 -0
  60. package/templates/context/CLAUDE.md.template +301 -0
  61. package/templates/context/copilot-instructions.md.template +60 -0
  62. package/templates/context/cursorrules.template +114 -0
  63. package/templates/instruct/Instruct-Agent-AI.be.md +96 -0
  64. package/templates/instruct/Instruct-Agent-AI.fe.md +79 -0
  65. package/templates/rules/antigravity/01-evnict-kit-general-rules.md +303 -0
  66. package/templates/rules/antigravity/02-evnict-kit-security-rules.md +423 -0
  67. package/templates/rules/antigravity/03-evnict-kit-backend-conventions.md +383 -0
  68. package/templates/rules/antigravity/04-evnict-kit-frontend-conventions.md +402 -0
  69. package/templates/rules/antigravity/05-evnict-kit-project-conventions.md +228 -0
  70. package/templates/rules/claude/README.md +8 -0
  71. package/templates/rules/cursor/01-evnict-kit-general-rules.mdc +46 -0
  72. package/templates/rules/cursor/02-evnict-kit-security-rules.mdc +46 -0
  73. package/templates/rules/cursor/03-evnict-kit-backend-conventions.mdc +50 -0
  74. package/templates/rules/cursor/04-evnict-kit-frontend-conventions.mdc +43 -0
  75. package/templates/rules/cursor/05-evnict-kit-project-conventions.mdc +63 -0
  76. package/templates/rules/cursor/README.md +7 -0
  77. package/templates/skills/evnict-kit-brainstorm/SKILL.md +140 -0
  78. package/templates/skills/evnict-kit-bug-fix/SKILL.md +108 -0
  79. package/templates/skills/evnict-kit-checkpoint/SKILL.md +156 -0
  80. package/templates/skills/evnict-kit-code-review/SKILL.md +158 -0
  81. package/templates/skills/evnict-kit-coordinate/SKILL.md +274 -0
  82. package/templates/skills/evnict-kit-create-api/SKILL.md +281 -0
  83. package/templates/skills/evnict-kit-create-component/SKILL.md +263 -0
  84. package/templates/skills/evnict-kit-create-page/SKILL.md +247 -0
  85. package/templates/skills/evnict-kit-database-migration/SKILL.md +164 -0
  86. package/templates/skills/evnict-kit-doc-postmortem/SKILL.md +93 -0
  87. package/templates/skills/evnict-kit-finish-branch/SKILL.md +87 -0
  88. package/templates/skills/evnict-kit-fix-attt/SKILL.md +129 -0
  89. package/templates/skills/evnict-kit-fix-business-logic/SKILL.md +89 -0
  90. package/templates/skills/evnict-kit-git-worktrees/SKILL.md +104 -0
  91. package/templates/skills/evnict-kit-merge-checklist/SKILL.md +108 -0
  92. package/templates/skills/evnict-kit-onboard/SKILL.md +143 -0
  93. package/templates/skills/evnict-kit-prompt-standard/SKILL.md +103 -0
  94. package/templates/skills/evnict-kit-receiving-review/SKILL.md +89 -0
  95. package/templates/skills/evnict-kit-security-audit/SKILL.md +190 -0
  96. package/templates/skills/evnict-kit-spec/SKILL.md +237 -0
  97. package/templates/skills/evnict-kit-tdd/SKILL.md +413 -0
  98. package/templates/skills/evnict-kit-wiki/SKILL.md +412 -0
  99. package/templates/wiki/README.md +35 -0
  100. package/templates/wiki/config.example.yaml +17 -0
  101. package/templates/wiki/package.json +17 -0
  102. package/templates/wiki/raw/notes/.gitkeep +1 -0
  103. package/templates/wiki/scripts/ingest.js +66 -0
  104. package/templates/workflows/antigravity/evnict-kit-archive-wiki.md +100 -0
  105. package/templates/workflows/antigravity/evnict-kit-attt.md +100 -0
  106. package/templates/workflows/antigravity/evnict-kit-bug-fix.md +107 -0
  107. package/templates/workflows/antigravity/evnict-kit-feature-large.md +393 -0
  108. package/templates/workflows/antigravity/evnict-kit-feature-small.md +86 -0
  109. package/templates/workflows/antigravity/evnict-kit-handoff.md +243 -0
  110. package/templates/workflows/antigravity/evnict-kit-implement.md +247 -0
  111. package/templates/workflows/antigravity/evnict-kit-init-check.md +76 -0
  112. package/templates/workflows/antigravity/evnict-kit-init-context.md +58 -0
  113. package/templates/workflows/antigravity/evnict-kit-init-rules.md +114 -0
  114. package/templates/workflows/antigravity/evnict-kit-init-wiki.md +80 -0
  115. package/templates/workflows/antigravity/evnict-kit-plan.md +308 -0
  116. package/templates/workflows/antigravity/evnict-kit-review.md +53 -0
  117. package/templates/workflows/antigravity/evnict-kit-spec-archive.md +53 -0
  118. package/templates/workflows/antigravity/evnict-kit-wiki-archive-feature.md +164 -0
  119. package/templates/workflows/antigravity/evnict-kit-wiki-query.md +91 -0
  120. package/templates/workflows/antigravity/evnict-kit-wiki-scan-project.md +272 -0
  121. package/templates/workflows/claude/README.md +6 -0
  122. package/templates/workflows/claude/evnict-kit-archive-wiki.md +98 -0
  123. package/templates/workflows/claude/evnict-kit-attt.md +98 -0
  124. package/templates/workflows/claude/evnict-kit-bug-fix.md +105 -0
  125. package/templates/workflows/claude/evnict-kit-feature-large.md +391 -0
  126. package/templates/workflows/claude/evnict-kit-feature-small.md +84 -0
  127. package/templates/workflows/claude/evnict-kit-handoff.md +240 -0
  128. package/templates/workflows/claude/evnict-kit-implement.md +245 -0
  129. package/templates/workflows/claude/evnict-kit-init-check.md +74 -0
  130. package/templates/workflows/claude/evnict-kit-init-context.md +56 -0
  131. package/templates/workflows/claude/evnict-kit-init-rules.md +112 -0
  132. package/templates/workflows/claude/evnict-kit-init-wiki.md +78 -0
  133. package/templates/workflows/claude/evnict-kit-plan.md +305 -0
  134. package/templates/workflows/claude/evnict-kit-review.md +51 -0
  135. package/templates/workflows/claude/evnict-kit-spec-archive.md +51 -0
  136. package/templates/workflows/claude/evnict-kit-wiki-archive-feature.md +162 -0
  137. package/templates/workflows/claude/evnict-kit-wiki-query.md +89 -0
  138. package/templates/workflows/claude/evnict-kit-wiki-scan-project.md +270 -0
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: evnict-kit-brainstorm
3
+ description: Socratic design refinement — hỏi ngược user để refine ý tưởng, explore alternatives, đánh giá scope trước khi specify. HARD-GATE: không cho code trước khi design approved.
4
+ ---
5
+
6
+ # evnict-kit-brainstorm
7
+
8
+ ## 1. Ý nghĩa và Mục đích
9
+
10
+ **evnict-kit-brainstorm** là một kỹ năng phân tích và khai thác thông tin từ người dùng dựa trên phương pháp hỏi đáp Socratic.
11
+ Quá trình brainstorm không nhằm mục đích tự tạo ra giải pháp chủ quan và ép người dùng theo, mà là một quy trình tương tác hai chiều.
12
+ Mục tiêu là giúp người dùng đào sâu vào ý tưởng, dự đoán sớm các "edge cases" (trường hợp biên), và thiết kế một giải pháp không chỉ đáp ứng hiện tại mà còn scale tốt trong tương lai. Nắm bắt được logic cốt lõi ở giai đoạn này sẽ giúp các khâu Plan và Implement (TDD) phía sau ít gặp ma sát nhất.
13
+
14
+ Kỹ năng này giúp Agent thay vì đóng vai một "Code Monkey" (nhận lệnh và gõ code vô tri) thì chuyển sang vai trò "Tech Lead / Solution Architect" (tư vấn giải pháp, cảnh báo rủi ro).
15
+
16
+ ---
17
+
18
+ ## 2. Khi nào kích hoạt
19
+ Kỹ năng này hoạt động độc lập hoặc như một phần không thể tách rời của `evnict-kit-feature-large`:
20
+ - **TỰ ĐỘNG** kích hoạt khi user yêu cầu tạo một feature mới mà context chưa thật sự rõ ràng hoặc mô tả của user quá trừu tượng/sơ sài.
21
+ - Được gọi **TRƯỚC KHI** hệ thống chạy Phase (Specify/Plan).
22
+ - **HARD-GATE:** Tuyệt đối KHÔNG được sinh code hay spec trước khi quá trình brainstorm kết thúc và chốt lại thành một **Design Brief**.
23
+
24
+ ---
25
+
26
+ ## 3. Khái niệm Socratic Brainstorm
27
+ 1. **Never Assume (Không bao giờ giả định)**: Thay vì tự giả định một hành vi, Agent hãy hỏi. Sự mơ hồ là kẻ thù của code quality. Tốt nhất là đưa ra câu hỏi đóng, kèm tuỳ chọn.
28
+ 2. **Offer Options (Luôn cung cấp lựa chọn)**: Khi đứng trước một vấn đề có nhiều cách giải, đưa ra tối đa 3 options (A, B, C) kèm theo Pros/Cons. Đừng ép User phải nghĩ ra Option. Hãy làm công việc đó thay họ.
29
+ 3. **Clarify Constraints (Làm rõ giới hạn)**: Xác định rõ các giới hạn về thời gian, kỹ thuật, bảo mật trước khi gõ bất cứ dòng code nào.
30
+
31
+ ---
32
+
33
+ ## 4. Tâm lý học Ứng xử (Behavioral Guardrails)
34
+ Khi đặt câu hỏi, Agent cần tuân thủ các quy tắc ứng xử sau:
35
+ - **Tôn trọng nhưng định hướng thiện chí**: Nếu Use-case của người dùng mang hơi hướng rườm rà (ví dụ muốn viết 1 file 5000 dòng để export Excel custom), nhẹ nhàng chỉ ra các thư viện hoặc Service trung gian thay vì hùa theo.
36
+ - **Tiết kiệm Token/Mắt đọc**: Gom nhóm câu hỏi một cách thông minh, sử dụng Bullet Points. Không hỏi dồn dập mỗi lần 1 câu.
37
+ - **Né tránh Hội chứng "Blank Page Syndrome"**: Con người thường lười mô tả ý tưởng từ đầu. Do đó Agent phải mớm lời bằng cách cung cấp Bản Nháp Góc Nhìn (Perspective Draft) để User phản biện lại. "Chửi một bản nháp tồi luôn dễ hơn xây một bản nháp từ số không."
38
+
39
+ ---
40
+
41
+ ## 5. Workflow chi tiết (Quy trình thực thi)
42
+
43
+ ### Bước 1: Tiếp nhận và Phân tách Ý tưởng Thô (Raw Idea Breakdown)
44
+ Đọc và phân tích mô tả feature dạng ý tưởng thô từ user.
45
+ 1. Xác định domain nghiệp vụ: Feature này thuộc phân hệ nào? (Ví dụ: Thanh toán, Quản lý người dùng, Báo cáo...).
46
+ 2. Xác định các target actor (vai trò người dùng) tham gia vào feature này: Admin, End-User, System Service, ...
47
+ 3. Xác định trạng thái ban đầu: Nó thay đổi hệ thống đang có hay tạo mới hoàn toàn?
48
+
49
+ ### Bước 2: Xác định Môi trường (Project Context Detect)
50
+ Trước khi đưa ra giải pháp, Agent PHẢI nhận biết rõ mình đang đứng ở Frontend hay Backend và giới hạn của repository hiện tại.
51
+ 1. Quét root directory xem có tồn tại `pom.xml`, `build.gradle` (Backend) hay `angular.json`, `package.json` cùng React/Angular (Frontend).
52
+ 2. Dựa trên tính chất của feature, phán đoán xem nó có CẦN sửa cả Backend lẫn Frontend hay không?
53
+ 3. Nếu CẦN sửa cả 2:
54
+ - Ngay lập tức thông báo để quản lý kỳ vọng:
55
+ > "Feature này đòi hỏi sự tương tác xuyên suốt: Code thay đổi Backend và Frontend.
56
+ > Agent sẽ ghi chú lại việc phân tách ranh giới rõ ràng. Trong thư mục hiện tại, Agent sẽ tạo Plan chỉ định phần BE/FE, sau khi hoàn thành phần này sẽ có lệnh Handoff để chuyển tác vụ cho Agent phía bên kia."
57
+
58
+ ### Bước 3: Socratic Questioning (TỐI ĐA 5 câu hỏi cốt lõi)
59
+ Hỏi user để refine lại design. **KHÔNG TỰ GIẢ ĐỊNH.** Đưa ra lượng câu hỏi vừa đủ, tinh giản, sắc bén theo mẫu chuẩn Socratic:
60
+
61
+ **Q1: Mục tiêu nghiệp vụ (Business Goal)**
62
+ - "Bạn muốn giải quyết triệt để bài toán gì cho user cuối bằng feature này?" (Tập trung vào The Why, không phải The How).
63
+
64
+ **Q2: Phạm vi tính năng (Scope Boundary)**
65
+ - "Feature này bao gồm và đặc biệt quan trọng nhất là KHÔNG BAO GỒM những gì? (Ví dụ: Tính năng gửi email thông báo sau khi hoàn tất Flow có nên đưa vào lúc này hay để Phase sau?)"
66
+
67
+ **Q3: Phương án kỹ thuật (Alternatives & Trade-offs)**
68
+ - "Dựa trên mô tả, tôi có 2 hướng tiếp cận để xử lý kỹ thuật nhằm đạt hiệu suất tốt nhất:
69
+ - **Hướng A**: {Mô tả giải pháp nhanh, MVP} - Pros: {Lợi ích} / Cons: {Bất lợi về scale}.
70
+ - **Hướng B**: {Mô tả giải pháp phức tạp nhưng chuẩn Architecture} - Pros: {Scale tốt, chuẩn} / Cons: {Tốn thời gian dev}.
71
+ Bạn ưu tiên Hướng A hay B?"
72
+
73
+ **Q4: Giới hạn hệ thống (Constraints & Security)**
74
+ - "Có yêu cầu gắt gao nào về hiệu năng (VD: xử lý 10.000 records/giây) hay bảo mật (Audit Log, Data Masking) mà chúng ta phải cân nhắc ngay từ Phase Database Schema không?"
75
+
76
+ **Q5: Tích hợp hệ thống (Integration)**
77
+ - "Tính năng có yêu cầu đồng bộ, gọi API đến hệ thống bên thứ 3 nào không (VD: Hệ thống Payment, CMIS, hay HRM)?"
78
+
79
+ *(Lưu ý cho AI: In ra màn hình các câu hỏi bằng Markdown có format bôi đậm rõ ràng, dễ nhìn, chia dòng hợp lý. Không in một cục text tảng).*
80
+
81
+ ### Bước 4: Đánh giá Quy mô (Scope Assessment & Reality Check)
82
+ Sau khi user cung cấp câu trả lời, Agent thực hiện kiểm tra kiểm tra xem Feature này có "quá khổ" so với 1 phiên làm việc hay không:
83
+ - **Feature quá lớn?** (Chẳng hạn: Cần hơn 5 bảng DB mới, 10 APIs liên quan, hoặc nhiều màn hình Web Form phức tạp).
84
+ - Hành động: Báo động! Đề xuất chia tính năng (Split the feature) thành các Sub-features nhỏ hơn theo phương pháp "Phased Approach" (Giai đoạn). Đề nghị chốt lại Scope cho Phase 1 là đủ Minimum Viable Feature.
85
+ - **Feature cực kỳ nhỏ lẻ?** (Chỉ thêm 1 trường DB, chỉ đổi cấu trúc JSON trên 1 file).
86
+ - Hành động: Đề nghị hạ workflow xuống dùng `feature-small` cho nhanh nhẹn.
87
+
88
+ ### Bước 5: Chốt hạ Design Brief (Bản tóm tắt thiết kế chốt)
89
+ Dựa vào 100% dữ kiện thu thập, xuất ra một Design Brief chốt lại mọi luồng suy nghĩ. **KHÔNG in Spec vội**. Đây là phiên bản tóm lược của giải pháp:
90
+
91
+ ```markdown
92
+ ## Design Brief: {feature_name}
93
+ - **Objective (Mục tiêu)**: {Tóm gọn trong 1 câu}
94
+ - **In-Scope (Tính năng làm đợt này)**: {Bullet points}
95
+ - **Out-of-Scope (Tính năng gác lại)**: {Bullet points}
96
+ - **Approach đã chọn**: {Hướng đi kỹ thuật chốt, ví dụ Hướng B}
97
+ - **Alternatives Rejected**: {Tại sao không chọn Hướng A}
98
+ - **Constraints / Risks (Rủi ro)**: {Vấn đề bảo mật, tải trọng, tích hợp...}
99
+ - **Impact (Phạm vi tác động)**: Backend ☑ / Frontend ☑ / Database ☑
100
+ - **Complexity Estimate**: Large / Medium / Small
101
+ ```
102
+
103
+ ### Bước 6: LẬP CHỐT CHẶN (HARD-GATE)
104
+ Đã gọi là Hard-Gate thì KHÔNG được đi tiếp, dù mô hình LLM có xu hướng tự động sinh code. Bắt buộc kết thúc câu thoại của Agent với Blockquote sau:
105
+
106
+ ```markdown
107
+ > [!IMPORTANT]
108
+ > Design Brief đã sẵn sàng. Bạn vui lòng đọc kỹ trước khi chúng ta tiến hành Specify (Đặc tả chi tiết).
109
+ > **Bạn có ĐỒNG Ý duyệt Design Brief này để chuyển sang Phase 1: Specify không?**
110
+ > (Gõ "Ok" để tiếp tục, hoặc chỉnh sửa lại Design nếu bạn chưa ưng ý).
111
+ ```
112
+
113
+ ### Bước 7: Phản ứng của Agent với User's Decision
114
+ - **User gõ "Ok" / "Approve"**: Agent xác nhận thành công và tự động chuyển giao flow cho `evnict-kit-feature-large` tiếp tục Phase 1: Sinh Spec File.
115
+ - **User gõ thay đổi / feedback**: Bắt tay ngay vào cập nhật bước 5 `Design Brief`, tuyệt đối kiên nhẫn làm lại bài toán Hard-Gate cho tới khi 2 bên đồng thuận. Đoạn này có thể lặp lại nhiều lần.
116
+
117
+ ---
118
+
119
+ ## 6. Mô phỏng Phiên Đối thoại Thực tế (Mock Interaction)
120
+ **User**: `Tính năng mới: Làm trang hiển thị lịch sử mua hàng, cho phép xuất PDF bill.`
121
+ **Agent (Bước 2)**: Nhận diện đây là Fullstack Feature (Frontend cần giao diện trang, Backend cần API trả lịch sử + generate PDF).
122
+ **Agent (Bước 3)**: Đặt các câu hỏi:
123
+ - *Q1*: Phần giao diện History có cần thanh filter date range không? Hay load tất cả?
124
+ - *Q2*: Phần xuất PDF, anh ưu tiên Hướng A (FE tự xài html2canvas gen PDF cho nhẹ server) hay Hướng B (BE dùng JasperReports gen PDF rất chuẩn form nhưng load BE)?
125
+ - *Q3*: Form này có cần bảo mật Anti-crawler bóc dữ liệu hàng loạt không?
126
+ **User**: `Có filter Date. Làm Hướng B. Có giới hạn rate limit.`
127
+ **Agent**: Tiến hành sinh Design Brief từ kết quả. Chặn lệnh bắt User gõ OK.
128
+ **User**: `OK`
129
+ **Agent**: Khởi chạy `/evnict-kit:feature-large` -> Specify Phase.
130
+
131
+ ---
132
+
133
+ ## 7. Anti-patterns (Tuyệt đối Tránh)
134
+ Những lỗi sai Agent thường mắc khi Brainstorming:
135
+ 1. **Thiếu kiên nhẫn (Rushing to Code)**: Nhảy thẳng vào viết Code hoặc SQL Database Schema trước khi Design Brief được người dùng "Duyệt".
136
+ 2. **Liệt kê câu hỏi vô nghĩa (Dumb Questions)**: Đưa các câu hỏi không liên quan đến scope ảnh hưởng (ví dụ hỏi tên table là gì, màu nút bấm ra sao).
137
+ 3. **Câu hỏi mở bế tắc (Open-ended Deadlock)**: Hỏi "Bạn muốn hệ thống hoạt động như thế nào?" mà không đưa ra Hướng A, Hướng B để user chọn. Điều này làm user phải viết text quá nhiều.
138
+ 4. **Giả vờ hỏi nhưng rồi tự trả lời**: Hỏi user nhưng cùng lúc in ra cả file Spec khổng lồ dựa trên giả định. (Đây là hành vi bỏ chốt chặn HARD-GATE).
139
+ 5. **Gãy kết nối Front/Back**: Quên nhắc nhở user ngay từ Bước 2 rằng feature này đòi hỏi sự đồng bộ giữa client agent và server agent.
140
+ 6. **Mất Context**: Không tóm tắt Alternatives bị loại bỏ, dẫn đến sau này bị dev team review hỏi lại "tại sao không làm cách A".
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: evnict-kit-bug-fix
3
+ description: Bug fix workflow — reproduce → root cause → TDD fix → scan similar → postmortem. Quy trình sửa lỗi có hệ thống.
4
+ compatibility: All tech stacks
5
+ ---
6
+
7
+ # evnict-kit-bug-fix — Sửa Lỗi
8
+
9
+ ## Khi nào dùng
10
+ - Bug report từ tester/user
11
+ - Lỗi phát hiện trong quá trình phát triển
12
+ - Regression bug
13
+
14
+ ## Input Parameters
15
+ - `description` (bắt buộc): Mô tả bug
16
+ - `severity` (optional): critical | high | medium | low
17
+ - `steps_to_reproduce` (optional): Các bước tái tạo
18
+
19
+ ---
20
+
21
+ ## Workflow Steps
22
+
23
+ ### Bước 1: Query Wiki
24
+ Tìm trong wiki xem bug này đã được report/fix trước đó chưa:
25
+ ```bash
26
+ grep -rl "{keyword}" {wiki_path}/processed/ --include="*.md"
27
+ ```
28
+ Nếu đã có → đọc cách fix trước đó.
29
+
30
+ ### Bước 2: Reproduce
31
+ 1. Đọc steps to reproduce
32
+ 2. Tìm file/module liên quan
33
+ 3. Nếu có test → chạy test xem fail ở đâu
34
+ 4. **Tạo test case reproduce lỗi** (RED phase — test PHẢI FAIL)
35
+
36
+ ```java
37
+ @Test
38
+ @DisplayName("BUG: {description}")
39
+ void reproduce_bug_description() {
40
+ // Arrange — setup data gây lỗi
41
+ // Act — thực hiện action gây lỗi
42
+ // Assert — verify kết quả sai (EXPECTED TO FAIL)
43
+ }
44
+ ```
45
+
46
+ ### Bước 3: Root Cause Analysis
47
+ 1. Đọc code liên quan
48
+ 2. Trace logic từ input → output
49
+ 3. Xác định chính xác dòng code gây lỗi
50
+ 4. Ghi lại root cause:
51
+
52
+ ```markdown
53
+ ## Root Cause
54
+ - File: {path}
55
+ - Line: {line}
56
+ - Issue: {description}
57
+ - Why: {explanation}
58
+ ```
59
+
60
+ ### Bước 4: TDD Fix
61
+ 1. Test reproduce ĐÃ FAIL (RED) ✅
62
+ 2. Fix code → test PASS (GREEN)
63
+ 3. Refactor nếu cần (test vẫn PASS)
64
+ 4. Chạy ALL tests → PASS
65
+
66
+ ```bash
67
+ ./mvnw test # hoặc ng test --watch=false
68
+ ./mvnw compile # Build OK
69
+ ```
70
+
71
+ ### Bước 5: Scan Similar
72
+ Tìm pattern lỗi tương tự trong codebase:
73
+ ```bash
74
+ grep -rn "{error pattern}" --include="*.java" src/
75
+ ```
76
+ Nếu tìm thấy → fix luôn (prevent regression).
77
+
78
+ ### Bước 6: Commit
79
+ ```bash
80
+ git add .
81
+ git commit -m "fix({module}): {description} [BUG-{id}]"
82
+ ```
83
+
84
+ ### Bước 7: Push Wiki
85
+ Dùng skill `evnict-kit-wiki` push kiến thức:
86
+ - Bug description
87
+ - Root cause
88
+ - Fix approach
89
+ - Similar patterns to watch for
90
+
91
+ ---
92
+
93
+ ## 3-Strike Rule
94
+ Nếu fix FAIL > 3 lần cho cùng 1 bug:
95
+ 1. **DỪNG** phiên AI
96
+ 2. Báo user: "Bug cần phân tích thủ công"
97
+ 3. Log lại 3 lần thử và kết quả
98
+
99
+ ---
100
+
101
+ ## Tiêu chí hoàn thành
102
+ - [ ] Bug reproduced bằng test case
103
+ - [ ] Root cause identified
104
+ - [ ] Fix implemented (TDD)
105
+ - [ ] All tests PASS
106
+ - [ ] Similar patterns scanned
107
+ - [ ] Commit message chuẩn
108
+ - [ ] Wiki updated
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: evnict-kit-checkpoint
3
+ description: Checkpoint & Rollback plan theo QĐ-TTPM Mục 8.8 — tạo branch, commit checkpoint, stash, lập rollback plan trước khi AI Agent thực hiện thay đổi.
4
+ compatibility: Git 2.x+
5
+ ---
6
+
7
+ # evnict-kit-checkpoint — Checkpoint & Rollback
8
+
9
+ ## Khi nào dùng
10
+ - TRƯỚC MỖI phiên làm việc với AI Agent
11
+ - Trước thay đổi lớn (nhiều file/module)
12
+ - Khi cần tạo rollback plan bằng văn bản
13
+
14
+ ## Input Parameters
15
+ - `action` (bắt buộc): create | rollback | plan | status
16
+ - `description` (optional): Mô tả checkpoint
17
+
18
+ ---
19
+
20
+ ## Workflow Steps
21
+
22
+ ### Action: CREATE — Tạo checkpoint
23
+
24
+ #### Bước 1: Kiểm tra git status
25
+ ```bash
26
+ git status
27
+ git stash list
28
+ ```
29
+
30
+ #### Bước 2: Chọn strategy
31
+ | Tình huống | Strategy | Command |
32
+ |------------|----------|---------|
33
+ | Feature mới | Branch mới | `git checkout -b feature/{slug}` |
34
+ | Task nhỏ | Commit checkpoint | `git add . && git commit -m "checkpoint: {desc}"` |
35
+ | Thử nghiệm | Stash | `git stash push -m "{desc}"` |
36
+
37
+ #### Bước 3: Tạo checkpoint
38
+ ```bash
39
+ # Option 1: Feature branch (KHUYẾN NGHỊ)
40
+ git checkout -b feature/{slug}-{date}
41
+
42
+ # Option 2: Commit checkpoint
43
+ git add .
44
+ git commit -m "checkpoint: before {description}"
45
+
46
+ # Option 3: Stash
47
+ git stash push -m "checkpoint: {description}"
48
+ ```
49
+
50
+ #### Bước 4: Confirm
51
+ ```
52
+ ✅ Checkpoint created
53
+ Strategy: {branch|commit|stash}
54
+ Reference: {branch name | commit hash | stash ref}
55
+ Rollback: git checkout main | git reset HEAD~1 | git stash pop
56
+ ```
57
+
58
+ ---
59
+
60
+ ### Action: ROLLBACK — Thực hiện rollback
61
+
62
+ #### Bước 1: Xác định checkpoint
63
+ ```bash
64
+ git log --oneline -5 # Tìm commit checkpoint
65
+ git stash list # Tìm stash
66
+ git branch # Tìm branch
67
+ ```
68
+
69
+ #### Bước 2: Rollback
70
+ ```bash
71
+ # Nếu dùng branch → quay về main
72
+ git checkout main
73
+ git branch -D feature/{slug}
74
+
75
+ # Nếu dùng commit checkpoint → reset
76
+ git reset --hard {checkpoint-hash}
77
+
78
+ # Nếu dùng stash → pop
79
+ git stash pop
80
+ ```
81
+
82
+ #### Bước 3: Verify
83
+ ```bash
84
+ git status # Clean
85
+ git log --oneline -3 # Confirm đúng state
86
+ ```
87
+
88
+ ---
89
+
90
+ ### Action: PLAN — Tạo Rollback Plan (cho thay đổi lớn)
91
+
92
+ Tạo file `.evnict/rollback-plan-{date}.md`:
93
+
94
+ ```markdown
95
+ # Rollback Plan: {feature/task description}
96
+ ## Date: {YYYY-MM-DD}
97
+ ## Author: AI Agent
98
+
99
+ ## Scope of Change
100
+ - Files affected: {count}
101
+ - Modules: {list}
102
+ - Database changes: {yes/no}
103
+ - Breaking changes: {yes/no}
104
+
105
+ ## Checkpoint
106
+ - Type: {branch|commit|stash}
107
+ - Reference: {ref}
108
+ - Created: {timestamp}
109
+
110
+ ## Rollback Steps
111
+ 1. `git checkout main` — Quay về main branch
112
+ 2. `git branch -D feature/{slug}` — Xóa feature branch
113
+ 3. {Nếu có DB migration} → Chạy rollback script:
114
+ `database/migrations/V{date}_ROLLBACK.sql`
115
+ 4. {Nếu có config change} → Revert config:
116
+ `git checkout {checkpoint-hash} -- path/to/config`
117
+
118
+ ## Verification After Rollback
119
+ - [ ] `git status` clean
120
+ - [ ] Build passes: `./mvnw compile`
121
+ - [ ] Tests pass: `./mvnw test`
122
+ - [ ] Application starts normally
123
+
124
+ ## Risk Assessment
125
+ - Impact if rollback needed: {low|medium|high}
126
+ - Data loss risk: {none|partial|full}
127
+ - Downtime: {none|minutes|hours}
128
+ ```
129
+
130
+ ---
131
+
132
+ ### Action: STATUS — Kiểm tra checkpoint status
133
+
134
+ ```markdown
135
+ ## 📋 Checkpoint Status
136
+
137
+ ### Active Checkpoints
138
+ | Type | Reference | Description | Date |
139
+ |------|-----------|-------------|------|
140
+ | branch | feature/xxx | Before auth changes | 2026-04-01 |
141
+ | stash | stash@{0} | WIP: customer form | 2026-04-01 |
142
+
143
+ ### Recent Commits
144
+ {git log --oneline -5}
145
+
146
+ ### Working Tree
147
+ {git status --short}
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Tiêu chí hoàn thành
153
+ - [ ] Checkpoint tạo thành công
154
+ - [ ] Rollback plan tạo cho thay đổi lớn
155
+ - [ ] Revert trong ≤ 1 thao tác git
156
+ - [ ] Verify sau rollback: build + test pass
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: evnict-kit-code-review
3
+ description: Review checklist theo QĐ-TTPM Mục 8.10 — kiểm tra security, logic, quality, vibe coding trước khi merge. 9 hạng mục bắt buộc.
4
+ compatibility: All tech stacks
5
+ ---
6
+
7
+ # evnict-kit-code-review — Auto Code Review
8
+
9
+ ## Khi nào dùng
10
+ - Trước khi merge code vào main/develop
11
+ - Review code do AI Agent sinh ra
12
+ - Kiểm tra toàn bộ changes trong branch hiện tại
13
+
14
+ ## Input Parameters
15
+ - `scope` (optional): all | security | logic | quality (default: all)
16
+ - `branch` (optional): Branch cần review (default: current)
17
+
18
+ ---
19
+
20
+ ## Workflow Steps
21
+
22
+ ### Bước 1: Thu thập changes
23
+ ```bash
24
+ git diff --stat main..HEAD # Files changed
25
+ git diff main..HEAD # Full diff
26
+ git log --oneline main..HEAD # Commits
27
+ ```
28
+
29
+ ### Bước 2: Chạy 9 hạng mục review (QĐ-TTPM Mục 8.10)
30
+
31
+ #### ✅ Hạng mục 1: Security — ATTT
32
+ Đọc rules `02-evnict-kit-security-rules.md` → scan:
33
+ ```bash
34
+ # SQL Injection
35
+ grep -rn "query.*+.*\"" --include="*.java" src/
36
+ grep -rn "DSL\.field(.*+\s" --include="*.java" src/
37
+
38
+ # XSS
39
+ grep -rn "\[innerHTML\]" --include="*.html" src/
40
+ grep -rn "bypassSecurityTrust" --include="*.ts" src/
41
+
42
+ # Secrets
43
+ grep -rn "password\s*=\s*\"" --include="*.java" --include="*.ts" src/
44
+
45
+ # Data exposure
46
+ grep -rn "ResponseEntity.ok(.*repository" --include="*.java" src/
47
+ ```
48
+
49
+ | Check | Pass/Fail | Details |
50
+ |-------|-----------|---------|
51
+ | No SQL Injection | ✅/❌ | {details} |
52
+ | No XSS | ✅/❌ | {details} |
53
+ | No hardcoded secrets | ✅/❌ | {details} |
54
+ | No data exposure | ✅/❌ | {details} |
55
+ | Auth on endpoints | ✅/❌ | {details} |
56
+
57
+ #### ✅ Hạng mục 2: Logic — Business correctness
58
+ - [ ] Business rules implemented correctly (so sánh với spec)
59
+ - [ ] Edge cases handled
60
+ - [ ] Error handling đầy đủ
61
+ - [ ] Null/empty checks
62
+
63
+ #### ✅ Hạng mục 3: Quality — Code quality
64
+ - [ ] Naming conventions tuân thủ
65
+ - [ ] No code duplication
66
+ - [ ] Methods không quá dài (< 50 lines)
67
+ - [ ] Comments cho logic phức tạp
68
+ - [ ] No dead code
69
+
70
+ #### ✅ Hạng mục 4: Tests
71
+ - [ ] Unit tests viết cho code mới
72
+ - [ ] Tests PASS: `./mvnw test` hoặc `ng test`
73
+ - [ ] Coverage đạt target (Service ≥ 80%, Controller ≥ 70%)
74
+
75
+ #### ✅ Hạng mục 5: Build & Lint
76
+ ```bash
77
+ ./mvnw compile && echo "✅ Build OK" || echo "❌ Build FAIL"
78
+ ./mvnw spotless:check && echo "✅ Lint OK" || echo "❌ Lint FAIL"
79
+ ```
80
+
81
+ #### ✅ Hạng mục 6: Vibe Coding Check
82
+ - [ ] Không có file thay đổi không liên quan
83
+ - [ ] Mỗi commit có message rõ ràng
84
+ - [ ] Code có thể giải thích được
85
+ - [ ] Không có logic trùng lặp/mâu thuẫn
86
+
87
+ #### ✅ Hạng mục 7: Database
88
+ - [ ] Migration script có rollback
89
+ - [ ] Index cho columns thường query
90
+ - [ ] Không DROP/TRUNCATE table production
91
+
92
+ #### ✅ Hạng mục 8: Documentation
93
+ - [ ] API mới có description
94
+ - [ ] Complex logic có comments
95
+ - [ ] Spec updated nếu scope thay đổi
96
+
97
+ #### ✅ Hạng mục 9: Performance
98
+ - [ ] No N+1 query
99
+ - [ ] Pagination cho list endpoints
100
+ - [ ] File upload có size limit
101
+ - [ ] No unbounded loops
102
+
103
+ ### Bước 3: Tạo Review Report
104
+
105
+ ```markdown
106
+ ## 📋 Code Review Report
107
+ ### Feature: {feature-name}
108
+ ### Branch: {branch}
109
+ ### Date: {date}
110
+ ### Reviewer: AI Agent
111
+
112
+ ## Summary
113
+ | Hạng mục | Status | Issues |
114
+ |----------|--------|--------|
115
+ | Security | ✅/❌ | {count} |
116
+ | Logic | ✅/❌ | {count} |
117
+ | Quality | ✅/❌ | {count} |
118
+ | Tests | ✅/❌ | {count} |
119
+ | Build | ✅/❌ | {count} |
120
+ | Vibe Coding | ✅/❌ | {count} |
121
+ | Database | ✅/❌ | {count} |
122
+ | Documentation | ✅/❌ | {count} |
123
+ | Performance | ✅/❌ | {count} |
124
+
125
+ ## ❌ Issues Found
126
+ ### Issue 1: {title}
127
+ - Severity: Critical/High/Medium/Low
128
+ - File: {path}
129
+ - Line: {line}
130
+ - Description: {desc}
131
+ - Fix: {suggested fix}
132
+
133
+ ## ✅ Verdict
134
+ {APPROVE | REQUEST CHANGES | BLOCK}
135
+ {Reason}
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Error Handling
141
+
142
+ ### BLOCK merge khi:
143
+ - Security issue Critical/High → PHẢI fix trước
144
+ - Tests FAIL → PHẢI fix
145
+ - Build FAIL → PHẢI fix
146
+
147
+ ### REQUEST CHANGES khi:
148
+ - Security issue Medium → Fix recommended
149
+ - Quality issues → Suggest improvements
150
+ - Missing tests → Add tests
151
+
152
+ ---
153
+
154
+ ## Tiêu chí hoàn thành
155
+ - [ ] 9 hạng mục đã review
156
+ - [ ] Report tạo đầy đủ
157
+ - [ ] Critical/High issues → BLOCK
158
+ - [ ] Verdict rõ ràng: APPROVE | REQUEST CHANGES | BLOCK