If you want to build .kb/ by hand instead of running /kb-build, copy from here.
<your-corpus>/.kb/
├── indexes/
│ └── _root.md
├── summaries/
├── decisions/ ← populated by /kb-record-decision, not by hand
└── .kb-state.json
- Copy
_root.template.mdto.kb/indexes/_root.md. Replace the placeholder areas with the real areas in your corpus. - For each area: copy
index.template.mdto.kb/indexes/<area>.md. Fill in the "when to enter" and leaves. - For each leaf: copy
summary.template.mdto.kb/summaries/<area>/<leaf>.md. Write the prose. - Create an empty
.kb/decisions/directory. Decision records land here when you run/kb-record-decisionagainst a completed plan. You can also hand-author them usingdecision.template.md, but the skill is the expected path. - Copy
.kb-state.template.jsonto.kb/.kb-state.json. Setlast_linted_shato your current git SHA:git rev-parse HEAD. Setlast_linted_atto the current UTC ISO-8601 timestamp.
- Index files are ≤300 tokens. Signposts, not content.
- Summary files: one topic per file. No size limit, but split if you're mixing unrelated concerns.
_root.mdis the agent's first read on any query. Keep it honest — if an area disappears, remove it from_root.md.decisions/is never referenced from_root.md. Each decision record names the summaries it shapes in its own## Affected areasblock; agents find decisions for a given summary by greping.kb/decisions/for that summary's path. Summaries themselves never list decisions — the link lives in the immutable side.
The drift checker may write an ephemeral artifact at .kb/.drift-report.json when invoked by /kb-maintain. It is recomputable from git history and should not be committed:
# kb-for-agents drift artifact (ephemeral, recomputable)
.kb/.drift-report.jsonKeep .kb/.kb-state.json in git — it is the refresh watermark and is meant to be shared between developers.