evnict-kit 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +360 -10
- package/bin/cli.js +28 -14
- package/package.json +4 -2
- package/scripts/convert-claude-commands.js +51 -0
- package/scripts/generate-templates.js +119 -0
- package/scripts/patch-workflows.js +142 -0
- package/scripts/postinstall.js +41 -0
- package/src/commands/doctor.js +197 -0
- package/src/commands/info.js +189 -0
- package/src/commands/init.js +7 -7
- package/src/commands/sync.js +317 -0
- package/src/commands/upgrade.js +131 -0
- package/src/utils/config.js +2 -2
- package/templates/GETTING-STARTED.md +23 -2
- package/templates/skills/evnict-kit-create-component/SKILL.md +23 -0
- package/templates/skills/evnict-kit-create-page/SKILL.md +23 -0
- package/templates/skills/evnict-kit-frontend-design/SKILL.md +161 -0
- package/templates/workflows/antigravity/evnict-kit-archive-wiki.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-attt.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-bug-fix.md +23 -0
- package/templates/workflows/antigravity/evnict-kit-feature-large.md +24 -0
- package/templates/workflows/antigravity/evnict-kit-feature-small.md +23 -0
- package/templates/workflows/antigravity/evnict-kit-handoff.md +23 -0
- package/templates/workflows/antigravity/evnict-kit-implement.md +23 -0
- package/templates/workflows/antigravity/evnict-kit-init-check.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-init-context.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-init-rules.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-init-wiki.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-plan.md +24 -0
- package/templates/workflows/antigravity/evnict-kit-review.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-spec-archive.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-wiki-archive-feature.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-wiki-query.md +20 -0
- package/templates/workflows/antigravity/evnict-kit-wiki-scan-project.md +20 -0
- package/templates/workflows/claude/evnict-kit-archive-wiki.md +20 -0
- package/templates/workflows/claude/evnict-kit-attt.md +20 -0
- package/templates/workflows/claude/evnict-kit-bug-fix.md +23 -0
- package/templates/workflows/claude/evnict-kit-feature-large.md +24 -0
- package/templates/workflows/claude/evnict-kit-feature-small.md +23 -0
- package/templates/workflows/claude/evnict-kit-handoff.md +23 -0
- package/templates/workflows/claude/evnict-kit-implement.md +23 -0
- package/templates/workflows/claude/evnict-kit-init-check.md +20 -0
- package/templates/workflows/claude/evnict-kit-init-context.md +20 -0
- package/templates/workflows/claude/evnict-kit-init-rules.md +20 -0
- package/templates/workflows/claude/evnict-kit-init-wiki.md +20 -0
- package/templates/workflows/claude/evnict-kit-plan.md +24 -0
- package/templates/workflows/claude/evnict-kit-review.md +20 -0
- package/templates/workflows/claude/evnict-kit-spec-archive.md +20 -0
- package/templates/workflows/claude/evnict-kit-wiki-archive-feature.md +20 -0
- package/templates/workflows/claude/evnict-kit-wiki-query.md +20 -0
- package/templates/workflows/claude/evnict-kit-wiki-scan-project.md +20 -0
- package/src/commands/init-check.js +0 -19
- package/src/commands/init-context.js +0 -37
- package/src/commands/init-rules.js +0 -42
- package/src/commands/init-workflow.js +0 -36
package/README.md
CHANGED
|
@@ -1,19 +1,369 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
> Tích hợp OpenSpec (SDD) + TDD Workflow + LLM Wiki
|
|
3
|
+
# 🚀 EVNICT-KIT
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
### AI-Assisted Development Toolkit
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/evnict-kit)
|
|
8
|
+
[](https://nodejs.org)
|
|
9
|
+
[](https://www.npmjs.com/package/evnict-kit)
|
|
10
|
+
[](https://www.npmjs.com/package/evnict-kit)
|
|
11
|
+
|
|
12
|
+
**Bộ công cụ chuẩn hóa phát triển phần mềm với AI Agent — theo QĐ-TTPM**
|
|
13
|
+
|
|
14
|
+
*Tích hợp Rules Engine · Skills Framework · TDD Workflows · Wiki Knowledge Base · Multi-Tool Support*
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
[Cài đặt](#-cài-đặt) · [Quick Start](#-quick-start) · [Tính năng](#-tính-năng) · [Workflows](#-danh-sách-workflows) · [Multi-Tool](#-multi-tool-support) · [CLI Commands](#-cli-commands)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 📦 Cài đặt
|
|
7
25
|
|
|
8
26
|
```bash
|
|
9
27
|
npm install -g evnict-kit
|
|
10
|
-
cd /path/to/workspace # chứa cmis-be/ và cmis-fe/
|
|
11
|
-
evnict-kit init --name=cmis --be=cmis-be --fe=cmis-fe
|
|
12
28
|
```
|
|
13
29
|
|
|
14
|
-
|
|
30
|
+
Kiểm tra cài đặt:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
evnict-kit --version # Xem phiên bản hiện tại
|
|
34
|
+
evnict-kit doctor # Kiểm tra môi trường & cập nhật
|
|
35
|
+
evnict-kit info # Thống kê chi tiết về toolkit
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
> **Yêu cầu:** Node.js >= 18.0.0
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## ⚡ Quick Start
|
|
43
|
+
|
|
44
|
+
### 1. Khởi tạo workspace
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
cd /path/to/workspace # Thư mục chứa các project BE, FE
|
|
48
|
+
evnict-kit init --name=myapp --be=myapp-be --fe=myapp-fe
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Setup AI Agent trong từng project
|
|
52
|
+
|
|
53
|
+
Mở AI Agent (Antigravity / Claude / Cursor / ...) trong thư mục project, sau đó gõ:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
/evnict-kit:init-rules # Agent quét code → tự sinh coding rules
|
|
57
|
+
/evnict-kit:init-context # Agent sinh context file (AGENTS.md)
|
|
58
|
+
/evnict-kit:init-wiki # Setup wiki repo tri thức
|
|
59
|
+
/evnict-kit:wiki-scan-project # Scan code → nạp wiki lần đầu
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3. Bắt đầu phát triển
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
/evnict-kit:feature-large "Mô tả tính năng" # Feature lớn (BE+FE+DB)
|
|
66
|
+
/evnict-kit:feature-small "Mô tả" # Feature nhỏ (sửa UI, thêm field)
|
|
67
|
+
/evnict-kit:bug-fix "Mô tả bug" # Sửa bug với TDD
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 🎯 Tính năng
|
|
73
|
+
|
|
74
|
+
### 🧠 Rules Engine — 5 Rule Sets
|
|
75
|
+
|
|
76
|
+
| Rule File | Nội dung |
|
|
77
|
+
|-----------|----------|
|
|
78
|
+
| `01-general-rules` | Quy tắc chung — git flow, commit convention, code style |
|
|
79
|
+
| `02-security-rules` | ATTT — OWASP, input validation, auth/authz |
|
|
80
|
+
| `03-backend-conventions` | BE — Spring Boot / ASP.NET / Java EE patterns |
|
|
81
|
+
| `04-frontend-conventions` | FE — Angular / React component & state patterns |
|
|
82
|
+
| `05-project-conventions` | Project-specific — Agent tự scan & bổ sung |
|
|
83
|
+
|
|
84
|
+
### 🛠️ Skills Framework — 22 Skills
|
|
85
|
+
|
|
86
|
+
Kỹ năng chuyên biệt giúp Agent thực thi chính xác:
|
|
87
|
+
|
|
88
|
+
| Nhóm | Skills |
|
|
89
|
+
|------|--------|
|
|
90
|
+
| **Development** | `create-api` · `create-component` · `create-page` · `database-migration` |
|
|
91
|
+
| **Quality** | `code-review` · `tdd` · `bug-fix` · `fix-business-logic` · `fix-attt` |
|
|
92
|
+
| **Process** | `brainstorm` · `spec` · `checkpoint` · `coordinate` · `prompt-standard` |
|
|
93
|
+
| **Git** | `finish-branch` · `merge-checklist` · `git-worktrees` · `receiving-review` |
|
|
94
|
+
| **Knowledge** | `wiki` · `onboard` · `doc-postmortem` · `security-audit` |
|
|
95
|
+
|
|
96
|
+
### 📋 Workflows — 17 Quy trình
|
|
97
|
+
|
|
98
|
+
Quy trình từng bước, Agent thực thi tự động:
|
|
99
|
+
|
|
100
|
+
| Workflow | Mô tả |
|
|
101
|
+
|----------|-------|
|
|
102
|
+
| `feature-large` | Brainstorm → Spec → Plan → Implement → Review |
|
|
103
|
+
| `feature-small` | Query wiki → Plan nhanh → Implement |
|
|
104
|
+
| `bug-fix` | Classify → Root cause → TDD fix |
|
|
105
|
+
| `plan` | Sinh plan + task files chi tiết |
|
|
106
|
+
| `implement` | TDD per subtask (STOP-AND-ASK) |
|
|
107
|
+
| `handoff` | Trao đổi giữa BE ↔ FE Agents |
|
|
108
|
+
| `review` | Auto review trước merge |
|
|
109
|
+
| `attt` | Quét & fix lỗi bảo mật |
|
|
110
|
+
| `wiki-scan-project` | Scan code → nạp wiki tri thức |
|
|
111
|
+
| `wiki-archive-feature` | Nạp tri thức feature vào wiki |
|
|
112
|
+
| `wiki-query` | Tìm thông tin trong wiki |
|
|
113
|
+
| `init-rules` / `init-context` / `init-check` / `init-wiki` | Setup ban đầu |
|
|
114
|
+
| `spec-archive` | Lưu trữ specification |
|
|
115
|
+
|
|
116
|
+
### 📚 Wiki — Knowledge Base
|
|
117
|
+
|
|
118
|
+
Hệ thống tri thức dùng chung giữa các Agent (BE + FE qua symlink):
|
|
119
|
+
|
|
120
|
+
- **Scan & Ingest**: Quét code tự động → sinh wiki notes
|
|
121
|
+
- **Query**: Tìm kiếm tri thức trước khi code
|
|
122
|
+
- **Archive**: Nạp tri thức sau mỗi feature/bugfix
|
|
123
|
+
- **Handoff Protocol**: Trao đổi file `handoff.md` giữa các Agent
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 🔧 Multi-Tool Support
|
|
128
|
+
|
|
129
|
+
EVNICT-KIT hỗ trợ **5 AI coding tools** — cùng hệ tri thức, khác format deploy:
|
|
130
|
+
|
|
131
|
+
| Tool | Agent Dir | Context File | Deploy Mode |
|
|
132
|
+
|------|-----------|-------------|-------------|
|
|
133
|
+
| **Antigravity** (default) | `.agent/` | `AGENTS.md` | Rules + Skills + Workflows |
|
|
134
|
+
| **Claude Code** | `.claude/` | `CLAUDE.md` | Mega-file + Commands |
|
|
135
|
+
| **Cursor** | `.cursor/` | `.cursorrules` | Rules only (`.mdc`) |
|
|
136
|
+
| **GitHub Copilot** | `.github/` | `copilot-instructions.md` | Single file |
|
|
137
|
+
| **OpenAI Codex** | `.agent/` | `AGENTS.md` | Rules + Skills + Workflows |
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Chọn tool khi init
|
|
141
|
+
evnict-kit init --name=myapp --tool=claude
|
|
142
|
+
evnict-kit init --name=myapp --tool=cursor
|
|
143
|
+
|
|
144
|
+
# Hoặc thay đổi tool cho project đã init
|
|
145
|
+
evnict-kit init-rules --tool=cursor
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 💻 CLI Commands
|
|
151
|
+
|
|
152
|
+
### Lệnh chính (Terminal)
|
|
153
|
+
|
|
154
|
+
| Lệnh | Mô tả |
|
|
155
|
+
|-------|-------|
|
|
156
|
+
| `evnict-kit init` | Khởi tạo workspace — interactive wizard hoặc flags |
|
|
157
|
+
| `evnict-kit add <folder>` | Thêm project vào workspace đã init |
|
|
158
|
+
| `evnict-kit doctor` | 🩺 Kiểm tra môi trường, phiên bản, cập nhật |
|
|
159
|
+
| `evnict-kit info` | 📊 Thống kê chi tiết toolkit |
|
|
160
|
+
| `evnict-kit upgrade` | 🔄 Kiểm tra & cập nhật phiên bản mới nhất |
|
|
161
|
+
| `evnict-kit sync` | 🔄 Re-deploy templates vào các project — ghi đè files evnict-kit, giữ nguyên files user |
|
|
162
|
+
|
|
163
|
+
### Lệnh Agent (gõ trong AI Agent chat)
|
|
164
|
+
|
|
165
|
+
| Lệnh | Mô tả |
|
|
166
|
+
|-------|-------|
|
|
167
|
+
| `/evnict-kit:init-rules` | Agent quét code → điền conventions |
|
|
168
|
+
| `/evnict-kit:init-context` | Agent sinh AGENTS.md |
|
|
169
|
+
| `/evnict-kit:init-check` | Agent sinh demo code verify |
|
|
170
|
+
| `/evnict-kit:init-wiki` | Setup wiki repo |
|
|
171
|
+
| `/evnict-kit:feature-large "..."` | Phát triển feature lớn |
|
|
172
|
+
| `/evnict-kit:feature-small "..."` | Phát triển feature nhỏ |
|
|
173
|
+
| `/evnict-kit:bug-fix "..."` | Sửa bug với TDD |
|
|
174
|
+
| `/evnict-kit:plan` | Sinh plan chi tiết |
|
|
175
|
+
| `/evnict-kit:implement` | TDD implement |
|
|
176
|
+
| `/evnict-kit:handoff` | Chuyển giao BE ↔ FE |
|
|
177
|
+
| `/evnict-kit:review` | Auto review |
|
|
178
|
+
| `/evnict-kit:attt` | Kiểm tra ATTT |
|
|
179
|
+
| `/evnict-kit:wiki-query "..."` | Tìm tri thức |
|
|
180
|
+
| `/evnict-kit:wiki-scan-project` | Scan code → wiki |
|
|
181
|
+
| `/evnict-kit:wiki-archive-feature` | Nạp tri thức feature |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 📐 Kiến trúc
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
evnict-kit/
|
|
189
|
+
├── bin/cli.js # CLI entry point (Commander.js)
|
|
190
|
+
├── src/
|
|
191
|
+
│ ├── commands/ # CLI command handlers
|
|
192
|
+
│ │ ├── init.js # Interactive wizard + workspace setup
|
|
193
|
+
│ │ ├── add.js # Thêm project vào workspace
|
|
194
|
+
│ │ ├── doctor.js # Health check & version check
|
|
195
|
+
│ │ ├── info.js # Toolkit statistics
|
|
196
|
+
│ │ └── upgrade.js # Auto-upgrade
|
|
197
|
+
│ └── utils/
|
|
198
|
+
│ ├── config.js # Config loader + TOOL_MAP
|
|
199
|
+
│ └── file.js # File utilities
|
|
200
|
+
└── templates/
|
|
201
|
+
├── content/ # Tool-agnostic content (source of truth)
|
|
202
|
+
│ ├── rules/ # 5 rule files
|
|
203
|
+
│ ├── skills/ # 22 skill folders
|
|
204
|
+
│ └── workflows/ # 17 workflow files
|
|
205
|
+
├── rules/ # Tool-specific formatted rules
|
|
206
|
+
│ ├── antigravity/ # .md files
|
|
207
|
+
│ ├── claude/ # Mega-file sections
|
|
208
|
+
│ └── cursor/ # .mdc files
|
|
209
|
+
├── workflows/ # Tool-specific formatted workflows
|
|
210
|
+
├── skills/ # Tool-specific formatted skills
|
|
211
|
+
├── context/ # Context file templates
|
|
212
|
+
├── instruct/ # Instruction templates
|
|
213
|
+
├── wiki/ # Wiki scaffold (MIT — llm-wiki)
|
|
214
|
+
└── GETTING-STARTED.md # User guide (deployed vào project)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 🔄 Luồng làm việc
|
|
220
|
+
|
|
221
|
+
### Feature Development (Full)
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
feature-large → plan → implement → handoff → review → wiki-archive-feature
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Feature Development (Quick)
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
feature-small → implement → wiki-archive-feature (optional)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Bug Fix
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
bug-fix → implement fix → wiki-archive-feature (optional)
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Workspace Setup
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
evnict-kit init → init-rules → init-context → init-check → init-wiki → wiki-scan-project
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Handoff Protocol (BE ↔ FE)
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
BE: /evnict-kit:handoff → sinh entry 🔴 Chờ xử lý
|
|
249
|
+
FE: Đọc handoff.md → implement → update 🟢 Đã xử lý
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## ⚙️ Options Reference
|
|
255
|
+
|
|
256
|
+
### `evnict-kit init`
|
|
257
|
+
|
|
258
|
+
| Flag | Mô tả | Default |
|
|
259
|
+
|------|-------|---------|
|
|
260
|
+
| `--name <n>` | Tên dự án | *(interactive)* |
|
|
261
|
+
| `--be <folder>` | Folder backend | `<name>-be` |
|
|
262
|
+
| `--fe <folder>` | Folder frontend | `<name>-fe` |
|
|
263
|
+
| `--tool <tool>` | AI tool | `antigravity` |
|
|
264
|
+
| `--tech-be <tech>` | `springboot\|aspnet\|javaee` | `springboot` |
|
|
265
|
+
| `--tech-fe <tech>` | `angular\|react-web\|react-mobile` | `angular` |
|
|
266
|
+
| `--db <db>` | `oracle\|sqlserver` | `oracle` |
|
|
267
|
+
| `--no-wiki` | Không setup wiki | `false` |
|
|
268
|
+
| `--no-interactive` | Non-interactive mode | `false` |
|
|
269
|
+
|
|
270
|
+
### `evnict-kit add <folder>`
|
|
271
|
+
|
|
272
|
+
| Flag | Mô tả |
|
|
273
|
+
|------|-------|
|
|
274
|
+
| `--type <type>` | `backend\|frontend` |
|
|
275
|
+
| `--tech <tech>` | `springboot\|angular\|react-web\|...` |
|
|
276
|
+
| `--tool <tool>` | Override AI tool |
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 📊 Stats
|
|
281
|
+
|
|
282
|
+
| Metric | Count |
|
|
283
|
+
|--------|-------|
|
|
284
|
+
| Rule Sets | 5 |
|
|
285
|
+
| Skills | 23 |
|
|
286
|
+
| Workflows | 17 |
|
|
287
|
+
| Supported AI Tools | 5 |
|
|
288
|
+
| Tech Stacks (BE) | SpringBoot · ASP.NET · Java EE |
|
|
289
|
+
| Tech Stacks (FE) | Angular · React Web · React Native |
|
|
290
|
+
| Databases | Oracle · SQL Server |
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## 🆘 Troubleshooting
|
|
295
|
+
|
|
296
|
+
| Vấn đề | Giải pháp |
|
|
297
|
+
|---------|-----------|
|
|
298
|
+
| Agent không hiểu lệnh | Kiểm tra file workflow trong `.agent/workflows/` |
|
|
299
|
+
| Wiki không truy cập | Check symlink: `ls -la <project>-wiki/` |
|
|
300
|
+
| Handoff không thấy | Check `.evnict/handoff/handoff.md` |
|
|
301
|
+
| Muốn thêm project | `evnict-kit add <folder>` |
|
|
302
|
+
| Wiki trống sau init | Chạy `/evnict-kit:wiki-scan-project` |
|
|
303
|
+
| Cần update toolkit | `evnict-kit doctor` hoặc `npm update -g evnict-kit` |
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## 📜 Changelog
|
|
308
|
+
|
|
309
|
+
### v0.2.3 (Current)
|
|
310
|
+
- 🎨 **Frontend Design Skill**: Skill mới `evnict-kit-frontend-design` — hướng dẫn tư duy thiết kế UI chất lượng cao cho Angular, tránh "AI slop" aesthetics
|
|
311
|
+
- 🧠 **Context Refresh**: Thêm section "Tuân thủ Rules & Context" vào TẤT CẢ 36 workflows/skills — cơ chế smart check (chỉ đọc lại nếu chưa đọc, tiết kiệm token)
|
|
312
|
+
- 🎯 **FE Design Hint**: 6 workflows có code FE được bổ sung nhắc tham chiếu skill frontend-design
|
|
313
|
+
- 🔄 **Sync Command**: Lệnh `evnict-kit sync` — re-deploy templates khi upgrade version, không xóa files user tự thêm
|
|
314
|
+
- 📦 Hỗ trợ cả Antigravity + Claude workflows
|
|
315
|
+
|
|
316
|
+
### v0.2.2
|
|
317
|
+
- 🧹 Removed obsolete standalone commands (`init-rules`, `init-context`, `init-workflow`, `init-check`)
|
|
318
|
+
- 🩺 `doctor` command: health check, version check, workspace status
|
|
319
|
+
- 📊 `info` command: toolkit statistics dashboard
|
|
320
|
+
- 🔄 `upgrade` command: check & auto-upgrade to latest
|
|
321
|
+
- 🎨 Post-install banner on `npm install`
|
|
322
|
+
|
|
323
|
+
### v0.2.1
|
|
324
|
+
- ✨ Multi-tool support: Antigravity, Claude, Cursor, Copilot, Codex
|
|
325
|
+
- 📚 Wiki system: scan-project, archive-feature, query
|
|
326
|
+
- 🤝 Handoff protocol: BE ↔ FE standardized
|
|
327
|
+
- 📖 GETTING-STARTED.md: comprehensive user guide
|
|
328
|
+
- 🩺 `doctor` & `info` CLI commands
|
|
329
|
+
|
|
330
|
+
### v0.1.6
|
|
331
|
+
- 📚 Wiki workflows: archive-feature, scan-project, query
|
|
332
|
+
- 🤝 Standardized Handoff protocol (single `handoff.md`)
|
|
333
|
+
- 📖 GETTING-STARTED.md user guide
|
|
334
|
+
|
|
335
|
+
### v0.1.5
|
|
336
|
+
- 🔐 Security rules & ATTT workflows
|
|
337
|
+
- 📋 TDD workflow improvements
|
|
338
|
+
|
|
339
|
+
### v0.1.4
|
|
340
|
+
- 🔧 Multi-repo support (array format)
|
|
341
|
+
- ➕ `evnict-kit add` command
|
|
342
|
+
|
|
343
|
+
### v0.1.3
|
|
344
|
+
- 🚀 Initial release — Rules, Skills, Workflows
|
|
345
|
+
- 🧙 Interactive wizard
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## 📄 License
|
|
350
|
+
|
|
351
|
+
**UNLICENSED** — Internal use only (EVNICT — Trung tâm Phát triển Phần mềm)
|
|
352
|
+
|
|
353
|
+
### Third-party
|
|
354
|
+
|
|
355
|
+
| Package | License | Note |
|
|
356
|
+
|---------|---------|------|
|
|
357
|
+
| [llm-wiki](https://github.com/mduongvandinh/llm-wiki) | MIT | Minimal scaffold bundled in `templates/wiki/` |
|
|
358
|
+
| [Commander.js](https://github.com/tj/commander.js) | MIT | CLI framework |
|
|
359
|
+
| [js-yaml](https://github.com/nodeca/js-yaml) | MIT | YAML parser |
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
<div align="center">
|
|
364
|
+
|
|
365
|
+
**Made with ❤️ by EVNICT — Trung tâm Phát triển Phần mềm**
|
|
15
366
|
|
|
16
|
-
|
|
367
|
+
*Nâng cao năng suất phát triển phần mềm với AI Agent*
|
|
17
368
|
|
|
18
|
-
|
|
19
|
-
## License: UNLICENSED (EVNICT internal)
|
|
369
|
+
</div>
|
package/bin/cli.js
CHANGED
|
@@ -2,37 +2,51 @@
|
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { initCommand } from '../src/commands/init.js';
|
|
4
4
|
import { addCommand } from '../src/commands/add.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { doctorCommand } from '../src/commands/doctor.js';
|
|
6
|
+
import { infoCommand } from '../src/commands/info.js';
|
|
7
|
+
import { upgradeCommand } from '../src/commands/upgrade.js';
|
|
8
|
+
import { syncCommand } from '../src/commands/sync.js';
|
|
9
9
|
|
|
10
10
|
const program = new Command();
|
|
11
|
-
program.name('evnict-kit').description('EVNICT AI-Assisted Development Toolkit v0.2.
|
|
11
|
+
program.name('evnict-kit').description('EVNICT AI-Assisted Development Toolkit v0.2.3').version('0.2.3');
|
|
12
12
|
|
|
13
13
|
program.command('init')
|
|
14
|
-
.description('
|
|
15
|
-
.option('--name <n>', '
|
|
14
|
+
.description('Khoi tao workspace + deploy rules/skills/workflows vao tung project')
|
|
15
|
+
.option('--name <n>', 'Ten du an (neu bo qua -> interactive wizard)')
|
|
16
16
|
.option('--be <folder>', 'Folder backend (default: <n>-be)')
|
|
17
17
|
.option('--fe <folder>', 'Folder frontend (default: <n>-fe)')
|
|
18
18
|
.option('--tool <tool>', 'AI tool: antigravity|claude|cursor|copilot|codex', 'antigravity')
|
|
19
19
|
.option('--tech-be <tech>', 'springboot|aspnet|javaee', 'springboot')
|
|
20
20
|
.option('--tech-fe <tech>', 'angular|react-web|react-mobile', 'angular')
|
|
21
21
|
.option('--db <db>', 'oracle|sqlserver', 'oracle')
|
|
22
|
-
.option('--no-wiki', '
|
|
23
|
-
.option('--no-interactive', '
|
|
22
|
+
.option('--no-wiki', 'Khong setup wiki')
|
|
23
|
+
.option('--no-interactive', 'Bat buoc chay non-interactive (can --name)')
|
|
24
24
|
.action(initCommand);
|
|
25
25
|
|
|
26
26
|
program.command('add <folder>')
|
|
27
|
-
.description('
|
|
27
|
+
.description('Them 1 project vao workspace da init (deploy rules/skills/workflows + symlinks)')
|
|
28
28
|
.option('--type <type>', 'backend|frontend')
|
|
29
29
|
.option('--tech <tech>', 'springboot|angular|react-web|react-mobile|aspnet')
|
|
30
30
|
.option('--tool <tool>', 'AI tool override')
|
|
31
31
|
.action(addCommand);
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
program.command('
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
// ── Utility Commands ──
|
|
34
|
+
program.command('doctor')
|
|
35
|
+
.description('Check environment, version, updates - health check')
|
|
36
|
+
.action(doctorCommand);
|
|
37
|
+
|
|
38
|
+
program.command('info')
|
|
39
|
+
.description('Show toolkit statistics - rules, skills, workflows, tools')
|
|
40
|
+
.action(infoCommand);
|
|
41
|
+
|
|
42
|
+
program.command('upgrade')
|
|
43
|
+
.description('Check and upgrade to latest version')
|
|
44
|
+
.option('-y, --yes', 'Auto-confirm upgrade')
|
|
45
|
+
.action(upgradeCommand);
|
|
46
|
+
|
|
47
|
+
program.command('sync')
|
|
48
|
+
.description('Re-deploy templates (workflows/skills/rules) vao cac project da init — ghi de files evnict-kit, giu nguyen files user')
|
|
49
|
+
.option('-y, --yes', 'Auto-confirm sync (khong hoi)')
|
|
50
|
+
.action(syncCommand);
|
|
37
51
|
|
|
38
52
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "evnict-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "EVNICT AI-Assisted Development Toolkit - Bộ công cụ hỗ trợ phát triển phần mềm với AI theo quy định QĐ-TTPM",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"bin/",
|
|
11
11
|
"src/",
|
|
12
12
|
"templates/",
|
|
13
|
+
"scripts/",
|
|
13
14
|
"README.md"
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
16
17
|
"test": "node test/test.js",
|
|
17
|
-
"link": "npm link"
|
|
18
|
+
"link": "npm link",
|
|
19
|
+
"postinstall": "node scripts/postinstall.js || true"
|
|
18
20
|
},
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"commander": "^12.1.0",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Convert Antigravity workflows to Claude Code commands format
|
|
2
|
+
// Run: node scripts/convert-claude-commands.js
|
|
3
|
+
|
|
4
|
+
import { readFileSync, writeFileSync, readdirSync, mkdirSync, existsSync } from 'node:fs';
|
|
5
|
+
import { join, dirname } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
const ROOT = join(__dirname, '..');
|
|
11
|
+
|
|
12
|
+
const srcDir = join(ROOT, 'templates/workflows/antigravity');
|
|
13
|
+
const destDir = join(ROOT, 'templates/workflows/claude');
|
|
14
|
+
|
|
15
|
+
if (!existsSync(destDir)) mkdirSync(destDir, { recursive: true });
|
|
16
|
+
|
|
17
|
+
const files = readdirSync(srcDir).filter(f => f.endsWith('.md'));
|
|
18
|
+
|
|
19
|
+
for (const file of files) {
|
|
20
|
+
let content = readFileSync(join(srcDir, file), 'utf8');
|
|
21
|
+
|
|
22
|
+
// Remove frontmatter (--- ... ---)
|
|
23
|
+
content = content.replace(/^---\n[\s\S]*?\n---\n\n?/, '');
|
|
24
|
+
|
|
25
|
+
// Extract command name from filename: evnict-kit-feature-large.md → feature-large
|
|
26
|
+
const slug = file.replace('evnict-kit-', '').replace('.md', '');
|
|
27
|
+
|
|
28
|
+
// Find the first # heading
|
|
29
|
+
const firstHeadingMatch = content.match(/^# (.+)$/m);
|
|
30
|
+
const title = firstHeadingMatch ? firstHeadingMatch[1] : slug;
|
|
31
|
+
|
|
32
|
+
// Add $ARGUMENTS handling after the command line
|
|
33
|
+
const commandLineRegex = /\*\*Command:\*\* `\/evnict-kit:[^`]+`/;
|
|
34
|
+
if (commandLineRegex.test(content)) {
|
|
35
|
+
content = content.replace(
|
|
36
|
+
commandLineRegex,
|
|
37
|
+
`**Command:** \`/evnict-kit:${slug} $ARGUMENTS\`\n\n$ARGUMENTS chứa mô tả từ user.`
|
|
38
|
+
);
|
|
39
|
+
} else {
|
|
40
|
+
// If no command line found, add after first heading
|
|
41
|
+
content = content.replace(
|
|
42
|
+
/^(# .+)$/m,
|
|
43
|
+
`$1\n**Command:** \`/evnict-kit:${slug} $ARGUMENTS\`\n\n$ARGUMENTS chứa mô tả từ user.`
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
writeFileSync(join(destDir, file), content, 'utf8');
|
|
48
|
+
console.log(`✅ ${file} → claude commands`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log(`\nDone: ${files.length} commands converted to ${destDir}`);
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { join, dirname } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const T = join(__dirname, '..', 'templates');
|
|
7
|
+
function w(p, c) { const f=join(T,p); mkdirSync(dirname(f),{recursive:true}); writeFileSync(f,c,'utf8'); console.log(` ✅ ${p}`); }
|
|
8
|
+
|
|
9
|
+
console.log('🔧 evnict-kit v0.1.2 templates\n');
|
|
10
|
+
|
|
11
|
+
// ══ RULES COMMON R01-R08 ══
|
|
12
|
+
w('rules/common/evnict-kit-R01-no-hardcoded-secrets.md',`---\nid: R01\nname: No Hardcoded Secrets\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# R01: No Hardcoded Secrets\nCấm hardcode API keys, passwords, tokens, connection strings.\nDùng env variables hoặc secret manager.\nGrep: password\\s*=\\s*", secret\\s*=, key\\s*=\\s*", token\\s*=\\s*"\nĐã commit secret → rotate NGAY → thông báo Tech Lead.\n`);
|
|
13
|
+
w('rules/common/evnict-kit-R02-no-auto-git-push.md',`---\nid: R02\nname: No Auto Git Push\nseverity: HIGH\nstatus: ACTIVE\n---\n# R02: No Auto Git Push\nAgent KHÔNG git push/force/merge vào protected branch.\nĐược phép: add, commit (feature branch), checkout -b, stash, pull, diff.\n`);
|
|
14
|
+
w('rules/common/evnict-kit-R03-no-destructive-ops.md',`---\nid: R03\nname: No Destructive Operations\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# R03: No Destructive Operations\nAgent KHÔNG xóa file/folder, drop DB, chmod mà không có xác nhận user.\n`);
|
|
15
|
+
w('rules/common/evnict-kit-R04-no-pii-in-logs.md',`---\nid: R04\nname: No PII in Logs\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# R04: No PII in Logs\nKHÔNG log: password, token, JWT, CMND, SĐT, email, thẻ ngân hàng, data khách hàng EVN.\nLog ID thay vì data.\n`);
|
|
16
|
+
w('rules/common/evnict-kit-R05-test-before-commit.md',`---\nid: R05\nname: Test Before Commit\nseverity: HIGH\nstatus: ACTIVE\n---\n# R05: Test Before Commit\nMọi thay đổi PHẢI: linter pass, unit test pass, build OK, không warning mới.\n`);
|
|
17
|
+
w('rules/common/evnict-kit-R06-minimal-diff.md',`---\nid: R06\nname: Minimal Diff\nseverity: MEDIUM\nstatus: ACTIVE\n---\n# R06: Minimal Diff — Chống Vibe Coding\nChỉ thay đổi code CẦN THIẾT. Sửa cùng chỗ >3 lần → DỪNG.\n`);
|
|
18
|
+
w('rules/common/evnict-kit-R07-no-placeholder-code.md',`---\nid: R07\nname: No Placeholder Code\nseverity: MEDIUM\nstatus: ACTIVE\n---\n# R07: No Placeholder Code\nCấm TODO, FIXME, placeholder. Implement đầy đủ hoặc throw exception.\n`);
|
|
19
|
+
w('rules/common/evnict-kit-R08-respect-gitignore.md',`---\nid: R08\nname: Respect .gitignore\nseverity: MEDIUM\nstatus: ACTIVE\n---\n# R08: Respect .gitignore\nKHÔNG tạo/sửa/commit file trong .gitignore.\n`);
|
|
20
|
+
|
|
21
|
+
// ══ RULES BACKEND RB01-RB06 ══
|
|
22
|
+
w('rules/backend/evnict-kit-RB01-input-validation.md',`---\nid: RB01\nname: Input Validation\nseverity: HIGH\nstatus: ACTIVE\n---\n# RB01: Input Validation\nMọi endpoint PHẢI validate input. @Valid + DTO annotations.\n`);
|
|
23
|
+
w('rules/backend/evnict-kit-RB02-sql-injection-prevention.md',`---\nid: RB02\nname: SQL Injection Prevention\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# RB02: SQL Injection Prevention\nCẤM nối chuỗi SQL. Dùng parameterized/ORM/JOOQ type-safe.\n`);
|
|
24
|
+
w('rules/backend/evnict-kit-RB03-error-handling.md',`---\nid: RB03\nname: Error Handling\nseverity: HIGH\nstatus: ACTIVE\n---\n# RB03: Error Handling\nMọi endpoint có error handling. KHÔNG lộ stack trace.\n`);
|
|
25
|
+
w('rules/backend/evnict-kit-RB04-migration-only.md',`---\nid: RB04\nname: Migration Only\nseverity: HIGH\nstatus: ACTIVE\n---\n# RB04: Migration Only\nThay đổi DB schema PHẢI qua migration. Naming: V{YYYYMMDD}_{SEQ}__{desc}.sql\n`);
|
|
26
|
+
w('rules/backend/evnict-kit-RB05-auth-on-every-route.md',`---\nid: RB05\nname: Auth on Every Route\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# RB05: Auth on Every Route\nMọi endpoint MỚI PHẢI có auth + authorization.\n`);
|
|
27
|
+
w('rules/backend/evnict-kit-RB06-rate-limiting.md',`---\nid: RB06\nname: Rate Limiting\nseverity: MEDIUM\nstatus: ACTIVE\n---\n# RB06: Rate Limiting\nEndpoint public/heavy PHẢI xem xét rate limiting.\n`);
|
|
28
|
+
|
|
29
|
+
// ══ RULES FRONTEND RF01-RF06 ══
|
|
30
|
+
w('rules/frontend/evnict-kit-RF01-no-inline-styles.md',`---\nid: RF01\nname: No Inline Styles\nseverity: MEDIUM\nstatus: ACTIVE\n---\n# RF01: No Inline Styles\nCấm inline CSS. Dùng class.\n`);
|
|
31
|
+
w('rules/frontend/evnict-kit-RF02-component-reuse.md',`---\nid: RF02\nname: Component Reuse\nseverity: MEDIUM\nstatus: ACTIVE\n---\n# RF02: Component Reuse\nCheck component có sẵn trước khi tạo mới.\n`);
|
|
32
|
+
w('rules/frontend/evnict-kit-RF03-no-hardcoded-text.md',`---\nid: RF03\nname: No Hardcoded Text\nseverity: LOW\nstatus: ACTIVE\n---\n# RF03: No Hardcoded Text\nCó i18n → dùng translation keys. Không → constants file.\n`);
|
|
33
|
+
w('rules/frontend/evnict-kit-RF04-accessibility.md',`---\nid: RF04\nname: Accessibility\nseverity: MEDIUM\nstatus: ACTIVE\n---\n# RF04: Accessibility\nimg→alt, button→aria-label, input→label, semantic HTML.\n`);
|
|
34
|
+
w('rules/frontend/evnict-kit-RF05-no-direct-dom.md',`---\nid: RF05\nname: No Direct DOM\nseverity: MEDIUM\nstatus: ACTIVE\n---\n# RF05: No Direct DOM\nCẤM document.getElementById. Dùng ViewChild/refs.\n`);
|
|
35
|
+
w('rules/frontend/evnict-kit-RF06-responsive-design.md',`---\nid: RF06\nname: Responsive Design\nseverity: MEDIUM\nstatus: ACTIVE\n---\n# RF06: Responsive\nĐúng trên mobile(<768), tablet(768-1024), desktop(>1024).\n`);
|
|
36
|
+
|
|
37
|
+
// ══ RULES SECURITY ATTT01-08 ══
|
|
38
|
+
w('rules/security/evnict-kit-ATTT01-sql-injection.md',`---\nid: ATTT01\nname: SQL Injection Deep Scan\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# ATTT01: SQL Injection Scan\ngrep -rn "query.*+.*\\"\\|createNativeQuery.*+\\|DSL.field(.*+" --include="*.java" src/\n`);
|
|
39
|
+
w('rules/security/evnict-kit-ATTT02-xss-prevention.md',`---\nid: ATTT02\nname: XSS Prevention\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# ATTT02: XSS Scan\ngrep -rn "innerHTML\\|bypassSecurityTrust\\|dangerouslySetInnerHTML" src/\n`);
|
|
40
|
+
w('rules/security/evnict-kit-ATTT03-csrf-protection.md',`---\nid: ATTT03\nseverity: HIGH\nstatus: ACTIVE\n---\n# ATTT03: CSRF Protection\nPOST/PUT/DELETE PHẢI có CSRF token hoặc SameSite cookie.\n`);
|
|
41
|
+
w('rules/security/evnict-kit-ATTT04-jwt-security.md',`---\nid: ATTT04\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# ATTT04: JWT Security\nRS256/RS512, key≥2048, exp≤24h, refresh rotation, no sensitive data in payload.\n`);
|
|
42
|
+
w('rules/security/evnict-kit-ATTT05-dependency-cve.md',`---\nid: ATTT05\nseverity: HIGH\nstatus: ACTIVE\n---\n# ATTT05: Dependency CVE\nJava: mvnw dependency-check | Node: npm audit | .NET: dotnet list --vulnerable\nCritical→24h | High→sprint | Medium→next sprint\n`);
|
|
43
|
+
w('rules/security/evnict-kit-ATTT06-file-upload.md',`---\nid: ATTT06\nseverity: HIGH\nstatus: ACTIVE\n---\n# ATTT06: File Upload Security\nValidate ext+MIME+magic bytes+size. UUID rename. Lưu MinIO/S3 ngoài web root.\n`);
|
|
44
|
+
w('rules/security/evnict-kit-ATTT07-data-exposure.md',`---\nid: ATTT07\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# ATTT07: Data Exposure\nDùng DTO—KHÔNG return Entity. Error: message chung, KHÔNG stack trace.\n`);
|
|
45
|
+
w('rules/security/evnict-kit-ATTT08-owasp-top10.md',`---\nid: ATTT08\nseverity: CRITICAL\nstatus: ACTIVE\n---\n# ATTT08: OWASP Top 10 Checklist\nA01 Access→RB05 | A02 Crypto→ATTT04 | A03 Inject→RB02 | A04 Design→ATTT06\nA05 Config→R01 | A06 Components→ATTT05 | A07 Auth→RB05 | A08 Integrity→RB04\nA09 Logging→R04 | A10 SSRF\n`);
|
|
46
|
+
|
|
47
|
+
// ══ RULES DYNAMIC (CHƯA KHỞI TẠO) ══
|
|
48
|
+
const PH=`⚠️ CHƯA ĐƯỢC KHỞI TẠO — chạy /evnict-kit:init-rules để AI Agent điền nội dung`;
|
|
49
|
+
w('rules/project/evnict-kit-RP01-naming-convention.md',`---\nid: RP01\nname: Naming Convention\nstatus: CHƯA_KHỞI_TẠO\n---\n# RP01: Naming Convention\n${PH}\n## Sẽ chứa: class, method, variable, file, package, branch, commit, DB table/column naming\n`);
|
|
50
|
+
w('rules/project/evnict-kit-RP02-architecture-pattern.md',`---\nid: RP02\nname: Architecture Pattern\nstatus: CHƯA_KHỞI_TẠO\n---\n# RP02: Architecture\n${PH}\n## Sẽ chứa: kiến trúc tổng thể, package structure, dependency flow, decisions\n`);
|
|
51
|
+
w('rules/project/evnict-kit-RP03-coding-convention.md',`---\nid: RP03\nname: Coding Convention\nstatus: CHƯA_KHỞI_TẠO\n---\n# RP03: Coding Convention\n${PH}\n## Sẽ chứa: code style, import order, error handling, logging, DTO patterns\n`);
|
|
52
|
+
w('rules/project/evnict-kit-RP04-api-convention.md',`---\nid: RP04\nname: API Convention\nstatus: CHƯA_KHỞI_TẠO\n---\n# RP04: API Convention\n${PH}\n## Sẽ chứa: REST URL, request/response format, pagination, error format\n`);
|
|
53
|
+
w('rules/project/evnict-kit-RP05-database-convention.md',`---\nid: RP05\nname: Database Convention\nstatus: CHƯA_KHỞI_TẠO\n---\n# RP05: Database Convention\n${PH}\n## Sẽ chứa: table/column naming, ORM/JOOQ patterns, FK naming\n`);
|
|
54
|
+
w('rules/project/evnict-kit-RP06-component-convention.md',`---\nid: RP06\nname: Component Convention\nstatus: CHƯA_KHỞI_TẠO\n---\n# RP06: Component Convention\n${PH}\n## Sẽ chứa: component structure, state management, form handling, UI library\n`);
|
|
55
|
+
w('rules/project/evnict-kit-RP07-integration-map.md',`---\nid: RP07\nname: Integration Map\nstatus: CHƯA_KHỞI_TẠO\n---\n# RP07: Integration Map\n${PH}\n## Sẽ chứa: external services, API clients, message queues, scheduled jobs\n`);
|
|
56
|
+
|
|
57
|
+
w('rules/INDEX.md',`# EVNICT-KIT Rules Index v0.1.2\n## Static (28): R01-R08, RB01-RB06, RF01-RF06, ATTT01-ATTT08\n## Dynamic (7): RP01-RP07 — chạy /evnict-kit:init-rules để khởi tạo\n`);
|
|
58
|
+
|
|
59
|
+
console.log('✅ Rules done\n');
|
|
60
|
+
|
|
61
|
+
// ══ SKILLS (20 files) ══
|
|
62
|
+
const skills = [
|
|
63
|
+
['evnict-kit-create-api-endpoint','Tạo API endpoint chuẩn — validation, auth, error handling, test','backend'],
|
|
64
|
+
['evnict-kit-create-component','Tạo UI component — check reuse, props, styling, test, a11y','frontend'],
|
|
65
|
+
['evnict-kit-create-page','Tạo page/màn hình — routing, layout, responsive, loading states','frontend'],
|
|
66
|
+
['evnict-kit-database-migration','Tạo migration an toàn — V{date}_{seq}__{desc}.sql + rollback','backend'],
|
|
67
|
+
['evnict-kit-write-tests','Viết test TDD — Red→Green→Refactor, unit + integration','both'],
|
|
68
|
+
['evnict-kit-code-review','Code review checklist — security, logic, quality, vibe coding','both'],
|
|
69
|
+
['evnict-kit-bug-fix','Sửa bug — reproduce, root cause, TDD fix, regression test','both'],
|
|
70
|
+
['evnict-kit-fix-business-logic','Fix lỗi nghiệp vụ — verify business rules, test scenarios','both'],
|
|
71
|
+
['evnict-kit-security-audit','Security audit OWASP Top 10, dependency scan','both'],
|
|
72
|
+
['evnict-kit-fix-attt','Fix lỗi ATTT — classify, hotfix, OWASP fix, security review','both'],
|
|
73
|
+
['evnict-kit-checkpoint','Checkpoint & rollback plan trước khi dùng AI (QĐ Mục 8.8)','both'],
|
|
74
|
+
['evnict-kit-doc-postmortem','Tài liệu đặc tả sau AI session (QĐ Mục 8.9)','both'],
|
|
75
|
+
['evnict-kit-merge-checklist','Pre-merge checklist (QĐ Mục 8.10)','both'],
|
|
76
|
+
['evnict-kit-prompt-standard','Chuẩn viết prompt cho AI Agent (QĐ Mục 8.5)','both'],
|
|
77
|
+
['evnict-kit-onboard','Onboarding member mới — tóm tắt project từ wiki+context','both'],
|
|
78
|
+
['evnict-kit-wiki','Push/Query tri thức LLM Wiki — không cần mở wiki repo','both'],
|
|
79
|
+
['evnict-kit-spec','Tạo spec SDD — specify+clarify, propose plan','both'],
|
|
80
|
+
['evnict-kit-tdd','TDD per subtask — test→implement→verify, 3-strike rule','both'],
|
|
81
|
+
['evnict-kit-coordinate','FE↔BE coordination qua handoff files + API contracts','both'],
|
|
82
|
+
['evnict-kit-review-auto','Auto review trước merge — check rules, ATTT, conventions','both'],
|
|
83
|
+
];
|
|
84
|
+
for(const [name,desc,scope] of skills){
|
|
85
|
+
w(`skills/${name}/SKILL.md`,`---\nname: ${name}\ndescription: ${desc}\nscope: ${scope}\n---\n# ${name}\n${desc}\n`);
|
|
86
|
+
}
|
|
87
|
+
console.log(`✅ Skills: ${skills.length}\n`);
|
|
88
|
+
|
|
89
|
+
// ══ WORKFLOWS (10 files) ══
|
|
90
|
+
const workflows = [
|
|
91
|
+
['init/evnict-kit-init-rules','evnict-kit:init-rules','Agent đọc code, điền rules động RP01-RP07'],
|
|
92
|
+
['init/evnict-kit-init-context','evnict-kit:init-context','Agent sinh context file từ rules đã khởi tạo'],
|
|
93
|
+
['init/evnict-kit-init-check','evnict-kit:init-check','Sinh demo code để verify conventions'],
|
|
94
|
+
['work/evnict-kit-feature-large','evnict-kit:feature-large','Feature lớn: spec→plan→TDD→archive'],
|
|
95
|
+
['work/evnict-kit-feature-small','evnict-kit:feature-small','Feature nhỏ: wiki query→plan→TDD→archive'],
|
|
96
|
+
['work/evnict-kit-bug-fix','evnict-kit:bug-fix','Bug fix: wiki→analyze→TDD fix→archive'],
|
|
97
|
+
['work/evnict-kit-attt','evnict-kit:attt','ATTT scan/check module'],
|
|
98
|
+
['work/evnict-kit-implement','evnict-kit:implement','Thực thi tasks TDD, FE↔BE coordination'],
|
|
99
|
+
['work/evnict-kit-archive-wiki','evnict-kit:archive-wiki','Push wiki + archive spec + postmortem'],
|
|
100
|
+
['work/evnict-kit-review','evnict-kit:review','Auto review: rules + ATTT + conventions'],
|
|
101
|
+
];
|
|
102
|
+
for(const [path,trigger,desc] of workflows){
|
|
103
|
+
w(`workflows/${path}.md`,`---\nname: ${trigger}\ntype: workflow-command\ndescription: ${desc}\ntrigger: /${trigger}\n---\n# /${trigger}\n${desc}\n`);
|
|
104
|
+
}
|
|
105
|
+
console.log(`✅ Workflows: ${workflows.length}\n`);
|
|
106
|
+
|
|
107
|
+
// ══ CONTEXT TEMPLATES ══
|
|
108
|
+
w('context/AGENT.md.template',`# {{PROJECT_NAME}} — AI Agent Context\n# Generated by evnict-kit v0.1.2\n## Overview: {{TECH_STACK}} | {{DATABASE}}\n## Structure: <!-- CHƯA KHỞI TẠO -->\n## Commands: <!-- CHƯA KHỞI TẠO -->\n## Conventions: → rules/project/RP03\n## Architecture: → rules/project/RP02\n## Security: → rules/ (R01,RB02,RB05,ATTT01-08)\n## Safety: ❌ git push | ❌ xóa file | ❌ secrets | ❌ log PII\n`);
|
|
109
|
+
w('context/CLAUDE.md.template',`# {{PROJECT_NAME}} — Claude Code\n# Generated by evnict-kit v0.1.2\n## {{TECH_STACK}} | {{DATABASE}}\n## Rules: .claude/rules/ | ❌ push ❌ secrets ❌ PII\n<!-- CHƯA KHỞI TẠO — /evnict-kit:init-context -->\n`);
|
|
110
|
+
w('context/cursorrules.template',`# {{PROJECT_NAME}} | {{TECH_STACK}} | evnict-kit v0.1.2\n# Rules: .cursor/rules/ | ❌ push ❌ secrets ❌ PII\n<!-- CHƯA KHỞI TẠO -->\n`);
|
|
111
|
+
|
|
112
|
+
// ══ INSTRUCT TEMPLATES ══
|
|
113
|
+
w('instruct/Instruct-Agent-AI.be.md',`# Instruct-Agent-AI.md — Backend\n# Project: {{PROJECT_NAME}} | Tech: {{TECH_STACK}} | DB: {{DATABASE}}\n\n## Khi nhận /evnict-kit:init-rules:\n### Task 1: Scan structure → tree -L 3\n### Task 2: Naming → cập nhật RP01 → ACTIVE\n### Task 3: Architecture → cập nhật RP02 → ACTIVE\n### Task 4: Coding convention → cập nhật RP03 → ACTIVE\n### Task 5: API convention → cập nhật RP04 → ACTIVE\n### Task 6: Database convention → cập nhật RP05 → ACTIVE\n### Task 7: Integrations → cập nhật RP07 → ACTIVE\n### Task 8: Summary → {{AGENT_DIR}}/context/init-summary-backend.md\n\n## Bảo mật: KHÔNG ghi secrets, IP nội bộ, URLs production\n`);
|
|
114
|
+
w('instruct/Instruct-Agent-AI.fe.md',`# Instruct-Agent-AI.md — Frontend\n# Project: {{PROJECT_NAME}} | Tech: {{TECH_STACK}}\n\n## Khi nhận /evnict-kit:init-rules:\n### Task 1: Scan structure\n### Task 2: Naming → RP01 → ACTIVE\n### Task 3: Architecture → RP02 → ACTIVE\n### Task 4: Coding convention → RP03 → ACTIVE\n### Task 5: Component convention → RP06 → ACTIVE\n### Task 6: Integrations → RP07 → ACTIVE\n### Task 7: Summary → {{AGENT_DIR}}/context/init-summary-frontend.md\n`);
|
|
115
|
+
|
|
116
|
+
console.log('═══════════════════════════════════════');
|
|
117
|
+
console.log(' 🎉 v0.1.2 complete!');
|
|
118
|
+
console.log(` Rules: 36 | Skills: ${skills.length} | Workflows: ${workflows.length}`);
|
|
119
|
+
console.log('═══════════════════════════════════════\n');
|