Document Validation

August 12, 2026 · View on GitHub

Module: scripts/docflow-validate.sh, skills/validate/ Entry: /docflow:validate (or just ask — the validate skill triggers)

Architecture

ComponentRole
Validator scriptResolves docs root, scans Markdown files, prints errors/warnings, and sets the exit code
Doctor integrationRuns validation read-only and summarizes pass/fail without changing doctor exit behavior
Scaffold/repair wiringInstalls docflow-validate.sh into target repos with the other helper scripts
Command/skill wrappersTell Claude and Codex to run validation before reporting docs complete

Data

SignalSourceSeverity
Broken local linkscheck-links.sh outputError
Stale INDEX.mdGenerated map comparisonError
Missing H1Markdown scanError
Unsupported category pathRelative doc pathError
Placeholder leakageKnown template tokens outside template pathsError
Template placeholdersFresh scaffold/template pathsWarning
Missing metadata comment<!-- docflow: ... --> absenceWarning
Missing update logContent docs without ## Update Log or feature/changelog logWarning

API

SurfaceBehavior
bash scripts/docflow-validate.sh --target <repo>Validates repo docs root from docflow.json or common docs folders
--docs-root <root>Overrides docs root detection
Exit 0No validation errors
Exit 1One or more blocking errors
Exit 2Invalid command usage or target access failure

Flow

  1. Resolve target and docs root.
  2. Compare current INDEX.md to an in-memory generated map.
  3. Run the existing local link checker.
  4. Scan every Markdown file for H1, path category, metadata, placeholders, update logs, and required sections.
  5. Print Status, Errors, and Warnings.
  6. Return a non-zero exit only when Errors is non-empty.

Risks

RiskMitigation
Adopted legacy docs lack metadataReport as warnings first, not blockers
Fresh scaffold contains placeholdersWarn for known template paths while blocking placeholder leakage elsewhere
Command docs use angle-bracket argumentsSkip placeholder checks for stable references and naming docs
Validation drifts from map generationReuse the same H1/path algorithm as docflow-map.sh

Related:

Update Log

DateChangeRef
2026-06-14Added validation gate specification.docflow-validate
2026-08-12Superseded exact-template enforcement for established repositories with the adopted profile defined in the adoption-aware validation spec.adoption-aware-validation