Xây dựng và duy trì knowledge base cá nhân theo pattern LLM Wiki (Karpathy). Hỗ trợ init, ingest, query, lint, discover, run, digest, pain-rank, setup, book-summary, competitive-brief, interview-prep.
Hệ thống knowledge base cá nhân. LLM xây dựng và duy trì wiki từ nguồn thô. Dựa trên pattern của Andrej Karpathy, mở rộng với auto-discovery.
Skill này hỗ trợ các sub-commands sau. Parse argument đầu tiên để xác định command:
| Command | Mô tả | Ví dụ |
|---|---|---|
init | Tạo wiki mới cho một chủ đề | /llm-wiki init "AI Agents" |
ingest | Xử lý nguồn mới trong raw/ | /llm-wiki ingest |
query | Hỏi đáp dựa trên wiki | /llm-wiki query "So sánh RAG vs Wiki" |
lint | Kiểm tra sức khỏe wiki | /llm-wiki lint |
discover | Tự tìm nguồn mới | /llm-wiki discover |
run | Chạy full cycle: discover → ingest → lint | /llm-wiki run |
status | Xem trạng thái wiki | /llm-wiki status |
digest | Daily brief — tóm tắt thay đổi wiki 24h | /llm-wiki digest |
pain-rank | Xếp hạng pain points theo cơ hội kinh doanh | /llm-wiki pain-rank |
setup | Khởi tạo wiki theo variant template có sẵn | /llm-wiki setup book-companion |
book-summary | Tóm tắt có cấu trúc toàn bộ wiki sách | /llm-wiki book-summary |
competitive-brief | Battlecard 1-pager cho một competitor | /llm-wiki competitive-brief "Linear" |
interview-prep | 1-pager chuẩn bị interview cho một công ty | /llm-wiki interview-prep "Stripe" |
Nếu không có sub-command → hiển thị trạng thái và hỏi user muốn làm gì.
WIKI_ROOT = <current working directory>
Xác định WIKI_ROOT bằng cách tìm folder chứa CLAUDE.md + config.yaml + wiki/ + raw/. Thường là thư mục project hiện tại.
Luôn đọc WIKI_ROOT/CLAUDE.md trước khi thực hiện bất kỳ command nào — đó là schema quy định mọi quy tắc.
Mục đích: Khởi tạo wiki mới hoặc thêm topic mới vào wiki hiện tại.
Quy trình:
CLAUDE.md và config.yamlconfig.yaml → topicsVí dụ:
/llm-wiki init "Rust Programming"
→ Thêm topic "Rust Programming" vào config.yaml
→ Keywords tự sinh: ["Rust language", "Rust programming", "cargo", "rustc"]
Mục đích: Xử lý mọi file mới/chưa xử lý trong raw/.
Quy trình:
CLAUDE.md (schema & quy tắc).discoveries/history.json → lấy danh sách đã xử lýraw/ → tìm file chưa có trong historywiki/sources/
c. Trích xuất entities → tạo/cập nhật wiki/entities/
d. Trích xuất concepts → tạo/cập nhật wiki/concepts/
e. Thêm cross-references [[links]] vào các trang liên quan
f. Phát hiện contradictions → ghi chú vào trang liên quanwiki/INDEX.mdwiki/LOG.md.discoveries/history.jsonQuy tắc QUAN TRỌNG:
raw/[Nguồn: filename](../raw/path)schedule.ingest.batch_sizeMục đích: Hỏi đáp dựa trên nội dung wiki.
Quy trình:
wiki/INDEX.md → tìm trang liên quan đến câu hỏi[[trang-wiki]]wiki/syntheses/ hoặc outputs/Quy tắc:
Ví dụ:
/llm-wiki query "So sánh RAG truyền thống vs LLM Wiki pattern"
→ Đọc INDEX.md → tìm trang về RAG, LLM Wiki
→ Đọc các trang liên quan
→ Tạo bảng so sánh
→ Lưu vào wiki/syntheses/rag-vs-llm-wiki.md
Mục đích: Kiểm tra sức khỏe wiki, phát hiện vấn đề.
Quy trình:
wiki/INDEX.mdwiki/[[link]] trỏ đến trang chưa tồn tạioutputs/lint-YYYY-MM-DD.md.discoveries/gaps.json (cho discover dùng)config.yaml → schedule.lint.auto_fix = true → tự sửa lỗi đơn giảnOutput format:
# Lint Report — YYYY-MM-DD
## Tóm tắt
- Tổng trang: N
- Contradictions: N
- Orphans: N
- Missing pages: N
- Gaps: N
## Chi tiết
### Contradictions
...
### Đề xuất
- Tạo trang mới: [danh sách]
- Tìm nguồn cho: [danh sách gaps]
Mục đích: Tự động tìm nguồn mới từ internet.
Quy trình:
config.yaml → topics, feeds, discovery settings.discoveries/gaps.json → knowledge gaps cần lấp.discoveries/history.json → tránh trùng lặpsite:reddit.com theo subreddits + keywords trong config.yaml → tìm pain points, use cases, ý tưởng. Lưu vào raw/reddit/YYYY-MM-DD-slug.md. Trích xuất: vấn đề gốc, giải pháp được đề xuất, upvotes, sentiment.
b. github_trending: WebSearch GitHub trending repos theo languages/topics filter
c. github_watch: Kiểm tra repos/orgs/people trong config → new releases, new repos
d. web_search: WebSearch theo keywords của mỗi topic
e. feed_poll: Kiểm tra RSS feeds, Hacker News
f. gap_fill: WebSearch theo gaps từ lint
g. snowball: Đọc references trong wiki → follow links chưa córaw/articles/YYYY-MM-DD-slug.md với frontmatter:
---
title: "Tiêu đề"
url: "https://..."
discovered: YYYY-MM-DD
topic: "tên topic"
---
.discoveries/history.jsonQuy tắc:
config.yaml → schedule.discover.max_sourcesraw/reddit/ (tách riêng khỏi raw/articles/)Mục đích: Chạy full cycle tự động.
Quy trình:
discover → ingest → lint → (nếu có gaps mới → discover lại)
discover → tìm nguồn mới (Reddit, GitHub trending, web search)ingest → xử lý mọi file mới trong raw/lint → kiểm tra sức khỏeoutputs/run-YYYY-MM-DD.mdGiới hạn: Tối đa 2 vòng discover-ingest để tránh vòng lặp vô hạn.
Mục đích: Hiển thị trạng thái wiki hiện tại.
Output:
LLM Wiki Status
═══════════════
Wiki: My LLM Wiki
Topics: 3 (LLM Agents, Claude Code, AI Engineering)
Raw sources: N files
Wiki pages: N pages (E entities, C concepts, S sources, Y syntheses)
Last ingest: YYYY-MM-DD
Last lint: YYYY-MM-DD
Last discover: YYYY-MM-DD
Knowledge gaps: N
Orphan pages: N
Health: Good | Warning | Needs Attention
Mục đích: Tạo daily brief — tóm tắt mọi thay đổi wiki trong 24h, highlights insights mới.
Quy trình:
wiki/LOG.md → lọc entries trong 24h quaOutput format:
# Daily Digest — YYYY-MM-DD
## Nguồn mới (N)
- [tên nguồn] — 1 dòng tóm tắt
## Wiki pages mới (N)
- [tên trang] — 1 dòng mô tả
## Top 3 Insights
1. [Insight quan trọng nhất — trích từ syntheses hoặc cross-references mới]
2. [Insight thứ hai]
3. [Insight thứ ba]
## Pain Points mới phát hiện (từ Reddit)
| Pain Point | Domain | Upvotes | Cơ hội |
|------------|--------|---------|--------|
| ... | ... | ... | ... |
## Knowledge Gaps cần lấp
- [gap 1]
- [gap 2]
## Thống kê
- Wiki: N pages (+X hôm nay)
- Sources: N (+Y hôm nay)
- Health: Good/Warning
Lưu vào: outputs/digest-YYYY-MM-DD.md
Mục đích: Xếp hạng pain points từ Reddit và các nguồn khác theo tiềm năng kinh doanh.
Quy trình:
raw/reddit/wiki/concepts/ai-pain-points.md và wiki/concepts/micro-saas-pattern.mdScoring Framework (mỗi tiêu chí 1-10, tổng max 50):
| Tiêu chí | Mô tả | Trọng số |
|---|---|---|
| Urgency | Người dùng cần giải pháp ngay? Hay "nice to have"? | x2 |
| Market Size | Bao nhiêu người/doanh nghiệp có vấn đề này? | x2 |
| Willingness to Pay | Sẵn sàng trả tiền? Đang trả cho alternatives? | x3 |
| AI Solvability | AI/LLM có thể giải quyết tốt không? | x2 |
| Competition | Ít cạnh tranh = điểm cao | x1 |
Output format:
# Pain Point Ranking — YYYY-MM-DD
## Top 10 Cơ hội
| Rank | Pain Point | Domain | Score | Urgency | Market | WTP | AI-Fit | Comp |
|------|-----------|--------|-------|---------|--------|-----|--------|------|
| 1 | ... | B2B | 42/50 | 9 | 8 | 9 | 8 | 8 |
| 2 | ... | Consumer | 38/50 | 7 | 9 | 7 | 9 | 6 |
## Chi tiết Top 3
### #1: [Tên Pain Point] — Score: 42/50
- **Vấn đề:** [Mô tả cụ thể]
- **Target user:** [Ai có vấn đề này]
- **Giải pháp đề xuất:** [MVP concept]
- **Revenue model:** [Cách kiếm tiền]
- **Nguồn Reddit:** [Links/upvotes]
- **Next step:** [Hành động cụ thể tiếp theo]
### #2: ...
### #3: ...
## Idea-to-Spec Pipeline (cho #1)
- Problem Statement: ...
- Target User Persona: ...
- MVP Features (3-5): ...
- Tech Stack Suggestion: ...
- Estimated effort: ... (human) / ... (CC)
Lưu vào: outputs/pain-rank-YYYY-MM-DD.md
Quy tắc:
[[kebab-case-name]][Nguồn: filename](../raw/path)Mục đích: Khởi tạo wiki theo một variant template có sẵn trong variants/.
Syntax: /llm-wiki setup <variant-name>
Variants có sẵn: book-companion, competitive-intel, job-search
Quy trình:
WIKI_ROOT/variants/<variant-name>/ tồn tạiconfig.yaml chưa có → copy variants/<variant-name>/config.yaml vào WIKI_ROOT/variants/<variant-name>/CLAUDE.md → merge schema extensions vào WIKI_ROOT/CLAUDE.mdraw/, wiki/entities/, wiki/concepts/, wiki/sources/, wiki/syntheses/, outputs/, .discoveries/variants/<variant-name>/sample-data/* → WIKI_ROOT/raw/articles/ingest tự động trên sample data vừa copyOutput ví dụ (book-companion):
Setting up book-companion variant...
✓ Config copied → config.yaml
✓ Schema extensions merged → CLAUDE.md
✓ Folder structure created
✓ Sample data: 3 files → raw/articles/
✓ Ingest complete: 12 wiki pages created
- 5 characters (Paul, Jessica, Duncan, Gurney, Stilgar)
- 3 locations (Caladan, Arrakis, Giedi Prime)
- 2 factions (Atreides, Harkonnen)
- 2 concepts (The Spice, Bene Gesserit)
Wiki ready! Try:
/llm-wiki query "Who is Paul Atreides?"
/llm-wiki query "What is the relationship between House Atreides and Arrakis?"
/llm-wiki book-summary
Quy tắc:
config.yaml đã tồn tại → hỏi user có muốn overwrite không, mặc định là KHÔNGMục đích: Tạo tóm tắt có cấu trúc toàn bộ wiki sách — characters, timeline, themes, mysteries.
Yêu cầu: Wiki phải ở book_mode: true trong config.yaml
Quy trình:
config.yaml → lấy tên sách, current_chapterwiki/INDEX.md → xác định tất cả pageswiki/entities/ (characters, locations, factions)wiki/concepts/ (themes, events, quotes)Output format:
# [Tên sách] — Book Summary (đến Chapter N)
## Cast of Characters
| Nhân vật | Vai trò | Faction | Trạng thái |
|----------|---------|---------|-----------|
| Paul Atreides | Protagonist | House Atreides | Alive |
| ... | | | |
## Timeline of Key Events
1. [Event 1] — Chapter N
2. [Event 2] — Chapter N
...
## Major Factions
- **House Atreides:** [mô tả ngắn, members, goals]
- **House Harkonnen:** [mô tả ngắn, members, goals]
## Key Locations
- **Arrakis:** [mô tả, significance]
- **Caladan:** [mô tả, significance]
## Major Themes
1. [Theme 1] — [giải thích ngắn]
2. [Theme 2] — [giải thích ngắn]
## Unresolved Mysteries / Open Questions
- [Question 1 chưa có câu trả lời đến chapter hiện tại]
- [Question 2]
## Notable Quotes
> "[Quote 1]" — [Nhân vật], Chapter N
> "[Quote 2]" — [Nhân vật], Chapter N
Lưu vào: outputs/book-summary-YYYY-MM-DD.md
Quy tắc:
current_chapter trong config (spoiler protection)Mục đích: Tạo battlecard 1-pager cho một competitor cụ thể.
Syntax: /llm-wiki competitive-brief "<Tên Competitor>"
Quy trình:
wiki/entities/wiki/changes/ nếu có (recent changes detected)Output format:
# Competitive Brief: [Competitor Name]
*Generated: YYYY-MM-DD | Sources: N wiki pages*
## One-Line Positioning
[Tagline hoặc how they describe themselves]
## Pricing
| Tier | Price | Key Limits |
|------|-------|-----------|
| Free | $0 | [limits] |
| Pro | $X/mo | [limits] |
| Enterprise | Custom | [limits] |
## Top Features
- [Feature 1]: [mô tả ngắn]
- [Feature 2]: [mô tả ngắn]
- [Feature 3]: [mô tả ngắn]
## Recent Moves (30 ngày qua)
- [Date]: [Change/announcement]
## Known Weaknesses (từ reviews & Reddit)
- [Weakness 1]
- [Weakness 2]
## Job Postings Signal
[Họ đang hire vị trí gì → signal về roadmap]
## How We Differ
[Điểm khác biệt của chúng ta so với họ]
Lưu vào: outputs/battlecard-<competitor>-YYYY-MM-DD.md
Quy tắc:
Drop competitor info into raw/ and run /llm-wiki ingest⚡ CHANGEDMục đích: Tổng hợp 1-pager chuẩn bị interview cho một công ty cụ thể.
Syntax: /llm-wiki interview-prep "<Tên Công ty>"
Quy trình:
wiki/entities/wiki/sources/ liên quan đến công ty đóOutput format:
# Interview Prep: [Company Name]
*Generated: YYYY-MM-DD | Sources: N wiki pages*
## Company Overview
[3-4 câu: business model, stage, size]
## Tech Stack
[Những gì đã biết về tech stack của họ]
## Engineering Culture
- [Culture signal 1 — từ reviews/blogs]
- [Culture signal 2]
- [Culture signal 3]
## Recent News (30 ngày qua)
- [Date]: [News item]
## The Role
[Tóm tắt JD đã collect được nếu có]
## Interview Process (từ Glassdoor/Reddit)
1. [Round 1]: [format, duration, focus]
2. [Round 2]: [format]
...
## Known Interview Questions
- [Question 1 — thường gặp]
- [Question 2]
## Green Flags
- [Positive signal 1]
- [Positive signal 2]
## Red Flags / Watch Out For
- [Warning 1 — từ reviews]
## Questions to Ask Them
- [Question 1 — meaningful, shows research]
- [Question 2]
- [Question 3]
Lưu vào: outputs/interview-prep-<company>-YYYY-MM-DD.md
Quy tắc:
Khi book_mode: true trong config.yaml, áp dụng thêm logic sau trong command ingest:
Quy trình bổ sung sau bước đọc file:
chapter: Nconfig.yaml → current_chapterchapter > current_chapter → SKIP file này[SKIP] raw/articles/[filename] — chapter N > current_chapter M (spoiler protection)Nếu không có field chapter trong frontmatter → ingest bình thường (coi là safe)
Cập nhật current_chapter: User tự sửa config.yaml → current_chapter khi đọc đến chương mới.
Gợi ý thêm vào setup: "Update current_chapter in config.yaml as you read each chapter."
Khi change_detection: true trong config.yaml, áp dụng thêm logic sau trong command discover:
Quy trình bổ sung khi fetch source đã có trong history:
wiki/changes/YYYY-MM-DD-<entity-name>.md với diff
b. Cập nhật entity page, ghi ⚡ CHANGED: [mô tả thay đổi] ở đầu
c. Ghi LOG.md với tag [CHANGE DETECTED]
d. Include trong digest reportFormat file change:
---