Validate documentation traceability between code annotations (@implements), feature registry, business rules, and use cases. Detect ID collisions, undocumented features, broken cross-references, and namespace violations.
60
72%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.github/skills/doc-traceability-validator/SKILL.mdValidate and maintain accurate traceability between code annotations (@implements FEATXXXX) and documentation registries (features.md, business_rules.md, use_cases.md). This skill detects gaps, collisions, and broken cross-references that compromise documentation accuracy.
Use this skill when you need to:
The validation framework ensures bidirectional traceability:
Code (@implements FEATXXXX) ←→ features.md ←→ business_rules.md ←→ use_cases.mdChain integrity requires:
| Dimension | Weight | Description |
|---|---|---|
| Completeness | 40% | % of code @implements that have docs |
| Uniqueness | 30% | % of IDs that are unique (no collisions) |
| Cross-refs | 20% | % of BR/UC references that resolve |
| Namespace | 10% | % of IDs in correct allocated ranges |
Composite Score:
Score = (0.40 × Completeness) + (0.30 × Uniqueness)
+ (0.20 × CrossRefs) + (0.10 × Namespace)Standard range allocation for EdgeQuake:
| Range | Module | Team |
|---|---|---|
| FEAT00XX | Core Pipeline | Backend |
| FEAT01XX | Query Engine | Backend |
| FEAT02XX | Graph Storage | Backend |
| FEAT03XX | Streaming/Pipeline | Backend |
| FEAT04XX | Conversations/Citations | Frontend |
| FEAT05XX | PDF/Lineage | Backend |
| FEAT06XX | WebUI Core | Frontend |
| FEAT07XX | API Client/Utils | Frontend |
| FEAT08XX | Authentication | Backend |
| FEAT085X | Cost Management | Frontend |
| FEAT086X | WebUI Providers | Frontend |
| FEAT10XX | Document Mgmt UI | Frontend |
cd /path/to/edgequake
# Validate features
python3 .github/skills/doc-traceability-validator/scripts/validate_features.py \
--code-dir edgequake_webui/src \
--docs-file docs/features.md \
--verbose
# Validate full traceability chain
python3 .github/skills/doc-traceability-validator/scripts/validate_traceability.py \
--code-dir edgequake_webui/src \
--features docs/features.md \
--rules docs/business_rules.md \
--usecases docs/use_cases.md \
--output-report validation_report.json# Auto-generate feature entries from code annotations
python3 .github/skills/doc-traceability-validator/scripts/generate_registry.py \
--code-dir edgequake_webui/src \
--output features_generated.md \
--format markdown# .github/workflows/docs-validation.yml
name: Documentation Validation
on: [pull_request]
jobs:
validate-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install -r .github/skills/doc-traceability-validator/scripts/requirements.txt
- name: Validate documentation
run: |
python3 .github/skills/doc-traceability-validator/scripts/validate_features.py \
--code-dir edgequake_webui/src \
--docs-file docs/features.md \
--fail-threshold 95.0Scan code for @implements annotations and compare with features.md.
Arguments:
--code-dir: Directory to scan for @implements annotations--docs-file: Path to features.md--pattern: Regex for annotation format (default: @implements\s+(FEAT\d{4}))--extensions: File extensions to scan (default: .ts,.tsx,.rs)--fail-threshold: Minimum completeness score (0-100)--output-json: Save results to JSON file--verbose: Show detailed outputOutput:
Feature Validation Report
=========================
Code Features Found: 247
Documented Features: 104
Undocumented: 143 (42.1% gap)
Duplicate IDs: 7
Unique Code Features: 240
Completeness Score: 42.1%
Uniqueness Score: 97.2%
Overall Score: 63.4%
DUPLICATE IDs (CRITICAL):
FEAT0636: 2 occurrences
- hooks/use-debounce.ts:12
- components/shared/empty-state.tsx:6
...
UNDOCUMENTED FEATURES:
FEAT0401 - hooks/use-conversations.ts:10
FEAT0402 - hooks/use-conversations.ts:11
...Validate complete FEAT↔BR↔UC traceability chain.
Arguments:
--code-dir: Directory with @implements annotations--features: Path to features.md--rules: Path to business_rules.md--usecases: Path to use_cases.md--output-report: Save full report to JSON--fix-suggestions: Generate suggested fixesOutput:
Traceability Validation Report
==============================
Features: 104 documented, 247 in code
Rules: 89 documented
UseCases: 56 documented
Cross-Reference Validation:
Features → Rules: 87/104 valid (83.7%)
Rules → Features: 85/89 valid (95.5%)
Rules → UseCases: 52/89 valid (58.4%)
UseCases → Rules: 48/56 valid (85.7%)
Broken References:
features.md:L340 - BR0999 not found
business_rules.md:L560 - FEAT9999 not found
...
Overall Traceability Score: 78.3%Auto-generate features.md entries from code annotations.
Arguments:
--code-dir: Directory to scan--output: Output file path--format: Output format (markdown, json, csv)--group-by: Group by range, module, or file--include-context: Include surrounding code contextOutput (markdown):
### FEAT0401 - Conversation Persistence
| Attribute | Value |
| ------------------ | ----------------------------------------------------------------------------- |
| **ID** | FEAT0401 |
| **Name** | Conversation Persistence |
| **Module** | edgequake_webui |
| **Status** | ⚠️ Undocumented |
| **Code Reference** | [use-conversations.ts](../edgequake_webui/src/hooks/use-conversations.ts#L10) |
| **Description** | Auto-extracted from code context |
| **Related** | (needs manual entry) |Validate FEAT IDs follow allocated ranges.
Arguments:
--code-dir: Directory to scan--allocation-file: YAML file with range allocations--team: Filter by team (frontend/backend)Output:
Namespace Validation Report
===========================
Total Features: 247
In Allocated Range: 235 (95.1%)
Out of Range: 12 (4.9%)
Violations:
FEAT0800 in components/theme-provider.tsx
Expected range: FEAT08XX (Auth/Backend)
Actual usage: Theme support (Frontend)
Suggestion: Move to FEAT086X (WebUI Providers)# Add to .git/hooks/pre-commit
python3 .github/skills/doc-traceability-validator/scripts/validate_features.py \
--code-dir edgequake_webui/src \
--docs-file docs/features.md \
--fail-threshold 100.0When adding @implements FEATXXXX:
# Weekly coverage report
python3 .github/skills/doc-traceability-validator/scripts/validate_features.py \
--code-dir . \
--docs-file docs/features.md \
--output-json coverage_$(date +%Y%m%d).jsonDuplicate FEAT IDs are CRITICAL - they break traceability:
This skill was developed and validated through 10 OODA loop iterations on the EdgeQuake codebase:
Code Features Found: 247
Documented Features: 104
Undocumented: 143 (42.1% gap)
Duplicate IDs: 42
Completeness Score: 57.9%
Uniqueness Score: 79.1%Code Features Found: 201
Documented Features: 224
Undocumented: 0 (0.0% gap)
Cross-cutting duplicates: 42 (intentional, multi-layer)
True collisions: 0 (all fixed!)
Completeness Score: 100.0%
Uniqueness Score: 100.0%
Overall Score: 100.0%The validation tool now recognizes that duplicates spanning multiple architectural layers (types, stores, hooks, components, lib) are intentional:
FEAT0001: 5x across ['components', 'lib', 'pages', 'stores', 'types'] ← OK!
FEAT0601: 8x across ['components', 'hooks', 'lib', 'pages', 'stores', 'types'] ← OK!
FEAT0734: 3x in ['components/query'] ← OK! (related components)This is standard React/TypeScript architecture where the same feature is implemented across layers.
generate_registry.py to create templates62e6adb
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.