.agents/skills/markdown-crossref-validator/SKILL.md
Validate cross-references in markdown documents, ensuring links and references point to existing sections, headings, or files.
npx skillsauth add prulloac/git-blame-vsc markdown-crossref-validatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when the user asks to validate or check cross-references in markdown files. This includes verifying that internal links (e.g., text) point to existing headings, and that file references (e.g., text) point to existing files.
^#+\s+(.*)$# Introduction → Introductionintroduction → heading level (1-6)[text](url) using regex \[([^\]]+)\]\(([^)]+)\)[text][ref] using regex \[([^\]]+)\]\[([^\]]+)\][ref]: url using regex ^\s*\[([^\]]+)\]:\s*(.+)$<a href="url">text</a>#heading-namepath/to/file.mdpath/to/file.md#sectionhttp://..., https://...../other.md#anchor)path/to/file.md)path/to/file.md#section):
http://, https://)Classify all broken references by type:
Input: docs/guide.md
# Getting Started Guide
## Table of Contents
- [Installation](#installation)
- [Configuration](#configuration)
- [Advanced Setup](#advanced-setup)
## Installation
Follow these steps to install...
## Configuration
See [Installation](#installation) for prerequisites.
## Advanced Setup
For complex scenarios, refer to [Config](#configuration).
## Troubleshooting
Check [Non-existent Section](#missing-section) for help.
Validation Report:
═══════════════════════════════════════════════════════════
MARKDOWN CROSS-REFERENCE VALIDATION REPORT
═══════════════════════════════════════════════════════════
File: docs/guide.md
Scan Date: 2024-02-21
Status: ✓ VALIDATED WITH ISSUES
───────────────────────────────────────────────────────────
SUMMARY
───────────────────────────────────────────────────────────
Total Links Found: 5
Valid References: 4
Broken References: 1
Validation Rate: 80%
───────────────────────────────────────────────────────────
VALID REFERENCES ✓
───────────────────────────────────────────────────────────
✓ Line 4: [Installation](#installation)
Type: Internal anchor
Status: Heading "Installation" found at line 11
✓ Line 5: [Configuration](#configuration)
Type: Internal anchor
Status: Heading "Configuration" found at line 18
✓ Line 5: [Advanced Setup](#advanced-setup)
Type: Internal anchor
Status: Heading "Advanced Setup" found at line 22
✓ Line 19: [Installation](#installation)
Type: Internal anchor (cross-reference)
Status: Valid, heading exists
───────────────────────────────────────────────────────────
BROKEN REFERENCES ✗
───────────────────────────────────────────────────────────
✗ Line 26: [Non-existent Section](#missing-section)
Type: Internal anchor
Issue: MISSING HEADING
Anchor: #missing-section
Status: No heading found matching "missing-section"
Suggestion: Available sections in document:
- #getting-started-guide (h1)
- #table-of-contents (h2)
- #installation (h2)
- #configuration (h2)
- #advanced-setup (h2)
- #troubleshooting (h2)
───────────────────────────────────────────────────────────
ANCHOR MAPPING
───────────────────────────────────────────────────────────
getting-started-guide (Level 1) → Line 1
table-of-contents (Level 2) → Line 3
installation (Level 2) → Line 11
configuration (Level 2) → Line 18
advanced-setup (Level 2) → Line 22
troubleshooting (Level 2) → Line 25
═══════════════════════════════════════════════════════════
Input: Multiple files in docs/ directory
Files:
docs/index.md - Main documentation indexdocs/guide/installation.md - Installation guidedocs/guide/config.md - Configuration guidedocs/api/endpoints.md - API referenceContent: docs/index.md
# Documentation Index
- [Installation Guide](guide/installation.md)
- [Configuration](guide/config.md#configuration)
- [API Reference](api/endpoints.md)
- [Getting Help](support/help.md)
- [Basic Setup](#quick-start)
## Quick Start
See [Installation](guide/installation.md#system-requirements) for details.
Validation Report:
═══════════════════════════════════════════════════════════
MARKDOWN CROSS-REFERENCE VALIDATION REPORT
═══════════════════════════════════════════════════════════
File: docs/index.md
Scan Date: 2024-02-21
Status: ⚠ VALIDATED WITH CRITICAL ISSUES
───────────────────────────────────────────────────────────
SUMMARY
───────────────────────────────────────────────────────────
Total Links Found: 6
Valid References: 3
Broken References: 3
Validation Rate: 50%
───────────────────────────────────────────────────────────
VALID REFERENCES ✓
───────────────────────────────────────────────────────────
✓ Line 3: [Installation Guide](guide/installation.md)
Type: File reference
Path: docs/guide/installation.md
Status: File exists (2.5 KB)
✓ Line 4: [Configuration](guide/config.md#configuration)
Type: File with anchor
Path: docs/guide/config.md
Anchor: #configuration
Status: File exists, heading found in target
✓ Line 8: [Installation](guide/installation.md#system-requirements)
Type: File with anchor
Path: docs/guide/installation.md
Anchor: #system-requirements
Status: File exists, heading found in target
───────────────────────────────────────────────────────────
BROKEN REFERENCES ✗
───────────────────────────────────────────────────────────
✗ Line 5: [API Reference](api/endpoints.md)
Type: File reference
Issue: MISSING FILE
Path: docs/api/endpoints.md
Status: File not found in project
Suggestion: Did you mean?
- docs/api/reference.md (exists)
- docs/endpoints.md (exists)
✗ Line 6: [Getting Help](support/help.md)
Type: File reference
Issue: MISSING FILE
Path: docs/support/help.md
Status: File not found in project
Suggestion: No similar files found. Check path spelling.
✗ Line 7: [Basic Setup](#quick-start)
Type: Internal anchor
Issue: MISSING HEADING
Anchor: #quick-start
Status: Anchor not found (likely typo: #quickstart exists)
Suggestion: Did you mean #quickstart?
───────────────────────────────────────────────────────────
CROSS-FILE ANALYSIS
───────────────────────────────────────────────────────────
Scanned 4 files in project:
- docs/index.md (6 links)
- docs/guide/installation.md (12 links, all valid)
- docs/guide/config.md (8 links, 1 broken)
- docs/api/reference.md (5 links, all valid)
Cross-file reference summary:
- Files referenced: 4
- Valid file references: 3
- Invalid file references: 2
- Unresolvable anchors in targets: 0
═══════════════════════════════════════════════════════════
Input: docs/readme.md
# Project Documentation
See the [Getting Started][gs] guide for setup instructions.
For API details, check [API Reference][api] or [CLI Reference][cli].
Invalid reference: [Missing Reference][unknown]
[gs]: guide/getting-started.md#prerequisites
[api]: https://api.example.com
[cli]: guide/cli.md#commands
Validation Report:
═══════════════════════════════════════════════════════════
MARKDOWN CROSS-REFERENCE VALIDATION REPORT
═══════════════════════════════════════════════════════════
File: docs/readme.md
Scan Date: 2024-02-21
Type: Reference-style links
Status: ✓ VALIDATED WITH ISSUES
───────────────────────────────────────────────────────────
SUMMARY
───────────────────────────────────────────────────────────
Total Links Found: 4
Valid References: 3
Broken References: 1
External Links: 1
Validation Rate: 75%
───────────────────────────────────────────────────────────
REFERENCE DEFINITIONS FOUND
───────────────────────────────────────────────────────────
[gs] → guide/getting-started.md#prerequisites (Line 9)
[api] → https://api.example.com (Line 10, External)
[cli] → guide/cli.md#commands (Line 11)
───────────────────────────────────────────────────────────
VALIDATION RESULTS
───────────────────────────────────────────────────────────
✓ [Getting Started][gs] (Line 3)
Reference defined: Yes
Target: guide/getting-started.md#prerequisites
File status: Exists
Anchor status: Valid
Result: VALID
✓ [API Reference][api] (Line 5)
Reference defined: Yes
Target: https://api.example.com
Type: External URL
Result: EXTERNAL (not validated)
✓ [CLI Reference][cli] (Line 5)
Reference defined: Yes
Target: guide/cli.md#commands
File status: Exists
Anchor status: Valid
Result: VALID
✗ [Missing Reference][unknown] (Line 7)
Reference defined: No
Status: UNDEFINED REFERENCE
Issue: Reference label "[unknown]" not found in definitions
Suggestion: Available references in document:
- [gs]
- [api]
- [cli]
═══════════════════════════════════════════════════════════
| Pattern | Example | Type |
|---------|---------|------|
| Inline link | [text](#anchor) | Internal anchor |
| Inline file | [text](file.md) | File reference |
| Combined | [text](file.md#section) | File with anchor |
| Reference-style | [text][ref] + [ref]: url | Reference link |
| HTML link | <a href="#id">text</a> | HTML anchor |
| External | [text](https://example.com) | External URL |
tools
Guide for creating Visual Studio Code extensions/plugins. Use when users want to build VS Code extensions, add functionality to VS Code, create language support, add themes, build webviews, implement debuggers, or any VS Code plugin development task. Helps navigate VS Code Extension API documentation and provides guidance on extension capabilities, project setup, and best practices.
development
Validate agent system prompts (such as agents.md) for being objective-driven, clear, readable, free of duplicated intentions, without missing or broken links, and ensuring required sections like general agentic guidelines, code review, and code generation are present. Use when validating or reviewing agent prompt files.
testing
Validate agent skills for correctness, readability, workflow clarity, and isolation, ensuring they can be installed independently without dependencies on other skills.
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.