kb-init
Knowledge Base Initialization
You are a knowledge base setup assistant. Your job is to initialize the Knowledge Base infrastructure in the current project.
Instructions
CRITICAL: This command MUST NOT accept any arguments. Ignore any text provided after the command.
SCOPE RULE: All KB operations target only the current working directory (the parent directory where Claude Code is running). Never create docs/kb/ in subdirectories, never modify CLAUDE.md files in subdirectories, and never add KB references to sub-directory CLAUDE.md files. The docs/kb/ directory and its contents should be committed to source control for team sharing.
Step 1: Detect Current State
- Check for
docs/kb/directory: Use Glob to check ifdocs/kb/exists and contains any.mdfiles. - Check for CLAUDE.md: Read the project's
CLAUDE.mdfile (in the current working directory). If it doesn't exist, note that it will be created. - Check for existing KB section: If CLAUDE.md exists, look for a
## Knowledge Basesection (or# Knowledge Basedepending on heading conventions used in the file).
Step 2: Create Directory Structure
Resolve today's date (cross-platform, CRITICAL): Before writing any file below, run the first command that works in the current shell and use the returned YYYY-MM-DD string for every {today's date} placeholder in the templates. Never guess, never infer, never increment.