kb-init
/kb-init
Zakłada nową bazę wiedzy OKF w bieżącym repozytorium, która czerpie z lokalnych sesji Claude Code dla wybranych repozytoriów źródłowych, i sprawdza jej poprawność.
- Autor
- smoketurner ↗
- Repozytorium
- claude-okf-kb ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 26.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 1
Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Zakłada nową bazę wiedzy OKF w bieżącym repozytorium, która czerpie z lokalnych sesji Claude Code dla wybranych repozytoriów źródłowych, i sprawdza jej poprawność.
Wyzwalacze z opisu
Oryginalny opis (EN)
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.
Jak działa
- 1. Locate the scaffolder
- 2. Gather inputs
- 3. Scaffold
- 4. Verify and hand off
Podgląd SKILL.md
---
name: kb-init
description: 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.
---
# Initialize a knowledge base
You turn the current directory into an [Open Knowledge Format v0.2](https://github.com/GoogleCloudPlatform/open-knowledge-format/blob/main/SPEC.md)
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 as `vouch`; and the human
**title** (`--title`), such as `Vouch`. 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/projects` shows 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`, optional `YYYY-MM-DD`): sessions older than this are never mined.
Suggest it when `ls ~/.claude/projects/<dir>/*.jsonl | wc -l` is 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 validate` is clean and `git status` shows the scaffold.
- `jq . kb.config.json` lists exactly the agreed repos; `.claude/settings.json` grants them.
- Install the hooks: `prek install` (fall back to `pre-commit install` if prek is absent).
- Confirm `jq`, `gitleaks`, and `uv` are on PATH — `refresh.py prepare` needs all three. Opening
the refresh PR needs either `gh` logged in or `GITHUB_TOKEN`/`GH_TOKEN` in the environment.
Do not commit unless the user asks. Report what was created, then tell the user:
1. Run `/kb-refresh` for 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).
2. Edit the **Layout** scope list in `AGENTS.md` whenever a source repo is added to
`kb.config.json` (bump its `version` and re-stamp).
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · smoketurner/claude-okf-kb | 100 | MIT |
| rvk7895/llm-knowledge-bases | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki f0f23c99cf3a (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100okf-init
Tworzy standardową strukturę knowledge w repozytorium zgodnie z profilem OKF v0.2 i przygotowuje ją do odczytu w Obsidian. - 84init
Zakłada nowy projekt ze standardową strukturą katalogów, plikami szablonowymi i repozytorium git. - 100okf-wiki
Buduje bazę wiedzy w Open Knowledge Format (OKF) z istniejących dokumentów, notatek lub repozytorium i tworzy szkielet wiki OKF. - 90okf-tidy-claude-md
Porządkuje plik CLAUDE.md w repozytorium względem bundla OKF: zostawia to, czego agent potrzebuje w każdej sesji, a resztę przenosi do pojęć. - 100kb-document
Dokumentuje repozytorium oprogramowania w pakiecie wiedzy OKF i aktualizuje dokumentację po zmianach w kodzie, traktując repozytorium jako żywe źródło tylko do odczytu. - 100init
Inicjalizuje pliki bazy wiedzy OKF w bieżącym projekcie dla claude-mega-brain i wprowadza w użycie wtyczki.