kb-compact
Installation
SKILL.md
Contains Hooks
This skill uses Claude hooks which can execute code automatically in response to events. Review carefully before installing.
/kb-compact
1. Configuration
Read KB config from .claude/knowledge-base/config.json (kb_roots array). Single KB: use its path. Multiple: AskUserQuestion which KB. No config: tell user "Run /kb-bootstrap to set up." and stop.
2. Input
Parse $ARGS:
--deep: recursive bottom-up traversal. Without it: single directory only.- path: optional, relative to project root or
<kb_root>. - No path: ask user. Offer "Compact whole KB" (warn: expensive, implies
--deep) or specify subfolder.
3. Folder Structure
All restructuring follows reference/folder-structure.md (canonical for clustering, unification, indexes, naming).
Sibling unification first: child folders grouped by semantically/lexicographically close names, run before other steps. 5+ siblings = medium sign; 8+ = high.