No description
  • Rust 94.9%
  • Shell 4.6%
  • Ruby 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-26 21:27:35 +02:00
docs Update knowledge base to 734968c 2026-08-26 21:27:35 +02:00
Formula Update kb formula to 68f11b0 2026-08-26 21:06:01 +02:00
skills/knowledge-base Add the /knowledge-base skill to the repo, plus a README 2026-08-26 20:03:50 +02:00
src Update ratatui, crossterm, pulldown-cmark & improve run function error bounds 2026-08-26 21:03:36 +02:00
tests/fixtures/docs/knowledge-base Add frontmatter/body parser and section loader 2026-08-26 17:07:51 +02:00
.gitignore Add .gitignore and commit Cargo.lock 2026-08-26 17:50:22 +02:00
Cargo.lock Update ratatui, crossterm, pulldown-cmark & improve run function error bounds 2026-08-26 21:03:36 +02:00
Cargo.toml Update ratatui, crossterm, pulldown-cmark & improve run function error bounds 2026-08-26 21:03:36 +02:00
LICENSE Add a Homebrew formula and MIT license 2026-08-26 20:00:41 +02:00
README.md Add the /knowledge-base skill to the repo, plus a README 2026-08-26 20:03:50 +02:00
renovate.json Add minimumReleaseAge to Renovate config 2026-08-26 21:01:28 +02:00

kb

A terminal UI for reading a project's knowledge base, plus the Claude Code skill that writes one.

The two halves are deliberately decoupled and share only an on-disk format:

Half What it does Lives in
kb Reads and renders docs/knowledge-base/*.md in a TUI src/ (this crate)
/knowledge-base Researches a codebase and writes those files skills/knowledge-base/

Neither calls the other at runtime. You can use the skill without the viewer (the output is plain markdown that renders on any git forge), or point the viewer at a knowledge base written by hand.

Installing the viewer

Via Homebrew, using this repo as its own tap:

brew tap headscracher/knowledgebase https://git.all4-one.de/Headscracher/KnowledgeBase.git
brew install headscracher/knowledgebase/kb

Or build from source (requires a Rust toolchain):

cargo install --path .

Installing the skill

Copy it into your personal Claude Code skills directory:

cp -r skills/knowledge-base ~/.claude/skills/

Or symlink it, so it tracks this repo as you pull updates:

ln -s "$PWD/skills/knowledge-base" ~/.claude/skills/knowledge-base

Then run /knowledge-base from any project you want documented.

Using it

Run kb in a project that has a knowledge base. It walks upward from the current directory looking for docs/knowledge-base/, the same way git looks for .git, so it works from any subdirectory:

kb            # search upward from the current directory
kb some/path  # search upward from a specific directory

If nothing is found it says so and exits, without taking over the terminal.

Key Action
/ h l Switch section (top tab bar)
/ j k Switch sub-section (left outline)
PgUp PgDn Scroll the content pane
/ Full-text search across all sections
q Quit

The mouse works too: click a tab or an outline entry, scroll the wheel over the content pane, or click the search hint in the status bar.

The file format

Each section is a markdown file with YAML frontmatter. kb reads the frontmatter for the sidebar's freshness markers; the skill writes it so a later run can tell which sections went stale:

---
title: Authorization
last_scanned_commit: 8f3a1c2
last_scanned_date: 2026-08-26
status: complete   # complete | partial | stale
paths_considered:
  - src/auth/**
---

status drives the marker next to each tab: complete, ~ partial, ! stale, ? unreadable frontmatter. A section whose frontmatter fails to parse still renders its body, with the error shown above it.

Section filenames are fixed (00-overview.md through 09-misc.md, plus a generated README.md index) so both halves agree on what exists without needing a manifest.

Development

cargo test                                                  # viewer tests
bash skills/knowledge-base/scripts/test-stale-sections.sh   # skill script tests

This project documents itself: docs/knowledge-base/ is real output from the skill, so the fastest way to see what kb looks like is to build it and run it here.

License

MIT — see LICENSE.