Skip to content

Instantly share code, notes, and snippets.

@walidbr
Last active April 12, 2026 21:20
Show Gist options
  • Select an option

  • Save walidbr/d1fe5537220d85d0abb90d77da5c1642 to your computer and use it in GitHub Desktop.

Select an option

Save walidbr/d1fe5537220d85d0abb90d77da5c1642 to your computer and use it in GitHub Desktop.
initialise llm_wiki and obsidian repo
#!/bin/bash
# llm_wiki_init.sh
# Initializes a project-specific LLM Wiki based on the Karpathy blueprint.
# Source: https://github.com/ScrapingArt/Karpathy-LLM-Wiki-Stack
WIKI_ROOT=".llm-wiki"
echo "πŸš€ Initializing LLM Wiki in $WIKI_ROOT..."
# 1. Create Directory Structure
mkdir -p "$WIKI_ROOT"/raw/{articles,papers,repos,transcripts,data,assets} \
"$WIKI_ROOT"/wiki/{sources,entities,concepts,comparisons,syntheses} \
"$WIKI_ROOT"/.obsidian/plugins \
"$WIKI_ROOT"/.claude/skills
# 2. Create Master Schema (.llm-wiki/CLAUDE.md)
cat > "$WIKI_ROOT/CLAUDE.md" << 'EOF'
# LLM Wiki β€” Master Schema (Layer 3)
## Domain
[REPLACE WITH YOUR TOPIC]
## Project Structure
- `.llm-wiki/raw/` β€” Immutable sources. NEVER modify.
- `.llm-wiki/wiki/` β€” LLM-owned wiki layer.
- `.llm-wiki/wiki/index.md` β€” Master catalog. Update on EVERY ingest.
- `.llm-wiki/wiki/log.md` β€” Activity log. Append-only.
- `.llm-wiki/wiki/overview.md` β€” High-level synthesis.
- `.llm-wiki/wiki/hot.md` β€” Session hot cache (~500 words).
- `.llm-wiki/CLAUDE.md` β€” This file. Re-read at session start.
## Page Conventions
Every wiki page MUST have YAML frontmatter.
### Source Summary (wiki/sources/)
---
type: source
title: "Title"
slug: summary-{slug}
source_file: .llm-wiki/raw/articles/{filename}.md
author: "Author"
date_published: YYYY-MM-DD
date_ingested: YYYY-MM-DD
key_claims: []
related: []
confidence: high
---
### Concept Page (wiki/concepts/)
---
type: concept
title: "Concept"
aliases: []
sources: []
related: []
created: YYYY-MM-DD
updated: YYYY-MM-DD
---
## Ingest Workflow
When I say "ingest [path]":
1. Read source from `.llm-wiki/raw/`.
2. Discuss 3-5 key takeaways.
3. Create summary in `wiki/sources/`.
4. Update `wiki/index.md` and `wiki/log.md`.
5. Update/Create relevant concepts and entities.
6. Cross-link everything with [[wiki-links]].
7. DELETE original source from `.llm-wiki/raw/` after successful ingest.
## Safety Rules
- NEVER modify or write to `.llm-wiki/raw/`.
- NEVER delete wiki pages (use `status: deprecated`).
- ALWAYS update index and log on every operation.
EOF
# 3. Create Live Dashboard
cat > "$WIKI_ROOT/VAULT-INDEX.md" << 'EOF'
# Vault Dashboard
- [ ] Initial topic research
- [ ] First batch ingest
- [ ] Schema refinement
EOF
# 4. Create Initial Wiki Files
cat > "$WIKI_ROOT/wiki/index.md" << 'EOF'
# Wiki Index β€” [Domain Name]
## Concepts
- (Empty)
## Entities
- (Empty)
## Source Summaries
- (Empty)
## Comparisons & Syntheses
- (Empty)
EOF
cat > "$WIKI_ROOT/wiki/log.md" << 'EOF'
# Activity Log
EOF
cat > "$WIKI_ROOT/wiki/overview.md" << 'EOF'
# Wiki Overview
Newly initialized Karpathy LLM Wiki.
Domain: [REPLACE WITH TOPIC]
EOF
cat > "$WIKI_ROOT/wiki/hot.md" << 'EOF'
---
type: hot-cache
updated: $(date +%Y-%m-%d)
---
### Current Focus
Newly initialized vault. Ready for first ingest.
EOF
# 5. Create Obsidian Config
cat > "$WIKI_ROOT/.obsidian/app.json" << 'EOF'
{
"userIgnoreFilters": ["node_modules/", ".git/"],
"newFileLocation": "folder",
"newFileFolderPath": ".llm-wiki/raw/articles",
"attachmentFolderPath": ".llm-wiki/raw/assets"
}
EOF
echo "βœ… Done. Open '$WIKI_ROOT' as an Obsidian vault."
echo "πŸ’‘ To begin, drop sources into '$WIKI_ROOT/raw/' and say 'ingest'."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment