{"name":"layer-repository-docs","title":"Layer a repository's documentation","description":"Make a repository's documentation legible when an organisation has more repos than anyone can track, through three entry points — audit read-only, draft the layers, update what a change overtook: classify every document by kind, list the rot where one fact is stated twice and the two disagree, draft only the layers the tier needs from the repo's own source rather than its README, audit every replaced file for rules silently dropped, and put a newcomer through a clean clone before claiming any of it works. Symptoms: nobody can tell what this repo is for, write a manual for this repo, check whether the docs are still true, update the docs after the code moved, our READMEs all say something different, too many repos to keep track of, the docs disagree with the code, where is this rule supposed to live. It writes the documentation people read; it does not write the context files agents load — that is derive-codebase-context.","compatibility":"Any repository the agent can read, with git to record a baseline revision and read files at it rather than through a README. A second clean clone makes the newcomer test real; without one it degrades, and the skill says so. A forge CLI compares the README description line with the registered description; without one that check is reported as not run. Output depends on the entry point: always a report, plus drafted files and a loss audit where something is replaced. Nothing is committed.","allowedTools":"Read Write Edit Grep Glob Bash","license":"MIT","kind":"signals","useWhen":"writing, auditing or updating the documentation people read in this repository","group":"workflow","lifecycle":"release","version":"1.0.0","author":"crissmoldovan","install":["npx skills add crissmoldovan/agent-skills --skill layer-repository-docs"],"asks":["/layer-repository-docs check","This repo has grown three files at the root that all claim to explain it and none of them\nagree. Classify every document by kind first and show me the rot list — file, line, and which\nfile should own each fact — before you draft a single replacement.","We have far more repositories than anyone can keep track of and every README is a different\nshape. Write the quick start and the manual for this one from the workflow files and the\nscripts' usage headers, not from the README, and tell me which claims in the current README\nturned out to be wrong.","Before I merge your documentation rewrite: split every file you are replacing into its facts\nand rules and give each a verdict, then run the newcomer test in a clean clone and tell me\nevery place a newcomer would get stuck. I want the weakened rules listed individually."],"commands":[],"documents":[{"path":"references/claim-check.md","slug":"claim-check","title":"The claim check","body":"# The claim check\n\nTwo passes over the draft, run separately because they find different things. The first asks\nwhether each sentence is true. The second asks what the document is asserting about **itself** —\nits status, its authority, and the reviews it implies were performed.\n\nBoth are needed. In the pilot the fact-check pass reported a draft as factually sound while that\nsame draft called the repository \"piloted\" and \"checked\" when nothing had landed, sent agent\nsessions to an authority that did not exist, and declared conformance to a checklist the\nrepository was failing. Every individual fact in it was true.\n\n## Pass one: every claim against source\n\n**The measured reason to run it.** A first draft was enumerated claim by claim: **59 checkable\nclaims, of which 27 were correct, 6 wrong, 20 misleading, 3 at risk of going stale and 3\nunverifiable.** Twenty-six of fifty-nine wrong or misleading, in a document whose structure was\nsound. The errors were not careless; they were plausible. That is the failure mode of\ndocumentation drafted by a model, and the only defence is enumeration.\n\n**What \"the draft\" means when nothing was drafted.** In an `audit` the draft is the documentation\nas it stands: the same enumeration, over the files that are already there.\n\n**What counts as a checkable claim.** Any sentence naming a command, a flag, a path, a file, an\nenvironment variable, a count, a version, a trigger, a behaviour, or an external citation. Do not\nenumerate the prose that says what the repository is for — that is a judgement, and it belongs to\nthe owner.\n\n**How to run it.**\n\n1. Number every checkable claim in the draft. The number is the unit of work; a claim that is not\n   numbered is a claim that will not be checked.\n2. For each, name the file that is its home and read it **at the baseline revision**. Not the\n   working tree, not another document, and never the README.\n3. Record a verdict and the path that produced it.\n\n**The five verdicts:**\n\n| Verdict | Meaning |\n|---|---|\n| **correct** | The source says this |\n| **wrong** | The source contradicts it |\n| **misleading** | Literally true and read the wrong way — the largest category, and the one most easily argued away |\n| **at risk of going stale** | True now, with nothing to keep it true: a count, a total, a status with no date |\n| **unverifiable** | No source in reach. Says so in the draft, or comes out of it |\n\n**Misleading is where the work is.** Twenty of the pilot's twenty-six problems were in this\ncategory. Three recurring shapes:\n\n- **True of the happy path only.** A branch documented as behaving one way, where the code exits\n  earlier under conditions the reader will actually hit.\n- **True but read as a guarantee.** A command described by what it does, which the reader takes as\n  a promise it does nothing else.\n- **True of one of the things named.** A statement covering two of the three things it appears to\n  cover, where the third is the one the reader has.\n\nAlso check the citations. An external quotation is a claim like any other: open it, and quote it\nexactly or not at all.\n\n## Pass two: what the draft asserts about itself\n\nRead the draft for status, authority and self-report. Five findings to look for, each of which\nwas real:\n\n- **A proposal written as though adopted.** \"Must\" and \"never\", about a standard nobody has\n  agreed to. One week later it reads as a rule somebody imposed without asking. State at the top\n  who decides, that nothing is bound, and that \"must\" describes what the proposal *would* require\n  if adopted.\n- **A pointer to an authority that does not exist.** Sending readers, and agent sessions\n  especially, to an organisation-wide handbook \"for all rules\" when no repository holds one. The\n  reader concludes the rules exist and that finding them is their problem. Until it exists in a\n  named repository, nothing links to it and no rules block claims it as its source.\n- **A freshness stamp claiming a review nobody performed.** \"Last reviewed\" is worth less than\n  nothing unless something defines who counts as a reviewer and how anyone would know the list of\n  paths it covers is complete. It converts an unread document into an apparently checked one.\n  Leave it out, or make it name the revision whose sources a person actually re-read.\n- **A conformance claim made while failing the checklist.** A document that declares it meets the\n  standard it introduces, while several items are unmet. State the unmet items in a table with\n  where each one is, and say what the repository would be if it conformed.\n- **A request overridden rather than put back to the requester.** The owner asked for a file in a\n  particular place; the draft decided otherwise and did not say so. Where a draft departs from\n  what was asked, it is a decision for the owner, with options and a recommendation — not a fait\n  accompli discovered on review.\n\nTwo more that belong in this pass because nothing else catches them:\n\n- **Proportion.** A draft that runs to several hundred lines to describe a standard for keeping\n  documents short has refuted itself. Check the draft against its own thresholds.\n- **A claim about another repository stated as fact.** Anything the run discovered elsewhere —\n  especially a security finding — is reported with what was actually read, when, and by what\n  means, and is that repository's work rather than this one's.\n\n**In an `audit`, pass two produces findings and decisions, not edits.** The five are written as\ncorrections because a drafting run makes them; a run that may write nothing in the repository\nreports each one and names whose decision it is.\n\n## Finishing honestly\n\nWhatever the final edits are, they are the ones nobody re-checked. Say so. A draft that names the\none part of itself that had no independent pass is more trustworthy than one that reports a clean\nrun, because the reader knows where to look.\n\nReport, at the end of the run:\n\n- Each pass, what it covered, and the counts it produced.\n- What was checked by running a command and what was checked by reading.\n- Everything that could not be verified, marked unknown.\n- Anything fixed after the last pass, marked as unchecked by that pass.\n\nA draft that claims a test it did not run is worse than no draft: it spends the reader's\nscepticism in the wrong place, and they stop looking.\n","bodyHtml":"<h2 id=\"the-claim-check\">The claim check</h2>\n<p>Two passes over the draft, run separately because they find different things. The first asks\nwhether each sentence is true. The second asks what the document is asserting about <strong>itself</strong> —\nits status, its authority, and the reviews it implies were performed.</p>\n<p>Both are needed. In the pilot the fact-check pass reported a draft as factually sound while that\nsame draft called the repository &quot;piloted&quot; and &quot;checked&quot; when nothing had landed, sent agent\nsessions to an authority that did not exist, and declared conformance to a checklist the\nrepository was failing. Every individual fact in it was true.</p>\n<h3 id=\"pass-one-every-claim-against-source\">Pass one: every claim against source</h3>\n<p><strong>The measured reason to run it.</strong> A first draft was enumerated claim by claim: <strong>59 checkable\nclaims, of which 27 were correct, 6 wrong, 20 misleading, 3 at risk of going stale and 3\nunverifiable.</strong> Twenty-six of fifty-nine wrong or misleading, in a document whose structure was\nsound. The errors were not careless; they were plausible. That is the failure mode of\ndocumentation drafted by a model, and the only defence is enumeration.</p>\n<p><strong>What &quot;the draft&quot; means when nothing was drafted.</strong> In an <code>audit</code> the draft is the documentation\nas it stands: the same enumeration, over the files that are already there.</p>\n<p><strong>What counts as a checkable claim.</strong> Any sentence naming a command, a flag, a path, a file, an\nenvironment variable, a count, a version, a trigger, a behaviour, or an external citation. Do not\nenumerate the prose that says what the repository is for — that is a judgement, and it belongs to\nthe owner.</p>\n<p><strong>How to run it.</strong></p>\n<ol>\n<li>Number every checkable claim in the draft. The number is the unit of work; a claim that is not\nnumbered is a claim that will not be checked.</li>\n<li>For each, name the file that is its home and read it <strong>at the baseline revision</strong>. Not the\nworking tree, not another document, and never the README.</li>\n<li>Record a verdict and the path that produced it.</li>\n</ol>\n<p><strong>The five verdicts:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Verdict</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><strong>correct</strong></td>\n<td>The source says this</td>\n</tr>\n<tr>\n<td><strong>wrong</strong></td>\n<td>The source contradicts it</td>\n</tr>\n<tr>\n<td><strong>misleading</strong></td>\n<td>Literally true and read the wrong way — the largest category, and the one most easily argued away</td>\n</tr>\n<tr>\n<td><strong>at risk of going stale</strong></td>\n<td>True now, with nothing to keep it true: a count, a total, a status with no date</td>\n</tr>\n<tr>\n<td><strong>unverifiable</strong></td>\n<td>No source in reach. Says so in the draft, or comes out of it</td>\n</tr>\n</tbody></table>\n<p><strong>Misleading is where the work is.</strong> Twenty of the pilot&#39;s twenty-six problems were in this\ncategory. Three recurring shapes:</p>\n<ul>\n<li><strong>True of the happy path only.</strong> A branch documented as behaving one way, where the code exits\nearlier under conditions the reader will actually hit.</li>\n<li><strong>True but read as a guarantee.</strong> A command described by what it does, which the reader takes as\na promise it does nothing else.</li>\n<li><strong>True of one of the things named.</strong> A statement covering two of the three things it appears to\ncover, where the third is the one the reader has.</li>\n</ul>\n<p>Also check the citations. An external quotation is a claim like any other: open it, and quote it\nexactly or not at all.</p>\n<h3 id=\"pass-two-what-the-draft-asserts-about-itself\">Pass two: what the draft asserts about itself</h3>\n<p>Read the draft for status, authority and self-report. Five findings to look for, each of which\nwas real:</p>\n<ul>\n<li><strong>A proposal written as though adopted.</strong> &quot;Must&quot; and &quot;never&quot;, about a standard nobody has\nagreed to. One week later it reads as a rule somebody imposed without asking. State at the top\nwho decides, that nothing is bound, and that &quot;must&quot; describes what the proposal <em>would</em> require\nif adopted.</li>\n<li><strong>A pointer to an authority that does not exist.</strong> Sending readers, and agent sessions\nespecially, to an organisation-wide handbook &quot;for all rules&quot; when no repository holds one. The\nreader concludes the rules exist and that finding them is their problem. Until it exists in a\nnamed repository, nothing links to it and no rules block claims it as its source.</li>\n<li><strong>A freshness stamp claiming a review nobody performed.</strong> &quot;Last reviewed&quot; is worth less than\nnothing unless something defines who counts as a reviewer and how anyone would know the list of\npaths it covers is complete. It converts an unread document into an apparently checked one.\nLeave it out, or make it name the revision whose sources a person actually re-read.</li>\n<li><strong>A conformance claim made while failing the checklist.</strong> A document that declares it meets the\nstandard it introduces, while several items are unmet. State the unmet items in a table with\nwhere each one is, and say what the repository would be if it conformed.</li>\n<li><strong>A request overridden rather than put back to the requester.</strong> The owner asked for a file in a\nparticular place; the draft decided otherwise and did not say so. Where a draft departs from\nwhat was asked, it is a decision for the owner, with options and a recommendation — not a fait\naccompli discovered on review.</li>\n</ul>\n<p>Two more that belong in this pass because nothing else catches them:</p>\n<ul>\n<li><strong>Proportion.</strong> A draft that runs to several hundred lines to describe a standard for keeping\ndocuments short has refuted itself. Check the draft against its own thresholds.</li>\n<li><strong>A claim about another repository stated as fact.</strong> Anything the run discovered elsewhere —\nespecially a security finding — is reported with what was actually read, when, and by what\nmeans, and is that repository&#39;s work rather than this one&#39;s.</li>\n</ul>\n<p><strong>In an <code>audit</code>, pass two produces findings and decisions, not edits.</strong> The five are written as\ncorrections because a drafting run makes them; a run that may write nothing in the repository\nreports each one and names whose decision it is.</p>\n<h3 id=\"finishing-honestly\">Finishing honestly</h3>\n<p>Whatever the final edits are, they are the ones nobody re-checked. Say so. A draft that names the\none part of itself that had no independent pass is more trustworthy than one that reports a clean\nrun, because the reader knows where to look.</p>\n<p>Report, at the end of the run:</p>\n<ul>\n<li>Each pass, what it covered, and the counts it produced.</li>\n<li>What was checked by running a command and what was checked by reading.</li>\n<li>Everything that could not be verified, marked unknown.</li>\n<li>Anything fixed after the last pass, marked as unchecked by that pass.</li>\n</ul>\n<p>A draft that claims a test it did not run is worse than no draft: it spends the reader&#39;s\nscepticism in the wrong place, and they stop looking.</p>\n","words":1104},{"path":"references/document-kinds.md","slug":"document-kinds","title":"Document kinds, edit rules, tiers","body":"# Document kinds, edit rules, tiers\n\nThe three layers are roles. Most of the files in a repository are none of them. This file names\nthe other kinds, gives each one a home and an **edit rule**, and gives the ladder that decides\nwhich of them a repository should have at all.\n\nThe reason to classify at all: these kinds age at different rates. A spec is stable and a\nworking list is stale within the week. Put them in one file and the file has no edit rule, so\nnobody can tell whether editing a line is a correction or a falsification — and the usual\noutcome is that everybody stops editing it.\n\n## The kinds\n\n| Kind | Where it lives | What it is for | Edit rule |\n|---|---|---|---|\n| Record: spec | a numbered file under a spec directory | The contract. The manual explains it and links to its sections; where the two differ, the spec wins and the manual has a bug. | `amend` |\n| Record: decisions | a decisions file beside the specs, or a decisions directory | The home of \"why\". | `supersede` |\n| Record: research and evidence | a research directory, with evidence beneath it | Reached through citations, not read front to back. May hold personal data, and therefore stays private. | Existing files are not edited. An evidence index may gain one row per new file. |\n| Runbook | beside the code it operates, or in a runbooks directory | A manual chapter for an operation, often one person's. | The **only** home of deploy-time variable names, endpoints, domains and deploy step state. |\n| Skill | a skill file under a skills directory | A manual chapter written for agent sessions. | Links to the manual's reference for flags and counts. A mirrored copy says where it came from and changes only at its source. |\n| Working: list | a status or backlog file | The home of dated status. | `strike through and date`. Any \"last updated\" line matches the newest entry in the file. |\n| Working: session prompt | one file at the root, pasted into a new session, not loaded automatically | A reading order; dated state, each item with its owner and any standing direction that governs it; ground truth, each fact with its date, its home and how to re-measure it. | Rules for all work live in the agent file, not here. |\n| Working: handoff | a dated file under a handoffs directory | Moves one piece of work, or one decision, to a person or a repository. | `delete when accepted` — version control keeps the history. |\n| Working: proposal | under the docs directory | A document awaiting a decision. | Says that it is a proposal, who decides, and that it binds nothing. |\n| Agent file | the harness context files at the root | Rules for agent sessions, kept apart from the repository rules that also bind people. | Owned by `derive-codebase-context`. This skill records it, its edit rule and its audience, and writes none of its content. |\n| Source | schemas; the usage header of a script | The home of a vocabulary, or of a command's flags. | Changed with the code, in the same change. |\n| Generated | a build output directory | Output. | `never`. A check fails the build when it is stale. |\n\n## The edit-rule vocabulary\n\nA docs map is only useful if the edit rules are a closed set. These seven cover every kind above:\n\n- **`PR`** — changed through a pull request like any other file.\n- **`never`** — not edited by hand at all; regenerate instead.\n- **`strike through and date`** — the old line stays, struck through, with the date it stopped\n  being true.\n- **`supersede`** — a new entry replaces an older one, which remains in place and readable.\n- **`amend`** — a deliberate change, recorded in the decisions record.\n- **`add only`** — new files or new rows; existing content is never edited.\n- **`delete when accepted`** — the file's job ends when somebody accepts it.\n\n## The docs map\n\nOne table, in the manual's reference part, listing every document in the repository. It is the\nonly complete list, and it is the file that makes the next person's inventory take ten minutes\ninstead of a morning.\n\n| Document | Kind | Audience | Edit rule |\n|---|---|---|---|\n| `README.md` | Quick start | anyone arriving | `PR` |\n| `docs/MANUAL.md` | Manual | people using or changing the repository | `PR` |\n| the spec files | Record: spec | people changing behaviour | `amend` |\n| the decisions file | Record: decisions | anyone asking \"why\" | `supersede` |\n| the status list | Working: list | the owner and any active session | `strike through and date` |\n| the build output | Generated | nobody; machines read it | `never` |\n\nOne line under the table records the revision whose sources were last read for it — `sources re-read\nat <sha>` — the one freshness stamp worth carrying, because it names something a reader can check,\nand because it is where a later `update` run starts.\n\nState the repository's tier in one line of the docs map — or, at the lowest tier, in the README,\nsince there is no map.\n\n## The tier ladder\n\nTiers keep the standard from manufacturing work. A repository is one of three things, and the\nthresholds are opinion.\n\n| Tier | What it is | What it has |\n|---|---|---|\n| 0 | Nothing others run or change: a deck, a static site, a delivered report | A README, with a **Use** section if anything has to be run |\n| 1 | Commands others run, or code others change | A README, plus a manual once a trigger below fires, plus agent files once theirs fires |\n| 2 | Also a spec another system depends on, a deploy, or a published interface | A README as the router, a manual with its docs map, and whatever records, runbooks, working documents and agent files it actually uses |\n\n## Triggers — what creates each document\n\nNothing is created because the tier table permits it. Each document appears when its trigger\nfires, and not before.\n\n- **Manual:** the README passes its cap; a second audience appears; a task needs more than three\n  steps; a command takes flags or credentials.\n- **Agent files:** the repository has a rule an agent would break by default, or a rule has had to\n  be repeated to a session. (What goes in them is `derive-codebase-context`'s.)\n- **Session prompt:** work regularly spans sessions.\n- **Handoff:** a piece of work, or a decision, moves to another person or another repository.\n- **Records:** the first decision somebody will ask \"why?\" about, or the first spec another system\n  depends on.\n- **Runbook:** the first operation only one person performs, with credentials.\n- **Removal:** a document with no reader, or with dead content, is deleted. Version control keeps\n  the history, and a deleted document is cheaper than a wrong one.\n\n## Visibility\n\nThree rules that cut across every kind:\n\n- A public repository does not name or link paths inside a private one.\n- A repository a client can see carries no internal link, no internal status, and no internal name\n  beyond a role.\n- Examples use patterns and `example.com` addresses, never a real one — including in a private\n  repository, because a private repository's contents move.\n","bodyHtml":"<h2 id=\"document-kinds-edit-rules-tiers\">Document kinds, edit rules, tiers</h2>\n<p>The three layers are roles. Most of the files in a repository are none of them. This file names\nthe other kinds, gives each one a home and an <strong>edit rule</strong>, and gives the ladder that decides\nwhich of them a repository should have at all.</p>\n<p>The reason to classify at all: these kinds age at different rates. A spec is stable and a\nworking list is stale within the week. Put them in one file and the file has no edit rule, so\nnobody can tell whether editing a line is a correction or a falsification — and the usual\noutcome is that everybody stops editing it.</p>\n<h3 id=\"the-kinds\">The kinds</h3>\n<table>\n<thead>\n<tr>\n<th>Kind</th>\n<th>Where it lives</th>\n<th>What it is for</th>\n<th>Edit rule</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Record: spec</td>\n<td>a numbered file under a spec directory</td>\n<td>The contract. The manual explains it and links to its sections; where the two differ, the spec wins and the manual has a bug.</td>\n<td><code>amend</code></td>\n</tr>\n<tr>\n<td>Record: decisions</td>\n<td>a decisions file beside the specs, or a decisions directory</td>\n<td>The home of &quot;why&quot;.</td>\n<td><code>supersede</code></td>\n</tr>\n<tr>\n<td>Record: research and evidence</td>\n<td>a research directory, with evidence beneath it</td>\n<td>Reached through citations, not read front to back. May hold personal data, and therefore stays private.</td>\n<td>Existing files are not edited. An evidence index may gain one row per new file.</td>\n</tr>\n<tr>\n<td>Runbook</td>\n<td>beside the code it operates, or in a runbooks directory</td>\n<td>A manual chapter for an operation, often one person&#39;s.</td>\n<td>The <strong>only</strong> home of deploy-time variable names, endpoints, domains and deploy step state.</td>\n</tr>\n<tr>\n<td>Skill</td>\n<td>a skill file under a skills directory</td>\n<td>A manual chapter written for agent sessions.</td>\n<td>Links to the manual&#39;s reference for flags and counts. A mirrored copy says where it came from and changes only at its source.</td>\n</tr>\n<tr>\n<td>Working: list</td>\n<td>a status or backlog file</td>\n<td>The home of dated status.</td>\n<td><code>strike through and date</code>. Any &quot;last updated&quot; line matches the newest entry in the file.</td>\n</tr>\n<tr>\n<td>Working: session prompt</td>\n<td>one file at the root, pasted into a new session, not loaded automatically</td>\n<td>A reading order; dated state, each item with its owner and any standing direction that governs it; ground truth, each fact with its date, its home and how to re-measure it.</td>\n<td>Rules for all work live in the agent file, not here.</td>\n</tr>\n<tr>\n<td>Working: handoff</td>\n<td>a dated file under a handoffs directory</td>\n<td>Moves one piece of work, or one decision, to a person or a repository.</td>\n<td><code>delete when accepted</code> — version control keeps the history.</td>\n</tr>\n<tr>\n<td>Working: proposal</td>\n<td>under the docs directory</td>\n<td>A document awaiting a decision.</td>\n<td>Says that it is a proposal, who decides, and that it binds nothing.</td>\n</tr>\n<tr>\n<td>Agent file</td>\n<td>the harness context files at the root</td>\n<td>Rules for agent sessions, kept apart from the repository rules that also bind people.</td>\n<td>Owned by <code>derive-codebase-context</code>. This skill records it, its edit rule and its audience, and writes none of its content.</td>\n</tr>\n<tr>\n<td>Source</td>\n<td>schemas; the usage header of a script</td>\n<td>The home of a vocabulary, or of a command&#39;s flags.</td>\n<td>Changed with the code, in the same change.</td>\n</tr>\n<tr>\n<td>Generated</td>\n<td>a build output directory</td>\n<td>Output.</td>\n<td><code>never</code>. A check fails the build when it is stale.</td>\n</tr>\n</tbody></table>\n<h3 id=\"the-edit-rule-vocabulary\">The edit-rule vocabulary</h3>\n<p>A docs map is only useful if the edit rules are a closed set. These seven cover every kind above:</p>\n<ul>\n<li><strong><code>PR</code></strong> — changed through a pull request like any other file.</li>\n<li><strong><code>never</code></strong> — not edited by hand at all; regenerate instead.</li>\n<li><strong><code>strike through and date</code></strong> — the old line stays, struck through, with the date it stopped\nbeing true.</li>\n<li><strong><code>supersede</code></strong> — a new entry replaces an older one, which remains in place and readable.</li>\n<li><strong><code>amend</code></strong> — a deliberate change, recorded in the decisions record.</li>\n<li><strong><code>add only</code></strong> — new files or new rows; existing content is never edited.</li>\n<li><strong><code>delete when accepted</code></strong> — the file&#39;s job ends when somebody accepts it.</li>\n</ul>\n<h3 id=\"the-docs-map\">The docs map</h3>\n<p>One table, in the manual&#39;s reference part, listing every document in the repository. It is the\nonly complete list, and it is the file that makes the next person&#39;s inventory take ten minutes\ninstead of a morning.</p>\n<table>\n<thead>\n<tr>\n<th>Document</th>\n<th>Kind</th>\n<th>Audience</th>\n<th>Edit rule</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>README.md</code></td>\n<td>Quick start</td>\n<td>anyone arriving</td>\n<td><code>PR</code></td>\n</tr>\n<tr>\n<td><code>docs/MANUAL.md</code></td>\n<td>Manual</td>\n<td>people using or changing the repository</td>\n<td><code>PR</code></td>\n</tr>\n<tr>\n<td>the spec files</td>\n<td>Record: spec</td>\n<td>people changing behaviour</td>\n<td><code>amend</code></td>\n</tr>\n<tr>\n<td>the decisions file</td>\n<td>Record: decisions</td>\n<td>anyone asking &quot;why&quot;</td>\n<td><code>supersede</code></td>\n</tr>\n<tr>\n<td>the status list</td>\n<td>Working: list</td>\n<td>the owner and any active session</td>\n<td><code>strike through and date</code></td>\n</tr>\n<tr>\n<td>the build output</td>\n<td>Generated</td>\n<td>nobody; machines read it</td>\n<td><code>never</code></td>\n</tr>\n</tbody></table>\n<p>One line under the table records the revision whose sources were last read for it — <code>sources re-read at &lt;sha&gt;</code> — the one freshness stamp worth carrying, because it names something a reader can check,\nand because it is where a later <code>update</code> run starts.</p>\n<p>State the repository&#39;s tier in one line of the docs map — or, at the lowest tier, in the README,\nsince there is no map.</p>\n<h3 id=\"the-tier-ladder\">The tier ladder</h3>\n<p>Tiers keep the standard from manufacturing work. A repository is one of three things, and the\nthresholds are opinion.</p>\n<table>\n<thead>\n<tr>\n<th>Tier</th>\n<th>What it is</th>\n<th>What it has</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>0</td>\n<td>Nothing others run or change: a deck, a static site, a delivered report</td>\n<td>A README, with a <strong>Use</strong> section if anything has to be run</td>\n</tr>\n<tr>\n<td>1</td>\n<td>Commands others run, or code others change</td>\n<td>A README, plus a manual once a trigger below fires, plus agent files once theirs fires</td>\n</tr>\n<tr>\n<td>2</td>\n<td>Also a spec another system depends on, a deploy, or a published interface</td>\n<td>A README as the router, a manual with its docs map, and whatever records, runbooks, working documents and agent files it actually uses</td>\n</tr>\n</tbody></table>\n<h3 id=\"triggers-what-creates-each-document\">Triggers — what creates each document</h3>\n<p>Nothing is created because the tier table permits it. Each document appears when its trigger\nfires, and not before.</p>\n<ul>\n<li><strong>Manual:</strong> the README passes its cap; a second audience appears; a task needs more than three\nsteps; a command takes flags or credentials.</li>\n<li><strong>Agent files:</strong> the repository has a rule an agent would break by default, or a rule has had to\nbe repeated to a session. (What goes in them is <code>derive-codebase-context</code>&#39;s.)</li>\n<li><strong>Session prompt:</strong> work regularly spans sessions.</li>\n<li><strong>Handoff:</strong> a piece of work, or a decision, moves to another person or another repository.</li>\n<li><strong>Records:</strong> the first decision somebody will ask &quot;why?&quot; about, or the first spec another system\ndepends on.</li>\n<li><strong>Runbook:</strong> the first operation only one person performs, with credentials.</li>\n<li><strong>Removal:</strong> a document with no reader, or with dead content, is deleted. Version control keeps\nthe history, and a deleted document is cheaper than a wrong one.</li>\n</ul>\n<h3 id=\"visibility\">Visibility</h3>\n<p>Three rules that cut across every kind:</p>\n<ul>\n<li>A public repository does not name or link paths inside a private one.</li>\n<li>A repository a client can see carries no internal link, no internal status, and no internal name\nbeyond a role.</li>\n<li>Examples use patterns and <code>example.com</code> addresses, never a real one — including in a private\nrepository, because a private repository&#39;s contents move.</li>\n</ul>\n","words":1273},{"path":"references/entry-points.md","slug":"entry-points","title":"Entry points","body":"# Entry points\n\nThree, and they share one procedure. They differ in what they may touch, which steps they run, and\nwhat comes back. The word that selects one arrives however the harness delivers it: as the word after\nthe skill name, as an `ARGUMENTS:` line appended to these instructions, or as the request's own\nphrasing. No entry point is a flag, and none of this is frontmatter: a skill is portable only through\nthe text of SKILL.md.\n\n## Choosing one, without asking\n\n| The request | Entry point |\n|---|---|\n| `check`, `need`, `audit`, `review`; \"is the documentation still true\", \"what does this repo need\" | `audit` |\n| `draft`, `ensure`, `write`, `layer`; \"give it a readme and a how-to-use file\", \"make it follow the standard\" | `draft` |\n| `update`, `refresh`; \"the code moved under the docs\", \"bring the docs up to date\" | `update` |\n| No word at all, or a word not listed here | `audit`, and the announcement says the word was not recognised |\n| A **listed** drafting word, on a repository whose layers do not exist yet | `draft`, with the files it will create named before drafting |\n\nA request that names no file to produce and asks for no change is an `audit`. Guessing toward\nread-only costs the reader one word; guessing the other way costs them a diff they did not ask for.\n\nNever stop to ask which entry point to run. State the one chosen, and let the reader redirect.\n\n## `audit` — read-only\n\n**Scope.** Every tracked documentation file at the baseline revision. Research and evidence records\nare read for contradictions but never listed as rot to fix.\n\n**May write.** Nothing inside the repository — no draft, no correction, not the baseline line. The\nnewcomer may edit a disposable clone, which is reverted and whose remote is made inert first.\nAnything the run saves — the claim list, the credential scan — lives outside the working tree, at a\npath the report names.\n\n**Runs.**\n\n1. Prerequisites 1, 2, 3, 5 and 6. Prerequisite 4 is not applicable: nothing is replaced, so there\n   is no scope list and no loss audit. Prerequisite 5 still applies — the newcomer test runs here\n   too, against the documentation as it stands.\n2. Step 1 in full, including the docs map checked against the list of tracked files, and whether a\n   tier line exists at all.\n3. The description check — the registered description against the README's description line — which\n   in a drafting run sits inside step 3.\n4. Step 2, after reading the repository's standing instructions for agent sessions.\n5. Step 6, pass one over the documentation as it stands, pass two over every layer file.\n6. The newcomer test on the main task only, labelled degraded whenever the session that runs it has\n   already read the source.\n7. Named as not applicable, never silently skipped: step 3 beyond the description check and the\n   trigger plan; step 4, since nothing is replaced; and step 5's fix-and-re-run loop, since nothing\n   was fixed. **Step 7 always runs.**\n\n**Where the layers do not exist yet,** step 3 runs as a plan and not a draft: each trigger quoted,\nmarked fired or not fired, with the file it would create and what would go in it.\n\n**Hands back.** The report contract, plus two saved files it links: the numbered claim list with a\nverdict each, and the credential scan, every finding by file and line with the value unread. Both\nare offered rather than pasted, and every count in the report is taken from those rows.\n\n## `draft <files>` — writes the layers\n\n**Scope.** The files named in the request. Where none are named, the layers whose triggers have\nfired, listed and announced before any drafting starts.\n\n**May write.**\n\n- Those files, uncommitted.\n- Pointer-only edits in files that link to content that moved.\n- The baseline line under the docs map — `sources re-read at <sha>` — which is the line a later\n  `update` looks for.\n- A one-line status correction in a document the new layers route readers to, where leaving it would\n  make the drafts contradict it. Anything larger there is reported as a blocker the drafts introduce,\n  not quietly fixed.\n- Nothing else. Records, research and other repositories are not touched.\n\n**Runs.** All seven steps, with four emphases. Only the last is drafting's own; the procedure\nstates the other three for every entry point.\n\n- The loss audit is saved as a row table before any total is quoted, and every total is counted from\n  it.\n- In a repository that is documents only, the newcomer's task is to find the home of a named fact and\n  prepare the change, stopping before anything is pushed.\n- Any edit made in step 6 sends the newcomer test back to a clean state and it runs again.\n- The repository's own test suite runs with the drafts in place, because a test that reads the\n  documentation as data fails on a rewrite that is otherwise correct.\n\n**Hands back.** The report contract, every weakened and lost row individually, and the commands that\nwould land the change — branch, add, commit, open a pull request — written out and not run.\n\n## `update` — the delta since the docs were written\n\n**Scope.** The range from the previous baseline to `HEAD`, and the files that changed in it. The\nprevious baseline is the revision recorded under the docs map as the one whose sources were last\nre-read. Where no such line exists, use the last commit that touched the docs map **before `HEAD`**,\nor the commit that created it, and say that is what was used: the docs map's own most recent commit\nis usually the documentation change itself, which would give an empty range and a run that reports\nnothing moved.\n\n**May write.**\n\n- Passages of the README and the manual that the diff has overtaken.\n- Working documents whose own edit rule allows it — struck through and dated, never rewritten — as a\n  separate patch, kept apart from the layer files.\n- The baseline line itself, which is the one freshness stamp this skill permits, because it names a\n  revision somebody actually re-read.\n- Never a record, a research file, an agent file, or anything in another repository.\n\n**Runs.**\n\n- Step 1 only where files were added or removed.\n- Step 2 over the changed files, plus every claim whose cited source moved in the range.\n- Step 4 over the edited passages, with the sixth verdict, `corrected`, for a passage the update\n  brings back into line.\n- Step 5 only where a command, a path or a step of a task changed. Otherwise the report records\n  \"not run: no task path changed\", which is a result and not a gap.\n- Step 3 over the overtaken passages only, drafted from source like anything else this skill writes.\n- Step 6 over the edited passages only.\n- Step 7 always.\n\n**Hands back.** A delta report: the range, what moved, the patches, what is stale that this entry\npoint may not touch and whose it is, the owner's decisions, and the unknowns.\n\n## The announcement\n\nOne line, before the first read, on every entry point:\n\n```text\nlayer-repository-docs · audit — read-only, baseline <baseline-sha>; writes nothing in the repository; report only\n```\n\nIt carries the entry point, the baseline, what may be written, and what comes back. Reading git\nmetadata — the clone, `rev-parse`, the log — comes first, because the line carries the baseline;\nreading a file for its content comes after. An `update` announces its range rather than one sha. A run that\nchanges entry point — an audit the reader turns into a draft — announces again rather than drifting\ninto writing.\n","bodyHtml":"<h2 id=\"entry-points\">Entry points</h2>\n<p>Three, and they share one procedure. They differ in what they may touch, which steps they run, and\nwhat comes back. The word that selects one arrives however the harness delivers it: as the word after\nthe skill name, as an <code>ARGUMENTS:</code> line appended to these instructions, or as the request&#39;s own\nphrasing. No entry point is a flag, and none of this is frontmatter: a skill is portable only through\nthe text of SKILL.md.</p>\n<h3 id=\"choosing-one-without-asking\">Choosing one, without asking</h3>\n<table>\n<thead>\n<tr>\n<th>The request</th>\n<th>Entry point</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>check</code>, <code>need</code>, <code>audit</code>, <code>review</code>; &quot;is the documentation still true&quot;, &quot;what does this repo need&quot;</td>\n<td><code>audit</code></td>\n</tr>\n<tr>\n<td><code>draft</code>, <code>ensure</code>, <code>write</code>, <code>layer</code>; &quot;give it a readme and a how-to-use file&quot;, &quot;make it follow the standard&quot;</td>\n<td><code>draft</code></td>\n</tr>\n<tr>\n<td><code>update</code>, <code>refresh</code>; &quot;the code moved under the docs&quot;, &quot;bring the docs up to date&quot;</td>\n<td><code>update</code></td>\n</tr>\n<tr>\n<td>No word at all, or a word not listed here</td>\n<td><code>audit</code>, and the announcement says the word was not recognised</td>\n</tr>\n<tr>\n<td>A <strong>listed</strong> drafting word, on a repository whose layers do not exist yet</td>\n<td><code>draft</code>, with the files it will create named before drafting</td>\n</tr>\n</tbody></table>\n<p>A request that names no file to produce and asks for no change is an <code>audit</code>. Guessing toward\nread-only costs the reader one word; guessing the other way costs them a diff they did not ask for.</p>\n<p>Never stop to ask which entry point to run. State the one chosen, and let the reader redirect.</p>\n<h3 id=\"audit-read-only\"><code>audit</code> — read-only</h3>\n<p><strong>Scope.</strong> Every tracked documentation file at the baseline revision. Research and evidence records\nare read for contradictions but never listed as rot to fix.</p>\n<p><strong>May write.</strong> Nothing inside the repository — no draft, no correction, not the baseline line. The\nnewcomer may edit a disposable clone, which is reverted and whose remote is made inert first.\nAnything the run saves — the claim list, the credential scan — lives outside the working tree, at a\npath the report names.</p>\n<p><strong>Runs.</strong></p>\n<ol>\n<li>Prerequisites 1, 2, 3, 5 and 6. Prerequisite 4 is not applicable: nothing is replaced, so there\nis no scope list and no loss audit. Prerequisite 5 still applies — the newcomer test runs here\ntoo, against the documentation as it stands.</li>\n<li>Step 1 in full, including the docs map checked against the list of tracked files, and whether a\ntier line exists at all.</li>\n<li>The description check — the registered description against the README&#39;s description line — which\nin a drafting run sits inside step 3.</li>\n<li>Step 2, after reading the repository&#39;s standing instructions for agent sessions.</li>\n<li>Step 6, pass one over the documentation as it stands, pass two over every layer file.</li>\n<li>The newcomer test on the main task only, labelled degraded whenever the session that runs it has\nalready read the source.</li>\n<li>Named as not applicable, never silently skipped: step 3 beyond the description check and the\ntrigger plan; step 4, since nothing is replaced; and step 5&#39;s fix-and-re-run loop, since nothing\nwas fixed. <strong>Step 7 always runs.</strong></li>\n</ol>\n<p><strong>Where the layers do not exist yet,</strong> step 3 runs as a plan and not a draft: each trigger quoted,\nmarked fired or not fired, with the file it would create and what would go in it.</p>\n<p><strong>Hands back.</strong> The report contract, plus two saved files it links: the numbered claim list with a\nverdict each, and the credential scan, every finding by file and line with the value unread. Both\nare offered rather than pasted, and every count in the report is taken from those rows.</p>\n<h3 id=\"draft-files-writes-the-layers\"><code>draft &lt;files&gt;</code> — writes the layers</h3>\n<p><strong>Scope.</strong> The files named in the request. Where none are named, the layers whose triggers have\nfired, listed and announced before any drafting starts.</p>\n<p><strong>May write.</strong></p>\n<ul>\n<li>Those files, uncommitted.</li>\n<li>Pointer-only edits in files that link to content that moved.</li>\n<li>The baseline line under the docs map — <code>sources re-read at &lt;sha&gt;</code> — which is the line a later\n<code>update</code> looks for.</li>\n<li>A one-line status correction in a document the new layers route readers to, where leaving it would\nmake the drafts contradict it. Anything larger there is reported as a blocker the drafts introduce,\nnot quietly fixed.</li>\n<li>Nothing else. Records, research and other repositories are not touched.</li>\n</ul>\n<p><strong>Runs.</strong> All seven steps, with four emphases. Only the last is drafting&#39;s own; the procedure\nstates the other three for every entry point.</p>\n<ul>\n<li>The loss audit is saved as a row table before any total is quoted, and every total is counted from\nit.</li>\n<li>In a repository that is documents only, the newcomer&#39;s task is to find the home of a named fact and\nprepare the change, stopping before anything is pushed.</li>\n<li>Any edit made in step 6 sends the newcomer test back to a clean state and it runs again.</li>\n<li>The repository&#39;s own test suite runs with the drafts in place, because a test that reads the\ndocumentation as data fails on a rewrite that is otherwise correct.</li>\n</ul>\n<p><strong>Hands back.</strong> The report contract, every weakened and lost row individually, and the commands that\nwould land the change — branch, add, commit, open a pull request — written out and not run.</p>\n<h3 id=\"update-the-delta-since-the-docs-were-written\"><code>update</code> — the delta since the docs were written</h3>\n<p><strong>Scope.</strong> The range from the previous baseline to <code>HEAD</code>, and the files that changed in it. The\nprevious baseline is the revision recorded under the docs map as the one whose sources were last\nre-read. Where no such line exists, use the last commit that touched the docs map <strong>before <code>HEAD</code></strong>,\nor the commit that created it, and say that is what was used: the docs map&#39;s own most recent commit\nis usually the documentation change itself, which would give an empty range and a run that reports\nnothing moved.</p>\n<p><strong>May write.</strong></p>\n<ul>\n<li>Passages of the README and the manual that the diff has overtaken.</li>\n<li>Working documents whose own edit rule allows it — struck through and dated, never rewritten — as a\nseparate patch, kept apart from the layer files.</li>\n<li>The baseline line itself, which is the one freshness stamp this skill permits, because it names a\nrevision somebody actually re-read.</li>\n<li>Never a record, a research file, an agent file, or anything in another repository.</li>\n</ul>\n<p><strong>Runs.</strong></p>\n<ul>\n<li>Step 1 only where files were added or removed.</li>\n<li>Step 2 over the changed files, plus every claim whose cited source moved in the range.</li>\n<li>Step 4 over the edited passages, with the sixth verdict, <code>corrected</code>, for a passage the update\nbrings back into line.</li>\n<li>Step 5 only where a command, a path or a step of a task changed. Otherwise the report records\n&quot;not run: no task path changed&quot;, which is a result and not a gap.</li>\n<li>Step 3 over the overtaken passages only, drafted from source like anything else this skill writes.</li>\n<li>Step 6 over the edited passages only.</li>\n<li>Step 7 always.</li>\n</ul>\n<p><strong>Hands back.</strong> A delta report: the range, what moved, the patches, what is stale that this entry\npoint may not touch and whose it is, the owner&#39;s decisions, and the unknowns.</p>\n<h3 id=\"the-announcement\">The announcement</h3>\n<p>One line, before the first read, on every entry point:</p>\n<pre><code class=\"language-text\">layer-repository-docs · audit — read-only, baseline &lt;baseline-sha&gt;; writes nothing in the repository; report only\n</code></pre>\n<p>It carries the entry point, the baseline, what may be written, and what comes back. Reading git\nmetadata — the clone, <code>rev-parse</code>, the log — comes first, because the line carries the baseline;\nreading a file for its content comes after. An <code>update</code> announces its range rather than one sha. A run that\nchanges entry point — an audit the reader turns into a draft — announces again rather than drifting\ninto writing.</p>\n","words":1300},{"path":"references/layer-contents.md","slug":"layer-contents","title":"Layer contents","body":"# Layer contents\n\nWhat belongs in each of the three layers, in the order it appears, and what is banned from each.\nThe bans matter more than the contents: a layer fails by absorbing the layer below it, and the\nfirst symptom is always that somebody had to update two files for one change.\n\nEvery length threshold here is an opinion. Adopt it, change it, or drop it — but write down\nwhich, because \"60 lines at most\" that nobody agreed to is a rule an agent will enforce against\na human who never heard of it.\n\n## Quick start — the README, at the root of every repository\n\nAnswers four questions and routes: **what is this, who is it for, what is it not, where do I go.**\n\nIn this order:\n\n1. **The repository's name as the heading.**\n2. **A description line**, inside the first few lines, on a line of its own with a machine-findable\n   marker such as an HTML comment. The text after the marker, trimmed, is one sentence, and the\n   repository's registered description on the forge begins with exactly that text. The registered\n   description may add one sentence of negative scope. If the two differ, tell the owner; changing\n   the forge is theirs. This is the one sentence deliberately allowed to exist in two places\n   ([one home per fact](one-home-per-fact.md)), because one of the copies is not in the repository.\n3. **What it is for** — the problem and who has it, in two to four lines.\n4. **Who it is for** — the audiences, in one or two lines.\n5. **What it is not** — concrete limits, in one to three lines. This is the section that saves the\n   most reader time and the one most often missing.\n6. **Start here** — a table with one row per audience goal, each linking into the manual, and to\n   the agent file if the repository has one. A repository with no manual uses a short **Use**\n   section instead.\n7. **Status** — each component as one lifecycle word, each linked to the document that holds its\n   dates. A workable set: `specified` (written, not built) · `building` · `built` (exists, and is\n   either not deployed or has nothing to deploy) · `live` (deployed and serving) · `paused` ·\n   `retired`. One word, because a README is the worst place in the repository to keep a date.\n8. **Owner** — who merges documentation changes here, and how to reach them, using only facts the\n   repository already contains.\n\n**Not in a README:** flags; environment variable names; counts or measured values; schemas, field\nlists or vocabularies; deploy steps; history or dates; credentials; real personal addresses. At\nmost one code block, five lines or fewer, for the primary task.\n\n**Length:** 60 lines (opinion), or the repository's own stricter cap if it has one.\n\nThe README is the layer that grows back. Every time somebody adds \"just one command\" to it, it\nbecomes a manual with no reference section, and then it is the file that goes stale fastest\nbecause it is also the file the forge renders on the landing page.\n\n## Manual — `docs/MANUAL.md`, or a root file named for what it is\n\nTwo parts, kept apart. The split is not decoration: a task and a reference entry age at\ndifferent rates and are read by people in different states of mind.\n\n### Part A — Tasks: how do I get X done?\n\nOne section per goal, named the way the reader would say it, not the way the system is\norganised.\n\n- **Full form:** *When* to use it · *You need* · numbered steps · *It worked if* · *If it fails* ·\n  *Why it works this way*, as a link to a record rather than an essay in place.\n- **Short form:** one line and a link, where a skill or a runbook owns the steps. If the linked\n  procedure is written for agent sessions, the line says so, so a person knows what they are\n  opening before they start following it.\n- The repository's **main task for people** is in full form, and readable without opening a spec\n  or a skill. If the main task can only be followed by opening three other documents, the manual\n  has not been written yet.\n\n### Part B — Reference: what exactly is Y?\n\n- **Prerequisites.**\n- **Commands:** command · purpose · side effects · what it needs · where its flags are\n  documented. A usable side-effect vocabulary: `none` · `writes files` · `reads the forge` ·\n  `network` · `opens a port` · `runs a container`, each with an \"only when …\" where it is\n  conditional. **No flags in this table** — the script's own usage header is their home, and a\n  table of flags is the single most reliable way to publish a lie with a straight face.\n- **Credentials:** the names the repository's own code reads, each with the source file that\n  reads it. Deploy-time variable names are never listed here; link to the runbook.\n- **Layout:** a link to the spec that owns it, or the listing itself if nothing owns it.\n- **Vocabularies:** a link to the schema, or a listing that provably matches it.\n- **Interfaces other systems read**, each with its version rule linked to that rule's home.\n- **Docs map:** every document in the repository with its kind, audience and edit rule. It is the\n  only complete list of documents, and the tier is stated in it.\n\n**Not in a manual:** rationale essays (link to the records); status or history (link to the\nworking documents); deploy-time variable names, endpoints or domains (link to the runbook);\norganisation-wide rules (link to the handbook); counts without a date and a home; credentials;\nreal personal data.\n\n**Split it** into a manual directory with one file per area when it passes roughly 400 lines\n(opinion), when two audiences share no tasks, or when a single task starts carrying a table of\nflags or fields — that last one is the reliable signal, because it means reference content has\nleaked into Part A.\n\n## Handbook — one repository for the whole organisation\n\nThe single organisation-wide set of rules for how repositories are placed, named, documented and\nhanded off, and how people and agent sessions work in them. One repository holds it. Every other\nrepository **links** to it and none copies it.\n\n**It would hold:** the documentation standard itself; cross-repository working rules; the\ncross-repository reference convention; the rule that no credential goes into documentation; an\nindex of repositories built from each README's description line. Where a repository *belongs* —\nplacement, and the policy it inherits — is a separate question with its own owner; the handbook\nrecords the convention only if the organisation keeps it there.\n\n**It would not hold:** anything about one repository's product, data, commands or status, and no\ntool procedure — link to the skill.\n\n**Length:** 200 lines or fewer per page (opinion).\n\nThree constraints that decide whether this layer works at all:\n\n- **It does not exist until a repository is named for it.** Until then, nothing links to it and no\n  file cites it as the source of a rule. A pointer to a handbook that has not been created is\n  worse than no pointer: the reader concludes the rules exist and that the failure is theirs.\n- **The name must not collide with something in the estate.** If any repository describes itself\n  as \"not a handbook\", or ships a product manual it calls a handbook, write the organisation-wide\n  layer's name in full every time so neither reading is possible.\n- **A shared block of agent rules copied into every repository is a separate decision, and a\n  costly one.** It needs a source, a settled wording, and an answer for repositories a client can\n  see. Until all three exist, each repository's agent file holds only its own rules.\n\n## A repository that is a deliverable rather than a system\n\nA deck, a static site, a report handed to a client: quick start only, with a **Use** section if\nanything has to be run. No manual, no records directory, no agent file. Its README's \"what it is\nnot\" section does most of the work, because the commonest failure for this kind of repository is\na reader assuming it is maintained.\n","bodyHtml":"<h2 id=\"layer-contents\">Layer contents</h2>\n<p>What belongs in each of the three layers, in the order it appears, and what is banned from each.\nThe bans matter more than the contents: a layer fails by absorbing the layer below it, and the\nfirst symptom is always that somebody had to update two files for one change.</p>\n<p>Every length threshold here is an opinion. Adopt it, change it, or drop it — but write down\nwhich, because &quot;60 lines at most&quot; that nobody agreed to is a rule an agent will enforce against\na human who never heard of it.</p>\n<h3 id=\"quick-start-the-readme-at-the-root-of-every-repository\">Quick start — the README, at the root of every repository</h3>\n<p>Answers four questions and routes: <strong>what is this, who is it for, what is it not, where do I go.</strong></p>\n<p>In this order:</p>\n<ol>\n<li><strong>The repository&#39;s name as the heading.</strong></li>\n<li><strong>A description line</strong>, inside the first few lines, on a line of its own with a machine-findable\nmarker such as an HTML comment. The text after the marker, trimmed, is one sentence, and the\nrepository&#39;s registered description on the forge begins with exactly that text. The registered\ndescription may add one sentence of negative scope. If the two differ, tell the owner; changing\nthe forge is theirs. This is the one sentence deliberately allowed to exist in two places\n(<a href=\"one-home-per-fact.md\">one home per fact</a>), because one of the copies is not in the repository.</li>\n<li><strong>What it is for</strong> — the problem and who has it, in two to four lines.</li>\n<li><strong>Who it is for</strong> — the audiences, in one or two lines.</li>\n<li><strong>What it is not</strong> — concrete limits, in one to three lines. This is the section that saves the\nmost reader time and the one most often missing.</li>\n<li><strong>Start here</strong> — a table with one row per audience goal, each linking into the manual, and to\nthe agent file if the repository has one. A repository with no manual uses a short <strong>Use</strong>\nsection instead.</li>\n<li><strong>Status</strong> — each component as one lifecycle word, each linked to the document that holds its\ndates. A workable set: <code>specified</code> (written, not built) · <code>building</code> · <code>built</code> (exists, and is\neither not deployed or has nothing to deploy) · <code>live</code> (deployed and serving) · <code>paused</code> ·\n<code>retired</code>. One word, because a README is the worst place in the repository to keep a date.</li>\n<li><strong>Owner</strong> — who merges documentation changes here, and how to reach them, using only facts the\nrepository already contains.</li>\n</ol>\n<p><strong>Not in a README:</strong> flags; environment variable names; counts or measured values; schemas, field\nlists or vocabularies; deploy steps; history or dates; credentials; real personal addresses. At\nmost one code block, five lines or fewer, for the primary task.</p>\n<p><strong>Length:</strong> 60 lines (opinion), or the repository&#39;s own stricter cap if it has one.</p>\n<p>The README is the layer that grows back. Every time somebody adds &quot;just one command&quot; to it, it\nbecomes a manual with no reference section, and then it is the file that goes stale fastest\nbecause it is also the file the forge renders on the landing page.</p>\n<h3 id=\"manual-docsmanualmd-or-a-root-file-named-for-what-it-is\">Manual — <code>docs/MANUAL.md</code>, or a root file named for what it is</h3>\n<p>Two parts, kept apart. The split is not decoration: a task and a reference entry age at\ndifferent rates and are read by people in different states of mind.</p>\n<h4 id=\"part-a-tasks-how-do-i-get-x-done\">Part A — Tasks: how do I get X done?</h4>\n<p>One section per goal, named the way the reader would say it, not the way the system is\norganised.</p>\n<ul>\n<li><strong>Full form:</strong> <em>When</em> to use it · <em>You need</em> · numbered steps · <em>It worked if</em> · <em>If it fails</em> ·\n<em>Why it works this way</em>, as a link to a record rather than an essay in place.</li>\n<li><strong>Short form:</strong> one line and a link, where a skill or a runbook owns the steps. If the linked\nprocedure is written for agent sessions, the line says so, so a person knows what they are\nopening before they start following it.</li>\n<li>The repository&#39;s <strong>main task for people</strong> is in full form, and readable without opening a spec\nor a skill. If the main task can only be followed by opening three other documents, the manual\nhas not been written yet.</li>\n</ul>\n<h4 id=\"part-b-reference-what-exactly-is-y\">Part B — Reference: what exactly is Y?</h4>\n<ul>\n<li><strong>Prerequisites.</strong></li>\n<li><strong>Commands:</strong> command · purpose · side effects · what it needs · where its flags are\ndocumented. A usable side-effect vocabulary: <code>none</code> · <code>writes files</code> · <code>reads the forge</code> ·\n<code>network</code> · <code>opens a port</code> · <code>runs a container</code>, each with an &quot;only when …&quot; where it is\nconditional. <strong>No flags in this table</strong> — the script&#39;s own usage header is their home, and a\ntable of flags is the single most reliable way to publish a lie with a straight face.</li>\n<li><strong>Credentials:</strong> the names the repository&#39;s own code reads, each with the source file that\nreads it. Deploy-time variable names are never listed here; link to the runbook.</li>\n<li><strong>Layout:</strong> a link to the spec that owns it, or the listing itself if nothing owns it.</li>\n<li><strong>Vocabularies:</strong> a link to the schema, or a listing that provably matches it.</li>\n<li><strong>Interfaces other systems read</strong>, each with its version rule linked to that rule&#39;s home.</li>\n<li><strong>Docs map:</strong> every document in the repository with its kind, audience and edit rule. It is the\nonly complete list of documents, and the tier is stated in it.</li>\n</ul>\n<p><strong>Not in a manual:</strong> rationale essays (link to the records); status or history (link to the\nworking documents); deploy-time variable names, endpoints or domains (link to the runbook);\norganisation-wide rules (link to the handbook); counts without a date and a home; credentials;\nreal personal data.</p>\n<p><strong>Split it</strong> into a manual directory with one file per area when it passes roughly 400 lines\n(opinion), when two audiences share no tasks, or when a single task starts carrying a table of\nflags or fields — that last one is the reliable signal, because it means reference content has\nleaked into Part A.</p>\n<h3 id=\"handbook-one-repository-for-the-whole-organisation\">Handbook — one repository for the whole organisation</h3>\n<p>The single organisation-wide set of rules for how repositories are placed, named, documented and\nhanded off, and how people and agent sessions work in them. One repository holds it. Every other\nrepository <strong>links</strong> to it and none copies it.</p>\n<p><strong>It would hold:</strong> the documentation standard itself; cross-repository working rules; the\ncross-repository reference convention; the rule that no credential goes into documentation; an\nindex of repositories built from each README&#39;s description line. Where a repository <em>belongs</em> —\nplacement, and the policy it inherits — is a separate question with its own owner; the handbook\nrecords the convention only if the organisation keeps it there.</p>\n<p><strong>It would not hold:</strong> anything about one repository&#39;s product, data, commands or status, and no\ntool procedure — link to the skill.</p>\n<p><strong>Length:</strong> 200 lines or fewer per page (opinion).</p>\n<p>Three constraints that decide whether this layer works at all:</p>\n<ul>\n<li><strong>It does not exist until a repository is named for it.</strong> Until then, nothing links to it and no\nfile cites it as the source of a rule. A pointer to a handbook that has not been created is\nworse than no pointer: the reader concludes the rules exist and that the failure is theirs.</li>\n<li><strong>The name must not collide with something in the estate.</strong> If any repository describes itself\nas &quot;not a handbook&quot;, or ships a product manual it calls a handbook, write the organisation-wide\nlayer&#39;s name in full every time so neither reading is possible.</li>\n<li><strong>A shared block of agent rules copied into every repository is a separate decision, and a\ncostly one.</strong> It needs a source, a settled wording, and an answer for repositories a client can\nsee. Until all three exist, each repository&#39;s agent file holds only its own rules.</li>\n</ul>\n<h3 id=\"a-repository-that-is-a-deliverable-rather-than-a-system\">A repository that is a deliverable rather than a system</h3>\n<p>A deck, a static site, a report handed to a client: quick start only, with a <strong>Use</strong> section if\nanything has to be run. No manual, no records directory, no agent file. Its README&#39;s &quot;what it is\nnot&quot; section does most of the work, because the commonest failure for this kind of repository is\na reader assuming it is maintained.</p>\n","words":1379},{"path":"references/loss-audit.md","slug":"loss-audit","title":"The loss audit","body":"# The loss audit\n\nEvery fact, rule and warning in a file you replace must have a new home or a stated reason for\nbeing dropped.\n\nThis is the pass with the worst odds of being run, because everything it finds is *absent* from\nthe new draft, and absence does not read as an error. A rewritten file reads better than the one\nit replaced — that is why it was rewritten — and the sentence that used to say \"this is deferred,\nand not to be chased\" is simply not there any more. Nothing is misspelled. Nothing contradicts\nanything. The rule is just gone, and the next session breaks it without ever having seen it.\n\nRun it on every file the run replaces, before the drafts are handed over and while the old file\nis still the version on the default branch.\n\n## The method\n\n1. **Fix the input before drafting.** The list of files being replaced is a prerequisite, not an\n   afterthought. Assembled after the rewrite, it will quietly omit the file whose content you\n   liked least.\n2. **Read the old file at the baseline revision**, not from memory of having edited it, and not\n   from the working tree where it may already be half-replaced.\n3. **Split it into atomic facts and rules.** One claim, one instruction, one warning, one\n   qualifier per row. \"Never push, and never commit unless asked\" is two rows, because a draft can\n   easily keep one and lose the other. Splitting too finely costs a few minutes; splitting too\n   coarsely is how a qualifier disappears inside a rule that was \"kept\".\n4. **Give every row a verdict** from those below, with the evidence for it.\n5. **Report the weakened and lost rows individually**, to the person who owns the file. A total\n   (\"81 rows, 2 lost\") hides exactly the rows the audit exists to surface.\n\n**Save the rows before you quote a total.** Every number in the report is counted from the table,\nand the table is a file the report can link. A total with no rows behind it cannot be checked by\nthe person it is shown to, and \"0 lost\" is the total most worth checking.\n\n## The verdicts\n\n| Verdict | What it means | What the row must carry |\n|---|---|---|\n| **kept** | Present in the new file, with the same force | The new file and section |\n| **moved** | Present, in a different file | The new home, named |\n| **dropped deliberately** | Deliberately not carried forward | The reason, in one sentence, and who it was shown to |\n| **weakened** | Present, but narrower, softer, or missing a qualifier | Both wordings, side by side |\n| **lost** | Not present anywhere, and not deliberate | The old wording, verbatim |\n\n**A sixth verdict, in an `update` run: `corrected`.** A passage the update brings back into line\nwith a source that moved — the row carries both wordings and the `path:line` that moved. It exists\nso that a correction is not filed as `kept`, which would make the audit say nothing changed.\n\n**`weakened` is the verdict people skip.** It is easier to mark a row `kept` because the topic\nsurvived. The test is not whether the topic survived — it is whether the *same instruction* would\nbe followed by somebody reading only the new file.\n\n## A worked pass\n\nThe pilot audited two replaced root files. They split into **81 facts and rules**: 36 kept, 22\nmoved, 9 dropped deliberately, 12 weakened, 2 lost outright.\n\nThe two lost rows were both procedural instructions to agent sessions — one telling a session to\nprepare a change and hand back the command rather than run it, and one recording that a\nparticular past action had been a one-off authorisation rather than a standing permission. Both\nwere invisible in the new draft: nothing in it contradicted them, so no fact-check could have\nfound them.\n\nThe twelve weakenings cost more than the two losses. Four shapes recur:\n\n- **A credentials rule narrowed.** The original applied to a broad class of action; the rewrite\n  applied it to one action. Anybody reading only the rewrite would take the other actions as\n  permitted.\n- **A restriction on editing a class of records loosened without saying so.** The rewrite kept the\n  topic and dropped the prohibition, which reads as permission.\n- **A cross-repository convention tightened into a rule.** The rewrite stated as a requirement\n  something that was a convention in one repository and does not exist in the other repository it\n  governs. A weakening in one direction is a loss; a strengthening in the other is an invention,\n  and the audit catches both because both are differences.\n- **A standing qualifier dropped.** A class of gap was marked \"deferred, later, and not to be\n  chased\". The rewrite kept the gap and dropped the qualifier, so an agent reading it does the\n  helpful thing and chases the owner about something they had already decided to defer.\n\n## What makes an audit worthless\n\n- **Auditing the draft instead of the original.** Reading the new file and asking \"is anything\n  missing?\" cannot work: you are asking the file to report its own omissions.\n- **Doing it after the handover.** Once the replacement is merged, the audit's findings arrive as\n  a second change against a file people have started trusting.\n- **Counting instead of listing.** The number is not the product. The list of weakened and lost\n  rows is the product.\n- **Treating the drafting session's judgement as the reason.** \"Dropped because it was\n  out of date\" is a claim that needs the same source check as anything else. If the reason is that\n  a fact changed, cite the file that changed it.\n- **Skipping files that were only \"reorganised\".** A file split into three is three replacements.\n  Reorganisation is where qualifiers go missing, because each fragment looks complete.\n","bodyHtml":"<h2 id=\"the-loss-audit\">The loss audit</h2>\n<p>Every fact, rule and warning in a file you replace must have a new home or a stated reason for\nbeing dropped.</p>\n<p>This is the pass with the worst odds of being run, because everything it finds is <em>absent</em> from\nthe new draft, and absence does not read as an error. A rewritten file reads better than the one\nit replaced — that is why it was rewritten — and the sentence that used to say &quot;this is deferred,\nand not to be chased&quot; is simply not there any more. Nothing is misspelled. Nothing contradicts\nanything. The rule is just gone, and the next session breaks it without ever having seen it.</p>\n<p>Run it on every file the run replaces, before the drafts are handed over and while the old file\nis still the version on the default branch.</p>\n<h3 id=\"the-method\">The method</h3>\n<ol>\n<li><strong>Fix the input before drafting.</strong> The list of files being replaced is a prerequisite, not an\nafterthought. Assembled after the rewrite, it will quietly omit the file whose content you\nliked least.</li>\n<li><strong>Read the old file at the baseline revision</strong>, not from memory of having edited it, and not\nfrom the working tree where it may already be half-replaced.</li>\n<li><strong>Split it into atomic facts and rules.</strong> One claim, one instruction, one warning, one\nqualifier per row. &quot;Never push, and never commit unless asked&quot; is two rows, because a draft can\neasily keep one and lose the other. Splitting too finely costs a few minutes; splitting too\ncoarsely is how a qualifier disappears inside a rule that was &quot;kept&quot;.</li>\n<li><strong>Give every row a verdict</strong> from those below, with the evidence for it.</li>\n<li><strong>Report the weakened and lost rows individually</strong>, to the person who owns the file. A total\n(&quot;81 rows, 2 lost&quot;) hides exactly the rows the audit exists to surface.</li>\n</ol>\n<p><strong>Save the rows before you quote a total.</strong> Every number in the report is counted from the table,\nand the table is a file the report can link. A total with no rows behind it cannot be checked by\nthe person it is shown to, and &quot;0 lost&quot; is the total most worth checking.</p>\n<h3 id=\"the-verdicts\">The verdicts</h3>\n<table>\n<thead>\n<tr>\n<th>Verdict</th>\n<th>What it means</th>\n<th>What the row must carry</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><strong>kept</strong></td>\n<td>Present in the new file, with the same force</td>\n<td>The new file and section</td>\n</tr>\n<tr>\n<td><strong>moved</strong></td>\n<td>Present, in a different file</td>\n<td>The new home, named</td>\n</tr>\n<tr>\n<td><strong>dropped deliberately</strong></td>\n<td>Deliberately not carried forward</td>\n<td>The reason, in one sentence, and who it was shown to</td>\n</tr>\n<tr>\n<td><strong>weakened</strong></td>\n<td>Present, but narrower, softer, or missing a qualifier</td>\n<td>Both wordings, side by side</td>\n</tr>\n<tr>\n<td><strong>lost</strong></td>\n<td>Not present anywhere, and not deliberate</td>\n<td>The old wording, verbatim</td>\n</tr>\n</tbody></table>\n<p><strong>A sixth verdict, in an <code>update</code> run: <code>corrected</code>.</strong> A passage the update brings back into line\nwith a source that moved — the row carries both wordings and the <code>path:line</code> that moved. It exists\nso that a correction is not filed as <code>kept</code>, which would make the audit say nothing changed.</p>\n<p><strong><code>weakened</code> is the verdict people skip.</strong> It is easier to mark a row <code>kept</code> because the topic\nsurvived. The test is not whether the topic survived — it is whether the <em>same instruction</em> would\nbe followed by somebody reading only the new file.</p>\n<h3 id=\"a-worked-pass\">A worked pass</h3>\n<p>The pilot audited two replaced root files. They split into <strong>81 facts and rules</strong>: 36 kept, 22\nmoved, 9 dropped deliberately, 12 weakened, 2 lost outright.</p>\n<p>The two lost rows were both procedural instructions to agent sessions — one telling a session to\nprepare a change and hand back the command rather than run it, and one recording that a\nparticular past action had been a one-off authorisation rather than a standing permission. Both\nwere invisible in the new draft: nothing in it contradicted them, so no fact-check could have\nfound them.</p>\n<p>The twelve weakenings cost more than the two losses. Four shapes recur:</p>\n<ul>\n<li><strong>A credentials rule narrowed.</strong> The original applied to a broad class of action; the rewrite\napplied it to one action. Anybody reading only the rewrite would take the other actions as\npermitted.</li>\n<li><strong>A restriction on editing a class of records loosened without saying so.</strong> The rewrite kept the\ntopic and dropped the prohibition, which reads as permission.</li>\n<li><strong>A cross-repository convention tightened into a rule.</strong> The rewrite stated as a requirement\nsomething that was a convention in one repository and does not exist in the other repository it\ngoverns. A weakening in one direction is a loss; a strengthening in the other is an invention,\nand the audit catches both because both are differences.</li>\n<li><strong>A standing qualifier dropped.</strong> A class of gap was marked &quot;deferred, later, and not to be\nchased&quot;. The rewrite kept the gap and dropped the qualifier, so an agent reading it does the\nhelpful thing and chases the owner about something they had already decided to defer.</li>\n</ul>\n<h3 id=\"what-makes-an-audit-worthless\">What makes an audit worthless</h3>\n<ul>\n<li><strong>Auditing the draft instead of the original.</strong> Reading the new file and asking &quot;is anything\nmissing?&quot; cannot work: you are asking the file to report its own omissions.</li>\n<li><strong>Doing it after the handover.</strong> Once the replacement is merged, the audit&#39;s findings arrive as\na second change against a file people have started trusting.</li>\n<li><strong>Counting instead of listing.</strong> The number is not the product. The list of weakened and lost\nrows is the product.</li>\n<li><strong>Treating the drafting session&#39;s judgement as the reason.</strong> &quot;Dropped because it was\nout of date&quot; is a claim that needs the same source check as anything else. If the reason is that\na fact changed, cite the file that changed it.</li>\n<li><strong>Skipping files that were only &quot;reorganised&quot;.</strong> A file split into three is three replacements.\nReorganisation is where qualifiers go missing, because each fragment looks complete.</li>\n</ul>\n","words":985},{"path":"references/newcomer-test.md","slug":"newcomer-test","title":"The newcomer test","body":"# The newcomer test\n\nSomeone who has not seen the repository follows the README, then the manual, and performs the\nrepository's main task in a clean clone. Every place they get stuck is a defect in the\ndocumentation.\n\nThis is the only pass that finds the defects caused by what the documentation **does not say**.\nA fact-check compares each written sentence against source and passes every sentence that is\ntrue; it has no way to notice the required field nobody wrote down. In the pilot, three other\npasses ran over the same draft and none of the three blockers below was found by any of them.\n\n## The three blockers it found\n\nAll three are shapes rather than one-off bugs, but they come from one run in one repository.\nTreat them as examples of what this pass finds, not as a list to go looking for.\n\n- **A documented step that failed validation.** The manual's procedure for adding a record omitted\n  a field the validator required. Every sentence in the procedure was true. Following all of them\n  produced an error.\n- **A lookup that silently returned nothing.** An identifier was looked up as the reader had typed\n  it, while the index was keyed in lower case. No error, no warning, an empty result — and a\n  newcomer with no way to tell a missing record from a mis-keyed query.\n- **A worked example whose own subject could not follow it.** The task named a person as its\n  example, and that person lacked the access its first step required. The procedure was correct\n  and unusable by the reader it addressed.\n\nA fourth finding from the same run is the reason the test must be run the way the documentation\nwill actually be used: a command documented as showing the reader something produced output only\nwhen attached to a terminal, so inside a session that was not one it succeeded and printed\nnothing — and the check could be \"passed\" without ever having run. A person and an agent session\nare different environments, and a command that works in only one of them is a documentation\ndefect in the other.\n\n## The protocol\n\n1. **Pick the newcomer's role, and write it down.** Not \"a developer\" — a specific standing: the\n   contractor with read access and no membership, the teammate whose account is invited but not\n   yet a member, the person who has the tool installed but has never authenticated. The role\n   decides which steps are even available to them, and a role chosen after the run is a role\n   chosen to match the result.\n2. **Take a clean clone, and a newcomer who is not the author.** A fresh checkout at the baseline\n   revision with the drafted files copied in, in a directory carrying none of the drafting\n   session's context, none of its caches and none of its uncommitted files. The clone is\n   disposable and its remote is removed before the newcomer starts — `git remote remove origin`,\n   because a clone whose origin is somebody's working copy is one `git push` away from writing into\n   it. The child is given the clone path and the task, and no write-capable tool the task does not\n   need; where the harness cannot withhold them, that is a degradation the report states. The reader must be a\n   person, or a child session given only that path and the task — never the session that wrote the\n   files, which cannot un-know what it left out. Drafting in the same tree makes every step pass.\n3. **Where the repository is documents rather than code, the task is still a task.** Find the home\n   of a named fact and prepare the change to it, stopping before anything is pushed. \"Read the\n   documentation\" is not a task, and a repository with no build to run still has a main thing\n   people come to it to do.\n4. **Read only what the documentation routes you to**, in the order it routes you. Do not open a\n   spec because you know it explains the thing. Being unable to find something is the finding.\n5. **Do only what is safe.** No commit, no push, no pull request, no write to any third-party\n   system, no container, nothing that spends money or notifies a person. Where a step would do one\n   of those, stop at the boundary and record that you stopped there — a step that could not be\n   attempted is a result, not a pass.\n6. **Record every stop.** What the documentation said, what happened, and what you would have\n   needed to know. Include the small ones: the missing example, the unexplained abbreviation, the\n   \"ask the owner\" that does not say who the owner is.\n7. **Fix, then re-run from the same clean state.** A fix verified in the tree where it was written\n   is not verified. Re-clone.\n\n## What counts as a blocker\n\n- The step produced an error.\n- The step succeeded and produced nothing, and the documentation implied it would produce\n  something.\n- The documentation did not say where to go next, and more than one next step existed.\n- The documentation named a person, an authority or a document that could not be reached.\n- The environment differed from what the documentation assumed and it did not say which\n  environment it assumed — engine versions, an interactive terminal, an authenticated tool.\n\nEverything else is a defect of a smaller size, and still goes in the list.\n\n## Degradations, and how to report them\n\nThe test is worth running degraded. It is not worth **claiming** undegraded.\n\n| What is missing | What the test still catches | What it no longer catches | Say in the report |\n|---|---|---|---|\n| A second clone | Routing, gaps, missing examples | Anything depending on a cached or uncommitted file | \"Run in the working tree, not a clean clone.\" |\n| The newcomer's real permissions | Everything the reader can read | Whether the reader could have performed the step at all | \"Permissions not reproduced; the access steps were read, not run.\" |\n| Access to a third-party system | Every local step | The half of the task that leaves the machine | \"Stopped at the boundary; the remaining N steps were not attempted.\" |\n| A human newcomer | Most of it | Whatever a person would have found confusing but an agent would not | \"Run by an agent session.\" |\n| A reader who had not already read the source | Routing, gaps, missing examples | Anything the reader supplies from memory of the code rather than from the documentation | \"Run by a session that had already read the source.\" |\n| Anything drafted — an `audit` | Whether the documentation as it stands routes a reader to the answer | Any defect a draft would have introduced | \"Run against the documentation as it stands; nothing was drafted.\" |\n\nA planned test that returned no results is not a run. Report it as not run, never as passed: in\nthe pilot's first round, the test was planned, produced nothing, and the draft carried on as\nthough the repository had been walked through — which is precisely how a document comes to claim\na check nobody performed.\n","bodyHtml":"<h2 id=\"the-newcomer-test\">The newcomer test</h2>\n<p>Someone who has not seen the repository follows the README, then the manual, and performs the\nrepository&#39;s main task in a clean clone. Every place they get stuck is a defect in the\ndocumentation.</p>\n<p>This is the only pass that finds the defects caused by what the documentation <strong>does not say</strong>.\nA fact-check compares each written sentence against source and passes every sentence that is\ntrue; it has no way to notice the required field nobody wrote down. In the pilot, three other\npasses ran over the same draft and none of the three blockers below was found by any of them.</p>\n<h3 id=\"the-three-blockers-it-found\">The three blockers it found</h3>\n<p>All three are shapes rather than one-off bugs, but they come from one run in one repository.\nTreat them as examples of what this pass finds, not as a list to go looking for.</p>\n<ul>\n<li><strong>A documented step that failed validation.</strong> The manual&#39;s procedure for adding a record omitted\na field the validator required. Every sentence in the procedure was true. Following all of them\nproduced an error.</li>\n<li><strong>A lookup that silently returned nothing.</strong> An identifier was looked up as the reader had typed\nit, while the index was keyed in lower case. No error, no warning, an empty result — and a\nnewcomer with no way to tell a missing record from a mis-keyed query.</li>\n<li><strong>A worked example whose own subject could not follow it.</strong> The task named a person as its\nexample, and that person lacked the access its first step required. The procedure was correct\nand unusable by the reader it addressed.</li>\n</ul>\n<p>A fourth finding from the same run is the reason the test must be run the way the documentation\nwill actually be used: a command documented as showing the reader something produced output only\nwhen attached to a terminal, so inside a session that was not one it succeeded and printed\nnothing — and the check could be &quot;passed&quot; without ever having run. A person and an agent session\nare different environments, and a command that works in only one of them is a documentation\ndefect in the other.</p>\n<h3 id=\"the-protocol\">The protocol</h3>\n<ol>\n<li><strong>Pick the newcomer&#39;s role, and write it down.</strong> Not &quot;a developer&quot; — a specific standing: the\ncontractor with read access and no membership, the teammate whose account is invited but not\nyet a member, the person who has the tool installed but has never authenticated. The role\ndecides which steps are even available to them, and a role chosen after the run is a role\nchosen to match the result.</li>\n<li><strong>Take a clean clone, and a newcomer who is not the author.</strong> A fresh checkout at the baseline\nrevision with the drafted files copied in, in a directory carrying none of the drafting\nsession&#39;s context, none of its caches and none of its uncommitted files. The clone is\ndisposable and its remote is removed before the newcomer starts — <code>git remote remove origin</code>,\nbecause a clone whose origin is somebody&#39;s working copy is one <code>git push</code> away from writing into\nit. The child is given the clone path and the task, and no write-capable tool the task does not\nneed; where the harness cannot withhold them, that is a degradation the report states. The reader must be a\nperson, or a child session given only that path and the task — never the session that wrote the\nfiles, which cannot un-know what it left out. Drafting in the same tree makes every step pass.</li>\n<li><strong>Where the repository is documents rather than code, the task is still a task.</strong> Find the home\nof a named fact and prepare the change to it, stopping before anything is pushed. &quot;Read the\ndocumentation&quot; is not a task, and a repository with no build to run still has a main thing\npeople come to it to do.</li>\n<li><strong>Read only what the documentation routes you to</strong>, in the order it routes you. Do not open a\nspec because you know it explains the thing. Being unable to find something is the finding.</li>\n<li><strong>Do only what is safe.</strong> No commit, no push, no pull request, no write to any third-party\nsystem, no container, nothing that spends money or notifies a person. Where a step would do one\nof those, stop at the boundary and record that you stopped there — a step that could not be\nattempted is a result, not a pass.</li>\n<li><strong>Record every stop.</strong> What the documentation said, what happened, and what you would have\nneeded to know. Include the small ones: the missing example, the unexplained abbreviation, the\n&quot;ask the owner&quot; that does not say who the owner is.</li>\n<li><strong>Fix, then re-run from the same clean state.</strong> A fix verified in the tree where it was written\nis not verified. Re-clone.</li>\n</ol>\n<h3 id=\"what-counts-as-a-blocker\">What counts as a blocker</h3>\n<ul>\n<li>The step produced an error.</li>\n<li>The step succeeded and produced nothing, and the documentation implied it would produce\nsomething.</li>\n<li>The documentation did not say where to go next, and more than one next step existed.</li>\n<li>The documentation named a person, an authority or a document that could not be reached.</li>\n<li>The environment differed from what the documentation assumed and it did not say which\nenvironment it assumed — engine versions, an interactive terminal, an authenticated tool.</li>\n</ul>\n<p>Everything else is a defect of a smaller size, and still goes in the list.</p>\n<h3 id=\"degradations-and-how-to-report-them\">Degradations, and how to report them</h3>\n<p>The test is worth running degraded. It is not worth <strong>claiming</strong> undegraded.</p>\n<table>\n<thead>\n<tr>\n<th>What is missing</th>\n<th>What the test still catches</th>\n<th>What it no longer catches</th>\n<th>Say in the report</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>A second clone</td>\n<td>Routing, gaps, missing examples</td>\n<td>Anything depending on a cached or uncommitted file</td>\n<td>&quot;Run in the working tree, not a clean clone.&quot;</td>\n</tr>\n<tr>\n<td>The newcomer&#39;s real permissions</td>\n<td>Everything the reader can read</td>\n<td>Whether the reader could have performed the step at all</td>\n<td>&quot;Permissions not reproduced; the access steps were read, not run.&quot;</td>\n</tr>\n<tr>\n<td>Access to a third-party system</td>\n<td>Every local step</td>\n<td>The half of the task that leaves the machine</td>\n<td>&quot;Stopped at the boundary; the remaining N steps were not attempted.&quot;</td>\n</tr>\n<tr>\n<td>A human newcomer</td>\n<td>Most of it</td>\n<td>Whatever a person would have found confusing but an agent would not</td>\n<td>&quot;Run by an agent session.&quot;</td>\n</tr>\n<tr>\n<td>A reader who had not already read the source</td>\n<td>Routing, gaps, missing examples</td>\n<td>Anything the reader supplies from memory of the code rather than from the documentation</td>\n<td>&quot;Run by a session that had already read the source.&quot;</td>\n</tr>\n<tr>\n<td>Anything drafted — an <code>audit</code></td>\n<td>Whether the documentation as it stands routes a reader to the answer</td>\n<td>Any defect a draft would have introduced</td>\n<td>&quot;Run against the documentation as it stands; nothing was drafted.&quot;</td>\n</tr>\n</tbody></table>\n<p>A planned test that returned no results is not a run. Report it as not run, never as passed: in\nthe pilot&#39;s first round, the test was planned, produced nothing, and the draft carried on as\nthough the repository had been walked through — which is precisely how a document comes to claim\na check nobody performed.</p>\n","words":1211},{"path":"references/one-home-per-fact.md","slug":"one-home-per-fact","title":"One home per fact","body":"# One home per fact\n\n**The rule.** Each fact is maintained in exactly one file — its home. Every other mention links\nto the home instead of restating it. A volatile fact — a count, a status, a version, a\nmeasurement — that appears anywhere but its home carries its date and names its home.\n\nThis is the rule that makes the layers hold. Without it the README acquires a command table, the\nmanual acquires a rationale essay, the working list acquires deploy steps, and each of those\ncopies is correct on the day it is written. The layers are not a filing preference; they are the\nshape that falls out of the rule once you apply it.\n\nThe measurable benefit is not tidiness. It is that a contradiction stops being an argument. When\ntwo files disagree and one of them is the home, the other one is wrong, and fixing it takes a\nminute. When neither is the home, fixing it takes a meeting.\n\n## The fact-to-home table\n\n| Fact | Its home |\n|---|---|\n| Flags and arguments | The script's own usage header |\n| Deploy-time variable names, endpoints, domains, project identifiers, deploy step state | The runbook |\n| Counts and measurements | The generated output, or the dated evidence record |\n| Versions and pins | The pinning file, or the spec that defines the contract |\n| Continuous-integration steps and triggers | The workflow file. The agent file maps its own checks to them rather than describing them |\n| Layout | The spec that owns it; otherwise the manual's reference part |\n| Rules | Organisation-wide: the handbook. Repository: the agent file for sessions, the manual for people. Domain: the spec |\n| Step lists | The one task, runbook or skill that owns the operation |\n| Dated status | The working list, or the runbook for anything deployed |\n| Real personal addresses | Only the records that need them, never any other document |\n| Credentials and passwords | Nowhere in documentation, at any tier, in any repository |\n\n## What may be repeated without breaking the rule\n\nThree things, and the list is deliberately this short:\n\n- **The README's description sentence**, because its other copy is the repository's registered\n  description on the forge, which is outside the repository entirely.\n- **A script name with no flags**, because the name is stable and the flags are not.\n- **A lifecycle word linked to the document that holds its dates** — `live`, `paused`, `retired`.\n  One word carries almost no staleness; a date carries all of it.\n\nEverything else is a link.\n\n## The rot pass\n\nThe pass that finds violations. Run it against source, not against other documentation — the\nwhole point is that documentation is the claim under test.\n\nFor each kind of fact in the table above:\n\n1. **Find the home and read it at the baseline revision.** The workflow file for the triggers.\n   The manifest for the command names. The usage header for the flags. The source file that reads\n   a credential by name.\n2. **Search every documentation file for the same fact**, by value rather than by phrasing — grep\n   for the command name, the variable name, the number.\n3. **Compare, and record the disagreements** with file, line, the source that contradicts them,\n   and which file should be the home.\n\nSix shapes the findings take, with what each one costs:\n\n- **The same fact in two places, disagreeing.** One document says a component is not deployed,\n  another in the same repository says it is live. Whoever reads first is wrong, and there is no\n  way to tell which one that was.\n- **A count gone stale.** A test count that was right when it was typed and is now out by a factor\n  of two. Nothing about the sentence signals its age.\n- **A command, flag or path that does not exist.** Usually a plausible near-miss: the right verb\n  with the wrong noun, or a flag that was renamed. This is the category an agent-written draft\n  inflates the most.\n- **A misstated trigger.** \"The checks run on every push\" where the workflow runs on pull\n  requests, on the default branch and on manual dispatch. Costs a contributor a debugging session\n  they should never have started.\n- **A fact restated outside its home.** Deploy variable names in a working list, deploy state in\n  two sections of the same file. Each copy is a future contradiction that has not happened yet.\n- **A credential in prose.** Report the file and the line. **Do not read, print or copy the\n  value.** Whether to change it is the owner's decision, and it is frequently another repository's\n  work rather than this one's.\n\n## Two traps in the pass itself\n\n- **A stale fact and a wrong fact are different findings.** \"17 tests\" that is now 36 is stale;\n  the fix is a date and a home, or the command that re-measures it. \"runs on every push\" was never\n  true; the fix is a correction. Reporting them in one list makes the owner treat the corrections\n  as maintenance.\n- **A near-miss in the source is still a finding.** Where a source file's own comment disagrees\n  with the code beside it — an option documented as choosing one of two things where the default\n  list holds three — the documentation that copied the comment is not the only defect. Report\n  both, and say which one is the home.\n","bodyHtml":"<h2 id=\"one-home-per-fact\">One home per fact</h2>\n<p><strong>The rule.</strong> Each fact is maintained in exactly one file — its home. Every other mention links\nto the home instead of restating it. A volatile fact — a count, a status, a version, a\nmeasurement — that appears anywhere but its home carries its date and names its home.</p>\n<p>This is the rule that makes the layers hold. Without it the README acquires a command table, the\nmanual acquires a rationale essay, the working list acquires deploy steps, and each of those\ncopies is correct on the day it is written. The layers are not a filing preference; they are the\nshape that falls out of the rule once you apply it.</p>\n<p>The measurable benefit is not tidiness. It is that a contradiction stops being an argument. When\ntwo files disagree and one of them is the home, the other one is wrong, and fixing it takes a\nminute. When neither is the home, fixing it takes a meeting.</p>\n<h3 id=\"the-fact-to-home-table\">The fact-to-home table</h3>\n<table>\n<thead>\n<tr>\n<th>Fact</th>\n<th>Its home</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Flags and arguments</td>\n<td>The script&#39;s own usage header</td>\n</tr>\n<tr>\n<td>Deploy-time variable names, endpoints, domains, project identifiers, deploy step state</td>\n<td>The runbook</td>\n</tr>\n<tr>\n<td>Counts and measurements</td>\n<td>The generated output, or the dated evidence record</td>\n</tr>\n<tr>\n<td>Versions and pins</td>\n<td>The pinning file, or the spec that defines the contract</td>\n</tr>\n<tr>\n<td>Continuous-integration steps and triggers</td>\n<td>The workflow file. The agent file maps its own checks to them rather than describing them</td>\n</tr>\n<tr>\n<td>Layout</td>\n<td>The spec that owns it; otherwise the manual&#39;s reference part</td>\n</tr>\n<tr>\n<td>Rules</td>\n<td>Organisation-wide: the handbook. Repository: the agent file for sessions, the manual for people. Domain: the spec</td>\n</tr>\n<tr>\n<td>Step lists</td>\n<td>The one task, runbook or skill that owns the operation</td>\n</tr>\n<tr>\n<td>Dated status</td>\n<td>The working list, or the runbook for anything deployed</td>\n</tr>\n<tr>\n<td>Real personal addresses</td>\n<td>Only the records that need them, never any other document</td>\n</tr>\n<tr>\n<td>Credentials and passwords</td>\n<td>Nowhere in documentation, at any tier, in any repository</td>\n</tr>\n</tbody></table>\n<h3 id=\"what-may-be-repeated-without-breaking-the-rule\">What may be repeated without breaking the rule</h3>\n<p>Three things, and the list is deliberately this short:</p>\n<ul>\n<li><strong>The README&#39;s description sentence</strong>, because its other copy is the repository&#39;s registered\ndescription on the forge, which is outside the repository entirely.</li>\n<li><strong>A script name with no flags</strong>, because the name is stable and the flags are not.</li>\n<li><strong>A lifecycle word linked to the document that holds its dates</strong> — <code>live</code>, <code>paused</code>, <code>retired</code>.\nOne word carries almost no staleness; a date carries all of it.</li>\n</ul>\n<p>Everything else is a link.</p>\n<h3 id=\"the-rot-pass\">The rot pass</h3>\n<p>The pass that finds violations. Run it against source, not against other documentation — the\nwhole point is that documentation is the claim under test.</p>\n<p>For each kind of fact in the table above:</p>\n<ol>\n<li><strong>Find the home and read it at the baseline revision.</strong> The workflow file for the triggers.\nThe manifest for the command names. The usage header for the flags. The source file that reads\na credential by name.</li>\n<li><strong>Search every documentation file for the same fact</strong>, by value rather than by phrasing — grep\nfor the command name, the variable name, the number.</li>\n<li><strong>Compare, and record the disagreements</strong> with file, line, the source that contradicts them,\nand which file should be the home.</li>\n</ol>\n<p>Six shapes the findings take, with what each one costs:</p>\n<ul>\n<li><strong>The same fact in two places, disagreeing.</strong> One document says a component is not deployed,\nanother in the same repository says it is live. Whoever reads first is wrong, and there is no\nway to tell which one that was.</li>\n<li><strong>A count gone stale.</strong> A test count that was right when it was typed and is now out by a factor\nof two. Nothing about the sentence signals its age.</li>\n<li><strong>A command, flag or path that does not exist.</strong> Usually a plausible near-miss: the right verb\nwith the wrong noun, or a flag that was renamed. This is the category an agent-written draft\ninflates the most.</li>\n<li><strong>A misstated trigger.</strong> &quot;The checks run on every push&quot; where the workflow runs on pull\nrequests, on the default branch and on manual dispatch. Costs a contributor a debugging session\nthey should never have started.</li>\n<li><strong>A fact restated outside its home.</strong> Deploy variable names in a working list, deploy state in\ntwo sections of the same file. Each copy is a future contradiction that has not happened yet.</li>\n<li><strong>A credential in prose.</strong> Report the file and the line. <strong>Do not read, print or copy the\nvalue.</strong> Whether to change it is the owner&#39;s decision, and it is frequently another repository&#39;s\nwork rather than this one&#39;s.</li>\n</ul>\n<h3 id=\"two-traps-in-the-pass-itself\">Two traps in the pass itself</h3>\n<ul>\n<li><strong>A stale fact and a wrong fact are different findings.</strong> &quot;17 tests&quot; that is now 36 is stale;\nthe fix is a date and a home, or the command that re-measures it. &quot;runs on every push&quot; was never\ntrue; the fix is a correction. Reporting them in one list makes the owner treat the corrections\nas maintenance.</li>\n<li><strong>A near-miss in the source is still a finding.</strong> Where a source file&#39;s own comment disagrees\nwith the code beside it — an option documented as choosing one of two things where the default\nlist holds three — the documentation that copied the comment is not the only defect. Report\nboth, and say which one is the home.</li>\n</ul>\n","words":914}],"body":"# Layer a repository's documentation\n\nDocumentation rarely fails by being absent. It fails by being present and wrong, which reads\nexactly like being present and right. A repository with no README is a problem anybody can see\nin a second. A repository whose README says the checks run on every push, while the workflow\nfile runs them on pull requests, on the default branch and on manual dispatch, hands every\nnewcomer a confident wrong answer, and it cost nothing to produce.\n\nMultiply that across an estate. Once an organisation has more repositories than one person can\nhold in their head, each one grows its own front door, its own session-continuation file, and\nits own copy of the same standing rules written in different words. The copies drift, and a\nrule that exists in four wordings is not a rule any more — it is four claims about a rule.\n\nDocumentation an agent drafts fails a third way, and it is the one to plan around: it is\nfluent, it is plausible, and it invents. In the pilot this skill generalises, a first draft was\nfact-checked claim by claim. Of 59 checkable claims, 26 were wrong or misleading. The structure\nwas sound; the detail was decoration. Every command, flag, path and citation had to be checked\nagainst source, and a quarter of them moved.\n\nEvery number in this skill comes from that one run — one repository, one rewrite, one week.\nTake the shapes as transferable and the proportions as not.\n\nThis skill is the shape the documentation takes, the order to build it in, and the four passes\nthat decide whether a draft is fit to hand over. The shape is the easy half.\n\n## What makes a repository legible\n\nThree things, and only the third is hard.\n\n**Three layers, which are roles rather than required files.**\n\n| Layer | Where it lives | The question it answers | Its reader |\n|---|---|---|---|\n| Quick start | `README.md`, at the root of every repository | What is this, is it for me, what is it not, and where do I go? | anyone arriving, with a minute |\n| Manual | `docs/MANUAL.md`, or a root file named for what it is, once a repository outgrows its README | How do I get something done here, and what exactly is each command, credential and file? | people using or changing the repository |\n| Handbook | one repository for the whole organisation; every other repository links to it and none copies it | How are repositories placed, named, documented and handed off, and how do people and agent sessions work in them? | anyone starting or maintaining a repository |\n\nA repository nobody else runs or changes needs only the first. Do not scaffold a layer the\nrepository has no content for — Diátaxis, on its own four-way split: \"It certainly does not\nmean that you should create empty structures for tutorials/howto guides/reference/explanation\nwith nothing in them. Don't do that. It's horrible.\" The contents of each layer, and what is\nbanned from each, are in [layer contents](references/layer-contents.md).\n\n**Other kinds of document beside the layers, because they age at different rates.** Records\n(specs, decisions, research), runbooks, skills, working documents, agent files, sources and\ngenerated files each have a home and an **edit rule** — how this kind of file is allowed to\nchange. A decision is superseded, never rewritten. A dated list is struck through and dated. A\ngenerated file is never hand-edited at all. Mixing kinds in one file means the file has no edit\nrule, and then nobody knows whether correcting it is a fix or a falsification. The kinds, their\nhomes and their edit rules are in [document kinds](references/document-kinds.md).\n\n**One home per fact, which is the rule the other two rest on.** Each fact is maintained in\nexactly one file. Every other mention links to that file rather than restating it. A volatile\nfact — a count, a status, a version, a measurement — repeated anywhere else carries its date\nand names its home. Without this rule the layers will not stay apart: the README grows a\ncommand table, the manual grows a rationale essay, and both restate the deploy variables the\nrunbook owns. With it, a contradiction stops being an argument and becomes a bug with a known\nowner. The fact-to-home table, and the short list of things that may be repeated, are in\n[one home per fact](references/one-home-per-fact.md).\n\nThe artefact that ties them together is the **docs map**: one table in the manual listing every\ndocument in the repository with its kind, its audience and its edit rule. It is the only\ncomplete list of documents, and it is where the repository's tier is stated.\n\n### What this skill does not own\n\n| The job | Whose it is | What this skill does with it |\n|---|---|---|\n| The context files agents load, and the CI gates that stop them rotting | `derive-codebase-context` | Records the agent file as a kind in the docs map with its edit rule; writes none of its content, builds no generated artefact and arms no gate. |\n| Answering one question about the code with re-runnable evidence | `investigate-codebase` | Delegates the fact-check to it and cites path and line, rather than re-deriving an answer in prose. |\n| The record of why a decision was made | `decision-journal` | Names the record as a kind and links it; writes no entry of its own. |\n| What a change that already landed actually did | `describe-changes` | Names it as the home of that fact; paraphrases no diff. |\n| The note for one version, and the semver call | `release-notes` | Makes neither. A version is a fact whose home is the pinning file or the note. |\n| Getting a credential into a secret store | `secure-credential-setup` | Never requests, prints or places one. A credential found in prose is reported by file and line, with the value unread. |\n| Where a repository belongs and which policy it inherits | `workspace-governance` | Reads no manifest and no catalog. The handbook layer is a document, not a placement decision. |\n| Reaching a repository that is not the current tree | `work-in-external-repo` | Assumes the checkout is already the right one, and already proved. |\n| The shape of status output while this runs | `report-progress` | Produces the drafts and the verification report; leaves the reporting shape to it. |\n| Landing the drafts and getting them reviewed | `land-complex-change`, `request-blocks-review` | Hands the drafts over. Opens no pull request and runs no review loop. |\n\nInstall the companions with `npx skills add crissmoldovan/agent-skills`.\n\n## Entry points\n\nOne procedure, three ways in. They differ in what may be touched, which steps run, and what comes\nback. The word that selects one arrives however the harness delivers it — the word after the skill\nname, an `ARGUMENTS:` line appended to these instructions, or the phrasing of the request itself.\n\n| Entry point | Selected by | Scope | May write | Hands back |\n|---|---|---|---|---|\n| `audit` | `check`, `need`, `audit`, `review`; no word; any word not listed here | every tracked document at the baseline | nothing in the repository | the report, the numbered claim list, the credential scan |\n| `draft <files>` | `draft`, `ensure`, `write`, `layer`; \"give it a readme and a manual\" | the files named, or the layers whose triggers have fired | those files, pointer-only edits where content moved, a one-line status correction in a document the drafts route readers to | the report, every weakened and lost row, the land commands unrun |\n| `update` | `update`, `refresh`; \"the code moved under the docs\" | the diff from the previous baseline to `HEAD` | overtaken passages of the README and manual, working documents as a separate patch, the baseline line | a delta report |\n\n**Announce the entry point in one line before the first read, and never ask which to run.**\n\n```text\nlayer-repository-docs · audit — read-only, baseline <baseline-sha>; writes nothing in the repository; report only\n```\n\nReading git metadata — the clone, `rev-parse`, the log — comes before the announcement, because the\nline carries the baseline; reading a file for its content comes after. An `update` announces its\nrange rather than a single revision.\n\nA request that names no file to produce and asks for no change is an `audit`: guessing toward\nread-only costs the reader one word, and guessing the other way costs them a diff they did not ask\nfor. An unrecognised word is an `audit` whose announcement says the word was not recognised. A run\nthat changes entry point announces again rather than drifting into writing. Each one's scope, steps\nand output in full are in [entry points](references/entry-points.md).\n\n## When to Use\n\n- A repository has no README, or one so long that nobody reads past the first screen.\n- Somebody asks for \"a manual\", \"a how-to file at the root\", or a handbook covering repositories\n  in general, and it is not yet clear which of those is one document and which is three.\n- Two documents in the same repository state the same fact and disagree, and nobody can say\n  which one is supposed to be right.\n- An organisation has accumulated more repositories than one person can track, each with its\n  own front door in its own shape.\n- A repository has collected several session-continuation or handoff files at its root, and it\n  is no longer obvious which one a new session should read.\n- Documentation is about to be handed to a newcomer, a contractor or a client, and nobody has\n  read it end to end since the code changed under it.\n\nDo not use it to answer a question about the code: that is `investigate-codebase`, and it is\nbetter at it. Do not use it to write the files an agent loads — those belong to\n`derive-codebase-context`, and this skill only records that they exist and who may edit them.\nAnd do not use it on a document nobody reads: a document with no reader, or with dead content,\nis deleted rather than restructured, because version control keeps the history.\n\n## Prerequisites\n\nA prerequisite an entry point cannot satisfy is recorded as not applicable with its reason, the same\nas a step: an `audit` replaces nothing, so it has no list of files to replace and no drafts to put in\nfront of a newcomer.\n\n1. **A baseline revision, recorded before anything is read for content.** Resolve the default\n   branch to a sha and write it into the draft. Every claim is checked against the files at that\n   revision, read directly, not against the working tree and never against the README — which is\n   one of the claims under test.\n   **Complete when:** the sha is written down, and at least one file has been read at it.\n2. **The repository's own sources located.** The manifest that names the runnable commands, every\n   workflow file, the usage header of each script the documentation mentions, the schemas that\n   define its vocabularies, and the source files that read credentials by name. These are the\n   homes. The documentation is the set of claims about them.\n   **Complete when:** each has a path, and each one that does not exist is written down as\n   absent rather than quietly skipped.\n3. **The owner named, and the route to them.** Who merges a documentation change here, and how a\n   reader reaches them using only facts already in the repository.\n   **Complete when:** a name and a route exist — or the run records the owner as unknown, and\n   the drafts contain no instruction to \"ask the owner\", which is an instruction to nobody.\n4. **The scope stated as files.** Which documents this run may replace, and which it must leave\n   untouched. Research and evidence records are normally not edited at all.\n   **Complete when:** the list of files to be replaced is fixed, because that list is the input\n   to the loss audit and it cannot be assembled afterwards.\n5. **A clean clone, or a stated substitute.** The newcomer test needs a checkout carrying none of\n   this session's context and none of its uncommitted files.\n   **Complete when:** a second clone exists — or the run records that the test ran degraded, and\n   says exactly what was missing from it.\n6. **The publication boundary.** Whether the repository is public, private, or visible to a\n   client, and what that forbids: a public repository names no path in a private one; a\n   client-visible repository carries no internal link, no internal status and no internal name\n   beyond a role.\n   **Complete when:** the visibility is written down together with what it rules out.\n\n## Procedure\n\nThe seven steps below are the whole method; the entry point decides which of them run. A step an\nentry point does not run is **named as not applicable, with its reason** — an unmentioned step reads\nas a step that passed.\n\n1. **Inventory what exists, and classify every document by kind.** List every tracked\n   documentation file, including the ones at the root that nobody planned: session prompts,\n   handover notes, conversation records. Give each one a kind, an audience and an edit rule. Then\n   choose the tier — the amount of structure this repository has earned — with one line of\n   reasons, and state it in the docs map. The tier ladder and its triggers are in\n   [document kinds](references/document-kinds.md).\n   **Complete when:** every tracked documentation file has a kind, an audience and an edit rule,\n   and the tier is chosen and justified in one line.\n\n2. **Find the rot, and give every finding a file, a line and a home.** Rot takes six shapes, and\n   all six are found by reading source and comparing, not by reading documentation and agreeing:\n   the same fact stated in two places where the two disagree; a count or a status that has gone\n   stale; a command, flag or path that does not exist; a misstated trigger, such as a claim that\n   the checks run on every push where the workflow says otherwise; a fact restated outside the\n   document that owns it; and a credential written into prose. Report a credential by its file\n   and its line **without reading, printing or copying the value**. Whether to change it is the\n   owner's decision, and it is frequently another repository's work.\n   Read the repository's own standing instructions for agent sessions before this pass, not after it:\n   a subject the owner has already closed is listed apart as **held back**, with where it is closed,\n   rather than raised again as though it were new. Every finding says whether the repository already\n   tracks it or nobody has recorded it yet, because those go to different people.\n   The pass itself, and the six shapes with what each costs, are in\n   [one home per fact](references/one-home-per-fact.md).\n   **Complete when:** every finding names its file, its line, the source that contradicts it, which\n   file should be its home, and whether it is already tracked.\n\n3. **Draft only what the tier needs, and draft it from source.** Write the README to the quick\n   start contract, the manual to the tasks-and-reference split if its trigger has fired, and\n   nothing else. Every command, flag, path, environment variable, count and citation in the draft\n   comes from the file that owns it at the baseline revision. Where the repository's registered\n   description and the README's description line differ, say so and leave the registered one\n   alone; changing it is the owner's. That comparison is not drafting: an `audit` runs it too.\n   What each layer contains, in order, and what is banned from it, are in\n   [layer contents](references/layer-contents.md).\n   **Complete when:** each drafted file exists in full, and every claim in it can be traced to a\n   path at the baseline revision.\n\n4. **Audit the replaced files for loss.** Split each file you are replacing into its individual\n   facts and rules, and give every one of them a verdict: kept, moved with its new home, dropped\n   deliberately with the reason, weakened, or lost. This is the pass that finds what no\n   fact-check can, because everything it finds is *absent* from the new draft and absence does\n   not read as an error. In the pilot, two replaced files split into 81 facts and rules: 36 kept,\n   22 moved, 9 dropped deliberately, 12 weakened, 2 lost outright. The weakenings cost more than\n   the losses — a credentials rule narrowed, a cross-repository convention tightened into a rule\n   the other repository does not have, and a standing instruction that told agents a class of gap\n   was deferred and **not to be chased** quietly dropped, which turns into an agent chasing the\n   owner about it a week later. The method is in [the loss audit](references/loss-audit.md).\n   Save the rows before quoting any total, and count every total from the saved table: a run that\n   reports \"0 lost\" out of a number nothing can be checked against has audited nothing. An `update`\n   run adds a sixth verdict, **corrected**, for a passage it brings back into line.\n   **Complete when:** every fact and rule in every replaced file carries one of those\n   verdicts, the rows exist as a table the report can link, and the weakened and lost rows are shown\n   to the owner rather than buried in a total.\n\n5. **Run the newcomer test in a clean clone.** Someone who has not seen this repository follows\n   the README, then the manual, and performs the repository's main task — in a fresh checkout,\n   doing only what is safe, stopping short of any write to a third-party system. **The newcomer is\n   never the session that drafted the files.** Dispatch a child given only the clean clone's path\n   and the task, carrying none of this run's context; where the harness cannot withhold that\n   context, the report says the test was run by the drafting session and is degraded. A newcomer\n   who already knows the answer passes every step. Everywhere they get stuck is a defect in the\n   documentation, not in the newcomer. In the pilot this found three blockers that the other three\n   passes over the same draft did not: a documented step that failed validation because it omitted\n   a field the validator required and the manual never mentioned; a lookup that silently returned\n   nothing, because the index keys were lowercased and the manual did not say so; and a task whose\n   own worked example named a person who did not have the access the first step required. Among its\n   other findings was a check command that printed nothing at all when run in a non-interactive\n   session rather than a terminal. The protocol, and what makes a run worthless, are in\n   [the newcomer test](references/newcomer-test.md).\n   In a repository that is documents rather than code, the main task is to find the home of a named\n   fact and prepare the change, stopping before anything is pushed. Any edit made later, in step 6,\n   sends this test back to a clean state and it runs again — a newcomer test whose files have since\n   changed tested a draft that no longer exists.\n   **Complete when:** the main task was attempted end to end, every place the newcomer stopped is\n   recorded as a defect, and each defect that was fixed has been re-run from the same clean state.\n\n6. **Check every claim against source, then check the draft for overreach.** Two separate passes,\n   because they find different things. The first enumerates the checkable claims and gives each a\n   verdict against a path at the baseline revision — where nothing was drafted, \"the draft\" is the\n   documentation as it stands. The second reads the draft for what it *asserts about itself*: a\n   proposal written as though already adopted, a pointer to an authority\n   that does not exist yet, a freshness stamp claiming a review nobody performed, a conformance\n   statement made while the repository fails items of its own checklist. Both are in\n   [the claim check](references/claim-check.md).\n   **Complete when:** every checkable claim has a verdict, and no sentence in the draft claims a\n   status, an authority, a review or a conformance that does not exist.\n\n7. **Report what was verified and what was not, and stop.** A draft that claims a test it did not\n   run is worse than no draft, because it spends the reader's scepticism in the wrong place and\n   they stop looking. Hand back the tier and its reasons, the inventory, the rot list, the loss\n   audit, the newcomer test's blockers, each check with the result it actually produced, the\n   decisions the owner must make, and everything that could not be verified marked as unknown — in\n   the shape the report contract below fixes, because a report nobody finishes reading was not\n   delivered.\n   **Complete when:** the report follows the contract, distinguishes what was run from what was\n   inferred, names every unknown, and nothing has been committed.\n\n## The report contract\n\nEvery entry point ends the same way, in this order:\n\n1. **A verdict line with counts** — what was run, and what it found.\n2. **The ranked findings**, worst first: an id, `file:line`, what it says, the `path:line` that\n   contradicts it, the file that should own it, the verdict, and whether it is already tracked.\n3. **The owner's decisions**, each one answerable without opening a file.\n4. **What was run, what was inferred, and what is unknown**, kept apart.\n\nCap the report at about 80 lines. Longer tables belong in files the report links, and the findings\nare ranked so that the reader can stop early. **If no file can be written, the four parts above go\ninline** and the longer tables are offered rather than pasted — a finding that reached no one was not\na finding. Every total in the report — findings, claims, credential locations — is counted from rows\nthat were saved, and a total whose rows exist nowhere is a failed run, not a short one.\n\n## Usage Examples\n\nA bare word picks the entry point — `check` or `need` audits, `draft` or `ensure` writes the layers,\n`update` takes the delta — and the run says which it chose before it starts. In a harness with slash\ncommands that is\n\n```text\n/layer-repository-docs check\n```\n\nEverything below selects an entry point by phrasing instead, which is how it reads in an agent with\nno slash commands:\n\n```text\nThis repo has grown three files at the root that all claim to explain it and none of them\nagree. Classify every document by kind first and show me the rot list — file, line, and which\nfile should own each fact — before you draft a single replacement.\n```\n\n```text\nWe have far more repositories than anyone can keep track of and every README is a different\nshape. Write the quick start and the manual for this one from the workflow files and the\nscripts' usage headers, not from the README, and tell me which claims in the current README\nturned out to be wrong.\n```\n\n```text\nBefore I merge your documentation rewrite: split every file you are replacing into its facts\nand rules and give each a verdict, then run the newcomer test in a clean clone and tell me\nevery place a newcomer would get stuck. I want the weakened rules listed individually.\n```\n\n## Pitfalls\n\n- **The plausible detail.** An agent drafting documentation fills gaps with what a repository\n  like this one would have: a flag that sounds right, a path that follows the convention, a\n  citation that matches the claim. It costs the reader the ability to trust anything in the\n  document, because there is no visible difference between the invented sentences and the true\n  ones. Check every command, flag, path and citation against the file that owns it.\n- **A proposal written as though it were adopted.** A draft that says \"must\" and \"never\" about a\n  standard nobody has agreed to reads, one week later, as a rule that somebody imposed without\n  asking. State at the top who decides, that nothing is bound yet, and that \"must\" describes what\n  the proposal would require if adopted.\n- **Pointing readers at an authority that does not exist.** Sending anyone — and agent sessions\n  especially — to a handbook that has not been created yet produces a confident dead end: the\n  reader concludes the rules exist and that they simply cannot find them. Until the handbook\n  exists in a named repository, nothing links to it and no file claims it as its source.\n- **Instructions for agent sessions mixed with instructions for people.** They are different\n  rules with different reasons, and a file that addresses both contradicts itself the first time\n  they diverge: \"never enter a credential\" is absolute for a session and wrong for the person who\n  has to enter it. Keep the agent rules in the agent file and say, in the manual, when a linked\n  procedure is written for a session so a person knows what they are opening.\n- **A freshness stamp nobody earned.** \"Last reviewed\" is worth less than nothing unless\n  something defines who counts as a reviewer and how they would know the list of paths is\n  complete. An unearned stamp converts an unread document into an apparently checked one. Leave\n  it out, or make it name the revision whose sources someone actually re-read.\n- **A count in prose.** A test count, a repository count, a number of orgs: true on the day it is\n  typed and quietly false afterwards. In the pilot, a documented test count had roughly doubled by\n  the next time anyone measured, and nothing in the sentence signalled its age. Either give the\n  count a date and name its home, or give the reader the command that re-measures it, or leave it\n  out.\n- **The empty structure.** Creating the manual, the runbook and the records directory for a\n  repository that has one command and one reader produces scaffolding that is immediately stale\n  and that nobody will ever fill. Let the tier decide, and let a document appear when its trigger\n  fires.\n- **Copying the organisation's rules into the repository instead of linking them.** A copied rule\n  is a fork. It is exactly how the same standing instruction ends up in four repositories in four\n  wordings, which is the failure the handbook layer exists to end. One home, everywhere else a\n  link.\n- **The check that would fail the repository's own recent work.** Before proposing any automated\n  documentation check, run it against the last several merged pull requests. Two checks proposed\n  in the pilot would each have blocked ordinary, correct changes. Start every check as a warning.\n\n## Verification\n\n- [ ] The entry point was announced in one line before the first read, and no run stopped to ask\n      which one to take.\n- [ ] Every step the entry point did not run is named as not applicable, with its reason.\n- [ ] The report follows the contract and its cap, or says why it had to be inline, and every total\n      in it comes from rows that were saved.\n- [ ] The baseline revision is recorded, and every claim was checked against files at it.\n- [ ] Every tracked documentation file was inventoried, with a kind, an audience and an edit rule,\n      and the tier is stated with its reasons — in the docs map where one is written.\n- [ ] Each rot finding names a file, a line, the source that contradicts it, and its proper home.\n- [ ] No credential value was read, printed or copied; any credential found is reported by file\n      and line only.\n- [ ] (`draft`, `update`) Every fact and rule in every replaced or edited passage has one of the\n      loss-audit verdicts, and the weakened and lost rows are listed individually.\n- [ ] The newcomer test ran in a clean clone, or the report says it was degraded and how, or — on an\n      `update` where no command, path or task step changed — that it was not run, and why.\n- [ ] Every blocker the newcomer hit is recorded, and every fix was re-run from a clean state.\n- [ ] Every checkable claim has a verdict against a path at the baseline revision — in the drafts\n      where something was drafted, in the documentation as it stands where nothing was.\n- [ ] (`draft`, `update`) No drafted file claims a status, an authority, a review or a conformance\n      that does not exist, and nothing links to a document that has not been created.\n- [ ] No count, deploy-time variable name, endpoint or real personal address appears outside its\n      home without a date and a link; examples use patterns and `example.com` addresses.\n- [ ] Each proposed check was run against recent merged pull requests before being proposed as a\n      failure.\n- [ ] The report separates what was run from what was inferred, and nothing was committed.\n\nThe work is finished when a reader can tell, for every sentence in the draft, which file it came\nfrom — and when everything the drafting could not verify is written down as unverified rather\nthan left to look like the rest.\n\n## Deeper reading\n\n- [Entry points](references/entry-points.md): the three ways in, how a request selects one without\n  a question, and the scope, permitted writes, steps and output of each.\n- [Layer contents](references/layer-contents.md): what belongs in the quick start, the manual and\n  the handbook, in order; what is banned from each; and the length thresholds, marked as opinion.\n- [Document kinds](references/document-kinds.md): every kind beside the three layers with its\n  home and edit rule, the edit-rule vocabulary, the tier ladder and the trigger that creates each\n  document.\n- [One home per fact](references/one-home-per-fact.md): the fact-to-home table, the short list of\n  things that may be repeated, and how to run the pass that finds violations.\n- [The loss audit](references/loss-audit.md): how to split a replaced file into facts and rules,\n  the verdicts, and what a weakened rule costs.\n- [The newcomer test](references/newcomer-test.md): the protocol, what the newcomer is allowed to\n  do, what counts as a blocker, and the shapes of defect only this pass finds.\n- [The claim check](references/claim-check.md): enumerating checkable claims, the five verdicts a\n  claim can take, and the overreach review that reads the draft for what it asserts about itself.\n","bodyHtml":"<h2 id=\"layer-a-repositorys-documentation\">Layer a repository&#39;s documentation</h2>\n<p>Documentation rarely fails by being absent. It fails by being present and wrong, which reads\nexactly like being present and right. A repository with no README is a problem anybody can see\nin a second. A repository whose README says the checks run on every push, while the workflow\nfile runs them on pull requests, on the default branch and on manual dispatch, hands every\nnewcomer a confident wrong answer, and it cost nothing to produce.</p>\n<p>Multiply that across an estate. Once an organisation has more repositories than one person can\nhold in their head, each one grows its own front door, its own session-continuation file, and\nits own copy of the same standing rules written in different words. The copies drift, and a\nrule that exists in four wordings is not a rule any more — it is four claims about a rule.</p>\n<p>Documentation an agent drafts fails a third way, and it is the one to plan around: it is\nfluent, it is plausible, and it invents. In the pilot this skill generalises, a first draft was\nfact-checked claim by claim. Of 59 checkable claims, 26 were wrong or misleading. The structure\nwas sound; the detail was decoration. Every command, flag, path and citation had to be checked\nagainst source, and a quarter of them moved.</p>\n<p>Every number in this skill comes from that one run — one repository, one rewrite, one week.\nTake the shapes as transferable and the proportions as not.</p>\n<p>This skill is the shape the documentation takes, the order to build it in, and the four passes\nthat decide whether a draft is fit to hand over. The shape is the easy half.</p>\n<h3 id=\"what-makes-a-repository-legible\">What makes a repository legible</h3>\n<p>Three things, and only the third is hard.</p>\n<p><strong>Three layers, which are roles rather than required files.</strong></p>\n<table>\n<thead>\n<tr>\n<th>Layer</th>\n<th>Where it lives</th>\n<th>The question it answers</th>\n<th>Its reader</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Quick start</td>\n<td><code>README.md</code>, at the root of every repository</td>\n<td>What is this, is it for me, what is it not, and where do I go?</td>\n<td>anyone arriving, with a minute</td>\n</tr>\n<tr>\n<td>Manual</td>\n<td><code>docs/MANUAL.md</code>, or a root file named for what it is, once a repository outgrows its README</td>\n<td>How do I get something done here, and what exactly is each command, credential and file?</td>\n<td>people using or changing the repository</td>\n</tr>\n<tr>\n<td>Handbook</td>\n<td>one repository for the whole organisation; every other repository links to it and none copies it</td>\n<td>How are repositories placed, named, documented and handed off, and how do people and agent sessions work in them?</td>\n<td>anyone starting or maintaining a repository</td>\n</tr>\n</tbody></table>\n<p>A repository nobody else runs or changes needs only the first. Do not scaffold a layer the\nrepository has no content for — Diátaxis, on its own four-way split: &quot;It certainly does not\nmean that you should create empty structures for tutorials/howto guides/reference/explanation\nwith nothing in them. Don&#39;t do that. It&#39;s horrible.&quot; The contents of each layer, and what is\nbanned from each, are in <a href=\"references/layer-contents.md\">layer contents</a>.</p>\n<p><strong>Other kinds of document beside the layers, because they age at different rates.</strong> Records\n(specs, decisions, research), runbooks, skills, working documents, agent files, sources and\ngenerated files each have a home and an <strong>edit rule</strong> — how this kind of file is allowed to\nchange. A decision is superseded, never rewritten. A dated list is struck through and dated. A\ngenerated file is never hand-edited at all. Mixing kinds in one file means the file has no edit\nrule, and then nobody knows whether correcting it is a fix or a falsification. The kinds, their\nhomes and their edit rules are in <a href=\"references/document-kinds.md\">document kinds</a>.</p>\n<p><strong>One home per fact, which is the rule the other two rest on.</strong> Each fact is maintained in\nexactly one file. Every other mention links to that file rather than restating it. A volatile\nfact — a count, a status, a version, a measurement — repeated anywhere else carries its date\nand names its home. Without this rule the layers will not stay apart: the README grows a\ncommand table, the manual grows a rationale essay, and both restate the deploy variables the\nrunbook owns. With it, a contradiction stops being an argument and becomes a bug with a known\nowner. The fact-to-home table, and the short list of things that may be repeated, are in\n<a href=\"references/one-home-per-fact.md\">one home per fact</a>.</p>\n<p>The artefact that ties them together is the <strong>docs map</strong>: one table in the manual listing every\ndocument in the repository with its kind, its audience and its edit rule. It is the only\ncomplete list of documents, and it is where the repository&#39;s tier is stated.</p>\n<h4 id=\"what-this-skill-does-not-own\">What this skill does not own</h4>\n<table>\n<thead>\n<tr>\n<th>The job</th>\n<th>Whose it is</th>\n<th>What this skill does with it</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>The context files agents load, and the CI gates that stop them rotting</td>\n<td><code>derive-codebase-context</code></td>\n<td>Records the agent file as a kind in the docs map with its edit rule; writes none of its content, builds no generated artefact and arms no gate.</td>\n</tr>\n<tr>\n<td>Answering one question about the code with re-runnable evidence</td>\n<td><code>investigate-codebase</code></td>\n<td>Delegates the fact-check to it and cites path and line, rather than re-deriving an answer in prose.</td>\n</tr>\n<tr>\n<td>The record of why a decision was made</td>\n<td><code>decision-journal</code></td>\n<td>Names the record as a kind and links it; writes no entry of its own.</td>\n</tr>\n<tr>\n<td>What a change that already landed actually did</td>\n<td><code>describe-changes</code></td>\n<td>Names it as the home of that fact; paraphrases no diff.</td>\n</tr>\n<tr>\n<td>The note for one version, and the semver call</td>\n<td><code>release-notes</code></td>\n<td>Makes neither. A version is a fact whose home is the pinning file or the note.</td>\n</tr>\n<tr>\n<td>Getting a credential into a secret store</td>\n<td><code>secure-credential-setup</code></td>\n<td>Never requests, prints or places one. A credential found in prose is reported by file and line, with the value unread.</td>\n</tr>\n<tr>\n<td>Where a repository belongs and which policy it inherits</td>\n<td><code>workspace-governance</code></td>\n<td>Reads no manifest and no catalog. The handbook layer is a document, not a placement decision.</td>\n</tr>\n<tr>\n<td>Reaching a repository that is not the current tree</td>\n<td><code>work-in-external-repo</code></td>\n<td>Assumes the checkout is already the right one, and already proved.</td>\n</tr>\n<tr>\n<td>The shape of status output while this runs</td>\n<td><code>report-progress</code></td>\n<td>Produces the drafts and the verification report; leaves the reporting shape to it.</td>\n</tr>\n<tr>\n<td>Landing the drafts and getting them reviewed</td>\n<td><code>land-complex-change</code>, <code>request-blocks-review</code></td>\n<td>Hands the drafts over. Opens no pull request and runs no review loop.</td>\n</tr>\n</tbody></table>\n<p>Install the companions with <code>npx skills add crissmoldovan/agent-skills</code>.</p>\n<h3 id=\"entry-points\">Entry points</h3>\n<p>One procedure, three ways in. They differ in what may be touched, which steps run, and what comes\nback. The word that selects one arrives however the harness delivers it — the word after the skill\nname, an <code>ARGUMENTS:</code> line appended to these instructions, or the phrasing of the request itself.</p>\n<table>\n<thead>\n<tr>\n<th>Entry point</th>\n<th>Selected by</th>\n<th>Scope</th>\n<th>May write</th>\n<th>Hands back</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>audit</code></td>\n<td><code>check</code>, <code>need</code>, <code>audit</code>, <code>review</code>; no word; any word not listed here</td>\n<td>every tracked document at the baseline</td>\n<td>nothing in the repository</td>\n<td>the report, the numbered claim list, the credential scan</td>\n</tr>\n<tr>\n<td><code>draft &lt;files&gt;</code></td>\n<td><code>draft</code>, <code>ensure</code>, <code>write</code>, <code>layer</code>; &quot;give it a readme and a manual&quot;</td>\n<td>the files named, or the layers whose triggers have fired</td>\n<td>those files, pointer-only edits where content moved, a one-line status correction in a document the drafts route readers to</td>\n<td>the report, every weakened and lost row, the land commands unrun</td>\n</tr>\n<tr>\n<td><code>update</code></td>\n<td><code>update</code>, <code>refresh</code>; &quot;the code moved under the docs&quot;</td>\n<td>the diff from the previous baseline to <code>HEAD</code></td>\n<td>overtaken passages of the README and manual, working documents as a separate patch, the baseline line</td>\n<td>a delta report</td>\n</tr>\n</tbody></table>\n<p><strong>Announce the entry point in one line before the first read, and never ask which to run.</strong></p>\n<pre><code class=\"language-text\">layer-repository-docs · audit — read-only, baseline &lt;baseline-sha&gt;; writes nothing in the repository; report only\n</code></pre>\n<p>Reading git metadata — the clone, <code>rev-parse</code>, the log — comes before the announcement, because the\nline carries the baseline; reading a file for its content comes after. An <code>update</code> announces its\nrange rather than a single revision.</p>\n<p>A request that names no file to produce and asks for no change is an <code>audit</code>: guessing toward\nread-only costs the reader one word, and guessing the other way costs them a diff they did not ask\nfor. An unrecognised word is an <code>audit</code> whose announcement says the word was not recognised. A run\nthat changes entry point announces again rather than drifting into writing. Each one&#39;s scope, steps\nand output in full are in <a href=\"references/entry-points.md\">entry points</a>.</p>\n<h3 id=\"when-to-use\">When to Use</h3>\n<ul>\n<li>A repository has no README, or one so long that nobody reads past the first screen.</li>\n<li>Somebody asks for &quot;a manual&quot;, &quot;a how-to file at the root&quot;, or a handbook covering repositories\nin general, and it is not yet clear which of those is one document and which is three.</li>\n<li>Two documents in the same repository state the same fact and disagree, and nobody can say\nwhich one is supposed to be right.</li>\n<li>An organisation has accumulated more repositories than one person can track, each with its\nown front door in its own shape.</li>\n<li>A repository has collected several session-continuation or handoff files at its root, and it\nis no longer obvious which one a new session should read.</li>\n<li>Documentation is about to be handed to a newcomer, a contractor or a client, and nobody has\nread it end to end since the code changed under it.</li>\n</ul>\n<p>Do not use it to answer a question about the code: that is <code>investigate-codebase</code>, and it is\nbetter at it. Do not use it to write the files an agent loads — those belong to\n<code>derive-codebase-context</code>, and this skill only records that they exist and who may edit them.\nAnd do not use it on a document nobody reads: a document with no reader, or with dead content,\nis deleted rather than restructured, because version control keeps the history.</p>\n<h3 id=\"prerequisites\">Prerequisites</h3>\n<p>A prerequisite an entry point cannot satisfy is recorded as not applicable with its reason, the same\nas a step: an <code>audit</code> replaces nothing, so it has no list of files to replace and no drafts to put in\nfront of a newcomer.</p>\n<ol>\n<li><strong>A baseline revision, recorded before anything is read for content.</strong> Resolve the default\nbranch to a sha and write it into the draft. Every claim is checked against the files at that\nrevision, read directly, not against the working tree and never against the README — which is\none of the claims under test.\n<strong>Complete when:</strong> the sha is written down, and at least one file has been read at it.</li>\n<li><strong>The repository&#39;s own sources located.</strong> The manifest that names the runnable commands, every\nworkflow file, the usage header of each script the documentation mentions, the schemas that\ndefine its vocabularies, and the source files that read credentials by name. These are the\nhomes. The documentation is the set of claims about them.\n<strong>Complete when:</strong> each has a path, and each one that does not exist is written down as\nabsent rather than quietly skipped.</li>\n<li><strong>The owner named, and the route to them.</strong> Who merges a documentation change here, and how a\nreader reaches them using only facts already in the repository.\n<strong>Complete when:</strong> a name and a route exist — or the run records the owner as unknown, and\nthe drafts contain no instruction to &quot;ask the owner&quot;, which is an instruction to nobody.</li>\n<li><strong>The scope stated as files.</strong> Which documents this run may replace, and which it must leave\nuntouched. Research and evidence records are normally not edited at all.\n<strong>Complete when:</strong> the list of files to be replaced is fixed, because that list is the input\nto the loss audit and it cannot be assembled afterwards.</li>\n<li><strong>A clean clone, or a stated substitute.</strong> The newcomer test needs a checkout carrying none of\nthis session&#39;s context and none of its uncommitted files.\n<strong>Complete when:</strong> a second clone exists — or the run records that the test ran degraded, and\nsays exactly what was missing from it.</li>\n<li><strong>The publication boundary.</strong> Whether the repository is public, private, or visible to a\nclient, and what that forbids: a public repository names no path in a private one; a\nclient-visible repository carries no internal link, no internal status and no internal name\nbeyond a role.\n<strong>Complete when:</strong> the visibility is written down together with what it rules out.</li>\n</ol>\n<h3 id=\"procedure\">Procedure</h3>\n<p>The seven steps below are the whole method; the entry point decides which of them run. A step an\nentry point does not run is <strong>named as not applicable, with its reason</strong> — an unmentioned step reads\nas a step that passed.</p>\n<ol>\n<li><p><strong>Inventory what exists, and classify every document by kind.</strong> List every tracked\ndocumentation file, including the ones at the root that nobody planned: session prompts,\nhandover notes, conversation records. Give each one a kind, an audience and an edit rule. Then\nchoose the tier — the amount of structure this repository has earned — with one line of\nreasons, and state it in the docs map. The tier ladder and its triggers are in\n<a href=\"references/document-kinds.md\">document kinds</a>.\n<strong>Complete when:</strong> every tracked documentation file has a kind, an audience and an edit rule,\nand the tier is chosen and justified in one line.</p>\n</li>\n<li><p><strong>Find the rot, and give every finding a file, a line and a home.</strong> Rot takes six shapes, and\nall six are found by reading source and comparing, not by reading documentation and agreeing:\nthe same fact stated in two places where the two disagree; a count or a status that has gone\nstale; a command, flag or path that does not exist; a misstated trigger, such as a claim that\nthe checks run on every push where the workflow says otherwise; a fact restated outside the\ndocument that owns it; and a credential written into prose. Report a credential by its file\nand its line <strong>without reading, printing or copying the value</strong>. Whether to change it is the\nowner&#39;s decision, and it is frequently another repository&#39;s work.\nRead the repository&#39;s own standing instructions for agent sessions before this pass, not after it:\na subject the owner has already closed is listed apart as <strong>held back</strong>, with where it is closed,\nrather than raised again as though it were new. Every finding says whether the repository already\ntracks it or nobody has recorded it yet, because those go to different people.\nThe pass itself, and the six shapes with what each costs, are in\n<a href=\"references/one-home-per-fact.md\">one home per fact</a>.\n<strong>Complete when:</strong> every finding names its file, its line, the source that contradicts it, which\nfile should be its home, and whether it is already tracked.</p>\n</li>\n<li><p><strong>Draft only what the tier needs, and draft it from source.</strong> Write the README to the quick\nstart contract, the manual to the tasks-and-reference split if its trigger has fired, and\nnothing else. Every command, flag, path, environment variable, count and citation in the draft\ncomes from the file that owns it at the baseline revision. Where the repository&#39;s registered\ndescription and the README&#39;s description line differ, say so and leave the registered one\nalone; changing it is the owner&#39;s. That comparison is not drafting: an <code>audit</code> runs it too.\nWhat each layer contains, in order, and what is banned from it, are in\n<a href=\"references/layer-contents.md\">layer contents</a>.\n<strong>Complete when:</strong> each drafted file exists in full, and every claim in it can be traced to a\npath at the baseline revision.</p>\n</li>\n<li><p><strong>Audit the replaced files for loss.</strong> Split each file you are replacing into its individual\nfacts and rules, and give every one of them a verdict: kept, moved with its new home, dropped\ndeliberately with the reason, weakened, or lost. This is the pass that finds what no\nfact-check can, because everything it finds is <em>absent</em> from the new draft and absence does\nnot read as an error. In the pilot, two replaced files split into 81 facts and rules: 36 kept,\n22 moved, 9 dropped deliberately, 12 weakened, 2 lost outright. The weakenings cost more than\nthe losses — a credentials rule narrowed, a cross-repository convention tightened into a rule\nthe other repository does not have, and a standing instruction that told agents a class of gap\nwas deferred and <strong>not to be chased</strong> quietly dropped, which turns into an agent chasing the\nowner about it a week later. The method is in <a href=\"references/loss-audit.md\">the loss audit</a>.\nSave the rows before quoting any total, and count every total from the saved table: a run that\nreports &quot;0 lost&quot; out of a number nothing can be checked against has audited nothing. An <code>update</code>\nrun adds a sixth verdict, <strong>corrected</strong>, for a passage it brings back into line.\n<strong>Complete when:</strong> every fact and rule in every replaced file carries one of those\nverdicts, the rows exist as a table the report can link, and the weakened and lost rows are shown\nto the owner rather than buried in a total.</p>\n</li>\n<li><p><strong>Run the newcomer test in a clean clone.</strong> Someone who has not seen this repository follows\nthe README, then the manual, and performs the repository&#39;s main task — in a fresh checkout,\ndoing only what is safe, stopping short of any write to a third-party system. <strong>The newcomer is\nnever the session that drafted the files.</strong> Dispatch a child given only the clean clone&#39;s path\nand the task, carrying none of this run&#39;s context; where the harness cannot withhold that\ncontext, the report says the test was run by the drafting session and is degraded. A newcomer\nwho already knows the answer passes every step. Everywhere they get stuck is a defect in the\ndocumentation, not in the newcomer. In the pilot this found three blockers that the other three\npasses over the same draft did not: a documented step that failed validation because it omitted\na field the validator required and the manual never mentioned; a lookup that silently returned\nnothing, because the index keys were lowercased and the manual did not say so; and a task whose\nown worked example named a person who did not have the access the first step required. Among its\nother findings was a check command that printed nothing at all when run in a non-interactive\nsession rather than a terminal. The protocol, and what makes a run worthless, are in\n<a href=\"references/newcomer-test.md\">the newcomer test</a>.\nIn a repository that is documents rather than code, the main task is to find the home of a named\nfact and prepare the change, stopping before anything is pushed. Any edit made later, in step 6,\nsends this test back to a clean state and it runs again — a newcomer test whose files have since\nchanged tested a draft that no longer exists.\n<strong>Complete when:</strong> the main task was attempted end to end, every place the newcomer stopped is\nrecorded as a defect, and each defect that was fixed has been re-run from the same clean state.</p>\n</li>\n<li><p><strong>Check every claim against source, then check the draft for overreach.</strong> Two separate passes,\nbecause they find different things. The first enumerates the checkable claims and gives each a\nverdict against a path at the baseline revision — where nothing was drafted, &quot;the draft&quot; is the\ndocumentation as it stands. The second reads the draft for what it <em>asserts about itself</em>: a\nproposal written as though already adopted, a pointer to an authority\nthat does not exist yet, a freshness stamp claiming a review nobody performed, a conformance\nstatement made while the repository fails items of its own checklist. Both are in\n<a href=\"references/claim-check.md\">the claim check</a>.\n<strong>Complete when:</strong> every checkable claim has a verdict, and no sentence in the draft claims a\nstatus, an authority, a review or a conformance that does not exist.</p>\n</li>\n<li><p><strong>Report what was verified and what was not, and stop.</strong> A draft that claims a test it did not\nrun is worse than no draft, because it spends the reader&#39;s scepticism in the wrong place and\nthey stop looking. Hand back the tier and its reasons, the inventory, the rot list, the loss\naudit, the newcomer test&#39;s blockers, each check with the result it actually produced, the\ndecisions the owner must make, and everything that could not be verified marked as unknown — in\nthe shape the report contract below fixes, because a report nobody finishes reading was not\ndelivered.\n<strong>Complete when:</strong> the report follows the contract, distinguishes what was run from what was\ninferred, names every unknown, and nothing has been committed.</p>\n</li>\n</ol>\n<h3 id=\"the-report-contract\">The report contract</h3>\n<p>Every entry point ends the same way, in this order:</p>\n<ol>\n<li><strong>A verdict line with counts</strong> — what was run, and what it found.</li>\n<li><strong>The ranked findings</strong>, worst first: an id, <code>file:line</code>, what it says, the <code>path:line</code> that\ncontradicts it, the file that should own it, the verdict, and whether it is already tracked.</li>\n<li><strong>The owner&#39;s decisions</strong>, each one answerable without opening a file.</li>\n<li><strong>What was run, what was inferred, and what is unknown</strong>, kept apart.</li>\n</ol>\n<p>Cap the report at about 80 lines. Longer tables belong in files the report links, and the findings\nare ranked so that the reader can stop early. <strong>If no file can be written, the four parts above go\ninline</strong> and the longer tables are offered rather than pasted — a finding that reached no one was not\na finding. Every total in the report — findings, claims, credential locations — is counted from rows\nthat were saved, and a total whose rows exist nowhere is a failed run, not a short one.</p>\n<h3 id=\"usage-examples\">Usage Examples</h3>\n<p>A bare word picks the entry point — <code>check</code> or <code>need</code> audits, <code>draft</code> or <code>ensure</code> writes the layers,\n<code>update</code> takes the delta — and the run says which it chose before it starts. In a harness with slash\ncommands that is</p>\n<pre><code class=\"language-text\">/layer-repository-docs check\n</code></pre>\n<p>Everything below selects an entry point by phrasing instead, which is how it reads in an agent with\nno slash commands:</p>\n<pre><code class=\"language-text\">This repo has grown three files at the root that all claim to explain it and none of them\nagree. Classify every document by kind first and show me the rot list — file, line, and which\nfile should own each fact — before you draft a single replacement.\n</code></pre>\n<pre><code class=\"language-text\">We have far more repositories than anyone can keep track of and every README is a different\nshape. Write the quick start and the manual for this one from the workflow files and the\nscripts&#39; usage headers, not from the README, and tell me which claims in the current README\nturned out to be wrong.\n</code></pre>\n<pre><code class=\"language-text\">Before I merge your documentation rewrite: split every file you are replacing into its facts\nand rules and give each a verdict, then run the newcomer test in a clean clone and tell me\nevery place a newcomer would get stuck. I want the weakened rules listed individually.\n</code></pre>\n<h3 id=\"pitfalls\">Pitfalls</h3>\n<ul>\n<li><strong>The plausible detail.</strong> An agent drafting documentation fills gaps with what a repository\nlike this one would have: a flag that sounds right, a path that follows the convention, a\ncitation that matches the claim. It costs the reader the ability to trust anything in the\ndocument, because there is no visible difference between the invented sentences and the true\nones. Check every command, flag, path and citation against the file that owns it.</li>\n<li><strong>A proposal written as though it were adopted.</strong> A draft that says &quot;must&quot; and &quot;never&quot; about a\nstandard nobody has agreed to reads, one week later, as a rule that somebody imposed without\nasking. State at the top who decides, that nothing is bound yet, and that &quot;must&quot; describes what\nthe proposal would require if adopted.</li>\n<li><strong>Pointing readers at an authority that does not exist.</strong> Sending anyone — and agent sessions\nespecially — to a handbook that has not been created yet produces a confident dead end: the\nreader concludes the rules exist and that they simply cannot find them. Until the handbook\nexists in a named repository, nothing links to it and no file claims it as its source.</li>\n<li><strong>Instructions for agent sessions mixed with instructions for people.</strong> They are different\nrules with different reasons, and a file that addresses both contradicts itself the first time\nthey diverge: &quot;never enter a credential&quot; is absolute for a session and wrong for the person who\nhas to enter it. Keep the agent rules in the agent file and say, in the manual, when a linked\nprocedure is written for a session so a person knows what they are opening.</li>\n<li><strong>A freshness stamp nobody earned.</strong> &quot;Last reviewed&quot; is worth less than nothing unless\nsomething defines who counts as a reviewer and how they would know the list of paths is\ncomplete. An unearned stamp converts an unread document into an apparently checked one. Leave\nit out, or make it name the revision whose sources someone actually re-read.</li>\n<li><strong>A count in prose.</strong> A test count, a repository count, a number of orgs: true on the day it is\ntyped and quietly false afterwards. In the pilot, a documented test count had roughly doubled by\nthe next time anyone measured, and nothing in the sentence signalled its age. Either give the\ncount a date and name its home, or give the reader the command that re-measures it, or leave it\nout.</li>\n<li><strong>The empty structure.</strong> Creating the manual, the runbook and the records directory for a\nrepository that has one command and one reader produces scaffolding that is immediately stale\nand that nobody will ever fill. Let the tier decide, and let a document appear when its trigger\nfires.</li>\n<li><strong>Copying the organisation&#39;s rules into the repository instead of linking them.</strong> A copied rule\nis a fork. It is exactly how the same standing instruction ends up in four repositories in four\nwordings, which is the failure the handbook layer exists to end. One home, everywhere else a\nlink.</li>\n<li><strong>The check that would fail the repository&#39;s own recent work.</strong> Before proposing any automated\ndocumentation check, run it against the last several merged pull requests. Two checks proposed\nin the pilot would each have blocked ordinary, correct changes. Start every check as a warning.</li>\n</ul>\n<h3 id=\"verification\">Verification</h3>\n<ul>\n<li><input disabled=\"\" type=\"checkbox\"> The entry point was announced in one line before the first read, and no run stopped to ask\nwhich one to take.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Every step the entry point did not run is named as not applicable, with its reason.</li>\n<li><input disabled=\"\" type=\"checkbox\"> The report follows the contract and its cap, or says why it had to be inline, and every total\nin it comes from rows that were saved.</li>\n<li><input disabled=\"\" type=\"checkbox\"> The baseline revision is recorded, and every claim was checked against files at it.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Every tracked documentation file was inventoried, with a kind, an audience and an edit rule,\nand the tier is stated with its reasons — in the docs map where one is written.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Each rot finding names a file, a line, the source that contradicts it, and its proper home.</li>\n<li><input disabled=\"\" type=\"checkbox\"> No credential value was read, printed or copied; any credential found is reported by file\nand line only.</li>\n<li><input disabled=\"\" type=\"checkbox\"> (<code>draft</code>, <code>update</code>) Every fact and rule in every replaced or edited passage has one of the\nloss-audit verdicts, and the weakened and lost rows are listed individually.</li>\n<li><input disabled=\"\" type=\"checkbox\"> The newcomer test ran in a clean clone, or the report says it was degraded and how, or — on an\n<code>update</code> where no command, path or task step changed — that it was not run, and why.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Every blocker the newcomer hit is recorded, and every fix was re-run from a clean state.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Every checkable claim has a verdict against a path at the baseline revision — in the drafts\nwhere something was drafted, in the documentation as it stands where nothing was.</li>\n<li><input disabled=\"\" type=\"checkbox\"> (<code>draft</code>, <code>update</code>) No drafted file claims a status, an authority, a review or a conformance\nthat does not exist, and nothing links to a document that has not been created.</li>\n<li><input disabled=\"\" type=\"checkbox\"> No count, deploy-time variable name, endpoint or real personal address appears outside its\nhome without a date and a link; examples use patterns and <code>example.com</code> addresses.</li>\n<li><input disabled=\"\" type=\"checkbox\"> Each proposed check was run against recent merged pull requests before being proposed as a\nfailure.</li>\n<li><input disabled=\"\" type=\"checkbox\"> The report separates what was run from what was inferred, and nothing was committed.</li>\n</ul>\n<p>The work is finished when a reader can tell, for every sentence in the draft, which file it came\nfrom — and when everything the drafting could not verify is written down as unverified rather\nthan left to look like the rest.</p>\n<h3 id=\"deeper-reading\">Deeper reading</h3>\n<ul>\n<li><a href=\"references/entry-points.md\">Entry points</a>: the three ways in, how a request selects one without\na question, and the scope, permitted writes, steps and output of each.</li>\n<li><a href=\"references/layer-contents.md\">Layer contents</a>: what belongs in the quick start, the manual and\nthe handbook, in order; what is banned from each; and the length thresholds, marked as opinion.</li>\n<li><a href=\"references/document-kinds.md\">Document kinds</a>: every kind beside the three layers with its\nhome and edit rule, the edit-rule vocabulary, the tier ladder and the trigger that creates each\ndocument.</li>\n<li><a href=\"references/one-home-per-fact.md\">One home per fact</a>: the fact-to-home table, the short list of\nthings that may be repeated, and how to run the pass that finds violations.</li>\n<li><a href=\"references/loss-audit.md\">The loss audit</a>: how to split a replaced file into facts and rules,\nthe verdicts, and what a weakened rule costs.</li>\n<li><a href=\"references/newcomer-test.md\">The newcomer test</a>: the protocol, what the newcomer is allowed to\ndo, what counts as a blocker, and the shapes of defect only this pass finds.</li>\n<li><a href=\"references/claim-check.md\">The claim check</a>: enumerating checkable claims, the five verdicts a\nclaim can take, and the overreach review that reads the draft for what it asserts about itself.</li>\n</ul>\n","outline":["What makes a repository legible","Entry points","When to Use","Prerequisites","Procedure","The report contract","Usage Examples","Pitfalls","Verification","Deeper reading"],"words":5048}
