docguard.init

A command for setting up Canonical-Driven Development, a way of keeping a project's key documentation as a maintained source of truth. It creates the initial documentation structure and selects a project profile, such as a web app, library, command-line tool, or prototype.

In plain words
What is it for?
Initializing documentation in a new or existing codebase, choosing the correct documentation profile, and declaring project-specific collections whose counts should match the code.
Why use it?
New or undocumented projects lack a consistent place to record how they work. This command creates the required starting files and adapts them to the kind of project being documented.

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/raccioly/docguard/docguard.init
Clone the repo
git clone --depth 1 https://github.com/raccioly/docguard
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 603 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.00012 $0.00603
Opus 5 $0.00006 $0.00302
Sonnet 5 $0.00002 $0.00121
Haiku 4.5 $0.00001 $0.00060

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

Security

Grade A, and why

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

templates/commands/docguard.init.md · 82 lines

How it starts

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

/docguard.init — Set Up CDD Documentation

You are an AI agent initializing Canonical-Driven Development (CDD) for a new or existing project.

Step 1: Initialize Skeleton Files

npx docguard-cli init

This creates the folder structure and template files. The templates are skeletons — they need real content.

Step 2: Pick the Right Profile

init auto-detects the project type, but verify the profile fits — it sets which docs are required (a CLI shouldn't be forced to document an HTTP API):

Signal Profile in .docguard.json
Has bin field / CLI tool "profile": "cli"
Publishable package "profile": "library"
Side project / prototype "profile": "starter"
Team web app / API "profile": "standard" (default)
Regulated / strict "profile": "enterprise"

Only schema-valid keys belong in .docguard.json — check schemas/docguard-config.schema.json (shipped in the package) before adding anything. If the project has domain collections (extractors, plugins, rules…), declare them so documented counts are verified against code: "collections": { "extractors": "src/extractors/*.py" }.

For an EXISTING codebase, prefer reverse-engineering over blank skeletons:

npx docguard-cli generate --plan --write

This pre-fills code-truth sections (routes, schemas, env vars) and leaves you an agent-task list for the prose.

Step 3: Write Real Documentation

For each canonical document, generate a research prompt and write real content:

npx docguard-cli fix --doc architecture
npx docguard-cli fix --doc data-model
npx docguard-cli fix --doc security
npx docguard-cli fix --doc test-spec
npx docguard-cli fix --doc environment

For each: read the output, execute RESEARCH STEPS, then write with real project content.

Step 4: Verify

npx docguard-cli guard
npx docguard-cli score

All checks should pass. Report the final score.

Step 5: Set Up Git Hooks (Optional)

Read the full file on GitHub · 82 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 · 82 lines · 12 tokens per session scan A 1fa832c34622

Subscribe to this mod's changes

docguard.init is a command published in the GitHub repository raccioly/docguard (27 stars, last pushed 4d ago), licensed MIT. It adds 12 tokens to every session and 603 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.