kb-query
Skill2 starsChanged 32 days agoMITView on GitHub
Answers questions from the user's own knowledge base (an evergreen library in a local or Obsidian folder) by searching it, never from memory; every fact is followed by the exact source sentence it rests on, with a link to it, and when nothing is found it says where it looked. Use only when the user asks to search or check the knowledge base, or a message says to use kb-query. Examples: "Check the knowledge base: when is the launch date?", "Look up in my knowledge base who owns Project Atlas". Other questions, including ones a library might record, are answered without this skill. Writes nothing except a status-card update the user confirmed; ingesting and setup belong to kb-ingest, saving notes to kb-note.
6 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- Iabstergo1/pdf-to-study-kbtheir own version, first seen Nov 7, 2026
- janezslapnik/llm-wiki-kbtheir own version, first seen Nov 1, 2026
- walkwithedi/drive-wikiedited, first seen Nov 1, 2026
- davidmatousek/tachitheir own version, first seen Oct 10, 2026
- viniciusbedum/vb-ai-contexttheir own version, first seen Sep 25, 2026
- tjkuhns/explodabletheir own version, first seen Apr 19, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- walkwithedi/drive-wiki★ 115% same
Wrote their own version · 5
- davidmatousek/tachi★ 95same name
- Iabstergo1/pdf-to-study-kb★ 2same name
- viniciusbedum/vb-ai-context★ 2same name
- janezslapnik/llm-wiki-kb★ 1same name
- tjkuhns/explodable★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- grillingSkill
- grill-meSkill
- skill-creatorSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- webapp-testingSkill
- kb-ingestSkill
- kb-noteSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 10 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Search, read and answer. The only file this skill ever changes is the status card, and only after the user confirmed the change (step 5).
- Very specific: line 18
Read references/environment.md only when Python cannot run or a library folder cannot be reached, and references/backend-local.md only when …
- Distinctive: line 25
If unsure whether a question falls in a library, read that library's spec Table A to check.
- Distinctive: line 55
Never use a file ID or path from memory.
- Distinctive: line 56
Search cap: at most 8 searches or select runs for one library and 4 more for each extra library.
- Distinctive: line 60
Every statement of fact is followed by a quote line with the exact sentence it rests on and its link:
- Distinctive: line 72
Use the standard terms (Table B, Table E).
- Distinctive: line 80
When the answer rests on cards or sources because the status card has no item for a recurring question, or its item is marked for review:
- Distinctive: line 88
Never answer from memory: search the library first.
- Distinctive: line 89
Every statement of fact is followed by a quote line with the exact source sentence and its link.
- Distinctive: line 90
Never rely on a status-card item marked for review.
- Very specific: line 91
Write nothing except a status-card update the user confirmed, through ingest.py status-check.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Knowledge base questions
Version: 6.5.2
Search, read and answer. The only file this skill ever changes is the status card, and only after the user confirmed the change (step 5). Partitions, topics, terms and entities are read from the library, never from this file.
Before starting
- Libraries: the instructions line names each library, its scope and its folder ("I keep knowledge bases:
<label>(<scope>) at<folder>"). Use those folders and do not look for a registry. Without such a line, read references/config.md and find the registry as it says. - Scripts: paths such as scripts/answer.py are relative to this skill's folder. Run a script by its full path in the skill's folder, one command per call, with no pipes, redirections or chained commands; put text arguments in quotes.
- Work folder (
<work>): a temporary directory outside the library, so that answering never writes into it. - Replies: in the library language (_kb.json language, else the user's language); plain text without Markdown when the instructions line or preferences.output asks for it.
- Read references/environment.md only when Python cannot run or a library folder cannot be reached, and references/backend-local.md only when searching without Python.
Step 1: which library
- A question unrelated to every library's scope (general knowledge, writing, code): do not search; answer normally.
- Match the question against each library's scope (from the instructions line, or the registry). Search the libraries that fit.
- Unclear, or more than one could hold the answer: search every library that might, without asking.
- If unsure whether a question falls in a library, read that library's spec Table A to check; still unsure, treat as rule 3.
- Ingesting and setup requests belong to kb-ingest; "note this" belongs to kb-note.
For each library searched, read its _kb.json. A _kb.json of schema 1 is a 1.x library: say that this release does not read it and that the 1.x release does. Start the answer with: Library: <label(s)>.
Step 2: where answers come from
| Question about | Read |
| the current state of something: conclusions, owners, numbers, dates, status | the status card, then the cards and topic pages behind it |
| one topic in general, how it developed | the topic page (names.topics_dir), newest first |
| details, the exact wording, a whole document | the cards, then the source file (names.sources_dir) at the card's anchor |
| how a term is written, whether a name is standard | spec Table B (term fixes) and Table E (entities and their aliases) |
| open issues | spec Table C |
| which partition or topic a subject belongs to | spec Table A |
| whether some material is in the library | the sources folder, by name |
Never use ignored files: the archive folder; names that start with an underscore; names that start with snapshot_prefix; names that contain old_suffix followed by a time stamp (the scripts skip them already). The archive folder holds superseded versions: search it only when the user asks for an old version, and say the result is superseded.
Step 3: find the material
Pick the question's keywords: names, terms (the standard form from Table B and the user's form), numbers, dates.
python3 scripts/answer.py select <library root> <keyword> [<keyword> ...]
It lists the status-card items holding a keyword (items marked for review say so), then the cards and the source paragraphs the keywords point to, at most 15 together, each with its quote and source link. Those holding every keyword come first, ranked by relevance with newer documents slightly ahead; when fewer than five hold every keyword, those holding only some follow, marked "only some keywords". A keyword that names an entity of Table E counts for all its aliases; a keyword that names a topic brings that topic's cards. Paragraphs are marked as not on a card; those of sources without cards yet also say so ("source without cards yet": filed, their cards still to be written). Answer only from what it lists. When it finds nothing, try once more with other forms of the keywords, then answer as not found.
Without Python: search yourself, inside the library root only. Status card first (read it whole when it is under 8000 characters), then the cards and topic pages with find_by_text; read a source file only at the paragraph a card cites, or whole when the question needs the whole document.
Rules:
- Never use a file ID or path from memory; use what the search returns.
- Search cap: at most 8 searches or select runs for one library and 4 more for each extra library. Then answer as not found.
Step 4: answer
Every statement of fact is followed by a quote line with the exact sentence it rests on and its link:
The pilot was extended to 2026-04-27.
The steering group approved extending the pilot by two weeks, to 2026-04-27. [[Sources/Meetings/Atlas steering minutes 2026-03-13#^p2]]
- Quote character for character from a card's quote or the source paragraph, with the link the card or select gives. Never shorten, translate or reword a quote; the statement above it says it in your words, in the library language.
- Priority: the status card, then cards and topic pages, then source paragraphs. When they disagree, give each with its quote and say which is newer; do not decide who is right.
- A status-card item marked for review (⏳) is not relied on: answer from the cards and sources instead, and go on to step 5.
- A card from an earlier version (restored by the owner) says so; say so in the answer too.
- A source paragraph that is not on a card is quoted the same way, with "(not on a card)" after the link.
- A card or paragraph marked "only some keywords" may be about something else: quote it only when it answers the question itself.
- Numbers and dates exactly as written, with units and the time they refer to; no conversion or estimate. No inference: what the library does not record is "not recorded in the knowledge base". If general knowledge is really needed, put it in a separate paragraph headed "not from the knowledge base", without quotes.
- Use the standard terms (Table B, Table E); if the user used another form, give the standard one with theirs in brackets once.
- Nothing found: say which libraries and keywords were searched and conclude "nothing found in the knowledge base".
- Answer only what was asked; mention the search only when nothing was found or sources conflict. Replies follow the library language and preferences.output.
Write the answer to <work>/answer.md first and run python3 scripts/answer.py check <library root> <work>/answer.md. Exit 3 lists the quotes not found in their linked paragraph: copy each again from the card or paragraph, exactly, and check once more; a quote that still fails is removed together with its statement. Then reply with the answer.
Step 5: status-card update (only with the user's confirmation)
When the answer rests on cards or sources because the status card has no item for a recurring question, or its item is marked for review:
- After the answer, propose the item: one numbered line in the status card's own style, citing the passages the answer quoted ([[Sources/
<source>#^pN]]), and for a marked item the text that replaces it (without the mark). Ask whether to write it; never write without a yes. - On yes: copy the status card to
<work>/status-card.md and make the change there. Run python3 scripts/ingest.py status-check --old<status card>--new<work>/status-card.md. It lists removed and changed items and source links no longer cited: show that list to the user. When they accept it, run the same command with --write --confirmed --library<library root>. Change nothing else on the card. - Without Python, do not change the status card (hard rule 4); give the proposed line for the user to add by hand or through kb-ingest.
Hard rules
- Never answer from memory: search the library first; what it does not record is "not recorded in the knowledge base".
- Every statement of fact is followed by a quote line with the exact source sentence and its link; never shorten, translate or reword a quote.
- Never rely on a status-card item marked for review; answer from the cards and sources.
- Write nothing except a status-card update the user confirmed, through ingest.py status-check. Without a code environment (Python), write nothing to the library and say so; reading and answering still work.
- Stay inside the chosen library root; never use a file ID or path from memory.
- Replies follow the library language and preferences.output.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

