System Documentation Skill
This skill manages the repository documentation system as a set of canonical
artefacts instead of treating README.md as a catch-all file.
It keeps four layers distinct:
- Repository entrypoints such as
README.md and GitHub-conventional files
- Durable current-state documentation under
docs/
- Long-lived architectural decisions under
docs/adr/
- Feature-scoped intent and history under
specs/NNN-feature-name/
The skill is opinionated on purpose. Its job is to keep documentation precise,
placed correctly, and aligned with implemented behaviour.
Theoretical basis
The skill combines two established frameworks with repository evidence from
mature open-source projects (Django, FastAPI, Kubernetes, Backstage):
- Diátaxis (diataxis.fr) defines the four
reader-needs modes - tutorials, how-to guides, reference, and
explanation - and is used here as the content-quality control
framework: every page must have exactly one mode.
- Docs as Code
(writethedocs.org/guide/docs-as-code)
defines the operating model: plain-text under version control,
reviewed in pull requests, validated automatically, evolved alongside the
code it documents.
Diátaxis alone does not enumerate every artefact a real software system needs.
Mature repositories also keep architecture overviews, ADRs, runbooks,
troubleshooting/FAQ, security policy, contribution guidance, release notes,
and upgrade guides as first-class documentation. This skill therefore covers
the whole documentation system, not only the four core modes.
Why this exists
Documentation usually drifts in three ways:
- canonical facts get copied into the wrong file
- public-surface changes update code but not reference material
- operational, architectural, and learning content get mixed together
This skill prevents that drift by managing documentation as a dependency-
ordered system of artefacts with explicit contracts.
Non-goals
This skill does not:
- replace the Spec Kit workflow
- replace feature history under
specs/NNN-*
- treat
tasks.md as a documentation source
- move GitHub-conventional files into
docs/
- generate speculative content without implementation evidence
Canonical layout
Governance and lifecycle files (CHANGELOG.md, .github/SECURITY.md,
.github/contributing.md, .github/CODE_OF_CONDUCT.md, and upgrade guides)
are first-class artefacts. See
step-09-governance-lifecycle.md.
.
├── README.md
├── CHANGELOG.md
├── .github/
│ ├── contributing.md
│ ├── SECURITY.md
│ └── CODE_OF_CONDUCT.md
├── specs/
│ ├── NNN-feature-name/
│ └── product/
├── .copilot/
│ ├── analysis/
│ └── workflow-mode.json
└── docs/
├── README.md
├── architecture.md
├── conventions.md
├── onboarding.md
├── adr/
├── tutorials/
├── how-to/
├── reference/
├── explanation/
├── operations/
│ ├── README.md
│ └── runbooks/
├── developers/
│ └── README.md
├── users/
│ └── README.md
└── prompts/
.copilot/analysis/ is workspace-local evidence output. It is not part of the
canonical documentation tree under docs/.
Step resolution
Resolve the requested step from $ARGUMENTS.
| Step |
Slug |
Primary outputs |
Dependencies |
| 01 |
foundation |
README.md, docs/README.md, docs/conventions.md, docs/onboarding.md, baseline docs directories |
None |
| 02 |
architecture |
docs/architecture.md, docs/adr/*.md |
Step 01 |
| 03 |
reference |
docs/reference/** |
Step 01 |
| 04 |
explanation |
docs/explanation/** |
Steps 02-03 |
| 05 |
how-to |
docs/how-to/** |
Steps 01,03 |
| 06 |
tutorials |
docs/tutorials/** |
Steps 03,05 |
| 07 |
operations |
docs/operations/README.md, docs/operations/runbooks/** |
Steps 01,03 |
| 08 |
audience-indexes |
docs/developers/README.md, docs/users/README.md |
Step 01 |
| 09 |
governance |
CHANGELOG.md, .github/SECURITY.md, .github/contributing.md, .github/CODE_OF_CONDUCT.md, upgrade guides |
Step 01 |
| all |
(all steps) |
All applicable outputs |
None |
Apply the following rules in order:
- Resolve the mode before executing the step.
- If
all is selected, run steps 01 -> 02 -> 03 -> 04 -> 05 -> 06 -> 07
-> 08 -> 09 in order.
- In
establish and sync, a single selected step is blocked when any
required dependency output is missing. Stop and instruct the user to run
the prerequisite step first.
- In
audit and pre-pr-review, missing dependency outputs are findings.
Continue and report them under the affected canonical target. Partial
presence of a step's required outputs is reported per missing artefact,
attributed to the step that owns it.
- In
establish, create the minimal canonical landing page or directory
index when the model requires a location to exist but detailed content is
not yet evidenced.
- In
sync, update only the smallest canonical set backed by evidence. A
sync run that finds no evidenced drift legitimately produces zero edits;
report "no changes; no drift detected" and continue to validation.
Mode resolution
Resolve the requested mode from $ARGUMENTS.
| Mode |
Writes files? |
Use when |
establish |
Yes |
The repository needs missing structure, baseline files, or initial placement cleanup |
sync |
Yes |
Code, contracts, configuration, prompts, skills, agents, hooks, or shipped behaviour changed |
audit |
No |
The user wants a documentation quality, completeness, placement, or drift assessment |
pre-pr-review |
No |
The user wants documentation checked against a diff before review |
audit and pre-pr-review are non-destructive. They MUST NOT create, edit,
rename, or delete files. They produce findings only. When delegating either
mode to a subagent, repeat this constraint in the subagent prompt.
Compatibility aliases:
feature-sync -> sync, with emphasis on steps 03-06
adr-sync -> sync, with emphasis on step 02
surface-sync -> sync, with emphasis on step 03
release-sync -> sync, with emphasis on step 09
If the user supplies both a mode and an alias, the explicit mode wins.
Mandatory preparation
Before starting any step:
- Read the constitution.
- Read .github/copilot-instructions.md.
- Read the current repository anchors when they exist:
README.md,
docs/conventions.md, docs/architecture.md, and docs/onboarding.md.
- Enumerate
docs/, docs/adr/, and specs/ when present.
- Inventory public surfaces from implementation, configuration, contracts,
scripts, prompts, skills, agents, hooks, and tests.
- If the request is diff-based or PR-based, inspect the changed paths first.
- Resolve and state the step, mode, and scope before writing.
- For repositories with non-trivial documentation systems, prefer
delegating inventory and drift analysis to a read-only exploration
subagent. Keep edits in the main agent.
If an expected anchor is missing, apply these fallback rules:
- In
establish, treat the missing anchor as evidence of a missing output, not
as a preparation failure. Read the closest existing anchors instead: root
README.md, docs/README.md, docs/adr/, specs/, and the controlling
implementation, configuration, contract, or test surfaces.
- In
sync, audit, and pre-pr-review, treat missing expected anchors as
drift and handle them through the mode-sensitive dependency rules above.
- State any missing anchors and fallback anchors used before you start
writing.
Operating principles
Single canonical location per fact. If two files claim the same
canonical fact, one of them is wrong by design. Replace duplication with
links.
Code is the tiebreaker. Prefer current code, configuration, contracts,
and passing tests over stale documentation. When sources disagree, use
the following promotion order:
- current implementation and passing tests
- current ADRs and
docs/architecture.md
- current reference docs under
docs/reference/
specs/product/ if present
- per-feature
specs/NNN-* artefacts
plan.md only as a narrow fallback for missing architecture context
- never
tasks.md
Keep documentation modes separate. Tutorials teach, how-to guides
solve tasks, reference docs define interfaces, explanation docs clarify
concepts, runbooks protect operations, and audience indexes route readers.
Entrypoints are human-first. Foundation docs, especially README.md,
must read as guided entrypoints for people: prose-led where context is
needed, selective in their use of bullets, and explicit about where deeper
canonical docs live.
Feature history stays under specs/NNN-*. Treat specs/product/ as
derived, not canonical feature history.
ADR discipline stays intact. Use ADRs only for long-lived technical
decisions with alternatives and consequences.
.copilot/analysis/ is evidence-only. Do not place normative docs
there.
plan.md is narrow context only. tasks.md is never a documentation
source.
Common document contract
For files under docs/reference/, docs/explanation/, docs/how-to/,
docs/tutorials/, and docs/operations/, prefer this minimal front matter
when the repository is establishing or standardising those artefacts:
---
title: Add a new skill
doc_type: how-to
audience: contributor
status: active
code_paths: [".github/skills/", ".github/prompts/"]
spec_refs: []
adr_refs: []
---
Rules:
doc_type must match the canonical mode of the directory.
audience should be user, operator, contributor, or mixed.
code_paths is expected for reference docs and runbooks when practical.
- generated files,
README.md, and ADRs do not need this contract unless the
repository already uses it there.
- Prefer bullet lists over Markdown tables when cell widths vary substantially
or any cell carries a long sentence. Aligned-table lint rules (such as
MD060) reject rows that overflow the header width, forcing cosmetic
rewrites. Tables are appropriate only for short, uniform-width data.
Drift classes
The skill detects and resolves or reports five classes of drift:
- missing documentation
- misplaced documentation
- duplicated documentation
- conflicting documentation
- stale documentation
Useful change-to-doc heuristics for sync, audit, and pre-pr-review:
- changed CLI, API, configuration, schema, or contract code without changes
under
docs/reference/
- changed user or contributor workflow without changes under
docs/how-to/
or docs/tutorials/
- changed architecture-affecting modules without changes to ADRs or
docs/architecture.md
- changed operational automation without changes under
docs/operations/
- shipped user-visible change without a
CHANGELOG.md entry
- changed supported runtime, dependency policy, or release cadence without
updates to
.github/SECURITY.md
- breaking change without an upgrade guide linked from
CHANGELOG.md
Anti-patterns to flag
Derived from cross-repository evidence in the research report:
- README-as-everything - tutorial, explanation, reference, changelog, and
support guide collapsed into a single file.
- Mode mixing - a how-to that becomes an architecture essay, or a
reference page that teaches from scratch.
- No operational surface - deployment, debugging, or upgrade guidance
missing for a deployed system.
- No architecture history - significant decisions visible only in old pull
requests or tribal memory.
- No security policy - vulnerability reporters left to guess the channel.
- No documentation contribution guidance - doc quality dependent on
institutional memory.
- Generated reference without curation - reference exists but has no
landing page or routes.
- Audience pages that shadow-copy canonical docs instead of routing to
them.
- Spec or task content (
plan.md, tasks.md) leaked into durable docs.
Validation gates
Validation for this skill is documentation-scoped. It does not include the
project test suite, type checker, or language linters; those belong to other
gates. audit and pre-pr-review runs do not need to execute validation
gates at all, and absence of gate output in those modes is not a finding.
For establish and sync, every touched file must pass the following
before the step is marked done. Rely on automation where present.
- Markdown lint passes for the changed files.
- Internal links resolve (no broken relative links between docs, ADRs,
specs, and code paths).
- Front matter, where used, declares
doc_type, audience, and status
consistent with the directory contract.
- Directory placement matches
doc_type: reference content lives under
docs/reference/, runbook content under docs/operations/runbooks/,
and so on.
- Required sections for the artefact type are present (see each step's
Standardised expectations).
- Cross-links to
spec_refs, adr_refs, and code_paths point to files
that exist.
- No canonical fact is duplicated across multiple files for the same
surface or code path.
Workflow per step
Each step has a dedicated companion document with detailed instructions,
artefact contracts, and a Definition of Done.
- Step 01 - Foundation. See step-01-foundation.md.
Establishes root and docs entrypoints, conventions, onboarding, and
baseline directories. The deterministic scaffold and templates for the
top-level
README.md live in
readme-templates.md.
- Step 02 - Architecture. See
step-02-architecture.md. Maintains the current
architecture overview and ADR linkage.
- Step 03 - Reference. See step-03-reference.md.
Maintains code-backed reference documentation for public surfaces.
- Step 04 - Explanation. See
step-04-explanation.md. Maintains conceptual docs,
trade-offs, terminology, and mental models.
- Step 05 - How-to. See step-05-how-to.md. Maintains
goal-oriented procedures.
- Step 06 - Tutorials. See step-06-tutorials.md.
Maintains newcomer or happy-path learning journeys.
- Step 07 - Operations. See
step-07-operations.md. Maintains operational
overviews and runbooks.
- Step 08 - Audience indexes. See
step-08-audience-indexes.md. Maintains
developer and user navigation pages.
- Step 09 - Governance and lifecycle. See
step-09-governance-lifecycle.md.
Maintains
CHANGELOG.md, .github/SECURITY.md, .github/contributing.md,
.github/CODE_OF_CONDUCT.md, and upgrade guides.
Common closing steps
After producing or updating any step output:
- Run focused documentation-scoped validation on the changed Markdown and
customisation files. Skip this for
audit and pre-pr-review runs.
- Re-run focused validation after generation when applicable.
- In a combined produce-and-review workflow, if the
audit phase surfaces
resolvable drift, re-enter the producing phase to fix it and re-run the
validation gates. Stop after at most one corrective pass and report any
drift that remains.
- Report unresolved drift by class and by canonical target file.
- In the final assistant message, state the resolved mode, step, and scope,
or each phase if more than one phase ran, the canonical files created or
updated, the validation run and result, and any exact gaps left open.
Definition of Done
- The requested step outputs exist in the canonical location or their absence
is reported precisely.
- Every updated canonical file matches its documented role.
- Public-surface changes are reflected in reference docs before learning docs.
- Architecture-sensitive changes update ADRs and current-state architecture
docs where relevant.
- Audience indexes link to canonical docs rather than duplicating them.
- Generated inventories are regenerated when required.
- Focused validation passes on the changed files, or unrelated pre-existing
failures are separated clearly from new issues.
1---2name: system-documentation3description: Establish, synchronise, audit, and review an opinionated repository documentation system across entrypoints, architecture, reference, explanation, tutorials, how-to guides, operations, audience indexes, and governance/lifecycle artefacts.4license: MIT5---67# System Documentation Skill89This skill manages the repository documentation system as a set of canonical10artefacts instead of treating `README.md` as a catch-all file.1112It keeps four layers distinct:13141. Repository entrypoints such as `README.md` and GitHub-conventional files152. Durable current-state documentation under `docs/`163. Long-lived architectural decisions under `docs/adr/`174. Feature-scoped intent and history under `specs/NNN-feature-name/`1819The skill is opinionated on purpose. Its job is to keep documentation precise,20placed correctly, and aligned with implemented behaviour.2122## Theoretical basis2324The skill combines two established frameworks with repository evidence from25mature open-source projects (Django, FastAPI, Kubernetes, Backstage):2627- **Diátaxis** ([diataxis.fr](https://diataxis.fr/)) defines the four28 reader-needs modes - tutorials, how-to guides, reference, and29 explanation - and is used here as the **content-quality control**30 framework: every page must have exactly one mode.31- **Docs as Code**32 ([writethedocs.org/guide/docs-as-code](https://www.writethedocs.org/guide/docs-as-code/))33 defines the **operating model**: plain-text under version control,34 reviewed in pull requests, validated automatically, evolved alongside the35 code it documents.3637Diátaxis alone does not enumerate every artefact a real software system needs.38Mature repositories also keep architecture overviews, ADRs, runbooks,39troubleshooting/FAQ, security policy, contribution guidance, release notes,40and upgrade guides as first-class documentation. This skill therefore covers41the **whole documentation system**, not only the four core modes.4243## Why this exists4445Documentation usually drifts in three ways:4647- canonical facts get copied into the wrong file48- public-surface changes update code but not reference material49- operational, architectural, and learning content get mixed together5051This skill prevents that drift by managing documentation as a dependency-52ordered system of artefacts with explicit contracts.5354## Non-goals5556This skill does not:5758- replace the Spec Kit workflow59- replace feature history under `specs/NNN-*`60- treat `tasks.md` as a documentation source61- move GitHub-conventional files into `docs/`62- generate speculative content without implementation evidence6364## Canonical layout6566Governance and lifecycle files (`CHANGELOG.md`, `.github/SECURITY.md`,67`.github/contributing.md`, `.github/CODE_OF_CONDUCT.md`, and upgrade guides)68are first-class artefacts. See69[step-09-governance-lifecycle.md](step-09-governance-lifecycle.md).7071```text72.73├── README.md74├── CHANGELOG.md75├── .github/76│ ├── contributing.md77│ ├── SECURITY.md78│ └── CODE_OF_CONDUCT.md79├── specs/80│ ├── NNN-feature-name/81│ └── product/82├── .copilot/83│ ├── analysis/84│ └── workflow-mode.json85└── docs/86 ├── README.md87 ├── architecture.md88 ├── conventions.md89 ├── onboarding.md90 ├── adr/91 ├── tutorials/92 ├── how-to/93 ├── reference/94 ├── explanation/95 ├── operations/96 │ ├── README.md97 │ └── runbooks/98 ├── developers/99 │ └── README.md100 ├── users/101 │ └── README.md102 └── prompts/103```104105`.copilot/analysis/` is workspace-local evidence output. It is not part of the106canonical documentation tree under `docs/`.107108## Step resolution109110Resolve the requested step from `$ARGUMENTS`.111112| Step | Slug | Primary outputs | Dependencies |113| ---- | ---------------- | -------------------------------------------------------------------------------------------------------------- | ------------ |114| 01 | foundation | `README.md`, `docs/README.md`, `docs/conventions.md`, `docs/onboarding.md`, baseline docs directories | None |115| 02 | architecture | `docs/architecture.md`, `docs/adr/*.md` | Step 01 |116| 03 | reference | `docs/reference/**` | Step 01 |117| 04 | explanation | `docs/explanation/**` | Steps 02-03 |118| 05 | how-to | `docs/how-to/**` | Steps 01,03 |119| 06 | tutorials | `docs/tutorials/**` | Steps 03,05 |120| 07 | operations | `docs/operations/README.md`, `docs/operations/runbooks/**` | Steps 01,03 |121| 08 | audience-indexes | `docs/developers/README.md`, `docs/users/README.md` | Step 01 |122| 09 | governance | `CHANGELOG.md`, `.github/SECURITY.md`, `.github/contributing.md`, `.github/CODE_OF_CONDUCT.md`, upgrade guides | Step 01 |123| all | (all steps) | All applicable outputs | None |124125Apply the following rules in order:1261271. Resolve the mode before executing the step.1282. If `all` is selected, run steps 01 -> 02 -> 03 -> 04 -> 05 -> 06 -> 07129 -> 08 -> 09 in order.1303. In `establish` and `sync`, a single selected step is blocked when any131 required dependency output is missing. Stop and instruct the user to run132 the prerequisite step first.1334. In `audit` and `pre-pr-review`, missing dependency outputs are findings.134 Continue and report them under the affected canonical target. Partial135 presence of a step's required outputs is reported per missing artefact,136 attributed to the step that owns it.1375. In `establish`, create the minimal canonical landing page or directory138 index when the model requires a location to exist but detailed content is139 not yet evidenced.1406. In `sync`, update only the smallest canonical set backed by evidence. A141 `sync` run that finds no evidenced drift legitimately produces zero edits;142 report "no changes; no drift detected" and continue to validation.143144## Mode resolution145146Resolve the requested mode from `$ARGUMENTS`.147148| Mode | Writes files? | Use when |149| --------------- | ------------- | -------------------------------------------------------------------------------------------- |150| `establish` | Yes | The repository needs missing structure, baseline files, or initial placement cleanup |151| `sync` | Yes | Code, contracts, configuration, prompts, skills, agents, hooks, or shipped behaviour changed |152| `audit` | No | The user wants a documentation quality, completeness, placement, or drift assessment |153| `pre-pr-review` | No | The user wants documentation checked against a diff before review |154155`audit` and `pre-pr-review` are non-destructive. They MUST NOT create, edit,156rename, or delete files. They produce findings only. When delegating either157mode to a subagent, repeat this constraint in the subagent prompt.158159Compatibility aliases:160161- `feature-sync` -> `sync`, with emphasis on steps 03-06162- `adr-sync` -> `sync`, with emphasis on step 02163- `surface-sync` -> `sync`, with emphasis on step 03164- `release-sync` -> `sync`, with emphasis on step 09165166If the user supplies both a mode and an alias, the explicit mode wins.167168## Mandatory preparation169170Before starting any step:1711721. Read the [constitution](../../../.specify/memory/constitution.md).1732. Read [.github/copilot-instructions.md](../../copilot-instructions.md).1743. Read the current repository anchors when they exist: `README.md`,175 `docs/conventions.md`, `docs/architecture.md`, and `docs/onboarding.md`.1764. Enumerate `docs/`, `docs/adr/`, and `specs/` when present.1775. Inventory public surfaces from implementation, configuration, contracts,178 scripts, prompts, skills, agents, hooks, and tests.1796. If the request is diff-based or PR-based, inspect the changed paths first.1807. Resolve and state the step, mode, and scope before writing.1818. For repositories with non-trivial documentation systems, prefer182 delegating inventory and drift analysis to a read-only exploration183 subagent. Keep edits in the main agent.184185If an expected anchor is missing, apply these fallback rules:186187- In `establish`, treat the missing anchor as evidence of a missing output, not188 as a preparation failure. Read the closest existing anchors instead: root189 `README.md`, `docs/README.md`, `docs/adr/`, `specs/`, and the controlling190 implementation, configuration, contract, or test surfaces.191- In `sync`, `audit`, and `pre-pr-review`, treat missing expected anchors as192 drift and handle them through the mode-sensitive dependency rules above.193- State any missing anchors and fallback anchors used before you start194 writing.195196## Operating principles1971981. **Single canonical location per fact.** If two files claim the same199 canonical fact, one of them is wrong by design. Replace duplication with200 links.2012. **Code is the tiebreaker.** Prefer current code, configuration, contracts,202 and passing tests over stale documentation. When sources disagree, use203 the following promotion order:204 1. current implementation and passing tests205 2. current ADRs and `docs/architecture.md`206 3. current reference docs under `docs/reference/`207 4. `specs/product/` if present208 5. per-feature `specs/NNN-*` artefacts209 6. `plan.md` only as a narrow fallback for missing architecture context210 7. never `tasks.md`2112123. **Keep documentation modes separate.** Tutorials teach, how-to guides213 solve tasks, reference docs define interfaces, explanation docs clarify214 concepts, runbooks protect operations, and audience indexes route readers.2154. **Entrypoints are human-first.** Foundation docs, especially `README.md`,216 must read as guided entrypoints for people: prose-led where context is217 needed, selective in their use of bullets, and explicit about where deeper218 canonical docs live.2195. **Feature history stays under `specs/NNN-*`.** Treat `specs/product/` as220 derived, not canonical feature history.2216. **ADR discipline stays intact.** Use ADRs only for long-lived technical222 decisions with alternatives and consequences.2237. **`.copilot/analysis/` is evidence-only.** Do not place normative docs224 there.2258. **`plan.md` is narrow context only.** `tasks.md` is never a documentation226 source.227228## Common document contract229230For files under `docs/reference/`, `docs/explanation/`, `docs/how-to/`,231`docs/tutorials/`, and `docs/operations/`, prefer this minimal front matter232when the repository is establishing or standardising those artefacts:233234```yaml235---236title: Add a new skill237doc_type: how-to238audience: contributor239status: active240code_paths: [".github/skills/", ".github/prompts/"]241spec_refs: []242adr_refs: []243---244```245246Rules:247248- `doc_type` must match the canonical mode of the directory.249- `audience` should be `user`, `operator`, `contributor`, or `mixed`.250- `code_paths` is expected for reference docs and runbooks when practical.251- generated files, `README.md`, and ADRs do not need this contract unless the252 repository already uses it there.253- Prefer bullet lists over Markdown tables when cell widths vary substantially254 or any cell carries a long sentence. Aligned-table lint rules (such as255 MD060) reject rows that overflow the header width, forcing cosmetic256 rewrites. Tables are appropriate only for short, uniform-width data.257258## Drift classes259260The skill detects and resolves or reports five classes of drift:2612621. missing documentation2632. misplaced documentation2643. duplicated documentation2654. conflicting documentation2665. stale documentation267268Useful change-to-doc heuristics for `sync`, `audit`, and `pre-pr-review`:269270- changed CLI, API, configuration, schema, or contract code without changes271 under `docs/reference/`272- changed user or contributor workflow without changes under `docs/how-to/`273 or `docs/tutorials/`274- changed architecture-affecting modules without changes to ADRs or275 `docs/architecture.md`276- changed operational automation without changes under `docs/operations/`277- shipped user-visible change without a `CHANGELOG.md` entry278- changed supported runtime, dependency policy, or release cadence without279 updates to `.github/SECURITY.md`280- breaking change without an upgrade guide linked from `CHANGELOG.md`281282## Anti-patterns to flag283284Derived from cross-repository evidence in the research report:2852861. README-as-everything - tutorial, explanation, reference, changelog, and287 support guide collapsed into a single file.2882. Mode mixing - a how-to that becomes an architecture essay, or a289 reference page that teaches from scratch.2903. No operational surface - deployment, debugging, or upgrade guidance291 missing for a deployed system.2924. No architecture history - significant decisions visible only in old pull293 requests or tribal memory.2945. No security policy - vulnerability reporters left to guess the channel.2956. No documentation contribution guidance - doc quality dependent on296 institutional memory.2977. Generated reference without curation - reference exists but has no298 landing page or routes.2998. Audience pages that shadow-copy canonical docs instead of routing to300 them.3019. Spec or task content (`plan.md`, `tasks.md`) leaked into durable docs.302303## Validation gates304305Validation for this skill is documentation-scoped. It does not include the306project test suite, type checker, or language linters; those belong to other307gates. `audit` and `pre-pr-review` runs do not need to execute validation308gates at all, and absence of gate output in those modes is not a finding.309310For `establish` and `sync`, every touched file must pass the following311before the step is marked done. Rely on automation where present.3123131. Markdown lint passes for the changed files.3142. Internal links resolve (no broken relative links between docs, ADRs,315 specs, and code paths).3163. Front matter, where used, declares `doc_type`, `audience`, and `status`317 consistent with the directory contract.3184. Directory placement matches `doc_type`: reference content lives under319 `docs/reference/`, runbook content under `docs/operations/runbooks/`,320 and so on.3215. Required sections for the artefact type are present (see each step's322 Standardised expectations).3236. Cross-links to `spec_refs`, `adr_refs`, and `code_paths` point to files324 that exist.3257. No canonical fact is duplicated across multiple files for the same326 surface or code path.327328## Workflow per step329330Each step has a dedicated companion document with detailed instructions,331artefact contracts, and a Definition of Done.332333- **Step 01 - Foundation.** See [step-01-foundation.md](step-01-foundation.md).334 Establishes root and docs entrypoints, conventions, onboarding, and335 baseline directories. The deterministic scaffold and templates for the336 top-level `README.md` live in337 [readme-templates.md](readme-templates.md).338- **Step 02 - Architecture.** See339 [step-02-architecture.md](step-02-architecture.md). Maintains the current340 architecture overview and ADR linkage.341- **Step 03 - Reference.** See [step-03-reference.md](step-03-reference.md).342 Maintains code-backed reference documentation for public surfaces.343- **Step 04 - Explanation.** See344 [step-04-explanation.md](step-04-explanation.md). Maintains conceptual docs,345 trade-offs, terminology, and mental models.346- **Step 05 - How-to.** See [step-05-how-to.md](step-05-how-to.md). Maintains347 goal-oriented procedures.348- **Step 06 - Tutorials.** See [step-06-tutorials.md](step-06-tutorials.md).349 Maintains newcomer or happy-path learning journeys.350- **Step 07 - Operations.** See351 [step-07-operations.md](step-07-operations.md). Maintains operational352 overviews and runbooks.353- **Step 08 - Audience indexes.** See354 [step-08-audience-indexes.md](step-08-audience-indexes.md). Maintains355 developer and user navigation pages.356- **Step 09 - Governance and lifecycle.** See357 [step-09-governance-lifecycle.md](step-09-governance-lifecycle.md).358 Maintains `CHANGELOG.md`, `.github/SECURITY.md`, `.github/contributing.md`,359 `.github/CODE_OF_CONDUCT.md`, and upgrade guides.360361## Common closing steps362363After producing or updating any step output:3643651. Run focused documentation-scoped validation on the changed Markdown and366 customisation files. Skip this for `audit` and `pre-pr-review` runs.3672. Re-run focused validation after generation when applicable.3683. In a combined produce-and-review workflow, if the `audit` phase surfaces369 resolvable drift, re-enter the producing phase to fix it and re-run the370 validation gates. Stop after at most one corrective pass and report any371 drift that remains.3724. Report unresolved drift by class and by canonical target file.3735. In the final assistant message, state the resolved mode, step, and scope,374 or each phase if more than one phase ran, the canonical files created or375 updated, the validation run and result, and any exact gaps left open.376377## Definition of Done378379- The requested step outputs exist in the canonical location or their absence380 is reported precisely.381- Every updated canonical file matches its documented role.382- Public-surface changes are reflected in reference docs before learning docs.383- Architecture-sensitive changes update ADRs and current-state architecture384 docs where relevant.385- Audience indexes link to canonical docs rather than duplicating them.386- Generated inventories are regenerated when required.387- Focused validation passes on the changed files, or unrelated pre-existing388 failures are separated clearly from new issues.