From kb
Manages a personal knowledge base with learning tracking. Modes: (1) learn from articles, (2) learn about topics, (3) fix errors. Uses markdown links with relative paths for cross-references. Maintains a rolling changelog, validates links, and keeps a markdown-compatible knowledge base. When a note reaches ~500 lines, suggests /kb-compact.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kb:learnThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [1. Configuration](#1-configuration)
agents/assessor.mdagents/challenger.mdagents/scouter.mdagents/searcher.mdassets/index-note.mdassets/legacy-note.mdassets/topic-note.mdreference/article-workflow.mdreference/changelog-workflow.mdreference/evolution-workflow.mdreference/fetch-content.mdreference/folder-structure.mdreference/mistake-workflow.mdreference/topic-workflow.mdscripts/suggestion.pyscripts/validate_kb.pyOn first invocation, check for config at .claude/knowledge-base/config.json.
No config: Tell user "Run /kb-bootstrap to set up your knowledge base." and stop.
Config exists: Read kb_roots. Single entry → use it. Multiple → defer to §4 step 0.
Parse $0 to determine workflow:
article → reference/article-workflow.mdtopic → reference/topic-workflow.mdfix → reference/mistake-workflow.mdcompact → Redirect: "Run /kb-compact [path] instead."Specialized agents isolate high-volume work and enable parallelism. SKILL.md is the orchestrator — spawns agents and chains results. Agents never spawn other agents.
| Agent | Model | Purpose | Used by |
|---|---|---|---|
| scouter | haiku | KB discovery via /kb-find (supports --challenge) | all workflows |
| searcher | sonnet | Web research — search, fetch, structure findings | topic, article |
| challenger | sonnet | Adversarial web research — finds counter-evidence | topic |
| assessor | opus | Evaluate claims against KB + web evidence | article, topic |
1. Spawn scouter(s) + searcher IN PARALLEL
├── scouter (normal) → supporting evidence
├── scouter (challenge) → counter-evidence
└── searcher → web findings
2. Spawn challenger (with claims from step 1) → counter-evidence from web
3. Spawn assessor (with all evidence incl. challenger) → verdicts + KB impact
4. Apply changes
Not all steps required every time:
Use agents when output is high-volume, work is parallelizable, or task benefits from model specialization. Use inline when KB is small, single simple claim, or latency matters.
All KB discovery goes through the scouter agent. Never use /kb-find directly.
${CLAUDE_SKILL_DIR}/../find/SKILL.mdmodel: haiku, background: trueWhy: Skill-internal agents don't get automatic skill injection — the orchestrator must explicitly inject kb-find content.
Empty KB: Skip loading, note KB is empty.
After loading KB, check for concept evolution — outdated terminology, framing, or versioning. Follow reference/evolution-workflow.md for detection, callouts, old patterns, and legacy notes.
KB routing: Multiple KBs → infer target from context; if ambiguous, ask user.
[read-only] badge (global KB), do NOT write to it. Instead, create a suggestion file in ~/.claude/knowledge-base/suggestions/ using suggestion.py (see ${CLAUDE_SKILL_DIR}/scripts/suggestion.py --help). Inform the user that a suggestion was created for the global KB.
0a. Skill folder check: If topic has skill/ subfolder, route by content type:reference/ or SKILL.mdskill/ → all content to concept notesTemplates from assets/: topic-note, index-note, legacy-note
Slim frontmatter:
name + description in frontmatter. No title, summary, confidence, tags.<conf:high>, <conf:medium>, <conf:low> markers on claims are allowed and preserved during edits. Claims without a confidence tag should be treated as <conf:medium> (unverified but not flagged).# {Title} → content sections. No summary paragraph duplicating description.## Contents in first 10 lines of body.name (append " (legacy)") + description (mention replacement).Keep heading accurate after modifications.
Cross-references: markdown links with relative paths. Every concept note should link to at least one other note/index. Cross-KB: use @kb-name/path format. Global KBs: use soft references only — see: @namespace.kb/topic (no hard markdown links to read-only KBs).
Index updates: Link new notes from relevant index. Create index if 3+ notes and none exists. Use table when section has 3+ items (see reference/folder-structure.md).
5a. Sibling unification: Skip if §4a already ran. Otherwise, if creating a new folder, check siblings per §4a.
MANDATORY changelog: Every change to KB files → prepend entry to that KB's CHANGELOG.md. Follow reference/changelog-workflow.md. Do NOT skip.
Large notes: If note reaches ~500 lines, suggest /kb-compact <path>.
Run after any KB update. Reuse KB root listing from step 5 if available; otherwise one ls.
Detection: Group KB root folders by first hyphen-delimited segment. 3+ folders sharing prefix (no existing parent) = candidate. No candidate = stop.
If found: Ask user — "Restructure now", "Skip", "Not applicable".
If approved: Follow reference/folder-structure.md. Run validate_kb.py --quiet to confirm zero errors.
Before non-trivial KB changes, present summary: notes to create, modify, index updates, changelog entry. Group claims by confidence level. Show <conf:low> claims in a separate "⚠ Low confidence" section. Use the AskUserQuestion tool (not plain text) with options: "Apply high/medium confidence", "Apply all (including low confidence)", "Apply selectively", "Cancel".
Exception: Minor changes (adding source URL, fixing typo) may proceed without approval but must be mentioned.
crdt-operation-based.md, not operations.md). 2-4 words.index.md per folder. See reference/folder-structure.md.Topics with "how" content have skill/ inside their concept folder. Symlink from .claude/skills/ makes it discoverable. All skills must be KB-backed. When skill/ exists, concept notes are lightweight (provenance, summary, pointers to skill).
Conventions apply to new notes by default. Existing notes not moved unless requested. When editing, may normalize frontmatter and update indexes.
When relocation requested: mv files → run validate_kb.py → fix reported broken links. Don't rewrite content just to relocate.
After completing KB changes, run the validator to catch broken links, frontmatter issues, and structural errors:
uv run ${CLAUDE_SKILL_DIR}/scripts/validate_kb.py --quiet --json
Fix any reported errors before finishing.
npx claudepluginhub farzadshbfn/knowledge-plugin --plugin kbCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.