Checking access…

Skip to main content

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)​

CheckScriptScope in CI
Doc structurelintDocStructure.jsOnly the PR's changed files under docs/01-business and docs/03-Integration. See which rules apply.
Links, anchors, duplicate slugslintDocLinks.jsWhole repo. Slug check is product-scope aware.
Slug collisionslintSlugCollisions.jsWhole repo. Checks each Docusaurus plugin instance independently.
Product scopelintProductScope.jsWhole repo. Fails if a file or nested _category_.json contradicts an ancestor folder's productOnly lock.
Optum Wallet tag leakslintOptumWalletTagLeaks.jsWhole repo. Source-only: regenerates docs-optum-wallet/ and flags symlinked pages that contain <Product> or <Audience> tags.
AI guidancelintAiGuidance.jsOnly 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.

StepWhat it checks
build-internalThe 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-merchantThe 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.

ScriptRun itChecks
lintOpenApiExamples.jsyarn lint:openapi-examplesContract-sensitive endpoint and example relationships stay consistent.
lintSchemaConsistency.jsyarn lint:schemasOpenAPI schema field conventions (missing default: values, PascalCase naming). Run after touching openapi/v2/schemas/.

Commands​

CommandRuns
yarn lint:docslintDocStructure.js, lintOpenApiExamples.js, lintDocLinks.js, lintSlugCollisions.js, lintProductScope.js, lintOptumWalletTagLeaks.js
yarn lint:linkslintDocLinks.js alone
yarn lint:slugslintSlugCollisions.js alone
yarn lint:product-scopelintProductScope.js alone
yarn lint:ow-tag-leakslintOptumWalletTagLeaks.js alone
yarn lint:merchant-searchvalidateMerchantSearch.js alone (add --build-dir build after a build to check every indexed route exists)
yarn lint:ai-guidancelintAiGuidance.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 familyStructure check
Current Business capability pages under docs/01-business/3-Core-Capabilities/Content boundary checks; no fixed heading list or mandatory tip
Other Business pagesNo Business structure template enforced
Legacy API Integration pagesRequired sections and :::tip Integration Details; see Integration Document Guidelines
Migrated Diataxis Integration pagesTheir own page-type rules; the legacy section template does not apply
API error-code pagesError-code structure; see API Error Code Guidelines
Selected internal Engineering Guide pagesDiataxis 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 seeDo this
A request or response exampleMove it to Integration and link from the Business outcome
A processing or processor detailMove it to the Engineering Guide; retain only the business consequence
A missing-section error on an Integration pageCheck 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.

Generators and config the lints depend on:

FilePurpose
generateOptumWalletContent.jsRegenerates docs-optum-wallet/ from productOnly: frontmatter. Runs automatically; never hand-edit or commit that folder. See Optum Wallet & CCG Product Model.
prepareMerchantOpenapi.jsCopies openapi/ to .openapi-merchant/, strips [Learn More](...) links, and removes User-scoped operations from the merchant API reference.
prepareOptumWalletOpenapi.jsBuilds Optum Wallet's own API reference spec (Sessions, Refunds, and the payment operations its scope allows).
generateSearchPages.jsBuilds the search index. Audience-aware; not product-aware.
generateErrorCodeReference.jsyarn error-codes regenerates api-error-codes-reference.md from the error code pages.
config/audience-exclude-globs.jsSource of truth for folders excluded per audience. See Internal vs. Merchant Content Guide.
config/optum-wallet-exclude-globs.jsHides productOnly: optum-wallet sibling pages from the CCG build.
config/legacy-redirects.jsSource of truth for redirects from moved or renamed pages. Add an entry whenever a slug changes. See Redirects for Moved or Merged Content.