Home / Market / perfect docs

perfect docs

The target state for a library's documentation site: quick starts, Learn, Guides and Reference, one home per fact, concepts taught in learning-graph order, every code example checked against the source, every export covered, rigorous cross-links, redirects for every moved URL. Use when writing, restructuring or auditing a docs site, deciding where a piece of documentation belongs, or adding a check that keeps docs true to the code.

skill★ 3374313720 dlskills.shMITInstall in CosmosUpstream Source

Documentation & Preview

--- name: perfect-docs description: "The target state for a library's documentation site: quick starts, Learn, Guides and Reference, one home per fact, concepts taught in learning-graph order, every code example checked against the source, every export covered, rigorous cross-links, redirects for every moved URL. Use when writing, restructuring or auditing a docs site, deciding where a piece of documentation belongs, or adding a check that keeps docs true to the code."

---

Perfect Docs

Measure a docs site against this target: every gap is a finding, and every change moves the site toward it. The target holds for any language and any docs tool. Each automated check below says what it must guarantee; the project picks the tool.

Vocabulary

Use these words exactly, each in this one sense.

Say concept where "topic" or "idea" might come to mind, and entry where "API doc" might.

The sections

The site has three sections, and each owns one kind of fact:

| Section | Owns | Links out to | | --------- | ---------------------------------------------------------- | ----------------------------------------- | | Learn | what each concept is, why it exists, the order to learn it | Reference, on every export mention | | Guides | the steps and choices of one task | Learn for concepts, Reference for exports | | Reference | what each export does | Learn, for the concept behind it |

A fact lives in exactly one home. Every other page that needs it links there, with at most a one-line gloss. A change to a behaviour is then a one-place edit, and the site cannot contradict itself.

Every site has a quick start for each mode of use, first in the navigation, before Learn. A quick start takes the shape of a Guide (see guides.md): it ends with working, checked code and teaches nothing, so every concept links to its home in Learn and every export to its entry.

The quick starts, Learn and Reference are complete: every mode has a quick start, every concept has a home in Learn, and every public export has an entry in Reference. Guides are extra and never needed for completeness.

Topic files

Read a topic file when the work touches that area.

Automated checks

Each runs in CI and fails the build on a violation.

  1. Examples: every code block is checked by the project's compiler or type checker against the current source. See examples.md.
  2. Coverage: every public export has an entry, and every entry names a public export. See reference.md.
  3. Cross-links: every export mention in Learn and Guides links to its entry, and every entry links to Learn. See links.md.
  4. Links: every internal link and anchor resolves. See links.md.
  5. Redirects: every page or anchor that leaves the URL list has a redirect or alias. See links.md.

What no check can judge (reading order, the problem each section opens with, the prose) is the job of the style review in style.md.