| name | validate-docs |
| description | Validate documentation pages against project conventions. Use when checking if doc pages are correctly set up, debugging broken navigation, or before committing doc changes. Checks all three registration points, TOC consistency, section IDs, and YAML schema compliance. |
| argument-hint | ["page-slug"] |
| allowed-tools | Read, Grep, Glob, Bash(npx tsc --noEmit) |
Validate Documentation Pages
Validate that documentation pages follow all project conventions. If $ARGUMENTS is provided, validate only the specified page slug. Otherwise, validate all pages.
Validation checklist
Run each check below and report results as PASS/FAIL with details.
Check 1: Four-file registration
For each page being validated, confirm it exists in all four locations:
lib/docs-data.ts โ slug appears in docSections items array
lib/docs-data.ts โ slug has entries in tocByPage
components/docs/page-content.tsx โ slug has an import and entry in pageComponents
components/docs/pages/<slug>.tsx โ component file exists
docs/<section-slug>/<slug>.md โ markdown backup file exists
Report any pages that are missing from one or more locations.
Check 2: TOC-to-section ID consistency
For each page:
- Read the TOC entries from
tocByPage in lib/docs-data.ts
- Read the page component file
- Extract all
id="..." attributes on elements with scroll-mt-20
- Verify every TOC
id has a matching element id in the component
- Verify the first TOC entry is
{ title: "Overview", id: "overview" }
Report any mismatches (TOC IDs without matching sections, or sections without TOC entries).
Check 3: Section structure
For each page component, verify:
- Every
<section> tag has both an id attribute AND className containing scroll-mt-20
- The header element uses
id="overview" and scroll-mt-20
- Sections are separated by
<Separator className="my-8" />
Check 4: Import consistency
In components/docs/page-content.tsx, verify:
- Every slug in
pageComponents has a corresponding import statement
- The import path matches
@/components/docs/pages/<expected-filename>
- The export name follows PascalCase-of-slug + "Page" convention
Check 5: YAML schema compliance
Search all page component files for CodeBlock usage with language="yaml". For any YAML that appears to be Harness pipeline configuration, verify it follows v1 schema:
- NO
projectIdentifier, orgIdentifier, or identifier fields
- NO
type: Deployment (should be type: deploy)
- NO
spec: blocks inside steps (should use with:)
- NO
<+expression> syntax (should use ${{ expression }})
- NO
serviceRef or environmentRef (should be service and environment)
Check 6: TypeScript compilation
Run npx tsc --noEmit and report any type errors.
Output format
Documentation Validation Report
================================
Page: <slug>
[PASS] Registered in docSections
[PASS] Registered in tocByPage
[PASS] Registered in pageComponents
[PASS] Component file exists
[PASS] Markdown backup exists
[PASS] TOC IDs match section IDs
[FAIL] Missing scroll-mt-20 on section "foo-section"
...
Summary: X pages checked, Y passed all checks, Z have issues
If all checks pass, congratulate the user. If there are failures, provide specific fix instructions for each issue.