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,243 @@
1
+ ---
2
+ name: evnict-kit-handoff
3
+ description: Handoff chi tiết từ BE→FE (hoặc ngược lại). Sinh 5 sections — tổng quan, API contract, DTO TypeScript, validation sync, FE tasks + UI requirements.
4
+ ---
5
+
6
+ # Handoff
7
+ **Command:** `/evnict-kit:handoff`
8
+
9
+ ## Ý nghĩa và Mục đích
10
+ Trong mô hình nhiều AI Agents làm việc song song trên nhiều Repositories (BE + FE). Khi Backend hoàn thành API, lệnh `handoff` sẽ sinh file bàn giao **ĐẦY ĐỦ** để FE Agent có thể implement mà KHÔNG cần hỏi thêm.
11
+
12
+ ## Khi nào dùng
13
+ - Khi phát triển xong API Endpoints ở Backend → FE cần implement UI
14
+ - Khi hoàn thành DB Migration ở dự án Database riêng → báo Backend
15
+ - Sau khi BE implement xong tất cả tasks của feature
16
+
17
+ ---
18
+
19
+ ## Workflow chi tiết
20
+
21
+ ### Bước 1: Rà soát Công việc
22
+ 1. Đọc `.evnict/specs/{feature}/plan.md` → lấy task list
23
+ 2. Kiểm tra tất cả BE tasks đã `[x]` hoàn thành chưa
24
+ - Nếu chưa xong hết → CẢNH BÁO: "Còn {N} BE tasks chưa hoàn thành. Handoff ngay?"
25
+ 3. Kiểm tra API Contract `.evnict/handoff/contracts/{feature}-api.yaml`
26
+ - Nếu chưa có → sinh mới từ code đã implement
27
+ - Nếu đã có → verify lại với code hiện tại
28
+
29
+ ### Bước 2: Đọc code đã implement → trích xuất context
30
+ Agent PHẢI đọc các files đã tạo trong BE tasks:
31
+
32
+ 1. **Đọc DTOs** → trích fields, types, annotations, JsonProperty
33
+ 2. **Đọc Controllers** → trích endpoints, request params, response format
34
+ 3. **Đọc Services** → trích business rules, validation logic
35
+ 4. **Đọc commit log** → `git log --oneline main..HEAD`
36
+
37
+ ### Bước 3: Append entry vào Handoff Log — PHẢI có 5 SECTIONS
38
+
39
+ > **QUAN TRỌNG:** KHÔNG tạo file riêng cho mỗi feature. Thay vào đó, APPEND entry mới vào file `.evnict/handoff/handoff.md`.
40
+ > Nếu file chưa tồn tại → tạo mới với header template.
41
+
42
+ Append entry sau vào `.evnict/handoff/handoff.md`:
43
+
44
+ ```markdown
45
+ ---
46
+
47
+ ### [{YYYY-MM-DD}] BE→FE: {Feature Name} — Handoff
48
+ - **Trạng thái:** 🔴 Chờ xử lý
49
+ - **Spec:** `.evnict/specs/{feature}/spec.md`
50
+
51
+ #### 1. TỔNG QUAN ĐÃ LÀM (Backend)
52
+ **Mô tả:** {3-5 câu tóm tắt những gì BE đã implement}
53
+
54
+ **Tasks đã hoàn thành:**
55
+ | # | Task | Files | Tests |
56
+ |---|------|-------|-------|
57
+ | 01 | DB Migration | {migration_file} | ✅ |
58
+ | 02 | Repository | {repo_file} ({dto_file}) | ✅ {N}/{N} |
59
+ | 03 | Service | {service_file} | ✅ {N}/{N} |
60
+ | 04 | Controller | {controller_file} ({M} endpoints) | ✅ {N}/{N} |
61
+
62
+ **Commits:**
63
+ ```
64
+ {hash} feat({module}): {description} [task-01]
65
+ {hash} feat({module}): {description} [task-02]
66
+ ...
67
+ ```
68
+
69
+ #### 2. API CONTRACT (Chi tiết cho Frontend)
70
+ **File đầy đủ:** `.evnict/handoff/contracts/{feature}-api.yaml`
71
+
72
+ **Quick Reference:**
73
+ | Method | Path | Mô tả | Auth |
74
+ |--------|------|-------|------|
75
+ | POST | /api/{module}/{action} | {mô tả} | JWT |
76
+ | ... | ... | ... | ... |
77
+
78
+ **DTO Structure (cho TypeScript interface):**
79
+ ```typescript
80
+ // Auto-generated từ {DTOFile.java}
81
+ export interface {EntityName} {
82
+ ID: number;
83
+ FIELD_NAME: string; // @JsonProperty("FIELD_NAME")
84
+ NULLABLE_FIELD?: string; // nullable → optional
85
+ NUMERIC_FIELD: number;
86
+ DATE_FIELD: string; // format: yyyy-MM-dd
87
+ STATUS: number;
88
+ USER_CR_ID: string; // audit - server tự set
89
+ USER_CR_DTIME: string; // audit - server tự set
90
+ USER_MDF_ID: string; // audit - server tự set
91
+ USER_MDF_DTIME: string; // audit - server tự set
92
+ }
93
+ ```
94
+
95
+ **Validation Rules (PHẢI sync BE↔FE):**
96
+ | Field | Rule | Error Message (tiếng Việt) |
97
+ |-------|------|---------------------------|
98
+ | {FIELD} | Required | "Vui lòng nhập {field_label}" |
99
+ | {FIELD} | MaxLength({N}) | "{field_label} không quá {N} ký tự" |
100
+ | {FIELD} | <= today | "{field_label} phải <= ngày hiện tại" |
101
+ | {FIELD} | Range(0-23) | "{field_label} phải từ 0-23" |
102
+ | {FIELD} | >= 0 | "{field_label} phải >= 0" |
103
+
104
+ **Response Format:**
105
+ ```json
106
+ // Success
107
+ { "success": true, "message": "OK", "data": { ... } }
108
+ // Error
109
+ { "success": false, "message": "Lỗi cụ thể", "data": null }
110
+ // Paginated
111
+ {
112
+ "success": true,
113
+ "data": {
114
+ "content": [{ ... }],
115
+ "totalElements": 100,
116
+ "totalPages": 5
117
+ }
118
+ }
119
+ ```
120
+
121
+ **Request Format chi tiết cho mỗi endpoint:**
122
+ **POST /api/{module}/list**
123
+ ```json
124
+ {
125
+ "FILTER_FIELD": "string",
126
+ "FROM_DATE": "yyyy-MM-dd",
127
+ "TO_DATE": "yyyy-MM-dd",
128
+ "page": 0,
129
+ "size": 20
130
+ }
131
+ ```
132
+
133
+ **POST /api/{module}/save**
134
+ ```json
135
+ {
136
+ "ID": null, // null = create, number = update
137
+ "FIELD_NAME": "value",
138
+ // ... all required fields
139
+ }
140
+ ```
141
+
142
+ **POST /api/{module}/delete**
143
+ ```json
144
+ {
145
+ "ID": 123
146
+ }
147
+ ```
148
+
149
+ #### 3. YÊU CẦU CHO FRONTEND
150
+ **Tasks cần làm:**
151
+ | # | Task | Mô tả | Priority |
152
+ |---|------|-------|----------|
153
+ | fe-01 | {Module}Service | HTTP service gọi {N} API endpoints | High |
154
+ | fe-02 | {Module}ListComponent | Trang danh sách + filter + pagination | High |
155
+ | fe-03 | {Module}FormComponent | Dialog form thêm/sửa | High |
156
+ | fe-04 | Routing + Menu | Thêm route + menu item | Medium |
157
+
158
+ **UI Requirements (từ spec):**
159
+ - **Filter bar:** {dropdown1}, {dropdown2}, {date range}
160
+ - **Table:** PrimeNG p-table, sortable, paginator
161
+ - **Form:** PrimeNG dialog, reactive forms, validation sync với BE
162
+ - **Actions:** Thêm (toolbar), Sửa (row button), Xóa (confirm dialog)
163
+ - **Export:** Excel export (nếu có trong spec)
164
+
165
+ **Dropdowns cần load:**
166
+ | Dropdown | API | Value field | Display field |
167
+ |----------|-----|-------------|---------------|
168
+ | {Dropdown name} | /api/{path} | {VALUE_ID} | {DISPLAY_NAME} |
169
+
170
+ #### 4. LƯU Ý ĐẶC BIỆT
171
+ - **ResponseData wrapper:** Luôn check `response.success` trước khi dùng `response.data`
172
+ - **Auth:** JWT token tự động gắn bởi HTTP interceptor — FE KHÔNG cần handle
173
+ - **Date format:** Server nhận `yyyy-MM-dd`, display trên FE `dd/MM/yyyy`
174
+ - **Audit fields:** (USER_CR_*, USER_MDF_*) → server tự set, FE KHÔNG cần gửi
175
+ - **Error handling:** Dùng `response.message` để hiển thị toast notification
176
+ - **Pagination:** PrimeNG LazyLoadEvent → map sang {page, size}
177
+
178
+ #### 5. HƯỚNG DẪN CHẠY
179
+ FE Agent mở project frontend:
180
+ 1. Đọc file: `.evnict/handoff/handoff.md` → tìm entry 🔴 Chờ xử lý
181
+ 2. Đọc API contract: `.evnict/handoff/contracts/{feature}-api.yaml`
182
+ 3. Chạy: `/evnict-kit:implement`
183
+ 4. Agent sẽ tự detect FE tasks từ handoff entry và implement
184
+ 5. Sau khi xong → update trạng thái entry thành 🟢 Đã xử lý
185
+
186
+ - **Kết quả xử lý:** _(FE Agent điền sau khi implement xong)_
187
+ ```
188
+
189
+ ### Bước 4: Sinh/Update API Contract YAML
190
+ Tạo hoặc cập nhật `.evnict/handoff/contracts/{feature}-api.yaml`:
191
+ - Dựa vào Controllers đã implement
192
+ - Format theo skill `evnict-kit-coordinate`
193
+
194
+ ### Bước 5: Update BE Status
195
+ Cập nhật `.evnict/handoff/be-status.md`:
196
+ ```markdown
197
+ # BE Status
198
+ status: done
199
+ feature: {feature-name}
200
+ completed_tasks: ["task-01", "task-02", ...]
201
+ api_contract: handoff/contracts/{feature}-api.yaml
202
+ handoff_entry: handoff/handoff.md (entry [{date}] BE→FE: {feature})
203
+ last_updated: {timestamp}
204
+ ```
205
+
206
+ ### Bước 6: Thông báo User
207
+ ```
208
+ ═══════════════════════════════════════════
209
+ ✅ Handoff: {Feature Name} — THÀNH CÔNG
210
+ ═══════════════════════════════════════════
211
+
212
+ 📄 Handoff entry: .evnict/handoff/handoff.md (🔴 Chờ xử lý)
213
+ 📜 API Contract: .evnict/handoff/contracts/{feature}-api.yaml
214
+ 📊 BE Status: .evnict/handoff/be-status.md → DONE
215
+
216
+ ───────────────────────────────────────────
217
+ 📋 Nội dung handoff entry:
218
+ Section 1: Tổng quan — {N} tasks hoàn thành
219
+ Section 2: API Contract — {M} endpoints
220
+ Section 3: FE Tasks — {K} tasks cần làm
221
+ Section 4: Lưu ý đặc biệt
222
+ Section 5: Hướng dẫn chạy
223
+
224
+ ───────────────────────────────────────────
225
+ 🔄 Thao tác tiếp:
226
+ 1. Chuyển sang IDE/workspace của project Frontend
227
+ 2. Mở Agent và paste:
228
+ "Backend đã Handoff xong feature {feature-name}.
229
+ Đọc .evnict/handoff/handoff.md
230
+ để implement FE tasks."
231
+ ═══════════════════════════════════════════
232
+ ```
233
+
234
+ ---
235
+
236
+ ## Tiêu chí thành công (Definition of Done)
237
+ 1. Handoff entry có ĐỦ 5 sections (tổng quan, API contract, FE tasks, lưu ý, hướng dẫn)
238
+ 2. Entry được APPEND vào `handoff.md` (không tạo file riêng)
239
+ 3. DTO → TypeScript interface mapping chính xác
240
+ 4. Validation rules sync table đầy đủ
241
+ 5. API Contract YAML file tồn tại và đầy đủ endpoints
242
+ 6. BE Status file updated → `status: done`
243
+ 7. User nhận được thông báo rõ ràng để chuyển workspace
@@ -0,0 +1,247 @@
1
+ ---
2
+ description: Implement TDD per subtask từ plan đã approve. MANDATORY STOP-AND-ASK sau mỗi task — Agent KHÔNG được tự chạy task tiếp. Đọc task files → TDD cycle → commit → STOP → user approve → next task.
3
+ ---
4
+
5
+ # Implement
6
+ **Command:** `/evnict-kit:implement`
7
+
8
+ ## Khi nào dùng
9
+ - Sau khi plan đã được user approve (từ feature-large hoặc feature-small)
10
+ - Implement từng task theo thứ tự dependency
11
+ - **MỖI task phải có user approval trước khi chuyển sang task tiếp**
12
+
13
+ ## Input
14
+ - Path đến plan: `.evnict/specs/{feature-slug}/plan.md`
15
+ - Hoặc: `/evnict-kit:implement` (tự detect plan từ current feature)
16
+
17
+ ---
18
+
19
+ ## ═══════════════════════════════════════════
20
+ ## QUY TẮC BẮT BUỘC: STOP-AND-ASK
21
+ ## ═══════════════════════════════════════════
22
+
23
+ ### Sau MỖI subtask hoàn thành, Agent PHẢI DỪNG và hiển thị:
24
+
25
+ ```
26
+ ═══════════════════════════════════════════
27
+ ✅ Task {N}/{Total}: {task_name} — HOÀN THÀNH
28
+ ═══════════════════════════════════════════
29
+
30
+ 📁 Files tạo/sửa:
31
+ + src/.../FileA.java (NEW — {X} lines)
32
+ ~ src/.../FileB.java (MODIFIED — {Y} lines changed)
33
+
34
+ 🧪 Tests: {pass}/{total} passed
35
+ 📏 Lint: ✅ passed | ❌ {N} issues
36
+ 🔨 Build: ✅ passed | ❌ failed
37
+ 📝 Commit: feat({module}): {description} [task-{NN}]
38
+
39
+ ───────────────────────────────────────────
40
+ ❓ Bạn muốn làm gì tiếp?
41
+
42
+ A) ✅ Approve — chuyển sang Task {N+1}: {next_task_name}
43
+ B) 👀 Review code — tôi sẽ hiển thị code và chờ feedback
44
+ C) 🔄 Yêu cầu sửa — mô tả cần sửa gì
45
+ D) ⏸️ Tạm dừng — lưu progress, tiếp tục sau
46
+ E) ❌ Hủy task này — rollback commit
47
+ F) 🚀 Auto-approve — chạy hết tasks còn lại KHÔNG hỏi nữa
48
+ ⚠️ Chỉ dùng khi đã review 2-3 tasks đầu và tin tưởng pattern
49
+
50
+ Chọn (A/B/C/D/E/F):
51
+ ═══════════════════════════════════════════
52
+ ```
53
+
54
+ ### TUYỆT ĐỐI KHÔNG được:
55
+ - ❌ Tự động chạy task tiếp mà không hỏi user
56
+ - ❌ Skip phần hiển thị kết quả (files, tests, lint, build, commit)
57
+ - ❌ Gộp nhiều tasks thành 1 lần chạy
58
+ - ❌ Bỏ qua test/lint/build results trong output
59
+
60
+ ---
61
+
62
+ ### Xử lý từng Option
63
+
64
+ #### Option A — Approve
65
+ Chuyển sang task tiếp theo. Nếu đây là task cuối → chuyển sang Bước 4: Final Verify.
66
+
67
+ #### Option B — Review Code
68
+ Agent PHẢI hiển thị code cho mỗi file đã tạo/sửa:
69
+ ```
70
+ 📄 {FileName.java} ({NEW|MODIFIED}):
71
+ ─────────────────────────────
72
+ {Hiển thị toàn bộ code nếu NEW}
73
+ {Hiển thị diff nếu MODIFIED}
74
+ ─────────────────────────────
75
+
76
+ 📄 {FileName2.java} ({NEW|MODIFIED}):
77
+ ─────────────────────────────
78
+ {Code/Diff}
79
+ ─────────────────────────────
80
+
81
+ Bạn có feedback gì không? (Gõ feedback hoặc "OK" để approve)
82
+ ```
83
+
84
+ Sau khi user gõ "OK" → xử lý như Option A.
85
+ Sau khi user gõ feedback → xử lý như Option C.
86
+
87
+ #### Option C — Yêu cầu sửa
88
+ 1. Đọc feedback của user
89
+ 2. Sửa code theo feedback
90
+ 3. Chạy lại test → lint → build
91
+ 4. Amend commit: `git commit --amend -m "..."`
92
+ 5. Hiển thị lại STOP-AND-ASK với kết quả mới
93
+
94
+ #### Option D — Tạm dừng
95
+ Lưu progress vào `.evnict/specs/{feature}/progress.md`:
96
+ ```markdown
97
+ # Progress: {feature}
98
+ ## Status: PAUSED
99
+ ## Completed: {N}/{Total}
100
+ ## Last updated: {timestamp}
101
+
102
+ ### Tasks
103
+ - [x] Task 01: {name} — commit: {hash}
104
+ - [x] Task 02: {name} — commit: {hash}
105
+ - [ ] Task 03: {name} ← NEXT
106
+ - [ ] Task 04: {name}
107
+ - [ ] ...
108
+
109
+ ### Resume
110
+ Chạy: `/evnict-kit:implement`
111
+ Agent sẽ auto-detect progress file và tiếp tục từ Task 03.
112
+ ```
113
+
114
+ Hiển thị:
115
+ ```
116
+ ⏸️ Progress đã lưu: .evnict/specs/{feature}/progress.md
117
+ Hoàn thành: {N}/{Total} tasks
118
+ Task tiếp: {N+1}: {name}
119
+ Resume: chạy /evnict-kit:implement
120
+ ```
121
+
122
+ #### Option E — Hủy + Rollback
123
+ 1. `git revert HEAD` (revert commit cuối)
124
+ 2. Xóa files đã tạo trong task này
125
+ 3. Cập nhật plan.md — đánh dấu task chưa hoàn thành
126
+ 4. Hỏi user: "Muốn thử lại task này hay chuyển sang task khác?"
127
+
128
+ #### Option F — Auto-approve
129
+ 1. Hiển thị cảnh báo:
130
+ ```
131
+ ⚠️ AUTO-APPROVE MODE
132
+ Tất cả tasks còn lại sẽ chạy liên tục KHÔNG hỏi.
133
+ Agent vẫn DỪNG nếu: test fail, build fail, hoặc 3-strike rule.
134
+
135
+ Tiếp tục? (Y/N)
136
+ ```
137
+ 2. Nếu Y → chạy tất cả tasks còn lại, mỗi task vẫn hiển thị kết quả (nhưng không hỏi)
138
+ 3. Nếu gặp lỗi (test fail, build fail) → TỰ ĐỘNG quay lại mode STOP-AND-ASK
139
+ 4. Sau khi tất cả tasks xong → hiển thị Final Summary (Bước 5)
140
+
141
+ ---
142
+
143
+ ## Pre-conditions
144
+ 1. Plan đã được user approve
145
+ 2. Working tree clean: `git status`
146
+ 3. Feature branch đã tạo
147
+
148
+ ## Bước 1: Đọc Plan + Check Resume
149
+ ```bash
150
+ cat .evnict/specs/{feature}/plan.md
151
+ ls .evnict/specs/{feature}/tasks/
152
+ ```
153
+
154
+ ### Resume Logic
155
+ Kiểm tra `.evnict/specs/{feature}/progress.md`:
156
+ - **Nếu tồn tại** → Đọc progress, hiển thị:
157
+ ```
158
+ 📋 Phát hiện progress đã lưu:
159
+ Hoàn thành: {N}/{Total} tasks
160
+ Task tiếp: {N+1}: {name}
161
+
162
+ Tiếp tục từ Task {N+1}? (Y/N)
163
+ ```
164
+ - Y → skip các tasks đã hoàn thành, bắt đầu từ task tiếp
165
+ - N → bắt đầu lại từ đầu (xác nhận trước: "Sẽ reset progress. Chắc chắn?")
166
+ - **Nếu không tồn tại** → bắt đầu từ Task 01
167
+
168
+ Xác định thứ tự thực hiện và dependencies.
169
+
170
+ ## Bước 2: Với MỖI task (theo thứ tự)
171
+
172
+ ### 2a: Đọc task spec
173
+ ```bash
174
+ cat .evnict/specs/{feature}/tasks/{NN}-{name}.md
175
+ ```
176
+
177
+ ### 2b: TDD Cycle
178
+ Gọi skill `evnict-kit-tdd`:
179
+ 1. **[RED]** Viết test → FAIL
180
+ 2. **[GREEN]** Code tối thiểu → PASS
181
+ 3. **Verify** lint + build
182
+ 4. **[REFACTOR]** Cải thiện (test vẫn PASS)
183
+
184
+ ### 2c: Commit
185
+ ```bash
186
+ git add .
187
+ git commit -m "feat({module}): {task description} [task-{NN}]"
188
+ ```
189
+
190
+ ### 2d: Update task status
191
+ Đánh dấu task hoàn thành trong plan.md.
192
+
193
+ ### 2e: Update handoff (nếu BE→FE)
194
+ Gọi skill `evnict-kit-coordinate` → publish contract khi BE tasks done.
195
+
196
+ ### ══ 2f: MANDATORY STOP — STOP-AND-ASK ══
197
+ **DỪNG ĐÂY.** Hiển thị kết quả và hỏi user (xem format ở đầu file).
198
+ **KHÔNG ĐƯỢC** tự động chuyển sang task tiếp.
199
+ Chỉ chuyển khi user chọn A, hoặc đang ở Auto-approve mode (F).
200
+
201
+ ## Bước 3: 3-Strike Rule
202
+ Test fail > 3 lần cho cùng 1 task → **DỪNG NGAY**.
203
+ - Nếu đang ở Auto-approve mode → TỰ ĐỘNG thoát auto-approve, quay lại STOP-AND-ASK.
204
+
205
+ ## Bước 4: Final Verify
206
+ ```bash
207
+ ./mvnw test && ./mvnw spotless:check && ./mvnw compile
208
+ ```
209
+
210
+ ## Bước 5: Final Summary
211
+ ```markdown
212
+ ═══════════════════════════════════════════
213
+ ✅ IMPLEMENTATION COMPLETE
214
+ ═══════════════════════════════════════════
215
+
216
+ 📋 Feature: {feature_name}
217
+ 📁 Tasks completed: {N}/{total}
218
+
219
+ 📝 Commits:
220
+ {hash1} feat({module}): {desc} [task-01]
221
+ {hash2} feat({module}): {desc} [task-02]
222
+ ...
223
+
224
+ 🧪 Tests: {total_tests} pass
225
+ 🔨 Build: ✅ OK
226
+ 📏 Lint: ✅ OK
227
+
228
+ ───────────────────────────────────────────
229
+ ❓ Tiếp theo:
230
+ A) /evnict-kit:review — code review
231
+ B) /evnict-kit:handoff — chuyển sang FE/BE
232
+ C) /evnict-kit:archive-wiki — lưu wiki + archive
233
+ ═══════════════════════════════════════════
234
+ ```
235
+
236
+ ---
237
+
238
+ ## Checklist
239
+ - [ ] Plan confirmed
240
+ - [ ] Resume logic checked (progress.md)
241
+ - [ ] All tasks implemented (TDD)
242
+ - [ ] STOP-AND-ASK enforced sau MỖI task
243
+ - [ ] All tests pass
244
+ - [ ] Build OK
245
+ - [ ] Handoff updated (nếu BE→FE)
246
+ - [ ] No 3-strike violations
247
+ - [ ] Final Summary hiển thị
@@ -0,0 +1,76 @@
1
+ ---
2
+ description: Agent sinh demo code để verify setup — tạo sample API + component để test rules, conventions, workflows.
3
+ ---
4
+
5
+ # Init Check — Verify Setup
6
+ **Command:** `/evnict-kit:init-check`
7
+
8
+ ## Mục đích
9
+ Sinh demo code nhỏ để verify rằng rules, conventions, workflows hoạt động đúng.
10
+
11
+ ## Pre-conditions
12
+ - `/evnict-kit:init-rules` đã chạy
13
+ - `/evnict-kit:init-context` đã chạy
14
+ - AGENTS.md tồn tại
15
+
16
+ ---
17
+
18
+ ## Workflow
19
+
20
+ ### Bước 1: Tạo demo branch
21
+ ```bash
22
+ git checkout -b demo/init-check
23
+ ```
24
+
25
+ ### Bước 2: Backend — Sinh sample API
26
+ Gọi skill `evnict-kit-create-api` tạo API đơn giản:
27
+ - GET /api/demo/health → return status
28
+ - POST /api/demo/echo → echo request body
29
+
30
+ Verify:
31
+ - [ ] DTO có validation annotations
32
+ - [ ] Service có @Transactional
33
+ - [ ] Controller return ResponseData
34
+ - [ ] Tests viết và pass
35
+
36
+ ### Bước 3: Frontend — Sinh sample component
37
+ Gọi skill `evnict-kit-create-component`:
38
+ - DemoComponent: hiển thị data từ /api/demo/health
39
+
40
+ Verify:
41
+ - [ ] Component trong shared/
42
+ - [ ] i18n keys
43
+ - [ ] Loading/error states
44
+ - [ ] takeUntil pattern
45
+
46
+ ### Bước 4: Security Check
47
+ Gọi skill `evnict-kit-security-audit` scope=module(demo):
48
+ - Verify no security violations
49
+
50
+ ### Bước 5: Report
51
+ ```markdown
52
+ ## ✅ Init Check Report
53
+ | Check | Status |
54
+ |-------|--------|
55
+ | Rules loaded | ✅ |
56
+ | Conventions applied | ✅ |
57
+ | Backend demo API | ✅ |
58
+ | Frontend demo component | ✅ |
59
+ | Security scan | ✅ |
60
+ | Tests pass | ✅ |
61
+ | Build OK | ✅ |
62
+
63
+ ## Setup is READY! 🎉
64
+ Next: Xóa demo branch hoặc giữ làm reference.
65
+ ```
66
+
67
+ ### Bước 6: Cleanup option
68
+ ```bash
69
+ git checkout main
70
+ git branch -D demo/init-check
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Output
76
+ Demo code + verification report. User quyết định giữ hoặc xóa demo.
@@ -0,0 +1,58 @@
1
+ ---
2
+ description: Agent sinh AGENTS.md context file từ rules đã khởi tạo + codebase analysis.
3
+ ---
4
+
5
+ # Init Context — Sinh AGENTS.md
6
+ **Command:** `/evnict-kit:init-context`
7
+
8
+ ## Mục đích
9
+ Đọc rules đã khởi tạo (RP01-RP07) + scan codebase → sinh file AGENTS.md đầy đủ ở root project.
10
+
11
+ ## Pre-conditions
12
+ - `/evnict-kit:init-rules` đã chạy thành công
13
+ - File `05-evnict-kit-project-conventions.md` đã có nội dung (không còn placeholders)
14
+
15
+ ---
16
+
17
+ ## Workflow
18
+
19
+ ### Bước 1: Thu thập context
20
+ 1. Đọc `.evnict/config.yaml` → project info
21
+ 2. Đọc `05-evnict-kit-project-conventions.md` → conventions
22
+ 3. Đọc `.agent/context/init-summary-*.md` → scan results
23
+ 4. Scan codebase: `tree -L 3`, pom.xml/package.json, config files
24
+
25
+ ### Bước 2: Sinh AGENTS.md
26
+ Tạo file AGENTS.md ở root project (400-600 dòng) với sections:
27
+
28
+ 1. **Project Overview** — tên, mô tả, tech stack
29
+ 2. **Architecture Diagram** — ASCII art
30
+ 3. **Tech Stack Table** — framework, library, version
31
+ 4. **Project Structure** — tree view
32
+ 5. **Development Commands** — build, test, run
33
+ 6. **Coding Conventions Summary** — tóm tắt từ rules
34
+ 7. **API Conventions** — endpoint patterns, response format
35
+ 8. **Database Conventions** — naming, migration
36
+ 9. **Security Rules Summary** — critical rules
37
+ 10. **Agent Commands** — available workflows/skills
38
+ 11. **Safety Rules** — no push, no secrets, no PII
39
+ 12. **Integration Map** — external services
40
+
41
+ ### Bước 3: Validate
42
+ - [ ] File 400-600 dòng
43
+ - [ ] Architecture diagram included
44
+ - [ ] Tech stack complete
45
+ - [ ] Commands accurate
46
+ - [ ] No secrets/IPs
47
+
48
+ ### Bước 4: Confirm
49
+ ```
50
+ ✅ AGENTS.md created: {line count} lines
51
+ 📋 Sections: 12
52
+ 🔒 Security: verified (no secrets)
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Output
58
+ File `AGENTS.md` ở root project — context file duy nhất cho AI Agent.