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