Documentation writing standard¶
This page sets the rules for ConnectSoft documentation: this site, the CompanyDocumentation site, repository README.md and AGENTS.md files, and the documentation generated by templates. It is written for anyone who writes or reviews documentation, people and AI agents alike. The step-by-step guide to adding a page is Contributing documentation.
Voice and audience¶
ConnectSoft documentation is professional, precise and pragmatic. It explains why as well as what, and it avoids marketing language. The primary readers are senior engineers, architects and technical leads. Do not over-explain general concepts, but define every ConnectSoft-specific term on first use.
Use these terms consistently:
- ConnectSoft AI Software Factory, or Factory with a capital F, for the generation platform.
- SaaS platform for the Identity, Audit, Config and Bot platforms.
- Template for a dotnet new starter, and library for a NuGet package that is referenced but not generated.
Rules¶
CS-DOCS-001: Write documentation in English¶
Severity: major · Applies to: docs, service, library, api-client, blazor, template, pipelines · Enforced by: manual · Status: active
Why¶
The documentation is read by an international team, partners and AI agents, and generated into client projects. One language keeps it searchable and lets agents cite it reliably.
Do¶
- Write every documentation page,
README.md,AGENTS.md, code comment and commit message in English.
Don't¶
- Mix languages in a page, or add a translated copy of a page beside it.
How to check¶
The changed documentation contains no text in another language, other than quoted user-interface strings that a test or a localization resource needs.
CS-DOCS-002: Open each page with one title and a purpose statement¶
Severity: minor · Applies to: docs · Enforced by: manual · Status: active
Why¶
Readers decide in the first lines whether a page is the right one. Search results show the title and the first sentences.
Do¶
- Use exactly one
#heading, the page title. - Follow it with one to three sentences:
- what the page covers;
- who it is for;
- what the reader gets from it.
- Use
##for sections and###for subsections. Rule pages use####inside a rule.
Don't¶
- Start a page with a diagram, an admonition or a table before the purpose statement.
How to check¶
The page has one # heading, followed directly by a short paragraph that states the topic and the audience.
CS-DOCS-003: Give every page front matter¶
Severity: minor · Applies to: docs · Enforced by: connectsoft-docs.ps1 validate · Status: active
Why¶
The front matter feeds search, the documentation inventory and the canonical-source checks described in Documentation source of truth.
Do¶
- Start every page with YAML front matter that has
titleanddescription. - On a canonical page, also set
owner,scope: canonicaland a uniquecanonicalId. - Add
tagsthat match existing tags where possible.
Don't¶
- Reuse a
canonicalIdthat another page already has.
Example¶
---
title: Order export
description: How the orders service exports orders to the reporting store.
owner: ConnectSoft.Documentation
scope: canonical
canonicalId: example.orders.order-export
tags:
- engineering-standards
- git
---
How to check¶
Run scripts/connectsoft-docs.ps1 validate and check-canonical-drift. Neither reports the page.
CS-DOCS-004: Keep the site building in strict mode¶
Severity: major · Applies to: docs · Enforced by: manual (target: DOC-001) · Status: active
Why¶
A strict build fails on broken links, broken anchors and missing nav targets. These are exactly the defects that make readers and agents land on the wrong page.
Do¶
- Run
mkdocs build --strictbefore opening the pull request. - Add every new page to the
mkdocs.ymlnav. - Link to other pages with relative paths to the
.mdfile, and to sections with their anchor.
Don't¶
- Link to a page of the same site with an absolute URL.
- Use
mkdocs build -qto judge the result, because it hides the warnings.
How to check¶
mkdocs build --strictcompletes with no warnings for the changed pages.- Each new page appears in the
mkdocs.ymlnav. A page left out of the nav is not a strict-build warning by default. - Search changed pages for links to the site's own published URL. The strict build does not report absolute links by default.
CS-DOCS-005: Keep client names, people and secrets out of canonical documentation¶
Severity: major · Applies to: docs · Enforced by: connectsoft-docs.ps1 check-standards (privacy denylist) · Status: active
Why¶
Canonical ConnectSoft documentation, templates and generated AGENTS.md files are copied into every client project. Content about one client leaks into another, and personal data in documentation is a privacy breach. ADR-0104 sets this rule for the standards.
Do¶
- Use neutral examples, such as
Order,CustomerandInvoice. - Describe defects and lessons in general terms: the symptom, the cause and the check.
- Keep client-specific documentation in the client's own repositories.
Don't¶
Put any of these in canonical pages, templates or generated files: - client or project names; - people's names; - internal ticket or change-request IDs; - dates of specific incidents; - environment URLs; - credentials.
How to check¶
scripts/connectsoft-docs.ps1 check-standardsreports no denylisted term.- The page has no names, ticket IDs or URLs that identify a client or a person.
CS-DOCS-006: Use admonitions for their meaning¶
Severity: nit · Applies to: docs · Enforced by: manual · Status: active
Why¶
Readers learn what each admonition colour means. Using a warning for a tip trains them to ignore warnings.
Do¶
| Admonition | Use for |
|---|---|
!!! note |
Helpful extra context. |
!!! tip |
A recommended practice and why it matters. |
!!! warning |
Something that can break an environment, lose data or cause serious confusion. |
!!! important |
A policy that always applies. |
!!! abstract "Decision" |
A summary of a decision, linking its ADR or BDR. |
Don't¶
- Put the main content of a section inside an admonition.
- Indent text by four spaces after an admonition unless it belongs to it. Indented text outside an admonition renders as a code block.
- Indent an admonition body by more than four spaces. The extra indentation turns the body into a code block, and the strict build does not report it.
How to check¶
Each admonition's type matches its content, and no paragraph renders as an unintended code block.
CS-DOCS-007: Make diagrams render and stay true¶
Severity: minor · Applies to: docs · Enforced by: manual · Status: active
Why¶
A Mermaid diagram that fails to parse shows as an error box in the built page, and mkdocs build --strict does not catch it. A diagram that no longer matches the code misleads more than text does.
Do¶
- Draw diagrams in Mermaid in a fenced
mermaidblock. - Check that each diagram renders, in the built site or with a Mermaid validator.
- Avoid the constructs that most often fail to parse:
;in sequence diagram messages and labels, unquoted special characters in flowchart labels, a%%comment at the end of a line, and a closing fence of a different length from the opening one. After generating or changing many diagrams, run a parse scan over every diagram block of the built site. - Update the diagram in the same pull request that changes the behaviour it shows.
Don't¶
- Add a diagram that repeats a short list in the text.
- Commit diagrams only as images, when a Mermaid source can be kept next to the text.
How to check¶
Each changed Mermaid block renders without a parse error, and matches the behaviour described in the text.
CS-DOCS-008: Validate anchors in every documentation site¶
Severity: minor · Applies to: docs, template · Enforced by: manual (target: DOC-048) · Status: active
Why¶
By default, MkDocs checks that a linked page exists, but not that the section a link points to exists on it. A heading anchor that is mistyped, renamed or ignored then breaks every link to it, and the strict build still passes.
Do¶
-
Turn on link and anchor validation in
mkdocs.yml, so that the strict build fails on a missing page or anchor: -
End a heading with its
{ #anchor }block, and put nothing after it on the line. - Keep the validation block in documentation templates, so that every new site starts with it.
Don't¶
- Put a status marker, an emoji or other text after a heading's
{ #anchor }block.
How to check¶
mkdocs.ymlsetsanchors: warnundervalidation: links:, and the strict build passes.- Search changed headings for any text after the closing
}of a{ #anchor }block.