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.
npx agentmods add commands/ethics03/kgskill/kg-querygit clone --depth 1 https://github.com/Ethics03/kgskillWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00021 | $0.00559 |
| Opus 5 | $0.00010 | $0.00280 |
| Sonnet 5 | $0.00004 | $0.00112 |
| Haiku 4.5 | $0.00002 | $0.00056 |
Grade A, and why
kg-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.
What it actually says
Answer the user's question by searching and synthesizing knowledge from the wiki. This is not a grep — read pages, follow links, and produce a synthesized answer with wikilink citations.
Steps
1. Resolve KG path
Check in order: $MYKG_PATH env var → ~/.config/mykg/config → ~/.mykgrc → common locations (~/MyKG, ~/Dev/Obsidian/MyKG). If not found, tell the user to run /kg-setup first.
2. Handle utility subcommands
If the query is one of these, handle it directly and stop:
active— read and displayActive.mdrecent— readlog.mdand show the last 10 entriesdecisions <project>— read<project>/Decisions/README.mdand list ADRs; offer to read any in fullplan <project>— list files in<project>/Plans/and offer to read any
3. For all other queries — synthesize from the wiki
This is the main path.
3a. Find relevant pages
Read index.md. Scan the catalog for pages relevant to the query — entities, concepts, synthesis, comparisons, source summaries. Pick the most relevant ones.
3b. Read and follow
Read the selected pages. Follow [[wikilinks]] to related pages where they add depth. Keep reading until you have enough to answer well — typically 3–8 pages.
3c. Synthesize an answer
Write a real answer, not a list of file contents. Integrate what you found across pages. Use [[Page Name]] citations inline so the user knows where claims come from.
3d. Note conflicts
If pages contradict each other on a relevant point, surface the contradiction explicitly rather than picking one silently.
4. Offer to file the answer back
After answering, ask: "Should I save this as a wiki page?" Good candidates:
- A comparison or analysis that took multiple pages to synthesize
- A connection between concepts that isn't captured anywhere yet
- An answer that would save time on a future query
If yes, write it to the appropriate location (wiki/synthesis/, wiki/comparisons/, etc.), update index.md, and append to log.md:
## [YYYY-MM-DD] query | <Question>
- Synthesized: [[wiki/synthesis/<slug>]]
- Sources: [[wiki/X]], [[concepts/Y]]
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.
- 2d ago First seen · 55 lines · 0 tokens per session scan A bb55674915c3
kg-query is a command published in the GitHub repository Ethics03/kgskill (3 stars, last pushed 4mo ago), licensed MIT. It adds 21 tokens to every session and 559 once invoked, about $0.0001 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-31.
Other commands, from other repositories
plan-review
The core plan review flow across Claude Code, Codex, and other supported agent hosts.
plannotator-review
Open interactive code review for current changes or a PR URL.
wiki-graph
Build the LLM Wiki knowledge graph.
wiki-ingest
Ingest a source document into the LLM Wiki.
docs-builder
Reorg a docs corpus, split an oversized doc, search it, keep pages current, index them.
live-canvas
Conduct design interviews, generate UI variations, and collect live click-to-annotate feedback that streams into the session so edits land without leaving the browser. Use when the user wants rapid iterative UI refinement, not just batched feedback.