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.
- package/README.md +19 -0
- package/bin/cli.js +38 -0
- package/package.json +48 -0
- package/src/commands/add.js +129 -0
- package/src/commands/init-check.js +19 -0
- package/src/commands/init-context.js +37 -0
- package/src/commands/init-rules.js +42 -0
- package/src/commands/init-workflow.js +36 -0
- package/src/commands/init.js +722 -0
- package/src/utils/config.js +167 -0
- package/src/utils/file.js +53 -0
- package/templates/GETTING-STARTED.md +196 -0
- package/templates/content/context/AGENTS.md.template +462 -0
- package/templates/content/rules/01-evnict-kit-general-rules.md +303 -0
- package/templates/content/rules/02-evnict-kit-security-rules.md +423 -0
- package/templates/content/rules/03-evnict-kit-backend-conventions.md +383 -0
- package/templates/content/rules/04-evnict-kit-frontend-conventions.md +402 -0
- package/templates/content/rules/05-evnict-kit-project-conventions.md +228 -0
- package/templates/content/skills/evnict-kit-brainstorm/SKILL.md +140 -0
- package/templates/content/skills/evnict-kit-bug-fix/SKILL.md +108 -0
- package/templates/content/skills/evnict-kit-checkpoint/SKILL.md +156 -0
- package/templates/content/skills/evnict-kit-code-review/SKILL.md +158 -0
- package/templates/content/skills/evnict-kit-coordinate/SKILL.md +274 -0
- package/templates/content/skills/evnict-kit-create-api/SKILL.md +281 -0
- package/templates/content/skills/evnict-kit-create-component/SKILL.md +263 -0
- package/templates/content/skills/evnict-kit-create-page/SKILL.md +247 -0
- package/templates/content/skills/evnict-kit-database-migration/SKILL.md +164 -0
- package/templates/content/skills/evnict-kit-doc-postmortem/SKILL.md +93 -0
- package/templates/content/skills/evnict-kit-finish-branch/SKILL.md +87 -0
- package/templates/content/skills/evnict-kit-fix-attt/SKILL.md +129 -0
- package/templates/content/skills/evnict-kit-fix-business-logic/SKILL.md +89 -0
- package/templates/content/skills/evnict-kit-git-worktrees/SKILL.md +104 -0
- package/templates/content/skills/evnict-kit-merge-checklist/SKILL.md +108 -0
- package/templates/content/skills/evnict-kit-onboard/SKILL.md +143 -0
- package/templates/content/skills/evnict-kit-prompt-standard/SKILL.md +103 -0
- package/templates/content/skills/evnict-kit-receiving-review/SKILL.md +89 -0
- package/templates/content/skills/evnict-kit-security-audit/SKILL.md +190 -0
- package/templates/content/skills/evnict-kit-spec/SKILL.md +237 -0
- package/templates/content/skills/evnict-kit-tdd/SKILL.md +413 -0
- package/templates/content/skills/evnict-kit-wiki/SKILL.md +412 -0
- package/templates/content/workflows/evnict-kit-archive-wiki.md +100 -0
- package/templates/content/workflows/evnict-kit-attt.md +100 -0
- package/templates/content/workflows/evnict-kit-bug-fix.md +107 -0
- package/templates/content/workflows/evnict-kit-feature-large.md +393 -0
- package/templates/content/workflows/evnict-kit-feature-small.md +86 -0
- package/templates/content/workflows/evnict-kit-handoff.md +243 -0
- package/templates/content/workflows/evnict-kit-implement.md +247 -0
- package/templates/content/workflows/evnict-kit-init-check.md +76 -0
- package/templates/content/workflows/evnict-kit-init-context.md +58 -0
- package/templates/content/workflows/evnict-kit-init-rules.md +114 -0
- package/templates/content/workflows/evnict-kit-init-wiki.md +80 -0
- package/templates/content/workflows/evnict-kit-plan.md +308 -0
- package/templates/content/workflows/evnict-kit-review.md +53 -0
- package/templates/content/workflows/evnict-kit-spec-archive.md +53 -0
- package/templates/content/workflows/evnict-kit-wiki-archive-feature.md +164 -0
- package/templates/content/workflows/evnict-kit-wiki-query.md +91 -0
- package/templates/content/workflows/evnict-kit-wiki-scan-project.md +272 -0
- package/templates/context/AGENT.md.template +9 -0
- package/templates/context/AGENTS.md.template +462 -0
- package/templates/context/CLAUDE.md.template +301 -0
- package/templates/context/copilot-instructions.md.template +60 -0
- package/templates/context/cursorrules.template +114 -0
- package/templates/instruct/Instruct-Agent-AI.be.md +96 -0
- package/templates/instruct/Instruct-Agent-AI.fe.md +79 -0
- package/templates/rules/antigravity/01-evnict-kit-general-rules.md +303 -0
- package/templates/rules/antigravity/02-evnict-kit-security-rules.md +423 -0
- package/templates/rules/antigravity/03-evnict-kit-backend-conventions.md +383 -0
- package/templates/rules/antigravity/04-evnict-kit-frontend-conventions.md +402 -0
- package/templates/rules/antigravity/05-evnict-kit-project-conventions.md +228 -0
- package/templates/rules/claude/README.md +8 -0
- package/templates/rules/cursor/01-evnict-kit-general-rules.mdc +46 -0
- package/templates/rules/cursor/02-evnict-kit-security-rules.mdc +46 -0
- package/templates/rules/cursor/03-evnict-kit-backend-conventions.mdc +50 -0
- package/templates/rules/cursor/04-evnict-kit-frontend-conventions.mdc +43 -0
- package/templates/rules/cursor/05-evnict-kit-project-conventions.mdc +63 -0
- package/templates/rules/cursor/README.md +7 -0
- package/templates/skills/evnict-kit-brainstorm/SKILL.md +140 -0
- package/templates/skills/evnict-kit-bug-fix/SKILL.md +108 -0
- package/templates/skills/evnict-kit-checkpoint/SKILL.md +156 -0
- package/templates/skills/evnict-kit-code-review/SKILL.md +158 -0
- package/templates/skills/evnict-kit-coordinate/SKILL.md +274 -0
- package/templates/skills/evnict-kit-create-api/SKILL.md +281 -0
- package/templates/skills/evnict-kit-create-component/SKILL.md +263 -0
- package/templates/skills/evnict-kit-create-page/SKILL.md +247 -0
- package/templates/skills/evnict-kit-database-migration/SKILL.md +164 -0
- package/templates/skills/evnict-kit-doc-postmortem/SKILL.md +93 -0
- package/templates/skills/evnict-kit-finish-branch/SKILL.md +87 -0
- package/templates/skills/evnict-kit-fix-attt/SKILL.md +129 -0
- package/templates/skills/evnict-kit-fix-business-logic/SKILL.md +89 -0
- package/templates/skills/evnict-kit-git-worktrees/SKILL.md +104 -0
- package/templates/skills/evnict-kit-merge-checklist/SKILL.md +108 -0
- package/templates/skills/evnict-kit-onboard/SKILL.md +143 -0
- package/templates/skills/evnict-kit-prompt-standard/SKILL.md +103 -0
- package/templates/skills/evnict-kit-receiving-review/SKILL.md +89 -0
- package/templates/skills/evnict-kit-security-audit/SKILL.md +190 -0
- package/templates/skills/evnict-kit-spec/SKILL.md +237 -0
- package/templates/skills/evnict-kit-tdd/SKILL.md +413 -0
- package/templates/skills/evnict-kit-wiki/SKILL.md +412 -0
- package/templates/wiki/README.md +35 -0
- package/templates/wiki/config.example.yaml +17 -0
- package/templates/wiki/package.json +17 -0
- package/templates/wiki/raw/notes/.gitkeep +1 -0
- package/templates/wiki/scripts/ingest.js +66 -0
- package/templates/workflows/antigravity/evnict-kit-archive-wiki.md +100 -0
- package/templates/workflows/antigravity/evnict-kit-attt.md +100 -0
- package/templates/workflows/antigravity/evnict-kit-bug-fix.md +107 -0
- package/templates/workflows/antigravity/evnict-kit-feature-large.md +393 -0
- package/templates/workflows/antigravity/evnict-kit-feature-small.md +86 -0
- package/templates/workflows/antigravity/evnict-kit-handoff.md +243 -0
- package/templates/workflows/antigravity/evnict-kit-implement.md +247 -0
- package/templates/workflows/antigravity/evnict-kit-init-check.md +76 -0
- package/templates/workflows/antigravity/evnict-kit-init-context.md +58 -0
- package/templates/workflows/antigravity/evnict-kit-init-rules.md +114 -0
- package/templates/workflows/antigravity/evnict-kit-init-wiki.md +80 -0
- package/templates/workflows/antigravity/evnict-kit-plan.md +308 -0
- package/templates/workflows/antigravity/evnict-kit-review.md +53 -0
- package/templates/workflows/antigravity/evnict-kit-spec-archive.md +53 -0
- package/templates/workflows/antigravity/evnict-kit-wiki-archive-feature.md +164 -0
- package/templates/workflows/antigravity/evnict-kit-wiki-query.md +91 -0
- package/templates/workflows/antigravity/evnict-kit-wiki-scan-project.md +272 -0
- package/templates/workflows/claude/README.md +6 -0
- package/templates/workflows/claude/evnict-kit-archive-wiki.md +98 -0
- package/templates/workflows/claude/evnict-kit-attt.md +98 -0
- package/templates/workflows/claude/evnict-kit-bug-fix.md +105 -0
- package/templates/workflows/claude/evnict-kit-feature-large.md +391 -0
- package/templates/workflows/claude/evnict-kit-feature-small.md +84 -0
- package/templates/workflows/claude/evnict-kit-handoff.md +240 -0
- package/templates/workflows/claude/evnict-kit-implement.md +245 -0
- package/templates/workflows/claude/evnict-kit-init-check.md +74 -0
- package/templates/workflows/claude/evnict-kit-init-context.md +56 -0
- package/templates/workflows/claude/evnict-kit-init-rules.md +112 -0
- package/templates/workflows/claude/evnict-kit-init-wiki.md +78 -0
- package/templates/workflows/claude/evnict-kit-plan.md +305 -0
- package/templates/workflows/claude/evnict-kit-review.md +51 -0
- package/templates/workflows/claude/evnict-kit-spec-archive.md +51 -0
- package/templates/workflows/claude/evnict-kit-wiki-archive-feature.md +162 -0
- package/templates/workflows/claude/evnict-kit-wiki-query.md +89 -0
- package/templates/workflows/claude/evnict-kit-wiki-scan-project.md +270 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Agent đọc codebase → phân tích patterns → điền rules RP01-RP07 vào project conventions.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Init Rules — Khởi tạo Project Conventions
|
|
6
|
+
**Command:** `/evnict-kit:init-rules`
|
|
7
|
+
|
|
8
|
+
## Mục đích
|
|
9
|
+
Đọc toàn bộ codebase → phân tích → tự động điền nội dung cho file `05-evnict-kit-project-conventions.md` (RP01-RP07).
|
|
10
|
+
|
|
11
|
+
## Pre-conditions
|
|
12
|
+
- Project đã init bằng `evnict-kit init`
|
|
13
|
+
- File `.agent/rules/05-evnict-kit-project-conventions.md` tồn tại (có placeholders)
|
|
14
|
+
- Codebase có source code để phân tích
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
### Task 1: Scan Project Structure
|
|
21
|
+
```bash
|
|
22
|
+
tree -L 3 --dirsfirst
|
|
23
|
+
```
|
|
24
|
+
Ghi nhận: package structure, module organization, config files.
|
|
25
|
+
|
|
26
|
+
### Task 2: RP01 — Naming Convention
|
|
27
|
+
Đọc 5-10 file Java/TypeScript → extract:
|
|
28
|
+
- Package naming pattern
|
|
29
|
+
- Class naming (Controller, Service, Repository, DTO)
|
|
30
|
+
- Method naming (CRUD verbs, prefixes)
|
|
31
|
+
- Variable naming
|
|
32
|
+
- File naming
|
|
33
|
+
- Table/Column naming (từ migration scripts hoặc JOOQ generated)
|
|
34
|
+
|
|
35
|
+
### Task 3: RP02 — Architecture Pattern
|
|
36
|
+
Phân tích:
|
|
37
|
+
- Folder structure → xác định architecture (MVC, Clean, Hexagonal)
|
|
38
|
+
- Layer dependencies (Controller→Service→Repository)
|
|
39
|
+
- Module organization (by feature, by layer)
|
|
40
|
+
|
|
41
|
+
### Task 4: RP03 — Coding Convention
|
|
42
|
+
Đọc code → extract:
|
|
43
|
+
- Indentation (tabs/spaces, size)
|
|
44
|
+
- Import ordering
|
|
45
|
+
- Method ordering
|
|
46
|
+
- Comment style
|
|
47
|
+
- Null handling
|
|
48
|
+
- Logging framework
|
|
49
|
+
|
|
50
|
+
### Task 5: RP04 — API Convention
|
|
51
|
+
Đọc Controller classes → extract:
|
|
52
|
+
- Base URL pattern
|
|
53
|
+
- HTTP method usage
|
|
54
|
+
- Request/Response format
|
|
55
|
+
- Pagination pattern
|
|
56
|
+
- Error format
|
|
57
|
+
|
|
58
|
+
### Task 6: RP05 — Database Convention
|
|
59
|
+
Đọc migration scripts, JOOQ config, application.yml → extract:
|
|
60
|
+
- Database type & version
|
|
61
|
+
- Schema structure
|
|
62
|
+
- Table/column naming
|
|
63
|
+
- PK pattern (sequence, UUID, identity)
|
|
64
|
+
- Audit columns
|
|
65
|
+
|
|
66
|
+
### Task 7: RP06 — Component Convention (Frontend only)
|
|
67
|
+
Đọc Angular files → extract:
|
|
68
|
+
- Component structure
|
|
69
|
+
- Selector prefix
|
|
70
|
+
- State management
|
|
71
|
+
- UI library usage
|
|
72
|
+
- Form handling
|
|
73
|
+
|
|
74
|
+
### Task 8: RP07 — Integration Map
|
|
75
|
+
Đọc config, dependencies, service files → extract:
|
|
76
|
+
- External services (SSO, MinIO, CMIS)
|
|
77
|
+
- Internal dependencies
|
|
78
|
+
- Cache, messaging, storage
|
|
79
|
+
|
|
80
|
+
### Task 9: Update File
|
|
81
|
+
Cập nhật `05-evnict-kit-project-conventions.md`:
|
|
82
|
+
1. Thay "⚠️ CHƯA ĐƯỢC KHỞI TẠO" bằng nội dung thực tế
|
|
83
|
+
2. Thêm code examples LẤY TỪ CODE THỰC TẾ (không mẫu generic)
|
|
84
|
+
3. Đổi header thành `✅ ĐÃ KHỞI TẠO — {date}`
|
|
85
|
+
|
|
86
|
+
### Task 10: Summary
|
|
87
|
+
Tạo `.agent/context/init-summary-backend.md` hoặc `init-summary-frontend.md`:
|
|
88
|
+
```markdown
|
|
89
|
+
# Init Summary — {date}
|
|
90
|
+
## Conventions found: {count}/7
|
|
91
|
+
## Files scanned: {count}
|
|
92
|
+
## Key findings:
|
|
93
|
+
- {finding 1}
|
|
94
|
+
- {finding 2}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Bảo mật
|
|
100
|
+
- KHÔNG ghi secrets, IP nội bộ, URLs production vào rules
|
|
101
|
+
- KHÔNG ghi passwords, connection strings
|
|
102
|
+
- Chỉ ghi PATTERNS không ghi VALUES
|
|
103
|
+
|
|
104
|
+
## Output
|
|
105
|
+
```
|
|
106
|
+
✅ RP01 Naming: ACTIVE
|
|
107
|
+
✅ RP02 Architecture: ACTIVE
|
|
108
|
+
✅ RP03 Coding: ACTIVE
|
|
109
|
+
✅ RP04 API: ACTIVE
|
|
110
|
+
✅ RP05 Database: ACTIVE
|
|
111
|
+
✅ RP06 Component: ACTIVE (hoặc SKIPPED nếu BE only)
|
|
112
|
+
✅ RP07 Integration: ACTIVE
|
|
113
|
+
📄 Summary: .agent/context/init-summary-{type}.md
|
|
114
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Setup llm-wiki — copy template, npm install, config, first ingest. Hoặc clone fresh từ GitHub.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Init Wiki — Setup LLM Wiki
|
|
6
|
+
**Command:** `/evnict-kit:init-wiki`
|
|
7
|
+
|
|
8
|
+
## Mục đích
|
|
9
|
+
Setup llm-wiki knowledge base cho dự án. Copy từ template có sẵn hoặc clone từ GitHub.
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
- `/evnict-kit:init-wiki` → Copy từ templates/wiki/ (mặc định)
|
|
13
|
+
- `/evnict-kit:init-wiki --from-github` → Clone fresh từ GitHub
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Workflow (Default — Copy Template)
|
|
18
|
+
|
|
19
|
+
### Bước 1: Xác định wiki path
|
|
20
|
+
```bash
|
|
21
|
+
cat .evnict/config.yaml | grep wiki
|
|
22
|
+
# → wiki.folder: "{project}-wiki"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Bước 2: Copy template
|
|
26
|
+
Wiki template đã có sẵn trong evnict-kit package:
|
|
27
|
+
```bash
|
|
28
|
+
cp -r {evnict-kit}/templates/wiki/ ./{project}-wiki/
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Bước 3: Install dependencies
|
|
32
|
+
```bash
|
|
33
|
+
cd {project}-wiki
|
|
34
|
+
npm install
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Bước 4: Configure
|
|
38
|
+
Tạo `config.yaml` từ `config.example.yaml`:
|
|
39
|
+
```yaml
|
|
40
|
+
project: "{project-name}"
|
|
41
|
+
raw_path: "raw/notes"
|
|
42
|
+
processed_path: "processed"
|
|
43
|
+
index_path: "processed/index.json"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Bước 5: Tạo folder structure
|
|
47
|
+
```bash
|
|
48
|
+
mkdir -p raw/notes
|
|
49
|
+
mkdir -p processed
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Bước 6: First ingest (nếu có notes sẵn)
|
|
53
|
+
```bash
|
|
54
|
+
npm run ingest
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Bước 7: Verify
|
|
58
|
+
```
|
|
59
|
+
✅ Wiki setup: {project}-wiki/
|
|
60
|
+
✅ Dependencies installed
|
|
61
|
+
✅ Config created
|
|
62
|
+
✅ Folders ready
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Workflow (--from-github)
|
|
68
|
+
|
|
69
|
+
### Bước 1: Clone
|
|
70
|
+
```bash
|
|
71
|
+
git clone https://github.com/mduongvandinh/llm-wiki.git {project}-wiki
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Bước 2: Install + Configure
|
|
75
|
+
Same as steps 3-7 above.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Output
|
|
80
|
+
Wiki folder ready at `{project}-wiki/` with npm dependencies installed.
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: evnict-kit-plan
|
|
3
|
+
description: Chuyển từ spec đã confirm sang plan + task breakdown CHI TIẾT. Sinh plan.md (6 sections) + task files (120+ dòng/file) + API contract. Dùng sau khi user trả lời các câu hỏi clarify.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Plan
|
|
7
|
+
**Command:** `/evnict-kit:plan [path_to_spec]`
|
|
8
|
+
|
|
9
|
+
## Khi nào dùng
|
|
10
|
+
Dùng để tự động sinh cấu trúc công việc CHI TIẾT, Breakdown các thành phần và tạo API Contract từ một bản Specification (Spec) đã chốt.
|
|
11
|
+
|
|
12
|
+
## Input
|
|
13
|
+
- Spec file path (Agent sẽ auto-detect từ `.evnict/specs/` gần nhất nếu không cung cấp)
|
|
14
|
+
- Hoặc người dùng chỉ định trực tiếp: `/evnict-kit:plan .evnict/specs/feature-xyz/spec.md`
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Workflow chi tiết
|
|
19
|
+
|
|
20
|
+
### Bước 1: Parse Specification
|
|
21
|
+
1. Đọc file `spec.md` đã confirm.
|
|
22
|
+
2. Kiểm tra xem có câu hỏi clarify nào chưa được user trả lời hay không.
|
|
23
|
+
- Nếu có: Yêu cầu người dùng trả lời trước khi tiếp tục. Dừng lệnh.
|
|
24
|
+
- Nếu đã trả lời: Tự động update `spec.md` với các quyết định/câu trả lời nếu cần thiết.
|
|
25
|
+
3. Đọc `.agent/rules/` → nắm conventions dự án (naming, architecture, coding patterns).
|
|
26
|
+
4. Đọc AGENTS.md → hiểu project overview, tech stack.
|
|
27
|
+
|
|
28
|
+
### Bước 2: Đọc file mẫu trong project
|
|
29
|
+
**BẮT BUỘC** đọc các file mẫu thật trong project để trích xuất code patterns:
|
|
30
|
+
1. Tìm file mẫu tương tự với feature cần implement:
|
|
31
|
+
- Repository mẫu (VD: `LrsDepartmentRepository.java`)
|
|
32
|
+
- Service mẫu (VD: `LrsDepartmentService.java`)
|
|
33
|
+
- Controller mẫu (VD: `NCPTController.java`)
|
|
34
|
+
- DTO mẫu (VD: `LrsDepartmentDTO.java`)
|
|
35
|
+
- FE Service mẫu, Component mẫu (nếu FE project)
|
|
36
|
+
2. Trích skeleton pattern: class structure, imports, method signatures, annotations.
|
|
37
|
+
3. Lưu lại để paste vào task files ở bước sau.
|
|
38
|
+
|
|
39
|
+
### Bước 3: Sinh Plan.md — PHẢI có 6 SECTIONS
|
|
40
|
+
|
|
41
|
+
Tạo file `.evnict/specs/{feature-slug}/plan.md` theo template sau:
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
# Plan: {Feature Name}
|
|
45
|
+
|
|
46
|
+
## 1. Tổng quan
|
|
47
|
+
- Feature: {tên chức năng}
|
|
48
|
+
- Spec: .evnict/specs/{slug}/spec.md
|
|
49
|
+
- Estimated: {X} tasks, phân bổ BE:{N} / FE:{M} / DB:{K}
|
|
50
|
+
- Priority: {High/Medium/Low}
|
|
51
|
+
- Branch: feature/{slug}
|
|
52
|
+
|
|
53
|
+
## 2. Database Schema
|
|
54
|
+
### Tables cần tạo/sửa
|
|
55
|
+
| Table | Column | Type | Nullable | FK | Mô tả |
|
|
56
|
+
|-------|--------|------|----------|-----|-------|
|
|
57
|
+
| {TABLE_NAME} | ID | NUMBER | NO | PK | Primary key |
|
|
58
|
+
| {TABLE_NAME} | {COL} | {TYPE} | {YES/NO} | {FK→TABLE} | {mô tả} |
|
|
59
|
+
| ... | ... | ... | ... | ... | ... |
|
|
60
|
+
|
|
61
|
+
### Indexes (nếu cần)
|
|
62
|
+
| Index | Columns | Type | Mô tả |
|
|
63
|
+
|-------|---------|------|-------|
|
|
64
|
+
| {IDX_NAME} | {cols} | {UNIQUE/NORMAL} | {mô tả} |
|
|
65
|
+
|
|
66
|
+
### Migration script naming
|
|
67
|
+
- `V{YYYYMMDD}_{SEQ}__{description}.sql`
|
|
68
|
+
|
|
69
|
+
## 3. API Design
|
|
70
|
+
### Endpoints
|
|
71
|
+
| # | Method | Path | Auth | Mô tả |
|
|
72
|
+
|---|--------|------|------|-------|
|
|
73
|
+
| 1 | POST | /api/{module}/{action} | JWT | {mô tả} |
|
|
74
|
+
| ... | ... | ... | ... | ... |
|
|
75
|
+
|
|
76
|
+
### Request/Response chi tiết cho MỖI endpoint
|
|
77
|
+
|
|
78
|
+
**{METHOD} {PATH}**
|
|
79
|
+
```json
|
|
80
|
+
// Request
|
|
81
|
+
{
|
|
82
|
+
"field1": "type — description",
|
|
83
|
+
"field2": "type — description",
|
|
84
|
+
"page": 0,
|
|
85
|
+
"size": 20
|
|
86
|
+
}
|
|
87
|
+
// Response (ResponseData wrapper)
|
|
88
|
+
{
|
|
89
|
+
"success": true,
|
|
90
|
+
"message": "OK",
|
|
91
|
+
"data": {
|
|
92
|
+
"content": [{ ... }],
|
|
93
|
+
"totalElements": 100,
|
|
94
|
+
"totalPages": 5
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Error Response
|
|
98
|
+
{
|
|
99
|
+
"success": false,
|
|
100
|
+
"message": "Lỗi cụ thể",
|
|
101
|
+
"data": null
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 4. Frontend Design
|
|
106
|
+
### Pages/Components
|
|
107
|
+
| # | Component | Type | Route | Mô tả |
|
|
108
|
+
|---|-----------|------|-------|-------|
|
|
109
|
+
| 1 | {Name}ListComponent | Page | /{route} | Danh sách + filter + CRUD |
|
|
110
|
+
| 2 | {Name}FormComponent | Dialog | — | Form thêm/sửa |
|
|
111
|
+
|
|
112
|
+
### UI Elements
|
|
113
|
+
- Filter bar: {dropdowns, date pickers, text inputs}
|
|
114
|
+
- Table: columns mapped từ DTO
|
|
115
|
+
- Actions: Thêm, Sửa, Xóa (confirm dialog)
|
|
116
|
+
- Toolbar: Export Excel (nếu cần)
|
|
117
|
+
|
|
118
|
+
### Dropdowns cần load
|
|
119
|
+
| Dropdown | API | Value field | Display field |
|
|
120
|
+
|----------|-----|-------------|---------------|
|
|
121
|
+
| {Dropdown name} | {API path} | {value} | {display} |
|
|
122
|
+
|
|
123
|
+
## 5. Business Rules áp dụng
|
|
124
|
+
| Mã | Rule | Áp dụng cho |
|
|
125
|
+
|----|------|-------------|
|
|
126
|
+
| BR01 | {rule description} | BE: {endpoint} |
|
|
127
|
+
| BR02 | {rule description} | BE + FE: validation |
|
|
128
|
+
| ... | ... | ... |
|
|
129
|
+
|
|
130
|
+
## 6. Task Breakdown
|
|
131
|
+
### Thứ tự thực hiện
|
|
132
|
+
```
|
|
133
|
+
DB Migration → BE Repository → BE Service → BE Controller → FE Service → FE Component → FE Page
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Dependencies
|
|
137
|
+
- FE tasks chờ BE xong → đọc API contract
|
|
138
|
+
- BE tasks chờ DB migration xong
|
|
139
|
+
|
|
140
|
+
### Task List
|
|
141
|
+
| # | File | Mô tả | Depends on | Est. |
|
|
142
|
+
|---|------|-------|------------|------|
|
|
143
|
+
| 01 | db-migration | {desc} | — | 3 min |
|
|
144
|
+
| 02 | be-repository | {desc} | 01 | 5 min |
|
|
145
|
+
| ... | ... | ... | ... | ... |
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### Bước 4: Sinh Task Files — MỖI FILE PHẢI ≥ 100 DÒNG
|
|
151
|
+
|
|
152
|
+
Tạo thư mục `.evnict/specs/{feature-slug}/tasks/` và sinh task files theo template:
|
|
153
|
+
|
|
154
|
+
```markdown
|
|
155
|
+
# Task {NN}: {be|fe|db}-{description}
|
|
156
|
+
|
|
157
|
+
## 1. Mục tiêu
|
|
158
|
+
{Mô tả cụ thể task này làm gì — 3-5 câu.
|
|
159
|
+
Nêu rõ input/output, layer nào trong architecture,
|
|
160
|
+
và kết quả mong đợi khi task hoàn thành.}
|
|
161
|
+
|
|
162
|
+
## 2. Business Context
|
|
163
|
+
Business rules liên quan đến task này (trích từ spec):
|
|
164
|
+
- BR{XX}: {rule description} — cách áp dụng trong task này
|
|
165
|
+
- BR{YY}: {rule description} — cách áp dụng trong task này
|
|
166
|
+
|
|
167
|
+
Luồng nghiệp vụ liên quan:
|
|
168
|
+
{Trích phần flow liên quan từ spec, giúp Agent hiểu WHY}
|
|
169
|
+
|
|
170
|
+
## 3. Files cần tạo/sửa
|
|
171
|
+
| File | Action | Mô tả |
|
|
172
|
+
|------|--------|-------|
|
|
173
|
+
| `src/.../XxxRepository.java` | CREATE | Repository JOOQ cho bảng {TABLE} |
|
|
174
|
+
| `src/.../XxxDTO.java` | CREATE | DTO với @JsonProperty UPPER_SNAKE |
|
|
175
|
+
| ... | ... | ... |
|
|
176
|
+
|
|
177
|
+
## 4. Implementation Guide
|
|
178
|
+
### Conventions phải tuân thủ (tham chiếu rules)
|
|
179
|
+
- Rule 03: Backend Conventions → {specific convention}
|
|
180
|
+
- Rule 05: Project Conventions → {specific convention}
|
|
181
|
+
- {Liệt kê CỤ THỂ rule nào, section nào áp dụng}
|
|
182
|
+
|
|
183
|
+
### Code Pattern tham khảo
|
|
184
|
+
Tham khảo file mẫu trong project: `{ReferenceFile.java}`
|
|
185
|
+
|
|
186
|
+
```java
|
|
187
|
+
// Pattern trích từ {ReferenceFile.java}
|
|
188
|
+
// Agent ĐÃ ĐỌC file thật và paste skeleton ở đây
|
|
189
|
+
@Repository
|
|
190
|
+
public class {EntityName}Repository extends BaseRepositoryImpl<...> {
|
|
191
|
+
@Qualifier(DefineProperties.DSLContextNCPT)
|
|
192
|
+
DSLContext dslContext;
|
|
193
|
+
|
|
194
|
+
@Override
|
|
195
|
+
public List<{EntityName}DTO> getAll(InputCondition input) {
|
|
196
|
+
// JOOQ type-safe query
|
|
197
|
+
// Pattern: select().from().where().fetch()
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
public int insert({EntityName}DTO dto) {
|
|
201
|
+
// Pattern: dslContext.insertInto(TABLE).set(...).execute()
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
public int update({EntityName}DTO dto) {
|
|
205
|
+
// Pattern: dslContext.update(TABLE).set(...).where(...).execute()
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
public int delete(Object id) {
|
|
209
|
+
// Pattern: dslContext.deleteFrom(TABLE).where(...).execute()
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Validation/Error handling
|
|
215
|
+
- {Mô tả cách xử lý lỗi theo convention dự án}
|
|
216
|
+
- {VD: throw BusinessException("message") cho business rule violations}
|
|
217
|
+
|
|
218
|
+
## 5. Test Cases (TDD — viết TRƯỚC)
|
|
219
|
+
| # | Test | Input | Expected | Type |
|
|
220
|
+
|---|------|-------|----------|------|
|
|
221
|
+
| 1 | {test_name} | {input description} | {expected result} | Unit |
|
|
222
|
+
| 2 | {test_name} | {input description} | {expected result} | Unit |
|
|
223
|
+
| 3 | {test_name} | {input description} | {expected result} | Unit |
|
|
224
|
+
| 4 | {test_name} | {input description} | {expected result} | Unit |
|
|
225
|
+
| 5 | {test_name} | {input description} | {expected result} | Unit |
|
|
226
|
+
|
|
227
|
+
### Test code skeleton
|
|
228
|
+
```java
|
|
229
|
+
@ExtendWith(MockitoExtension.class)
|
|
230
|
+
class {EntityName}{Layer}Test {
|
|
231
|
+
// Arrange — mocks, test data
|
|
232
|
+
// Act — call method under test
|
|
233
|
+
// Assert — verify result + interactions
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## 6. Acceptance Criteria
|
|
238
|
+
- [ ] {Criterion 1 — cụ thể, đo được}
|
|
239
|
+
- [ ] {Criterion 2}
|
|
240
|
+
- [ ] {Criterion 3}
|
|
241
|
+
- [ ] Code theo đúng conventions (rule {XX}, {YY})
|
|
242
|
+
- [ ] Unit tests pass (≥ {N} test cases)
|
|
243
|
+
|
|
244
|
+
## 7. Dependencies
|
|
245
|
+
- **Requires:** Task {XX} ({description}) hoàn thành
|
|
246
|
+
- **Blocks:** Task {YY} ({description}) — cần output của task này
|
|
247
|
+
- **Related:** {API Contract, handoff, other tasks}
|
|
248
|
+
|
|
249
|
+
## 8. Estimated: {N} phút
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
### Bước 5: Sinh API Contract
|
|
255
|
+
Từ API Design trong plan.md, tạo file `.evnict/specs/{feature-slug}/contracts/api-contract.yaml`:
|
|
256
|
+
|
|
257
|
+
```yaml
|
|
258
|
+
# contracts/api-contract.yaml
|
|
259
|
+
feature: {feature-name}
|
|
260
|
+
generated: {date}
|
|
261
|
+
endpoints:
|
|
262
|
+
- method: POST
|
|
263
|
+
path: /api/{module}/{action}
|
|
264
|
+
description: {mô tả}
|
|
265
|
+
request:
|
|
266
|
+
body:
|
|
267
|
+
fieldName: { type: string, required: true, maxLength: 100 }
|
|
268
|
+
response:
|
|
269
|
+
200:
|
|
270
|
+
schema: ResponseData
|
|
271
|
+
data:
|
|
272
|
+
id: { type: number }
|
|
273
|
+
400:
|
|
274
|
+
schema: ResponseData
|
|
275
|
+
error: { message: string }
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Bước 6: Quality Gate — KIỂM TRA TRƯỚC KHI HIỂN THỊ
|
|
279
|
+
|
|
280
|
+
Agent PHẢI tự kiểm tra trước khi hiển thị plan cho user:
|
|
281
|
+
|
|
282
|
+
| Check | Yêu cầu | Nếu fail |
|
|
283
|
+
|-------|---------|----------|
|
|
284
|
+
| Plan.md sections | Đủ 6 sections | Bổ sung section thiếu |
|
|
285
|
+
| Task file length | Mỗi file ≥ 100 dòng | Bổ sung chi tiết |
|
|
286
|
+
| Test cases | Mỗi task ≥ 3 test cases | Thêm test cases |
|
|
287
|
+
| Code patterns | Mỗi task có skeleton code từ file mẫu THẬT | Đọc lại file mẫu |
|
|
288
|
+
| Dependencies | Mỗi task ghi rõ Requires/Blocks | Bổ sung |
|
|
289
|
+
| Business rules | Task liên quan có trích BR từ spec | Trích bổ sung |
|
|
290
|
+
| API contract | File yaml tồn tại và đầy đủ endpoints | Bổ sung |
|
|
291
|
+
|
|
292
|
+
### Bước 7: Chờ Confirm
|
|
293
|
+
Hiển thị Plan đã Breakdown ra log cho User duyệt:
|
|
294
|
+
```
|
|
295
|
+
📋 Plan đã sinh:
|
|
296
|
+
📄 plan.md — {N} dòng, {X} tasks
|
|
297
|
+
📁 tasks/ — {X} files ({be_count} BE, {fe_count} FE, {db_count} DB)
|
|
298
|
+
📜 contracts/api-contract.yaml
|
|
299
|
+
|
|
300
|
+
Quality Gate: ✅ PASSED (tất cả checks OK)
|
|
301
|
+
|
|
302
|
+
Bạn duyệt plan này không?
|
|
303
|
+
A) ✅ Approve — chạy /evnict-kit:implement
|
|
304
|
+
B) 📝 Sửa — feedback cụ thể
|
|
305
|
+
C) ❌ Hủy — xóa plan, quay lại spec
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Sau khi người dùng Approve, hãy nhắc họ chạy lệnh: `/evnict-kit:implement`.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Auto review workflow — check rules + ATTT + conventions trước merge. Gọi skill evnict-kit-code-review + evnict-kit-merge-checklist.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Auto Review
|
|
6
|
+
**Command:** `/evnict-kit:review`
|
|
7
|
+
|
|
8
|
+
## Khi nào dùng
|
|
9
|
+
- Trước khi merge code
|
|
10
|
+
- Review code do AI Agent sinh ra
|
|
11
|
+
- Kiểm tra chất lượng trước pull request
|
|
12
|
+
|
|
13
|
+
## Input
|
|
14
|
+
- Branch (auto-detect current)
|
|
15
|
+
- `/evnict-kit:review` hoặc `/evnict-kit:review --scope=security`
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Bước 1: Code Review
|
|
20
|
+
Gọi skill `evnict-kit-code-review`:
|
|
21
|
+
- 9 hạng mục review (Security, Logic, Quality, Tests, Build, Vibe Coding, Database, Documentation, Performance)
|
|
22
|
+
- Tạo review report
|
|
23
|
+
|
|
24
|
+
## Bước 2: Merge Checklist
|
|
25
|
+
Gọi skill `evnict-kit-merge-checklist`:
|
|
26
|
+
- 9 hạng mục pre-merge check
|
|
27
|
+
- Build, tests, lint, security, secrets, commits, files, docs, migration
|
|
28
|
+
|
|
29
|
+
## Bước 3: Verdict
|
|
30
|
+
```markdown
|
|
31
|
+
## 📋 Review Summary
|
|
32
|
+
|
|
33
|
+
### Code Review: {APPROVE | REQUEST CHANGES | BLOCK}
|
|
34
|
+
{Summary of issues}
|
|
35
|
+
|
|
36
|
+
### Merge Checklist: {PASS | FAIL}
|
|
37
|
+
{Summary of checks}
|
|
38
|
+
|
|
39
|
+
### Final Verdict: {✅ READY TO MERGE | ❌ NEEDS FIXES}
|
|
40
|
+
{Actions required before merge}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Bước 4: Nếu BLOCK/FAIL
|
|
44
|
+
1. Liệt kê issues cần fix
|
|
45
|
+
2. Fix issues
|
|
46
|
+
3. Chạy lại `/evnict-kit:review`
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Checklist
|
|
51
|
+
- [ ] Code review completed (9 items)
|
|
52
|
+
- [ ] Merge checklist completed (9 items)
|
|
53
|
+
- [ ] Verdict: APPROVE + PASS → Ready to merge
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Spec CRUD — save, find, update, list specs. Quản lý specs trong .evnict/specs/.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Spec Archive
|
|
6
|
+
**Command:** `/evnict-kit:spec-archive`
|
|
7
|
+
|
|
8
|
+
## Khi nào dùng
|
|
9
|
+
- Tìm spec đã tạo trước đó
|
|
10
|
+
- Archive spec từ .evnict/ vào docs/
|
|
11
|
+
- Liệt kê tất cả specs
|
|
12
|
+
|
|
13
|
+
## Input
|
|
14
|
+
- Action: list | find | archive | show
|
|
15
|
+
- `/evnict-kit:spec-archive list` → Liệt kê tất cả specs
|
|
16
|
+
- `/evnict-kit:spec-archive find {keyword}` → Tìm spec theo keyword
|
|
17
|
+
- `/evnict-kit:spec-archive archive {slug}` → Archive spec vào docs/
|
|
18
|
+
- `/evnict-kit:spec-archive show {slug}` → Hiển thị spec
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Action: LIST
|
|
23
|
+
```bash
|
|
24
|
+
ls .evnict/specs/
|
|
25
|
+
```
|
|
26
|
+
Output:
|
|
27
|
+
```markdown
|
|
28
|
+
## 📋 Specs
|
|
29
|
+
| # | Slug | Status | Date | Tasks |
|
|
30
|
+
|---|------|--------|------|-------|
|
|
31
|
+
| 1 | {slug} | {draft|confirmed|archived} | {date} | {count} |
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Action: FIND
|
|
35
|
+
```bash
|
|
36
|
+
grep -rl "{keyword}" .evnict/specs/ --include="*.md"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Action: ARCHIVE
|
|
40
|
+
```bash
|
|
41
|
+
cp -r .evnict/specs/{slug}/ docs/specs/{slug}/
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Action: SHOW
|
|
45
|
+
```bash
|
|
46
|
+
cat .evnict/specs/{slug}/spec.md
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Checklist
|
|
52
|
+
- [ ] Action executed successfully
|
|
53
|
+
- [ ] Output formatted clearly
|