Skip to content

Technical guide · Contributing

Page status: Active

Documentation Style Guide

How to author equivalent, safe, and accessible Simple and Technical NutsNews Wiki articles.

Visual overview

Primary diagram

System map

A new or changed canonical Technical source is reconciled with its Simple mirror, Technical mirror, accessible diagram, metadata, links, images, and History placement. Human approval follows the complete review, and any stale change returns the bundle to review before validation and delivery.

Render the repository-owned system map when you need it.

Diagram is not rendered yet.

View as text
Documentation Style Guide

A new or changed canonical Technical source is reconciled with its Simple mirror, Technical mirror, accessible diagram, metadata, links, images, and History placement. Human approval follows the complete review, and any stale change returns the bundle to review before validation and delivery.

---
title: Documentation style guide content workflow
---

flowchart TB
  accTitle: Documentation Style Guide
  accDescr {
    A new or changed canonical Technical source is reconciled with its Simple mirror, Technical mirror, accessible diagram, metadata, links, images, and History placement. Human approval follows the complete review, and any stale change returns the bundle to review before validation and delivery.
  }
  request["New or changed canonical source"] --> scaffold{"New document?"}
  scaffold -->|Yes| newdoc["Run docs:new, then docs:prepare --force"]
  scaffold -->|No| update["Update the existing source"]
  newdoc --> bundle["Reconcile Simple mirror, Technical mirror, and diagram"]
  update --> bundle
  bundle --> safety["Preserve facts, commands, cautions, verification, and rollback"]
  safety --> assets["Check metadata, related links, images, accessibility, and History"]
  assets --> review["Human reviews the complete current bundle"]
  review --> approve["Run docs:approve"]
  approve --> validate["Run complete content, link, Mermaid, route, and build gates"]
  validate --> current{"Approval still current?"}
  current -->|No| bundle
  current -->|Yes| deliver{"Documentation only?"}
  deliver -->|Yes| main["Push validated docs directly to main"]
  deliver -->|No or mixed| pr["Use checked and approved pull request"]

Documentation Style Guide

Fullscreen diagram view.

Use this guide to create or update a complete NutsNews Wiki document bundle without losing facts, commands, cautions, or accessibility.

Every canonical Technical source owns:

  • one Simple mirror at audiences/simple/<source>.md
  • one Technical mirror at audiences/technical/<source>.md
  • one accessible Mermaid diagram at diagrams/<source-without-md>.mmd

The two audience articles may use different wording and detail, but they must agree on observable behavior, prerequisites, values, commands, warnings, verification, failure handling, and rollback. Simple means easier to understand; it never means incomplete or less safe.

  • Define specialized terms before using them.
  • Prefer short sentences, concrete verbs, numbered actions, and one idea per paragraph.
  • Explain why a command or warning matters.
  • Preserve exact commands, identifiers, URLs, thresholds, limitations, verification, and rollback.
  • Link to the same relevant sources as the Technical article.
  • Name components, dependencies, inputs, outputs, defaults, state changes, and ownership precisely.
  • Include exact commands and the conditions under which they are safe.
  • Describe failure modes, observability, verification, recovery, and rollback.
  • Distinguish current behavior from a proposal or historical behavior.

Current canonical sources live at the repository root. Put time-bounded records in the matching source area:

Canonical pathHistory group
updates/Updates
reports/Reports
archive/Archives
ios/Classified notes

History pages remain directly browsable. Search excludes them by default until the reader enables Include History. Do not move a current operating contract into History merely to avoid updating it.

New sources use every expert field: title, description, slug, collection, section, status, and order. Internal routes omit the trailing slash; published routes add it.

This schema-valid new-document state is intentionally blocked:

---
title: "Cache Invalidation Guide (Technical)"
description: "How NutsNews invalidates cached reader content safely."
wiki:
source_route: "/technical/cache-invalidation-guide"
simple_route: "/simple/cache-invalidation-guide"
slug: "cache-invalidation-guide"
primary_diagram:
file: "diagrams/CACHE_INVALIDATION_GUIDE.mmd"
accTitle: "Cache invalidation flow"
accDescr: "An operator verifies scope, purges the selected cache, checks the reader response, and rolls back or escalates when verification fails."
status: draft
collection: platform-and-data
section: core-platform
order: 228
approval:
state: unreviewed
publishing: blocked
reviewed_by: pending
reviewed_on: pending
technical_source_hash: pending
---

Valid status values are active, draft, deprecated, and obsolete. Use only a collection/section pair defined by the wiki contract, and choose an unused numeric order.

  1. Create the tracked five-file scaffold:

    Terminal window
    npm run docs:new -- CACHE_INVALIDATION_GUIDE.md --collection platform-and-data --section core-platform
  2. Replace every Technical TODO. Verify claims, commands, links, warnings, current status, verification, and rollback.

  3. Prepare the Simple draft and diagram for the new blocked bundle:

    Terminal window
    npm run docs:prepare -- CACHE_INVALIDATION_GUIDE.md --force
  4. Reconcile the generated Simple text and Technical mirror with the canonical source. Generation is a draft aid, not approval.

  5. Make the Mermaid diagram accurate and accessible. Resolve every item in the adjacent review manifest.

  6. Have a human review the current Technical source, both mirrors, and diagram.

  7. Record approval only after that review:

    Terminal window
    npm run docs:approve -- CACHE_INVALIDATION_GUIDE.md --reviewed-by "<human-reviewer>" --confirm-human-review
  8. Run the complete documentation gate:

    Terminal window
    npm run wiki:prepare
    npm run validate:content
    npm run validate:links
    npm run validate:mermaid
    npm run test:content-routes
    npm run build
  9. Follow AGENTS.md: documentation-only changes may go directly to main after validation; site-code or mixed changes require a checked and explicitly approved pull request.

A substantive canonical edit invalidates the old hash even if the approval fields still say approved.

Terminal window
npm run wiki:prepare
npm run validate:content

The expected failure identifies stale approval. Do not change only the hash or bypass the gate.

  1. Update the Simple mirror, Technical mirror, and diagram to match the new source.
  2. Preserve every safety-critical fact, command, caution, verification, and rollback.
  3. Have a human review the complete current bundle.
  4. Run the exact docs:approve command for that canonical source.
  5. Rerun the complete gate until it passes.
Technical contentSimple equivalent must retain
Prerequisites and scopeWho may act, what is affected, and what is excluded
Exact command or settingThe unchanged command or value plus a plain-language explanation
Warning or destructive boundaryThe same warning before the risky step
Expected resultA concrete success signal
Failure handlingStop conditions, diagnostic location, and escalation
Rollback or recoveryThe complete safe reversal and post-rollback verification

Never publish real credentials, local environment values, private contact/payment data, or secret-bearing output. Use placeholders that cannot be mistaken for working secrets.

  • Every canonical source has one primary Mermaid diagram with valid accTitle and specific accDescr text in frontmatter and diagram source.
  • The diagram must communicate a useful flow, state change, hierarchy, or relationship; do not add a decorative chart.
  • Keep Mermaid local and text-readable. Preserve the text fallback and never use an external diagram CDN.
  • Use a screenshot only when a visual state or control location is materially clearer than prose.
  • Give each image meaningful alt text, a caption, and a resolvable local asset. Redact secrets, personal data, and irrelevant browser or desktop content.

Schema-valid Markdown image form:

![Search dialog with Include History enabled](public/wiki-assets/search-history.png "Search results with History enabled")
  • Add important current documents to the appropriate section of README.md.
  • Link to canonical Markdown sources with repository-relative paths. The generator resolves the active audience route.
  • Use exact heading fragments and descriptive link text; validate both paths and fragments.
  • End substantial guides with a short Related docs section when it helps the next action.
  • Link a historical record to the current operating contract when one exists.
  • Simple and Technical versions agree on every fact and safety boundary.
  • Metadata, routes, status, collection, section, and order are valid.
  • The accessible diagram is current; screenshots have alt text and captions.
  • Related links and History placement are correct.
  • Approval names a human and matches the current source hash.
  • The complete documentation gate passes before delivery.