kb-query

A tool for answering questions from a project knowledge bundle, which is a structured collection of linked Markdown notes. It finds the relevant notes and assembles an answer from them instead of searching the entire bundle each time.

In plain words
What is it for?
Use it to look up project facts, compare documented concepts, explore connections, or consult existing knowledge before making a decision. It follows links between the bundle's index and its relevant notes.
Why use it?
It keeps answers grounded in information the project has already collected. It can also add relevant bundle context to another task when the repository contains useful knowledge.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/stjbrown/agent-knowledge/kb-query
Any agent
npx skills add stjbrown/agent-knowledge --skill kb-query
Clone the repo
git clone --depth 1 https://github.com/stjbrown/agent-knowledge

Made for: Claude Code, Codex.

Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,243 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00077 $0.01243
Opus 5 $0.00039 $0.00622
Sonnet 5 $0.00015 $0.00249
Haiku 4.5 $0.00008 $0.00124

Measured 2d ago against content hash 8811d6d108e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

kb-query scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/kb-query/SKILL.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

kb-query — answer from the bundle

Answer a question from a knowledge bundle, or surface relevant bundle context for another task. Because synthesis was front-loaded during ingest or repository documentation, this is mostly navigation and assembly, not rediscovery. Read ../kb/references/glossary.md for terms.

Two modes, same procedure:

  • Explicit — the user asks a knowledge question ("what do we know about X?", "compare A and B").
  • Ambient — you're doing another task and a bundle in the repo has relevant context; consult it before answering from scratch, then return to the task.

1. Locate the bundle(s)

Find the bundle root (a knowledge/ dir, or an index.md with okf_version). If knowledge/ holds several bundles, read knowledge/index.md and pick the relevant one(s); a query may span more than one. If no bundle exists, say so and stop (offer kb-init).

Completion criterion: the relevant bundle root(s) are identified.

2. Navigate by progressive disclosure

Do not read the whole bundle. Read the root index.md first, then the relevant section index.md, to find candidate concepts; follow cross-links from there. Read only concepts relevant to the question. (At large scale a search tool may exist — use it to find candidates, but the retrieved unit is still a synthesized concept, not a raw chunk.)

Completion criterion: you have the specific concepts that bear on the question, reached by following the index and links rather than scanning.

3. Read with currency and conflict awareness

Apply the reading side of the trust model and the version profile:

  • If a concept is retired (status: deprecated in OKF v0.2 or legacy status: superseded), follow superseded_by to the current version and answer from that (use the old one only if the user asks how something evolved).
  • If concepts are linked by conflicts_with, read the anchor and all linked signals and answer with nuance — separate what authoritative sources confirm from what softer signals suggest, with dates and sources. Do not flatten a contested question into a single yes/no.
  • If today >= stale_after, label the concept stale and corroborate it before relying on it. Use generated.at for v0.2 recency and fall back to legacy timestamp only when generated is absent.
  • Derive the advisory trust tier from verified: no verifier is unverified, non-human verifiers are machine-confirmed, and any human: verifier is human-reviewed. Never treat a tier as access control.
  • Resolve claim footnotes through matching sources[].id; when sources is absent, a v0.2 consumer may fall back to a legacy # Citations section.
  • For type: Attested Computation, distinguish recorded definition verification from per-run attestation. Do not execute or alter its computation unless the user separately authorizes the declared executor path; never present an unattested runtime value as attested.

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 96 lines · 77 tokens per session scan A 8811d6d108e8

Subscribe to this mod's changes

kb-query is a skill published in the GitHub repository stjbrown/agent-knowledge (32 stars, last pushed 1mo ago), licensed MIT. It adds 77 tokens to every session and 1,243 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

okf-authoring

Author Open Knowledge Format (OKF) bundles — knowledge represented as a directory of markdown files with YAML frontmatter. Use when asked to create, write, generate, enrich, or validate an OKF bundle or OKF concept docs; to turn a data source (Glue database, API, database, catalog), documentation, or a research topic…

aws-samples/sample-okf-llm-wiki · 102 tokens

refresh-okf-mcp-token

Fetch or refresh an OAuth2 access token for the OKF Data wiki consumption MCP server. Use when the OKF MCP server returns 401/403/unauthorized/expired-token errors, when the user asks to refresh, renew, or get a new OKF MCP token, or when setting up authentication to call the okf-mcp / okfconsumption MCP runtime.

aws-samples/sample-okf-llm-wiki · 83 tokens

report-authoring

The report-authoring methodology: required structure, language, evidence discipline, and figure selection. Read BEFORE your first createreport of a conversation - the tool validates shape; this is everything it cannot check.

aws-samples/sample-okf-llm-wiki · 44 tokens

setup

Set up the OKF MCP plugin — outputs a guide for the user to create their /.okf/credentials file with their OAuth2 client id/secret. Use when first enabling the plugin, when headersHelper fails with "Missing credentials", or when the user says "setup okf".

aws-samples/sample-okf-llm-wiki · 60 tokens

openkb-deck-neon

Use when the user asks the openkb chat to make a deck / slide presentation / PPT / slides / 演示稿 / 幻灯片 from their compiled KB content AND wants a dark, high-tech, neon / glow / glassmorphism look (赛博 / 科技风 / 暗色 / 霓虹 / 炫酷). Generates a polished single-file HTML deck in the Aurora Glass visual direction (near-black…

VectifyAI/OpenKB · 173 tokens

openkb-deck-editorial

Use when the user asks the openkb chat to make a deck / slide presentation / PPT / slides / 演示稿 / 幻灯片 from their compiled KB content. Generates a polished single-file HTML deck in the Editorial Monocle visual direction (warm cream background, serif type, brick-red accent) — designed to be opened in a browser…

VectifyAI/OpenKB · 117 tokens