docs-builder

A command-line tool for organising, splitting, searching, and updating a collection of project documentation.

In plain words
What is it for?
Use it to reorganise a docs collection, split oversized pages, search documentation, update stale content, and index pages.
Why use it?
It keeps documentation easier to find and current when files become too large or scattered, while noting that better structure does not automatically reduce reading effort.

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/hamr0/agentic-toolkit/docs-builder
Clone the repo
git clone --depth 1 https://github.com/hamr0/agentic-toolkit
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 14,466 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00023 $0.14466
Opus 5 $0.00012 $0.07233
Sonnet 5 $0.00005 $0.02893
Haiku 4.5 $0.00002 $0.01447

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

Security

Grade A, and why

docs-builder 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.

Origin

This is a copy

100% identical to docs-builder — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

ai/subagentic/ampcode/commands/docs-builder.md · 903 lines

How it starts

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

docs-builder

Keep project docs current, complete and findable, and split a file when it outgrows its row in docs/index.md.

The honest label: this does NOT make docs cheaper to read. Measured four ways; best case is a tie with doing nothing. Cost tracks findings, not structure — better navigation raises how thorough an agent is willing to be, it does not cut reading. The winning arm wins because synthesis caps cost: the pages already did the reading. Never sell this as a token saving.

Every mechanical step is docs-builder/docs-builder.cjs (vanilla Node, zero deps). A model is used for exactly two things: proposing themes, and writing pages. Bookkeeping done by a script is 100% correct; done by a model it was 27%.

Model tiers — never hardcode a vendor model name

step tier why
propose + assign themes cheapest tier structured labelling against a fixed list; no synthesis
write pages mid tier semantic synthesis, cheaper/faster than your top reasoning tier

Use whatever your tool designates as that tier. The measured numbers below were taken on Claude's Haiku 4.5 (cheap) and Sonnet 5 (mid) in August 2026 — the ratios and shapes carry over, the absolute prices do not.


Invocation

Locate the script first. docs-builder.cjs is bundled next to this command at docs-builder/docs-builder.cjs — the same directory as this file, whether installed or run from the package. Never search the target repo for it, never reconstruct it from this spec, and if it truly exists nowhere say so and stop. Set DB to its ABSOLUTE path, then cd to the target repo's root:

DB=<absolute path to docs-builder.cjs>
cd <target repo root>

Every command below is node $DB …; everything the script writes (docs/.docs-builder/* JSON state, docs/index.md, the ledger, the log, the config pointer) lands under the target repo. REPO= is optional and only needed when not running from the repo root.

Read the full file on GitHub · 903 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 · 903 lines · 23 tokens per session scan A f37b490e6e9b

Subscribe to this mod's changes

docs-builder is a command published in the GitHub repository hamr0/agentic-toolkit (22 stars, last pushed 2d ago), licensed Apache-2.0. It adds 23 tokens to every session and 14,466 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to docs-builder, differing in 0 lines, and is treated as a copy.