← Back to Skills Marketplace
zhangmengyang

karpathy-wiki

by Zack · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
33
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install karpathy-wiki-improve
Description
Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source trace...
README (SKILL.md)

karpathy-wiki — OpenClaw Implementation v3.0

Based on Andrej Karpathy's LLM Wiki pattern.


wiki Root

wiki_root: /path/to/your/wiki  # configure to your local path
\x3Cwiki_root>/
├── raw/
│   ├── sources/          # raw bookmarks/docs (immutable)
│   └── assets/           # images and resources
├── wiki/
│   ├── entities/        # entity pages (people, products, companies, sites, books)
│   ├── concepts/        # concept pages (tech, theory, methodology)
│   ├── comparisons/     # comparison pages
│   ├── synthesis/       # synthesis/overview pages
│   ├── index.md         # wiki index (entry point)
│   ├── log.md           # operation log (append-only)
│   └── overview.md      # global overview
├── purpose.md           # wiki goal definition (wiki constitution)
└── schema.md            # structure conventions

Core Principles (v3.0)

  1. sources/ is read-only — LLM only writes wiki/, never modifies raw sources
  2. wikilink cross-references[[page-slug]] syntax for page connections
  3. YAML frontmatter — every page has type/tags/related/sources
  4. Bidirectional links enforced — every write to related must sync back-link
  5. Two-phase Ingest — Analysis → Generation
  6. URL-level traceability — sources contain specific URLs, not just filenames
  7. Lint-driven — periodic health checks, graph stays clean
  8. Deep Research — knowledge gaps auto-discovered and filled

Page Type Taxonomy (entity vs concept boundary)

Type Definition Examples
entity Named, discrete things people/products/companies/sites/books/tools
concept Abstract ideas/theories/methodologies indexing principles, microservices, DI
comparison Multi-option comparisons Vue vs React, MySQL vs PostgreSQL
synthesis Comprehensive overview tech stack panorama, annual summary

Boundary Rules:

  • If it has a specific name → entity ("pdai.tech", "Effective Java")
  • If it's abstract/generic → concept ("MySQL indexing", "dependency injection")
  • Avoid having both entity and concept for the same topic

Naming Convention

entity:
  blogs/sites: use domain or person name
    → mysql-zhu-shuangyin
    → pdai-tech
    → jon-index-blog
  books: use simplified book title
    → effective-java

concept:
  use core terms in kebab-case
    → mysql-innodb
    → jwt-json-web-token
    → dependency-injection

comparison:
  → mysql-postgresql-comparison
  → vue-vs-react

synthesis:
  → go-web-dev-overview
  → 2026-learning-roadmap-summary

Rules:

  • All lowercase, hyphen-separated
  • No mixed Chinese/English
  • Unique slugs, no duplicates

YAML Frontmatter (Required Fields)

---
type: entity | concept | comparison | synthesis
title: Page Title
created: YYYY-MM-DD
updated: YYYY-MM-DD
tags: [tag1, tag2]
related: [page-slug-1, page-slug-2]  # forward reference (back-link auto-added)
sources:
  - file: bookmarks_xxx.md
    urls:
      - https://example.com/article1
      - https://example.com/article2
---

sources.urls is mandatory — URL-level traceability is a core principle.


Quality Thresholds

Every concept/comparison page must have:

Requirement Description
One-line definition frontmatter title or page header >
Core principles ≥ 3 body contains at least 3 substantial points
Related pages ≥ 1 related field is non-empty
Source URLs sources.urls is non-empty
Back-links added every page in related back-links to this page

Every entity page must have:

Requirement Description
One-line description frontmatter title
Key features ≥ 2 body has substantive descriptions
Related pages ≥ 1 related field non-empty
Source URLs sources.urls is non-empty

Page Templates

Entity Page

---
type: entity
title: Entity Name
created: YYYY-MM-DD
updated: YYYY-MM-DD
tags: [tags]
related: [page-slug-1, page-slug-2]
sources:
  - file: bookmarks_xxx.md
    urls:
      - https://example.com
---

# Entity Name

> One-line description (used in index.md summary).

## Overview
Main content and background.

## Key Features
- Feature 1
- Feature 2

## Related
- [[page-slug]] — reason (back-link auto-added)

## Sources
- [Article Title](https://example.com) — source description

Concept Page

---
type: concept
title: Concept Name
created: YYYY-MM-DD
updated: YYYY-MM-DD
tags: [tags]
related: [page-slug-1, page-slug-2]
sources:
  - file: bookmarks_xxx.md
    urls:
      - https://example.com/article1
---

# Concept Name

> One-line definition.

## Core Principles
- Principle 1
- Principle 2
- Principle 3

## Use Cases
- Use case 1

## Related
- [[page-slug]] — reason

## Counter-arguments / Data Gaps
- Known limitations
- Uncovered aspects

## Sources
- [Article Title](https://example.com) — source description

Operations

Ingest (Collection & Digestion)

Phase 1 — Analysis

## Key Entities
Identified entities

## Key Concepts
Identified core concepts

## Main Arguments & Findings
Key arguments and findings

## Connections to Existing Wiki
Relations to existing wiki pages

## Contradictions & Tensions
Conflicts with existing knowledge

## Coverage Gaps
What was mentioned but not covered deeply?
What related topics are missing?

## Recommendations
New/update which pages

Phase 2 — Generation

  1. Create/update target pages (with urls in sources)
  2. Sync related + back-link (bidirectional link enforcement)
  3. Verify pages meet quality thresholds
  4. Update index.md
  5. Append to log.md

Output format:

---FILE: wiki/concepts/page.md---
[page content with sources.urls]
---END FILE---

---FILE: wiki/entities/backlink-target.md---
[update target page, append back-link]
---END FILE---

---FILE: wiki/index.md---
[append new page entry]
---END FILE---

---FILE: wiki/log.md---
[append ingest log entry]
---END FILE---

Query

  1. Read wiki/index.md to locate relevant pages
  2. Read related pages + extract sources.urls
  3. Use web_fetch to trace and verify original URLs
  4. Synthesize answer, annotate source confidence

Relink (Automatic Relationship Discovery)

Trigger: batch ingest complete / periodic heartbeat

Process:

1. Scan all wiki/*.md tags and body text
2. Extract core topics from each page
3. Find page pairs sharing tags/topics
4. Analyze relationship strength pairwise
5. Generate recommended link list (candidate)
6. User confirms before writing (back-link sync)

Execution steps:

# 1. Collect all related pairs (shared tags)
grep -r "^tags:" wiki/concepts/ wiki/entities/ | analyze

# 2. List orphan pages
for f in wiki/**/*.md; do
  related=$(grep "^related:" "$f")
  inbound=$(grep -r "^\* \[\[$(basename $f .md)\]\]" wiki/)
  [ -z "$related" ] && [ -z "$inbound" ] && echo "$f is orphan"
done

# 3. LLM generates relink suggestion report
#    Format:
#    [[page-A]] \x3C--> [[page-B]]  reason: shared tag MySQL B+tree
#    [[page-C]] --> [[page-D]]   reason: C mentions D but not linked

Write rules:

  • Update A's related to add B
  • Update B's related to add A
  • Append to log.md

Lint (Health Check) — Enhanced

Trigger: user request / periodic heartbeat

Scan dimensions (6):

# Dimension Description
1 Orphan pages No related pages, no inbound links
2 Dangling references related references non-existent slugs
3 One-way links A→B but B→A missing
4 Contradiction detection Same claim described differently across pages
5 Quality threshold Page fails minimum quality (no urls/no related/principles\x3C3)
6 Naming drift Slug style inconsistent (mixed case/mixed Chinese-English)

Lint report format:

## Lint Report — YYYY-MM-DD

### Orphan Pages (N)
- [[page]] — no related, no inbound

### One-way Links (N)
- [[A]] → [[B]] (B not back-linking A)

### Dangling References (N)
- [[page]] references non-existent [[nonexistent]]

### Quality Failures (N)
- [[page]] — missing urls source
- [[page]] — empty related

### Contradictions (N)
- [[page-A]] says: X is Y
- [[page-B]] says: X is Z

### Naming Issues (N)
- [[page]] — slug has uppercase/mixed Chinese-English

### Recommended Actions
1. [Priority 1]
2. [Priority 2]

Deep Research

Trigger: lint finds Coverage Gaps / user says "research X"

Process:

1. Discover knowledge gap
   lint report "missing coverage" items
   user says "help me research XXX"

2. Generate search queries
   LLM generates 3-5 search queries from gap

3. Multi-source search
   Execute web_search for each query

4. Ingest results
   Write search results to raw/sources/
   Execute ingest to generate new pages

5. relink + lint
   complete relationships + health check

purpose.md (Wiki Constitution)

Every wiki should have purpose.md defining:

# purpose.md

## Goal
Who is this wiki for? What problem does it solve?

## Core Questions
What core questions must this wiki answer?

## Scope
What domains are covered?
What is explicitly excluded?

## Evolution Direction
Near-term (3 months): fill gaps in which domains?
Mid-term (6 months): what state to achieve?
Long-term (1 year): what is the ideal wiki form?

## Quality Standards
What is the minimum quality threshold?

Source Traceability Chain

User bookmarks (Chrome export)
  ↓
raw/sources/bookmarks_xxx.md  (immutable)
  ↓  Ingest writes
wiki/xxx.md
  sources:
    - file: bookmarks_xxx.md
      urls:
        - https://example.com  ← specific URL
  ↓  Query time
OpenClaw reads wiki → reads sources.urls → web_fetch original URL → verify

Use Cases

  • User asks technical question (check wiki first, then search)
  • User says "help me digest this link"
  • User requests "organize my collected content on XXX"
  • User requests "run lint"
  • User requests "relink"
  • User requests "research X" (Deep Research)
  • Periodic heartbeat triggers lint + relink + quality check

Confidence Annotations

Annotation Meaning
✅ Verified wiki content matches original URL source
⚠️ Inferred wiki content is LLM inference based on source, not direct quote
❌ Disputed wiki content contradicts source, needs verification

Bidirectional Link Write Rules (Enforced)

Every time you modify the related field:

When writing A's related to add B:
  1. Add B to A's related: [...]
  2. Check if B's related already has A
  3. If not, add A as back-link
  4. If yes, skip

Prohibited:

  • ❌ Write A→B only, skip B→A
  • ❌ Leave related empty with no links added
  • ❌ sources has only file, no urls
Usage Guidance
This appears safe to install as an instruction-only local wiki workflow if you trust the registry entry and use it on a dedicated folder. Before running ingest or Deep Research steps, make sure the wiki root does not contain secrets, private credentials, or materials you would not want summarized into persistent markdown files, and review generated diffs after multi-file maintenance operations.
Capability Analysis
Type: OpenClaw Skill Name: karpathy-wiki-improve Version: 1.0.1 The skill bundle implements a structured knowledge management system based on the 'Karpathy LLM Wiki' pattern. It provides detailed instructions for an AI agent to manage a local directory of markdown files, including automated ingestion, bidirectional linking, health linting, and 'Deep Research' via web searches. The operations are confined to the user-defined wiki root and standard web tools, with no evidence of data exfiltration, malicious execution, or prompt injection attacks in SKILL.md.
Capability Assessment
Purpose & Capability
The stated purpose—building and maintaining a Karpathy-style local LLM wiki—matches the documented ingest, query, relink, lint, and Deep Research workflow. The automatic graph maintenance is disclosed, but it should be supervised because it can add and update persistent knowledge.
Instruction Scope
The instructions explicitly scope writes to the wiki folder and keep raw sources read-only, but related/backlink/index operations can update multiple wiki files during one task.
Install Mechanism
There is no install spec, no code, no required binaries, and no declared credentials. Provenance is limited because the source/homepage are unknown, and the registry version differs from the SKILL.md frontmatter version.
Credentials
Reading user-provided raw sources and writing generated markdown pages is proportionate for a local knowledge-base skill, but users should avoid including secrets or private URLs unless they are comfortable having them summarized in the wiki.
Persistence & Privilege
The skill creates persistent wiki pages, backlinks, indexes, and logs, but it does not request account credentials, elevated privileges, background services, or external install-time execution.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install karpathy-wiki-improve
  3. After installation, invoke the skill by name or use /karpathy-wiki-improve
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
No functional changes in this version; only SKILL.md metadata and documentation have been updated. - Skill renamed from "llm-wiki" to "karpathy-wiki" - Description revised to English and references the Karpathy LLM Wiki pattern explicitly - All documentation rewritten in English for broader accessibility - No core logic, operational, or code changes detected
v1.0.0
Version 3.0 is a major refactor and expansion, replacing the previous Karpathy-wiki skill with LLM Wiki: - Complete rewrite: Skill is now LLM Wiki v3.0, implementing a structured, multilingual (Chinese), entity/concept/category wiki system. - Reorganized and expanded all documentation; removed all previous reference guides. - Introduced stricter page type conventions (entity, concept, comparison, synthesis), with clear naming, linking, and minimum content standards. - Enforced traceable sources (urls required in sources for every page) and mutual (bi-directional) linking for all related entries. - Added new operational modes: Deep Research, automatic relink, enhanced linting (orphan, broken, one-way links, naming drift, quality gating, contradiction detection). - Required new files: purpose.md (wiki "constitution"), with detailed per-file and per-operation format examples.
Metadata
Slug karpathy-wiki-improve
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is karpathy-wiki?

Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source trace... It is an AI Agent Skill for Claude Code / OpenClaw, with 33 downloads so far.

How do I install karpathy-wiki?

Run "/install karpathy-wiki-improve" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is karpathy-wiki free?

Yes, karpathy-wiki is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does karpathy-wiki support?

karpathy-wiki is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created karpathy-wiki?

It is built and maintained by Zack (@zhangmengyang); the current version is v1.0.1.

💬 Comments