Build docs

From CERTCC/Vultron · View interactive version

Build docs is an AI agent skill from the GitHub repository CERTCC/Vultron. Run mkdocs build with strict validation to ensure documentation builds cleanly and all links are valid.

How to use this skill

Skill file

Skill: Build Docs with mkdocs in Strict Mode

Purpose

Validate that documentation builds cleanly without real warnings or broken links using

mkdocs build --strict. This ensures the documentation site is correct before

committing changes to docs/ directory files.

When the docs/ directory is modified, mkdocs build --strict MUST pass with

zero real warnings before code is staged for commit. CI enforces the same

constraint: both docs-build-check.yml and deploy_site.yml build through

.github/actions/build-site, which runs a plain mkdocs build --strict

(DOCBW-03-009, DOCBW-06-004). CI suppresses nothing, so a warning

this script forgives below still fails CI; the suppression list exists only for

the griffe false positives, which are absent from the current build.

Note: This skill automatically suppresses false-positive warnings from griffe

that result from Python decorators being misinterpreted as bibliography citations

(e.g., @dataclass, @main.command, @prefix). Real documentation errors are

still reported and must be fixed.

Inputs

be executed.

Outputs

stdout/stderr (exit status indicates success/failure). A successful build

prints "Successfully built docs!" and exits with code 0. A build with

real warnings exits with code 1 and prints the warning count.

Procedure

  1. From the repository root, run the build script:
uv run python .agents/skills/shared/run-heavy.py .github/scripts/mkdocs-build-strict.sh
  1. Inspect the output. Any broken links, missing anchors, or other real issues

are printed as WARNING lines to stdout. False-positive warnings from griffe

decorators are automatically suppressed.

  1. Fix all reported real issues in the docs/ files and re-run the command until

it exits with code 0.

  1. Serve the released drafts' frozen pages into site/spec/, as CI's

serve-frozen-drafts action does between the build and the checks below

(DOCBW-08-028, DOCBW-08-035):

register=$(mktemp)
PYTHONPATH='' uv run drafts-register show > "$register"
python3 -I .github/scripts/serve_frozen_drafts.py \
  --register "$register" --site site --repo CERTCC/Vultron

The build never writes site/spec/ (DOCBW-08-034), but the Revision Log

links each released draft's frozen copy at spec/draft-N/. Without this

step, docs-links reports every such link as unresolved. The script reads

the drafts' release assets through gh, so it needs gh authenticated.

Run it once per build: a second run fails DOCBW-08-034 on the pages its first

run served, so rebuild with the first step before running it again.

  1. Check the publication axis against the built site, with the frozen drafts

served into it:

PYTHONPATH='' uv run docs-withheld
PYTHONPATH='' uv run docs-legacy-urls

docs-withheld fails when an artifact the project declared withheld

produced files in site/ (DOCBW-03-005). docs-legacy-urls fails when a

URL an earlier publish served no longer resolves as a page or a redirect

(DOCBW-03-008). The fix for a moved page is a redirect_maps entry in

mkdocs.yml. A page withdrawn on purpose gets a declaration in

vultron/metadata/docs/withheld.py instead. Both checks read the built tree,

so they only mean anything after the build and the frozen-drafts step

succeeded. Both the pull-request workflow and deploy_site.yml run them

through the check-site-publication action, so a failure here is a failure

that would have blocked the deploy.

The same action also runs

PYTHONPATH='' uv run docs-legacy-urls --require-recorded (DOCBW-03-012).

It needs no site/: it fails when a page the checked-out commit builds is

missing from vultron/metadata/docs/legacy_urls_baseline.txt. A new page

— _-prefixed fragments included — goes live at the next deploy, so it is

due in the baseline in the pull request that adds it. The fix

is to commit the page, run uv run docs-legacy-urls --snapshot HEAD, and

commit the updated baseline on the same branch.

  1. Check the reference axis against the same build:
PYTHONPATH='' uv run docs-links

This resolves every internal href/src on every page in site/ and

fails on any that points at a file the build did not produce, printing each

as <page>: <reference> (DOCBW-03-007). It covers what --strict cannot:

links printed by markdown-exec blocks, links to withheld pages, and pages

nothing links to. Both workflows run it, unconditionally, through the same

check-site-publication action.

  1. Stage changes only after every command above exits cleanly with zero code.

Constraints / Rules

target file (including auto-generated anchors from headings)

to catch markdown syntax issues early.

script, never before: they read site/, and they fail rather than pass when

that directory is absent or empty.

Examples

# Build docs in strict mode (required when docs/ changes)
uv run python .agents/skills/shared/run-heavy.py .github/scripts/mkdocs-build-strict.sh

Rationale

Validating documentation builds during development prevents broken links and

build failures from reaching CI. The --strict flag treats warnings as errors,

ensuring high quality documentation. This skill provides a discoverable,

reproducible invocation matching CI behavior, reducing surprise failures and

improving documentation quality. The script suppresses false-positive griffe

warnings while maintaining strict validation of real documentation issues.

False-Positive Warnings Suppressed

The script automatically suppresses the following false-positive warnings:

These occur when griffe's docstring parser encounters Python decorators and

misinterprets them as bibliography citations. They are harmless and do not

indicate documentation problems.

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.