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,303 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
---
|
|
4
|
+
# General Rules — EVNICT Standard
|
|
5
|
+
**Activation Mode: Always On**
|
|
6
|
+
**Source: QĐ-TTPM Điều 8**
|
|
7
|
+
|
|
8
|
+
> **Các quy tắc này LUÔN được kiểm tra trong MỌI phiên làm việc với AI Agent.**
|
|
9
|
+
> Vi phạm → Agent PHải DỪNG và thông báo ngay.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. NO HARDCODED SECRETS (R01) — CRITICAL
|
|
14
|
+
|
|
15
|
+
### Nghiêm cấm tuyệt đối (QĐ-TTPM Điều 8, Mục 8.2)
|
|
16
|
+
KHÔNG BAO GIỜ viết trực tiếp vào source code:
|
|
17
|
+
- Mật khẩu, API keys, tokens, JWT secrets
|
|
18
|
+
- Connection strings chứa credentials
|
|
19
|
+
- IP/URLs nội bộ production
|
|
20
|
+
- Private keys, certificates
|
|
21
|
+
|
|
22
|
+
### Code examples
|
|
23
|
+
```java
|
|
24
|
+
// ❌ SAI — TUYỆT ĐỐI KHÔNG
|
|
25
|
+
String password = "admin123";
|
|
26
|
+
String apiKey = "sk-1234567890abcdef";
|
|
27
|
+
String dbUrl = "jdbc:oracle:thin:@10.0.1.5:1521:PROD";
|
|
28
|
+
private static final String JWT_SECRET = "my-super-secret-key";
|
|
29
|
+
|
|
30
|
+
// ✅ ĐÚNG — Environment variables / Application config
|
|
31
|
+
@Value("${spring.datasource.password}") String dbPassword;
|
|
32
|
+
@Value("${jwt.public-key-path}") String keyPath;
|
|
33
|
+
String apiKey = System.getenv("API_KEY");
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
// ❌ SAI
|
|
38
|
+
const API_URL = 'http://10.0.1.100:8080/api';
|
|
39
|
+
const TOKEN = 'eyJhbGciOiJIUzI1NiIs...';
|
|
40
|
+
|
|
41
|
+
// ✅ ĐÚNG
|
|
42
|
+
const API_URL = environment.apiUrl;
|
|
43
|
+
const TOKEN = this.authService.getToken();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Scan commands
|
|
47
|
+
```bash
|
|
48
|
+
grep -rn "password\s*=\s*\"" --include="*.java" --include="*.ts" src/
|
|
49
|
+
grep -rn "apiKey\s*=\s*\"" --include="*.java" --include="*.ts" src/
|
|
50
|
+
grep -rn "secret\s*=\s*\"" --include="*.java" --include="*.ts" src/
|
|
51
|
+
grep -rn "jdbc:oracle" --include="*.java" src/
|
|
52
|
+
grep -rn "10\.\|192\.168\.\|172\." --include="*.java" --include="*.ts" --include="*.yml" src/
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Khi phát hiện secret đã commit
|
|
56
|
+
1. **DỪNG NGAY** — không push thêm
|
|
57
|
+
2. **Rotate secret** — đổi password/key mới ngay lập tức
|
|
58
|
+
3. **Thông báo Tech Lead** + Tổ trưởng ANTT
|
|
59
|
+
4. `git filter-branch` hoặc `BFG Repo-Cleaner` để xóa khỏi history
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 2. NO AUTO GIT PUSH (R02)
|
|
64
|
+
|
|
65
|
+
### Quy tắc
|
|
66
|
+
- KHÔNG BAO GIỜ tự động chạy `git push`
|
|
67
|
+
- KHÔNG BAO GIỜ tự động chạy `git push --force`
|
|
68
|
+
- `git commit` được phép khi user yêu cầu rõ ràng
|
|
69
|
+
- `git add` + `git commit` → OK. `git push` → PHẢI HỎI USER
|
|
70
|
+
|
|
71
|
+
### Lý do
|
|
72
|
+
- Push sai branch → ảnh hưởng team
|
|
73
|
+
- Push code chưa review → vi phạm quy trình
|
|
74
|
+
- Force push → mất code của người khác
|
|
75
|
+
|
|
76
|
+
### Được phép
|
|
77
|
+
```bash
|
|
78
|
+
git add .
|
|
79
|
+
git commit -m "feat(module): description" # OK - local only
|
|
80
|
+
git status # OK - readonly
|
|
81
|
+
git log # OK - readonly
|
|
82
|
+
git diff # OK - readonly
|
|
83
|
+
git stash # OK - local only
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### KHÔNG được phép
|
|
87
|
+
```bash
|
|
88
|
+
git push # ❌ KHÔNG BAO GIỜ
|
|
89
|
+
git push --force # ❌ TUYỆT ĐỐI KHÔNG
|
|
90
|
+
git push origin main # ❌ KHÔNG
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 3. NO DESTRUCTIVE OPERATIONS (R03)
|
|
96
|
+
|
|
97
|
+
### Nghiêm cấm
|
|
98
|
+
- `rm -rf` trên thư mục quan trọng (src/, database/, docs/)
|
|
99
|
+
- `DROP TABLE`, `TRUNCATE TABLE` trong production
|
|
100
|
+
- `git reset --hard` trên shared branch
|
|
101
|
+
- Xóa file mà không có backup/git tracking
|
|
102
|
+
- Format/overwrite toàn bộ file mà không cần thiết
|
|
103
|
+
|
|
104
|
+
### Quy tắc
|
|
105
|
+
- Trước khi xóa → kiểm tra git status
|
|
106
|
+
- Trước khi DROP/TRUNCATE → hỏi user confirm
|
|
107
|
+
- Prefer `git stash` over xóa thủ công
|
|
108
|
+
- Luôn có rollback plan cho thay đổi database
|
|
109
|
+
|
|
110
|
+
### Scan commands
|
|
111
|
+
```bash
|
|
112
|
+
grep -rn "DROP\s\+TABLE\|TRUNCATE\s\+TABLE" --include="*.sql" --include="*.java" src/ database/
|
|
113
|
+
grep -rn "rm\s\+-rf\|rmdir" --include="*.sh" --include="*.bat" scripts/
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 4. NO PII IN LOGS (R04)
|
|
119
|
+
|
|
120
|
+
### Danh sách NGHIÊM CẤM log (QĐ-TTPM Điều 8, Mục 8.2)
|
|
121
|
+
- Mật khẩu, tokens, JWT, session IDs
|
|
122
|
+
- Số CMND/CCCD, số điện thoại cá nhân
|
|
123
|
+
- Email cá nhân, địa chỉ nhà
|
|
124
|
+
- Thông tin thẻ/tài khoản ngân hàng
|
|
125
|
+
- Dữ liệu khách hàng EVN (mã KH, số công tơ, điện năng tiêu thụ)
|
|
126
|
+
|
|
127
|
+
### Code examples
|
|
128
|
+
```java
|
|
129
|
+
// ❌ SAI — Log sensitive data
|
|
130
|
+
log.info("Login: user={}, password={}", username, password); // NEVER!
|
|
131
|
+
log.debug("Token: {}", jwtToken); // NEVER!
|
|
132
|
+
log.info("Customer phone: {}", customer.getPhone()); // PII!
|
|
133
|
+
log.info("CMND: {}", user.getCmnd()); // PII!
|
|
134
|
+
|
|
135
|
+
// ✅ ĐÚNG — Log IDs, actions, results
|
|
136
|
+
log.info("User {} logged in successfully", userId);
|
|
137
|
+
log.info("Customer id={} updated by user={}", customerId, userId);
|
|
138
|
+
log.warn("Login failed for user: {}", username);
|
|
139
|
+
log.info("Import completed: {} records processed", count);
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Scan commands
|
|
143
|
+
```bash
|
|
144
|
+
grep -rn "log\.\(info\|debug\|warn\|error\).*password\|log\.\(info\|debug\|warn\|error\).*token\|log\.\(info\|debug\|warn\|error\).*secret" --include="*.java" src/
|
|
145
|
+
grep -rn "console\.log.*password\|console\.log.*token" --include="*.ts" --include="*.tsx" src/
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 5. TEST BEFORE COMMIT (R05)
|
|
151
|
+
|
|
152
|
+
### Quy tắc (QĐ-TTPM Điều 8, Mục 8.4)
|
|
153
|
+
- **BẮT BUỘC** chạy test TRƯỚC khi commit
|
|
154
|
+
- Test ALL pass → commit
|
|
155
|
+
- Test FAIL → fix trước, không commit code lỗi
|
|
156
|
+
- Build FAIL → fix trước
|
|
157
|
+
|
|
158
|
+
### Quy trình
|
|
159
|
+
```bash
|
|
160
|
+
# Backend (Java Spring Boot)
|
|
161
|
+
./mvnw test # Unit tests
|
|
162
|
+
./mvnw spotless:check # Lint/format check
|
|
163
|
+
./mvnw compile # Build check
|
|
164
|
+
|
|
165
|
+
# Frontend (Angular)
|
|
166
|
+
ng test --watch=false # Unit tests
|
|
167
|
+
ng lint # Lint check
|
|
168
|
+
ng build # Build check
|
|
169
|
+
|
|
170
|
+
# .NET
|
|
171
|
+
dotnet test
|
|
172
|
+
dotnet build
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### SAU KHI test pass
|
|
176
|
+
```bash
|
|
177
|
+
git add .
|
|
178
|
+
git commit -m "feat(module): description [task-N]"
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 6. MINIMAL DIFF (R06)
|
|
184
|
+
|
|
185
|
+
### Quy tắc (QĐ-TTPM Điều 8, Mục 8.7 — Chống Vibe Coding)
|
|
186
|
+
- Chỉ sửa code **LIÊN QUAN TRỰC TIẾP** đến yêu cầu
|
|
187
|
+
- KHÔNG refactor code không liên quan
|
|
188
|
+
- KHÔNG thay đổi formatting của code không sửa
|
|
189
|
+
- KHÔNG thêm imports không cần thiết
|
|
190
|
+
- KHÔNG đổi tên biến/hàm nếu không được yêu cầu
|
|
191
|
+
|
|
192
|
+
### Dấu hiệu Vibe Coding (DỪNG NGAY)
|
|
193
|
+
- Sửa cùng đoạn code > **3 lần** mà lỗi chưa fix
|
|
194
|
+
- Code sinh ra chứa logic trùng lặp hoặc mâu thuẫn
|
|
195
|
+
- Module/function phình to bất thường so với yêu cầu
|
|
196
|
+
- Thay đổi nhiều file không liên quan
|
|
197
|
+
|
|
198
|
+
### Khi phát hiện Vibe Coding
|
|
199
|
+
1. **DỪNG phiên AI** ngay lập tức
|
|
200
|
+
2. Thông báo user: "Phát hiện dấu hiệu vibe coding, cần phân tích thủ công"
|
|
201
|
+
3. **Chia nhỏ yêu cầu** — 1 prompt = 1 nhiệm vụ đơn lẻ
|
|
202
|
+
4. Code không giải thích được = không merge
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 7. NO PLACEHOLDER CODE (R07)
|
|
207
|
+
|
|
208
|
+
### Quy tắc
|
|
209
|
+
- KHÔNG viết `// TODO: implement later`
|
|
210
|
+
- KHÔNG viết method rỗng hoặc return null/empty
|
|
211
|
+
- KHÔNG viết `throw new UnsupportedOperationException()`
|
|
212
|
+
- Mỗi function PHẢI có logic thực tế hoặc KHÔNG viết
|
|
213
|
+
|
|
214
|
+
### Code examples
|
|
215
|
+
```java
|
|
216
|
+
// ❌ SAI — Placeholder
|
|
217
|
+
public List<CustomerDTO> search(String keyword) {
|
|
218
|
+
// TODO: implement search
|
|
219
|
+
return Collections.emptyList();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// ❌ SAI — Stub
|
|
223
|
+
public void processPayment(PaymentRequest request) {
|
|
224
|
+
throw new UnsupportedOperationException("Not implemented");
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// ✅ ĐÚNG — Code thực tế
|
|
228
|
+
public List<CustomerDTO> search(String keyword) {
|
|
229
|
+
return dsl.selectFrom(CUSTOMER)
|
|
230
|
+
.where(CUSTOMER.NAME.containsIgnoreCase(keyword))
|
|
231
|
+
.fetchInto(CustomerDTO.class);
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Ngoại lệ
|
|
236
|
+
- `// TODO` chỉ được phép khi user YÊU CẦU RÀNH MẠCH viết skeleton
|
|
237
|
+
- Phải kèm ticket/task reference: `// TODO [TASK-123]: implement payment gateway integration`
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## 8. RESPECT GITIGNORE (R08)
|
|
242
|
+
|
|
243
|
+
### Quy tắc
|
|
244
|
+
KHÔNG tạo, sửa, commit files thuộc .gitignore:
|
|
245
|
+
- `node_modules/`
|
|
246
|
+
- `target/`, `build/`, `dist/`
|
|
247
|
+
- `.env`, `.env.local`, `.env.production`
|
|
248
|
+
- `*.key`, `*.pem`, `*.p12`, `*.jks`
|
|
249
|
+
- `application-prod.yml`
|
|
250
|
+
- `.idea/`, `.vscode/` (nếu trong .gitignore)
|
|
251
|
+
- `*.log`, `*.tmp`
|
|
252
|
+
|
|
253
|
+
### .gitignore BẮT BUỘC chặn
|
|
254
|
+
```gitignore
|
|
255
|
+
# Secrets
|
|
256
|
+
.env
|
|
257
|
+
.env.local
|
|
258
|
+
.env.production
|
|
259
|
+
*.key
|
|
260
|
+
*.pem
|
|
261
|
+
*.p12
|
|
262
|
+
*.jks
|
|
263
|
+
application-prod.yml
|
|
264
|
+
|
|
265
|
+
# Build
|
|
266
|
+
target/
|
|
267
|
+
build/
|
|
268
|
+
dist/
|
|
269
|
+
node_modules/
|
|
270
|
+
|
|
271
|
+
# IDE
|
|
272
|
+
.idea/
|
|
273
|
+
*.iml
|
|
274
|
+
|
|
275
|
+
# Logs
|
|
276
|
+
*.log
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Trước khi tạo file mới
|
|
280
|
+
1. Kiểm tra `.gitignore` → file có bị ignore không?
|
|
281
|
+
2. Nếu bị ignore → KHÔNG tạo (hoặc hỏi user)
|
|
282
|
+
3. Nếu cần file config → dùng `.example` suffix: `application-prod.yml.example`
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## CHECKPOINT & ROLLBACK (QĐ-TTPM Điều 8, Mục 8.8)
|
|
287
|
+
|
|
288
|
+
### TRƯỚC KHI bắt đầu phiên AI — BẮT BUỘC
|
|
289
|
+
```bash
|
|
290
|
+
# Option 1: Branch riêng (KHUYẾN NGHỊ)
|
|
291
|
+
git checkout -b feature/ai-task-xxx
|
|
292
|
+
|
|
293
|
+
# Option 2: Commit checkpoint
|
|
294
|
+
git add . && git commit -m "checkpoint: before AI session"
|
|
295
|
+
|
|
296
|
+
# Option 3: Stash
|
|
297
|
+
git stash
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Yêu cầu
|
|
301
|
+
- Revert được trong ≤ **1 thao tác git** (`git revert` hoặc `git reset`)
|
|
302
|
+
- Thay đổi lớn (nhiều file/module) → Rollback plan bằng văn bản trước khi thực hiện
|
|
303
|
+
- KHÔNG bắt đầu implement mà không có checkpoint
|