Irminsul
Repository knowledge that stays accountable to the code.
However your team creates documentation and specifications, Irminsul mechanically verifies their structure, the code they claim, their provenance and lifecycle, and whether those relationships still hold in the repository. It is a Python CLI + composite GitHub Action that enforces those invariants locally and in CI without prescribing an authoring workflow.
Why
Docs that rot are worse than no docs — they are noise that reads as signal. Agents are the primary operators and direct consumers of repository knowledge; humans interact with that knowledge primarily through agents and remain the authority for intent and approval. Irminsul gives both a machine-verified contract: agents query the graph and perform the work, while deterministic checks make structural drift visible to the humans who authorize it. There is no server, no hosted state, and no LLM in the check path.
Quickstart
For an existing codebase:
pipx install irminsul
cd my-codebase
irminsul init
irminsul adoption init
The fourth line is what makes an existing codebase adoptable. It records the files that
have no owning document today, so they do not fail CI while you work through them. Every
check runs from that moment — the record excepts those named files from the one finding
that says a file has no owner, and nothing else. Each exception retires the moment you
document its file, editing a recorded file means documenting it in the same change, and
the record can only shrink. See the adoption record
for the whole contract, and irminsul list undocumented --all for what is left.
Skip it on a repository whose code is already documented; skip it on a new project. The symptom of skipping it when you needed it is a green run today and a red one the day you write your first component doc, because documenting one file brings the rest of its directory into scope.
For a new project with no code yet:
pipx install irminsul
irminsul init --fresh --language python --path my-new-project
That scaffolds a six-layer /docs skeleton, an irminsul.toml config, GitHub Actions workflows, and the agent wiring: docs/AGENTS.md (the generated navigation manifest), a root AGENTS.md holding the agent loop, which Cursor and Codex read natively (an AGENTS.md you already have gains it as a marked section), a CLAUDE.md that imports it for Claude Code, a .mcp.json registering the read-only MCP server, and a harness skill that points an agent at that loop and irminsul orient.
For private docs with separate public code, run irminsul init --topology siblings --code-repo owner/repo --language python inside a docs repo that sits beside the code repo. The code repo does not have to exist yet; omit --language when a local checkout is available for detection.
For AI agents
The loop: orient, locate the owning docs, edit code and docs in the same commit, verify before committing. Each command supports --format json.
| Command | What it does |
|---|---|
irminsul orient |
First call in a session: one-shot repo orientation — what this repo is, the layer map, how much of the source a doc owns, where to start |
irminsul context <path...> / --after-edit |
Before an edit: owners, tests, active RFCs, bounded authored excerpts, and next actions, with no checks run. After it: the same for the changed files, plus findings and what the change introduced |
irminsul context --topic <q> |
The docs that cover a topic, before you know which file to open |
irminsul refs <doc-id> |
The docs that depend on or link to a doc |
irminsul surface {cli,cli-options,http,exports,env-vars,mcp} |
Derive a code surface from source on demand — never written to disk, so it cannot drift |
irminsul list {undocumented,lifecycle,review,baseline} |
Source files no doc claims, unfinished RFC work, doc sentences to re-check against changed code, and the findings a baseline hides |
irminsul check --format json |
Machine-readable findings, each with its class, plus the exit code CI enforces; --only <check> runs one check, such as orphans |
irminsul fix |
Apply deterministic remediations for mechanical findings |
For MCP-speaking harnesses, irminsul mcp exposes the same commands as MCP tools (install with pip install 'irminsul[mcp]').
For humans
Read the curated layers — GitHub and your IDE render the markdown. The tree has six layers: foundation, architecture, components, decisions, rfcs, and guides, each a folder you can rename under [layers] in irminsul.toml.
irminsul new {adr,component,rfc} scaffolds a correctly-frontmattered atom into the right layer.
What it checks
Every check is deterministic and makes no LLM call. Each finding has a class: a certain finding proves the tree breaks a rule and fails CI; a hint points at something to investigate and fails only under --fail-on hint when it is a warning; a time finding comes from elapsed time and stays off pull requests. Checks enabled by default include:
- Frontmatter validity — required fields present, enums valid, IDs match filenames
- Glob resolution — every
describesglob resolves to ≥1 source file - Coverage uniqueness — every source file is claimed by exactly one most-specific doc
- Internal link integrity — no broken
[link](other.md)references - Schema-leak detection — no class/type definitions in component docs
- Test coverage — every component doc that claims source declares at least one valid test path
- Code references — a code span naming a command, option, function, or environment variable the code no longer has
- Prose file references — local
.mdfilenames in stable prose must be real Markdown links - RFC lifecycle — every RFC declares its state, and
resolved_by/implementsresolve; under--diff,diff-integrityreports an implemented RFC that changed - Retired references — current docs do not present a command or concept an ADR retired as live
- Agents manifest (opt-in) — the generated section of
docs/AGENTS.mdmatches the actual tree - mtime-drift — a doc's last commit lags behind the sources it describes
- orphans — docs that nothing links to or claims
- stale-reaper — deprecated docs that have aged past the staleness threshold
- supersession — a doc another one
supersedesis deprecated - parent-child — INDEX.md invariants: no broad globs over children, length cap
- glossary-discipline — no doc uses a synonym the glossary forbids, and a term's first use links its entry
- external-links — http(s) link reachability, cached (opt-in)
…plus further deterministic audits (boundary, phantom-layer, claim provenance, inventory drift, and more), listed in checks.enabled in irminsul.toml.
CI integration
on: pull_request
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: huajie-zhong/irminsul@v0.4.0
with:
diff: origin/${{ github.base_ref }}
irminsul init writes this file for you.
License
AGPL-3.0-or-later. See LICENSE.
Metadata
Release files for irminsul 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| irminsul-0.4.0.tar.gz | 854.2 kB | With provenance | Details for irminsul-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| irminsul-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for irminsul-0.4.0-py3-none-any.whl |
Total release size: 1.3 MB
Release files / irminsul-0.4.0.tar.gz
| Download URL | irminsul-0.4.0.tar.gz |
|---|---|
| Size | 854.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a5915f4657adbd2f249633468f96d5664aa48504b338e7f5b88545fc609add5
|
|
BLAKE2b-256 checksum How to use checksums |
d84012c0a61f5ba6d0c1e545661de8f663de4a4f401eee8b1630b6c82c9ccc92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logRelease files / irminsul-0.4.0-py3-none-any.whl
| Download URL | irminsul-0.4.0-py3-none-any.whl |
|---|---|
| Size | 441.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f54d09a027333aaa1ceb9f42394f4e68356bf352597a4ad733345c5379ace700
|
|
BLAKE2b-256 checksum How to use checksums |
db4002ac7b048f7f6e960d7f3accc08f4e3e6f44b3c1a1bd13867b605681901d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logSecurity for irminsul 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for irminsul-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.