Documentation Lints Reference
This is the canonical inventory of documentation checks. Other pages link here instead of
repeating it. There are nine validation scripts under scripts/docs/. Most run in a PR check, but
two do not β a green PR does not mean all nine passed.
What runs in CIβ
docs-lint.yml (PRs that touch docs content)β
| Check | Script | Scope in CI |
|---|---|---|
| Doc structure | lintDocStructure.js | Only the PR's changed files under docs/01-business and docs/03-Integration. See which rules apply. |
| Links, anchors, duplicate slugs | lintDocLinks.js | Whole repo. Slug check is product-scope aware. |
| Slug collisions | lintSlugCollisions.js | Whole repo. Checks each Docusaurus plugin instance independently. |
| Product scope | lintProductScope.js | Whole repo. Fails if a file or nested _category_.json contradicts an ancestor folder's productOnly lock. |
| Optum Wallet tag leaks | lintOptumWalletTagLeaks.js | Whole repo. Source-only: regenerates docs-optum-wallet/ and flags symlinked pages that contain <Product> or <Audience> tags. |
| AI guidance | lintAiGuidance.js | Only when a PR touches .ai/, .github/instructions/, .github/agents/, AGENTS.md, CLAUDE.md, or the lint itself. |
pr-build-check.yml (PRs to main)β
It builds the internal and merchant audiences with yarn build. No image is pushed and no
deployment issue is created. The build runs the prebuild hook (prepareAudienceAssets.js), which
includes generateOptumWalletContent.js and, for the merchant build, validateMerchantSearch.js.
| Step | What it checks |
|---|---|
build-internal | The internal build succeeds, then lintOptumWalletTagLeaks.js --require-build scans build/optum-wallet/ for leaked CCG-only content and fails if that output is missing. |
build-merchant | The merchant build succeeds. Three guards run and fail the workflow with a PR comment: DOCS_AUDIENCE=merchant is set exactly once in build-merchant.yml, values-dev.yaml points at docs-merchant, and the merchant artifact and sitemap contain no internal routes (docs-ccg-internal/engineering-guide, docs-ccg-internal/high-level-designs, docs-site/contributing-guide, docs-site/announcements/internal). |
A build failure is a real signal, but it is a build check, not a named lint step. Read the failing step's log to see what broke.
Not run in CIβ
Run these yourself when your change touches what they check.
| Script | Run it | Checks |
|---|---|---|
lintOpenApiExamples.js | yarn lint:openapi-examples | Contract-sensitive endpoint and example relationships stay consistent. |
lintSchemaConsistency.js | yarn lint:schemas | OpenAPI schema field conventions (missing default: values, PascalCase naming). Run after touching openapi/v2/schemas/. |
Commandsβ
| Command | Runs |
|---|---|
yarn lint:docs | lintDocStructure.js, lintOpenApiExamples.js, lintDocLinks.js, lintSlugCollisions.js, lintProductScope.js, lintOptumWalletTagLeaks.js |
yarn lint:links | lintDocLinks.js alone |
yarn lint:slugs | lintSlugCollisions.js alone |
yarn lint:product-scope | lintProductScope.js alone |
yarn lint:ow-tag-leaks | lintOptumWalletTagLeaks.js alone |
yarn lint:merchant-search | validateMerchantSearch.js alone (add --build-dir build after a build to check every indexed route exists) |
yarn lint:ai-guidance | lintAiGuidance.js |
yarn review:manifest -- <files> | buildReviewManifest.js: lists which instruction files and standards apply to the changed files, for reviewers |
Use yarn lint:docs locally for the fullest check before opening a PR. CI runs a different set: it
skips lintOpenApiExamples.js and scopes lintDocStructure.js to changed files.
Doc Structure Lint β which rules applyβ
lintDocStructure.js applies different rules to different document families. Run
node scripts/docs/lintDocStructure.js --files path/to/your-doc.md for a focused check.
| Content family | Structure check |
|---|---|
Current Business capability pages under docs/01-business/3-Core-Capabilities/ | Content boundary checks; no fixed heading list or mandatory tip |
| Other Business pages | No Business structure template enforced |
| Legacy API Integration pages | Required sections and :::tip Integration Details; see Integration Document Guidelines |
| Migrated Diataxis Integration pages | Their own page-type rules; the legacy section template does not apply |
| API error-code pages | Error-code structure; see API Error Code Guidelines |
| Selected internal Engineering Guide pages | Diataxis label and slug checks; see Engineering Guide Documentation Guidelines |
The Business Documentation Guidelines describe how to organize Business content. A capability page can use headings that fit its reader's decision, such as Eligibility and business rules or What happens to the payment. It does not need Key Benefits, How It Works, Scenarios, Related Documentation, or a :::tip Get Started block merely to pass structure lint.
Business content boundaryβ
The linter still flags implementation material in Business capability pages, including versioned HTTP endpoint paths, curl and shell examples, API version declarations, OpenAPI or Swagger mentions, and API request or response sections. Move those details to Integration and link to the appropriate guide. Internal-only material inside <Audience include="internal"> is excluded from these checks, although a separate Engineering page is usually a clearer home.
| If you see | Do this |
|---|---|
| A request or response example | Move it to Integration and link from the Business outcome |
| A processing or processor detail | Move it to the Engineering Guide; retain only the business consequence |
| A missing-section error on an Integration page | Check whether it is a legacy template page or a migrated Diataxis page |
Focused validationβ
node scripts/docs/lintDocStructure.js --files docs/01-business/3-Core-Capabilities/1-Payments/Split-Tender/payments.md
node scripts/docs/lintDocLinks.js
git diff --check
The structure linter does not verify that a product claim is true or that a link names the correct destination. Review those manually using the Business Documentation Guidelines.
Related, not a lintβ
Generators and config the lints depend on:
| File | Purpose |
|---|---|
generateOptumWalletContent.js | Regenerates docs-optum-wallet/ from productOnly: frontmatter. Runs automatically; never hand-edit or commit that folder. See Optum Wallet & CCG Product Model. |
prepareMerchantOpenapi.js | Copies openapi/ to .openapi-merchant/, strips [Learn More](...) links, and removes User-scoped operations from the merchant API reference. |
prepareOptumWalletOpenapi.js | Builds Optum Wallet's own API reference spec (Sessions, Refunds, and the payment operations its scope allows). |
generateSearchPages.js | Builds the search index. Audience-aware; not product-aware. |
generateErrorCodeReference.js | yarn error-codes regenerates api-error-codes-reference.md from the error code pages. |
config/audience-exclude-globs.js | Source of truth for folders excluded per audience. See Internal vs. Merchant Content Guide. |
config/optum-wallet-exclude-globs.js | Hides productOnly: optum-wallet sibling pages from the CCG build. |
config/legacy-redirects.js | Source of truth for redirects from moved or renamed pages. Add an entry whenever a slug changes. See Redirects for Moved or Merged Content. |