From david-skills
Compiles personal data from journals, meetings, docs, and notes into a structured markdown wiki with categories for people, projects, places, concepts, topics, and periods. Maintains indexes and cross-references.
npx claudepluginhub thedavidweng/skillsThis skill uses the workspace's default tool permissions.
Inspired by [Andrej Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f): a persistent, compounding knowledge base maintained by an LLM. Instead of re-discovering knowledge from raw documents on every query, the LLM incrementally compiles source material into a structured, interlinked markdown wiki at ingest time.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Processes PDFs: extracts text/tables/images, merges/splits/rotates pages, adds watermarks, creates/fills forms, encrypts/decrypts, OCRs scans. Activates on PDF mentions or output requests.
Share bugs, ideas, or general feedback.
Inspired by Andrej Karpathy's LLM Wiki pattern: a persistent, compounding knowledge base maintained by an LLM. Instead of re-discovering knowledge from raw documents on every query, the LLM incrementally compiles source material into a structured, interlinked markdown wiki at ingest time.
"The key difference: the wiki is a persistent, compounding artifact. Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase."
You are a writer compiling this wiki from personal data. Not a filing clerk. A writer. Your job is to read entries, understand what they mean, and write articles that capture understanding. The wiki is a map of a mind.
The question is never "where do I put this fact?" It is: "what does this mean, and how does it connect to what I already know?"
| Layer | Directory | Purpose | Agent writes? |
|---|---|---|---|
| Source | sources/ | Immutable raw evidence | No (append/import only) |
| Wiki | wiki/ | Canonical compiled knowledge | Yes (actively maintained) |
| System | system/ | Rules, indexes, schemas | Yes |
The human curates sources and directs analysis. The LLM performs all bookkeeping — summarizing, cross-referencing, updating entity pages, and maintaining consistency.
vault/
inbox/ # Temporary staging area (DO NOT LINK FROM SOURCES)
sources/ # Immutable raw evidence
journal/ # Daily notes, personal logs
meetings/ # Meeting notes, conversations
docs/ # OCR'd documents, PDFs, reports
web/ # Clipped articles, saved web content
notes-import/ # Apple Notes, Obsidian imports, legacy captures
chats/ # Chat exports (WeChat, WhatsApp, iMessage)
identity/ # Passport scans, ID cards, work permits
flights/ # Flight exports, travel records
media/ # Media-related notes
courses/ # Course materials, syllabi
wiki/ # The compiled knowledge base
people/ # Named individuals
projects/ # Things built with serious commitment
places/ # Meaningful locations
concepts/ # Beliefs, patterns, frameworks, recurring themes
topics/ # External subjects studied deeply
maps/ # Domain hub/index pages
periods/ # Major biographical phases
system/
wiki/
schema.md # Linking rules, tag taxonomy, article format
index.md # Catalog of all pages with one-line summaries
log.md # Append-only ingest/absorb/query history
workflows.md # Exact procedures for ingest, absorb, query, lint
Before touching any wiki file in a new session, orient yourself:
system/wiki/schema.md — understand current conventions and tag taxonomy.system/wiki/index.md — learn what pages exist and their summaries.system/wiki/log.md — understand recent activity.Only after orientation should you ingest, absorb, query, or lint. This prevents duplicate pages, missed cross-references, and contradictions against established conventions.
For large wikis (100+ pages), also search_files for the topic at hand before creating anything new.
sources/)Raw evidence. The agent reads but never rewrites after initial import.
---
layer: source
kind: journal | meeting | document | article | import | clip | media | chat
created: YYYY-MM-DD
updated: YYYY-MM-DD
source_type: obsidian-daily | apple-notes | notion | web-clip | ocr | manual | export
source_uri: "" # original path or URL if known
sha256: <hex digest of body below frontmatter> # detects drift on re-ingest
tags: []
---
{date}-{slug}.md for dated material (e.g., 2023-11-14-daily.md){slug}.md for undated imports (e.g., kinship-dynamics.md)## Agent Notes instead of editing.inbox/ from ## Sources. Inbox is temporary — all content is deleted after distillation into sources/ and wiki/. Sources must reference sources/ paths only.source_uri, recompute the sha256 over the body. Skip processing if identical; flag drift and append an ## Agent Notes entry if the content has changed. This catches silent edits in exported data./wiki ingestConvert source data into source notes under sources/. Write a Python script ingest.py to do this. This step is mechanical, no LLM intelligence needed.
Auto-detect and extract: date, title, body, tags, media. Common formats: Day One JSON, Apple Notes, Obsidian Vault, Notion Export, Chat Exports, CSV/Spreadsheet, Email Export, VCF Contacts, Twitter/X Archive.
(See references/data-formats.md for detailed extraction rules)
If the data doesn't match any known format, read a sample, figure out the structure, and write a custom parser. The goal is always the same: one markdown file per logical entry with date and metadata in frontmatter.
Each file: {date}_{id}.md with YAML frontmatter (id, date, time, source_type, tags). The script must be idempotent.
/wiki absorb [date-range]The core compilation step. Date ranges: last 30 days, 2026-03, 2026-03-22, 2024, all. Default (no argument): absorb last 30 days. If source notes don't exist, run ingest first.
Process entries chronologically. Read system/wiki/index.md before each entry to match against existing articles. Re-read every article before updating.
For each entry:
Named things get pages if there's enough material. A person mentioned once in passing doesn't need a stub. A person who appears across 2 or more sources with a distinct role does. If you can't write at least 3 meaningful sentences, don't create the page yet. Note it in the article where they appear, and create the page when more material arrives.
Single-source mentions that are central to that source (e.g., a whole meeting about one project) may also qualify. Passing footnotes do not.
Patterns and themes get pages. When you notice the same idea surfacing across entries (a creative philosophy, a recurring emotional arc, a search pattern, a learning style) that's a concept article. These are often the most valuable articles in the wiki.
The gravitational pull of existing articles is the enemy. It's always easier to append a paragraph to a big article than to create a new one. This produces 5 bloated articles instead of 30 focused ones.
If you're adding a third paragraph about a sub-topic to an existing article, that sub-topic probably deserves its own page.
Creating a page is not the win. Enriching it is. A stub with 3 vague sentences when 4 other entries also mentioned that topic is a failure. Every time you touch a page, it should get richer.
When new information conflicts with existing content:
contested: true and add the conflicting page/article slug to contradictions: [].Never silently overwrite. Contradictions between a diary entry and a chat log are common and deserve explicit handling, not burial.
Stop and:
system/wiki/index.mdwiki/)Canonical knowledge. The agent actively maintains these.
---
layer: wiki
kind: person | project | place | concept | topic | map | period
updated: YYYY-MM-DD
aliases: []
tags: []
status: draft | active
confidence: high | medium | low # optional. high = multi-source verified; medium = single source or inferred; low = hearsay
contested: false # set true when sources contradict
contradictions: [] # slugs of conflicting pages
---
draft — Stub page. Has a title and minimal frontmatter but little to no body content. Targets for future enrichment.active — Page has substantive content. Ready for ongoing maintenance.| Kind | Directory | What goes here |
|---|---|---|
| person | people/ | Named individuals, including self |
| project | projects/ | Things built with serious commitment |
| place | places/ | Meaningful locations |
| concept | concepts/ | Beliefs, patterns, frameworks, recurring themes |
| topic | topics/ | External subjects studied deeply |
| map | maps/ | Domain hub/index pages |
| period | periods/ | Major biographical phases |
zhang-san, 李四光 → li-si-guang.jane-doe, john-smith.中文名 / English (Chinese first, English nickname second, slash separator). For Westerners: English Surname / 中文名.Index pages for domains. Example structure:
---
layer: wiki
kind: map
tags: [university]
---
# University Classmates
## Overview
Studied Computer Science at Some University (2020-2024).
## People
| Name | Slug | Relationship | Notes |
|------|------|--------------|-------|
| Li Si | [[li-si]] | Classmate, Project Partner | Co-founded Startup X |
Map pages are the primary navigation. Every person/project/place should be reachable from at least one map.
---
layer: wiki
kind: person | project | place | concept | topic | map | period
updated: YYYY-MM-DD
aliases: []
tags: []
status: draft | active
---
# Title
## Section (theme-based, NOT date-based)
Content with [[wikilinks]] inline.
## Timeline (if relevant)
| Date | Event |
|------|-------|
## Sources
- `[[sources/journal/2024-01-15_daily.md]]` — description of relevance
Section titles are thematic (e.g., "Early Life", "Career", "Philosophy"). Never use event dates as section titles.
When a page synthesizes 3 or more sources, append paragraph-level provenance so claims remain traceable without re-reading entire raw files:
张三于 2021 年移居温哥华。^[sources/journal/2021-07-21_landing.md]
Use ^[[sources/path.md]] at the end of a paragraph whose claims come from a specific source. Optional on single-source pages where the ## Sources section is sufficient.
Every wiki page must end with a ## Sources section listing [[wikilinks]] to source files. Omit if the page is self-contained.
Pages may mix Chinese and English. Follow these rules:
[[wikilinks]].[[wikilinks]] in the ## Sources section.maps/ page or system/wiki/index.md./wiki query <question>Answer questions about the subject's life by navigating the wiki.
system/wiki/index.md. Scan for articles relevant to the query. Each entry has aliases.[[wikilinks]] 2-3 links deep when relevant.Good answers can be filed back into the wiki as new pages. This ensures explorations compound rather than disappearing into chat history.
sources/). The wiki is the knowledge base./wiki cleanupAudit and enrich articles via parallel subagents. See references/cleanup-breakdown.md for full phase-by-phase workflow.
/wiki breakdownFind and create missing articles by mining sources for unmapped entities and themes. See references/cleanup-breakdown.md for full workflow.
/wiki lintPeriodic maintenance. Check:
Broken / Orphan
maps/ indexes or add linksCompleteness
## Sources sectionssystem/wiki/index.md; verify every active page is listedmaps/ page or indexQuality Signals
layer, kind, status; validate confidence/contested fields present on opinion-heavy pagesFreshness & Drift
updated date is >90 days older than the newest source mentioning the same entityLog Hygiene
system/wiki/log.md exceeds 500 entries, rename to log-YYYY.md and start fresh/wiki lint — Periodic audit: orphans, broken links, missing sources, index drift, frontmatter/naming issues./wiki rebuild-index — Rebuild system/wiki/index.md and update backlinks. Scaling rules: when any section exceeds 50 entries, split by first letter or sub-domain; when total exceeds 200 entries, create _meta/topic-map.md for theme-based navigation./wiki status — Show stats: entries absorbed, articles by category, most-connected articles, orphans, pending entries.When a wiki page body text mentions a person, project, place, course, or concept that has its own wiki page, link it inline where it is naturally mentioned:
张三在 [[beijing-university|北京大学]] 读书期间加入了 [[open-source-club|开源社]]。
NOT in a separate section at the bottom. Follow Wikipedia convention: link the term where it appears in flowing text.
## Related section. Do not create a "Related" block at the bottom of a page with a list of wikilinks. If a link is worth having, it belongs in the body text where the entity is mentioned.[[wikilinks]] between wiki pages — inline, where entities are mentioned in body text.[[wikilinks]] from wiki pages to sources — in the ## Sources section only.maps/ or system/wiki/index.md.Two-layer tag system.
person | project | place | topic | concept | map | period
Broad domains relevant to the wiki owner: e.g., ai | media | startup | writing
Tech stack tags belong in body text, not tags. Redundant name tags and one-off tags should be removed. Audit rule: report unfamiliar tags before deleting — never auto-delete.
Load references/writing-standards.md before creating or rewriting articles. Core rule: Wikipedia tone, not AI tone. Flat, factual, encyclopedic. Every article must have a point. Theme-based sections, not chronological dumps. Max 2 direct quotes.
Conventions discovered during wiki work MUST be written into system/wiki/schema.md and system/wiki/workflows.md. Other agents and future sessions won't know about session-only decisions. If you discover a new convention (e.g., "no ## Related sections"), immediately add it to schema.md. Otherwise the next agent will reintroduce the pattern you just removed.
Load references/pitfalls.md before debugging broken links, index drift, or unexpected orphans.