theme-format

A design specification for a future `ki theme` command that would print groups of related vault documents. It defines a self-explanatory output format, but the command is marked as not implemented.

In plain words
What is it for?
Use it as a format reference when implementing or reviewing `ki theme`; it does not currently provide a working command.
Why use it?
It describes how the command’s output should be understandable without a separate glossary or guide.

Command

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 commands/zach-blumenfeld/knowledge-index/theme-format
Clone the repo
git clone --depth 1 https://github.com/zach-blumenfeld/knowledge-index
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,635 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.00000 $0.02635
Opus 5 $0.00000 $0.01318
Sonnet 5 $0.00000 $0.00527
Haiku 4.5 $0.00000 $0.00264

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

Security

Grade A, and why

theme-format 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.

docs/commands/theme-format.md · 125 lines

How it starts

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

Theme format for ki theme

⚠️ Status: DRAFT — not yet implemented. ki theme does not exist as a command yet; this is a design doc, not a description of shipping behavior. Format only — how themes are computed (clustering, GDS vs not, ingest vs read time) is out of scope; this pins down what the output looks like in a context window. Companion to docs/commands/outline.md; reuses its row conventions.

Design rule: self-explanatory like outline. No jargon labels that need a guide. Every label is a plain-English phrase that defines its own content, and every count carries its unit inline (in 31 docs, never ×31). A reader (human or agent) seeing the output cold should have no open questions about what a line means.

ki never names a theme (no LLM at ingest/read; #17 rules). Each block carries the evidence an agent needs to name the theme itself, plus full URIs to drill with (ki outline <uri> / ki get <uri>, verbatim round-trip — same contract as outline).

ki theme writes to stdout. Pipe to save; no output-format flag.

Layout

Header

THEMES  <vault-name>   <N> docs · <G> grouped into <K> themes by wikilinks · <U> ungrouped
  • by wikilinks is the method statement, in plain words. If the producer degrades (link-sparse vault, capability missing), the phrase changes — e.g. grouped into 6 themes by folders — so differently-derived clusters are never presented identically.
  • <U> ungrouped is always printed, even when 0 — it stops an agent from overclaiming coverage (187 grouped ≠ "the vault is about these K things"). N = G + U always reconciles; the reader can derive coverage % themselves, so none is printed.
  • · <E> excluded is appended only when the run excluded docs (hub pages like CLAUDE.md / index.md dropped from the whole analysis via --exclude). Excluded docs leave the <N> denominator entirely — the segment exists so that removal is visible, never silent.
  • (showing top <K> — <H> smaller themes cover <D> more docs) is appended when a top_k cut is active. The cut is display-only: the hidden themes remain real (and keep their themeIds in the graph) — they are not folded into ungrouped, so <G> still counts them. Crossover lines pointing at hidden themes are suppressed (no dangling T<j> references). Intended first-use pattern: an agent wanting a lay-of-the-land asks for a small top_k, reads the header to see how much theme mass is below the cut, and widens only if needed.
  • Doc counts cover internal md docs only; stubs are excluded.

Read the full file on GitHub · 125 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 · 125 lines · 0 tokens per session scan A 3e2266ff5663

Subscribe to this mod's changes

theme-format is a command published in the GitHub repository zach-blumenfeld/knowledge-index (6 stars, last pushed 8d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,635 tokens. 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.