[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78AN0EXXNX8FSZ92BFGKDSD":3,"skill-same:01M78AN0EXXNX8FSZ92BFGKDSD":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":44,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M78AN0EXXNX8FSZ92BFGKDSD","wiki",null,"Karpathy's LLM Wiki: build\u002Fquery interlinked markdown KB. Use when creating, ingesting into, querying, or linting a markdown wiki.","moonlight-lupin\u002Fagent-skills","moonlight-lupin","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F136997773?v=4","01M78AEDSH1N62R0RNWPWMWVQY","01M78AEDT8ZF85MTK6XYBQBTNT",123,"MIT","https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin\u002Fagent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Flumen\u002Fskills\u002Fwiki\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: wiki\ndescription: \"Karpathy's LLM Wiki: build\u002Fquery interlinked markdown KB. Use when creating, ingesting into, querying, or linting a markdown wiki.\"\nlicense: MIT\nmetadata:\n  version: 0.1.2\n  author: moonlight-lupin\n  platforms: [linux, macos, windows]\n  tags: [wiki, knowledge-base, research, notes, markdown, rag-alternative]\n  hermes:\n    category: research\n    related_skills: [obsidian, arxiv]\n---\n\n> **Upstream hierarchy:**\n> 1. **Canonical source:** [Andrej Karpathy's LLM Wiki pattern](https:\u002F\u002Fgist.github.com\u002Fkarpathy\u002F442a6bf555914893e9891c11519de94f) — the core methodology this skill implements.\n> 2. **Conceptual enhancements:** [nashsu\u002Fllm_wiki](https:\u002F\u002Fgithub.com\u002Fnashsu\u002Fllm_wiki) — methodology niceties adopted conceptually (not code): `purpose.md`, Two-Step Chain-of-Thought Ingest, `overview.md`, 4-signal relevance model, graph insights, dedup pipeline, cohesion scoring. The upstream desktop app, API, MCP server, and vector search are **not** used — this skill is a standalone agent-curated markdown wiki with no external dependencies.\n>\n> **v3.0 changelog:** Adopted the nashsu enhancements above as conceptual improvements to the Karpathy pattern.\n\n# Karpathy's LLM Wiki\n\nBuild and maintain a persistent, compounding knowledge base as interlinked markdown files.\nBased on [Andrej Karpathy's LLM Wiki pattern](https:\u002F\u002Fgist.github.com\u002Fkarpathy\u002F442a6bf555914893e9891c11519de94f).\n\nUnlike traditional RAG (which rediscovers knowledge from scratch per query), the wiki\ncompiles knowledge once and keeps it current. Cross-references are already there.\nContradictions have already been flagged. Synthesis reflects everything ingested.\n\n**Division of labor:** The human curates sources and directs analysis. The agent\nsummarizes, cross-references, files, and maintains consistency.\n\n## When This Skill Activates\n\nUse this skill when the user:\n- Asks to create, build, or start a wiki or knowledge base\n- Asks to ingest, add, or process a source into their wiki\n- Asks a question and an existing wiki is present at the configured path\n- Asks to lint, audit, or health-check their wiki\n- References their wiki, knowledge base, or \"notes\" in a research context\n\n## Wiki Location\n\n**Location:** Plugin config first, then environment fallback.\n\n1. `paths.wiki_path` in the Lumen plugin config (`shared\u002Fconfig\u002Flumen.yaml`, or `--config`)\n2. `$WIKI_PATH` environment variable\n3. Default `~\u002Fwiki`\n\n```bash\n# Resolved by config_loader.py. Equivalent fallback:\nWIKI=\"${WIKI_PATH:-$HOME\u002Fwiki}\"\n```\n\nThe wiki is just a directory of markdown files — open it in Obsidian, VS Code, or\nany editor. No database, no special tooling required.\n\n## Architecture: Three Layers + Purpose\n\n```\nwiki\u002F\n├── SCHEMA.md           # Conventions, structure rules, domain config\n├── purpose.md          # The wiki's soul — goals, key questions, scope (read on every ingest\u002Fquery)\n├── index.md            # Sectioned content catalog with one-line summaries\n├── overview.md         # Auto-regenerated global summary of the entire wiki\n├── log.md              # Chronological action log (append-only, rotated yearly)\n├── raw\u002F                # Layer 1: Immutable source material\n│   ├── articles\u002F       # Web articles, clippings\n│   ├── papers\u002F         # PDFs, arxiv papers\n│   ├── transcripts\u002F    # Meeting notes, interviews\n│   └── assets\u002F         # Images, diagrams referenced by sources\n├── entities\u002F           # Layer 2: Entity pages (people, orgs, products, models)\n├── concepts\u002F           # Layer 2: Concept\u002Ftopic pages\n├── comparisons\u002F        # Layer 2: Side-by-side analyses\n└── queries\u002F            # Layer 2: Filed query results worth keeping\n```\n\n**Layer 1 — Raw Sources:** Immutable. The agent reads but never modifies these.\n**Layer 2 — The Wiki:** Agent-owned markdown files. Created, updated, and\ncross-referenced by the agent.\n**Layer 3 — The Schema:** `SCHEMA.md` defines structure, conventions, and tag taxonomy.\n**Purpose — `purpose.md`:** Defines goals, key questions, research scope, and evolving thesis.\nThe LLM reads it during every ingest and query to stay aligned with the wiki's intent.\nThis is different from schema — schema is structural rules, purpose is directional intent.\n\n## Resuming an Existing Wiki (CRITICAL — do this every session)\n\nWhen the user has an existing wiki, **always orient yourself before doing anything**:\n\n① **Read `purpose.md`** — understand the wiki's goals, scope, and key questions.\n② **Read `SCHEMA.md`** — understand the domain, conventions, and tag taxonomy.\n③ **Read `index.md`** — learn what pages exist and their summaries.\n④ **Scan recent `log.md`** — read the last 20-30 entries to understand recent activity.\n\n```bash\nWIKI=\"${WIKI_PATH:-$HOME\u002Fwiki}\"\n# Orientation reads at session start\nread_file \"$WIKI\u002Fpurpose.md\"\nread_file \"$WIKI\u002FSCHEMA.md\"\nread_file \"$WIKI\u002Findex.md\"\nread_file \"$WIKI\u002Flog.md\" offset=\u003Clast 30 lines>\n```\n\nOnly after orientation should you ingest, query, or lint. This prevents:\n- Creating duplicate pages for entities that already exist\n- Missing cross-references to existing content\n- Contradicting the schema's conventions\n- Repeating work already logged\n\nFor large wikis (100+ pages), also run a quick `search_files` for the topic\nat hand before creating anything new.\n\n## Initializing a New Wiki\n\nWhen the user asks to create or start a wiki:\n\n1. Determine the wiki path (from plugin config `paths.wiki_path`, else `$WIKI_PATH`, else ask the user; default `~\u002Fwiki`)\n2. Create the directory structure above\n3. Ask the user what domain the wiki covers — be specific\n4. Write `purpose.md` — goals, key questions, scope, evolving thesis (see template below)\n5. Write `SCHEMA.md` customized to the domain (see template below)\n6. Write initial `index.md` with sectioned header\n7. Write initial `overview.md` with a brief summary\n8. Write initial `log.md` with creation entry\n9. Confirm the wiki is ready and suggest first sources to ingest\n\n### purpose.md Template\n\nThe wiki's soul — directional intent, not structural rules. Read on every ingest and query.\n\n```markdown\n# Wiki Purpose\n\n## Goal\n[What this wiki is for — e.g., \"Track AI\u002FML research and synthesize learnings into a compounding knowledge base\"]\n\n## Key Questions\n- [What questions should this wiki help answer?]\n\n## Scope\n- **In scope:** [What earns a page]\n- **Out of scope:** [What doesn't belong here]\n\n## Evolving Thesis\n[Your current understanding of the domain — updated as the wiki grows]\n```\n\n### SCHEMA.md Template\n\nAdapt to the user's domain. The schema constrains agent behavior and ensures consistency:\n\n```markdown\n# Wiki Schema\n\n## Domain\n[What this wiki covers — e.g., \"AI\u002FML research\", \"personal health\", \"startup intelligence\"]\n\n## OKF Conformance\n\nThis wiki is conformant with the [Open Knowledge Format (OKF) v0.1](https:\u002F\u002Fgithub.com\u002FGoogleCloudPlatform\u002Fknowledge-catalog\u002Fblob\u002Fmain\u002Fokf\u002FSPEC.md)\n— Google's open specification for agent-readable knowledge bundles.\n\n**Conformance requirements (all met):**\n- Every non-reserved `.md` file has parseable YAML frontmatter ✓\n- Every frontmatter block has a non-empty `type` field ✓\n- Reserved filenames (`index.md`, `log.md`) follow OKF structure ✓\n\n**OKF fields used:**\n- `type` (required) — concept type, also used for our richer taxonomy\n- `title` (recommended) — display name\n- `description` (recommended) — one-line summary, used by index generators and search\n- `resource` (optional) — canonical URI for external assets\n- `tags` (optional) — cross-cutting categorization\n- `updated` (maps to OKF `timestamp`) — last-modified date\n\n**Extensions beyond OKF (allowed by spec):**\n- `created` — creation date (producer-defined extension)\n- `sources` — provenance links to raw source files\n- `confidence`, `contested`, `contradictions` — quality signals\n- `purpose.md`, `SCHEMA.md`, `overview.md` — wiki-specific reserved files\n- `[[wikilinks]]` — Obsidian-style cross-links (OKF uses standard markdown links;\n  both coexist — `[[wikilinks]]` for Obsidian, standard links for OKF consumers)\n- `raw\u002F` layer — immutable source material (OKF has no equivalent)\n\n**Root index.md declares OKF version:**\n```yaml\nokf_version: \"0.2\"\n```\n\n## Conventions\n- File names: lowercase, hyphens, no spaces (e.g., `transformer-architecture.md`)\n- Every wiki page starts with YAML frontmatter (see below)\n- Use `[[wikilinks]]` to link between pages (minimum 2 outbound links per page)\n- When updating a page, always bump the `updated` date\n- Every new page must be added to `index.md` under the correct section\n- Every action must be appended to `log.md`\n- **Provenance markers:** On pages that synthesize 3+ sources, append `^[raw\u002Farticles\u002Fsource-file.md]`\n  at the end of paragraphs whose claims come from a specific source. This lets a reader trace each\n  claim back without re-reading the whole raw file. Optional on single-source pages where the\n  `sources:` frontmatter is enough.\n\n## Frontmatter\n  ```yaml\n  ---\n  type: entity | concept | comparison | query | summary   # REQUIRED (OKF)\n  title: Page Title\n  description: One-line summary of this concept             # OKF recommended\n  created: YYYY-MM-DD\n  updated: YYYY-MM-DD                                      # maps to OKF timestamp\n  tags: [from taxonomy below]\n  sources: [raw\u002Farticles\u002Fsource-name.md]\n  resource: \u003COptional canonical URI for the underlying asset>  # OKF optional\n  # Optional quality signals:\n  confidence: high | medium | low        # how well-supported the claims are\n  contested: true                        # set when the page has unresolved contradictions\n  contradictions: [other-page-slug]      # pages this one conflicts with\n  ---\n  ```\n\n**OKF conformance:** `type` is the only required field. All other fields are extensions\nthat OKF consumers must tolerate. `description` enables index generation and search\nsnippets in OKF consumers. `resource` links to external assets (APIs, dashboards, repos).\n`updated` serves as OKF's `timestamp`.\n\n`confidence` and `contested` are optional but recommended for opinion-heavy or fast-moving\ntopics. Lint surfaces `contested: true` and `confidence: low` pages for review so weak claims\ndon't silently harden into accepted wiki fact.\n\n### raw\u002F Frontmatter\n\nRaw sources ALSO get a small frontmatter block so re-ingests can detect drift:\n\n```yaml\n---\nsource_url: https:\u002F\u002Fexample.com\u002Farticle   # original URL, if applicable\ningested: YYYY-MM-DD\nsha256: \u003Chex digest of the raw content below the frontmatter>\n---\n```\n\nThe `sha256:` lets a future re-ingest of the same URL skip processing when content is unchanged,\nand flag drift when it has changed. Compute over the body only (everything after the closing\n`---`), not the frontmatter itself.\n\n## Tag Taxonomy\n[Define 10-20 top-level tags for the domain. Add new tags here BEFORE using them.]\n\nExample for AI\u002FML:\n- Models: model, architecture, benchmark, training\n- People\u002FOrgs: person, company, lab, open-source\n- Techniques: optimization, fine-tuning, inference, alignment, data\n- Meta: comparison, timeline, controversy, prediction\n\nRule: every tag on a page must appear in this taxonomy. If a new tag is needed,\nadd it here first, then use it. This prevents tag sprawl.\n\n## Page Thresholds\n- **Create a page** when an entity\u002Fconcept appears in 2+ sources OR is central to one source\n- **Add to existing page** when a source mentions something already covered\n- **DON'T create a page** for passing mentions, minor details, or things outside the domain\n- **Split a page** when it exceeds ~200 lines — break into sub-topics with cross-links\n- **Archive a page** when its content is fully superseded — move to `_archive\u002F`, remove from index\n\n## Entity Pages\nOne page per notable entity. Include:\n- Overview \u002F what it is\n- Key facts and dates\n- Relationships to other entities ([[wikilinks]])\n- Source references\n\n## Concept Pages\nOne page per concept or topic. Include:\n- Definition \u002F explanation\n- Current state of knowledge\n- Open questions or debates\n- Related concepts ([[wikilinks]])\n\n## Comparison Pages\nSide-by-side analyses. Include:\n- What is being compared and why\n- Dimensions of comparison (table format preferred)\n- Verdict or synthesis\n- Sources\n\n## Update Policy\nWhen new information conflicts with existing content:\n1. Check the dates — newer sources generally supersede older ones\n2. If genuinely contradictory, note both positions with dates and sources\n3. Mark the contradiction in frontmatter: `contradictions: [page-name]`\n4. Flag for user review in the lint report\n```\n\n### index.md Template\n\nThe index is sectioned by type. Each entry is one line: wikilink + summary.\n\n```markdown\n# Wiki Index\n\n---\nokf_version: \"0.2\"\n---\n\n> Content catalog. Every wiki page listed under its type with a one-line summary.\n> Read this first to find relevant pages for any query.\n> Last updated: YYYY-MM-DD | Total pages: N\n\n## Entities\n\u003C!-- Alphabetical within section -->\n\n## Concepts\n\n## Comparisons\n\n## Queries\n```\n\n**Curator-managed block:** when `lumen:curator` runs on the wiki, it regenerates only the\ntext between `\u003C!-- lumen:auto:start -->` and `\u003C!-- lumen:auto:end -->` in `index.md` and\n`overview.md` (appending that block if a file has none). Keep hand-maintained sections, like\nthe ones above, outside the markers; never edit inside them, since the next run replaces it.\n\n**Scaling rule:** When any section exceeds 50 entries, split it into sub-sections\nby first letter or sub-domain. When the index exceeds 200 entries total, create\na `_meta\u002Ftopic-map.md` that groups pages by theme for faster navigation.\n\n### log.md Template\n\n```markdown\n# Wiki Log\n\n> Chronological record of all wiki actions. Append-only.\n> Format: `## [YYYY-MM-DD] action | subject`\n> Actions: ingest, update, query, lint, create, archive, delete\n> When this file exceeds 500 entries, rotate: rename to log-YYYY.md, start fresh.\n\n## [YYYY-MM-DD] create | Wiki initialized\n- Domain: [domain]\n- Structure created with purpose.md, SCHEMA.md, index.md, overview.md, log.md\n```\n\n### overview.md Template\n\nAuto-regenerated after every ingest. The wiki's \"elevator pitch\" for fast orientation.\n\n```markdown\n# Wiki Overview\n\n> Auto-generated. Last updated: YYYY-MM-DD | Total pages: N\n\n## Summary\n[2-3 paragraph summary of what the wiki covers and its current state]\n\n## Main Topics\n- [Topic 1] — [N pages] — [brief description]\n- [Topic 2] — [N pages] — [brief description]\n\n## Recent Changes\n- [YYYY-MM-DD] [action] — [what changed]\n- [YYYY-MM-DD] [action] — [what changed]\n\n## Key Themes\n[Emerging patterns and connections across the wiki]\n```\n\n## Core Operations\n\n### 1. Ingest (Two-Step Chain-of-Thought)\n\nWhen the user provides a source (URL, file, paste), integrate it into the wiki in two\nsequential phases for better quality — Analysis, then Generation.\n\n#### Step 1: Capture & Analysis\n\n① **Capture the raw source:**\n   - URL → use `web_extract` to get markdown, save to `raw\u002Farticles\u002F`\n   - PDF → use `web_extract` (handles PDFs), save to `raw\u002Fpapers\u002F`\n   - Pasted text → save to appropriate `raw\u002F` subdirectory\n   - Name the file descriptively: `raw\u002Farticles\u002Fkarpathy-llm-wiki-2026.md`\n   - **Add raw frontmatter** (`source_url`, `ingested`, `sha256` of the body).\n     On re-ingest of the same URL: recompute the sha256, compare to the stored value —\n     skip if identical, flag drift and update if different. This is cheap enough to\n     do on every re-ingest and catches silent source changes.\n\n② **Read `purpose.md`** — align with the wiki's goals and scope before analyzing.\n\n③ **Discuss takeaways** with the user — what's interesting, what matters for\n   the domain. (Skip this in automated\u002Fcron contexts — proceed directly.)\n\n④ **Check what already exists** — search index.md and use `search_files` to find\n   existing pages for mentioned entities\u002Fconcepts. This is the difference between\n   a growing wiki and a pile of duplicates.\n\n⑤ **Structured Analysis** — before writing any pages, produce an analysis:\n   - Key entities, concepts, arguments in the source\n   - Connections to existing wiki content (which pages relate, how)\n   - Contradictions & tensions with existing knowledge\n   - Recommendations for wiki structure (new pages vs updates vs merges)\n   \n   In conversation context, share this analysis with the user. In automated\u002Fcron\n   contexts, proceed directly to Step 2.\n\n#### Step 2: Generation\n\n⑥ **Write or update wiki pages** based on the analysis:\n   - **New entities\u002Fconcepts:** Create pages only if they meet the Page Thresholds\n     in SCHEMA.md (2+ source mentions, or central to one source)\n   - **Existing pages:** Add new information, update facts, bump `updated` date.\n     When new info contradicts existing content, follow the Update Policy.\n   - **Cross-reference:** Every new or updated page must link to at least 2 other\n     pages via `[[wikilinks]]`. Check that existing pages link back.\n   - **Tags:** Only use tags from the taxonomy in SCHEMA.md\n   - **Provenance:** On pages synthesizing 3+ sources, append `^[raw\u002Farticles\u002Fsource.md]`\n     markers to paragraphs whose claims trace to a specific source.\n   - **Confidence:** For opinion-heavy, fast-moving, or single-source claims, set\n     `confidence: medium` or `low` in frontmatter. Don't mark `high` unless the\n     claim is well-supported across multiple sources.\n\n⑦ **Update navigation & overview:**\n   - Add new pages to `index.md` under the correct section, alphabetically\n   - Update the \"Total pages\" count and \"Last updated\" date in index header\n   - Edit hand-maintained content only outside the `\u003C!-- lumen:auto:start -->` … `\u003C!-- lumen:auto:end -->` block (the curator owns that block)\n   - **Regenerate `overview.md`** — a global summary of the entire wiki, updated after every ingest. Include: total pages, main topics, recent changes, key themes. This is the wiki's \"elevator pitch\" and helps the LLM orient quickly on future sessions.\n   - Append to `log.md`: `## [YYYY-MM-DD] ingest | Source Title`\n   - List every file created or updated in the log entry\n\n⑧ **Report what changed** — list every file created or updated to the user.\n\nA single source can trigger updates across 5-15 wiki pages. This is normal\nand desired — it's the compounding effect.\n\n### 2. Query (4-Signal Relevance Model)\n\nWhen the user asks a question about the wiki's domain:\n\n① **Read `purpose.md`** — align with the wiki's scope.\n② **Read `index.md`** to identify relevant pages.\n③ **For wikis with 100+ pages**, also `search_files` across all `.md` files\n   for key terms — the index alone may miss relevant content.\n④ **Read the relevant pages** using `read_file`.\n⑤ **Rank results using the 4-signal relevance model:**\n\n| Signal | Weight | Description |\n|--------|--------|-------------|\n| Direct link | ×3.0 | Pages linked via `[[wikilinks]]` from seed pages |\n| Source overlap | ×4.0 | Pages sharing the same raw source (via frontmatter `sources[]`) |\n| Adamic-Adar | ×1.5 | Pages sharing common neighbors (weighted by neighbor degree) |\n| Type affinity | ×1.0 | Bonus for same page type (concept→concept, entity→entity) |\n\n   For each candidate page, compute a composite score. Start with keyword-matched\n   seed pages, then expand 2 hops via `[[wikilinks]]` and source overlap. Rank by\n   composite score. Read only the top pages (budget control: ~60% bodies \u002F 20%\n   chat context \u002F 5% index \u002F 15% system prompt).\n\n⑥ **Synthesize an answer** from the compiled knowledge. Cite the wiki pages\n   you drew from: \"Based on [[page-a]] and [[page-b]]...\"\n⑦ **File valuable answers back** — if the answer is a substantial comparison,\n   deep dive, or novel synthesis, create a page in `queries\u002F` or `comparisons\u002F`.\n   Don't file trivial lookups — only answers that would be painful to re-derive.\n⑧ **Update log.md** with the query and whether it was filed.\n\n### 3. Lint\n\nWhen the user asks to lint, health-check, or audit the wiki:\n\n① **Orphan pages:** Find pages with no inbound `[[wikilinks]]` from other pages.\n```python\n# Use execute_code for this — programmatic scan across all wiki pages\nimport os, re\nfrom collections import defaultdict\nwiki = \"\u003CWIKI_PATH>\"\n# Scan all .md files in entities\u002F, concepts\u002F, comparisons\u002F, queries\u002F\n# Extract all [[wikilinks]] — build inbound link map\n# Pages with zero inbound links are orphans\n```\n\n② **Broken wikilinks:** Find `[[links]]` that point to pages that don't exist.\n\n③ **Index completeness:** Every wiki page should appear in `index.md`. Compare\n   the filesystem against index entries.\n\n④ **Frontmatter validation:** Every wiki page must have all required fields\n   (title, created, updated, type, tags, sources). Tags must be in the taxonomy.\n\n⑤ **Stale content:** Pages whose `updated` date is >90 days older than the most\n   recent source that mentions the same entities.\n\n⑥ **Contradictions:** Pages on the same topic with conflicting claims. Look for\n   pages that share tags\u002Fentities but state different facts. Surface all pages\n   with `contested: true` or `contradictions:` frontmatter for user review.\n\n⑦ **Quality signals:** List pages with `confidence: low` and any page that cites\n   only a single source but has no confidence field set — these are candidates\n   for either finding corroboration or demoting to `confidence: medium`.\n\n⑧ **Source drift:** For each file in `raw\u002F` with a `sha256:` frontmatter, recompute\n   the hash and flag mismatches. Mismatches indicate the raw file was edited\n   (shouldn't happen — raw\u002F is immutable) or ingested from a URL that has since\n   changed. Not a hard error, but worth reporting.\n\n⑨ **Page size:** Flag pages over 200 lines — candidates for splitting.\n\n⑩ **Tag audit:** List all tags in use, flag any not in the SCHEMA.md taxonomy.\n\n⑪ **Log rotation:** If log.md exceeds 500 entries, rotate it.\n\n⑫ **Graph insights — surprising connections:** Find cross-community edges (pages\n   in different Louvain clusters linked via `[[wikilinks]]`), cross-type links\n   (entity↔concept), and peripheral↔hub couplings. These are often the most\n   interesting parts of the knowledge base — flag them for the user to review.\n\n⑬ **Graph insights — knowledge gaps:**\n   - **Isolated pages:** degree ≤ 1 (few or no connections — candidates for expansion)\n   - **Sparse communities:** Louvain clusters with cohesion \u003C 0.15 and ≥ 3 pages\n   - **Bridge nodes:** pages connecting 3+ clusters (high leverage but fragile)\n\n⑭ **Deduplication check:** Look for pages with similar titles or overlapping\n   content. If two pages cover the same concept with >70% content overlap,\n   flag for merge. Use LLM judgment: extract summaries, compare, recommend\n   merge or keep-separate. Do NOT auto-merge — surface as a review item.\n\n⑮ **Report findings** with specific file paths and suggested actions, grouped by\n   severity (broken links > orphans > source drift > contested pages > stale content > style issues > graph insights > dedup candidates).\n\n⑯ **Append to log.md:** `## [YYYY-MM-DD] lint | N issues found`\n\n## Working with the Wiki\n\n### Searching\n\n```bash\n# Find pages by content\nsearch_files \"transformer\" path=\"$WIKI\" file_glob=\"*.md\"\n\n# Find pages by filename\nsearch_files \"*.md\" target=\"files\" path=\"$WIKI\"\n\n# Find pages by tag\nsearch_files \"tags:.*alignment\" path=\"$WIKI\" file_glob=\"*.md\"\n\n# Recent activity\nread_file \"$WIKI\u002Flog.md\" offset=\u003Clast 20 lines>\n```\n\n### Bulk Ingest\n\nWhen ingesting multiple sources at once, batch the updates:\n1. Read all sources first\n2. Identify all entities and concepts across all sources\n3. Check existing pages for all of them (one search pass, not N)\n4. Create\u002Fupdate pages in one pass (avoids redundant updates)\n5. Update index.md once at the end\n6. Write a single log entry covering the batch\n\n### Archiving\n\nWhen content is fully superseded or the domain scope changes:\n1. Create `_archive\u002F` directory if it doesn't exist\n2. Move the page to `_archive\u002F` with its original path (e.g., `_archive\u002Fentities\u002Fold-page.md`)\n3. Remove from `index.md`\n4. Update any pages that linked to it — replace wikilink with plain text + \"(archived)\"\n5. Log the archive action\n\n### Obsidian Integration\n\nThe wiki directory works as an Obsidian vault out of the box:\n- `[[wikilinks]]` render as clickable links\n- Graph View visualizes the knowledge network\n- YAML frontmatter powers Dataview queries\n- The `raw\u002Fassets\u002F` folder holds images referenced via `![[image.png]]`\n\nFor best results:\n- Set Obsidian's attachment folder to `raw\u002Fassets\u002F`\n- Enable \"Wikilinks\" in Obsidian settings (usually on by default)\n- Install Dataview plugin for queries like `TABLE tags FROM \"entities\" WHERE contains(tags, \"company\")`\n\nIf using the Obsidian skill alongside this one, set `OBSIDIAN_VAULT_PATH` to the\nsame directory as the wiki path.\n\n### Obsidian Headless (servers and headless machines)\n\nOn machines without a display, use `obsidian-headless` instead of the desktop app.\nIt syncs vaults via Obsidian Sync without a GUI — perfect for agents running on\nservers that write to the wiki while Obsidian desktop reads it on another device.\n\n**Setup:**\n```bash\n# Requires Node.js 22+\nnpm install -g obsidian-headless\n\n# Login (requires Obsidian account with Sync subscription)\nob login --email \u003Cemail> --password '\u003Cpassword>'\n\n# Create a remote vault for the wiki\nob sync-create-remote --name \"LLM Wiki\"\n\n# Connect the wiki directory to the vault\ncd ~\u002Fwiki\nob sync-setup --vault \"\u003Cvault-id>\"\n\n# Initial sync\nob sync\n\n# Continuous sync (foreground — use systemd for background)\nob sync --continuous\n```\n\n**Continuous background sync via systemd:**\n```ini\n# ~\u002F.config\u002Fsystemd\u002Fuser\u002Fobsidian-wiki-sync.service\n[Unit]\nDescription=Obsidian LLM Wiki Sync\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nExecStart=\u002Fpath\u002Fto\u002Fob sync --continuous\nWorkingDirectory=\u002Fhome\u002Fuser\u002Fwiki\nRestart=on-failure\nRestartSec=10\n\n[Install]\nWantedBy=default.target\n```\n\n```bash\nsystemctl --user daemon-reload\nsystemctl --user enable --now obsidian-wiki-sync\n# Enable linger so sync survives logout:\nsudo loginctl enable-linger $USER\n```\n\nThis lets the agent write to `~\u002Fwiki` on a server while you browse the same\nvault in Obsidian on your laptop\u002Fphone — changes appear within seconds.\n\n## Pitfalls\n\n- **Never modify files in `raw\u002F`** — sources are immutable. Corrections go in wiki pages.\n- **Always orient first** — read SCHEMA + index + recent log before any operation in a new session.\n  Skipping this causes duplicates and missed cross-references.\n- **Always update index.md and log.md** — skipping this makes the wiki degrade. These are the\n  navigational backbone.\n- **Don't create pages for passing mentions** — follow the Page Thresholds in SCHEMA.md. A name\n  appearing once in a footnote doesn't warrant an entity page.\n- **Don't create pages without cross-references** — isolated pages are invisible. Every page must\n  link to at least 2 other pages.\n- **Frontmatter is required** — it enables search, filtering, and staleness detection.\n- **Tags must come from the taxonomy** — freeform tags decay into noise. Add new tags to SCHEMA.md\n  first, then use them.\n- **Keep pages scannable** — a wiki page should be readable in 30 seconds. Split pages over\n  200 lines. Move detailed analysis to dedicated deep-dive pages.\n- **Ask before mass-updating** — if an ingest would touch 10+ existing pages, confirm\n  the scope with the user first.\n- **Rotate the log** — when log.md exceeds 500 entries, rename it `log-YYYY.md` and start fresh.\n  The agent should check log size during lint.\n- **Handle contradictions explicitly** — don't silently overwrite. Note both claims with dates,\n  mark in frontmatter, flag for user review.\n- **Read `purpose.md` on every ingest and query** — skipping this causes drift from the wiki's\n  intended scope. Purpose is the compass; schema is the rulebook.\n- **Regenerate `overview.md` after every ingest** — a stale overview is worse than no overview\n  because it misleads orientation. It should reflect the current state of the wiki.\n- **Page merge on re-ingest** — when re-ingesting a source that was already processed, use a\n  3-layer merge: (1) array union for lists\u002Flinks, (2) LLM body merge with a 70% length sanity\n  check (if merged body is \u003C70% or >130% of the longer original, flag for manual review),\n  (3) locked frontmatter fields (title, created — never overwritten). This prevents both\n  information loss and uncontrolled bloat from repeated re-ingestion.\n- **Dedup is advisory, not automatic** — the dedup check surfaces candidates but never auto-merges.\n  Two pages with similar titles may cover genuinely different aspects. Always present to the user.\n\n## Upstream & Related\n\n**Canonical source:** [Andrej Karpathy's LLM Wiki gist](https:\u002F\u002Fgist.github.com\u002Fkarpathy\u002F442a6bf555914893e9891c11519de94f) — the pattern this skill implements.\n\n**Conceptual enhancements adopted from:** [nashsu\u002Fllm_wiki](https:\u002F\u002Fgithub.com\u002Fnashsu\u002Fllm_wiki) — methodology niceties (purpose.md, two-step CoT ingest, overview.md, 4-signal relevance, graph insights, dedup, cohesion scoring). We adopt the *concepts*, not the code. The upstream desktop app, API, MCP server, vector search, and Chrome clipper are separate products and are not used by this skill. Upstream app is GPL-3.0; this skill remains MIT (original implementation, no upstream code\u002Ftext imported).\n\n**Related CLI tool:** [llm-wiki-compiler](https:\u002F\u002Fgithub.com\u002Fatomicmemory\u002Fllm-wiki-compiler) — a Node.js CLI that\ncompiles sources into a concept wiki with the same Karpathy inspiration. Obsidian-compatible.\nUse this skill when you want agent-in-the-loop curation; use llm-wiki-compiler when you want\nbatch compile of a source directory.\n","> **Upstream hierarchy:**\n> 1. **Canonical source:** [Andrej Karpathy's LLM Wiki pattern](https:\u002F\u002Fgist.github.com\u002Fkarpathy\u002F442a6bf555914893e9891c11519de94f) — the core methodology this skill implements.\n> 2. **Conceptual enhancements:** [nashsu\u002Fllm_wiki](https:\u002F\u002Fgithub.com\u002Fnashsu\u002Fllm_wiki) — methodology niceties adopted conceptually (not code): `purpose.md`, Two-Step Chain-of-Thought Ingest, `overview.md`, 4-signal relevance model, graph insights, dedup pipeline, cohesion scoring. The upstream desktop app, API, MCP server, and vector search are **not** used — this skill is a standalone agent-curated markdown wiki with no external dependencies.\n>\n> **v3.0 changelog:** Adopted the nashsu enhancements above as conceptual improvements to the Karpathy pattern.\n\n# Karpathy's LLM Wiki\n\nBuild and maintain a persistent, compounding knowledge base as interlinked markdown files.\nBased on [Andrej Karpathy's LLM Wiki pattern](https:\u002F\u002Fgist.github.com\u002Fkarpathy\u002F442a6bf555914893e9891c11519de94f).\n\nUnlike traditional RAG (which rediscovers knowledge from scratch per query), the wiki\ncompiles knowledge once and keeps it current. Cross-references are already there.\nContradictions have already been flagged. Synthesis reflects everything ingested.\n\n**Division of labor:** The human curates sources and directs analysis. The agent\nsummarizes, cross-references, files, and maintains consistency.\n\n## When This Skill Activates\n\nUse this skill when the user:\n- Asks to create, build, or start a wiki or knowledge base\n- Asks to ingest, add, or process a source into their wiki\n- Asks a question and an existing wiki is present at the configured path\n- Asks to lint, audit, or health-check their wiki\n- References their wiki, knowledge base, or \"notes\" in a research context\n\n## Wiki Location\n\n**Location:** Plugin config first, then environment fallback.\n\n1. `paths.wiki_path` in the Lumen plugin config (`shared\u002Fconfig\u002Flumen.yaml`, or `--config`)\n2. `$WIKI_PATH` environment variable\n3. Default `~\u002Fwiki`\n\n```bash\n# Resolved by config_loader.py. Equivalent fallback:\nWIKI=\"${WIKI_PATH:-$HOME\u002Fwiki}\"\n```\n\nThe wiki is just a directory of markdown files — open it in Obsidian, VS Code, or\nany editor. No database, no special tooling required.\n\n## Architecture: Three Layers + Purpose\n\n```\nwiki\u002F\n├── SCHEMA.md           # Conventions, structure rules, domain config\n├── purpose.md          # The wiki's soul — goals, key questions, scope (read on every ingest\u002Fquery)\n├── index.md            # Sectioned content catalog with one-line summaries\n├── overview.md         # Auto-regenerated global summary of the entire wiki\n├── log.md              # Chronological action log (append-only, rotated yearly)\n├── raw\u002F                # Layer 1: Immutable source material\n│   ├── articles\u002F       # Web articles, clippings\n│   ├── papers\u002F         # PDFs, arxiv papers\n│   ├── transcripts\u002F    # Meeting notes, interviews\n│   └── assets\u002F         # Images, diagrams referenced by sources\n├── entities\u002F           # Layer 2: Entity pages (people, orgs, products, models)\n├── concepts\u002F           # Layer 2: Concept\u002Ftopic pages\n├── comparisons\u002F        # Layer 2: Side-by-side analyses\n└── queries\u002F            # Layer 2: Filed query results worth keeping\n```\n\n**Layer 1 — Raw Sources:** Immutable. The agent reads but never modifies these.\n**Layer 2 — The Wiki:** Agent-owned markdown files. Created, updated, and\ncross-referenced by the agent.\n**Layer 3 — The Schema:** `SCHEMA.md` defines structure, conventions, and tag taxonomy.\n**Purpose — `purpose.md`:** Defines goals, key questions, research scope, and evolving thesis.\nThe LLM reads it during every ingest and query to stay aligned with the wiki's intent.\nThis is different from schema — schema is structural rules, purpose is directional intent.\n\n## Resuming an Existing Wiki (CRITICAL — do this every session)\n\nWhen the user has an existing wiki, **always orient yourself before doing anything**:\n\n① **Read `purpose.md`** — understand the wiki's goals, scope, and key questions.\n② **Read `SCHEMA.md`** — understand the domain, conventions, and tag taxonomy.\n③ **Read `index.md`** — learn what pages exist and their summaries.\n④ **Scan recent `log.md`** — read the last 20-30 entries to understand recent activity.\n\n```bash\nWIKI=\"${WIKI_PATH:-$HOME\u002Fwiki}\"\n# Orientation reads at session start\nread_file \"$WIKI\u002Fpurpose.md\"\nread_file \"$WIKI\u002FSCHEMA.md\"\nread_file \"$WIKI\u002Findex.md\"\nread_file \"$WIKI\u002Flog.md\" offset=\u003Clast 30 lines>\n```\n\nOnly after orientation should you ingest, query, or lint. This prevents:\n- Creating duplicate pages for entities that already exist\n- Missing cross-references to existing content\n- Contradicting the schema's conventions\n- Repeating work already logged\n\nFor large wikis (100+ pages), also run a quick `search_files` for the topic\nat hand before creating anything new.\n\n## Initializing a New Wiki\n\nWhen the user asks to create or start a wiki:\n\n1. Determine the wiki path (from plugin config `paths.wiki_path`, else `$WIKI_PATH`, else ask the user; default `~\u002Fwiki`)\n2. Create the directory structure above\n3. Ask the user what domain the wiki covers — be specific\n4. Write `purpose.md` — goals, key questions, scope, evolving thesis (see template below)\n5. Write `SCHEMA.md` customized to the domain (see template below)\n6. Write initial `index.md` with sectioned header\n7. Write initial `overview.md` with a brief summary\n8. Write initial `log.md` with creation entry\n9. Confirm the wiki is ready and suggest first sources to ingest\n\n### purpose.md Template\n\nThe wiki's soul — directional intent, not structural rules. Read on every ingest and query.\n\n```markdown\n# Wiki Purpose\n\n## Goal\n[What this wiki is for — e.g., \"Track AI\u002FML research and synthesize learnings into a compounding knowledge base\"]\n\n## Key Questions\n- [What questions should this wiki help answer?]\n\n## Scope\n- **In scope:** [What earns a page]\n- **Out of scope:** [What doesn't belong here]\n\n## Evolving Thesis\n[Your current understanding of the domain — updated as the wiki grows]\n```\n\n### SCHEMA.md Template\n\nAdapt to the user's domain. The schema constrains agent behavior and ensures consistency:\n\n```markdown\n# Wiki Schema\n\n## Domain\n[What this wiki covers — e.g., \"AI\u002FML research\", \"personal health\", \"startup intelligence\"]\n\n## OKF Conformance\n\nThis wiki is conformant with the [Open Knowledge Format (OKF) v0.1](https:\u002F\u002Fgithub.com\u002FGoogleCloudPlatform\u002Fknowledge-catalog\u002Fblob\u002Fmain\u002Fokf\u002FSPEC.md)\n— Google's open specification for agent-readable knowledge bundles.\n\n**Conformance requirements (all met):**\n- Every non-reserved `.md` file has parseable YAML frontmatter ✓\n- Every frontmatter block has a non-empty `type` field ✓\n- Reserved filenames (`index.md`, `log.md`) follow OKF structure ✓\n\n**OKF fields used:**\n- `type` (required) — concept type, also used for our richer taxonomy\n- `title` (recommended) — display name\n- `description` (recommended) — one-line summary, used by index generators and search\n- `resource` (optional) — canonical URI for external assets\n- `tags` (optional) — cross-cutting categorization\n- `updated` (maps to OKF `timestamp`) — last-modified date\n\n**Extensions beyond OKF (allowed by spec):**\n- `created` — creation date (producer-defined extension)\n- `sources` — provenance links to raw source files\n- `confidence`, `contested`, `contradictions` — quality signals\n- `purpose.md`, `SCHEMA.md`, `overview.md` — wiki-specific reserved files\n- `[[wikilinks]]` — Obsidian-style cross-links (OKF uses standard markdown links;\n  both coexist — `[[wikilinks]]` for Obsidian, standard links for OKF consumers)\n- `raw\u002F` layer — immutable source material (OKF has no equivalent)\n\n**Root index.md declares OKF version:**\n```yaml\nokf_version: \"0.2\"\n```\n\n## Conventions\n- File names: lowercase, hyphens, no spaces (e.g., `transformer-architecture.md`)\n- Every wiki page starts with YAML frontmatter (see below)\n- Use `[[wikilinks]]` to link between pages (minimum 2 outbound links per page)\n- When updating a page, always bump the `updated` date\n- Every new page must be added to `index.md` under the correct section\n- Every action must be appended to `log.md`\n- **Provenance markers:** On pages that synthesize 3+ sources, append `^[raw\u002Farticles\u002Fsource-file.md]`\n  at the end of paragraphs whose claims come from a specific source. This lets a reader trace each\n  claim back without re-reading the whole raw file. Optional on single-source pages where the\n  `sources:` frontmatter is enough.\n\n## Frontmatter\n  ```yaml\n  ---\n  type: entity | concept | comparison | query | summary   # REQUIRED (OKF)\n  title: Page Title\n  description: One-line summary of this concept             # OKF recommended\n  created: YYYY-MM-DD\n  updated: YYYY-MM-DD                                      # maps to OKF timestamp\n  tags: [from taxonomy below]\n  sources: [raw\u002Farticles\u002Fsource-name.md]\n  resource: \u003COptional canonical URI for the underlying asset>  # OKF optional\n  # Optional quality signals:\n  confidence: high | medium | low        # how well-supported the claims are\n  contested: true                        # set when the page has unresolved contradictions\n  contradictions: [other-page-slug]      # pages this one conflicts with\n  ---\n  ```\n\n**OKF conformance:** `type` is the only required field. All other fields are extensions\nthat OKF consumers must tolerate. `description` enables index generation and search\nsnippets in OKF consumers. `resource` links to external assets (APIs, dashboards, repos).\n`updated` serves as OKF's `timestamp`.\n\n`confidence` and `contested` are optional but recommended for opinion-heavy or fast-moving\ntopics. Lint surfaces `contested: true` and `confidence: low` pages for review so weak claims\ndon't silently harden into accepted wiki fact.\n\n### raw\u002F Frontmatter\n\nRaw sources ALSO get a small frontmatter block so re-ingests can detect drift:\n\n```yaml\n---\nsource_url: https:\u002F\u002Fexample.com\u002Farticle   # original URL, if applicable\ningested: YYYY-MM-DD\nsha256: \u003Chex digest of the raw content below the frontmatter>\n---\n```\n\nThe `sha256:` lets a future re-ingest of the same URL skip processing when content is unchanged,\nand flag drift when it has changed. Compute over the body only (everything after the closing\n`---`), not the frontmatter itself.\n\n## Tag Taxonomy\n[Define 10-20 top-level tags for the domain. Add new tags here BEFORE using them.]\n\nExample for AI\u002FML:\n- Models: model, architecture, benchmark, training\n- People\u002FOrgs: person, company, lab, open-source\n- Techniques: optimization, fine-tuning, inference, alignment, data\n- Meta: comparison, timeline, controversy, prediction\n\nRule: every tag on a page must appear in this taxonomy. If a new tag is needed,\nadd it here first, then use it. This prevents tag sprawl.\n\n## Page Thresholds\n- **Create a page** when an entity\u002Fconcept appears in 2+ sources OR is central to one source\n- **Add to existing page** when a source mentions something already covered\n- **DON'T create a page** for passing mentions, minor details, or things outside the domain\n- **Split a page** when it exceeds ~200 lines — break into sub-topics with cross-links\n- **Archive a page** when its content is fully superseded — move to `_archive\u002F`, remove from index\n\n## Entity Pages\nOne page per notable entity. Include:\n- Overview \u002F what it is\n- Key facts and dates\n- Relationships to other entities ([[wikilinks]])\n- Source references\n\n## Concept Pages\nOne page per concept or topic. Include:\n- Definition \u002F explanation\n- Current state of knowledge\n- Open questions or debates\n- Related concepts ([[wikilinks]])\n\n## Comparison Pages\nSide-by-side analyses. Include:\n- What is being compared and why\n- Dimensions of comparison (table format preferred)\n- Verdict or synthesis\n- Sources\n\n## Update Policy\nWhen new information conflicts with existing content:\n1. Check the dates — newer sources generally supersede older ones\n2. If genuinely contradictory, note both positions with dates and sources\n3. Mark the contradiction in frontmatter: `contradictions: [page-name]`\n4. Flag for user review in the lint report\n```\n\n### index.md Template\n\nThe index is sectioned by type. Each entry is one line: wikilink + summary.\n\n```markdown\n# Wiki Index\n\n---\nokf_version: \"0.2\"\n---\n\n> Content catalog. Every wiki page listed under its type with a one-line summary.\n> Read this first to find relevant pages for any query.\n> Last updated: YYYY-MM-DD | Total pages: N\n\n## Entities\n\u003C!-- Alphabetical within section -->\n\n## Concepts\n\n## Comparisons\n\n## Queries\n```\n\n**Curator-managed block:** when `lumen:curator` runs on the wiki, it regenerates only the\ntext between `\u003C!-- lumen:auto:start -->` and `\u003C!-- lumen:auto:end -->` in `index.md` and\n`overview.md` (appending that block if a file has none). Keep hand-maintained sections, like\nthe ones above, outside the markers; never edit inside them, since the next run replaces it.\n\n**Scaling rule:** When any section exceeds 50 entries, split it into sub-sections\nby first letter or sub-domain. When the index exceeds 200 entries total, create\na `_meta\u002Ftopic-map.md` that groups pages by theme for faster navigation.\n\n### log.md Template\n\n```markdown\n# Wiki Log\n\n> Chronological record of all wiki actions. Append-only.\n> Format: `## [YYYY-MM-DD] action | subject`\n> Actions: ingest, update, query, lint, create, archive, delete\n> When this file exceeds 500 entries, rotate: rename to log-YYYY.md, start fresh.\n\n## [YYYY-MM-DD] create | Wiki initialized\n- Domain: [domain]\n- Structure created with purpose.md, SCHEMA.md, index.md, overview.md, log.md\n```\n\n### overview.md Template\n\nAuto-regenerated after every ingest. The wiki's \"elevator pitch\" for fast orientation.\n\n```markdown\n# Wiki Overview\n\n> Auto-generated. Last updated: YYYY-MM-DD | Total pages: N\n\n## Summary\n[2-3 paragraph summary of what the wiki covers and its current state]\n\n## Main Topics\n- [Topic 1] — [N pages] — [brief description]\n- [Topic 2] — [N pages] — [brief description]\n\n## Recent Changes\n- [YYYY-MM-DD] [action] — [what changed]\n- [YYYY-MM-DD] [action] — [what changed]\n\n## Key Themes\n[Emerging patterns and connections across the wiki]\n```\n\n## Core Operations\n\n### 1. Ingest (Two-Step Chain-of-Thought)\n\nWhen the user provides a source (URL, file, paste), integrate it into the wiki in two\nsequential phases for better quality — Analysis, then Generation.\n\n#### Step 1: Capture & Analysis\n\n① **Capture the raw source:**\n   - URL → use `web_extract` to get markdown, save to `raw\u002Farticles\u002F`\n   - PDF → use `web_extract` (handles PDFs), save to `raw\u002Fpapers\u002F`\n   - Pasted text → save to appropriate `raw\u002F` subdirectory\n   - Name the file descriptively: `raw\u002Farticles\u002Fkarpathy-llm-wiki-2026.md`\n   - **Add raw frontmatter** (`source_url`, `ingested`, `sha256` of the body).\n     On re-ingest of the same URL: recompute the sha256, compare to the stored value —\n     skip if identical, flag drift and update if different. This is cheap enough to\n     do on every re-ingest and catches silent source changes.\n\n② **Read `purpose.md`** — align with the wiki's goals and scope before analyzing.\n\n③ **Discuss takeaways** with the user — what's interesting, what matters for\n   the domain. (Skip this in automated\u002Fcron contexts — proceed directly.)\n\n④ **Check what already exists** — search index.md and use `search_files` to find\n   existing pages for mentioned entities\u002Fconcepts. This is the difference between\n   a growing wiki and a pile of duplicates.\n\n⑤ **Structured Analysis** — before writing any pages, produce an analysis:\n   - Key entities, concepts, arguments in the source\n   - Connections to existing wiki content (which pages relate, how)\n   - Contradictions & tensions with existing knowledge\n   - Recommendations for wiki structure (new pages vs updates vs merges)\n   \n   In conversation context, share this analysis with the user. In automated\u002Fcron\n   contexts, proceed directly to Step 2.\n\n#### Step 2: Generation\n\n⑥ **Write or update wiki pages** based on the analysis:\n   - **New entities\u002Fconcepts:** Create pages only if they meet the Page Thresholds\n     in SCHEMA.md (2+ source mentions, or central to one source)\n   - **Existing pages:** Add new information, update facts, bump `updated` date.\n     When new info contradicts existing content, follow the Update Policy.\n   - **Cross-reference:** Every new or updated page must link to at least 2 other\n     pages via `[[wikilinks]]`. Check that existing pages link back.\n   - **Tags:** Only use tags from the taxonomy in SCHEMA.md\n   - **Provenance:** On pages synthesizing 3+ sources, append `^[raw\u002Farticles\u002Fsource.md]`\n     markers to paragraphs whose claims trace to a specific source.\n   - **Confidence:** For opinion-heavy, fast-moving, or single-source claims, set\n     `confidence: medium` or `low` in frontmatter. Don't mark `high` unless the\n     claim is well-supported across multiple sources.\n\n⑦ **Update navigation & overview:**\n   - Add new pages to `index.md` under the correct section, alphabetically\n   - Update the \"Total pages\" count and \"Last updated\" date in index header\n   - Edit hand-maintained content only outside the `\u003C!-- lumen:auto:start -->` … `\u003C!-- lumen:auto:end -->` block (the curator owns that block)\n   - **Regenerate `overview.md`** — a global summary of the entire wiki, updated after every ingest. Include: total pages, main topics, recent changes, key themes. This is the wiki's \"elevator pitch\" and helps the LLM orient quickly on future sessions.\n   - Append to `log.md`: `## [YYYY-MM-DD] ingest | Source Title`\n   - List every file created or updated in the log entry\n\n⑧ **Report what changed** — list every file created or updated to the user.\n\nA single source can trigger updates across 5-15 wiki pages. This is normal\nand desired — it's the compounding effect.\n\n### 2. Query (4-Signal Relevance Model)\n\nWhen the user asks a question about the wiki's domain:\n\n① **Read `purpose.md`** — align with the wiki's scope.\n② **Read `index.md`** to identify relevant pages.\n③ **For wikis with 100+ pages**, also `search_files` across all `.md` files\n   for key terms — the index alone may miss relevant content.\n④ **Read the relevant pages** using `read_file`.\n⑤ **Rank results using the 4-signal relevance model:**\n\n| Signal | Weight | Description |\n|--------|--------|-------------|\n| Direct link | ×3.0 | Pages linked via `[[wikilinks]]` from seed pages |\n| Source overlap | ×4.0 | Pages sharing the same raw source (via frontmatter `sources[]`) |\n| Adamic-Adar | ×1.5 | Pages sharing common neighbors (weighted by neighbor degree) |\n| Type affinity | ×1.0 | Bonus for same page type (concept→concept, entity→entity) |\n\n   For each candidate page, compute a composite score. Start with keyword-matched\n   seed pages, then expand 2 hops via `[[wikilinks]]` and source overlap. Rank by\n   composite score. Read only the top pages (budget control: ~60% bodies \u002F 20%\n   chat context \u002F 5% index \u002F 15% system prompt).\n\n⑥ **Synthesize an answer** from the compiled knowledge. Cite the wiki pages\n   you drew from: \"Based on [[page-a]] and [[page-b]]...\"\n⑦ **File valuable answers back** — if the answer is a substantial comparison,\n   deep dive, or novel synthesis, create a page in `queries\u002F` or `comparisons\u002F`.\n   Don't file trivial lookups — only answers that would be painful to re-derive.\n⑧ **Update log.md** with the query and whether it was filed.\n\n### 3. Lint\n\nWhen the user asks to lint, health-check, or audit the wiki:\n\n① **Orphan pages:** Find pages with no inbound `[[wikilinks]]` from other pages.\n```python\n# Use execute_code for this — programmatic scan across all wiki pages\nimport os, re\nfrom collections import defaultdict\nwiki = \"\u003CWIKI_PATH>\"\n# Scan all .md files in entities\u002F, concepts\u002F, comparisons\u002F, queries\u002F\n# Extract all [[wikilinks]] — build inbound link map\n# Pages with zero inbound links are orphans\n```\n\n② **Broken wikilinks:** Find `[[links]]` that point to pages that don't exist.\n\n③ **Index completeness:** Every wiki page should appear in `index.md`. Compare\n   the filesystem against index entries.\n\n④ **Frontmatter validation:** Every wiki page must have all required fields\n   (title, created, updated, type, tags, sources). Tags must be in the taxonomy.\n\n⑤ **Stale content:** Pages whose `updated` date is >90 days older than the most\n   recent source that mentions the same entities.\n\n⑥ **Contradictions:** Pages on the same topic with conflicting claims. Look for\n   pages that share tags\u002Fentities but state different facts. Surface all pages\n   with `contested: true` or `contradictions:` frontmatter for user review.\n\n⑦ **Quality signals:** List pages with `confidence: low` and any page that cites\n   only a single source but has no confidence field set — these are candidates\n   for either finding corroboration or demoting to `confidence: medium`.\n\n⑧ **Source drift:** For each file in `raw\u002F` with a `sha256:` frontmatter, recompute\n   the hash and flag mismatches. Mismatches indicate the raw file was edited\n   (shouldn't happen — raw\u002F is immutable) or ingested from a URL that has since\n   changed. Not a hard error, but worth reporting.\n\n⑨ **Page size:** Flag pages over 200 lines — candidates for splitting.\n\n⑩ **Tag audit:** List all tags in use, flag any not in the SCHEMA.md taxonomy.\n\n⑪ **Log rotation:** If log.md exceeds 500 entries, rotate it.\n\n⑫ **Graph insights — surprising connections:** Find cross-community edges (pages\n   in different Louvain clusters linked via `[[wikilinks]]`), cross-type links\n   (entity↔concept), and peripheral↔hub couplings. These are often the most\n   interesting parts of the knowledge base — flag them for the user to review.\n\n⑬ **Graph insights — knowledge gaps:**\n   - **Isolated pages:** degree ≤ 1 (few or no connections — candidates for expansion)\n   - **Sparse communities:** Louvain clusters with cohesion \u003C 0.15 and ≥ 3 pages\n   - **Bridge nodes:** pages connecting 3+ clusters (high leverage but fragile)\n\n⑭ **Deduplication check:** Look for pages with similar titles or overlapping\n   content. If two pages cover the same concept with >70% content overlap,\n   flag for merge. Use LLM judgment: extract summaries, compare, recommend\n   merge or keep-separate. Do NOT auto-merge — surface as a review item.\n\n⑮ **Report findings** with specific file paths and suggested actions, grouped by\n   severity (broken links > orphans > source drift > contested pages > stale content > style issues > graph insights > dedup candidates).\n\n⑯ **Append to log.md:** `## [YYYY-MM-DD] lint | N issues found`\n\n## Working with the Wiki\n\n### Searching\n\n```bash\n# Find pages by content\nsearch_files \"transformer\" path=\"$WIKI\" file_glob=\"*.md\"\n\n# Find pages by filename\nsearch_files \"*.md\" target=\"files\" path=\"$WIKI\"\n\n# Find pages by tag\nsearch_files \"tags:.*alignment\" path=\"$WIKI\" file_glob=\"*.md\"\n\n# Recent activity\nread_file \"$WIKI\u002Flog.md\" offset=\u003Clast 20 lines>\n```\n\n### Bulk Ingest\n\nWhen ingesting multiple sources at once, batch the updates:\n1. Read all sources first\n2. Identify all entities and concepts across all sources\n3. Check existing pages for all of them (one search pass, not N)\n4. Create\u002Fupdate pages in one pass (avoids redundant updates)\n5. Update index.md once at the end\n6. Write a single log entry covering the batch\n\n### Archiving\n\nWhen content is fully superseded or the domain scope changes:\n1. Create `_archive\u002F` directory if it doesn't exist\n2. Move the page to `_archive\u002F` with its original path (e.g., `_archive\u002Fentities\u002Fold-page.md`)\n3. Remove from `index.md`\n4. Update any pages that linked to it — replace wikilink with plain text + \"(archived)\"\n5. Log the archive action\n\n### Obsidian Integration\n\nThe wiki directory works as an Obsidian vault out of the box:\n- `[[wikilinks]]` render as clickable links\n- Graph View visualizes the knowledge network\n- YAML frontmatter powers Dataview queries\n- The `raw\u002Fassets\u002F` folder holds images referenced via `![[image.png]]`\n\nFor best results:\n- Set Obsidian's attachment folder to `raw\u002Fassets\u002F`\n- Enable \"Wikilinks\" in Obsidian settings (usually on by default)\n- Install Dataview plugin for queries like `TABLE tags FROM \"entities\" WHERE contains(tags, \"company\")`\n\nIf using the Obsidian skill alongside this one, set `OBSIDIAN_VAULT_PATH` to the\nsame directory as the wiki path.\n\n### Obsidian Headless (servers and headless machines)\n\nOn machines without a display, use `obsidian-headless` instead of the desktop app.\nIt syncs vaults via Obsidian Sync without a GUI — perfect for agents running on\nservers that write to the wiki while Obsidian desktop reads it on another device.\n\n**Setup:**\n```bash\n# Requires Node.js 22+\nnpm install -g obsidian-headless\n\n# Login (requires Obsidian account with Sync subscription)\nob login --email \u003Cemail> --password '\u003Cpassword>'\n\n# Create a remote vault for the wiki\nob sync-create-remote --name \"LLM Wiki\"\n\n# Connect the wiki directory to the vault\ncd ~\u002Fwiki\nob sync-setup --vault \"\u003Cvault-id>\"\n\n# Initial sync\nob sync\n\n# Continuous sync (foreground — use systemd for background)\nob sync --continuous\n```\n\n**Continuous background sync via systemd:**\n```ini\n# ~\u002F.config\u002Fsystemd\u002Fuser\u002Fobsidian-wiki-sync.service\n[Unit]\nDescription=Obsidian LLM Wiki Sync\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nExecStart=\u002Fpath\u002Fto\u002Fob sync --continuous\nWorkingDirectory=\u002Fhome\u002Fuser\u002Fwiki\nRestart=on-failure\nRestartSec=10\n\n[Install]\nWantedBy=default.target\n```\n\n```bash\nsystemctl --user daemon-reload\nsystemctl --user enable --now obsidian-wiki-sync\n# Enable linger so sync survives logout:\nsudo loginctl enable-linger $USER\n```\n\nThis lets the agent write to `~\u002Fwiki` on a server while you browse the same\nvault in Obsidian on your laptop\u002Fphone — changes appear within seconds.\n\n## Pitfalls\n\n- **Never modify files in `raw\u002F`** — sources are immutable. Corrections go in wiki pages.\n- **Always orient first** — read SCHEMA + index + recent log before any operation in a new session.\n  Skipping this causes duplicates and missed cross-references.\n- **Always update index.md and log.md** — skipping this makes the wiki degrade. These are the\n  navigational backbone.\n- **Don't create pages for passing mentions** — follow the Page Thresholds in SCHEMA.md. A name\n  appearing once in a footnote doesn't warrant an entity page.\n- **Don't create pages without cross-references** — isolated pages are invisible. Every page must\n  link to at least 2 other pages.\n- **Frontmatter is required** — it enables search, filtering, and staleness detection.\n- **Tags must come from the taxonomy** — freeform tags decay into noise. Add new tags to SCHEMA.md\n  first, then use them.\n- **Keep pages scannable** — a wiki page should be readable in 30 seconds. Split pages over\n  200 lines. Move detailed analysis to dedicated deep-dive pages.\n- **Ask before mass-updating** — if an ingest would touch 10+ existing pages, confirm\n  the scope with the user first.\n- **Rotate the log** — when log.md exceeds 500 entries, rename it `log-YYYY.md` and start fresh.\n  The agent should check log size during lint.\n- **Handle contradictions explicitly** — don't silently overwrite. Note both claims with dates,\n  mark in frontmatter, flag for user review.\n- **Read `purpose.md` on every ingest and query** — skipping this causes drift from the wiki's\n  intended scope. Purpose is the compass; schema is the rulebook.\n- **Regenerate `overview.md` after every ingest** — a stale overview is worse than no overview\n  because it misleads orientation. It should reflect the current state of the wiki.\n- **Page merge on re-ingest** — when re-ingesting a source that was already processed, use a\n  3-layer merge: (1) array union for lists\u002Flinks, (2) LLM body merge with a 70% length sanity\n  check (if merged body is \u003C70% or >130% of the longer original, flag for manual review),\n  (3) locked frontmatter fields (title, created — never overwritten). This prevents both\n  information loss and uncontrolled bloat from repeated re-ingestion.\n- **Dedup is advisory, not automatic** — the dedup check surfaces candidates but never auto-merges.\n  Two pages with similar titles may cover genuinely different aspects. Always present to the user.\n\n## Upstream & Related\n\n**Canonical source:** [Andrej Karpathy's LLM Wiki gist](https:\u002F\u002Fgist.github.com\u002Fkarpathy\u002F442a6bf555914893e9891c11519de94f) — the pattern this skill implements.\n\n**Conceptual enhancements adopted from:** [nashsu\u002Fllm_wiki](https:\u002F\u002Fgithub.com\u002Fnashsu\u002Fllm_wiki) — methodology niceties (purpose.md, two-step CoT ingest, overview.md, 4-signal relevance, graph insights, dedup, cohesion scoring). We adopt the *concepts*, not the code. The upstream desktop app, API, MCP server, vector search, and Chrome clipper are separate products and are not used by this skill. Upstream app is GPL-3.0; this skill remains MIT (original implementation, no upstream code\u002Ftext imported).\n\n**Related CLI tool:** [llm-wiki-compiler](https:\u002F\u002Fgithub.com\u002Fatomicmemory\u002Fllm-wiki-compiler) — a Node.js CLI that\ncompiles sources into a concept wiki with the same Karpathy inspiration. Obsidian-compatible.\nUse this skill when you want agent-in-the-loop curation; use llm-wiki-compiler when you want\nbatch compile of a source directory.\n",{"name":5,"license":14,"metadata":23,"description":7},{"tags":24,"author":9,"hermes":30,"version":34,"platforms":35},[5,25,26,27,28,29],"knowledge-base","research","notes","markdown","rag-alternative",{"category":26,"related_skills":31},[32,33],"obsidian","arxiv","0.1.2",[36,37,38],"linux","macos","windows","main","e943e3285cd03c44b2c762a9a52328e3d16444b1","plugins\u002Flumen\u002Fskills\u002Fwiki",22,"https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin\u002Fagent-skills","https:\u002F\u002Fhermes-agent.nousresearch.com","https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin","Accounting\u002FFP&A\u002FM&A\u002FPERE guy by day, AI\u002Fself-host\u002Fprogramming hobbyist by night. \r\n\r\nPassionate in solving practical business issues.","2026-11-13 19:46:18",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add moonlight-lupin\u002Fagent-skills --skill wiki",{"tool":54,"command":55},"bunx","bunx skills add moonlight-lupin\u002Fagent-skills --skill wiki",{"tool":57,"command":58},"pnpm","pnpm dlx skills add moonlight-lupin\u002Fagent-skills --skill wiki","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin\u002Fagent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Flumen\u002Fskills\u002Fwiki\u002FSKILL.md",true,[],[63,70,77,84,91,98],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M78ATNRV7RYQ8M314V0QZX18","website-scraping","Generic playbook for extracting structured data from any website — hotel prices, flight fares, e-commerce listings, real estate, jobs, competitor product catalogues, anything where the goal is to turn one or more URLs into clean records on disk. Use this skill whenever the user mentions scraping, harvesting, extracting, or pulling data from a website; names a specific site or competitor they want data from; asks how to handle JavaScript-rendered pages, Cloudflare blocks, bot detection, Turnstile challenges, or Playwright; wants to monitor prices over time; needs to automate a copy-paste research task; or says things like \"just get the data from X\" or \"I need a script that grabs N from site Y\". Covers recon, picking the lightest extraction tool that works, surviving anti-bot defences, and writing clean JSONL output with a run manifest. Scope is scraping only — landing data in a database, scheduling, and downstream pipeline work are explicitly out of scope and live in other tools.","https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin\u002Fagent-skills\u002Fblob\u002Fmain\u002Fweb-scraping\u002Fwebsite-scraping\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M78ATK9XGEKSH3QRN7P2MEER","greet","Greets a named person warmly.","https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin\u002Fagent-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fclaude_plugin_sample\u002Fskills\u002Fgreet\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M78ATEAQB5CK2D4MKPCW4YHQ","skill-quality-review","Use when auditing or reviewing skill quality — batch checks across a library, deep per-skill grep methodology, usage stats, efficacy testing, or fix planning. Single consolidated home for the writing-for-agents review framework and the 3-surface review methodology.","https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin\u002Fagent-skills\u002Fblob\u002Fmain\u002Fsoftware-development\u002Fskill-quality-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M78AT58EM57023QSC79S8R6D","people-enrichment","Use when the user has a list of names or companies and wants their job, employer, work history, LinkedIn URLs or company profiles looked up, or wants to find people or companies matching criteria — trigger on phrases like \"enrich these contacts\", \"find their LinkedIn\", \"look up these people\", \"who works at X\", \"find directors at Y\", \"enrich these companies\", or \"get firmographics for\". Enrich and search People Data Labs (PDL) Person and Company data, writing results to .xlsx. Five operations: enrich named PEOPLE into a profile, employment history and LinkedIn URL; IDENTIFY an ambiguous person as several scored candidates; SEARCH people by criteria (company, title, location); enrich COMPANIES into firmographics (industry, size, employees, HQ, founded, LinkedIn); and SEARCH companies by criteria. Do not scrape LinkedIn directly — this uses a licensed data aggregator (PDL) instead, for legal and reliability reasons.","https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin\u002Fagent-skills\u002Fblob\u002Fmain\u002Fresearch\u002Fpeople-enrichment\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":18},"01M78AT0AZJ7WFY73766NBA1EC","notebooklm-mode","Source-grounded research pipeline inspired by NotebookLM. Collect verbatim source extracts into a temporary workspace, then answer questions and create deliverables grounded in those sources. Two grounding modes: strict (vault-only) and augmented (vault + labeled [background] knowledge). Trigger when the user asks to research a topic from sources, wants NotebookLM-style grounded answers, asks to build a resource vault, or says \"notebooklm mode\".","https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin\u002Fagent-skills\u002Fblob\u002Fmain\u002Fresearch\u002Fnotebooklm-mode\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":18},"01M78ASTJVZ9G5JY6GM40SF909","news-monitoring","Use when a topic or news stream needs recurring monitoring — cover it with web search, multi-language sources, digest formatting, and automated delivery via Hermes cron jobs. Covers search strategy, source selection, Chinese-language platforms, and digest templates.","https:\u002F\u002Fgithub.com\u002Fmoonlight-lupin\u002Fagent-skills\u002Fblob\u002Fmain\u002Fresearch\u002Fnews-monitoring\u002FSKILL.md",[],[]]