Documentation Validation Rules
Coverage Metrics by Type
| Type | Key Metric | Target | How Measured |
|---|---|---|---|
| CODING | Entity Coverage | >= 90% | Documented services / total services |
| CODING | Signpost Accuracy | 100% | Referenced functions exist |
| INFORMATIONAL | Frontmatter Valid | >= 95% | Required fields present |
| INFORMATIONAL | Links Valid | 100% | All internal links resolve |
| OPS | Values.yaml Coverage | >= 80% | Documented keys / total keys |
| OPS | Golden Completeness | 100% | Required sections present |
INFORMATIONAL Validation
No standalone validator script ships with this skill. Run the checks below
manually — for doc-file presence coverage use the shipped
skills/doc/scripts/audit-oss-docs.sh; for link/orphan/path checks write a
short throwaway Python script in the target repo (not bash: bash loops are
O(n*m) and time out on large repos, while Python processes 350+ files in
seconds with cleaner regex extraction).
Checks Performed
- Broken Links - ALL internal .md links resolved
- Orphaned Docs - Files not referenced from any index
- Index Completeness - READMEs reference all subdirectories
- Hardcoded Paths - Absolute paths like /Users/, /home/
Output Format
CRITICAL: Broken Links (81)
file.md:42 -> missing.md (not found)
MEDIUM: Orphaned Documents (13)
path/to/orphan.md
LOW: Hardcoded Paths (2)
file.md:156 -> /Users/...
SUMMARY: 96 issues (81 critical, 13 medium, 2 low)CODING Validation
Required Sections (16)
From code-map-standard skill:
- Current Status (one-liner with date)
- Overview (2-3 sentences)
- State Machine (ASCII diagram if applicable)
- Inputs/Outputs (table)
- Data Flow (ASCII diagram)
- API Endpoints (table with curl examples)
- Code Signposts (NO line numbers)
- Configuration (table)
- Prometheus Metrics (table + PromQL examples)
- Error Handling (table)
- Unit Tests (table)
- Integration Tests (separate from unit)
- Example Usage (curl + SDK)
- Related Features (cross-links)
- Known Limitations
- Learnings (What Worked + What We'd Change)
Signpost Rules
- NO line numbers - Functions/classes only
- References must exist in source files
- Use semantic names:
authenticate(),UserService
OPS Validation
Required Sections
- Overview with Chart.yaml description
- Quick Start with install command
- Values Reference table
- Dependencies table
- Environment overrides (dev/staging/prod)
- Troubleshooting table
Values.yaml Coverage
Every key in values.yaml should have:
- Description comment or doc reference
- Type specification
- Default value explanation
Coverage Report Format
===================================================================
DOCUMENTATION COVERAGE REPORT
===================================================================
Repository: [REPO_NAME]
Type: [CODING|INFORMATIONAL|OPS]
Generated: [date]
SUMMARY
-------------------------------------------------------------------
Total Features: 25
Documented: 22 (88%)
Missing: 3
Orphaned: 1
MISSING DOCUMENTATION
-------------------------------------------------------------------
| Feature | Priority | Source Files |
|---------|----------|--------------|
| auth-service | P1 | services/auth/*.py |
ORPHANED DOCUMENTATION
-------------------------------------------------------------------
| Document | Last Updated | Action |
|----------|--------------|--------|
| legacy-api.md | 2023-06-15 | Remove |
===================================================================Semantic Validation (CODING repos)
Structure vs Semantic: Structural validation checks formatting. Semantic validation checks if claims are TRUE.
Semantic Metrics
| Check | How | Target |
|---|---|---|
| Status Accuracy | Compare "Status: X" to deployment state | 100% |
| Claim Verification | Cross-ref with ground truth file | 100% |
| Validation Freshness | Status includes date | < 30 days |
Ground Truth Pattern
Establish ONE authoritative file per domain. Other docs MUST reference, not duplicate.
| Domain | Ground Truth | Pattern |
|---|---|---|
| Agents | docs/agents/catalog.md |
Reference via link |
| Images | charts/*/IMAGE-LIST.md |
Reference via link |
| Config | values.yaml |
Generate docs from source |
Status Validation
Valid status formats:
## Current Status: ✅ RUNNING
Validated: 2026-01-04 against ocppoc cluster
## Current Status: ❌ FAILED
Status: Accepted=False (CRD exists but not running)
Validated: 2026-01-04 against ocppoc cluster
## Current Status: 📝 PLANNED
Not yet deployed - template onlySemantic Validation Commands
# Check status claims against cluster (manual)
oc get pods -n ai-platform | grep <service>
oc get agents.kagent.dev -n ai-platform
# Cross-reference with ground truth
diff <(grep "Status:" docs/code-map/services/*.md) <(cat docs/agents/catalog.md)--verify-claims Flag
When running /doc coverage --verify-claims:
- Extract all "Status: X" claims from docs
- Query deployment state (oc get pods, oc get agents)
- Report mismatches as CRITICAL
- Flag stale validation dates (>30 days) as WARNING
Anti-Patterns
| DON'T | DO INSTEAD |
|---|---|
| Sample 20 files, declare "healthy" | Scan ALL files |
| Say "healthy" with broken links | Report exact issue counts |
| Skip validation for "organized" repos | Validate regardless |
| Use bash loops on large repos | Use Python validator |
| Claim "deployed" without verification | Validate against cluster first |
| Duplicate ground truth data | Reference authoritative file |
| Omit validation dates | Include "Validated: DATE against SOURCE" |