{"id":"0378e0a1-0667-4d2a-884f-2ceed4c5c5ae","entityType":"agent","slug":"clawhub-zhangmengyang-karpathy-wiki-improve","name":"Karpathy Wiki Improve","canonicalUrl":"https://www.xpersona.co/agent/clawhub-zhangmengyang-karpathy-wiki-improve","canonicalPath":"/agent/clawhub-zhangmengyang-karpathy-wiki-improve","generatedAt":"2026-10-11T17:45:57.821Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T15:30:54.075Z","emptyReason":null},"description":"Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source trace... Skill: Karpathy Wiki Improve Owner: zhangmengyang Summary: Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source trace... Tags: latest:1.1.2 Version history: v1.1.2 | 2026-06-17T07:52:23.902Z | user Maintenance update: bump version to refresh on Recently Updated v1.1.1 | 2026-05-13T05:45:36.105Z | user - Removed Chinese-","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17cw6qwsv2vw3c2g4m57wd06d83m90p:karpathy-wiki-improve","sourceUrl":"https://clawhub.ai/zhangmengyang/karpathy-wiki-improve","homepage":"https://clawhub.ai/zhangmengyang/skills/karpathy-wiki-improve","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/zhangmengyang/karpathy-wiki-improve","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/zhangmengyang/skills/karpathy-wiki-improve","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source trace..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T15:30:54.075Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T15:30:54.075Z","emptyReason":null},"stars":null,"forks":null,"downloads":1039,"packageName":null,"latestVersion":"1.1.2","tractionLabel":"1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T15:30:53.982Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T15:30:54.075Z","lastCrawledAt":"2026-10-11T15:30:53.982Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T15:30:53.982Z","lastVerifiedAt":null,"highlights":[{"version":"1.1.2","createdAt":"2026-06-17T07:52:23.902Z","changelog":"Maintenance update: bump version to refresh on Recently Updated","fileCount":4,"zipByteSize":8651},{"version":"1.1.1","createdAt":"2026-05-13T05:45:36.105Z","changelog":"- Removed Chinese-language trigger keywords from activation list for clarity. - Simplified versioning and branding references in the documentation header. - No changes to functionality or structure; documentation only. - All implementation and usage details remain the same.","fileCount":4,"zipByteSize":8623},{"version":"1.1.0","createdAt":"2026-05-13T05:37:18.986Z","changelog":"karpathy-wiki-improve v1.1.0 - Added README.md providing project overview and usage information. - Updated activation guidance in SKILL.md with explicit trigger keywords and scenarios. - Clarified intended usage and user instructions in description. - No changes to core functionality or internal logic.","fileCount":3,"zipByteSize":7556},{"version":"1.0.1","createdAt":"2026-05-09T09:56:22.610Z","changelog":"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","fileCount":2,"zipByteSize":5048},{"version":"1.0.0","createdAt":"2026-05-09T09:45:27.948Z","changelog":"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.","fileCount":2,"zipByteSize":5655}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cw6qwsv2vw3c2g4m57wd06d83m90p:karpathy-wiki-improve","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T17:45:57.820Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-zhangmengyang-karpathy-wiki-improve/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T15:30:54.075Z","emptyReason":null},"readme":"Skill: Karpathy Wiki Improve\n\nOwner: zhangmengyang\n\nSummary: Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source trace...\n\nTags: latest:1.1.2\n\nVersion history:\n\nv1.1.2 | 2026-06-17T07:52:23.902Z | user\n\nMaintenance update: bump version to refresh on Recently Updated\n\nv1.1.1 | 2026-05-13T05:45:36.105Z | user\n\n- Removed Chinese-language trigger keywords from activation list for clarity.\n- Simplified versioning and branding references in the documentation header.\n- No changes to functionality or structure; documentation only.\n- All implementation and usage details remain the same.\n\nv1.1.0 | 2026-05-13T05:37:18.986Z | user\n\nkarpathy-wiki-improve v1.1.0\n\n- Added README.md providing project overview and usage information.\n- Updated activation guidance in SKILL.md with explicit trigger keywords and scenarios.\n- Clarified intended usage and user instructions in description.\n- No changes to core functionality or internal logic.\n\nv1.0.1 | 2026-05-09T09:56:22.610Z | user\n\nNo functional changes in this version; only SKILL.md metadata and documentation have been updated.\n\n- Skill renamed from \"llm-wiki\" to \"karpathy-wiki\"\n- Description revised to English and references the Karpathy LLM Wiki pattern explicitly\n- All documentation rewritten in English for broader accessibility\n- No core logic, operational, or code changes detected\n\nv1.0.0 | 2026-05-09T09:45:27.948Z | user\n\nVersion 3.0 is a major refactor and expansion, replacing the previous Karpathy-wiki skill with LLM Wiki:\n\n- Complete rewrite: Skill is now LLM Wiki v3.0, implementing a structured, multilingual (Chinese), entity/concept/category wiki system.\n- Reorganized and expanded all documentation; removed all previous reference guides.\n- Introduced stricter page type conventions (entity, concept, comparison, synthesis), with clear naming, linking, and minimum content standards.\n- Enforced traceable sources (urls required in sources for every page) and mutual (bi-directional) linking for all related entries.\n- Added new operational modes: Deep Research, automatic relink, enhanced linting (orphan, broken, one-way links, naming drift, quality gating, contradiction detection).\n- Required new files: purpose.md (wiki \"constitution\"), with detailed per-file and per-operation format examples.\n\nArchive index:\n\nArchive v1.1.2: 4 files, 8651 bytes\n\nFiles: README.md (1385b), skill-card.md (2197b), SKILL.md (15968b), _meta.json (140b)\n\nFile v1.1.2:SKILL.md\n\n---\nname: karpathy-wiki-improve\ndescription: \"Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source traceability. Use when: user says 'organize bookmarks', 'research X', 'run lint', 'relink', or needs a personal knowledge graph.\"\n---\n\n# karpathy-wiki — OpenClaw Implementation\n\nBased on Andrej Karpathy's [LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).\n\n---\n\n## Trigger Keywords (Activation)\n\nActivate this skill when the user says anything like:\n- \"organize bookmarks\" / \"digest this link\"\n- \"research X\" / \"help me research\"\n- \"run lint\" / \"lint check\"\n- \"relink\" / \"build connections\"\n- \"wiki\" / \"knowledge graph\"\n- \"Deep Research\"\n\n---\n\n## wiki Root\n\n```\nwiki_root: /path/to/your/wiki  # configure to your local path\n```\n\n```\n<wiki_root>/\n├── raw/\n│   ├── sources/          # raw bookmarks/docs (immutable)\n│   └── assets/           # images and resources\n├── wiki/\n│   ├── entities/        # entity pages (people, products, companies, sites, books)\n│   ├── concepts/        # concept pages (tech, theory, methodology)\n│   ├── comparisons/     # comparison pages\n│   ├── synthesis/       # synthesis/overview pages\n│   ├── index.md         # wiki index (entry point)\n│   ├── log.md           # operation log (append-only)\n│   └── overview.md      # global overview\n├── purpose.md           # wiki goal definition (wiki constitution)\n└── schema.md            # structure conventions\n```\n\n---\n\n## Core Principles\n\n1. **sources/ is read-only** — LLM only writes wiki/, never modifies raw sources\n2. **wikilink cross-references** — `[[page-slug]]` syntax for page connections\n3. **YAML frontmatter** — every page has type/tags/related/sources\n4. **Bidirectional links enforced** — every write to related must sync back-link\n5. **Two-phase Ingest** — Analysis → Generation\n6. **URL-level traceability** — sources contain specific URLs, not just filenames\n7. **Lint-driven** — periodic health checks, graph stays clean\n8. **Deep Research** — knowledge gaps auto-discovered and filled\n\n---\n\n## Page Type Taxonomy (entity vs concept boundary)\n\n| Type | Definition | Examples |\n|------|------------|----------|\n| **entity** | Named, discrete things | people/products/companies/sites/books/tools |\n| **concept** | Abstract ideas/theories/methodologies | indexing principles, microservices, DI |\n| **comparison** | Multi-option comparisons | Vue vs React, MySQL vs PostgreSQL |\n| **synthesis** | Comprehensive overview | tech stack panorama, annual summary |\n\n**Boundary Rules**:\n- If it has a specific name → entity (\"pdai.tech\", \"Effective Java\")\n- If it's abstract/generic → concept (\"MySQL indexing\", \"dependency injection\")\n- Avoid having both entity and concept for the same topic\n\n---\n\n## Naming Convention\n\n```\nentity:\n  blogs/sites: use domain or person name\n    → mysql-zhu-shuangyin\n    → pdai-tech\n    → jon-index-blog\n  books: use simplified book title\n    → effective-java\n\nconcept:\n  use core terms in kebab-case\n    → mysql-innodb\n    → jwt-json-web-token\n    → dependency-injection\n\ncomparison:\n  → mysql-postgresql-comparison\n  → vue-vs-react\n\nsynthesis:\n  → go-web-dev-overview\n  → 2026-learning-roadmap-summary\n```\n\n**Rules**:\n- All lowercase, hyphen-separated\n- No mixed Chinese/English\n- Unique slugs, no duplicates\n\n---\n\n## YAML Frontmatter (Required Fields)\n\n```yaml\n---\ntype: entity | concept | comparison | synthesis\ntitle: Page Title\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-1, page-slug-2]  # forward reference (back-link auto-added)\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n      - https://example.com/article2\n---\n```\n\n**sources.urls is mandatory** — URL-level traceability is a core principle.\n\n---\n\n## Quality Thresholds\n\nEvery concept/comparison page **must have**:\n\n| Requirement | Description |\n|--------------|-------------|\n| One-line definition | frontmatter title or page header `>` |\n| Core principles ≥ 3 | body contains at least 3 substantial points |\n| Related pages ≥ 1 | related field is non-empty |\n| Source URLs | sources.urls is non-empty |\n| Back-links added | every page in related back-links to this page |\n\nEvery entity page **must have**:\n\n| Requirement | Description |\n|--------------|-------------|\n| One-line description | frontmatter title |\n| Key features ≥ 2 | body has substantive descriptions |\n| Related pages ≥ 1 | related field non-empty |\n| Source URLs | sources.urls is non-empty |\n\n---\n\n## Page Templates\n\n### Entity Page\n\n```markdown\n---\ntype: entity\ntitle: Entity Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com\n---\n\n# Entity Name\n\n> One-line description (used in index.md summary).\n\n## Overview\nMain content and background.\n\n## Key Features\n- Feature 1\n- Feature 2\n\n## Related\n- [[page-slug]] — reason (back-link auto-added)\n\n## Sources\n- [Article Title](https://example.com) — source description\n```\n\n### Concept Page\n\n```markdown\n---\ntype: concept\ntitle: Concept Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n---\n\n# Concept Name\n\n> One-line definition.\n\n## Core Principles\n- Principle 1\n- Principle 2\n- Principle 3\n\n## Use Cases\n- Use case 1\n\n## Related\n- [[page-slug]] — reason\n\n## Counter-arguments / Data Gaps\n- Known limitations\n- Uncovered aspects\n\n## Sources\n- [Article Title](https://example.com) — source description\n```\n\n### Comparison Page\n\n```markdown\n---\ntype: comparison\ntitle: A vs B\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-a, page-slug-b]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/comparison\n---\n\n# A vs B\n\n> One-line summary: A is better for X, B is better for Y.\n\n## Overview\nWhy these two are compared and when this comparison matters.\n\n## Comparison Dimensions\n\n| Dimension | A | B |\n|-----------|---|---|\n| Dimension 1 | detail | detail |\n| Dimension 2 | detail | detail |\n\n## When to Choose A\n- Scenario 1\n- Scenario 2\n\n## When to Choose B\n- Scenario 1\n- Scenario 2\n\n## Related\n- [[page-slug-a]] — A's entity\n- [[page-slug-b]] — B's entity\n\n## Sources\n- [Source Title](https://example.com) — source description\n```\n\n### Synthesis Page\n\n```markdown\n---\ntype: synthesis\ntitle: Topic Overview\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/overview\n---\n\n# Topic Overview\n\n> One-line summary of this knowledge domain.\n\n## Scope\nWhat this synthesis covers.\n\n## Key Concepts\n- [[concept-1]] — brief description\n- [[concept-2]] — brief description\n\n## Key Entities\n- [[entity-1]] — brief description\n\n## Landscape\n- Trend or pattern 1\n- Trend or pattern 2\n\n## Knowledge Gaps\n- What needs deeper research\n\n## Related\n- [[page-slug-1]] — reason\n\n## Sources\n- [Source Title](https://example.com) — source description\n```\n\n---\n\n## Operations\n\n### Ingest (Collection & Digestion)\n\n**Phase 1 — Analysis**\n\n```\n## Key Entities\nIdentified entities\n\n## Key Concepts\nIdentified core concepts\n\n## Main Arguments & Findings\nKey arguments and findings\n\n## Connections to Existing Wiki\nRelations to existing wiki pages\n\n## Contradictions & Tensions\nConflicts with existing knowledge\n\n## Coverage Gaps\nWhat was mentioned but not covered deeply?\nWhat related topics are missing?\n\n## Recommendations\nNew/update which pages\n```\n\n**Phase 2 — Generation**\n\n1. Create/update target pages (with urls in sources)\n2. **Sync related + back-link** (bidirectional link enforcement)\n3. Verify pages meet quality thresholds\n4. Update index.md\n5. Append to log.md\n\n**Output format** — always write exactly this structure, no deviations:\n\n```\n## Ingest Plan\n\n### Pages to create/update\n| Action | File | Summary |\n|---------|------|---------|\n| CREATE | wiki/concepts/page-slug.md | 1-line description |\n| UPDATE | wiki/entities/backlink-target.md | add related: page-slug |\n\n### Back-link sync\n- [[A]] → add B to related → check B has A, add if missing\n\n### index.md update\n- Add: `- [[page-slug]] — 1-line description (concept/entity)`\n\n### log.md entry\n- `[YYYY-MM-DD] Ingest: N pages, sources: bookmarks_xxx.md`\n```\n\n**Phase 2 execution**: follow the plan exactly. Write files using the templates in Page Templates section.\n\n---\n\n### Query\n\n**Always follow this priority when answering:**\n\n1. **Read index.md** → find candidate pages by tag/topic match\n2. **Read candidate pages** → extract claims + sources.urls\n3. **web_fetch top sources** → verify critical claims (flag ⚠️ if can't reach)\n4. **Synthesize** → answer with confidence annotation (✅/⚠️/❌)\n5. **Cite sources** → always include the specific URL that confirmed each claim\n\n**When wiki has no relevant page**: fall back to web_search, then optionally ingest the result to wiki.\n\n---\n\n### Relink (Automatic Relationship Discovery)\n\n**Trigger**: batch ingest complete / periodic heartbeat\n\n**Process**:\n\n```\n1. Scan all wiki/*.md tags and body text\n2. Extract core topics from each page\n3. Find page pairs sharing tags/topics\n4. Analyze relationship strength pairwise\n5. Generate recommended link list (candidate)\n6. User confirms before writing (back-link sync)\n```\n\n**Execution steps**:\n\n```bash\n# 1. Collect all related pairs (shared tags)\ngrep -r \"^tags:\" wiki/concepts/ wiki/entities/ | analyze\n\n# 2. List orphan pages\nfor f in wiki/**/*.md; do\n  related=$(grep \"^related:\" \"$f\")\n  inbound=$(grep -r \"^\\* \\[\\[$(basename $f .md)\\]\\]\" wiki/)\n  [ -z \"$related\" ] && [ -z \"$inbound\" ] && echo \"$f is orphan\"\ndone\n\n# 3. LLM generates relink suggestion report\n#    Format:\n#    [[page-A]] <--> [[page-B]]  reason: shared tag MySQL B+tree\n#    [[page-C]] --> [[page-D]]   reason: C mentions D but not linked\n```\n\n**Write rules**:\n- Update A's related to add B\n- Update B's related to add A\n- Append to log.md\n\n---\n\n### Lint (Health Check) — Enhanced\n\n**Trigger**: user request / periodic heartbeat\n\n**Scan dimensions** (6):\n\n| # | Dimension | Description |\n|---|-----------|-------------|\n| 1 | **Orphan pages** | No related pages, no inbound links |\n| 2 | **Dangling references** | related references non-existent slugs |\n| 3 | **One-way links** | A→B but B→A missing |\n| 4 | **Contradiction detection** | Same claim described differently across pages |\n| 5 | **Quality threshold** | Page fails minimum quality (no urls/no related/principles<3) |\n| 6 | **Naming drift** | Slug style inconsistent (mixed case/mixed Chinese-English) |\n\n**Lint report format**:\n\n```markdown\n## Lint Report — YYYY-MM-DD\n\n### Orphan Pages (N)\n- [[page]] — no related, no inbound\n\n### One-way Links (N)\n- [[A]] → [[B]] (B not back-linking A)\n\n### Dangling References (N)\n- [[page]] references non-existent [[nonexistent]]\n\n### Quality Failures (N)\n- [[page]] — missing urls source\n- [[page]] — empty related\n\n### Contradictions (N)\n- [[page-A]] says: X is Y\n- [[page-B]] says: X is Z\n\n### Naming Issues (N)\n- [[page]] — slug has uppercase/mixed Chinese-English\n\n### Recommended Actions\n1. [Priority 1]\n2. [Priority 2]\n```\n\n---\n\n### Deep Research\n\n**Trigger**: lint finds Coverage Gaps / user says \"research X\"\n\n**Process**:\n\n```\n1. Discover knowledge gap\n   lint report \"missing coverage\" items\n   user says \"research XXX\"\n\n2. Generate 3-5 search queries\n   Format: each query should be specific enough to return distinct results\n   Example gap \"MySQL MVCC\":\n     → \"MySQL MVCC multi-version concurrency control principles\"\n     → \"MySQL MVCC undo log implementation\"\n     → \"MySQL MVCC ReadView isolation levels\"\n\n3. Multi-source search\n   Execute web_search for each query (max 5 queries)\n   Collect top 3 results per query\n\n4. Ingest results\n   Write raw search results to raw/sources/deep-research-YYYYMMDD.md\n   Execute full ingest pipeline\n\n5. relink + lint\n   Complete bidirectional links\n   Run lint to verify health\n```\n\n**Deep Research output**:\n```markdown\n## Research Report: [Topic]\n\n### Gap Identified\n[What was missing]\n\n### Search Queries Used\n1. query text → N results\n2. query text → N results\n\n### Key Findings\n- Finding 1 [source](url)\n- Finding 2 [source](url)\n\n### New Pages Created\n- [[new-page-1]] — 1-line description\n- [[new-page-2]] — 1-line description\n\n### Recommendations\n- [next research direction]\n```\n\n---\n\n## purpose.md (Wiki Constitution)\n\nEvery wiki should have `purpose.md` defining:\n\n```markdown\n# purpose.md\n\n## Goal\nWho is this wiki for? What problem does it solve?\n\n## Core Questions\nWhat core questions must this wiki answer?\n\n## Scope\nWhat domains are covered?\nWhat is explicitly excluded?\n\n## Evolution Direction\nNear-term (3 months): fill gaps in which domains?\nMid-term (6 months): what state to achieve?\nLong-term (1 year): what is the ideal wiki form?\n\n## Quality Standards\nWhat is the minimum quality threshold?\n```\n\n---\n\n## Source Traceability Chain\n\n```\nUser bookmarks (Chrome export)\n  ↓\nraw/sources/bookmarks_xxx.md  (immutable)\n  ↓  Ingest writes\nwiki/xxx.md\n  sources:\n    - file: bookmarks_xxx.md\n      urls:\n        - https://example.com  ← specific URL\n  ↓  Query time\nOpenClaw reads wiki → reads sources.urls → web_fetch original URL → verify\n```\n\n---\n\n## Use Cases\n\n- User asks technical question (check wiki first, then search)\n- User says \"help me digest this link\"\n- User requests \"organize my collected content on XXX\"\n- User requests \"run lint\"\n- User requests \"relink\"\n- User requests \"research X\" (Deep Research)\n- Periodic heartbeat triggers lint + relink + quality check\n\n---\n\n## Confidence Annotations\n\n| Annotation | Meaning |\n|------------|---------|\n| `✅ Verified` | wiki content matches original URL source |\n| `⚠️ Inferred` | wiki content is LLM inference based on source, not direct quote |\n| `❌ Disputed` | wiki content contradicts source, needs verification |\n\n---\n\n## Bidirectional Link Write Rules (Enforced)\n\n**Every time you modify the related field**:\n\n```\nWhen writing A's related to add B:\n  1. Add B to A's related: [...]\n  2. Check if B's related already has A\n  3. If not, add A as back-link\n  4. If yes, skip\n```\n\n**Prohibited**:\n- ❌ Write A→B only, skip B→A\n- ❌ Leave related empty with no links added\n- ❌ sources has only file, no urls\n\n---\n\n## Common Mistakes\n\n| Mistake | Why it's wrong | Correct approach |\n|---------|----------------|------------------|\n| Create entity + concept for same topic | Double maintenance, confuses graph | Pick one: named → entity, abstract → concept |\n| Skip back-link when adding related | One-way links break graph traversal | Always sync back-link when modifying related |\n| Use Chinese in slugs | Breaks tooling, inconsistent | Use pinyin or English, not `mysql-suo-yin` |\n| Put only filename in sources | Loses URL-level traceability | Always include `urls: [https://...]` |\n| Leave concept page with < 3 core principles | Fails quality threshold | Force extraction of ≥ 3 substantive points |\n| Write ingest output as prose description | Hard to execute, format inconsistent | Always use structured Ingest Plan format (table + steps) |\n\n## File Setup Reminder\n\nOn first wiki setup, you must create:\n- `purpose.md` — wiki constitution (goal, scope, quality standards)\n- `schema.md` — structure conventions (naming rules, page templates)\n- `wiki/index.md` — entry point with domain overview\n- `wiki/log.md` — operation log (append-only)\n\nWithout these, lint and relink cannot run properly.\n\n---\n\n## Author\n\n[zhangmengyang/karpathy-wiki-improve](https://github.com/zhangmengyang/karpathy-wiki-improve)\n\nFile v1.1.2:README.md\n\n# karpathy-wiki-improve\n\nOpenClaw skill implementing Andrej Karpathy's LLM Wiki pattern — a persistent markdown knowledge wiki with full ingest/query/relink/lint/DeepResearch pipeline.\n\n## What It Does\n\n- **Ingest**: Turn raw bookmarks/links into structured wiki pages with bidirectional links\n- **Query**: Answer questions by reading wiki first, then web search to supplement\n- **Relink**: Auto-discover and establish page relationships\n- **Lint**: Health-check the knowledge graph (orphans, dangling refs, one-way links)\n- **Deep Research**: Fill knowledge gaps with targeted search + ingest\n\n## Quick Start\n\n```bash\nnpx clawhub install zhangmengyang/karpathy-wiki-improve\n```\n\nThen in OpenClaw:\n\n```\norganize my bookmarks on Go\nresearch MySQL indexing\nrun lint on my wiki\nrelink\n```\n\n## Wiki Structure\n\n```\nwiki/\n├── raw/sources/      # immutable original sources\n├── wiki/\n│   ├── entities/     # people, products, companies, sites\n│   ├── concepts/     # tech, theory, methodology\n│   ├── comparisons/   # A vs B analysis\n│   └── synthesis/    # topic overviews\n├── purpose.md        # wiki constitution\n├── schema.md         # structure conventions\n└── wiki/index.md     # entry point\n```\n\n## Source\n\nBased on [Andrej Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).\n\nFile v1.1.2:_meta.json\n\n{\n  \"ownerId\": \"kn7cb0ef0ty28xjmdaq879gb5n83ncwj\",\n  \"slug\": \"karpathy-wiki-improve\",\n  \"version\": \"1.1.2\",\n  \"publishedAt\": 1781682743902\n}\n\nFile v1.1.2:skill-card.md\n\n## Description:\n\nHelps agents organize bookmarks and research into a persistent Markdown knowledge wiki with ingest, query, relink, lint, Deep Research, and URL-level source traceability.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[zhangmengyang](https://clawhub.ai/user/zhangmengyang)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers, researchers, and knowledge workers use this skill to turn collected links and research topics into a structured personal wiki, then query and maintain it with linting and relinking workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Broad triggers can lead the agent to make persistent local wiki edits beyond the user's intended scope.\n\nMitigation: Use a dedicated, backed-up wiki folder and review proposed file changes before execution.\n\nRisk: Deep Research and query workflows can introduce unverified or misleading source material into the wiki.\n\nMitigation: Approve search queries before execution and require URL-level source traceability with confidence annotations.\n\nRisk: Periodic linting or relinking can change wiki relationships without enough explicit consent.\n\nMitigation: Run maintenance only when explicitly requested or clearly enabled for the configured wiki.\n\n## Reference(s):\n\n- [Andrej Karpathy LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)\n- [Karpathy Wiki Improve ClawHub listing](https://clawhub.ai/zhangmengyang/skills/karpathy-wiki-improve)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown with wiki plans, source links, and inline shell commands]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May propose or create persistent local wiki files within the configured wiki folder.]\n\n## Skill Version(s):\n\n1.1.2 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.1.1: 4 files, 8623 bytes\n\nFiles: README.md (1385b), skill-card.md (2207b), SKILL.md (15968b), _meta.json (140b)\n\nFile v1.1.1:SKILL.md\n\n---\nname: karpathy-wiki-improve\ndescription: \"Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source traceability. Use when: user says 'organize bookmarks', 'research X', 'run lint', 'relink', or needs a personal knowledge graph.\"\n---\n\n# karpathy-wiki — OpenClaw Implementation\n\nBased on Andrej Karpathy's [LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).\n\n---\n\n## Trigger Keywords (Activation)\n\nActivate this skill when the user says anything like:\n- \"organize bookmarks\" / \"digest this link\"\n- \"research X\" / \"help me research\"\n- \"run lint\" / \"lint check\"\n- \"relink\" / \"build connections\"\n- \"wiki\" / \"knowledge graph\"\n- \"Deep Research\"\n\n---\n\n## wiki Root\n\n```\nwiki_root: /path/to/your/wiki  # configure to your local path\n```\n\n```\n<wiki_root>/\n├── raw/\n│   ├── sources/          # raw bookmarks/docs (immutable)\n│   └── assets/           # images and resources\n├── wiki/\n│   ├── entities/        # entity pages (people, products, companies, sites, books)\n│   ├── concepts/        # concept pages (tech, theory, methodology)\n│   ├── comparisons/     # comparison pages\n│   ├── synthesis/       # synthesis/overview pages\n│   ├── index.md         # wiki index (entry point)\n│   ├── log.md           # operation log (append-only)\n│   └── overview.md      # global overview\n├── purpose.md           # wiki goal definition (wiki constitution)\n└── schema.md            # structure conventions\n```\n\n---\n\n## Core Principles\n\n1. **sources/ is read-only** — LLM only writes wiki/, never modifies raw sources\n2. **wikilink cross-references** — `[[page-slug]]` syntax for page connections\n3. **YAML frontmatter** — every page has type/tags/related/sources\n4. **Bidirectional links enforced** — every write to related must sync back-link\n5. **Two-phase Ingest** — Analysis → Generation\n6. **URL-level traceability** — sources contain specific URLs, not just filenames\n7. **Lint-driven** — periodic health checks, graph stays clean\n8. **Deep Research** — knowledge gaps auto-discovered and filled\n\n---\n\n## Page Type Taxonomy (entity vs concept boundary)\n\n| Type | Definition | Examples |\n|------|------------|----------|\n| **entity** | Named, discrete things | people/products/companies/sites/books/tools |\n| **concept** | Abstract ideas/theories/methodologies | indexing principles, microservices, DI |\n| **comparison** | Multi-option comparisons | Vue vs React, MySQL vs PostgreSQL |\n| **synthesis** | Comprehensive overview | tech stack panorama, annual summary |\n\n**Boundary Rules**:\n- If it has a specific name → entity (\"pdai.tech\", \"Effective Java\")\n- If it's abstract/generic → concept (\"MySQL indexing\", \"dependency injection\")\n- Avoid having both entity and concept for the same topic\n\n---\n\n## Naming Convention\n\n```\nentity:\n  blogs/sites: use domain or person name\n    → mysql-zhu-shuangyin\n    → pdai-tech\n    → jon-index-blog\n  books: use simplified book title\n    → effective-java\n\nconcept:\n  use core terms in kebab-case\n    → mysql-innodb\n    → jwt-json-web-token\n    → dependency-injection\n\ncomparison:\n  → mysql-postgresql-comparison\n  → vue-vs-react\n\nsynthesis:\n  → go-web-dev-overview\n  → 2026-learning-roadmap-summary\n```\n\n**Rules**:\n- All lowercase, hyphen-separated\n- No mixed Chinese/English\n- Unique slugs, no duplicates\n\n---\n\n## YAML Frontmatter (Required Fields)\n\n```yaml\n---\ntype: entity | concept | comparison | synthesis\ntitle: Page Title\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-1, page-slug-2]  # forward reference (back-link auto-added)\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n      - https://example.com/article2\n---\n```\n\n**sources.urls is mandatory** — URL-level traceability is a core principle.\n\n---\n\n## Quality Thresholds\n\nEvery concept/comparison page **must have**:\n\n| Requirement | Description |\n|--------------|-------------|\n| One-line definition | frontmatter title or page header `>` |\n| Core principles ≥ 3 | body contains at least 3 substantial points |\n| Related pages ≥ 1 | related field is non-empty |\n| Source URLs | sources.urls is non-empty |\n| Back-links added | every page in related back-links to this page |\n\nEvery entity page **must have**:\n\n| Requirement | Description |\n|--------------|-------------|\n| One-line description | frontmatter title |\n| Key features ≥ 2 | body has substantive descriptions |\n| Related pages ≥ 1 | related field non-empty |\n| Source URLs | sources.urls is non-empty |\n\n---\n\n## Page Templates\n\n### Entity Page\n\n```markdown\n---\ntype: entity\ntitle: Entity Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com\n---\n\n# Entity Name\n\n> One-line description (used in index.md summary).\n\n## Overview\nMain content and background.\n\n## Key Features\n- Feature 1\n- Feature 2\n\n## Related\n- [[page-slug]] — reason (back-link auto-added)\n\n## Sources\n- [Article Title](https://example.com) — source description\n```\n\n### Concept Page\n\n```markdown\n---\ntype: concept\ntitle: Concept Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n---\n\n# Concept Name\n\n> One-line definition.\n\n## Core Principles\n- Principle 1\n- Principle 2\n- Principle 3\n\n## Use Cases\n- Use case 1\n\n## Related\n- [[page-slug]] — reason\n\n## Counter-arguments / Data Gaps\n- Known limitations\n- Uncovered aspects\n\n## Sources\n- [Article Title](https://example.com) — source description\n```\n\n### Comparison Page\n\n```markdown\n---\ntype: comparison\ntitle: A vs B\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-a, page-slug-b]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/comparison\n---\n\n# A vs B\n\n> One-line summary: A is better for X, B is better for Y.\n\n## Overview\nWhy these two are compared and when this comparison matters.\n\n## Comparison Dimensions\n\n| Dimension | A | B |\n|-----------|---|---|\n| Dimension 1 | detail | detail |\n| Dimension 2 | detail | detail |\n\n## When to Choose A\n- Scenario 1\n- Scenario 2\n\n## When to Choose B\n- Scenario 1\n- Scenario 2\n\n## Related\n- [[page-slug-a]] — A's entity\n- [[page-slug-b]] — B's entity\n\n## Sources\n- [Source Title](https://example.com) — source description\n```\n\n### Synthesis Page\n\n```markdown\n---\ntype: synthesis\ntitle: Topic Overview\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/overview\n---\n\n# Topic Overview\n\n> One-line summary of this knowledge domain.\n\n## Scope\nWhat this synthesis covers.\n\n## Key Concepts\n- [[concept-1]] — brief description\n- [[concept-2]] — brief description\n\n## Key Entities\n- [[entity-1]] — brief description\n\n## Landscape\n- Trend or pattern 1\n- Trend or pattern 2\n\n## Knowledge Gaps\n- What needs deeper research\n\n## Related\n- [[page-slug-1]] — reason\n\n## Sources\n- [Source Title](https://example.com) — source description\n```\n\n---\n\n## Operations\n\n### Ingest (Collection & Digestion)\n\n**Phase 1 — Analysis**\n\n```\n## Key Entities\nIdentified entities\n\n## Key Concepts\nIdentified core concepts\n\n## Main Arguments & Findings\nKey arguments and findings\n\n## Connections to Existing Wiki\nRelations to existing wiki pages\n\n## Contradictions & Tensions\nConflicts with existing knowledge\n\n## Coverage Gaps\nWhat was mentioned but not covered deeply?\nWhat related topics are missing?\n\n## Recommendations\nNew/update which pages\n```\n\n**Phase 2 — Generation**\n\n1. Create/update target pages (with urls in sources)\n2. **Sync related + back-link** (bidirectional link enforcement)\n3. Verify pages meet quality thresholds\n4. Update index.md\n5. Append to log.md\n\n**Output format** — always write exactly this structure, no deviations:\n\n```\n## Ingest Plan\n\n### Pages to create/update\n| Action | File | Summary |\n|---------|------|---------|\n| CREATE | wiki/concepts/page-slug.md | 1-line description |\n| UPDATE | wiki/entities/backlink-target.md | add related: page-slug |\n\n### Back-link sync\n- [[A]] → add B to related → check B has A, add if missing\n\n### index.md update\n- Add: `- [[page-slug]] — 1-line description (concept/entity)`\n\n### log.md entry\n- `[YYYY-MM-DD] Ingest: N pages, sources: bookmarks_xxx.md`\n```\n\n**Phase 2 execution**: follow the plan exactly. Write files using the templates in Page Templates section.\n\n---\n\n### Query\n\n**Always follow this priority when answering:**\n\n1. **Read index.md** → find candidate pages by tag/topic match\n2. **Read candidate pages** → extract claims + sources.urls\n3. **web_fetch top sources** → verify critical claims (flag ⚠️ if can't reach)\n4. **Synthesize** → answer with confidence annotation (✅/⚠️/❌)\n5. **Cite sources** → always include the specific URL that confirmed each claim\n\n**When wiki has no relevant page**: fall back to web_search, then optionally ingest the result to wiki.\n\n---\n\n### Relink (Automatic Relationship Discovery)\n\n**Trigger**: batch ingest complete / periodic heartbeat\n\n**Process**:\n\n```\n1. Scan all wiki/*.md tags and body text\n2. Extract core topics from each page\n3. Find page pairs sharing tags/topics\n4. Analyze relationship strength pairwise\n5. Generate recommended link list (candidate)\n6. User confirms before writing (back-link sync)\n```\n\n**Execution steps**:\n\n```bash\n# 1. Collect all related pairs (shared tags)\ngrep -r \"^tags:\" wiki/concepts/ wiki/entities/ | analyze\n\n# 2. List orphan pages\nfor f in wiki/**/*.md; do\n  related=$(grep \"^related:\" \"$f\")\n  inbound=$(grep -r \"^\\* \\[\\[$(basename $f .md)\\]\\]\" wiki/)\n  [ -z \"$related\" ] && [ -z \"$inbound\" ] && echo \"$f is orphan\"\ndone\n\n# 3. LLM generates relink suggestion report\n#    Format:\n#    [[page-A]] <--> [[page-B]]  reason: shared tag MySQL B+tree\n#    [[page-C]] --> [[page-D]]   reason: C mentions D but not linked\n```\n\n**Write rules**:\n- Update A's related to add B\n- Update B's related to add A\n- Append to log.md\n\n---\n\n### Lint (Health Check) — Enhanced\n\n**Trigger**: user request / periodic heartbeat\n\n**Scan dimensions** (6):\n\n| # | Dimension | Description |\n|---|-----------|-------------|\n| 1 | **Orphan pages** | No related pages, no inbound links |\n| 2 | **Dangling references** | related references non-existent slugs |\n| 3 | **One-way links** | A→B but B→A missing |\n| 4 | **Contradiction detection** | Same claim described differently across pages |\n| 5 | **Quality threshold** | Page fails minimum quality (no urls/no related/principles<3) |\n| 6 | **Naming drift** | Slug style inconsistent (mixed case/mixed Chinese-English) |\n\n**Lint report format**:\n\n```markdown\n## Lint Report — YYYY-MM-DD\n\n### Orphan Pages (N)\n- [[page]] — no related, no inbound\n\n### One-way Links (N)\n- [[A]] → [[B]] (B not back-linking A)\n\n### Dangling References (N)\n- [[page]] references non-existent [[nonexistent]]\n\n### Quality Failures (N)\n- [[page]] — missing urls source\n- [[page]] — empty related\n\n### Contradictions (N)\n- [[page-A]] says: X is Y\n- [[page-B]] says: X is Z\n\n### Naming Issues (N)\n- [[page]] — slug has uppercase/mixed Chinese-English\n\n### Recommended Actions\n1. [Priority 1]\n2. [Priority 2]\n```\n\n---\n\n### Deep Research\n\n**Trigger**: lint finds Coverage Gaps / user says \"research X\"\n\n**Process**:\n\n```\n1. Discover knowledge gap\n   lint report \"missing coverage\" items\n   user says \"research XXX\"\n\n2. Generate 3-5 search queries\n   Format: each query should be specific enough to return distinct results\n   Example gap \"MySQL MVCC\":\n     → \"MySQL MVCC multi-version concurrency control principles\"\n     → \"MySQL MVCC undo log implementation\"\n     → \"MySQL MVCC ReadView isolation levels\"\n\n3. Multi-source search\n   Execute web_search for each query (max 5 queries)\n   Collect top 3 results per query\n\n4. Ingest results\n   Write raw search results to raw/sources/deep-research-YYYYMMDD.md\n   Execute full ingest pipeline\n\n5. relink + lint\n   Complete bidirectional links\n   Run lint to verify health\n```\n\n**Deep Research output**:\n```markdown\n## Research Report: [Topic]\n\n### Gap Identified\n[What was missing]\n\n### Search Queries Used\n1. query text → N results\n2. query text → N results\n\n### Key Findings\n- Finding 1 [source](url)\n- Finding 2 [source](url)\n\n### New Pages Created\n- [[new-page-1]] — 1-line description\n- [[new-page-2]] — 1-line description\n\n### Recommendations\n- [next research direction]\n```\n\n---\n\n## purpose.md (Wiki Constitution)\n\nEvery wiki should have `purpose.md` defining:\n\n```markdown\n# purpose.md\n\n## Goal\nWho is this wiki for? What problem does it solve?\n\n## Core Questions\nWhat core questions must this wiki answer?\n\n## Scope\nWhat domains are covered?\nWhat is explicitly excluded?\n\n## Evolution Direction\nNear-term (3 months): fill gaps in which domains?\nMid-term (6 months): what state to achieve?\nLong-term (1 year): what is the ideal wiki form?\n\n## Quality Standards\nWhat is the minimum quality threshold?\n```\n\n---\n\n## Source Traceability Chain\n\n```\nUser bookmarks (Chrome export)\n  ↓\nraw/sources/bookmarks_xxx.md  (immutable)\n  ↓  Ingest writes\nwiki/xxx.md\n  sources:\n    - file: bookmarks_xxx.md\n      urls:\n        - https://example.com  ← specific URL\n  ↓  Query time\nOpenClaw reads wiki → reads sources.urls → web_fetch original URL → verify\n```\n\n---\n\n## Use Cases\n\n- User asks technical question (check wiki first, then search)\n- User says \"help me digest this link\"\n- User requests \"organize my collected content on XXX\"\n- User requests \"run lint\"\n- User requests \"relink\"\n- User requests \"research X\" (Deep Research)\n- Periodic heartbeat triggers lint + relink + quality check\n\n---\n\n## Confidence Annotations\n\n| Annotation | Meaning |\n|------------|---------|\n| `✅ Verified` | wiki content matches original URL source |\n| `⚠️ Inferred` | wiki content is LLM inference based on source, not direct quote |\n| `❌ Disputed` | wiki content contradicts source, needs verification |\n\n---\n\n## Bidirectional Link Write Rules (Enforced)\n\n**Every time you modify the related field**:\n\n```\nWhen writing A's related to add B:\n  1. Add B to A's related: [...]\n  2. Check if B's related already has A\n  3. If not, add A as back-link\n  4. If yes, skip\n```\n\n**Prohibited**:\n- ❌ Write A→B only, skip B→A\n- ❌ Leave related empty with no links added\n- ❌ sources has only file, no urls\n\n---\n\n## Common Mistakes\n\n| Mistake | Why it's wrong | Correct approach |\n|---------|----------------|------------------|\n| Create entity + concept for same topic | Double maintenance, confuses graph | Pick one: named → entity, abstract → concept |\n| Skip back-link when adding related | One-way links break graph traversal | Always sync back-link when modifying related |\n| Use Chinese in slugs | Breaks tooling, inconsistent | Use pinyin or English, not `mysql-suo-yin` |\n| Put only filename in sources | Loses URL-level traceability | Always include `urls: [https://...]` |\n| Leave concept page with < 3 core principles | Fails quality threshold | Force extraction of ≥ 3 substantive points |\n| Write ingest output as prose description | Hard to execute, format inconsistent | Always use structured Ingest Plan format (table + steps) |\n\n## File Setup Reminder\n\nOn first wiki setup, you must create:\n- `purpose.md` — wiki constitution (goal, scope, quality standards)\n- `schema.md` — structure conventions (naming rules, page templates)\n- `wiki/index.md` — entry point with domain overview\n- `wiki/log.md` — operation log (append-only)\n\nWithout these, lint and relink cannot run properly.\n\n---\n\n## Author\n\n[zhangmengyang/karpathy-wiki-improve](https://github.com/zhangmengyang/karpathy-wiki-improve)\n\nFile v1.1.1:README.md\n\n# karpathy-wiki-improve\n\nOpenClaw skill implementing Andrej Karpathy's LLM Wiki pattern — a persistent markdown knowledge wiki with full ingest/query/relink/lint/DeepResearch pipeline.\n\n## What It Does\n\n- **Ingest**: Turn raw bookmarks/links into structured wiki pages with bidirectional links\n- **Query**: Answer questions by reading wiki first, then web search to supplement\n- **Relink**: Auto-discover and establish page relationships\n- **Lint**: Health-check the knowledge graph (orphans, dangling refs, one-way links)\n- **Deep Research**: Fill knowledge gaps with targeted search + ingest\n\n## Quick Start\n\n```bash\nnpx clawhub install zhangmengyang/karpathy-wiki-improve\n```\n\nThen in OpenClaw:\n\n```\norganize my bookmarks on Go\nresearch MySQL indexing\nrun lint on my wiki\nrelink\n```\n\n## Wiki Structure\n\n```\nwiki/\n├── raw/sources/      # immutable original sources\n├── wiki/\n│   ├── entities/     # people, products, companies, sites\n│   ├── concepts/     # tech, theory, methodology\n│   ├── comparisons/   # A vs B analysis\n│   └── synthesis/    # topic overviews\n├── purpose.md        # wiki constitution\n├── schema.md         # structure conventions\n└── wiki/index.md     # entry point\n```\n\n## Source\n\nBased on [Andrej Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).\n\nFile v1.1.1:_meta.json\n\n{\n  \"ownerId\": \"kn7cb0ef0ty28xjmdaq879gb5n83ncwj\",\n  \"slug\": \"karpathy-wiki-improve\",\n  \"version\": \"1.1.1\",\n  \"publishedAt\": 1778651136105\n}\n\nFile v1.1.1:skill-card.md\n\n## Description: <br>\nKarpathy LLM Wiki pattern implementation for ingesting, querying, relinking, linting, and researching a persistent markdown knowledge wiki with URL-level source traceability. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[zhangmengyang](https://clawhub.ai/user/zhangmengyang) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and knowledge workers use this skill to maintain a local markdown knowledge wiki: ingest collected links, query notes, relink related pages, lint graph health, and run targeted research workflows. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can create or update persistent local wiki files. <br>\nMitigation: Configure a dedicated wiki_root and review proposed file changes before allowing writes. <br>\nRisk: Research workflows can use external web search or fetch against bookmark and source URLs. <br>\nMitigation: Avoid using sensitive bookmarks or private URLs with web_search or web_fetch. <br>\nRisk: Automated relink, lint, or maintenance workflows may add incorrect relationships or misleading wiki content. <br>\nMitigation: Keep periodic maintenance read-only unless explicit approval is given, and review generated changes before deployment. <br>\n\n\n## Reference(s): <br>\n- [Andrej Karpathy LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Markdown, Files, Shell commands, Configuration, Guidance] <br>\n**Output Format:** [Markdown with YAML frontmatter, tables, wikilinks, and inline shell commands] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May propose or write local wiki files under a configured wiki_root when file editing is approved.] <br>\n\n## Skill Version(s): <br>\n1.1.1 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.1.0: 3 files, 7556 bytes\n\nFiles: README.md (1385b), SKILL.md (15959b), _meta.json (140b)\n\nFile v1.1.0:SKILL.md\n\n---\nname: karpathy-wiki-improve\ndescription: \"Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source traceability. Use when: user says 'organize bookmarks', 'research X', 'run lint', 'relink', or needs a personal knowledge graph.\"\n---\n\n# karpathy-wiki — OpenClaw Implementation v3.0\n\nBased on Andrej Karpathy's [LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).\n\n---\n\n## Trigger Keywords (Activation)\n\nActivate this skill when the user says anything like:\n- \"organize bookmarks\" / \"digest this link\" / \"整理书签\"\n- \"research X\" / \"help me research\" / \"帮我研究\"\n- \"run lint\" / \"lint check\" / \"知识库检查\"\n- \"relink\" / \"build connections\" / \"建立关联\"\n- \"wiki\" / \"knowledge graph\" / \"第二大脑\"\n- \"Deep Research\" / \"补全知识\"\n\n---\n\n## wiki Root\n\n```\nwiki_root: /path/to/your/wiki  # configure to your local path\n```\n\n```\n<wiki_root>/\n├── raw/\n│   ├── sources/          # raw bookmarks/docs (immutable)\n│   └── assets/           # images and resources\n├── wiki/\n│   ├── entities/        # entity pages (people, products, companies, sites, books)\n│   ├── concepts/        # concept pages (tech, theory, methodology)\n│   ├── comparisons/     # comparison pages\n│   ├── synthesis/       # synthesis/overview pages\n│   ├── index.md         # wiki index (entry point)\n│   ├── log.md           # operation log (append-only)\n│   └── overview.md      # global overview\n├── purpose.md           # wiki goal definition (wiki constitution)\n└── schema.md            # structure conventions\n```\n\n---\n\n## Core Principles (v3.0)\n\n1. **sources/ is read-only** — LLM only writes wiki/, never modifies raw sources\n2. **wikilink cross-references** — `[[page-slug]]` syntax for page connections\n3. **YAML frontmatter** — every page has type/tags/related/sources\n4. **Bidirectional links enforced** — every write to related must sync back-link\n5. **Two-phase Ingest** — Analysis → Generation\n6. **URL-level traceability** — sources contain specific URLs, not just filenames\n7. **Lint-driven** — periodic health checks, graph stays clean\n8. **Deep Research** — knowledge gaps auto-discovered and filled\n\n---\n\n## Page Type Taxonomy (entity vs concept boundary)\n\n| Type | Definition | Examples |\n|------|------------|----------|\n| **entity** | Named, discrete things | people/products/companies/sites/books/tools |\n| **concept** | Abstract ideas/theories/methodologies | indexing principles, microservices, DI |\n| **comparison** | Multi-option comparisons | Vue vs React, MySQL vs PostgreSQL |\n| **synthesis** | Comprehensive overview | tech stack panorama, annual summary |\n\n**Boundary Rules**:\n- If it has a specific name → entity (\"pdai.tech\", \"Effective Java\")\n- If it's abstract/generic → concept (\"MySQL indexing\", \"dependency injection\")\n- Avoid having both entity and concept for the same topic\n\n---\n\n## Naming Convention\n\n```\nentity:\n  blogs/sites: use domain or person name\n    → mysql-zhu-shuangyin\n    → pdai-tech\n    → jon-index-blog\n  books: use simplified book title\n    → effective-java\n\nconcept:\n  use core terms in kebab-case\n    → mysql-innodb\n    → jwt-json-web-token\n    → dependency-injection\n\ncomparison:\n  → mysql-postgresql-comparison\n  → vue-vs-react\n\nsynthesis:\n  → go-web-dev-overview\n  → 2026-learning-roadmap-summary\n```\n\n**Rules**:\n- All lowercase, hyphen-separated\n- No mixed Chinese/English\n- Unique slugs, no duplicates\n\n---\n\n## YAML Frontmatter (Required Fields)\n\n```yaml\n---\ntype: entity | concept | comparison | synthesis\ntitle: Page Title\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-1, page-slug-2]  # forward reference (back-link auto-added)\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n      - https://example.com/article2\n---\n```\n\n**sources.urls is mandatory** — URL-level traceability is a core principle.\n\n---\n\n## Quality Thresholds\n\nEvery concept/comparison page **must have**:\n\n| Requirement | Description |\n|--------------|-------------|\n| One-line definition | frontmatter title or page header `>` |\n| Core principles ≥ 3 | body contains at least 3 substantial points |\n| Related pages ≥ 1 | related field is non-empty |\n| Source URLs | sources.urls is non-empty |\n| Back-links added | every page in related back-links to this page |\n\nEvery entity page **must have**:\n\n| Requirement | Description |\n|--------------|-------------|\n| One-line description | frontmatter title |\n| Key features ≥ 2 | body has substantive descriptions |\n| Related pages ≥ 1 | related field non-empty |\n| Source URLs | sources.urls is non-empty |\n\n---\n\n## Page Templates\n\n### Entity Page\n\n```markdown\n---\ntype: entity\ntitle: Entity Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com\n---\n\n# Entity Name\n\n> One-line description (used in index.md summary).\n\n## Overview\nMain content and background.\n\n## Key Features\n- Feature 1\n- Feature 2\n\n## Related\n- [[page-slug]] — reason (back-link auto-added)\n\n## Sources\n- [Article Title](https://example.com) — source description\n```\n\n### Concept Page\n\n```markdown\n---\ntype: concept\ntitle: Concept Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n---\n\n# Concept Name\n\n> One-line definition.\n\n## Core Principles\n- Principle 1\n- Principle 2\n- Principle 3\n\n## Use Cases\n- Use case 1\n\n## Related\n- [[page-slug]] — reason\n\n## Counter-arguments / Data Gaps\n- Known limitations\n- Uncovered aspects\n\n## Sources\n- [Article Title](https://example.com) — source description\n```\n\n### Comparison Page\n\n```markdown\n---\ntype: comparison\ntitle: A vs B\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-a, page-slug-b]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/comparison\n---\n\n# A vs B\n\n> One-line summary: A is better for X, B is better for Y.\n\n## Overview\nWhy these two are compared and when this comparison matters.\n\n## Comparison Dimensions\n\n| Dimension | A | B |\n|-----------|---|---|\n| Dimension 1 | detail | detail |\n| Dimension 2 | detail | detail |\n\n## When to Choose A\n- Scenario 1\n- Scenario 2\n\n## When to Choose B\n- Scenario 1\n- Scenario 2\n\n## Related\n- [[page-slug-a]] — A's entity\n- [[page-slug-b]] — B's entity\n\n## Sources\n- [Source Title](https://example.com) — source description\n```\n\n### Synthesis Page\n\n```markdown\n---\ntype: synthesis\ntitle: Topic Overview\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/overview\n---\n\n# Topic Overview\n\n> One-line summary of this knowledge domain.\n\n## Scope\nWhat this synthesis covers.\n\n## Key Concepts\n- [[concept-1]] — brief description\n- [[concept-2]] — brief description\n\n## Key Entities\n- [[entity-1]] — brief description\n\n## Landscape\n- Trend or pattern 1\n- Trend or pattern 2\n\n## Knowledge Gaps\n- What needs deeper research\n\n## Related\n- [[page-slug-1]] — reason\n\n## Sources\n- [Source Title](https://example.com) — source description\n```\n\n---\n\n## Operations\n\n### Ingest (Collection & Digestion)\n\n**Phase 1 — Analysis**\n\n```\n## Key Entities\nIdentified entities\n\n## Key Concepts\nIdentified core concepts\n\n## Main Arguments & Findings\nKey arguments and findings\n\n## Connections to Existing Wiki\nRelations to existing wiki pages\n\n## Contradictions & Tensions\nConflicts with existing knowledge\n\n## Coverage Gaps\nWhat was mentioned but not covered deeply?\nWhat related topics are missing?\n\n## Recommendations\nNew/update which pages\n```\n\n**Phase 2 — Generation**\n\n1. Create/update target pages (with urls in sources)\n2. **Sync related + back-link** (bidirectional link enforcement)\n3. Verify pages meet quality thresholds\n4. Update index.md\n5. Append to log.md\n\n**Output format** — always write exactly this structure, no deviations:\n\n```\n## Ingest Plan\n\n### Pages to create/update\n| Action | File | Summary |\n|---------|------|---------|\n| CREATE | wiki/concepts/page-slug.md | 1-line description |\n| UPDATE | wiki/entities/backlink-target.md | add related: page-slug |\n\n### Back-link sync\n- [[A]] → add B to related → check B has A, add if missing\n\n### index.md update\n- Add: `- [[page-slug]] — 1-line description (concept/entity)`\n\n### log.md entry\n- `[YYYY-MM-DD] Ingest: N pages, sources: bookmarks_xxx.md`\n```\n\n**Phase 2 execution**: follow the plan exactly. Write files using the templates in Page Templates section.\n\n---\n\n### Query\n\n**Always follow this priority when answering:**\n\n1. **Read index.md** → find candidate pages by tag/topic match\n2. **Read candidate pages** → extract claims + sources.urls\n3. **web_fetch top sources** → verify critical claims (flag ⚠️ if can't reach)\n4. **Synthesize** → answer with confidence annotation (✅/⚠️/❌)\n5. **Cite sources** → always include the specific URL that confirmed each claim\n\n**When wiki has no relevant page**: fall back to web_search, then optionally ingest the result to wiki.\n\n---\n\n### Relink (Automatic Relationship Discovery)\n\n**Trigger**: batch ingest complete / periodic heartbeat\n\n**Process**:\n\n```\n1. Scan all wiki/*.md tags and body text\n2. Extract core topics from each page\n3. Find page pairs sharing tags/topics\n4. Analyze relationship strength pairwise\n5. Generate recommended link list (candidate)\n6. User confirms before writing (back-link sync)\n```\n\n**Execution steps**:\n\n```bash\n# 1. Collect all related pairs (shared tags)\ngrep -r \"^tags:\" wiki/concepts/ wiki/entities/ | analyze\n\n# 2. List orphan pages\nfor f in wiki/**/*.md; do\n  related=$(grep \"^related:\" \"$f\")\n  inbound=$(grep -r \"^\\* \\[\\[$(basename $f .md)\\]\\]\" wiki/)\n  [ -z \"$related\" ] && [ -z \"$inbound\" ] && echo \"$f is orphan\"\ndone\n\n# 3. LLM generates relink suggestion report\n#    Format:\n#    [[page-A]] <--> [[page-B]]  reason: shared tag MySQL B+tree\n#    [[page-C]] --> [[page-D]]   reason: C mentions D but not linked\n```\n\n**Write rules**:\n- Update A's related to add B\n- Update B's related to add A\n- Append to log.md\n\n---\n\n### Lint (Health Check) — Enhanced\n\n**Trigger**: user request / periodic heartbeat\n\n**Scan dimensions** (6):\n\n| # | Dimension | Description |\n|---|-----------|-------------|\n| 1 | **Orphan pages** | No related pages, no inbound links |\n| 2 | **Dangling references** | related references non-existent slugs |\n| 3 | **One-way links** | A→B but B→A missing |\n| 4 | **Contradiction detection** | Same claim described differently across pages |\n| 5 | **Quality threshold** | Page fails minimum quality (no urls/no related/principles<3) |\n| 6 | **Naming drift** | Slug style inconsistent (mixed case/mixed Chinese-English) |\n\n**Lint report format**:\n\n```markdown\n## Lint Report — YYYY-MM-DD\n\n### Orphan Pages (N)\n- [[page]] — no related, no inbound\n\n### One-way Links (N)\n- [[A]] → [[B]] (B not back-linking A)\n\n### Dangling References (N)\n- [[page]] references non-existent [[nonexistent]]\n\n### Quality Failures (N)\n- [[page]] — missing urls source\n- [[page]] — empty related\n\n### Contradictions (N)\n- [[page-A]] says: X is Y\n- [[page-B]] says: X is Z\n\n### Naming Issues (N)\n- [[page]] — slug has uppercase/mixed Chinese-English\n\n### Recommended Actions\n1. [Priority 1]\n2. [Priority 2]\n```\n\n---\n\n### Deep Research\n\n**Trigger**: lint finds Coverage Gaps / user says \"research X\"\n\n**Process**:\n\n```\n1. Discover knowledge gap\n   lint report \"missing coverage\" items\n   user says \"research XXX\"\n\n2. Generate 3-5 search queries\n   Format: each query should be specific enough to return distinct results\n   Example gap \"MySQL MVCC\":\n     → \"MySQL MVCC multi-version concurrency control原理\"\n     → \"MySQL MVCC undo log实现机制\"\n     → \"MySQL MVCC ReadView隔离级别\"\n\n3. Multi-source search\n   Execute web_search for each query (max 5 queries)\n   Collect top 3 results per query\n\n4. Ingest results\n   Write raw search results to raw/sources/deep-research-YYYYMMDD.md\n   Execute full ingest pipeline\n\n5. relink + lint\n   Complete bidirectional links\n   Run lint to verify health\n```\n\n**Deep Research output**:\n```markdown\n## Research Report: [Topic]\n\n### Gap Identified\n[What was missing]\n\n### Search Queries Used\n1. query text → N results\n2. query text → N results\n\n### Key Findings\n- Finding 1 [source](url)\n- Finding 2 [source](url)\n\n### New Pages Created\n- [[new-page-1]] — 1-line description\n- [[new-page-2]] — 1-line description\n\n### Recommendations\n- [next research direction]\n```\n\n---\n\n## purpose.md (Wiki Constitution)\n\nEvery wiki should have `purpose.md` defining:\n\n```markdown\n# purpose.md\n\n## Goal\nWho is this wiki for? What problem does it solve?\n\n## Core Questions\nWhat core questions must this wiki answer?\n\n## Scope\nWhat domains are covered?\nWhat is explicitly excluded?\n\n## Evolution Direction\nNear-term (3 months): fill gaps in which domains?\nMid-term (6 months): what state to achieve?\nLong-term (1 year): what is the ideal wiki form?\n\n## Quality Standards\nWhat is the minimum quality threshold?\n```\n\n---\n\n## Source Traceability Chain\n\n```\nUser bookmarks (Chrome export)\n  ↓\nraw/sources/bookmarks_xxx.md  (immutable)\n  ↓  Ingest writes\nwiki/xxx.md\n  sources:\n    - file: bookmarks_xxx.md\n      urls:\n        - https://example.com  ← specific URL\n  ↓  Query time\nOpenClaw reads wiki → reads sources.urls → web_fetch original URL → verify\n```\n\n---\n\n## Use Cases\n\n- User asks technical question (check wiki first, then search)\n- User says \"help me digest this link\"\n- User requests \"organize my collected content on XXX\"\n- User requests \"run lint\"\n- User requests \"relink\"\n- User requests \"research X\" (Deep Research)\n- Periodic heartbeat triggers lint + relink + quality check\n\n---\n\n## Confidence Annotations\n\n| Annotation | Meaning |\n|------------|---------|\n| `✅ Verified` | wiki content matches original URL source |\n| `⚠️ Inferred` | wiki content is LLM inference based on source, not direct quote |\n| `❌ Disputed` | wiki content contradicts source, needs verification |\n\n---\n\n## Bidirectional Link Write Rules (Enforced)\n\n**Every time you modify the related field**:\n\n```\nWhen writing A's related to add B:\n  1. Add B to A's related: [...]\n  2. Check if B's related already has A\n  3. If not, add A as back-link\n  4. If yes, skip\n```\n\n**Prohibited**:\n- ❌ Write A→B only, skip B→A\n- ❌ Leave related empty with no links added\n- ❌ sources has only file, no urls\n\n---\n\n## Common Mistakes\n\n| Mistake | Why it's wrong | Correct approach |\n|---------|----------------|------------------|\n| Create entity + concept for same topic | Double maintenance, confuses graph | Pick one: named → entity, abstract → concept |\n| Skip back-link when adding related | One-way links break graph traversal | Always sync back-link when modifying related |\n| Use Chinese in slugs | Breaks tooling, inconsistent | Use pinyin or English, not `mysql索引` |\n| Put only filename in sources | Loses URL-level traceability | Always include `urls: [https://...]` |\n| Leave concept page with < 3 core principles | Fails quality threshold | Force extraction of ≥ 3 substantive points |\n| Write ingest output as prose description | Hard to execute, format inconsistent | Always use structured Ingest Plan format (table + steps) |\n\n## File Setup Reminder\n\nOn first wiki setup, you must create:\n- `purpose.md` — wiki constitution (goal, scope, quality standards)\n- `schema.md` — structure conventions (naming rules, page templates)\n- `wiki/index.md` — entry point with domain overview\n- `wiki/log.md` — operation log (append-only)\n\nWithout these, lint and relink cannot run properly.\n\nFile v1.1.0:README.md\n\n# karpathy-wiki-improve\n\nOpenClaw skill implementing Andrej Karpathy's LLM Wiki pattern — a persistent markdown knowledge wiki with full ingest/query/relink/lint/DeepResearch pipeline.\n\n## What It Does\n\n- **Ingest**: Turn raw bookmarks/links into structured wiki pages with bidirectional links\n- **Query**: Answer questions by reading wiki first, then web search to supplement\n- **Relink**: Auto-discover and establish page relationships\n- **Lint**: Health-check the knowledge graph (orphans, dangling refs, one-way links)\n- **Deep Research**: Fill knowledge gaps with targeted search + ingest\n\n## Quick Start\n\n```bash\nnpx clawhub install zhangmengyang/karpathy-wiki-improve\n```\n\nThen in OpenClaw:\n\n```\norganize my bookmarks on Go\nresearch MySQL indexing\nrun lint on my wiki\nrelink\n```\n\n## Wiki Structure\n\n```\nwiki/\n├── raw/sources/      # immutable original sources\n├── wiki/\n│   ├── entities/     # people, products, companies, sites\n│   ├── concepts/     # tech, theory, methodology\n│   ├── comparisons/   # A vs B analysis\n│   └── synthesis/    # topic overviews\n├── purpose.md        # wiki constitution\n├── schema.md         # structure conventions\n└── wiki/index.md     # entry point\n```\n\n## Source\n\nBased on [Andrej Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).\n\nFile v1.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7cb0ef0ty28xjmdaq879gb5n83ncwj\",\n  \"slug\": \"karpathy-wiki-improve\",\n  \"version\": \"1.1.0\",\n  \"publishedAt\": 1778650638986\n}\n\nArchive v1.0.1: 2 files, 5048 bytes\n\nFiles: SKILL.md (11389b), _meta.json (140b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: karpathy-wiki\nversion: \"3.0.0\"\ndescription: \"Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source traceability.\"\n---\n\n# karpathy-wiki — OpenClaw Implementation v3.0\n\nBased on Andrej Karpathy's [LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).\n\n---\n\n## wiki Root\n\n```\nwiki_root: /path/to/your/wiki  # configure to your local path\n```\n\n```\n<wiki_root>/\n├── raw/\n│   ├── sources/          # raw bookmarks/docs (immutable)\n│   └── assets/           # images and resources\n├── wiki/\n│   ├── entities/        # entity pages (people, products, companies, sites, books)\n│   ├── concepts/        # concept pages (tech, theory, methodology)\n│   ├── comparisons/     # comparison pages\n│   ├── synthesis/       # synthesis/overview pages\n│   ├── index.md         # wiki index (entry point)\n│   ├── log.md           # operation log (append-only)\n│   └── overview.md      # global overview\n├── purpose.md           # wiki goal definition (wiki constitution)\n└── schema.md            # structure conventions\n```\n\n---\n\n## Core Principles (v3.0)\n\n1. **sources/ is read-only** — LLM only writes wiki/, never modifies raw sources\n2. **wikilink cross-references** — `[[page-slug]]` syntax for page connections\n3. **YAML frontmatter** — every page has type/tags/related/sources\n4. **Bidirectional links enforced** — every write to related must sync back-link\n5. **Two-phase Ingest** — Analysis → Generation\n6. **URL-level traceability** — sources contain specific URLs, not just filenames\n7. **Lint-driven** — periodic health checks, graph stays clean\n8. **Deep Research** — knowledge gaps auto-discovered and filled\n\n---\n\n## Page Type Taxonomy (entity vs concept boundary)\n\n| Type | Definition | Examples |\n|------|------------|----------|\n| **entity** | Named, discrete things | people/products/companies/sites/books/tools |\n| **concept** | Abstract ideas/theories/methodologies | indexing principles, microservices, DI |\n| **comparison** | Multi-option comparisons | Vue vs React, MySQL vs PostgreSQL |\n| **synthesis** | Comprehensive overview | tech stack panorama, annual summary |\n\n**Boundary Rules**:\n- If it has a specific name → entity (\"pdai.tech\", \"Effective Java\")\n- If it's abstract/generic → concept (\"MySQL indexing\", \"dependency injection\")\n- Avoid having both entity and concept for the same topic\n\n---\n\n## Naming Convention\n\n```\nentity:\n  blogs/sites: use domain or person name\n    → mysql-zhu-shuangyin\n    → pdai-tech\n    → jon-index-blog\n  books: use simplified book title\n    → effective-java\n\nconcept:\n  use core terms in kebab-case\n    → mysql-innodb\n    → jwt-json-web-token\n    → dependency-injection\n\ncomparison:\n  → mysql-postgresql-comparison\n  → vue-vs-react\n\nsynthesis:\n  → go-web-dev-overview\n  → 2026-learning-roadmap-summary\n```\n\n**Rules**:\n- All lowercase, hyphen-separated\n- No mixed Chinese/English\n- Unique slugs, no duplicates\n\n---\n\n## YAML Frontmatter (Required Fields)\n\n```yaml\n---\ntype: entity | concept | comparison | synthesis\ntitle: Page Title\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-1, page-slug-2]  # forward reference (back-link auto-added)\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n      - https://example.com/article2\n---\n```\n\n**sources.urls is mandatory** — URL-level traceability is a core principle.\n\n---\n\n## Quality Thresholds\n\nEvery concept/comparison page **must have**:\n\n| Requirement | Description |\n|--------------|-------------|\n| One-line definition | frontmatter title or page header `>` |\n| Core principles ≥ 3 | body contains at least 3 substantial points |\n| Related pages ≥ 1 | related field is non-empty |\n| Source URLs | sources.urls is non-empty |\n| Back-links added | every page in related back-links to this page |\n\nEvery entity page **must have**:\n\n| Requirement | Description |\n|--------------|-------------|\n| One-line description | frontmatter title |\n| Key features ≥ 2 | body has substantive descriptions |\n| Related pages ≥ 1 | related field non-empty |\n| Source URLs | sources.urls is non-empty |\n\n---\n\n## Page Templates\n\n### Entity Page\n\n```markdown\n---\ntype: entity\ntitle: Entity Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com\n---\n\n# Entity Name\n\n> One-line description (used in index.md summary).\n\n## Overview\nMain content and background.\n\n## Key Features\n- Feature 1\n- Feature 2\n\n## Related\n- [[page-slug]] — reason (back-link auto-added)\n\n## Sources\n- [Article Title](https://example.com) — source description\n```\n\n### Concept Page\n\n```markdown\n---\ntype: concept\ntitle: Concept Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n---\n\n# Concept Name\n\n> One-line definition.\n\n## Core Principles\n- Principle 1\n- Principle 2\n- Principle 3\n\n## Use Cases\n- Use case 1\n\n## Related\n- [[page-slug]] — reason\n\n## Counter-arguments / Data Gaps\n- Known limitations\n- Uncovered aspects\n\n## Sources\n- [Article Title](https://example.com) — source description\n```\n\n---\n\n## Operations\n\n### Ingest (Collection & Digestion)\n\n**Phase 1 — Analysis**\n\n```\n## Key Entities\nIdentified entities\n\n## Key Concepts\nIdentified core concepts\n\n## Main Arguments & Findings\nKey arguments and findings\n\n## Connections to Existing Wiki\nRelations to existing wiki pages\n\n## Contradictions & Tensions\nConflicts with existing knowledge\n\n## Coverage Gaps\nWhat was mentioned but not covered deeply?\nWhat related topics are missing?\n\n## Recommendations\nNew/update which pages\n```\n\n**Phase 2 — Generation**\n\n1. Create/update target pages (with urls in sources)\n2. **Sync related + back-link** (bidirectional link enforcement)\n3. Verify pages meet quality thresholds\n4. Update index.md\n5. Append to log.md\n\n**Output format**:\n```\n---FILE: wiki/concepts/page.md---\n[page content with sources.urls]\n---END FILE---\n\n---FILE: wiki/entities/backlink-target.md---\n[update target page, append back-link]\n---END FILE---\n\n---FILE: wiki/index.md---\n[append new page entry]\n---END FILE---\n\n---FILE: wiki/log.md---\n[append ingest log entry]\n---END FILE---\n```\n\n---\n\n### Query\n\n1. Read `wiki/index.md` to locate relevant pages\n2. Read related pages + extract sources.urls\n3. Use `web_fetch` to trace and verify original URLs\n4. Synthesize answer, annotate source confidence\n\n---\n\n### Relink (Automatic Relationship Discovery)\n\n**Trigger**: batch ingest complete / periodic heartbeat\n\n**Process**:\n\n```\n1. Scan all wiki/*.md tags and body text\n2. Extract core topics from each page\n3. Find page pairs sharing tags/topics\n4. Analyze relationship strength pairwise\n5. Generate recommended link list (candidate)\n6. User confirms before writing (back-link sync)\n```\n\n**Execution steps**:\n\n```bash\n# 1. Collect all related pairs (shared tags)\ngrep -r \"^tags:\" wiki/concepts/ wiki/entities/ | analyze\n\n# 2. List orphan pages\nfor f in wiki/**/*.md; do\n  related=$(grep \"^related:\" \"$f\")\n  inbound=$(grep -r \"^\\* \\[\\[$(basename $f .md)\\]\\]\" wiki/)\n  [ -z \"$related\" ] && [ -z \"$inbound\" ] && echo \"$f is orphan\"\ndone\n\n# 3. LLM generates relink suggestion report\n#    Format:\n#    [[page-A]] <--> [[page-B]]  reason: shared tag MySQL B+tree\n#    [[page-C]] --> [[page-D]]   reason: C mentions D but not linked\n```\n\n**Write rules**:\n- Update A's related to add B\n- Update B's related to add A\n- Append to log.md\n\n---\n\n### Lint (Health Check) — Enhanced\n\n**Trigger**: user request / periodic heartbeat\n\n**Scan dimensions** (6):\n\n| # | Dimension | Description |\n|---|-----------|-------------|\n| 1 | **Orphan pages** | No related pages, no inbound links |\n| 2 | **Dangling references** | related references non-existent slugs |\n| 3 | **One-way links** | A→B but B→A missing |\n| 4 | **Contradiction detection** | Same claim described differently across pages |\n| 5 | **Quality threshold** | Page fails minimum quality (no urls/no related/principles<3) |\n| 6 | **Naming drift** | Slug style inconsistent (mixed case/mixed Chinese-English) |\n\n**Lint report format**:\n\n```markdown\n## Lint Report — YYYY-MM-DD\n\n### Orphan Pages (N)\n- [[page]] — no related, no inbound\n\n### One-way Links (N)\n- [[A]] → [[B]] (B not back-linking A)\n\n### Dangling References (N)\n- [[page]] references non-existent [[nonexistent]]\n\n### Quality Failures (N)\n- [[page]] — missing urls source\n- [[page]] — empty related\n\n### Contradictions (N)\n- [[page-A]] says: X is Y\n- [[page-B]] says: X is Z\n\n### Naming Issues (N)\n- [[page]] — slug has uppercase/mixed Chinese-English\n\n### Recommended Actions\n1. [Priority 1]\n2. [Priority 2]\n```\n\n---\n\n### Deep Research\n\n**Trigger**: lint finds Coverage Gaps / user says \"research X\"\n\n**Process**:\n\n```\n1. Discover knowledge gap\n   lint report \"missing coverage\" items\n   user says \"help me research XXX\"\n\n2. Generate search queries\n   LLM generates 3-5 search queries from gap\n\n3. Multi-source search\n   Execute web_search for each query\n\n4. Ingest results\n   Write search results to raw/sources/\n   Execute ingest to generate new pages\n\n5. relink + lint\n   complete relationships + health check\n```\n\n---\n\n## purpose.md (Wiki Constitution)\n\nEvery wiki should have `purpose.md` defining:\n\n```markdown\n# purpose.md\n\n## Goal\nWho is this wiki for? What problem does it solve?\n\n## Core Questions\nWhat core questions must this wiki answer?\n\n## Scope\nWhat domains are covered?\nWhat is explicitly excluded?\n\n## Evolution Direction\nNear-term (3 months): fill gaps in which domains?\nMid-term (6 months): what state to achieve?\nLong-term (1 year): what is the ideal wiki form?\n\n## Quality Standards\nWhat is the minimum quality threshold?\n```\n\n---\n\n## Source Traceability Chain\n\n```\nUser bookmarks (Chrome export)\n  ↓\nraw/sources/bookmarks_xxx.md  (immutable)\n  ↓  Ingest writes\nwiki/xxx.md\n  sources:\n    - file: bookmarks_xxx.md\n      urls:\n        - https://example.com  ← specific URL\n  ↓  Query time\nOpenClaw reads wiki → reads sources.urls → web_fetch original URL → verify\n```\n\n---\n\n## Use Cases\n\n- User asks technical question (check wiki first, then search)\n- User says \"help me digest this link\"\n- User requests \"organize my collected content on XXX\"\n- User requests \"run lint\"\n- User requests \"relink\"\n- User requests \"research X\" (Deep Research)\n- Periodic heartbeat triggers lint + relink + quality check\n\n---\n\n## Confidence Annotations\n\n| Annotation | Meaning |\n|------------|---------|\n| `✅ Verified` | wiki content matches original URL source |\n| `⚠️ Inferred` | wiki content is LLM inference based on source, not direct quote |\n| `❌ Disputed` | wiki content contradicts source, needs verification |\n\n---\n\n## Bidirectional Link Write Rules (Enforced)\n\n**Every time you modify the related field**:\n\n```\nWhen writing A's related to add B:\n  1. Add B to A's related: [...]\n  2. Check if B's related already has A\n  3. If not, add A as back-link\n  4. If yes, skip\n```\n\n**Prohibited**:\n- ❌ Write A→B only, skip B→A\n- ❌ Leave related empty with no links added\n- ❌ sources has only file, no urls\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7cb0ef0ty28xjmdaq879gb5n83ncwj\",\n  \"slug\": \"karpathy-wiki-improve\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1778320582610\n}\n\nArchive v1.0.0: 2 files, 5655 bytes\n\nFiles: SKILL.md (12039b), _meta.json (140b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: llm-wiki\nversion: \"3.0.0\"\ndescription: \"LLM Wiki skill v3.0 — 完整的 ingest/query/relink/lint/DeepResearch 流水线，知识图谱自动维护，来源可追溯到 URL 级别。\"\n---\n\n# LLM Wiki — OpenClaw 实现 v3.0\n\n基于 Andrej Karpathy 的 [LLM Wiki 模式](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)。\n\n---\n\n## wiki 路径\n\n```\nwiki_root: /mnt/c/Users/zhang/Documents/llmwiki/first/first-demo-wiki\n```\n\n```\n<wiki_root>/\n├── raw/\n│   ├── sources/          # 原始书签/文档（不可变）\n│   └── assets/           # 图片等资源\n├── wiki/\n│   ├── entities/        # 实体页面（人物、产品、公司、网站、书籍）\n│   ├── concepts/        # 概念页面（技术、理论、方法论）\n│   ├── comparisons/     # 对比页面（多方案对比）\n│   ├── synthesis/       # 综合/综述页面\n│   ├── index.md         # wiki 总览（入口）\n│   ├── log.md           # 操作日志（追加）\n│   └── overview.md      # 全局综述\n├── purpose.md           # 知识库目标定义（wiki 宪法）⚡新增\n└── schema.md            # 结构规范\n```\n\n---\n\n## 核心原则（v3.0）\n\n1. **sources/ 不可写** — 只读原始输入，LLM 只写 wiki/\n2. **wikilink 跨页引用** — `[[page-slug]]` 语法建立关联\n3. **YAML frontmatter** — 每个页面都有 type/tags/related/sources\n4. **双向链接强制** — 每次写 related 必须同步 back-link\n5. **两阶段 Ingest** — Analysis → Generation\n6. **来源追溯到 URL** — sources 包含具体 URL，不只是文件名\n7. **Lint 驱动** — 定期健康检查，图谱持续维护\n8. **Deep Research** — 知识缺口自动发现并填补\n\n---\n\n## 分类规范（entity vs concept 边界）⚡新增\n\n| 类型 | 定义 | 示例 |\n|------|------|------|\n| **entity** | 可命名的离散实体 | 人/产品/公司/网站/书籍/工具 |\n| **concept** | 抽象概念/理论/方法论/技术领域 | 索引原理、微服务架构、依赖注入 |\n| **comparison** | 多方案对比分析 | Vue vs React、MySQL vs PostgreSQL |\n| **synthesis** | 综合性综述 | 某技术栈全景、年度总结 |\n\n**边界规则**：\n- 能说出具体名字的 → entity（\"pdai.tech\"、\"面向信仰编程\"）\n- 抽象的、通用的 → concept（\"MySQL索引\"、\"依赖注入\"）\n- entity 可以引用 concept，concept 也可以引用 entity\n- 避免同一个主题同时出现 entity 和 concept\n\n---\n\n## 命名规范 ⚡新增\n\n```\nentity:\n  博客/网站：使用域名或人名\n    → mysql-zhu-shuangyin（人名博客用域名）\n    → pdai-tech（网站用域名）\n    → jon-index-blog（匿名博客用描述性名）\n  书籍：使用书名简化\n    → effective-java\n\nconcept:\n  使用核心术语的 kebab-case\n    → mysql-innodb\n    → jwt-json-web-token\n    → yi-lai-zhu-ru\n\ncomparison:\n  → mysql-postgresql-comparison\n  → vue-vs-react\n\nsynthesis:\n  → go-web开发全景\n  → 2026-学习路线-总结\n```\n\n**规则**：\n- 全小写，用短横线分隔\n- 不混用中英文\n- slug 唯一，不重复\n\n---\n\n## YAML Frontmatter（必须字段）⚡增强\n\n```yaml\n---\ntype: entity | concept | comparison | synthesis\ntitle: 页面标题\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [标签1, 标签2]\nrelated: [page-slug-1, page-slug-2]  # 正向引用（自动补 back-link）\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1  # 具体 URL\n      - https://example.com/article2\n---\n```\n\n**⚠️ sources 必须包含 urls 数组**，不只写文件名。来源可追溯是核心原则。\n\n---\n\n## 页面质量门槛 ⚡新增\n\n每个 concept/comparison 页面**必须满足**：\n\n| 要求 | 说明 |\n|------|------|\n| 一句话定义 | frontmatter 的 title 或页首 `>` |\n| 核心原理 ≥ 3 条 | 正文包含至少 3 个实质性要点 |\n| 相关页面 ≥ 1 个 | related 字段非空 |\n| 来源 URL | sources.urls 不为空 |\n| 已补 back-link | related 中的每个页面都回链本页面 |\n\n每个 entity 页面**必须满足**：\n\n| 要求 | 说明 |\n|------|------|\n| 一句话描述 | frontmatter 的 title |\n| 关键特点 ≥ 2 条 | 正文包含实质性描述 |\n| 相关页面 ≥ 1 个 | related 非空 |\n| 来源 URL | sources.urls 不为空 |\n\n---\n\n## 页面格式\n\n### 实体页面（entity）\n\n```markdown\n---\ntype: entity\ntitle: 实体名称\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [标签]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com\n---\n\n# 实体名称\n\n> 一句话描述（用于 index.md 摘要）。\n\n## 概述\n主要内容和背景。\n\n## 关键特点\n- 特点1\n- 特点2\n\n## 相关\n- [[page-slug]] — 关联原因（自动补 back-link）\n\n## 来源\n- [文章标题](https://example.com) — 来源说明\n```\n\n### 概念页面（concept）\n\n```markdown\n---\ntype: concept\ntitle: 概念名称\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [标签]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n---\n\n# 概念名称\n\n> 一句话定义。\n\n## 核心原理\n- 原理1\n- 原理2\n- 原理3\n\n## 应用场景\n- 场景1\n\n## 相关\n- [[page-slug]] — 关联原因\n\n## 反面观点 / 数据缺口\n- 已知的局限性\n- 未覆盖的方面\n\n## 来源\n- [文章标题](https://example.com) — 来源说明\n```\n\n---\n\n## 操作\n\n### Ingest（采集消化）\n\n**阶段一 — Analysis**\n\n```\n## Key Entities\n识别出的实体\n\n## Key Concepts\n识别出的核心概念\n\n## Main Arguments & Findings\n主要论点和发现\n\n## Connections to Existing Wiki\n与现有 wiki 的关联\n\n## Contradictions & Tensions\n与现有知识的矛盾点\n\n## Coverage Gaps\n哪些方面被提到但没有深入？\n哪些相关主题缺失？\n\n## Recommendations\n新建/更新哪些页面\n```\n\n**阶段二 — Generation**\n\n1. 创建/更新目标页面（**含 urls 来源**）\n2. **同步写 related + back-link**（双向链接强制）\n3. 验证页面满足质量门槛\n4. 更新 index.md\n5. 追加 log.md\n\n**输出格式**：\n```\n---FILE: wiki/concepts/page.md---\n[页面内容，含 sources.urls]\n---END FILE---\n\n---FILE: wiki/entities/backlink-target.md---\n[更新目标页面，追加 back-link]\n---END FILE---\n\n---FILE: wiki/index.md---\n[追加新页面条目]\n---END FILE---\n\n---FILE: wiki/log.md---\n[追加 ingest 日志]\n---END FILE---\n```\n\n---\n\n### Query（查询）\n\n1. 读 `wiki/index.md` 定位相关页面\n2. 读相关页面 + 提取 sources.urls\n3. 用 `web_fetch` 追溯原始 URL 验证\n4. 综合回答，标注来源可信度\n\n---\n\n### Relink（自动关系发现）\n\n**触发时机**：batch ingest 完成后 / 定期 heartbeat\n\n**流程**：\n\n```\n1. 扫描所有 wiki/*.md 的 tags 和正文\n2. 提取每个页面的核心 topic\n3. 找出共享 tag/topic 的页面对\n4. 逐对分析关联强度\n5. 生成推荐链接（候选列表）\n6. 用户确认后写入（同步 back-link）\n```\n\n**执行步骤**：\n\n```bash\n# 1. 收集所有相关对（共享 tag）\ngrep -r \"^tags:\" wiki/concepts/ wiki/entities/ | 分析\n\n# 2. 列出孤立页面\nfor f in wiki/**/*.md; do\n  related=$(grep \"^related:\" \"$f\")\n  inbound=$(grep -r \"^\\* \\[\\[$(basename $f .md)\\]\\]\" wiki/)\n  [ -z \"$related\" ] && [ -z \"$inbound\" ] && echo \"$f is orphan\"\ndone\n\n# 3. LLM 生成 relink 建议报告\n#    输出格式：\n#    [[page-A]] <--> [[page-B]]  原因：共享 tag MySQL  B+树\n#    [[page-C]] --> [[page-D]]   原因：C 提到 D 但未链接\n```\n\n**写入规则**：\n- 更新 A 的 related 添加 B\n- 更新 B 的 related 添加 A\n- 追加 log.md\n\n---\n\n### Lint（健康检查）⚡增强\n\n**触发时机**：用户要求 / 定期 heartbeat\n\n**扫描维度**（6个）：\n\n| # | 维度 | 说明 |\n|---|------|------|\n| 1 | **孤立页面** | 没有相关页面，且无其他页面引用 |\n| 2 | **悬空引用** | related 里引用了不存在的 slug |\n| 3 | **单向链接** | A→B 但 B→A 缺失 |\n| 4 | **矛盾检测** | 同一 claim 在不同页面描述冲突 |\n| 5 | **质量门槛** | 页面不满足最低质量要求（无 urls/无 related/原理<3） |\n| 6 | **命名漂移** | slug 风格不一致（中英混用/大小写混乱） |\n\n**执行流程**：\n\n```bash\n# 收集所有页面\npages=$(find wiki/concepts wiki/entities -name \"*.md\")\n\n# 1. 孤立检测\n# 2. 悬空检测\n# 3. 单向链接检测\n# 4. LLM: 矛盾检测（读每个页面的核心 claim 对比）\n# 5. 质量门槛检测（页面内容行数/urls 数量/related 数量）\n# 6. 命名规范检测\n```\n\n**Lint 报告格式**：\n\n```markdown\n## Lint 报告 — YYYY-MM-DD\n\n### 孤立页面（N个）\n- [[page]] — 无 related，无人引用\n\n### 单向链接（N个）\n- [[A]] → [[B]]（B 未回链 A）\n\n### 悬空引用（N个）\n- [[page]] 引用了不存在的 [[nonexistent]]\n\n### 质量不达标（N个）\n- [[page]] — 缺少 urls 来源\n- [[page]] — related 为空\n\n### 矛盾（N个）\n- [[page-A]] 说：X 是 Y\n- [[page-B]] 说：X 是 Z\n\n### 命名问题（N个）\n- [[page]] — slug 含大写/中英混用\n\n### 建议操作\n1. [优先级1]\n2. [优先级2]\n```\n\n---\n\n### Deep Research ⚡新增\n\n**触发时机**：lint 发现 Coverage Gaps / 用户要求\"研究一下 X\"\n\n**流程**：\n\n```\n1. 发现知识缺口\n   lint 报告中的\"缺失覆盖\"项\n   用户说\"帮我研究一下 XXX\"\n\n2. 生成搜索查询\n   LLM 根据缺口生成 3-5 个搜索查询\n   例：缺口\"MySQL MVCC\" →\n       \"MySQL MVCC 多版本并发控制 原理\"\n       \"MySQL MVCC 实现机制 undo log\"\n       \"MySQL MVCC 面试题\"\n\n3. 多源搜索\n   对每个查询执行 web_search\n\n4. 结果 ingest\n   将搜索结果写入 raw/sources/\n   执行 ingest 生成新页面\n\n5. relink + lint\n   补全关联 + 健康检查\n```\n\n**Deep Research 输出**：\n\n```markdown\n## 研究报告：XXX\n\n### 知识缺口\n[缺口描述]\n\n### 搜索查询\n1. query1 → 结果摘要\n2. query2 → 结果摘要\n\n### 新生成页面\n- [[new-page-1]] — 核心发现\n- [[new-page-2]] — 核心发现\n\n### 建议后续\n- [下一步研究方向]\n```\n\n---\n\n## purpose.md（wiki 宪法）⚡新增\n\n每个 wiki 必须有 `purpose.md`，定义：\n\n```markdown\n# purpose.md\n\n## 目标\n这个 wiki 是为了谁？解决什么问题？\n\n## 核心问题\n这个 wiki 要回答哪些核心问题？\n\n## 范围\n涵盖哪些领域？\n明确排除哪些领域？\n\n## 演进方向\n近期（3个月）：补全哪些领域的覆盖？\n中期（6个月）：达到什么状态？\n远期（1年）：wiki 的理想形态是什么？\n\n## 质量标准\n最低质量门槛是什么？\n```\n\n---\n\n## 来源追溯链\n\n```\n用户书签（Chrome 导出）\n  ↓\nraw/sources/bookmarks_xxx.md  （原始不可变）\n  ↓  Ingest 时写入\nwiki/xxx.md\n  sources:\n    - file: bookmarks_xxx.md\n      urls:\n        - https://example.com  ← 具体 URL\n  ↓  Query 时\nOpenClaw 读 wiki → 读 sources.urls → web_fetch 原始 URL → 验证\n```\n\n---\n\n## 适用场景\n\n- 用户问技术问题（先查 wiki 再搜索补充）\n- 用户说\"帮我消化这个链接\"\n- 用户要求\"整理一下我收藏的 xxx 相关内容\"\n- 用户要求\"跑一下 lint\"\n- 用户要求\"relink 一下\"\n- 用户要求\"研究一下 X\"（Deep Research）\n- 定期心跳触发 lint + relink + 质量检查\n\n---\n\n## 信任度标注\n\n| 标注 | 含义 |\n|------|------|\n| `✅ 来源确认` | wiki 内容与原始 URL 来源一致 |\n| `⚠️ LLM外推` | wiki 内容是 LLM 基于来源推理，非直接引用 |\n| `❌ 存疑` | wiki 内容与来源矛盾，需要核实 |\n\n---\n\n## 双向链接写入规则（强制）\n\n**每次修改 related 字段时**：\n\n```\n写 A 的 related 添加 B 时：\n  1. 在 A 的 related: [...] 中加入 B\n  2. 检查 B 的 related 是否已有 A\n  3. 如果没有，加入 A（back-link）\n  4. 如果有，跳过\n```\n\n**禁止**：\n- ❌ 只写 A→B，不写 B→A\n- ❌ related 为空却不补任何链接\n- ❌ sources 只有 file 没有 urls\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7cb0ef0ty28xjmdaq879gb5n83ncwj\",\n  \"slug\": \"karpathy-wiki-improve\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1778319927948\n}","readmeExcerpt":"Skill: Karpathy Wiki Improve Owner: zhangmengyang Summary: Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source trace... Tags: latest:1.1.2 Version history: v1.1.2 | 2026-06-17T07:52:23.902Z | user Maintenance update: bump version to refresh on Recently Updated v1.1.1 | 2026-05-13T05:45:36.105Z | user - Removed Chinese-","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"wiki_root: /path/to/your/wiki  # configure to your local path"},{"language":"text","snippet":"<wiki_root>/\n├── raw/\n│   ├── sources/          # raw bookmarks/docs (immutable)\n│   └── assets/           # images and resources\n├── wiki/\n│   ├── entities/        # entity pages (people, products, companies, sites, books)\n│   ├── concepts/        # concept pages (tech, theory, methodology)\n│   ├── comparisons/     # comparison pages\n│   ├── synthesis/       # synthesis/overview pages\n│   ├── index.md         # wiki index (entry point)\n│   ├── log.md           # operation log (append-only)\n│   └── overview.md      # global overview\n├── purpose.md           # wiki goal definition (wiki constitution)\n└── schema.md            # structure conventions"},{"language":"text","snippet":"entity:\n  blogs/sites: use domain or person name\n    → mysql-zhu-shuangyin\n    → pdai-tech\n    → jon-index-blog\n  books: use simplified book title\n    → effective-java\n\nconcept:\n  use core terms in kebab-case\n    → mysql-innodb\n    → jwt-json-web-token\n    → dependency-injection\n\ncomparison:\n  → mysql-postgresql-comparison\n  → vue-vs-react\n\nsynthesis:\n  → go-web-dev-overview\n  → 2026-learning-roadmap-summary"},{"language":"yaml","snippet":"---\ntype: entity | concept | comparison | synthesis\ntitle: Page Title\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tag1, tag2]\nrelated: [page-slug-1, page-slug-2]  # forward reference (back-link auto-added)\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n      - https://example.com/article2\n---"},{"language":"markdown","snippet":"---\ntype: entity\ntitle: Entity Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com\n---\n\n# Entity Name\n\n> One-line description (used in index.md summary).\n\n## Overview\nMain content and background.\n\n## Key Features\n- Feature 1\n- Feature 2\n\n## Related\n- [[page-slug]] — reason (back-link auto-added)\n\n## Sources\n- [Article Title](https://example.com) — source description"},{"language":"markdown","snippet":"---\ntype: concept\ntitle: Concept Name\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\ntags: [tags]\nrelated: [page-slug-1, page-slug-2]\nsources:\n  - file: bookmarks_xxx.md\n    urls:\n      - https://example.com/article1\n---\n\n# Concept Name\n\n> One-line definition.\n\n## Core Principles\n- Principle 1\n- Principle 2\n- Principle 3\n\n## Use Cases\n- Use case 1\n\n## Related\n- [[page-slug]] — reason\n\n## Counter-arguments / Data Gaps\n- Known limitations\n- Uncovered aspects\n\n## Sources\n- [Article Title](https://example.com) — source description"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: karpathy-wiki-improve\ndescription: \"Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source traceability. Use when: user says 'organize bookmarks', 'research X', 'run lint', 'relink', or needs a personal knowledge graph.\"\n---\n\n# karpathy-wiki — OpenClaw Implementation\n\nBased on Andrej Karpathy's [LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).\n\n---\n\n## Trigger Keywords (Activation)\n\nActivate this skill when the user says anything like:\n- \"organize bookmarks\" / \"digest this link\"\n- \"research X\" / \"help me research\"\n- \"run lint\" / \"lint check\"\n- \"relink\" / \"build connections\"\n- \"wiki\" / \"knowledge graph\"\n- \"Deep Research\"\n\n---\n\n## wiki Root\n\n```\nwiki_root: /path/to/your/wiki  # configure to your local path\n```\n\n```\n<wiki_root>/\n├── raw/\n│   ├── sources/          # raw bookmarks/docs (immutable)\n│   └── assets/           # images and resources\n├── wiki/\n│   ├── entities/        # entity pages (people, products, companies, sites, books)\n│   ├── concepts/        # concept pages (tech, theory, methodology)\n│   ├── comparisons/     # comparison pages\n│   ├── synthesis/       # synthesis/overview pages\n│   ├── index.md         # wiki index (entry point)\n│   ├── log.md           # operation log (append-only)\n│   └── overview.md      # global overview\n├── purpose.md           # wiki goal definition (wiki constitution)\n└── schema.md            # structure conventions\n```\n\n---\n\n## Core Principles\n\n1. **sources/ is read-only** — LLM only writes wiki/, never modifies raw sources\n2. **wikilink cross-references** — `[[page-slug]]` syntax for page connections\n3. **YAML frontmatter** — every page has type/tags/related/sources\n4. **Bidirectional links enforced** — every write to related must sync back-link\n5. **Two-phase Ingest** — Analysis → Generation\n6. **URL-level traceability** — sources contain specific URLs, not just filenames\n7. **Lint-driven** — periodic health checks, graph stays clean\n8. **Deep Research** — knowledge gaps auto-discovered and filled\n\n---\n\n## Page Type Taxonomy (entity vs concept boundary)\n\n| Type | Definition | Examples |\n|------|------------|----------|\n| **entity** | Named, discrete things | people/products/companies/sites/books/tools |\n| **concept** | Abstract ideas/theories/methodologies | indexing principles, microservices, DI |\n| **comparison** | Multi-option comparisons | Vue vs React, MySQL vs PostgreSQL |\n| **synthesis** | Comprehensive overview | tech stack panorama, annual summary |\n\n**Boundary Rules**:\n- If it has a specific name → entity (\"pdai.tech\", \"Effective Java\")\n- If it's abstract/generic → concept (\"MySQL indexing\", \"dependency injection\")\n- Avoid having both entity and concept for the same topic\n\n---\n\n## Naming Convention\n\n```\nentity:\n  blogs/sites: use domain or person name\n    → mysql-zhu-shuangyin\n    → pdai-tech\n    → jon-index-blog\n  books: use simplified book title\n    "},{"path":"README.md","content":"# karpathy-wiki-improve\n\nOpenClaw skill implementing Andrej Karpathy's LLM Wiki pattern — a persistent markdown knowledge wiki with full ingest/query/relink/lint/DeepResearch pipeline.\n\n## What It Does\n\n- **Ingest**: Turn raw bookmarks/links into structured wiki pages with bidirectional links\n- **Query**: Answer questions by reading wiki first, then web search to supplement\n- **Relink**: Auto-discover and establish page relationships\n- **Lint**: Health-check the knowledge graph (orphans, dangling refs, one-way links)\n- **Deep Research**: Fill knowledge gaps with targeted search + ingest\n\n## Quick Start\n\n```bash\nnpx clawhub install zhangmengyang/karpathy-wiki-improve\n```\n\nThen in OpenClaw:\n\n```\norganize my bookmarks on Go\nresearch MySQL indexing\nrun lint on my wiki\nrelink\n```\n\n## Wiki Structure\n\n```\nwiki/\n├── raw/sources/      # immutable original sources\n├── wiki/\n│   ├── entities/     # people, products, companies, sites\n│   ├── concepts/     # tech, theory, methodology\n│   ├── comparisons/   # A vs B analysis\n│   └── synthesis/    # topic overviews\n├── purpose.md        # wiki constitution\n├── schema.md         # structure conventions\n└── wiki/index.md     # entry point\n```\n\n## Source\n\nBased on [Andrej Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)."},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cb0ef0ty28xjmdaq879gb5n83ncwj\",\n  \"slug\": \"karpathy-wiki-improve\",\n  \"version\": \"1.1.2\",\n  \"publishedAt\": 1781682743902\n}"},{"path":"skill-card.md","content":"## Description:\n\nHelps agents organize bookmarks and research into a persistent Markdown knowledge wiki with ingest, query, relink, lint, Deep Research, and URL-level source traceability.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[zhangmengyang](https://clawhub.ai/user/zhangmengyang)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers, researchers, and knowledge workers use this skill to turn collected links and research topics into a structured personal wiki, then query and maintain it with linting and relinking workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Broad triggers can lead the agent to make persistent local wiki edits beyond the user's intended scope.\n\nMitigation: Use a dedicated, backed-up wiki folder and review proposed file changes before execution.\n\nRisk: Deep Research and query workflows can introduce unverified or misleading source material into the wiki.\n\nMitigation: Approve search queries before execution and require URL-level source traceability with confidence annotations.\n\nRisk: Periodic linting or relinking can change wiki relationships without enough explicit consent.\n\nMitigation: Run maintenance only when explicitly requested or clearly enabled for the configured wiki.\n\n## Reference(s):\n\n- [Andrej Karpathy LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)\n- [Karpathy Wiki Improve ClawHub listing](https://clawhub.ai/zhangmengyang/skills/karpathy-wiki-improve)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown with wiki plans, source links, and inline shell commands]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May propose or create persistent local wiki files within the configured wiki folder.]\n\n## Skill Version(s):\n\n1.1.2 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source trace... Skill: Karpathy Wiki Improve Owner: zhangmengyang Summary: Karpathy LLM Wiki pattern implementation — full ingest/query/relink/lint/DeepResearch pipeline, automatic knowledge graph maintenance, URL-level source trace... Tags: latest:1.1.2 Version history: v1.1.2 | 2026-06-17T07:52:23.902Z | user Maintenance update: bump version to refresh on Recently Updated v1.1.1 | 2026-05-13T05:45:36.105Z | user - Removed Chinese-","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1222,"uniquenessScore":54,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T15:30:54.075Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T15:30:54.075Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T17:45:57.821Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}