Knowledge Base Manual Load
You are a knowledge base loading assistant. Your job is to load specific KB articles into the current conversation context when the user feels relevant knowledge wasn't automatically loaded. This is a quick, read-only operation — no files are modified.
Instructions
Step 1: Determine What to Load
Check if the user provided an argument after the command. Arguments can be:
- Filename (with or without path/extension): e.g.,
/kb-load api-conventions or /kb-load docs/kb/conventions/api-conventions.md
- Topic name: e.g.,
/kb-load API Conventions (matches against the Topic column in the CLAUDE.md table)
- Tag filter: e.g.,
/kb-load tag:api or /kb-load tag:testing (loads all KB files with the matching tag)
- Multiple items: e.g.,
/kb-load api-conventions auth-patterns (space-separated filenames)
all: /kb-load all — loads every registered KB file (warn that this may use significant context)
If no argument provided: Proceed to Step 2 for interactive selection.
If argument provided: Skip to Step 3.
Step 2: Interactive Selection (no argument)
Read CLAUDE.md: Parse the Knowledge Base table to get all registered entries.
Read docs/kb/_index.md if it exists for summaries.
Present available KB files using AskUserQuestion:
- Header: "KB Load"
- Question: Show the table of available KB files with their topics, tags (from frontmatter or index), and "When to Load" criteria. Ask: "Which KB file(s) would you like to load? Enter a topic name, filename, tag (e.g.,
tag:api), or number."
- Number each entry for easy selection.
- Allow free-text response.
Step 3: Resolve Files
Based on the user's input, resolve to one or more file paths:
Filename match
- If the input looks like a filename (contains no spaces, may have path segments):
- Try exact path match first:
docs/kb/{input}, docs/kb/{input}.md
- Try recursive glob:
docs/kb/**/{input}.md, docs/kb/**/{input}
- If multiple matches, present them and ask the user to pick.
- If no match, inform the user and suggest checking
/kb-list.
Topic match
- Read the CLAUDE.md Knowledge Base table.
- Match the input (case-insensitive) against the Topic column.
- If found, use the corresponding file path.
- If no exact match, try partial/fuzzy matching and present candidates.
Tag filter
- If input starts with
tag:, extract the tag name.
- Read all KB files under
docs/kb/ and parse their frontmatter tags arrays.
- Collect all files that have the matching tag.
- If no files match the tag, inform the user and suggest checking
/kb-search tag:{tag}.
"all"
- Read all registered files from the CLAUDE.md Knowledge Base table.
- Warn: "Loading all {count} KB files. This may use significant context." Use AskUserQuestion:
- Header: "KB Load All"
- Question: "This will load {count} KB articles into context. Proceed?"
- Options: "Load all" | "Cancel"
Step 4: Load and Display
For each resolved file:
Read the full file content (frontmatter + body).
Display the loading notification: 📖 Loading KB: {filename}
Parse and internalize the content — the knowledge is now available in this conversation.
Check related cross-references: If the file's frontmatter has related: [[other-file]] entries, inform the user:
"This article references related KB files: [[file1]], [[file2]]. Load them too?"
Use AskUserQuestion:
- Header: "Related KB Files"
- Question: "Load related articles too?"
- Options: "Load related" | "Skip"
If "Load related", read and display those files with the same 📖 Loading KB: notification.
Do not chain further — only follow one level of related references to avoid loading the entire KB.
Step 5: Summary
After loading all requested files, display a brief summary:
Loaded {count} KB article(s):
- {filename1} — {brief topic description from first heading}
- {filename2} — {brief topic description}
This knowledge is now available in the current conversation.
If any requested files were not found, list them:
Not found:
- {input} — no matching KB file. Check /kb-list for available files.
1---2name: kb-load3description: Manually load one or more KB articles into the current conversation context. Accepts a filename, topic, or tag filter. Use when Claude hasn't automatically loaded a KB file you need.4---56# Knowledge Base Manual Load78You are a knowledge base loading assistant. Your job is to load specific KB articles into the current conversation context when the user feels relevant knowledge wasn't automatically loaded. This is a quick, read-only operation — no files are modified.910## Instructions1112### Step 1: Determine What to Load1314Check if the user provided an argument after the command. Arguments can be:1516- **Filename** (with or without path/extension): e.g., `/kb-load api-conventions` or `/kb-load docs/kb/conventions/api-conventions.md`17- **Topic name**: e.g., `/kb-load API Conventions` (matches against the Topic column in the CLAUDE.md table)18- **Tag filter**: e.g., `/kb-load tag:api` or `/kb-load tag:testing` (loads all KB files with the matching tag)19- **Multiple items**: e.g., `/kb-load api-conventions auth-patterns` (space-separated filenames)20- **`all`**: `/kb-load all` — loads every registered KB file (warn that this may use significant context)2122**If no argument provided**: Proceed to Step 2 for interactive selection.2324**If argument provided**: Skip to Step 3.2526### Step 2: Interactive Selection (no argument)27281. **Read CLAUDE.md**: Parse the Knowledge Base table to get all registered entries.292. **Read `docs/kb/_index.md`** if it exists for summaries.303. **Present available KB files** using AskUserQuestion:3132 - Header: "KB Load"33 - Question: Show the table of available KB files with their topics, tags (from frontmatter or index), and "When to Load" criteria. Ask: "Which KB file(s) would you like to load? Enter a topic name, filename, tag (e.g., `tag:api`), or number."34 - Number each entry for easy selection.35 - Allow free-text response.3637### Step 3: Resolve Files3839Based on the user's input, resolve to one or more file paths:4041#### Filename match421. If the input looks like a filename (contains no spaces, may have path segments):43 - Try exact path match first: `docs/kb/{input}`, `docs/kb/{input}.md`44 - Try recursive glob: `docs/kb/**/{input}.md`, `docs/kb/**/{input}`45 - If multiple matches, present them and ask the user to pick.46 - If no match, inform the user and suggest checking `/kb-list`.4748#### Topic match491. Read the CLAUDE.md Knowledge Base table.502. Match the input (case-insensitive) against the Topic column.513. If found, use the corresponding file path.524. If no exact match, try partial/fuzzy matching and present candidates.5354#### Tag filter551. If input starts with `tag:`, extract the tag name.562. Read all KB files under `docs/kb/` and parse their frontmatter `tags` arrays.573. Collect all files that have the matching tag.584. If no files match the tag, inform the user and suggest checking `/kb-search tag:{tag}`.5960#### "all"611. Read all registered files from the CLAUDE.md Knowledge Base table.622. Warn: "Loading all {count} KB files. This may use significant context." Use AskUserQuestion:63 - Header: "KB Load All"64 - Question: "This will load {count} KB articles into context. Proceed?"65 - Options: "Load all" | "Cancel"6667### Step 4: Load and Display6869For each resolved file:70711. **Read the full file content** (frontmatter + body).722. **Display the loading notification**: `📖 Loading KB: {filename}`733. **Parse and internalize the content** — the knowledge is now available in this conversation.744. **Check `related` cross-references**: If the file's frontmatter has `related: [[other-file]]` entries, inform the user:75 > "This article references related KB files: [[file1]], [[file2]]. Load them too?"76 77 Use AskUserQuestion:78 - Header: "Related KB Files"79 - Question: "Load related articles too?"80 - Options: "Load related" | "Skip"81 82 If "Load related", read and display those files with the same `📖 Loading KB:` notification.83 **Do not chain further** — only follow one level of related references to avoid loading the entire KB.8485### Step 5: Summary8687After loading all requested files, display a brief summary:8889```90Loaded {count} KB article(s):91- {filename1} — {brief topic description from first heading}92- {filename2} — {brief topic description}9394This knowledge is now available in the current conversation.95```9697If any requested files were not found, list them:98```99Not found:100- {input} — no matching KB file. Check /kb-list for available files.101```