CLI-driven system for building and maintaining a self-compiling markdown knowledge base.
Install
mkdir -p .claude/skills/kb-compozy && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18070" && unzip -o skill.zip -d .claude/skills/kb-compozy && rm skill.zipInstalls to .claude/skills/kb-compozy
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Comprehensive skill for the `kb` CLI and the Karpathy Knowledge Base pattern. Covers the full KB lifecycle — topic scaffolding, multi-source ingestion (URLs, files, YouTube videos and channels, Instagram reels, bookmarks, codebases), wiki article compilation, cross-article querying with file-back, lint-and-heal passes, QMD indexing, and hybrid search. Also covers the OKF (Open Knowledge Format) dual-mode lifecycle: per-topic `mode: wiki|okf`, scaffolding portable OKF bundles, promoting compiled wiki concepts into a typed catalog with `kb promote`, the four-producer-field + relative-link contract, a local concept-type vocabulary, and OKF v0.1 conformance checking with `kb okf check`. Also covers codebase-specific analysis via inspect commands for complexity, coupling, blast radius, dead code, circular dependencies, symbol/file lookups, backlinks, and code smells. Use when working with kb CLI commands, knowledge base workflows, code vault generation, code graph analysis, code metrics inspection, wiki compilation, the ingest-compile-query-lint cycle, or the wiki→OKF distill loop (promote + conformance). Do not use for general code review, linting, formatting, building Go projects, or writing application code.Key capabilities
- →Scaffold new knowledge base topics
- →Ingest content from URLs, files, YouTube, Instagram, and codebases
- →Compile wiki articles from raw sources
- →Query across articles with file-back capabilities
- →Perform lint-and-heal passes on the knowledge base
- →Promote compiled wiki concepts into a typed catalog
How it works
The skill uses the `kb` CLI to build and maintain an Obsidian markdown knowledge base, treating the LLM as a compiler to process raw sources into cross-linked wiki articles.
Inputs & outputs
When to use kb
- →Ingest documentation sources
- →Analyze codebase coupling
- →Compile wiki articles
- →Perform code smell inspection
About this skill
kb CLI and Knowledge Base Pattern
kb maintains an Obsidian markdown knowledge base in the Karpathy LLM Wiki pattern. kb ingests sources, and its decision model gates, classifies and links them. You, the agent, compile wiki articles from the sources, answer questions from the wiki and file the answers back, and run lint-and-heal passes.
- Topic. Each topic is a folder in the vault: at the root (
go-best-practices/) or nested by[vault].topic_globs(harness/goclaw/).CLAUDE.mdis the topic marker and schema document (scope, conventions, current articles, gaps;AGENTS.mdmay symlink to it).topic.yamlholdsslug,title,domain,modeand the selection contract. kb renders the contract intoCLAUDE.mdunder## Selection contract; change it withkb topic contract, never inCLAUDE.md. - Mode.
mode: wiki(default;raw/,wiki/,outputs/,bases/,log.md, the ingest → compile → query → lint loop) ormode: okf(a flat, portable Open Knowledge Format bundle of typed concepts, filled bykb promote). - Division of labour. The decision model only judges text (yes/no, choice, score) and a small generation model only writes short literals (summaries, criteria, aliases, drafts); code applies thresholds and writes files. You write and update article prose, decide what to ingest, draft or edit contracts, and give the human verdicts in
kb review.
references/architecture.md has the rationale (compiler analogy, context window vs RAG, multi-topic vaults).
Prerequisites
kb versionworks.qmd --versionforkb index/kb searchand optional vector candidates (npm install -g @tobilu/qmd).OPENROUTER_API_KEYfor every command that ingests (exceptcodebase), classifies, links, finds, drafts or accepts a contract, builds a vocabulary, accepts or rejects review items, or suggests an OKF type. Those commands refuse to start without it.lint,inspect,index,search,topic new|list|info,topic contract --import-claude,review list|import-links|import-labels|calibrate,find --facets,ingest codebaseandmigratenever call a model.FIRECRAWL_API_KEYforkb ingest url;yt-dlp(and an STT key for--transcribe auto|stt) for YouTube and Instagram.- A repo-root vault has
kb.tomlat its root:[vault] root = "." topic_globs = ["*", "harness/*"]
Command map
| Intent | Command | Details |
|---|---|---|
| New wiki topic / OKF bundle | kb topic new <slug> <title> <domain> [--mode okf] | okf-mode.md |
| List topics, topic metadata | kb topic list, kb topic info <topic> | |
| Ingest a URL, URL list, file, YouTube video, channel, Instagram reel, bookmark cluster | kb ingest url|file|youtube|channel|instagram|bookmarks <input> --topic <topic> | cli-ingest-sources.md |
| Write, import or accept the selection contract | kb topic contract <topic> --draft|--import-claude|--accept | selection-contract.md |
| Bootstrap concepts for a topic without articles | kb topic vocabulary <topic> --draft, then --accept | decision-workflow.md |
| Classify documents (facets, summaries, criteria, aliases) | kb classify <topic> [--only-missing] | decision-workflow.md |
| Write typed relations and backlinks | kb link <topic> [--dry-run] | decision-workflow.md |
| Find the documents that answer a question | kb find <topic> "<question>" --explain | decision-workflow.md |
| Count documents per genre, relevance, depth, concept | kb find --facets <topic> | |
| Work the review queues | kb review <topic> [--queue q]; kb review accept|reject --topic <topic> <id>... | decision-workflow.md |
| Import screening files or human links as labels | kb review import-labels <topic> --from <file> ...; kb review import-links <topic> | decision-workflow.md |
| Calibrate thresholds | kb review calibrate <topic> [--write] | decision-workflow.md |
| Clean a topic that predates the decision model | five steps | cleaning-a-topic.md |
| Lint a topic | kb lint <topic> [--save] | lint-procedure.md |
| Index and search with QMD | kb index --topic <topic>; kb search "<query>" --topic <topic> [--lex|--vec] --format json | cli-search-index.md |
| Distill a wiki concept into an OKF bundle | kb promote <wiki-doc> --to <okf-topic> [--type <Type>] | okf-mode.md |
| Check an OKF bundle | kb okf check <okf-topic> [--strict] [--decide] | okf-mode.md |
| Analyze a codebase, then inspect it | kb ingest codebase <path> --topic <topic> --progress never; kb inspect <subcommand> --format json | cli-ingest-codebase.md, cli-inspect.md |
| Move legacy transcripts | kb migrate transcripts --topic <topic> | cli-ingest-sources.md |
Use path-relative topic ids for nested topics (--topic harness/goclaw). For parsing, use --format json where a command offers it and read stdout only; stderr carries diagnostics and run summaries (output-formats.md).
Working with the decision model
These rules apply to every decision-backed command; references/decision-workflow.md has flags, thresholds, queue actions, calibration and the .decisions/ files.
- Budget.
--budget <usd>caps a run (default US$ 1).--budget 0uses cached answers only. Past the budget, items areundecided:budget: re-run to continue from the cache in<topic>/.decisions/receipts.jsonl. - Failures are never a "no".
undecided:<reason>andnot_checked:<reason>leave a document as it was, and an undecided ingest judgment writestriage: reviewwithtriage_reason: undecided. Report these statuses from the run summary; re-run instead of concluding anything from them. - Shadow before apply. Relevance gates and body-link insertion run in shadow (recorded as review items, nothing moved) until the topic has an accepted contract and a current calibration or
decisions.gates: apply/decisions.mode: apply. Quality gates and exact dedupe apply from the start. Never switch a topic to apply without the user. - Nothing is deleted. Gated sources move to
raw/_quarantine/with a ledger of every index line and frontmatter entry removed, sokb review acceptrestores them byte for byte. Quarantine and restore only throughkb review, never by moving files. - Frontmatter ownership. kb writes its own keys (
triage,genre,depth,relevance,concepts,summary,criterion,entities,questions,quality, relation lists,aliases, ...;frontmatter-schemas.md). A key you or the user edit becomes user-owned and kb stops writing it (lint:key-conflict); relation lists andaliasesonly get appended to.locked: truemakes kb skip a file entirely.topic.yamldecisions.excludeglobs keep files out of every model call. - Human verdicts. Review items are yours or the user's to decide. Read items before bulk-accepting (
--above,--topic-wide); several wrongremoveitems mean the contract is too narrow. Every verdict becomes a calibration label.
KB maintenance procedures
Procedure 1: Compile a wiki article
- Read
references/compilation-guide.mdfor length, style, wikilink density, sourcing and update rules. - Find candidate sources:
kb find <topic> "<what the article must cover>" --explain, sources whoseconcepts:oraffects:name the article,kb search "<phrase>" --topic <topic>, or<topic>/wiki/index/Source Index.md. For a stub (stage: stub), itscriterionsays what the article must cover. - Load the candidate sources fully, and
<topic>/wiki/index/Concept Index.mdfor existing articles and wikilink targets. - Before drafting, present 3–5 key takeaways, the concepts the article introduces or updates, and any contradiction with existing articles; ask what to emphasize, unless the user asked for autonomous compilation.
- Write
<topic>/wiki/concepts/<Article Title>.md(Obsidian Flavored Markdown; frontmatter fromfrontmatter-schemas.md; 3000–4000 words; Sources section). Updates to an existing article use theCurrent / Proposed / Reason / Sourcediff format fromcompilation-guide.md. - Run
kb classify <topic> --only-missing(criterion and aliases for the new article), thenkb link <topic>, and workkb review <topic> --queue link. kb finds the mentions and writes the backlinks; you do not hand-audit them. - Update the topic indexes (Procedure 2) and the current-articles list in
<topic>/CLAUDE.md; re-index withkb index --topic <topic>when the topic uses QMD. - Append
## [YYYY-MM-DD] compile | <Article Title> (<words> words, <N> sources)to<topic>/log.md.
Procedure 2: Maintain topic indexes
After adding, renaming or removing a wiki article, update <topic>/wiki/index/Dashboard.md (counts, featured sections, Base embeds), Concept Index.md (alphabetical row with a one-line summary) and Source Index.md (every cited source with a wikilink back to the article).
Procedure 3: Query the wiki and file back the answer
- Read the topic's
Concept Index.mdfirst, then locate articles: the index at small scale (< 30 articles), otherwisekb find <topic> "<question>" --explain, pluskb searchorgrepfor exact terms. Answer from the wiki, never from general knowledge; a contradiction between the two is itself a finding. - Read the identified articles in full, following one level of
[[wikilinks]]when relevant. Pull a raw source only to verify an ambiguous claim. - Answer with a
[[wikilink]]citation for every factual claim, note agreements and disagreements between articles, and state gaps explicitly ("the wiki has no article on X"). Match the format to the question: prose, comparison table, numbered steps, Known / Open questions / Gaps, or a diagram (tooling-tips.mdfor Marp). - Save the answer to
<topic>/outputs/queries/<YYYY-MM-DD> <Question Slug>.md(type: output,stage: query,informed_by:wikilinks) and call out insights to absorb on the next compile. - When the answer contradicts or extends an
Content truncated.
When not to use it
- →For general code review or linting
- →For formatting or building Go projects
- →For writing application code
Prerequisites
Limitations
- →Does not perform general code review or linting
- →Does not format or build Go projects
- →Does not write application code
How it compares
This skill automates the entire lifecycle of a knowledge base, from ingestion to compilation and querying, providing a structured approach to managing information and code insights.
Compared to similar skills
kb side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| kb (this skill) | 0 | 4mo | Review | Advanced |
| llm-wiki | 0 | 5mo | Review | Intermediate |
| knowledge-ops | 0 | 6mo | No flags | Advanced |
| ask | 0 | 5mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
llm-wiki
rtl-buddy
Karpathy's LLM Wiki: build/query interlinked markdown KB.
knowledge-ops
ThanhTrunggDEV
Knowledge base management, ingestion, sync, and retrieval across multiple storage layers (local files, MCP memory, vector stores, Git repos). Use when the user wants to save, organize, sync, deduplicate, or search across their knowledge systems.
ask
Lambenthan
对 wiki 提问,综合检索相关页面后回答,好的回答可 crystallize 回 wiki
braindump
huytieu
Quick capture of raw thoughts with intelligent domain classification and competitive intelligence extraction
hindsight-cloud
vectorize-io
Store team knowledge, project conventions, and learnings from tasks. Use to remember what works and recall context before new tasks. Connects to Hindsight Cloud. (user)
scratch-pad
krafton-ai
Markdown-based working memory for complex tasks. Use when: 5+ tool calls needed, researching multiple sources, analyzing/comparing items, multi-step workflows. Record process → Reference for response → Delete after use