Build and query a structured, evidence-backed knowledge base with Claude Code.
LLMs hallucinate. When answering questions about your product, company, or domain, you need answers grounded in documented facts, not general knowledge. This plugin creates a knowledge base where every answer must cite literal quotes from your KB files.
| Skill | What it does |
|---|---|
/setup-knowledge-base |
Interactive onboarding: define categories, scaffold the KB structure, create the index |
/kb-answer |
Answer questions with evidence-backed citations from your KB |
/kb-import |
Import knowledge from existing documents (Markdown, PDF, plain text) into structured KB entries |
/kb-refresh |
Add new sources (Notion, Slack, Confluence, local files) or re-scrape existing ones to pick up changes |
- Install the plugin via Claude Code marketplace or
./install.sh knowledge-base - Run
/setup-knowledge-basein your project - Add entries to
kb/or import existing docs with/kb-import - Query with
/kb-answer What encryption do we use?
Markdown files with YAML frontmatter, organized by category:
---
title: "Data Encryption"
description: "AES-256 at rest, TLS 1.2+ in transit"
category: security
tags: [encryption, aes, tls]
last_updated: "2026-04-10"
---
All data is encrypted at rest using AES-256-GCM.
Data in transit is protected with TLS 1.2 or higher.When you ask /kb-answer, the skill:
- Navigates the KB index to find relevant files
- Reads the files and extracts supporting evidence
- Formulates an answer citing literal quotes
- Flags when information is missing from the KB
Optional context profiles that customize answers. For example, a "enterprise-customer" scope can emphasize security certifications while excluding self-serve pricing.
kb/
.kb-config.yaml # Category definitions (flat or nested)
index.md # Central navigation index
scopes/ # Context profiles
_default.yaml
security/ # Top-level category directory
data-encryption.md
certifications.md
access/ # Nested sub-category (optional)
mfa.md
sso.md
technical/
product-overview.md
...
scripts/
kb-index.py # Lists all KB files; --write regenerates index.md (nested-aware)
kb-verify.py # Verifies answer citations (single- and multi-line, strict + normalized-match fallback)
kb-validate.py # Checks frontmatter, categories (incl. nested), related-link resolution; --max-age N warns on stale entries
kb-search.py # Keyword search across title, tags, description, body; filter by category/tag
python3 scripts/kb-search.py "encryption"
python3 scripts/kb-search.py "MFA" --category security
python3 scripts/kb-search.py "breach" --tag incident --limit 5