agentleFS
walkwithediwalkwithedi/evergreen-wiki/skills/kb-query/SKILL.md

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

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
  1. Distinctive:

    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).

    line 10
  2. Very specific:

    Read references/environment.md only when Python cannot run or a library folder cannot be reached, and references/backend-local.md only when …

    line 18
  3. Distinctive:

    If unsure whether a question falls in a library, read that library's spec Table A to check.

    line 25
  4. Distinctive:

    Never use a file ID or path from memory.

    line 55
  5. Distinctive:

    Search cap: at most 8 searches or select runs for one library and 4 more for each extra library.

    line 56
  6. Distinctive:

    Every statement of fact is followed by a quote line with the exact sentence it rests on and its link:

    line 60
  7. Distinctive:

    Use the standard terms (Table B, Table E).

    line 72
  8. Distinctive:

    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:

    line 80
  9. Distinctive:

    Never answer from memory: search the library first.

    line 88
  10. Distinctive:

    Every statement of fact is followed by a quote line with the exact source sentence and its link.

    line 89
  11. Distinctive:

    Never rely on a status-card item marked for review.

    line 90
  12. Very specific:

    Write nothing except a status-card update the user confirmed, through ingest.py status-check.

    line 91

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. A question unrelated to every library's scope (general knowledge, writing, code): do not search; answer normally.
  2. Match the question against each library's scope (from the instructions line, or the registry). Search the libraries that fit.
  3. Unclear, or more than one could hold the answer: search every library that might, without asking.
  4. If unsure whether a question falls in a library, read that library's spec Table A to check; still unsure, treat as rule 3.
  5. 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 aboutRead
the current state of something: conclusions, owners, numbers, dates, statusthe status card, then the cards and topic pages behind it
one topic in general, how it developedthe topic page (names.topics_dir), newest first
details, the exact wording, a whole documentthe cards, then the source file (names.sources_dir) at the card's anchor
how a term is written, whether a name is standardspec Table B (term fixes) and Table E (entities and their aliases)
open issuesspec Table C
which partition or topic a subject belongs tospec Table A
whether some material is in the librarythe 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:

  1. Never use a file ID or path from memory; use what the search returns.
  2. 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]]

  1. 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.
  2. 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.
  3. A status-card item marked for review (⏳) is not relied on: answer from the cards and sources instead, and go on to step 5.
  4. A card from an earlier version (restored by the owner) says so; say so in the answer too.
  5. A source paragraph that is not on a card is quoted the same way, with "(not on a card)" after the link.
  6. A card or paragraph marked "only some keywords" may be about something else: quote it only when it answers the question itself.
  7. 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.
  8. Use the standard terms (Table B, Table E); if the user used another form, give the standard one with theirs in brackets once.
  9. Nothing found: say which libraries and keywords were searched and conclude "nothing found in the knowledge base".
  10. 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:

  1. 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.
  2. 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.
  3. 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

  1. Never answer from memory: search the library first; what it does not record is "not recorded in the knowledge base".
  2. 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.
  3. Never rely on a status-card item marked for review; answer from the cards and sources.
  4. 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.
  5. Stay inside the chosen library root; never use a file ID or path from memory.
  6. Replies follow the library language and preferences.output.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.