kb-init
Skill0 starsChanged 3 days agoMITView on GitHub
Scaffold a new OKF knowledge base in the current repository that mines local Claude Code sessions for one or more source repos. Use when asked to initialize/create/set up a knowledge base, start a new "-kb" repo, or bootstrap this template. Gathers the project name and source repo paths, runs the deterministic scaffolder, verifies the bundle, and explains the first refresh.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- dimitar-radenkov/Pointframetheir own version, first seen Nov 1, 2026
- jsobolewski1/fonduetheir own version, first seen Oct 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- dimitar-radenkov/Pointframe★ 16same name
- jsobolewski1/fondue★ 6same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- template/AGENTS.mdAGENTS.md
- template/CLAUDE.mdCLAUDE.md
- kb-refreshSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Ask the user with AskUserQuestion when they have not already said:
- Distinctive: line 47
Run, from the repo root:
- Distinctive: line 67
Do not commit unless the user asks.
- Very specific: line 69
Run /kb-refresh for the first mining pass (with no watermarks it mines every session after the history floor.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Initialize a knowledge base
You turn the current directory into an Open Knowledge Format v0.2
bundle that /kb-refresh keeps up to date from Claude Code transcripts. The work itself is done by a
deterministic script; your job is to gather correct inputs, run it, and verify the result.
1. Locate the scaffolder
The script is scripts/init.py under the plugin root when this skill runs from the installed
okf-kb plugin: ${CLAUDE_PLUGIN_ROOT}. If that placeholder was not expanded to a real path (it
appears literally above), this skill is running from a template checkout and the scaffolder is
./scripts/init.py in the current directory. Call the resolved path SOURCE/scripts/init.py
below.
Refuse to proceed if the current directory already holds kb.config.json (it is already a
knowledge base) or is not a git repository (git rev-parse --show-toplevel); tell the user to
create or clone the empty target repo first.
2. Gather inputs
Ask the user with AskUserQuestion when they have not already said:
- Project name (
--name): a lowercase kebab-case slug such asvouch; and the human title (--title), such asVouch. Default the name to the repo directory name minus a trailing-kb. - Source repositories (
--repo, repeatable): absolute paths of the checkouts whose sessions to mine. Before asking, list candidates:ls ~/.claude/projectsshows one directory per working directory Claude Code has run in, named by the path with/and.replaced by-(-Users-you-envs-git-vouch); directories containing--claude-worktrees-are worktrees of the preceding repo and are mined automatically. Offer the directories whose names contain the project name, mapped back to their real paths, and confirm each path exists. Only repos listed here are mined — a sibling that merely shares the name prefix is not. - History floor (
--since, optionalYYYY-MM-DD): sessions older than this are never mined. Suggest it whenls ~/.claude/projects/<dir>/*.jsonl | wc -lis in the hundreds, because the first refresh otherwise digests everything (which is fine, just long).
--run-dir (scratch space for digests, default /private/tmp/<name>-kb-refresh) and
--base-branch (default main) rarely need changing.
3. Scaffold
Run, from the repo root:
uv run SOURCE/scripts/init.py --name <name> --title "<Title>" --repo <path> [--repo <path> ...] [--since YYYY-MM-DD]It copies the bundle skeleton, scripts/, and the /kb-refresh skill into the repo, writes
kb.config.json, .claude/settings.json (the out-of-tree directories and command allow-list the
refresh needs), and .refresh/watermarks.json, stamps the docs, regenerates the eight type-directory indexes, and runs okf.py validate. In a template
checkout it also removes the template-only files (template/, .claude-plugin/, this skill, the
scaffolder) so what remains is a plain knowledge-base repo.
4. Verify and hand off
uv run scripts/okf.py validateis clean andgit statusshows the scaffold.jq . kb.config.jsonlists exactly the agreed repos;.claude/settings.jsongrants them.- Install the hooks:
prek install(fall back topre-commit installif prek is absent). - Confirm
jq,gitleaks, anduvare on PATH —refresh.py prepareneeds all three. Opening the refresh PR needs eitherghlogged in orGITHUB_TOKEN/GH_TOKENin the environment.
Do not commit unless the user asks. Report what was created, then tell the user:
- Run
/kb-refreshfor the first mining pass (with no watermarks it mines every session after the history floor; expect a Workflow fan-out when there are many batches, and a PR at the end). - Edit the Layout scope list in
AGENTS.mdwhenever a source repo is added tokb.config.json(bump itsversionand re-stamp).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

