kb-compile

kb-compile is a command for Claude Code from eddiebelaval/squire. It costs 0 tokens per session (1,123 once invoked), scanned A, original, MIT.

A tool that turns raw source files into a structured Markdown knowledge base with concept articles, source summaries, and articles connecting related ideas. It can process only new sources or rebuild the whole knowledge base.

In plain words
What is it for?
Use it to scan a knowledge base, process uncompiled sources, perform full recompiles, and show compilation status.
Why use it?
Raw research files are difficult to browse and connect. Compiling them into linked articles makes the collected information easier to use.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths.

Good fit Use it to scan a knowledge base, process uncompiled sources, perform full recompiles, and show compilation status.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/eddiebelaval/squire/kb-compile
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.

Clone the repo
git clone --depth 1 https://github.com/eddiebelaval/squire

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kb-compile

README.md
[![agentmods](https://agentmods.dev/badge/commands/eddiebelaval/squire/kb-compile/github.svg)](https://agentmods.dev/commands/eddiebelaval/squire/kb-compile)
Your own site
<a href="https://agentmods.dev/commands/eddiebelaval/squire/kb-compile"><img src="https://agentmods.dev/badge/commands/eddiebelaval/squire/kb-compile/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kb-compile

Your own site · 80×15
<a href="https://agentmods.dev/commands/eddiebelaval/squire/kb-compile"><img src="https://agentmods.dev/badge/commands/eddiebelaval/squire/kb-compile.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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 1,123 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01123
Opus 5 $0.00000 $0.00562
Sonnet 5 $0.00000 $0.00225
Haiku 4.5 $0.00000 $0.00112

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

Security

Grade A, and why

kb-compile 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 5d 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.

commands/kb-compile.md · 119 lines

How it starts

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

/kb-compile -- Knowledge Base Compiler

You are the knowledge compiler for id8Labs. You read raw sources and compile them into a structured .md wiki with concept articles, source summaries, and connection articles.

Arguments: $ARGUMENTS


Route by Arguments

Parse $ARGUMENTS:

Input Action
<kb-name> Incremental compile (process new raw sources only)
<kb-name> --full Full recompile (regenerate all wiki articles from raw)
status Show compile status for all KBs
(empty) Show compile status for all KBs

Setup

  1. Read ~/Development/id8/knowledge/manifest.json to locate the target KB
  2. Resolve the KB path: ~/Development/id8/knowledge/{kb.path}/
  3. Read the skill reference: ~/.claude/skills/knowledge/SKILL.md for article templates and conventions
  4. Read {kb}/wiki/_index.md to understand current wiki state

Compile Process

Step 1: Inventory Raw Sources

Scan {kb}/raw/ recursively for all files. For each file:

  • Check frontmatter for processed: true/false
  • If --full flag: ignore processed status, process everything
  • If incremental (default): only process files where processed: false or no frontmatter

For the design KB: raw sources are DESIGN.md files inside raw/design-md/. Each site directory is one source. Also include raw/MCM-DIGITAL-DESIGN-RESEARCH.md as a source.

For the research KB: raw sources are in raw/ plus the registries at wiki/registries/ contain the compiled knowledge. Generate concept articles from findings, not just raw files.

Step 2: Generate Source Summaries

For each unprocessed raw source, create a summary in wiki/sources/:

  • File name: {slug}.md (kebab-case from source title)
  • Content: Follow the Source Summary template from SKILL.md
  • Extract: Key claims, concepts mentioned, relationships to existing concepts
  • Use Obsidian [[wikilinks]] for all internal references

Step 3: Extract and Cluster Concepts

Read the full file on GitHub · 119 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. 5d ago First seen · 119 lines · 0 tokens per session scan A 3aed40f83501

Subscribe to this mod's changes

kb-compile is a command published in the GitHub repository eddiebelaval/squire (21 stars, last pushed 23d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,123 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-09-03.