Skip to main content

Docusaurus validation and repair framework for opinionated micro-CMS documentation, designed for human-agent collaboration workflows

Project description

Docuchango

CI codecov Python Version License: MPL 2.0

Code style: ruff Type checked: mypy Code quality: strict Maintenance Development Status

Validate and fix Docusaurus documentation. Checks frontmatter, links, code blocks, and formatting.

flowchart LR
    A[docs-cms/] --> B{docuchango}
    B -->|validate| C[✓ Report errors]
    B -->|fix| D[✓ Fixed docs]
    D --> E[Docusaurus]
    E -->|build| F[📚 Static site]

    style A fill:#f9f,stroke:#333
    style B fill:#bbf,stroke:#333
    style C fill:#bfb,stroke:#333
    style D fill:#bfb,stroke:#333
    style E fill:#feb,stroke:#333
    style F fill:#bfb,stroke:#333

Quick Start

1. Bootstrap a docs-cms Project

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install docuchango
curl -sSL https://raw.githubusercontent.com/jrepp/docuchango/main/install.sh | bash

# View bootstrap guide
docuchango bootstrap

# View agent instructions
docuchango bootstrap --guide agent

# View best practices
docuchango bootstrap --guide best-practices

2. Validate and Fix Documentation

# Validate
docuchango validate

# Fix issues
docuchango fix all

Example Usage

# Run validation
$ docuchango validate --verbose

📂 Scanning documents...
   Found 23 documents

✓ Validating links...
   Found 47 total links

❌ DOCUMENTS WITH ERRORS (2):
   adr/adr-001.md:
    Missing field: 'deciders'
    Invalid status: 'Draft'

# Fix automatically
$ docuchango fix all
    Fixed 12 code blocks
    Removed trailing whitespace
    Added missing frontmatter

Document Structure

docs-cms/
├── adr/              # Architecture Decision Records
│   ├── adr-001-*.md
│   └── adr-002-*.md
├── rfcs/             # Request for Comments
│   └── rfc-001-*.md
├── memos/            # Technical memos
│   └── memo-001-*.md
└── prd/              # Product requirements
    └── prd-001-*.md

Each doc needs frontmatter:

---
id: "adr-001"
title: "Use Click for CLI"
status: Accepted
date: 2025-01-26
deciders: Engineering Team
tags: ["cli", "framework"]
project_id: "my-project"
doc_uuid: "..."
---

Schema Structure

graph TD
    A[Document] --> B[Frontmatter]
    A --> C[Content]

    B --> D[Required Fields]
    B --> E[Optional Fields]

    D --> F[id: adr-001]
    D --> G[title: string]
    D --> H[status: Literal]
    D --> I[date/created]
    D --> J[tags: list]
    D --> K[project_id]
    D --> L[doc_uuid: UUID]

    C --> M[Markdown Body]
    C --> N[Code Blocks]
    C --> O[Links]

    style A fill:#bbf,stroke:#333
    style B fill:#feb,stroke:#333
    style C fill:#bfb,stroke:#333
    style D fill:#fbb,stroke:#333

Templates & Docs:

Features

  • Validates frontmatter (required fields, valid formats)
  • Checks links (internal, relative, broken refs)
  • Fixes automatically (whitespace, code blocks, frontmatter)
  • Fast (100 docs in < 1s)
  • CI-ready (exit codes, clear errors)

Commands

# Validate everything
docuchango validate

# Validate with verbose output
docuchango validate --verbose

# Skip slow build checks
docuchango validate --skip-build

# Fix all issues
docuchango fix all

# Fix specific issues
docuchango fix code-blocks
docuchango fix links

# CLI shortcuts
dcc-validate        # Same as docuchango validate
dcc-fix            # Same as docuchango fix

Python API

from docuchango.validator import DocValidator
from docuchango.schemas import ADRFrontmatter

# Validate
validator = DocValidator(repo_root=".", verbose=True)
validator.scan_documents()
validator.check_code_blocks()
validator.check_formatting()

# Use schemas
adr = ADRFrontmatter(**frontmatter_data)

Development

# Setup
uv sync
pip install -e ".[dev]"

# Test
pytest
pytest --cov=docuchango
pytest -n auto  # Parallel (for large test suites)

# Lint
ruff format .
ruff check .
mypy docuchango tests
actionlint  # Lint GitHub Actions workflows

# Build
uv build

Documentation

  • Templates - Starter files for ADR, RFC, Memo, PRD
  • ADRs - Architecture decisions
  • RFCs - Technical proposals

Requirements

  • Python 3.9+
  • Works on macOS, Linux, Windows

License

Mozilla Public License Version 2.0 (MPL-2.0) - See LICENSE file

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

Links

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

docuchango-1.3.2.tar.gz (80.8 kB view details)

Uploaded Source

Built Distribution

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

docuchango-1.3.2-py3-none-any.whl (87.1 kB view details)

Uploaded Python 3

File details

Details for the file docuchango-1.3.2.tar.gz.

File metadata

  • Download URL: docuchango-1.3.2.tar.gz
  • Upload date:
  • Size: 80.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for docuchango-1.3.2.tar.gz
Algorithm Hash digest
SHA256 ea9c412e2bca00da51904c55d1bc62b6ef341d0582521a172e49dafd259f8428
MD5 e70256d4dfe6816cf996c4ba792c8108
BLAKE2b-256 a6e960d8e47b3cb2b1c23e91b4c846daf2759c515893d0a098d1937a6bf589af

See more details on using hashes here.

Provenance

The following attestation bundles were made for docuchango-1.3.2.tar.gz:

Publisher: release.yml on jrepp/docuchango

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

File details

Details for the file docuchango-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: docuchango-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 87.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for docuchango-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b6be6b1a7d81262da2952d55b266ca720c0d66a55c376060cf3a5c62170b4d9
MD5 05fcdde5ebad2254317cbf0e9455bde9
BLAKE2b-256 6fa9069afb4f957a085b5a9bb3fe4b32cc4b3e93db977baa5213e8525d90e170

See more details on using hashes here.

Provenance

The following attestation bundles were made for docuchango-1.3.2-py3-none-any.whl:

Publisher: release.yml on jrepp/docuchango

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