docs

A command that creates or updates GitHub documentation for a project in two stages: first a review and plan, then the document writing. It checks existing files and project guidance before drafting.

In plain words
What is it for?
Use it to create or refresh a README and related project documentation, optionally limited to a subdirectory. Resume a previously prepared brief with the `continue` option.
Why use it?
It gives you a chance to review the documentation plan before files are written. It also adapts its work when documentation or a previous brief already exists.

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/drobins25/craft/craft-docs
Clone the repo
git clone --depth 1 https://github.com/drobins25/craft
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,094 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.00039 $0.03094
Opus 5 $0.00019 $0.01547
Sonnet 5 $0.00008 $0.00619
Haiku 4.5 $0.00004 $0.00309

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

Security

Grade A, and why

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

commands/craft-docs.md · 380 lines

How it starts

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

Docs

Generate quality GitHub documentation for any craft project. Uses the crystallized doc-writer agent for both analysis and writing. Two passes - brief then generate - with a human gate in between.

Project Root

Use $CRAFT_PROJECT_ROOT (set at session start) as the base path. If not set, resolve by walking up from PWD to find the nearest .craft/.global-state.

Set PROJECT to ${CRAFT_PROJECT_ROOT:-.}.

Flow

Step 0: Determine Run Context

Parse args:

  • "continue" - Resume from an existing brief. Jump to Step 3.
  • "--scope=path" - Scope the analysis to a subdirectory. Store as SCOPE.
  • No args - Full project analysis.

Step 1: Detect State

Check what already exists:

# Check for existing brief
BRIEF="$PROJECT/.craft/docs/brief.md"

# Check for existing docs
README=$(ls "$PROJECT"/README.md "$PROJECT"/README.MD 2>/dev/null | head -1)
DOCS_DIR=$(ls -d "$PROJECT"/docs/ 2>/dev/null)

Also check for craft-specific sources of truth:

  • $PROJECT/CLAUDE.md
  • $PROJECT/.craft/design/locked.md
  • $PROJECT/.craft/project.md

If an unapproved brief exists (status: draft in frontmatter):

Use AskUserQuestion:

question: "Found a draft brief from {date}."
header: "Resume"
options:
  - label: "Continue with this brief"
    description: "Review and approve the existing brief"
  - label: "Start fresh"
    description: "Generate a new brief"

If "Continue" -> Jump to Step 2e (Present Brief). If "Start fresh" -> Continue to Step 2 (Investigate).

Determine mode based on what exists:

  • No README, no docs/ -> MODE=first-run
  • README or docs/ exists -> MODE=update

Step 2: Investigate Documentation Health

Create the brief directory:

mkdir -p "$PROJECT/.craft/docs"
Step 2a: Gather Context

For update mode, gather git changes since the last docs run:

LAST_DOCS_DATE={date from existing brief frontmatter, e.g. 2026-04-17}
GIT_LOG=$(git log --oneline --since="$LAST_DOCS_DATE" -- . ':!.craft/cycles' ':!.craft/backlog')
GIT_DIFF_STAT=$(git diff $(git log --since="$LAST_DOCS_DATE" --format="%H" --reverse -- . | head -1)^..HEAD --stat -- . ':!.craft/cycles' ':!.craft/backlog' 2>/dev/null || echo "Unable to compute diff stat")

Read the full file on GitHub · 380 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 · 380 lines · 39 tokens per session scan A bec4dae3a2b5

Subscribe to this mod's changes

docs is a command published in the GitHub repository drobins25/craft (53 stars, last pushed 3d ago), licensed MIT. It adds 39 tokens to every session and 3,094 once invoked, about $0.0002 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.