Docs compliance checks before every commit.
A Rust CLI that enforces documentation standards in projects using structured markdown. Checks that your CHANGELOG.md has recent entries, your ARCHITECTURE.md has required sections, your tickets have valid types, and your Discovery Reports follow the expected format. Single binary, zero runtime dependencies.
cargo install --git https://github.com/aspelldenny/docs-gateOr from source:
git clone https://github.com/aspelldenny/docs-gate.git
cd docs-gate
cargo install --path .# Run core checks (changelog + architecture)
docs-gate
# Run all checks including ticket type validation
docs-gate --all
# Auto-generate config from your project layout
docs-gate init| Command | Description |
|---|---|
| (default) | Run core checks (changelog + architecture) |
check-discovery <file> |
Validate Discovery Report format in a file |
serve |
Start MCP server on stdio transport |
init |
Scan project and generate .docs-gate.toml |
| Flag | Description |
|---|---|
--all |
Include ticket type checks |
--watch |
Re-run checks on file changes (Ctrl+C to exit) |
--verbose |
Show passing checks in output |
--config <path> |
Path to config file |
| Check | What it verifies |
|---|---|
changelog |
CHANGELOG.md has a recent entry (date + content) |
architecture-section-count |
ARCHITECTURE.md has the required number of sections |
architecture-section-{N} |
Specified sections are non-empty |
ticket-type |
Ticket files contain a valid type classification |
discovery |
Discovery Report follows the expected 4-section format |
| Code | Meaning |
|---|---|
| 0 | All checks passed |
| 1 | One or more checks failed |
| 2 | Usage error |
Optional .docs-gate.toml in project root. Run docs-gate init to generate one automatically.
docs_dir = "docs"
changelog = "CHANGELOG.md"
architecture = "ARCHITECTURE.md"
required_sections = 9
required_non_empty = [7, 8, 9]
changelog_max_age_days = 1
[ticket]
ticket_dir = "docs/ticket"
valid_types = ["read-only", "mutating", "destructive"]
exclude_files = ["TEMPLATE.md"]All fields are optional. Without a config file, sensible defaults apply.
docs-gate can run as an MCP server, letting AI assistants call docs checks as tools.
docs-gate serveAdd to claude_desktop_config.json:
{
"mcpServers": {
"docs-gate": {
"command": "docs-gate",
"args": ["serve"],
"cwd": "/path/to/your/project"
}
}
}Available MCP tools: check_changelog, check_architecture, check_discovery, check_all.
# .git/hooks/pre-commit
#!/bin/sh
docs-gate- Rust 1.85+ (edition 2024)
v0.1 -- functional and tested, used in production workflows. API may evolve.
- Fork the repo
- Create a feature branch
- Run
cargo test && cargo clippy -- -D warningsbefore submitting - Open a PR against
main
MIT -- see LICENSE.