evnict-kit 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +39 -2
  2. package/bin/cli.js +7 -1
  3. package/package.json +1 -1
  4. package/scripts/patch-workflows.js +142 -0
  5. package/scripts/postinstall.js +1 -1
  6. package/src/commands/init.js +18 -9
  7. package/src/commands/sync.js +317 -0
  8. package/src/commands/upgrade.js +7 -1
  9. package/src/utils/config.js +2 -2
  10. package/templates/GETTING-STARTED.md +23 -2
  11. package/templates/content/skills/evnict-kit-bug-fix/SKILL.md +1 -1
  12. package/templates/content/skills/evnict-kit-git-worktrees/SKILL.md +0 -2
  13. package/templates/content/skills/evnict-kit-onboard/SKILL.md +0 -1
  14. package/templates/content/skills/evnict-kit-spec/SKILL.md +1 -1
  15. package/templates/content/skills/evnict-kit-wiki/SKILL.md +16 -54
  16. package/templates/content/workflows/evnict-kit-archive-wiki.md +4 -5
  17. package/templates/content/workflows/evnict-kit-attt.md +1 -1
  18. package/templates/content/workflows/evnict-kit-bug-fix.md +1 -1
  19. package/templates/content/workflows/evnict-kit-feature-large.md +2 -2
  20. package/templates/content/workflows/evnict-kit-feature-small.md +1 -1
  21. package/templates/content/workflows/evnict-kit-init-wiki.md +18 -47
  22. package/templates/content/workflows/evnict-kit-wiki-archive-feature.md +2 -3
  23. package/templates/content/workflows/evnict-kit-wiki-query.md +3 -3
  24. package/templates/content/workflows/evnict-kit-wiki-scan-project.md +3 -4
  25. package/templates/skills/evnict-kit-bug-fix/SKILL.md +1 -1
  26. package/templates/skills/evnict-kit-create-component/SKILL.md +23 -0
  27. package/templates/skills/evnict-kit-create-page/SKILL.md +23 -0
  28. package/templates/skills/evnict-kit-frontend-design/SKILL.md +161 -0
  29. package/templates/skills/evnict-kit-spec/SKILL.md +1 -1
  30. package/templates/skills/evnict-kit-wiki/SKILL.md +16 -54
  31. package/templates/wiki/AGENTS.md +280 -0
  32. package/templates/wiki/CLAUDE.md +280 -0
  33. package/templates/wiki/FAQ.md +168 -0
  34. package/templates/wiki/README.md +272 -35
  35. package/templates/wiki/config.example.yaml +145 -17
  36. package/templates/wiki/scripts/run-wiki.sh +17 -0
  37. package/templates/wiki/scripts/setup-scheduler.ps1 +29 -0
  38. package/templates/wiki/skills/llm-wiki/SKILL.md +341 -0
  39. package/templates/wiki/wiki/INDEX.md +9 -0
  40. package/templates/wiki/wiki/INDEX.template.md +29 -0
  41. package/templates/wiki/wiki/LOG.md +3 -0
  42. package/templates/wiki/wiki/LOG.template.md +7 -0
  43. package/templates/wiki/wiki-viewer.html +408 -0
  44. package/templates/workflows/antigravity/evnict-kit-archive-wiki.md +24 -5
  45. package/templates/workflows/antigravity/evnict-kit-attt.md +21 -1
  46. package/templates/workflows/antigravity/evnict-kit-bug-fix.md +24 -1
  47. package/templates/workflows/antigravity/evnict-kit-feature-large.md +26 -2
  48. package/templates/workflows/antigravity/evnict-kit-feature-small.md +24 -1
  49. package/templates/workflows/antigravity/evnict-kit-handoff.md +23 -0
  50. package/templates/workflows/antigravity/evnict-kit-implement.md +23 -0
  51. package/templates/workflows/antigravity/evnict-kit-init-check.md +20 -0
  52. package/templates/workflows/antigravity/evnict-kit-init-context.md +20 -0
  53. package/templates/workflows/antigravity/evnict-kit-init-rules.md +20 -0
  54. package/templates/workflows/antigravity/evnict-kit-init-wiki.md +26 -8
  55. package/templates/workflows/antigravity/evnict-kit-plan.md +24 -0
  56. package/templates/workflows/antigravity/evnict-kit-review.md +20 -0
  57. package/templates/workflows/antigravity/evnict-kit-spec-archive.md +20 -0
  58. package/templates/workflows/antigravity/evnict-kit-wiki-archive-feature.md +22 -3
  59. package/templates/workflows/antigravity/evnict-kit-wiki-query.md +23 -3
  60. package/templates/workflows/antigravity/evnict-kit-wiki-scan-project.md +23 -4
  61. package/templates/workflows/claude/evnict-kit-archive-wiki.md +24 -5
  62. package/templates/workflows/claude/evnict-kit-attt.md +21 -1
  63. package/templates/workflows/claude/evnict-kit-bug-fix.md +24 -1
  64. package/templates/workflows/claude/evnict-kit-feature-large.md +26 -2
  65. package/templates/workflows/claude/evnict-kit-feature-small.md +24 -1
  66. package/templates/workflows/claude/evnict-kit-handoff.md +23 -0
  67. package/templates/workflows/claude/evnict-kit-implement.md +23 -0
  68. package/templates/workflows/claude/evnict-kit-init-check.md +20 -0
  69. package/templates/workflows/claude/evnict-kit-init-context.md +20 -0
  70. package/templates/workflows/claude/evnict-kit-init-rules.md +20 -0
  71. package/templates/workflows/claude/evnict-kit-init-wiki.md +25 -7
  72. package/templates/workflows/claude/evnict-kit-plan.md +24 -0
  73. package/templates/workflows/claude/evnict-kit-review.md +20 -0
  74. package/templates/workflows/claude/evnict-kit-spec-archive.md +20 -0
  75. package/templates/workflows/claude/evnict-kit-wiki-archive-feature.md +22 -3
  76. package/templates/workflows/claude/evnict-kit-wiki-query.md +23 -3
  77. package/templates/workflows/claude/evnict-kit-wiki-scan-project.md +23 -4
  78. package/templates/wiki/package.json +0 -17
  79. package/templates/wiki/raw/notes/.gitkeep +0 -1
  80. package/templates/wiki/scripts/ingest.js +0 -66
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: evnict-kit-frontend-design
3
+ description: Hướng dẫn tư duy thiết kế UI chất lượng cao cho Angular. Tập trung vào design thinking, aesthetics, typography, color, motion — tránh UI generic "AI slop". Dùng khi tạo component, page, hoặc cải thiện giao diện.
4
+ compatibility: Angular 16+
5
+ ---
6
+
7
+ # evnict-kit-frontend-design — Thiết kế UI Chất lượng Cao
8
+
9
+ ## Khi nào dùng
10
+ - Tạo UI component/page mới
11
+ - Cải thiện giao diện hiện có
12
+ - Thiết kế landing page, dashboard, form phức tạp
13
+ - Khi cần UI vượt trội hơn mức "tạm được"
14
+
15
+ ## Nguyên tắc cốt lõi
16
+ > **UI do AI sinh ra PHẢI trông như được thiết kế bởi designer chuyên nghiệp,
17
+ > KHÔNG phải output generic của AI.**
18
+
19
+ ---
20
+
21
+ ## 1. Design Thinking — TRƯỚC KHI CODE
22
+
23
+ Trước khi viết bất kỳ dòng code nào, Agent PHẢI trả lời 4 câu hỏi:
24
+
25
+ ### 1.1 Purpose — Giao diện này giải quyết vấn đề gì?
26
+ - Ai là người dùng? (admin, nhân viên, khách hàng?)
27
+ - Họ cần làm gì? (nhập liệu, tra cứu, phê duyệt?)
28
+ - Tần suất sử dụng? (hàng ngày vs. thi thoảng)
29
+
30
+ ### 1.2 Tone — Chọn hướng thẩm mỹ RÕ RÀNG
31
+ Không dùng "trung tính an toàn". Chọn 1 hướng và đẩy mạnh:
32
+ - **Refined/Professional** — enterprise app, dashboard, quản trị
33
+ - **Minimalist/Clean** — form nhập liệu, workflow step-by-step
34
+ - **Data-Dense/Utilitarian** — bảng dữ liệu lớn, reporting
35
+ - **Modern/Dynamic** — landing page, portal, user-facing
36
+ - **Soft/Approachable** — onboarding, wizard, hướng dẫn
37
+
38
+ ### 1.3 Constraints — Ràng buộc kỹ thuật
39
+ - Framework: Angular (tuân thủ Angular conventions)
40
+ - Component library đang dùng trong project
41
+ - Responsive requirements
42
+ - Accessibility requirements
43
+ - Performance constraints
44
+
45
+ ### 1.4 Differentiation — Điểm nhấn đáng nhớ
46
+ - UI này có gì KHÁC BIỆT so với template mặc định?
47
+ - Người dùng sẽ nhớ gì sau khi rời trang?
48
+ - Micro-interaction nào tạo cảm giác "chuyên nghiệp"?
49
+
50
+ ---
51
+
52
+ ## 2. Nguyên tắc Thẩm mỹ — Frontend Aesthetics
53
+
54
+ ### 2.1 Typography — Chữ phải ĐẸP và CÓ CÁ TÍNH
55
+ - **KHÔNG dùng** font generic mặc định (Arial, system fonts)
56
+ - **Chọn font có cá tính** phù hợp với tone của ứng dụng
57
+ - **Pair fonts:** 1 display font nổi bật + 1 body font dễ đọc
58
+ - **Hierarchy rõ ràng:** heading > subheading > body > caption
59
+ - **Spacing:** line-height, letter-spacing phải được tinh chỉnh — không dùng default
60
+
61
+ ### 2.2 Color & Theme — Màu sắc PHẢI có chủ đích
62
+ - **Commit vào 1 color palette nhất quán** — dùng CSS variables
63
+ - **Dominant + Accent:** 1 màu chủ đạo mạnh + 1-2 màu nhấn, tốt hơn nhiều màu đều nhau
64
+ - **TRÁNH:** tím gradient trên nền trắng (AI cliché), màu quá generic (red/blue/green thuần)
65
+ - **Dark mode:** Nếu phù hợp — dark theme tạo cảm giác premium cho enterprise app
66
+ - **Semantic colors:** success/warning/error/info phải nhất quán toàn app
67
+
68
+ ### 2.3 Motion & Micro-interactions — Sống động nhưng KHÔNG rối
69
+ - **Ưu tiên CSS-only:** transitions, animations — không cần thêm lib nếu không cần thiết
70
+ - **High-impact moments:** page load staggered reveal, hover state, expand/collapse
71
+ - **Scroll-triggered effects:** chỉ dùng khi phù hợp (landing page, dashboard)
72
+ - **Form feedback:** input focus, validation animation, submit loading state
73
+ - **NGUYÊN TẮC:** 1 animation tốt > 10 animation rời rạc
74
+
75
+ ### 2.4 Spatial Composition — Bố cục KHÔNG nhàm chán
76
+ - **TRÁNH:** layout đối xứng hoàn toàn, mọi thứ căn giữa
77
+ - **Negative space:** khoảng trống có chủ đích tạo sự thoáng
78
+ - **Grid-breaking:** 1-2 element phá grid tạo điểm nhấn
79
+ - **Card depth:** shadow, border, background tạo layer hierarchy
80
+ - **Responsive:** mobile-first, breakpoints hợp lý
81
+
82
+ ### 2.5 Backgrounds & Visual Details — Tạo chiều sâu
83
+ - **KHÔNG mặc định nền trắng/xám nhạt** — cân nhắc gradient nhẹ, pattern, texture
84
+ - **Depth effects:** shadow layers, glassmorphism (nếu phù hợp)
85
+ - **Decorative elements:** border styles, dividers, icons có phong cách
86
+ - **NGUYÊN TẮC:** Mỗi pixel phải có lý do tồn tại
87
+
88
+ ---
89
+
90
+ ## 3. Anti-Patterns — TUYỆT ĐỐI TRÁNH
91
+
92
+ ### ❌ "AI Slop" — Dấu hiệu UI sinh bởi AI kém chất lượng
93
+ - Font Inter/Roboto/Arial trên mọi project
94
+ - Tím gradient (#6366f1 → #8b5cf6) trên nền trắng
95
+ - Card bo góc 8px + shadow nhẹ — mọi component giống nhau
96
+ - Layout 100% đối xứng, không có điểm nhấn
97
+ - Icon generic không có phong cách riêng
98
+ - Spacing đều đặn máy móc, không có rhythm
99
+
100
+ ### ✅ Dấu hiệu UI được THIẾT KẾ tốt
101
+ - Font choice phản ánh tính cách ứng dụng
102
+ - Color palette có chủ đích, nhất quán
103
+ - Layout có hierarchy rõ, mắt biết nhìn đâu trước
104
+ - Micro-interactions tạo feedback tự nhiên
105
+ - Mỗi trang/component có "cá tính" riêng — không copy-paste aesthetic
106
+
107
+ ---
108
+
109
+ ## 4. Áp dụng cho Angular
110
+
111
+ ### 4.1 Component Design
112
+ - Mỗi component nên có CSS riêng — KHÔNG dùng inline styles tràn lan
113
+ - Dùng CSS variables cho theme consistency
114
+ - `:host` styling để component self-contained
115
+ - `@media` queries cho responsive — mobile-first
116
+
117
+ ### 4.2 Theming
118
+ - Định nghĩa design tokens (colors, spacing, typography) ở root/shared level
119
+ - Component consume tokens — KHÔNG hardcode values
120
+ - Support theme switching nếu dự án yêu cầu
121
+
122
+ ### 4.3 Animation trong Angular
123
+ - Ưu tiên CSS transitions/animations
124
+ - Angular Animations API cho complex state transitions
125
+ - `@defer` cho lazy-loaded content với loading states đẹp
126
+
127
+ ### 4.4 Responsive
128
+ - Breakpoints nhất quán toàn project
129
+ - Mobile layout PHẢI được thiết kế — không chỉ "co lại"
130
+ - Table → card view trên mobile
131
+ - Navigation → hamburger/drawer trên mobile
132
+
133
+ ---
134
+
135
+ ## 5. Quy trình áp dụng
136
+
137
+ ```
138
+ 1. Đọc yêu cầu → Trả lời 4 câu hỏi Design Thinking
139
+ 2. Chọn tone + color palette + typography
140
+ 3. Sketch layout (mô tả text hoặc wireframe đơn giản)
141
+ 4. Implement component với full styling
142
+ 5. Review: so sánh với Anti-Patterns checklist
143
+ 6. Polish: micro-interactions, responsive, accessibility
144
+ ```
145
+
146
+ > **QUAN TRỌNG:** Match complexity với vision.
147
+ > - Design maximalist → code phải elaborate (animations, effects, layers)
148
+ > - Design minimalist → code phải precise (spacing, typography, subtle details)
149
+ > - Elegance = thực thi đúng vision, không phải nhiều hay ít code
150
+
151
+ ---
152
+
153
+ ## Tiêu chí chất lượng
154
+ - [ ] Design Thinking 4 câu hỏi đã trả lời
155
+ - [ ] Tone thẩm mỹ rõ ràng, nhất quán
156
+ - [ ] Typography: font có cá tính, hierarchy rõ
157
+ - [ ] Color: palette nhất quán, có dominant + accent
158
+ - [ ] Layout: có hierarchy, không đối xứng nhàm chán
159
+ - [ ] Motion: ít nhất 1 micro-interaction có ý nghĩa
160
+ - [ ] Responsive: mobile-first, breakpoints hợp lý
161
+ - [ ] KHÔNG có dấu hiệu "AI slop"
@@ -24,7 +24,7 @@ compatibility: Java Spring Boot, Angular, ASP.NET Core
24
24
  1. Đọc `.evnict/config.yaml` → lấy project name, tech stack, wiki path
25
25
  2. Đọc `.agent/rules/05-evnict-kit-project-conventions.md` → nắm conventions dự án
26
26
  3. Query wiki (nếu có):
27
- - Đọc index từ `{wiki_path}/processed/`
27
+ - Đọc index từ `{wiki_path}/wiki/`
28
28
  - Tìm theo keyword/domain/tags từ mô tả feature
29
29
  - Nếu tìm được context liên quan → đưa vào spec
30
30
  4. Scan codebase:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: evnict-kit-wiki
3
3
  description: Quản lý knowledge base dự án bằng LLM Wiki. Push tri thức, query, ingest, status, scan-code. Tích hợp sẵn vào cuối mọi workflow.
4
- compatibility: Node.js 18+
4
+ compatibility: AI Agent (Claude Code / Antigravity)
5
5
  ---
6
6
 
7
7
  # evnict-kit-wiki — Project Knowledge Base
@@ -119,21 +119,8 @@ cp {generated_file} {wiki_path}/raw/notes/{domain}-{slug}.md
119
119
  ```
120
120
 
121
121
  #### Bước 4: TỰ ĐỘNG chạy ingest
122
- **KHÔNG bắt user chạy npm thủ công.** Agent TRỰC TIẾP chạy:
123
- ```bash
124
- cd {wiki_path} && node scripts/ingest.js
125
- ```
126
-
127
- Nếu `scripts/ingest.js` không tồn tại → thử:
128
- ```bash
129
- cd {wiki_path} && npm run ingest
130
- ```
131
-
132
- Nếu vẫn fail → retry 1 lần → nếu vẫn fail → báo lỗi cụ thể:
133
- ```
134
- ❌ Ingest failed: {error message}
135
- Thử: cd {wiki_path} && npm install && node scripts/ingest.js
136
- ```
122
+ **KHÔNG bắt user chạy node/npm.** Agent TRỰC TIẾP chạy ingest:
123
+ Thực hiện ingest procedure (tiến hành theo hướng dẫn Sub-command INGEST).
137
124
 
138
125
  #### Bước 5: Confirm
139
126
  ```
@@ -155,7 +142,7 @@ Nếu vẫn fail → retry 1 lần → nếu vẫn fail → báo lỗi cụ th
155
142
 
156
143
  #### Bước 1: Đọc wiki INDEX
157
144
  ```bash
158
- cat {wiki_path}/wiki/INDEX.md 2>/dev/null || cat {wiki_path}/processed/INDEX.md 2>/dev/null
145
+ cat {wiki_path}/wiki/INDEX.md 2>/dev/null || cat {wiki_path}/wiki/INDEX.md 2>/dev/null
159
146
  ```
160
147
  Map keywords từ input vào index.
161
148
 
@@ -163,7 +150,7 @@ Map keywords từ input vào index.
163
150
  ```bash
164
151
  # Tìm trong wiki pages
165
152
  grep -rl "{keyword}" {wiki_path}/wiki/ --include="*.md" 2>/dev/null
166
- grep -rl "{keyword}" {wiki_path}/processed/ --include="*.md" 2>/dev/null
153
+ grep -rl "{keyword}" {wiki_path}/wiki/ --include="*.md" 2>/dev/null
167
154
  # Tìm trong raw notes
168
155
  grep -rl "{keyword}" {wiki_path}/raw/notes/ --include="*.md" 2>/dev/null
169
156
  ```
@@ -193,34 +180,13 @@ grep -rl "{keyword}" {wiki_path}/raw/notes/ --include="*.md" 2>/dev/null
193
180
 
194
181
  ---
195
182
 
196
- ## Sub-command: INGEST Xử raw → wiki pages
197
-
198
- ### Quy trình
199
-
200
- #### Bước 1: Scan raw sources
201
- ```bash
202
- ls {wiki_path}/raw/notes/ | wc -l # Đếm raw files
203
- ls {wiki_path}/wiki/ | wc -l # Đếm wiki pages
204
- ```
205
-
206
- #### Bước 2: Chạy ingest script
207
- Agent TRỰC TIẾP chạy (KHÔNG bắt user):
208
- ```bash
209
- cd {wiki_path} && node scripts/ingest.js
210
- ```
211
-
212
- #### Bước 3: Verify kết quả
213
- Với mỗi raw file đã xử lý:
214
- - Source summary → `wiki/sources/`
215
- - Entities extracted → `wiki/entities/`
216
- - Concepts extracted → `wiki/concepts/`
217
- - Cross-references thêm vào
218
-
219
- #### Bước 4: Cập nhật index
220
- ```bash
221
- cat {wiki_path}/wiki/INDEX.md # Verify index updated
222
- cat {wiki_path}/wiki/LOG.md # Check log
223
- ```
183
+ ## Sub-command: INGEST (từ project qua symlink)
184
+ 1. Wiki path: {project_name}-wiki/ (symlink)
185
+ 2. Đọc {wiki_path}/CLAUDE.md → hiểu schema
186
+ 3. Scan {wiki_path}/raw/notes/ → tìm file chưa có trong history.json
187
+ 4. Sinh wiki/sources/, wiki/entities/, wiki/concepts/
188
+ 5. Cập nhật INDEX.md + LOG.md + history.json
189
+ Agent tự làm hết, KHÔNG cần mở Agent riêng
224
190
 
225
191
  ### QUAN TRỌNG
226
192
  - **KHÔNG BAO GIỜ** sửa file trong `raw/`
@@ -281,9 +247,7 @@ Với mỗi note đã sinh → copy vào `raw/notes/`
281
247
  Naming: `{domain}-{type}-{slug}.md`
282
248
 
283
249
  #### Bước 5: Chạy ingest
284
- ```bash
285
- cd {wiki_path} && node scripts/ingest.js
286
- ```
250
+ Thực hiện ingest procedure (tiến hành theo hướng dẫn Sub-command INGEST).
287
251
 
288
252
  #### Bước 6: Report
289
253
  ```
@@ -392,13 +356,11 @@ B) Không — skip, tôi sẽ push thủ công sau
392
356
 
393
357
  ### DỪNG khi:
394
358
  - Wiki folder không tồn tại → *"Chạy `/evnict-kit:init-wiki` trước"*
395
- - `node scripts/ingest.js` failRetry 1 lần → hiển thị error cụ thể
359
+ - Error file configVerify `config.yaml`
396
360
  - Frontmatter thiếu required fields → KHÔNG push, sửa trước
397
361
 
398
362
  ### Auto-recovery:
399
- - ingest fail lần 1 retry lần 2
400
- - scripts/ingest.js không tồn tại → thử npm run ingest
401
- - npm run ingest fail → báo: "cd {wiki_path} && npm install"
363
+ - Agent tự động bổ sung file chưa hoàn thiện.
402
364
 
403
365
  ---
404
366
 
@@ -406,7 +368,7 @@ B) Không — skip, tôi sẽ push thủ công sau
406
368
  - [ ] File markdown tạo đúng format frontmatter (llm-wiki chuẩn)
407
369
  - [ ] Nội dung đầy đủ (API, DB, BR, files, lessons)
408
370
  - [ ] File đã copy vào `raw/notes/` đúng naming
409
- - [ ] Ingest đã trigger TỰ ĐỘNG (node scripts/ingest.js)
371
+ - [ ] Ingest đã thực hiện hoàn tất TỰ ĐỘNG
410
372
  - [ ] Query trả về results có format rõ ràng + gap detection
411
373
  - [ ] scan-code sinh được wiki notes từ codebase
412
374
  - [ ] Status cho health check chính xác
@@ -0,0 +1,280 @@
1
+ # LLM Wiki — Schema & Quy tắc vận hành
2
+
3
+ > Hệ thống knowledge base cá nhân dựa trên pattern của Andrej Karpathy.
4
+ > LLM xây dựng và duy trì wiki từ nguồn thô. Con người chỉ đọc wiki và hỏi đáp.
5
+
6
+ ## Kiến trúc 3 lớp
7
+
8
+ ```
9
+ raw/ → Nguồn thô (bất biến — LLM CHỈ ĐỌC, KHÔNG BAO GIỜ SỬA)
10
+ wiki/ → Wiki do LLM viết & duy trì hoàn toàn
11
+ outputs/ → Kết quả query, reports, phân tích
12
+ config.yaml → Cấu hình topics, feeds, lịch chạy
13
+ ```
14
+
15
+ ## Cấu trúc thư mục
16
+
17
+ ```
18
+ llm-wiki/
19
+ ├── CLAUDE.md ← File này — schema & quy tắc
20
+ ├── config.yaml ← Cấu hình hệ thống
21
+ ├── raw/ ← Nguồn thô (KHÔNG ĐƯỢC SỬA)
22
+ │ ├── articles/ ← Web articles (markdown, text)
23
+ │ ├── papers/ ← PDF, research papers
24
+ │ ├── notes/ ← Ghi chú cá nhân
25
+ │ ├── media/ ← Screenshots, diagrams
26
+ │ └── assets/ ← Downloaded images từ articles
27
+ ├── wiki/ ← LLM sở hữu toàn bộ
28
+ │ ├── INDEX.md ← Catalog mọi trang wiki
29
+ │ ├── LOG.md ← Timeline sự kiện
30
+ │ ├── entities/ ← Người, tổ chức, tool, project
31
+ │ ├── concepts/ ← Khái niệm, pattern, methodology
32
+ │ ├── sources/ ← Summary từng raw source
33
+ │ └── syntheses/ ← Phân tích tổng hợp, so sánh
34
+ ├── outputs/ ← Kết quả query & reports
35
+ └── .discoveries/ ← Metadata cho auto-discovery
36
+ ├── feeds.json ← Nguồn đang theo dõi
37
+ ├── gaps.json ← Knowledge gaps cần lấp
38
+ └── history.json ← Nguồn đã xử lý (tránh trùng)
39
+ ```
40
+
41
+ ## Quy tắc vàng
42
+
43
+ ### 1. Raw sources là bất biến
44
+ - KHÔNG BAO GIỜ sửa, xóa, hoặc di chuyển file trong `raw/`
45
+ - Đây là source of truth — mọi thứ trong wiki phải truy ngược được về raw
46
+
47
+ ### 2. Wiki do LLM sở hữu hoàn toàn
48
+ - Con người KHÔNG sửa wiki bằng tay
49
+ - LLM tạo, cập nhật, xóa trang wiki
50
+ - Mỗi thay đổi phải được ghi vào LOG.md
51
+
52
+ ### 3. Mỗi topic một file
53
+ - Mỗi entity, concept, source summary là một file `.md` riêng
54
+ - File name: `kebab-case.md` (VD: `andrej-karpathy.md`, `llm-agents.md`)
55
+ - Không tạo file quá dài — tách thành nhiều file nếu > 500 dòng
56
+
57
+ ### 4. Cross-reference bằng wiki links
58
+ - Dùng format `[[tên-file]]` để liên kết giữa các trang
59
+ - Mỗi trang nên có ít nhất 2 liên kết đến trang khác
60
+ - Orphan pages (không ai liên kết đến) cần được phát hiện khi lint
61
+
62
+ ### 5. INDEX.md luôn cập nhật
63
+ - Mỗi lần tạo/xóa trang → cập nhật INDEX.md
64
+ - Format: `- [Tên trang](path) — mô tả một dòng`
65
+ - Phân nhóm theo category: entities, concepts, sources, syntheses
66
+
67
+ ### 6. LOG.md ghi nhận mọi hoạt động
68
+ - Format: `## [YYYY-MM-DD HH:mm] action | Mô tả`
69
+ - Actions: `ingest`, `query`, `lint`, `discover`, `update`
70
+ - Mỗi entry ghi rõ: files đã tạo/sửa, số trang bị ảnh hưởng
71
+
72
+ ## Workflows
73
+
74
+ ### Ingest (Nhập nguồn mới)
75
+
76
+ ```
77
+ 1. Đọc file mới trong raw/
78
+ 2. Tạo source summary trong wiki/sources/
79
+ 3. Trích xuất entities → tạo/cập nhật wiki/entities/
80
+ 4. Trích xuất concepts → tạo/cập nhật wiki/concepts/
81
+ 5. Tìm connections với trang đã có → thêm cross-references
82
+ 6. Phát hiện contradictions với nội dung cũ → ghi chú
83
+ 7. Cập nhật INDEX.md
84
+ 8. Ghi LOG.md
85
+ 9. Cập nhật .discoveries/history.json
86
+ ```
87
+
88
+ **Quy tắc ingest:**
89
+ - Một source có thể ảnh hưởng 5-15 wiki pages
90
+ - Luôn trích dẫn nguồn: `[Nguồn: tên-file-raw](../raw/path)`
91
+ - Nếu thông tin mới mâu thuẫn với cũ → giữ cả hai, ghi rõ mâu thuẫn
92
+ - Không bịa thông tin — chỉ viết những gì có trong raw sources
93
+
94
+ ### Query (Hỏi đáp)
95
+
96
+ ```
97
+ 1. Đọc INDEX.md để tìm trang liên quan
98
+ 2. Đọc các trang wiki liên quan
99
+ 3. Tổng hợp câu trả lời với citations
100
+ 4. Nếu câu trả lời có giá trị → lưu vào outputs/ hoặc wiki/syntheses/
101
+ 5. Ghi LOG.md
102
+ ```
103
+
104
+ **Quy tắc query:**
105
+ - Trả lời dựa trên wiki, KHÔNG dựa trên kiến thức ngoài
106
+ - Nếu wiki không có đủ thông tin → nói rõ và gợi ý nguồn cần tìm
107
+ - Câu trả lời hay (so sánh, phân tích) → file lại thành wiki page mới
108
+
109
+ ### Lint (Kiểm tra sức khỏe)
110
+
111
+ ```
112
+ 1. Kiểm tra contradictions giữa các trang
113
+ 2. Tìm orphan pages (không ai liên kết đến)
114
+ 3. Tìm mentioned-but-missing (nhắc đến nhưng chưa có trang)
115
+ 4. Tìm stale claims (thông tin cũ bị nguồn mới bác bỏ)
116
+ 5. Tìm knowledge gaps (lĩnh vực thiếu coverage)
117
+ 6. Kiểm tra broken wiki links
118
+ 7. Đề xuất trang mới cần tạo
119
+ 8. Đề xuất nguồn mới cần tìm
120
+ 9. Ghi kết quả vào outputs/ và LOG.md
121
+ ```
122
+
123
+ ### Discover (Tự động tìm nguồn)
124
+
125
+ ```
126
+ 1. Đọc config.yaml → lấy danh sách topics & feeds
127
+ 2. Đọc .discoveries/gaps.json → lấy knowledge gaps
128
+ 3. Web search theo topics + gaps
129
+ 4. Scrape articles tìm được → lưu vào raw/articles/
130
+ 5. Cập nhật .discoveries/feeds.json & history.json
131
+ 6. Trigger ingest cho nguồn mới
132
+ 7. Ghi LOG.md
133
+ ```
134
+
135
+ **Quy tắc discover:**
136
+ - Chỉ tìm nguồn liên quan đến topics trong config.yaml
137
+ - Không tải lại nguồn đã có trong history.json
138
+ - Ưu tiên: gaps.json > trending topics > feeds định kỳ
139
+ - Mỗi lần discover tối đa 5-10 nguồn mới (tránh overload)
140
+
141
+ ## Format trang wiki
142
+
143
+ ### Entity page (wiki/entities/)
144
+
145
+ ```markdown
146
+ ---
147
+ type: entity
148
+ category: person | organization | tool | project
149
+ created: YYYY-MM-DD
150
+ updated: YYYY-MM-DD
151
+ sources: [danh sách raw sources]
152
+ ---
153
+
154
+ # Tên Entity
155
+
156
+ Mô tả ngắn 1-2 câu.
157
+
158
+ ## Tổng quan
159
+ [Mô tả chi tiết]
160
+
161
+ ## Điểm đáng chú ý
162
+ - [Bullet points]
163
+
164
+ ## Liên kết
165
+ - [[concept-liên-quan]]
166
+ - [[entity-liên-quan]]
167
+
168
+ ## Nguồn
169
+ - [Source 1](../raw/path)
170
+ - [Source 2](../raw/path)
171
+ ```
172
+
173
+ ### Concept page (wiki/concepts/)
174
+
175
+ ```markdown
176
+ ---
177
+ type: concept
178
+ domain: ai | engineering | business | ...
179
+ created: YYYY-MM-DD
180
+ updated: YYYY-MM-DD
181
+ sources: [danh sách raw sources]
182
+ ---
183
+
184
+ # Tên Concept
185
+
186
+ Mô tả ngắn 1-2 câu.
187
+
188
+ ## Định nghĩa
189
+ [Giải thích rõ ràng]
190
+
191
+ ## Cách hoạt động
192
+ [Chi tiết kỹ thuật nếu cần]
193
+
194
+ ## Ví dụ
195
+ [Ví dụ cụ thể]
196
+
197
+ ## Liên kết
198
+ - [[concept-liên-quan]]
199
+ - [[entity-liên-quan]]
200
+
201
+ ## Nguồn
202
+ - [Source 1](../raw/path)
203
+ ```
204
+
205
+ ### Source summary (wiki/sources/)
206
+
207
+ ```markdown
208
+ ---
209
+ type: source
210
+ format: article | paper | note | video | podcast
211
+ raw_path: raw/articles/ten-file.md
212
+ ingested: YYYY-MM-DD
213
+ ---
214
+
215
+ # Tên Source
216
+
217
+ ## Tóm tắt
218
+ [2-3 đoạn tóm tắt nội dung chính]
219
+
220
+ ## Key takeaways
221
+ - [Bullet points — điểm quan trọng nhất]
222
+
223
+ ## Entities được nhắc đến
224
+ - [[entity-1]]
225
+ - [[entity-2]]
226
+
227
+ ## Concepts được nhắc đến
228
+ - [[concept-1]]
229
+ - [[concept-2]]
230
+
231
+ ## Trích dẫn đáng chú ý
232
+ > "Quote quan trọng từ nguồn"
233
+ ```
234
+
235
+ ### Synthesis page (wiki/syntheses/)
236
+
237
+ ```markdown
238
+ ---
239
+ type: synthesis
240
+ topic: chủ đề phân tích
241
+ created: YYYY-MM-DD
242
+ sources_count: N
243
+ ---
244
+
245
+ # Tiêu đề phân tích
246
+
247
+ ## Câu hỏi gốc
248
+ [Câu hỏi hoặc mục đích phân tích]
249
+
250
+ ## Phân tích
251
+ [Nội dung phân tích tổng hợp]
252
+
253
+ ## Kết luận
254
+ [Tóm tắt kết luận]
255
+
256
+ ## Nguồn sử dụng
257
+ - [[source-1]]
258
+ - [[source-2]]
259
+ ```
260
+
261
+ ## Auto-Discovery
262
+
263
+ Hệ thống tự động tìm nguồn mới dựa trên:
264
+
265
+ 1. **Topics** trong config.yaml — web search định kỳ
266
+ 2. **Knowledge gaps** — lint phát hiện thiếu gì → discover tự tìm
267
+ 3. **Feeds** — RSS, GitHub repos, YouTube channels
268
+ 4. **Snowball** — đọc references trong sources đã có → follow links
269
+
270
+ Chu kỳ tự động (cấu hình trong config.yaml):
271
+ - Discover: mỗi ngày (hoặc theo cron)
272
+ - Ingest: ngay khi có file mới trong raw/
273
+ - Lint: hàng tuần
274
+ - Full recompile: hàng tháng (nếu cần)
275
+
276
+ ## Ngôn ngữ
277
+
278
+ - Wiki content viết bằng **tiếng Việt có dấu** (trừ thuật ngữ kỹ thuật giữ tiếng Anh)
279
+ - File names: tiếng Anh, kebab-case
280
+ - Frontmatter: tiếng Anh