Keep code and documentation in sync with centralized linking and section-aware staleness detection
Project description
menard is a pre-commit hook and CLI tool that deterministically flags when code changes should trigger documentation updates. It outputs agent-friendly JSON with targeted information about what changed and which doc sections need review.
When working fast with tools like Claude, docs drift quickly. Agents excel at changing code but struggle to understand how code changes should trigger doc updates. menard addresses this with deterministic checks.
📚 Full docs | Getting Started | CLI Reference
Core Use Cases
1. Track Doc Drift
Define code → doc relationships in .menard/links.toml. menard uses git diffs to detect stale docs. Section-level tracking means changes to one part of a file won't trigger full doc rewrites.
git commit -m "refactor auth"
# ❌ Blocked: docs/api.md#Authentication unchanged since src/auth.py changed
2. Flag Protected Content Changes
Use .menard/donttouch to define sections that shouldn't be edited. Avoid accidental changes by over-eager agents with automatic warnings.
git commit -m "update requirements"
# ⚠️ Warning: Protected literal changed
# "Python 3.10+" → "Python 3.9+"
# This is protected in .menard/donttouch
3. Audit for Deterministic Maintainability
Use the audit skill to analyze how easily your docs can be maintained with deterministic checks. Get concrete suggestions for links.toml additions, donttouch protections, and restructuring.
> Audit my documentation
4. Find Duplicate Content
Use menard brevity to find semantically similar sections across your docs using local embeddings. No API keys needed—runs entirely on your machine.
menard brevity --threshold 0.95
# README.md#License ↔ docs/index.md#License (1.00)
# README.md#Quick Start ↔ docs/getting-started.md#Quick Start (0.96)
Quick Start
# Install
uv add menard
# Initialize
menard init
# Audit docs for trackability (in Claude Code)
> Audit my documentation and apply the suggestions
# Auto-generate convention-based links
menard bootstrap --apply
# Validate and check coverage
menard validate-links
menard coverage
# Set up pre-commit hook
# See: https://nlebovits.github.io/menard/getting-started/#pre-commit-setup
pre-commit install
# Optional: Find duplicate content with embeddings
uv add menard[brevity]
menard brevity --threshold 0.95
License
Apache-2.0
Contributing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file menard-0.4.0.tar.gz.
File metadata
- Download URL: menard-0.4.0.tar.gz
- Upload date:
- Size: 428.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a556e615189c3fbd41abcd1fc3772fb3fc77ed82534a3f96d1644b7afcfec358
|
|
| MD5 |
3c5dff25e0b7c8c1729ec6ef555e7abd
|
|
| BLAKE2b-256 |
ef718aad44096c0e25ab0e7762d909351d7478e474d557d24434a67173b12a37
|
Provenance
The following attestation bundles were made for menard-0.4.0.tar.gz:
Publisher:
release.yml on nlebovits/menard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
menard-0.4.0.tar.gz -
Subject digest:
a556e615189c3fbd41abcd1fc3772fb3fc77ed82534a3f96d1644b7afcfec358 - Sigstore transparency entry: 1224578600
- Sigstore integration time:
-
Permalink:
nlebovits/menard@89b653a1d42a5e5ffe737d63f8599559855e1f09 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nlebovits
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@89b653a1d42a5e5ffe737d63f8599559855e1f09 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file menard-0.4.0-py3-none-any.whl.
File metadata
- Download URL: menard-0.4.0-py3-none-any.whl
- Upload date:
- Size: 62.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4c4d23b6092870277762a390e2ea4fa1d0a0012076a872d09d321c36c462101
|
|
| MD5 |
173cb9236879247b0223b974346d8e55
|
|
| BLAKE2b-256 |
55d7570ca032d366546160aa551ab372ee16436f71befa4c354f1541050ec543
|
Provenance
The following attestation bundles were made for menard-0.4.0-py3-none-any.whl:
Publisher:
release.yml on nlebovits/menard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
menard-0.4.0-py3-none-any.whl -
Subject digest:
b4c4d23b6092870277762a390e2ea4fa1d0a0012076a872d09d321c36c462101 - Sigstore transparency entry: 1224578654
- Sigstore integration time:
-
Permalink:
nlebovits/menard@89b653a1d42a5e5ffe737d63f8599559855e1f09 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nlebovits
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@89b653a1d42a5e5ffe737d63f8599559855e1f09 -
Trigger Event:
workflow_dispatch
-
Statement type: