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,462 @@
|
|
|
1
|
+
# {{PROJECT_NAME}} — AI Agent Context
|
|
2
|
+
# Generated by evnict-kit v0.1.3
|
|
3
|
+
# Đây là file context chính cho AI Agent — đọc file này ĐẦU TIÊN
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. PROJECT OVERVIEW
|
|
8
|
+
|
|
9
|
+
| Property | Value |
|
|
10
|
+
|----------|-------|
|
|
11
|
+
| Project Name | {{PROJECT_NAME}} |
|
|
12
|
+
| Tech Stack | {{TECH_STACK}} |
|
|
13
|
+
| Database | {{DATABASE}} |
|
|
14
|
+
| Generated | {{DATE}} |
|
|
15
|
+
| evnict-kit | v0.1.3 |
|
|
16
|
+
|
|
17
|
+
### Mô tả
|
|
18
|
+
<!-- CHƯA KHỞI TẠO — Agent sẽ điền khi chạy /evnict-kit:init-context -->
|
|
19
|
+
{Mô tả ngắn gọn về dự án — 2-3 câu}
|
|
20
|
+
|
|
21
|
+
### Mục tiêu nghiệp vụ
|
|
22
|
+
<!-- CHƯA KHỞI TẠO -->
|
|
23
|
+
{Mục tiêu chính của hệ thống}
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. ARCHITECTURE
|
|
28
|
+
|
|
29
|
+
### Tổng quan
|
|
30
|
+
<!-- CHƯA KHỞI TẠO — Agent sẽ điền architecture diagram -->
|
|
31
|
+
```
|
|
32
|
+
┌──────────────────────────────────────────────────┐
|
|
33
|
+
│ CLIENT │
|
|
34
|
+
│ Angular + PrimeNG │
|
|
35
|
+
└───────────────────┬──────────────────────────────┘
|
|
36
|
+
│ HTTP/REST
|
|
37
|
+
┌───────────────────▼──────────────────────────────┐
|
|
38
|
+
│ API GATEWAY / NGINX │
|
|
39
|
+
└───────────────────┬──────────────────────────────┘
|
|
40
|
+
│
|
|
41
|
+
┌───────────────────▼──────────────────────────────┐
|
|
42
|
+
│ SPRING BOOT APP │
|
|
43
|
+
│ ┌─────────┐ ┌──────────┐ ┌──────────────┐ │
|
|
44
|
+
│ │Controller│→ │ Service │→ │ Repository │ │
|
|
45
|
+
│ │ @Valid │ │ @Transac │ │ JOOQ/JPA │ │
|
|
46
|
+
│ └─────────┘ └──────────┘ └──────┬───────┘ │
|
|
47
|
+
│ │ │
|
|
48
|
+
│ ┌──────────┐ ┌──────────┐ │ │
|
|
49
|
+
│ │ Security │ │ Exception│ │ │
|
|
50
|
+
│ │ JWT(RS256)│ │ Handler │ │ │
|
|
51
|
+
│ └──────────┘ └──────────┘ │ │
|
|
52
|
+
└──────────────────────────────────────┤────────────┘
|
|
53
|
+
│
|
|
54
|
+
┌──────────────────────────▼───────┐
|
|
55
|
+
│ ORACLE DATABASE │
|
|
56
|
+
│ Schema: EVNTMS + {{PROJECT}} │
|
|
57
|
+
└──────────────────────────────────┘
|
|
58
|
+
│
|
|
59
|
+
┌──────────────────────────┘
|
|
60
|
+
│
|
|
61
|
+
┌───────▼─────┐ ┌──────────┐ ┌──────────┐
|
|
62
|
+
│ MinIO │ │ EVN SSO │ │ Redis │
|
|
63
|
+
│ File Storage│ │ Auth │ │ Cache │
|
|
64
|
+
└─────────────┘ └──────────┘ └──────────┘
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Layer Architecture
|
|
68
|
+
```
|
|
69
|
+
Controller Layer → HTTP handling, input validation (@Valid)
|
|
70
|
+
↓
|
|
71
|
+
Service Layer → Business logic, @Transactional
|
|
72
|
+
↓
|
|
73
|
+
Repository Layer → Data access (JOOQ type-safe queries)
|
|
74
|
+
↓
|
|
75
|
+
Database → Oracle/SQL Server
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Nguyên tắc
|
|
79
|
+
- Controller KHÔNG chứa business logic
|
|
80
|
+
- Service quản lý transactions
|
|
81
|
+
- Repository CHỈ data access — không business logic
|
|
82
|
+
- DTO cho data transfer — KHÔNG dùng Entity trực tiếp trong response
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 3. TECH STACK
|
|
87
|
+
|
|
88
|
+
| Layer | Technology | Version | Notes |
|
|
89
|
+
|-------|-----------|---------|-------|
|
|
90
|
+
| Backend | {{TECH_STACK}} | <!-- version --> | Main API server |
|
|
91
|
+
| ORM | JOOQ | <!-- version --> | Type-safe SQL |
|
|
92
|
+
| Database | {{DATABASE}} | <!-- version --> | Primary data store |
|
|
93
|
+
| Frontend | Angular | <!-- version --> | SPA |
|
|
94
|
+
| UI Library | PrimeNG | <!-- version --> | Component library |
|
|
95
|
+
| Auth | JWT (RS256) | - | Via EVN SSO |
|
|
96
|
+
| File Storage | MinIO | - | S3-compatible |
|
|
97
|
+
| Cache | Redis | - | Session + local cache |
|
|
98
|
+
| CI/CD | Azure DevOps | - | Pipeline |
|
|
99
|
+
| Container | Docker + K8s | - | Deployment |
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 4. PROJECT STRUCTURE
|
|
104
|
+
|
|
105
|
+
### Backend
|
|
106
|
+
<!-- CHƯA KHỞI TẠO — Agent sẽ điền từ tree output -->
|
|
107
|
+
```
|
|
108
|
+
src/main/java/com/evn/{{PROJECT_NAME}}/
|
|
109
|
+
├── config/ ← Application configuration
|
|
110
|
+
├── common/ ← Shared utilities, base classes
|
|
111
|
+
│ ├── dto/ ← ResponseData, PageDTO
|
|
112
|
+
│ └── exception/ ← BusinessException, GlobalExceptionHandler
|
|
113
|
+
├── security/ ← JWT filter, SecurityConfig
|
|
114
|
+
└── {module}/ ← Feature modules
|
|
115
|
+
├── controller/
|
|
116
|
+
├── service/
|
|
117
|
+
├── repository/
|
|
118
|
+
└── dto/
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Frontend
|
|
122
|
+
<!-- CHƯA KHỞI TẠO -->
|
|
123
|
+
```
|
|
124
|
+
src/app/
|
|
125
|
+
├── core/ ← Guards, interceptors, core services
|
|
126
|
+
├── shared/ ← Reusable components, pipes, directives
|
|
127
|
+
│ ├── components/
|
|
128
|
+
│ ├── pipes/
|
|
129
|
+
│ └── services/
|
|
130
|
+
├── features/ ← Feature modules (lazy-loaded)
|
|
131
|
+
│ └── {module}/
|
|
132
|
+
│ ├── pages/
|
|
133
|
+
│ ├── components/
|
|
134
|
+
│ ├── services/
|
|
135
|
+
│ └── models/
|
|
136
|
+
└── assets/ ← Static assets, i18n files
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 5. DEVELOPMENT COMMANDS
|
|
142
|
+
|
|
143
|
+
### Backend
|
|
144
|
+
```bash
|
|
145
|
+
# Build
|
|
146
|
+
./mvnw clean install
|
|
147
|
+
|
|
148
|
+
# Run
|
|
149
|
+
./mvnw spring-boot:run
|
|
150
|
+
|
|
151
|
+
# Test
|
|
152
|
+
./mvnw test
|
|
153
|
+
|
|
154
|
+
# Lint/Format
|
|
155
|
+
./mvnw spotless:check
|
|
156
|
+
./mvnw spotless:apply
|
|
157
|
+
|
|
158
|
+
# Dependency check
|
|
159
|
+
./mvnw versions:display-dependency-updates
|
|
160
|
+
./mvnw org.owasp:dependency-check-maven:check
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Frontend
|
|
164
|
+
```bash
|
|
165
|
+
# Install
|
|
166
|
+
npm install
|
|
167
|
+
|
|
168
|
+
# Run
|
|
169
|
+
ng serve
|
|
170
|
+
|
|
171
|
+
# Test
|
|
172
|
+
ng test --watch=false
|
|
173
|
+
|
|
174
|
+
# Lint
|
|
175
|
+
ng lint
|
|
176
|
+
|
|
177
|
+
# Build
|
|
178
|
+
ng build --configuration=production
|
|
179
|
+
|
|
180
|
+
# Security
|
|
181
|
+
npm audit
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Database
|
|
185
|
+
```bash
|
|
186
|
+
# Migration (Flyway)
|
|
187
|
+
./mvnw flyway:migrate
|
|
188
|
+
./mvnw flyway:info
|
|
189
|
+
|
|
190
|
+
# JOOQ Code Generation
|
|
191
|
+
./mvnw jooq-codegen:generate
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## 6. CODING CONVENTIONS
|
|
197
|
+
|
|
198
|
+
> Chi tiết → `.agent/rules/03-evnict-kit-backend-conventions.md` (BE)
|
|
199
|
+
> Chi tiết → `.agent/rules/04-evnict-kit-frontend-conventions.md` (FE)
|
|
200
|
+
> Chi tiết → `.agent/rules/05-evnict-kit-project-conventions.md` (Project-specific)
|
|
201
|
+
|
|
202
|
+
### Naming
|
|
203
|
+
<!-- CHƯA KHỞI TẠO — sẽ tóm tắt từ RP01 -->
|
|
204
|
+
| Loại | Convention | Ví dụ |
|
|
205
|
+
|------|-----------|-------|
|
|
206
|
+
| Class | PascalCase | `CustomerService` |
|
|
207
|
+
| Method | camelCase | `findByStatus()` |
|
|
208
|
+
| Variable | camelCase | `customerId` |
|
|
209
|
+
| Constant | UPPER_SNAKE | `MAX_FILE_SIZE` |
|
|
210
|
+
| Table | UPPER_SNAKE | `CUSTOMER` |
|
|
211
|
+
| Column | UPPER_SNAKE | `CREATED_DATE` |
|
|
212
|
+
| API path | kebab-case | `/api/customers` |
|
|
213
|
+
|
|
214
|
+
### API Response Format
|
|
215
|
+
```java
|
|
216
|
+
// Tất cả API response dùng ResponseData
|
|
217
|
+
public class ResponseData {
|
|
218
|
+
private int status; // 0 = success, 1 = error
|
|
219
|
+
private String message;
|
|
220
|
+
private Object data;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Thành công
|
|
224
|
+
ResponseData.ok(data) // { status: 0, message: "Thành công", data: {...} }
|
|
225
|
+
|
|
226
|
+
// Lỗi
|
|
227
|
+
ResponseData.error("msg") // { status: 1, message: "msg", data: null }
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Commit Message Format
|
|
231
|
+
```
|
|
232
|
+
{type}({scope}): {description} [task-{N}]
|
|
233
|
+
|
|
234
|
+
Types: feat, fix, refactor, test, docs, chore
|
|
235
|
+
Scope: module name
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 7. API CONVENTIONS
|
|
241
|
+
|
|
242
|
+
<!-- CHƯA KHỞI TẠO — sẽ tóm tắt từ RP04 -->
|
|
243
|
+
|
|
244
|
+
### Endpoint Pattern
|
|
245
|
+
```
|
|
246
|
+
GET /api/{module} → List (paginated)
|
|
247
|
+
GET /api/{module}/{id} → Get by ID
|
|
248
|
+
POST /api/{module} → Create
|
|
249
|
+
PUT /api/{module}/{id} → Update
|
|
250
|
+
DELETE /api/{module}/{id} → Delete
|
|
251
|
+
POST /api/{module}/search → Complex search
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Pagination
|
|
255
|
+
```
|
|
256
|
+
?page=0&size=20&sort=name
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Authentication
|
|
260
|
+
```
|
|
261
|
+
Authorization: Bearer {JWT_TOKEN}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Error Codes
|
|
265
|
+
| HTTP Code | Usage |
|
|
266
|
+
|-----------|-------|
|
|
267
|
+
| 200 | Success (kể cả business error qua ResponseData.status) |
|
|
268
|
+
| 400 | Validation error |
|
|
269
|
+
| 401 | Unauthorized |
|
|
270
|
+
| 403 | Forbidden |
|
|
271
|
+
| 500 | Server error (không trả stack trace) |
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## 8. DATABASE CONVENTIONS
|
|
276
|
+
|
|
277
|
+
<!-- CHƯA KHỞI TẠO — sẽ tóm tắt từ RP05 -->
|
|
278
|
+
|
|
279
|
+
### Migration
|
|
280
|
+
- Tool: Flyway
|
|
281
|
+
- Path: `database/migrations/`
|
|
282
|
+
- Naming: `V{YYYYMMDD}_{seq}__{desc}.sql`
|
|
283
|
+
- BẮT BUỘC có ROLLBACK script
|
|
284
|
+
|
|
285
|
+
### Audit Columns (bắt buộc mọi table)
|
|
286
|
+
```sql
|
|
287
|
+
CREATED_BY VARCHAR2(50)
|
|
288
|
+
CREATED_DATE TIMESTAMP DEFAULT SYSTIMESTAMP
|
|
289
|
+
UPDATED_BY VARCHAR2(50)
|
|
290
|
+
UPDATED_DATE TIMESTAMP
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Soft Delete
|
|
294
|
+
```sql
|
|
295
|
+
IS_DELETED NUMBER(1) DEFAULT 0
|
|
296
|
+
-- Hoặc: STATUS = 'DELETED'
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## 9. SECURITY RULES
|
|
302
|
+
|
|
303
|
+
> Chi tiết → `.agent/rules/01-evnict-kit-general-rules.md`
|
|
304
|
+
> Chi tiết → `.agent/rules/02-evnict-kit-security-rules.md`
|
|
305
|
+
|
|
306
|
+
### Critical Rules — LÀM SAI = DỪNG NGAY
|
|
307
|
+
| # | Rule | Category |
|
|
308
|
+
|---|------|----------|
|
|
309
|
+
| R01 | Không hardcode secrets | General |
|
|
310
|
+
| R02 | Không git push | General |
|
|
311
|
+
| R03 | Không destructive ops | General |
|
|
312
|
+
| R04 | Không log PII | General |
|
|
313
|
+
| ATTT01 | SQL Injection prevention | Security |
|
|
314
|
+
| ATTT02 | XSS prevention | Security |
|
|
315
|
+
| ATTT04 | JWT RS256 only | Security |
|
|
316
|
+
| ATTT07 | No data exposure | Security |
|
|
317
|
+
|
|
318
|
+
### OWASP Top 10 Quick Check
|
|
319
|
+
- ✅ Parameterized queries (JOOQ type-safe)
|
|
320
|
+
- ✅ Response DTO (không Entity)
|
|
321
|
+
- ✅ JWT RS256, key ≥ 2048
|
|
322
|
+
- ✅ CSRF (JWT stateless → disabled)
|
|
323
|
+
- ✅ CSP headers
|
|
324
|
+
- ✅ File upload validation
|
|
325
|
+
- ✅ Error handler (no stack trace)
|
|
326
|
+
- ✅ Dependency scan
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## 10. AGENT COMMANDS
|
|
331
|
+
|
|
332
|
+
### Phase 1: Init (chạy 1 lần khi setup)
|
|
333
|
+
| Command | Mô tả |
|
|
334
|
+
|---------|--------|
|
|
335
|
+
| `/evnict-kit:init-rules` | Agent đọc code → điền rules RP01-RP07 |
|
|
336
|
+
| `/evnict-kit:init-context` | Agent sinh AGENTS.md từ rules |
|
|
337
|
+
| `/evnict-kit:init-check` | Agent sinh demo code để verify |
|
|
338
|
+
| `/evnict-kit:init-wiki` | Setup llm-wiki knowledge base |
|
|
339
|
+
|
|
340
|
+
### Phase 2: Development (sử dụng thường xuyên)
|
|
341
|
+
| Command | Mô tả |
|
|
342
|
+
|---------|--------|
|
|
343
|
+
| `/evnict-kit:feature-large` | Feature lớn: spec→plan→TDD→archive |
|
|
344
|
+
| `/evnict-kit:feature-small` | Feature nhỏ: plan→TDD |
|
|
345
|
+
| `/evnict-kit:bug-fix` | Sửa lỗi: reproduce→TDD fix |
|
|
346
|
+
| `/evnict-kit:implement` | TDD implement từ plan |
|
|
347
|
+
| `/evnict-kit:attt` | Scan ATTT (full hoặc module) |
|
|
348
|
+
| `/evnict-kit:review` | Auto review trước merge |
|
|
349
|
+
| `/evnict-kit:archive-wiki` | Archive spec + push wiki |
|
|
350
|
+
| `/evnict-kit:spec-archive` | Quản lý specs |
|
|
351
|
+
|
|
352
|
+
### Skills (tự động gọi bởi workflows)
|
|
353
|
+
| Skill | Mô tả |
|
|
354
|
+
|-------|--------|
|
|
355
|
+
| evnict-kit-spec | SDD: specify + clarify + plan |
|
|
356
|
+
| evnict-kit-tdd | TDD: Red→Green→Refactor |
|
|
357
|
+
| evnict-kit-wiki | Push/Query wiki |
|
|
358
|
+
| evnict-kit-create-api | Tạo API endpoint chuẩn |
|
|
359
|
+
| evnict-kit-create-component | Tạo UI component |
|
|
360
|
+
| evnict-kit-create-page | Tạo page mới |
|
|
361
|
+
| evnict-kit-database-migration | Migration scripts |
|
|
362
|
+
| evnict-kit-coordinate | FE↔BE coordination |
|
|
363
|
+
| evnict-kit-checkpoint | Checkpoint & rollback |
|
|
364
|
+
| evnict-kit-code-review | Code review (9 items) |
|
|
365
|
+
| evnict-kit-merge-checklist | Pre-merge check (9 items) |
|
|
366
|
+
| evnict-kit-security-audit | Security audit toàn diện |
|
|
367
|
+
| evnict-kit-fix-attt | Fix lỗi ATTT |
|
|
368
|
+
| evnict-kit-bug-fix | Bug fix flow |
|
|
369
|
+
| evnict-kit-fix-business-logic | Fix lỗi nghiệp vụ |
|
|
370
|
+
| evnict-kit-doc-postmortem | Tạo tài liệu đặc tả |
|
|
371
|
+
| evnict-kit-onboard | Onboard member mới |
|
|
372
|
+
| evnict-kit-prompt-standard | Chuẩn viết prompt |
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## 11. SAFETY RULES (NON-NEGOTIABLE)
|
|
377
|
+
|
|
378
|
+
```
|
|
379
|
+
❌ KHÔNG tự động git push
|
|
380
|
+
❌ KHÔNG xóa file/folder quan trọng
|
|
381
|
+
❌ KHÔNG hardcode secrets, passwords, API keys
|
|
382
|
+
❌ KHÔNG log PII (password, CMND, phone, token)
|
|
383
|
+
❌ KHÔNG expose stack trace cho client
|
|
384
|
+
❌ KHÔNG sửa code ngoài scope yêu cầu
|
|
385
|
+
❌ KHÔNG tiếp tục khi test fail > 3 lần (3-strike rule)
|
|
386
|
+
|
|
387
|
+
✅ Luôn tạo checkpoint trước phiên AI
|
|
388
|
+
✅ Luôn chạy test trước commit
|
|
389
|
+
✅ Luôn dùng DTO, không Entity trực tiếp
|
|
390
|
+
✅ Luôn validate input ở Controller
|
|
391
|
+
✅ Luôn transaction ở Service
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## 12. INTEGRATION MAP
|
|
397
|
+
|
|
398
|
+
<!-- CHƯA KHỞI TẠO — sẽ tóm tắt từ RP07 -->
|
|
399
|
+
|
|
400
|
+
| Service | Protocol | Usage |
|
|
401
|
+
|---------|----------|-------|
|
|
402
|
+
| EVN SSO | JWT (RS256) | Authentication |
|
|
403
|
+
| MinIO | S3 API | File storage |
|
|
404
|
+
| Redis | TCP | Session + cache |
|
|
405
|
+
| CMIS | HTTP | Document management |
|
|
406
|
+
| Azure DevOps | Git + Pipeline | CI/CD |
|
|
407
|
+
| Docker + K8s | Container | Deployment |
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## 13. WORKSPACE STRUCTURE
|
|
412
|
+
|
|
413
|
+
```
|
|
414
|
+
workspace/
|
|
415
|
+
├── .evnict/ ← Workspace config
|
|
416
|
+
│ ├── config.yaml ← Project configuration
|
|
417
|
+
│ ├── handoff/ ← FE↔BE coordination
|
|
418
|
+
│ │ ├── contracts/ ← API contracts
|
|
419
|
+
│ │ ├── be-status.md
|
|
420
|
+
│ │ └── fe-status.md
|
|
421
|
+
│ └── specs/ ← Feature specs
|
|
422
|
+
│ └── {feature}/
|
|
423
|
+
│ ├── spec.md
|
|
424
|
+
│ ├── plan.md
|
|
425
|
+
│ ├── tasks/
|
|
426
|
+
│ └── contracts/
|
|
427
|
+
├── {{BE_FOLDER}}/ ← Backend project
|
|
428
|
+
│ ├── .agent/
|
|
429
|
+
│ │ ├── rules/ ← 5 rule files
|
|
430
|
+
│ │ ├── skills/ ← 18 skills
|
|
431
|
+
│ │ ├── workflows/ ← 8 workflows
|
|
432
|
+
│ │ └── commands/ ← 4 commands
|
|
433
|
+
│ ├── AGENTS.md ← THIS FILE
|
|
434
|
+
│ └── Instruct-Agent-AI.md
|
|
435
|
+
├── {{FE_FOLDER}}/ ← Frontend project
|
|
436
|
+
│ └── (same structure)
|
|
437
|
+
├── docs/
|
|
438
|
+
│ ├── specs/ ← Archived specs
|
|
439
|
+
│ ├── attt/ ← Security reports
|
|
440
|
+
│ └── postmortem/ ← Session documents
|
|
441
|
+
├── database/
|
|
442
|
+
│ └── migrations/ ← DB migration scripts
|
|
443
|
+
└── {{PROJECT}}-wiki/ ← LLM Wiki knowledge base
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
---
|
|
447
|
+
|
|
448
|
+
## 14. REFERENCES
|
|
449
|
+
|
|
450
|
+
- **QĐ-TTPM**: Quy định hướng dẫn sử dụng AI trong PTPM tại EVNICT
|
|
451
|
+
- Điều 7: Thiết lập ngữ cảnh
|
|
452
|
+
- Điều 8: Nguyên tắc sử dụng AI an toàn
|
|
453
|
+
- Phụ lục II: Quy trình theo loại công việc
|
|
454
|
+
- Phụ lục III: Cấu trúc tài liệu thiết kế
|
|
455
|
+
- Phụ lục IV: Hướng dẫn thiết lập ngữ cảnh
|
|
456
|
+
- **OWASP Top 10:2021**: https://owasp.org/Top10/
|
|
457
|
+
- **evnict-kit**: v0.1.3
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
> ⚠️ **File này chứa sections "CHƯA KHỞI TẠO"**
|
|
462
|
+
> Chạy `/evnict-kit:init-context` để Agent tự động điền nội dung.
|