Documentation policy
Policies that keep the org coherent
Complements repository-policy.md and package-policy.md.
Every packable library under src/ must ship:
- XML API documentation (
GenerateDocumentationFilewith strictCS1591— no suppressions). - A package README at
src/<Project>/README.md, packed viaPackageReadmeFile.
XML documentation (public API)
Document all public and protected types and members:
| Element | Required |
|---|---|
| Types, members | `/// <summary>` |
| Method parameters | `/// <param name="...">` |
| Return values (non-void) | `/// <returns>` |
| Generic type parameters | `/// <typeparam name="...">` |
| Documented exceptions | `/// <exception cref="...">` when part of the contract |
Guidelines:
- Use
/// <see cref="..."/>for cross-references. - Use
/// <inheritdoc/>on explicit interface implementations. - Do not document
privateorinternalmembers unless intentionally exposed. - Generated binding surfaces produced by codegen: document regeneration and manifest inputs in the package README; do not hand-maintain thousands of
///on generated members unless the generator emits them.
Package README
Authoritative copy: src/<Project>/README.md (or codegen/<Project>/README.md) is packed into each .nupkg via PackageReadmeFile and appears in Visual Studio / nuget.org.
GitHub Packages UI: The package page often shows the repository root README.md for every package in the repo (NuGet/Home#14849). Mitigations:
- Run
scripts/sync-repo-package-index-readme.ps1on multi-package repos so the repo README links to each package README. - Set
PackageProjectUrlto the blob URL of that package’s README (src/Directory.Build.propspattern innovolis-raylib). - After pack, run
scripts/verify-nupkg-package-readme.ps1to confirm the.nupkgH1 matchesPackageId.
Each packable project directory must contain README.md with:
- Title and one-line purpose
dotnet add package <PackageId>- Prerequisites (
.NET 10/net10.0) - Minimal quick-start code sample
- When to use this package vs sibling packages (table for meta/umbrella packages)
- Links to repo
docs/getting-started.mdand related package READMEs - Stability note when pre-release
MSBuild wiring
Import Novolis.Documentation.props from the repo only after all packable packages in that repo pass a strict build (no missing XML docs).
Standard csproj fragment:
Import Novolis.PackageReadme.props from repo src/Directory.Build.props (packs README + sets PackageReadmeFile; suppresses NU5118 duplicate-readme warning).
Repo-level import (example):
<Import Project="$(MSBuildThisFileDirectory)build\Novolis.Example.Documentation.props"
Condition="Exists('$(MSBuildThisFileDirectory)build\Novolis.Example.Documentation.props')" />Novolis.Example.Documentation.props:
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\novolis-governance\build\Novolis.Documentation.props"
Condition="Exists('$(MSBuildThisFileDirectory)..\..\novolis-governance\build\Novolis.Documentation.props')" />
</Project>Apply to packable src/**/*.csproj via Directory.Build.props under src/ or per-project Import of repo documentation props.
CI audit
Run scripts/doc-audit.ps1 before merge when a repo is marked documentation-complete (build/.novolis-documentation-complete marker file). The audit fails on missing READMEs, missing Install / Quick start sections, and placeholder quick starts (// See docs/getting-started.md).
Scaffold
New packages: copy docs/templates/package-readme.md.