Skip to main content

Keep code and documentation in sync with centralized linking and section-aware staleness detection

Project description

menard logo

CI codecov PyPI Python 3.10+ License Ruff

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

Contributing Guide

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

menard-0.4.0.tar.gz (428.4 kB view details)

Uploaded Source

Built Distribution

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

menard-0.4.0-py3-none-any.whl (62.9 kB view details)

Uploaded Python 3

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

Hashes for menard-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a556e615189c3fbd41abcd1fc3772fb3fc77ed82534a3f96d1644b7afcfec358
MD5 3c5dff25e0b7c8c1729ec6ef555e7abd
BLAKE2b-256 ef718aad44096c0e25ab0e7762d909351d7478e474d557d24434a67173b12a37

See more details on using hashes here.

Provenance

The following attestation bundles were made for menard-0.4.0.tar.gz:

Publisher: release.yml on nlebovits/menard

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

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

Hashes for menard-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4c4d23b6092870277762a390e2ea4fa1d0a0012076a872d09d321c36c462101
MD5 173cb9236879247b0223b974346d8e55
BLAKE2b-256 55d7570ca032d366546160aa551ab372ee16436f71befa4c354f1541050ec543

See more details on using hashes here.

Provenance

The following attestation bundles were made for menard-0.4.0-py3-none-any.whl:

Publisher: release.yml on nlebovits/menard

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