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.10+
  • 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-0.1.0.tar.gz (53.3 kB view details)

Uploaded Source

Built Distribution

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

docuchango-0.1.0-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for docuchango-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d33b429fa35f68ae9df338fc0b92b3a77039f9f79b6e15502e0033f887d33e92
MD5 53f4e34b53bd60d394b7bcfb1aef4034
BLAKE2b-256 9b9102ab6db5be0f3e6ff19f1845c9c975a4e549bff1bd746d21bbeb9159e78d

See more details on using hashes here.

Provenance

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

Publisher: publish.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-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for docuchango-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2cb6d3d90a70836d23ea709d31993acd28e3455d399ad5cbe3892feb61685485
MD5 970642c4a5cc3777094e0b9516b50736
BLAKE2b-256 40b9175ee6a507abe6fe57bd48b86f657e6bb87f9a7fa274ceed58dd809b5f13

See more details on using hashes here.

Provenance

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

Publisher: publish.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