skills/kb-query/SKILL.md
Query a knowledge base topic and optionally file the answer.
npx skillsauth add notque/claude-code-toolkit kb-queryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Answer a question using the compiled wiki for a knowledge base topic. Reads relevant articles from the wiki, synthesizes an answer, and optionally files the response as a permanent query record that feeds back into the next compile cycle.
/kb query {topic} "{question}"
/kb query {topic} "{question}" --no-file
{topic} — directory name under research/ (e.g., llm-security){question} — the question to answer (quoted string)--no-file — output only to conversation, do not save a query fileGoal: Confirm the topic exists and load its index.
{topic}, {question}, and whether --no-file was specified.research/{topic}/kb.yaml — if it does not exist, stop and report: "Topic {topic} not found. Run python3 scripts/kb-init.py {topic} to initialize it."research/{topic}/wiki/_index.md — this is the full index of compiled concepts and source summaries. If it does not exist, stop and report: "Wiki index not found for {topic}. Run /kb compile {topic} first."Goal: Select the wiki articles most likely to contain the answer.
Using only the _index.md (do NOT read individual articles yet), identify the 3-10 most relevant concept and/or source articles for this question.
For each selected article, note:
research/{topic}/wiki/Prefer concept articles for questions about ideas, patterns, or mechanisms. Prefer source articles for questions about specific documents, papers, or implementations.
If the index contains no obviously relevant entries, select the closest 3 and note the uncertainty.
Goal: Read the selected articles and produce a comprehensive answer.
[Source: concept-name](concepts/concept-name.md) or [Source: source-slug](sources/source-slug.md)Do NOT draw on general knowledge when the KB has relevant content. Prefer KB sources. If you must supplement with general knowledge (because the KB is silent on a point), mark it clearly: "(from general knowledge, not in KB)".
Goal: Persist the query and answer as a permanent wiki record.
If --no-file was specified: output the answer to the conversation and stop. Do not save any file.
Otherwise:
Derive a slug from the question:
what-is-prompt-injectionGet today's date in YYYY-MM-DD format.
Write the answer to research/{topic}/wiki/queries/{date}-{slug}.md with this structure:
---
query: "{the exact question asked}"
date: "{ISO 8601 timestamp, e.g. 2026-04-02T14:30:00}"
sources_consulted:
- concepts/relevant-concept.md
- sources/relevant-source.md
filed: true
---
# {the question, as a title}
{the full synthesized answer, with inline citations}
Populate sources_consulted with the relative paths (within wiki/) of every article you read during Phase 3.
research/{topic}/wiki/queries/{date}-{slug}.md. It will be incorporated into concept articles during the next /kb compile {topic} run."Do NOT answer from general knowledge if the KB has relevant content. The point of the system is to build and use a local knowledge base. Bypassing it defeats the flywheel.
Do NOT read every wiki file. Use the _index.md to select relevant articles. Reading every file wastes time and context on irrelevant material.
Do NOT write query files longer than 1500 words. If the answer requires more than that, it is probably two separate questions. Answer the specific question asked.
Do NOT omit sources_consulted. This field is the data the flywheel uses during the next compile run. An empty or incomplete list breaks the feedback loop.
Do NOT skip filing unless --no-file was explicitly specified. Filed queries accumulate domain knowledge. Each one makes the next query better.
documentation
Document translation: quick/normal/refined modes with chunked parallel subagents and glossary support.
development
AI image generation: Gemini and Nano Banana backends; single/series/batch workflows with prompt-to-disk.
testing
Unified voice content generation pipeline with mandatory validation and joy-check. 13-phase pipeline: LOAD, GROUND, STATS-CHECKPOINT, GENERATE, HOOK-GATE, VALIDATE, REFINE, VARIETY-GATE, JOY-CHECK, ANTI-AI, CLOSE-GATE, OUTPUT, CLEANUP. Use when writing articles, blog posts, or any content that uses a voice profile. Use for "write article", "blog post", "write in voice", "generate content", "draft article", "write about".
documentation
Critique-and-rewrite loop for voice fidelity validation.