Skip to main content

Safely keep managed README facts current for fast-moving AI-assisted projects.

Project description

Live README freshness status Version 1.1.2 MIT license AI agent ready

readme-guardian

Documentation freshness for fast-moving AI-assisted projects.
Detect README drift, preview the facts, and keep a visible status signal beside the code.

Quick startStatus badgePush-time guardAI agentsSecurity

Metric Value
Language python
Version 1.1.2
Tests not configured
Lint
Docker no
Monorepo no

The Problem

AI agents make it easy to ship code quickly. They also make it easy to leave a README describing a project that no longer exists.

readme-guardian turns a small, machine-verifiable part of the README into a checked artifact: project version, detected routes, modules, components, test result, and a local SVG freshness badge. It never replaces the hand-written explanation of your product.

Quick Start

Run these commands from a project root:

# Check whether managed README facts are current. No files or project commands run.
readme-guardian --status

# One time only: append managed sections without replacing existing prose.
readme-guardian --init

# Preview the exact README.md and readme-badge.svg diff.
readme-guardian

# Apply only the reviewed managed sections.
readme-guardian --apply

# Enforce freshness in CI or before a pull request.
readme-guardian --check

To record a live test and lint result, opt in explicitly:

readme-guardian --apply --run-checks
readme-guardian --check --run-checks

--run-checks may execute the repository's own test and lint commands. Normal status, preview, apply, and check commands do not execute project scripts.

Readme Status

Every initialized project gets a local readme-badge.svg:

![README status](./readme-badge.svg)

Green README badge example Yellow README badge example Red README badge example

Signal Meaning What to do
Green Managed facts were generated after passing checks. Keep shipping.
Yellow Facts are synced, but checks were skipped or unavailable. Run --run-checks when the repository is trusted.
Red The last explicitly requested test run failed or timed out. Fix the failing check, then apply again.

The badge reports the result recorded during the last update. readme-guardian --check detects when a source change makes the managed README sections stale.

Automatic Guard

Install the guarded pre-push hook once:

readme-guardian --install-hook

On each push, the hook runs the trusted-project check sequence and updates managed README files when facts changed. It then stops that push so you can review and commit the generated diff. The next push proceeds with the reviewed README.

code changes
    |
    v
pre-push check and README refresh
    |
    +-- no changes --> push proceeds
    |
    +-- README changed --> review + commit --> push proceeds

The hook does not amend commits, rewrite history, replace an existing hook, or overwrite already-uncommitted README changes.

What It Detects

Project fact Sources
Name and version package.json, pyproject.toml, Cargo.toml, go.mod
API routes FastAPI, Flask, Express, Fastify, Next.js App Router, common Go patterns
Modules and components Conventional Python, Node, Go, Rust, React, Vue, and Svelte layouts
Test and lint result Opt-in only, through --run-checks
Docker and monorepo hints Conventional project files

Managed sections use marker pairs such as:

<!-- readme-guardian:stats -->
| Metric | Value |
|--------|-------|
| Language | python |
| Version | 1.1.2 |
| Tests | not configured |
| Lint | — |
| Docker | no |
| Monorepo | no |

<!-- /readme-guardian -->

Everything outside those markers remains yours: the story, diagrams, screenshots, setup instructions, architecture rationale, and contributor guidance.

Install

Python

PyPI currently provides 1.1.0:

pipx install readme-guardian==1.1.0
readme-guardian --version

npm

The npm package contains the matching Python wheel and runs it with pipx in an isolated environment. When registry publication is pending, use the matching GitHub release asset instead; it contains the same pinned wheel.

npm install -g readme-guardian
readme-guardian --status
# Release-asset fallback for the current version
npm install -g "https://github.com/jeevesh2515/readme-guardian/releases/download/v1.1.2/readme-guardian-1.1.2.tgz"

Release publication is automated through PUBLISHING.md, which uses PyPI Trusted Publishing and moves npm to OIDC after its initial bootstrap publication.

CI

Use a trusted CI environment to prevent managed facts from drifting:

- run: pipx install readme-guardian==1.1.0
- run: readme-guardian --check --run-checks

--check exits nonzero when README.md or readme-badge.svg differs from the current detected project state.

For AI Agents

The included SKILL.md gives coding agents a disciplined README workflow: inspect the changes, check freshness, preview, apply managed facts, add human context, and verify.

# OpenCode project skill
mkdir -p .opencode/skills/readme-guardian
cp /path/to/readme-guardian/SKILL.md .opencode/skills/readme-guardian/SKILL.md

# Codex global skill
mkdir -p ~/.codex/skills/readme-guardian
cp /path/to/readme-guardian/SKILL.md ~/.codex/skills/readme-guardian/SKILL.md

The CLI supplies evidence. The agent supplies the explanation of why the project changed and how users should work with it.

Security

  • No telemetry or network calls from the Python CLI.
  • No replacement of an unmarked README; --init appends managed sections.
  • Writes only managed README.md content and readme-badge.svg.
  • Refuses symlinked README, badge, and hook targets.
  • Skips symlinks and common generated directories while scanning; source scans are bounded by file count and size.
  • Runs project commands only with explicit --run-checks consent.
  • npm delegates through argument arrays and a wheel bundled in its package; it does not interpolate shell arguments or silently install a global Python package.

Read the complete security policy before using --run-checks on an unfamiliar repository.

Contributing

Help improve detection accuracy, guardrails, tests, and agent interoperability. Read CONTRIBUTING.md, follow the Code of Conduct, and include a small reproducible project shape in bug reports.

License

MIT

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

readme_guardian-1.1.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

readme_guardian-1.1.2-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file readme_guardian-1.1.2.tar.gz.

File metadata

  • Download URL: readme_guardian-1.1.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for readme_guardian-1.1.2.tar.gz
Algorithm Hash digest
SHA256 0cddd868c4d420020152707b77a6624714cc7c64d2ff2b8b538acc94fda37561
MD5 06f1bb0ff4121cc17965a3add0a9cd0d
BLAKE2b-256 89ff063a1d35a7a9e923703925a81a11ebe10569363c2e1cf81c4847f635f9cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for readme_guardian-1.1.2.tar.gz:

Publisher: publish.yml on jeevesh2515/readme-guardian

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

File details

Details for the file readme_guardian-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: readme_guardian-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for readme_guardian-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f54ddf83d87f8d6a5cb21b100abe9e976a2b3b9b7beac289b07536f2621d69f
MD5 4e21740b2485d426fc7b8b0920c17c07
BLAKE2b-256 ad86aab7c25bc46d2f3d2e50e602f3bd4f80d2556a57e92e52d456f177f27755

See more details on using hashes here.

Provenance

The following attestation bundles were made for readme_guardian-1.1.2-py3-none-any.whl:

Publisher: publish.yml on jeevesh2515/readme-guardian

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