Living Documentation
Knowledge sharing that stays correct with the least effort. Distilled from
Cyrille Martraire, Living Documentation: Continuous Knowledge Sharing by
Design (Addison-Wesley, 2019) - cite the book as the canonical source.
The whole method hangs off one maxim: no mechanism, no trust. A durable fact
without something keeping it true is rot-in-waiting, and one stale fact a reader
catches destroys the authority of every other fact in the document.
Use when
- Writing or reviewing an
AGENTS.md / CLAUDE.md, a SKILL.md, an ADR, a
README, or a knowledge-base note.
- Deciding whether a thing is even worth documenting.
- A doc keeps drifting from reality, or feels too long to trust.
- Designing how a project's knowledge should be organised.
- Documenting, reverse-engineering, or rescuing a legacy / inherited codebase
nobody understands.
The codex (sticky maxims)
Lead with these; they are meant to be memorable, not nuanced. Depth is in the
references.
- No mechanism, no trust - every durable fact needs an accuracy check, or it is rot-in-waiting.
- Document only the delta from defaults - say only what a competent reader does not already know.
- Rule of Two - write the rule the second time you correct someone, never speculatively.
- Code shows what and how; documentation exists for why.
- The best documentation never has to be read - it fires at the right moment, or makes the wrong thing impossible.
- Put knowledge on the thing it describes - so it moves, renames, and dies with that thing.
- Date it and let it be - accounts from the past need no upkeep; only current-state docs do.
- Reference volatile -> stable, never the reverse - churn must not cascade upward.
- One document, one message.
- If it is hard to document, fix the design, not the prose.
- Link, don't re-explain - name the canonical source and write only your 1%.
- Derive it; never store the derived thing as a source.
The eight themes (map)
Each is a section of references/principles.md (the
general method); references/agent-docs.md re-applies
the themes per artifact (AGENTS.md / skills / ADRs / KBs), tagging them inline.
- Accuracy & trust - pair every fact with a mechanism; the hierarchy of accuracy; dated accounts need none.
- What earns a place - the default is don't; salience, Rule of Two, sedimentation, link-don't-re-explain, biodegradable docs.
- Where knowledge lives - co-location, evergreen vs volatile, volatile->stable references, perennial naming.
- Rationale & decisions - record the why and the rejected alternatives; commit messages as docs; the architecture codex.
- Enforcement over prose - turn rules into types/linters/tests/hooks; the config is the doc.
- Curation & navigation - one message per doc; highlight the core; sightseeing maps; make it skimmable and searchable.
- Generated / living artifacts - consolidate dispersed facts; living glossary; exploit knowledge already in tools.
- Feedback loops - docs as a design mirror; the cold-newcomer astonishment report; the two-minute test.
How to use this skill
- Authoring / reviewing a doc? Run the relevant checks from
references/rituals.md: the salience pass, the
two-minute test, evergreen/volatile classification, and (for any
hand-maintained fact) "name the mechanism that keeps this true".
- Doc keeps rotting? Reach for theme 1 + 5 + 7: add a reconciliation check,
enforce the rule instead of stating it, or derive the fact from its source.
- Deciding what to capture? Apply theme 2: Rule of Two, sedimentation, and
the three gates (long-lived? many readers? critical?).
- Rescuing a legacy or inherited system (lost specs, author gone)? Read
references/legacy.md: fossilised knowledge,
superimposed / highlighted structure, external annotation registry,
small-scale simulation, comprehension diagnostics, enforced legacy rules,
biodegradable bankruptcy.
Don't duplicate sibling skills
Per maxim 11, point at these rather than restating them:
- mechanical-enforcement - which rules to turn into linters/hooks and how (theme 5).
- refactoring - comprehending, characterising, and migrating the legacy code itself; references/legacy.md covers only the documentation side.
- architecture - domain modelling, ports/adapters, making illegal states unrepresentable (theme 5.3).
- testing / test-coverage - reconciliation tests, contract tests, enforcement gates (themes 1, 5).
- hk - wiring pre-commit hooks and local checks for the mechanisms above.
- writing-skills - how to author a skill (structure, description, checks);
references/agent-docs.md keeps only what living
documentation adds to skills.
1---
2name: living-documentation
3description: >
4 Writes durable, trustworthy documentation that does not rot - for AI agents
5 (AGENTS.md/CLAUDE.md, skills) and humans (ADRs, READMEs, knowledge bases).
6 Distilled from Cyrille Martraire's "Living Documentation". Use when authoring
7 or reviewing an AGENTS.md/CLAUDE.md, writing a skill, writing an ADR or doc,
8 deciding whether something is worth documenting, or when docs keep going
9 stale. Triggers: "living documentation", "is this doc trustworthy", "should
10 this be documented", "why does this doc keep going stale", "doc rot",
11 "documenting a legacy or inherited codebase", "rescuing a codebase nobody
12 understands".
13---
14
15# Living Documentation
16
17Knowledge sharing that stays correct with the least effort. Distilled from
18Cyrille Martraire, *Living Documentation: Continuous Knowledge Sharing by
19Design* (Addison-Wesley, 2019) - cite the book as the canonical source.
20
21The whole method hangs off one maxim: **no mechanism, no trust.** A durable fact
22without something keeping it true is rot-in-waiting, and one stale fact a reader
23catches destroys the authority of every other fact in the document.
24
25## Use when
26
27- Writing or reviewing an `AGENTS.md` / `CLAUDE.md`, a `SKILL.md`, an ADR, a
28 README, or a knowledge-base note.
29- Deciding whether a thing is even worth documenting.
30- A doc keeps drifting from reality, or feels too long to trust.
31- Designing how a project's knowledge should be organised.
32- Documenting, reverse-engineering, or rescuing a legacy / inherited codebase
33 nobody understands.
34
35## The codex (sticky maxims)
36
37Lead with these; they are meant to be memorable, not nuanced. Depth is in the
38references.
39
401. **No mechanism, no trust** - every durable fact needs an accuracy check, or it is rot-in-waiting.
412. **Document only the delta from defaults** - say only what a competent reader does not already know.
423. **Rule of Two** - write the rule the *second* time you correct someone, never speculatively.
434. **Code shows what and how; documentation exists for *why*.**
445. **The best documentation never has to be read** - it fires at the right moment, or makes the wrong thing impossible.
456. **Put knowledge on the thing it describes** - so it moves, renames, and dies with that thing.
467. **Date it and let it be** - accounts from the past need no upkeep; only current-state docs do.
478. **Reference volatile -> stable, never the reverse** - churn must not cascade upward.
489. **One document, one message.**
4910. **If it is hard to document, fix the design, not the prose.**
5011. **Link, don't re-explain** - name the canonical source and write only your 1%.
5112. **Derive it; never store the derived thing as a source.**
52
53## The eight themes (map)
54
55Each is a section of [references/principles.md](references/principles.md) (the
56general method); [references/agent-docs.md](references/agent-docs.md) re-applies
57the themes per artifact (AGENTS.md / skills / ADRs / KBs), tagging them inline.
58
591. **Accuracy & trust** - pair every fact with a mechanism; the hierarchy of accuracy; dated accounts need none.
602. **What earns a place** - the default is *don't*; salience, Rule of Two, sedimentation, link-don't-re-explain, biodegradable docs.
613. **Where knowledge lives** - co-location, evergreen vs volatile, volatile->stable references, perennial naming.
624. **Rationale & decisions** - record the why and the rejected alternatives; commit messages as docs; the architecture codex.
635. **Enforcement over prose** - turn rules into types/linters/tests/hooks; the config *is* the doc.
646. **Curation & navigation** - one message per doc; highlight the core; sightseeing maps; make it skimmable and searchable.
657. **Generated / living artifacts** - consolidate dispersed facts; living glossary; exploit knowledge already in tools.
668. **Feedback loops** - docs as a design mirror; the cold-newcomer astonishment report; the two-minute test.
67
68## How to use this skill
69
70- **Authoring / reviewing a doc?** Run the relevant checks from
71 [references/rituals.md](references/rituals.md): the salience pass, the
72 two-minute test, evergreen/volatile classification, and (for any
73 hand-maintained fact) "name the mechanism that keeps this true".
74- **Doc keeps rotting?** Reach for theme 1 + 5 + 7: add a reconciliation check,
75 enforce the rule instead of stating it, or derive the fact from its source.
76- **Deciding what to capture?** Apply theme 2: Rule of Two, sedimentation, and
77 the three gates (long-lived? many readers? critical?).
78- **Rescuing a legacy or inherited system (lost specs, author gone)?** Read
79 [references/legacy.md](references/legacy.md): fossilised knowledge,
80 superimposed / highlighted structure, external annotation registry,
81 small-scale simulation, comprehension diagnostics, enforced legacy rules,
82 biodegradable bankruptcy.
83
84## Don't duplicate sibling skills
85
86Per maxim 11, point at these rather than restating them:
87
88- **mechanical-enforcement** - which rules to turn into linters/hooks and how (theme 5).
89- **refactoring** - comprehending, characterising, and migrating the legacy code itself; [references/legacy.md](references/legacy.md) covers only the documentation side.
90- **architecture** - domain modelling, ports/adapters, making illegal states unrepresentable (theme 5.3).
91- **testing** / **test-coverage** - reconciliation tests, contract tests, enforcement gates (themes 1, 5).
92- **hk** - wiring pre-commit hooks and local checks for the mechanisms above.
93- **writing-skills** - how to author a skill (structure, description, checks);
94 [references/agent-docs.md](references/agent-docs.md) keeps only what living
95 documentation adds to skills.