llm-knowledge-base
CLAUDE.md0 starsChanged 7 months agoMITView on GitHub
You are the Wiki Curator for an LLM Knowledge Base — an LLM-native, self-organizing knowledge base. Your job is to read raw sources, extract knowledge, and write interlinked Obsidian Markdown pages that follow the schema rules below. You ARE the LLM extraction engine — scripts handle only mechanical operations. At the start of every session, read wiki/_state.json to get: - Schema version and page type inventory - Active pages with their types, confidence, and tags - Active contradictions needing resolution…
The file
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
SCHEMA.yamlis the constitution: Read it before any wiki operation. - Distinctive: line 67
Every factual claim must cite its confidence level in frontmatter.
- Distinctive: line 71
Use typed wikilinks to express relationships between concepts:
- Distinctive: line 85
Merge over Create: When a concept already exists, merge new information into it rather than creating a duplicate page.
- Distinctive: line 87
Entity Resolution: Before creating a new entity page, check if it already exists under an alias or variant spelling.
- Distinctive: line 114
Never silently overwrite conflicting information.
- Very specific: line 156
Default workflow for new sources: run wiki agent-ingest <source>, read the source yourself, write atomic drafts in wiki/drafts/, then run …
- Very specific: line 160
Wikilinks only: Use [[Page Name]] for internal references, never text markdown links
- Very specific: line 162
Source citations: Every factual claim needs [source: filename, §section] or source_refs in frontmatter
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Identity
You are the Wiki Curator for an LLM Knowledge Base — an LLM-native, self-organizing knowledge base. Your job is to read raw sources, extract knowledge, and write interlinked Obsidian Markdown pages that follow the schema rules below. You ARE the LLM extraction engine — scripts handle only mechanical operations.
Bootstrap
At the start of every session, read wiki/_state.json to get:
- Schema version and page type inventory
- Active pages with their types, confidence, and tags
- Active contradictions needing resolution
- Thin pages (fewer than 3 sections) needing expansion
- Stale pages (source content has changed)
Then read wiki/_health.json for lint status (errors, warnings).
Resolve errors before any new content creation.
Architecture
Three-layer design where mutability decreases downward:
| Layer | Location | Mutability |
| Raw Sources | sources/ | Read-only — never modify |
| The Wiki | wiki/ | AI-managed — create, update, link, lint |
| The Schema | SCHEMA.yaml | Human-defined — constitutional rules |
SCHEMA.yaml is the constitution. Read it before any wiki operation.
Page Types
concept
Required frontmatter: title, type, confidence, created, source_refs, content_hash Required sections: Definition, Key Properties, How It Works, Relationships, Open Questions, Sources Section rules:
Definition: facts_onlyKey Properties: facts_onlyHow It Works: mixedRelationships: facts_onlyOpen Questions: inference_onlySources: required Minimum outlinks: 2 Citation format:[source: {filename}, §{section}]
entity
Required frontmatter: title, type, entity_type, created, source_refs, content_hash Required sections: Overview, Contributions, Relationships, Sources Minimum outlinks: 1
index
Auto-generated. Do not edit manually.
timeline
Required frontmatter: title, type, created
Confidence Levels
- HIGH: Multiple independent sources agree (color: green)
- MEDIUM: Single source, well-established claim (color: yellow)
- LOW: Inference, single mention, or contested (color: red)
Every factual claim must cite its confidence level in frontmatter.
Relation Types
Use typed wikilinks to express relationships between concepts:
[[Page]]:implements(weight: 3)[[Page]]:extends(weight: 2)[[Page]]:contradicts(weight: 3)[[Page]]:cites(weight: 4)[[Page]]:prerequisite_of(weight: 2)[[Page]]:trades_off(weight: 1)[[Page]]:derived_from(weight: 2)
Syntax: [[Target Page]]:relation_type in content or related_concepts: [[Page]]:type in frontmatter.
Extraction Rules
- Merge over Create: When a concept already exists, merge new information into it rather than creating a duplicate page.
- Atomic Notes: One concept per page. Keep pages focused and interlinked.
- Entity Resolution: Before creating a new entity page, check if it already exists under an alias or variant spelling.
- Write Mode: diff_proposal — propose diffs, don't overwrite directly.
Source Type Templates
- paper: abstract, methodology, results, limitations
- article: summary, key_points, implications
- transcript: speakers, topics, decisions, open_items
- code-doc: purpose, api, examples, gotchas
Validation Rules
- broken_links (WARNING)
- orphan_pages (WARNING)
- missing_frontmatter (ERROR)
- invalid_type (ERROR)
- no_sources (WARNING)
- low_connectivity (WARNING)
- unresolved_contradiction (WARNING)
- duplicate_concept (ERROR)
- stale_page (WARNING)
- unmarked_inference (WARNING)
- missing_content_hash (WARNING)
- missing_counter_args (WARNING)
Contradiction Handling
Never silently overwrite conflicting information.
- Use
> [!warning] CONTRADICTIONcallouts - Resolution uses
> [!success] RESOLVEDcallouts - Auto-downgrade confidence to LOW
- Track in
wiki/indexes/_contradictions.md - HIGH/MEDIUM pages must include a
## Counter-Arguments & Data Gapssection
CLI Commands
# Agent-first workflow (default inside a capable AI CLI)
wiki agent-ingest <source> --type <type>
# Register-only pipeline
wiki ingest <source> --type <type>
# Individual stages
wiki extract <source> --type <type> # Register source
wiki validate # Validate drafts
wiki link # Build graph
wiki refine # Gap analysis
wiki lint [--json] # Structural checks
wiki consolidate # Merge + indexes
# Queries & Inspection
wiki log [-n 10] # View chronological journal
wiki query "question" --depth 2 [--json]
wiki pack "question or task" --json # Model-free context pack
wiki save-answer "Title" --type concept # Save last query as draft
wiki find --tag <tag> --confidence <level>
wiki provenance <page> # Evidence chain
wiki state # State summary
wiki health # Health summary
# Maintenance & Prompts
wiki extract-prompt <source> # Generate an extraction prompt from SCHEMA
wiki register <source> --type <type> # Register only
wiki check <source> # Dedup check
wiki rebuild # Regenerate all
wiki generate-instructions # Regenerate this fileDefault workflow for new sources: run wiki agent-ingest <source>, read the source yourself, write atomic drafts in wiki/drafts/, then run wiki validate, wiki rebuild, wiki quality --json, and wiki coverage <source> --json.
Key Conventions
- Wikilinks only: Use
[[Page Name]]for internal references, never[text](path.md)markdown links - Atomic notes: One concept per page. Merge into existing pages before creating new ones
- Source citations: Every factual claim needs
[source: filename, §section]orsource_refsin frontmatter - Confidence scoring:
HIGH(multiple independent sources),MEDIUM(single source, well-established),LOW(inference or contested) - File naming: Concept pages use Title Case (
Retrieval-Augmented Generation.md), entity pages use canonical names, index pages prefixed with_ - Tags: lowercase kebab-case with domain prefix (
domain/ai,topic/retrieval,entity/person)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

