Skip to content

feat(tools): add documentation audit CLI tool#576

Merged
kcenon merged 1 commit into
mainfrom
feat/issue-567-doc-audit-tool
Apr 4, 2026
Merged

feat(tools): add documentation audit CLI tool#576
kcenon merged 1 commit into
mainfrom
feat/issue-567-doc-audit-tool

Conversation

@kcenon

@kcenon kcenon commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add Python CLI documentation audit tool (tools/doc-audit/) with 4 modular checkers: metadata validation, internal link checking, SSOT registry consistency, and README structure compliance
  • Supports --quick mode for CI (metadata + structure only), --ecosystem mode for all 8 projects, and --format flag for markdown/json/both output
  • Validates YAML frontmatter fields, doc_id format (PREFIX-CAT-NNN), broken internal links (with code block skip), SSOT registry table parsing, and 13 standard README sections

Tool Structure

tools/doc-audit/
├── __init__.py          # Package init (v1.0.0)
├── __main__.py          # CLI entry point (argparse)
├── config.py            # Constants, regex patterns, field definitions
├── models.py            # Finding, CheckResult, AuditReport dataclasses
├── checker_metadata.py  # YAML frontmatter validation
├── checker_links.py     # Internal link and anchor validation
├── checker_ssot.py      # SSOT registry consistency
├── checker_structure.py # README standard section compliance
├── report.py            # Markdown and JSON report generation
└── utils.py             # File discovery, path resolution, heading extraction

Usage

python -m tools.doc-audit /path/to/project              # Full audit
python -m tools.doc-audit /path/to/project --quick       # Fast CI check
python -m tools.doc-audit /path/to/sources --ecosystem   # All 8 repos
python -m tools.doc-audit /path/to/project --format json # JSON output

Test plan

  • Tested --quick mode on common_system (7 findings detected correctly)
  • Tested --ecosystem mode across all 8 repos (54 findings in quick mode)
  • Tested --format json output (valid JSON, correct finding counts)
  • Tested full mode with link + SSOT checkers (code block skip working)
  • Verified exit code 1 on critical findings, 0 otherwise

Closes #567

Add Python CLI tool (tools/doc-audit/) with 4 checkers for validating
documentation quality across the kcenon ecosystem:

- checker_metadata: YAML frontmatter validation (required fields,
  doc_id format, semver, ISO 8601 dates, status enum, duplicates)
- checker_links: Internal markdown link and anchor validation with
  code block skip to avoid false positives from C++ lambdas
- checker_ssot: SSOT registry consistency (file existence, doc_id
  match, unlisted file detection)
- checker_structure: README.md standard section compliance (13 sections)

CLI supports --quick (metadata+structure only), --format (markdown/json/both),
and --ecosystem (audit all 8 projects) flags. Exit code 1 on critical findings.

Closes #567
@kcenon kcenon merged commit 1a7bd3b into main Apr 4, 2026
34 checks passed
@kcenon kcenon deleted the feat/issue-567-doc-audit-tool branch April 4, 2026 05:30
kcenon added a commit that referenced this pull request Apr 13, 2026
Add Python CLI tool (tools/doc-audit/) with 4 checkers for validating
documentation quality across the kcenon ecosystem:

- checker_metadata: YAML frontmatter validation (required fields,
  doc_id format, semver, ISO 8601 dates, status enum, duplicates)
- checker_links: Internal markdown link and anchor validation with
  code block skip to avoid false positives from C++ lambdas
- checker_ssot: SSOT registry consistency (file existence, doc_id
  match, unlisted file detection)
- checker_structure: README.md standard section compliance (13 sections)

CLI supports --quick (metadata+structure only), --format (markdown/json/both),
and --ecosystem (audit all 8 projects) flags. Exit code 1 on critical findings.

Closes #567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Build ecosystem documentation audit tool

1 participant