kb-init

A tool that creates the starting files for an OKF knowledge bundle, a structured set of Markdown documents used as a project wiki. It can place the bundle in the default knowledge folder or in a requested location.

In plain words
What is it for?
Use it when starting a new project wiki or adding a separate knowledge bundle. It helps create the index, schema, seed content, and producer information required by the bundle format.
Why use it?
It avoids manually setting up the folder structure and required metadata. It also checks whether a bundle already exists so existing content is not overwritten.

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-init
Any agent
npx skills add stjbrown/agent-knowledge --skill kb-init
Clone the repo
git clone --depth 1 https://github.com/stjbrown/agent-knowledge

Made for: Claude Code, Codex.

Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,527 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.00027 $0.01527
Opus 5 $0.00014 $0.00763
Sonnet 5 $0.00005 $0.00305
Haiku 4.5 $0.00003 $0.00153

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

Security

Grade A, and why

kb-init 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-init/SKILL.md · 111 lines

How it starts

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

kb-init — scaffold a knowledge bundle

Scaffold a conformant bundle per kb. Your unique work is the schema layer (step 2) and adapting the seed (step 3).

Read the version profile before writing. New bundles target OKF v0.2. Read the glossary if the terms below are unfamiliar.

1. Resolve location and bundle name

Default to a bundle at knowledge/. Accept overrides from the user's request:

  • A different path (e.g. docs/kb) → scaffold there instead.
  • A named bundle (e.g. "a ci bundle") → scaffold at knowledge/<name>/ and treat knowledge/ as a multi-bundle folder: ensure a top-level knowledge/index.md exists that catalogs the bundles (create it if missing; add this bundle to it).

If the target directory already contains a bundle (a root index.md), stop and report it — do not overwrite. Offer kb-document for repository documentation or kb-ingest for captured sources.

Choose an honest producer actor for generated.by: the current agent/tool as <producer>/<version>, never human:<id> unless the human actually authored the content.

Completion criterion: the target path, bundle name, and producer actor are fixed, and the target is confirmed not to collide with an existing bundle.

2. Understand the domain before scaffolding

The scaffold is deterministic; the schema layer needs judgment, so gather it first. Inspect the workspace for signal (README, existing docs, the code, any notes the user points at), determine whether this is a repository-documentation or captured-source bundle, and ask the user only what you still can't infer:

  • What kind of knowledge will this bundle hold? (work context — people, deals, product; a research corpus you keep adding papers to; a codebase or product handbook; competitive landscape; a book/course you're studying; a spec or pattern you're documenting, like this repo's OKF bundle, …)
  • What are the main entities — the recurring things worth a concept each? These become the type vocabulary (e.g. person, deal, metric; or character, chapter, theme).
  • For a captured-source bundle: what raw sources will be ingested, how should they route to those entities, and which intake locations are explicitly managed?
  • For repository documentation: which parts of the repository are in scope, and how should components, workflows, interfaces, operations, and decisions route? Repository files remain evidence in place and are not raw intake.

Read the full file on GitHub · 111 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 · 111 lines · 27 tokens per session scan A baf2c91f8a0d

Subscribe to this mod's changes

kb-init is a skill published in the GitHub repository stjbrown/agent-knowledge (32 stars, last pushed 1mo ago), licensed MIT. It adds 27 tokens to every session and 1,527 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-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

wegent-knowledge

Knowledge base management and search tools for Wegent. Provides capabilities to list, create, update, and search knowledge bases and documents using RAG retrieval. Use this skill when the user wants to manage knowledge bases, documents, or search for information programmatically.

wecode-ai/Wegent · 51 tokens

llm-wiki

Build and maintain a persistent, interlinked Obsidian-compatible markdown wiki using Karpathy's LLM Wiki pattern. Extension-backed with auto-generated metadata, guardrails, and 14 custom tools (+3 opt-in agent-trajectory tools).

zosmaai/pi-llm-wiki · 52 tokens