Skip to main content

CLI-first Markdown structure checker for repositories

Project description

docguard

CLI-first Markdown structure checker for repositories.

Docguard helps teams keep documentation from growing too large, becoming unreachable from index files, or drifting away from expected document types such as ADRs.

Quick start

Install from PyPI as docguard-structure (CLI command remains docguard; this is not the unrelated docguard-cli package). Use uv add docguard-structure, then run uv run docguard --summary. Existing uv users can upgrade with uv add --upgrade docguard-structure; see Update an existing uv install. Equivalent with pip: pip install docguard-structure. Git-based install: usage guide — Install from Git.

Run docguard init for a starter [tool.docguard] snippet, or use the strict baseline without configuration. Full install commands, configuration, pytest integration, and exit codes: usage guide. To adopt docguard in another repository, see Use in another repository.

docguard --summary

What this tool checks

Docguard focuses on document structure and repository health. Prose style checks (DG-STYLE001, DG-STYLE002) flag decorative strong emphasis and conversational phrasing in body text; they are not a general Markdown formatter.

With no configuration, docguard applies the strict baseline: scan README.md, CONTEXT.md, and docs; require reachability from README.md; enforce 300-line documents, 120-line sections, and a 20-line floor for untyped non-index documents; and fail duplicate guidance plus prose style diagnostics as errors. Any relaxation from that baseline must be recorded in [[tool.docguard.relaxations]] with a reason.

Phase What you can check Diagnostics Typical default
Core Document and section size; stub detection; typed document shape; index reachability; prose style DG-SIZE001, DG-SIZE002, DG-SIZE003, DG-FORMAT001, DG-FORMAT003, DG-ORG003, DG-STYLE001, DG-STYLE002 strict baseline, error
Phase 2 Link structure between files: orphans and hub dead ends DG-ORG001, DG-ORG002 opt-in, warning
Phase 3 Structure inside each file: mixed roles and heading level skips DG-SPLIT001, DG-FORMAT002 opt-in, warning
Duplicate guidance Repeated commands, list guidance, or prose paragraphs across the scan scope; headings and paragraphs opt-in DG-SPLIT002 strict baseline, error

Phase 2 details: organization rules. Phase 3 and duplicate guidance details: structure rules. Prose style details: prose style rules. To adopt docguard in another repository, see Use in another repository.

Development

Requires Python 3.11+ and uv on PATH:

uv pip install -e ".[dev]"
uv run pytest
uv run docguard README.md CONTEXT.md docs/ --summary

Documentation

Status

Alpha (Development Status :: 3 - Alpha). Configuration keys, diagnostic JSON fields, and rule defaults may change; breaking changes are recorded in CHANGELOG.md. Exit codes and existing diagnostic meanings are preserved where practical.

Docguard 0.3.0 uses a strict baseline by default. Relaxations require [[tool.docguard.relaxations]] entries with reasons. Release readiness is documented in docs/release-readiness.md.

Repository navigation

Relative links for clone checkouts and docguard reachability checks:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docguard_structure-0.3.0.tar.gz (54.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docguard_structure-0.3.0-py3-none-any.whl (36.6 kB view details)

Uploaded Python 3

File details

Details for the file docguard_structure-0.3.0.tar.gz.

File metadata

  • Download URL: docguard_structure-0.3.0.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for docguard_structure-0.3.0.tar.gz
Algorithm Hash digest
SHA256 764835b8829727870f89aa4c80a3a19a66c54dde9eb3ec2da7883074243af7b5
MD5 183053c798ae36c206c95a769aacd6eb
BLAKE2b-256 c6a986caa7aafc2ea1381a1d98d899d77e74816ead12993c4e80b989b1ef617c

See more details on using hashes here.

Provenance

The following attestation bundles were made for docguard_structure-0.3.0.tar.gz:

Publisher: publish.yml on takuto-NA/docguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file docguard_structure-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for docguard_structure-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 595011731584182a8a862ee229d01f430aaf45d6fbf582efbcbf6a23dbb71b08
MD5 c230f8bb69d49cf80222ff5c2adb06eb
BLAKE2b-256 ad00ec9807cf0d2920563e58c5b4c8da38e0121cef38a5e6d9d8281a24d35f32

See more details on using hashes here.

Provenance

The following attestation bundles were made for docguard_structure-0.3.0-py3-none-any.whl:

Publisher: publish.yml on takuto-NA/docguard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page