kmd-librarian

kmd-librarian is an agent for coding agents from yasik/kmd. It costs 91 tokens per session (614 once invoked), scanned A, original, MIT.

A librarian agent for maintaining a Markdown knowledge base, a collection of linked text notes and sources.

In plain words
What is it for?
Use it for scheduled health checks, linting, audits, and cleanup after adding many new sources.
Why use it?
It finds broken links, invalid metadata, stale or conflicting pages, duplicates, unprocessed sources, and index problems that can reduce trust in the knowledge base.

Agent

Part of the kmd plugin — 2 skills, 3 agents, 2 hooks shipped together

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 agents/yasik/kmd/kmd-librarian
Clone the repo
git clone --depth 1 https://github.com/yasik/kmd

Or install kmd, the plugin that ships this one along with the rest of its 2 skills, 3 agents, 2 hooks.

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 kmd-librarian

README.md
[![agentmods](https://agentmods.dev/badge/agents/yasik/kmd/kmd-librarian.svg)](https://agentmods.dev/agents/yasik/kmd/kmd-librarian)
Your own site
<a href="https://agentmods.dev/agents/yasik/kmd/kmd-librarian"><img src="https://agentmods.dev/badge/agents/yasik/kmd/kmd-librarian.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 614 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.1 $0.00091 $0.00614
Opus 5 $0.00046 $0.00307
Sonnet 5 $0.00018 $0.00123
Haiku 4.5 $0.00009 $0.00061

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

Security

Grade A, and why

kmd-librarian 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.

agents/kmd-librarian.md · 51 lines

How it starts

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

You are the librarian of a markdown knowledge base. Drift is the KB's primary failure mode, and you are the counter-force: your job is to find rot before query-time trust erodes, fix what is mechanical, and surface what needs judgment to whoever owns it.

Locate the KB root the way the skills do: an explicit path from the task > $KMD_ROOT > a .kmd.json at the workspace root > a directory containing schema.md/log.md > the default kb/.

Protocol

Run the kmd-lint skill end to end — all three phases, every time:

  1. Mechanicallint_mechanical.py --report (broken links, invalid frontmatter/provenance, source tampering, unreferenced sources, orphans, unlogged changes, oversized pages).
  2. Judgment — the four passes the script cannot do: contradictions between pages (highest severity — a self-contradicting KB is worse than none), staleness against newer sources, near-duplicates to merge, confidence downgrades for thin provenance.
  3. Triage & resolution — fix what is mechanical and judgment-free directly (each fix follows the kmd-ingest protocol and is logged with --action lint); everything else becomes concrete open items in the report's Resolution section for the KB owner. If the installation declares the org extension (see the kmd-lint skill's references/org-extension.md), route instead of recording: judgment calls to page authors' inboxes, intake work to the owning agent per ORG.md.

Complete the report (all three sections), append one log.md entry via kb_log.py, and verify by re-running the mechanical script — the pass isn't done until errors are zero or explicitly resolved as open items.

Boundaries

You repair structure and surface judgment; you do not rewrite page content wholesale (that is a re-ingest), never touch sources/ beyond restoring tampered files to their committed state, never hand-edit index.md, and never silently pick a side in a contradiction.

Return format

Read the full file on GitHub · 51 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 · 51 lines · 91 tokens per session scan A f5059674aabd

Subscribe to this mod's changes

kmd-librarian is an agent published in the GitHub repository yasik/kmd (2 stars, last pushed 1mo ago), licensed MIT. It adds 91 tokens to every session and 614 once invoked, about $0.0005 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.

Related

Other agents, from other repositories

researcher

Sub-agent dispatched by /mb:research. Has WebFetch + WebSearch + Read + MCP researchsave + searchwiki tools. Cannot Edit/Write directly — research findings flow through mindbaseresearchsave (append-only to sources/research/).

frankchu91/mindbase-llm-wiki · 54 tokens

nauro-planner

Use to plan a non-trivial change before any code is written. Classifies doctrine risk (GREEN/AMBER/RED) via Nauro, writes a structured plan, and drafts decision additions, updates, or supersedes for the direct-user Delivery parent. Returns a plan and never writes project truth or edits files.

Nauro-AI/nauro · 69 tokens

engineer

Use this agent when you need to implement features, fix bugs, or write code anywhere in the Code Insights monorepo. This includes CLI commands, dashboard components (Vite + React SPA), Hono server routes, SQLite schema changes, provider implementations, LLM provider integration, UI work with shadcn/ui, and any…

melagiri/code-insights · 307 tokens

journey-chronicler

Use this agent to capture pivotal learning moments, breakthroughs, course corrections, and insights during development. Invoke when detecting learning signals like "I just realized...", "Turns out...", "That didn't work because...", or when a debugging breakthrough or process innovation occurs.

melagiri/code-insights · 56 tokens

timps_ai_workflow_orchestrator

Turn a plain-English multi-step workflow into executable code for LangGraph, Temporal, or Claude-Flow — plus a Mermaid diagram and tests. Use the timpsaiworkfloworchestrator MCP tool to perform this task. Do not answer directly — delegate to this sub-agent.

Sandeeprdy1729/timps-swarm · 67 tokens

timps_cli_tool_agent

Generate Click/Cobra/Commander CLI tools with shell completions and release workflows. Use the timpsclitoolagent MCP tool to perform this task. Do not answer directly — delegate to this sub-agent.

Sandeeprdy1729/timps-swarm · 49 tokens