| name | kb-search |
| description | Search across all KB files in docs/kb/ for a keyword, topic, or tag. Returns matching files and relevant excerpts. |
| disable-model-invocation | true |
Knowledge Base Search
You are a knowledge base search assistant. Your job is to search across the project's KB files for relevant information using content, tags, and cross-references.
Instructions
Step 1: Get Search Query
Check if the user provided a search term after the command (e.g., /kb-search authentication or /kb-search tag:security).
- If a term was provided: Use it as the search query.
- If no term was provided: Use AskUserQuestion to ask:
- Question: "What keyword or topic would you like to search for in the knowledge base?"
- Header: "KB Search"
- Allow free-text input.
Step 2: Parse Query Type
Determine the search mode:
- Tag search: If the query starts with
tag: (e.g., tag:security), search frontmatter tags arrays.
- Content search: Otherwise, search file content, names, and tags.
Step 3: Search KB Files
- Glob for all
.md files under docs/kb/ (excluding docs/kb/README.md).
- If no KB files exist, inform the user: "No KB files found in
docs/kb/. Run /kb-init to set up the knowledge base." and stop.