doc-audit

Validates local links and heading anchors in Markdown documentation files.

10|2|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/nrdxp/predicate --skill doc-audit-nrdxp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: doc-audit
Source: https://github.com/nrdxp/predicate/tree/main/skills/doc-audit
Command: npx skills add https://github.com/nrdxp/predicate --skill doc-audit-nrdxp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Broken links and dead heading anchors silently accumulate in Markdown documentation, leaving readers stranded on 404-style dead ends. This Skill scans Markdown files to detect broken local links and dead in-document anchors before they reach readers. ## Core Features & Use Cases - Local Link Validation: Recursively walks a directory of Markdown files and verifies that every relative and absolute local link resolves to an existing file. - Anchor Resolution: Replicates GitHub-style heading slug generation (including duplicate-heading numeric suffixes) to confirm that #fragment links point to real headings. - Clear Diagnostics: Distinguishes dead anchors (file exists, heading missing) from fully broken links, and exits with a non-zero status for CI integration. - Use Case: Before publishing a documentation site, run the script against your docs folder to catch every broken cross-reference introduced by renamed files or edited headings. ## Quick Start Ask the agent to run the doc-audit link checker against your documentation directory and report any broken links or dead anchors.

Frequently Asked Questions about doc-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check Markdown files for broken links?

Run the check_docs.py script with a Markdown file or directory path as its argument. It scans every link, verifies local targets exist on disk, and prints each broken link with its location, exiting non-zero if any are found.

How to validate heading anchor links in Markdown?

The script generates GitHub-style slugs for every heading in the target file and checks that each #fragment link matches one. It handles duplicate headings with numeric suffixes and ignores fragments pointing into non-Markdown files.

Does the link checker validate external URLs?

External http and https links are skipped by default to keep runs fast, though a check_external_link function exists for optional URL validation with a five-second timeout. Local file and anchor links are always validated.

Why are links inside code blocks flagged as broken?

They are not. The script strips fenced code blocks and inline backtick code before extracting links, so example URLs and paths inside code samples are never audited or flagged.

Can I use this Markdown link checker in CI?

Yes. The script exits with status code 1 when any broken local link is found, so it integrates directly into CI pipelines as a blocking gate. Point it at your docs root and it recursively audits all Markdown files while skipping hidden directories.