charlesjones-dev/claude-code-plugins-dev/kb-query
Claude Code and agent skill by charlesjones-dev/claude-code-plugins-dev
- community
Checking that the SKILL.md file is still in the repository.
Answer a question from the team knowledge base with cited articles and offer to file the answer back as an article. Also searches by keyword or tag:name and lists every article with how it loads.
Install
npx vskill@latest install charlesjones-dev/claude-code-plugins-dev/kb-querySKILL.md
Query the knowledge base
Read kb-format.md first. It defines the layout, frontmatter and load modes used below.
Arguments (may be empty): $ARGUMENTS
Step 1: Pick the mode
| Arguments | Mode | |
|---|---|---|
list | List: show every article and how it loads | |
tag:{name} | Search by tag | |
search {terms} | Search by keyword | |
| One or two words, with no question mark or question word | Search by keyword, then offer an answer | |
| Anything else | Answer the question | |
| None | Ask (below) |
With no arguments, ask with AskUserQuestion:
- Header: "KB Query"
- Question: "What do you want to know? Ask a question, search for a keyword or
tag:name, or list the knowledge base." - Options: "Ask a question" | "Search" | "List everything"
Then ask for the question or search terms as free text.
Step 2: Check the knowledge base
Run the checks from kb-format.md: stop if there's a 1.x knowledge base (point to /kb-migrate) or no knowledge base (point to /kb-init).
Gather the articles: every .md file under .claude/rules/kb/ and .claude/kb/ except _index.md, _log.md and README.md. If there are none, say "The knowledge base has no articles yet. Add some with /kb-learn, /kb-add or /kb-discover." and stop.
List and Search modes are read-only.
List mode
For each article, read its frontmatter and title, and work out its load mode from its location and paths. Also check:
- frontmatter: missing, YAML that won't parse, missing
tags,createdorlast-updated, 1.x fields (scope,pinned,related,sources) or[[name]]links; - a scoped or on-demand article without a line in
_index.md, or an index line pointing at a missing file; - a scoped article whose
pathsmatch no file (check with Glob); - Related entries that point at files that don't exist.
If there are problems, suggest the fix: /kb-prune for content, links and paths that match nothing; /kb-migrate for 1.x fields, [[name]] links and format problems; /kb-add {path} for an article added by hand.
Search mode
- By tag (
tag:security): match the tag against each article'stags, ignoring case. Also list articles whose Related section points at a match. - By keyword: search article content (Grep, ignoring case), file and folder names (
apimatchesapi-conventions.md), titles and tags. Search_global-learnings.mdtoo.
With no matches: "Nothing in the knowledge base matches '{query}'. It has {n} articles tagged: {tags}."
When the search came from one or two words rather than search or tag:, end by offering to answer it as a question.
Answer mode
Find the relevant articles
- Read
_index.mdfor the scoped and on-demand articles and their keywords. - Match the question's keywords against file names, titles, tags, index lines and, for scoped articles, the folders their
pathscover. - Read the most relevant articles in full, usually 3 to 8.
- Follow the Related paths in those articles to others that look pertinent.
- Read
_global-learnings.mdfor cross-cutting rules that apply.
Answer
- Draw on several articles where you can; connecting them is the point.
- Cite the article behind each part of the answer by its path ("Per
conventions/api-conventions.md, every route is versioned"). - Point out contradictions between articles.
- Name gaps: if the knowledge base doesn't cover part of the question, say so and suggest how to fill it (
/kb-discover src/deploy, or/kb-addwith a doc or URL). Answer that part from the code only if you checked the code, and say that you did. - Use the format that fits: prose to explain, bullets for rules, a table to compare, code blocks for examples.
Offer to file the answer
Ask (Header: "File Answer to KB?"; Question: "This answer drew on {n} articles. Save it as an article for future sessions?"; Options: "Save as an article" | "Skip"). Recommend saving when the answer drew on three or more articles, or produced a comparison, an overview or a decision record. Still offer, without pushing, when it only restated one article. With "Skip", stop; nothing is written.
File it
- Where: suggest a path and load mode. A synthesis of scoped articles about the same folders can be scoped to them; most syntheses are on-demand. Ask (Header: "KB File Location"; Options: "{suggested path} ({mode})" | "Somewhere else").
- Write: get today's date once (kb-format.md, Dates). Rewrite the answer in article style: headings, imperative rules where they fit, no conversational phrasing, citations kept as paths. Frontmatter adds
type: synthesisandquery: "{the question}", plustags,createdandlast-updated, andpathsif scoped. End with a## Relatedsection listing the articles consulted, as paths. - Reverse links: add the new article's path to the Related section of its main sources, and update their
last-updated. - Index: add its line to
_index.md, whether it's scoped or on-demand. - Log: append
```markdown ## [{date}] query | {topic}
- Question: "{the question}"
- Consulted: {articles}
- Filed as: {path}
```
- Report the path, load mode, tags and links added.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/ai-knowledge/skills/kb-query/SKILL.md
Popularity
- Repository stars
- 32
- Repository forks
- 3
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/charlesjones-dev/claude-code-plugins-dev/kb-query)