markdown-link-checker
Checks relative links, image paths and heading anchors in Markdown files without using the network, and lists every broken one with its line number. Use when the user asks to verify README or docs links, after moving or renaming files, or before publishing documentation.
Install
npx skills add https://github.com/Lethe044/agentskill-kit/tree/main/skills/markdown-link-checker
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install lethe044-agentskill-kit@llmmart
git clone https://github.com/Lethe044/agentskill-kit.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole lethe044/agentskill-kit collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Markdown link checker
Finds links that point nowhere inside a repository. External http and https links are skipped on purpose,
so the check is fast, repeatable and works offline.
When to use
- Files or folders were renamed or moved and docs may now point to the old paths.
- A README has a table of contents with
#anchors. - Before a release, to make sure the docs have no dead internal links.
How to run
python scripts/check_links.py README.md docs/
Directories are searched recursively for .md files. Hidden folders and node_modules are skipped.
What is checked
[text](path/to/file.md)and image links: the target must exist, relative to the file that contains the link.[text](#section): the heading must exist in the same file.[text](other.md#section): the file must exist and contain the heading.- Heading anchors use the GitHub style: lowercase, punctuation removed, spaces become hyphens, repeated headings
get
-1,-2and so on. - Fenced code blocks and inline code are ignored.
Output
JSON with files, links_checked and broken, a list of {"file", "line", "target", "reason"}.
Reasons are file not found and anchor not found. The exit code is 1 when anything is broken.
After running
Group the broken links by file, fix the target when the file moved, and remove the link when the content is gone. For anchors, check whether the heading was reworded.
Errors
A path that does not exist exits with code 2.
Files (agentskill-kit)
-
scripts
-
check_links.py 3.8 KB
Loading…
-
-
tests
-
cases.json 1.8 KB
Loading…
-
-
SKILL.md 1.9 KB
--- name: markdown-link-checker description: Checks relative links, image paths and heading anchors in Markdown files without using the network, and lists every broken one with its line number. Use when the user asks to verify README or docs links, after moving or renaming files, or before publishing documentation. license: MIT metadata: version: 1.0.0 author: Lethe044 tags: [markdown, documentation, links, quality] --- # Markdown link checker Finds links that point nowhere inside a repository. External `http` and `https` links are skipped on purpose, so the check is fast, repeatable and works offline. ## When to use - Files or folders were renamed or moved and docs may now point to the old paths. - A README has a table of contents with `#anchors`. - Before a release, to make sure the docs have no dead internal links. ## How to run ```bash python scripts/check_links.py README.md docs/ ``` Directories are searched recursively for `.md` files. Hidden folders and `node_modules` are skipped. ## What is checked - `[text](path/to/file.md)` and image links: the target must exist, relative to the file that contains the link. - `[text](#section)`: the heading must exist in the same file. - `[text](other.md#section)`: the file must exist and contain the heading. - Heading anchors use the GitHub style: lowercase, punctuation removed, spaces become hyphens, repeated headings get `-1`, `-2` and so on. - Fenced code blocks and inline code are ignored. ## Output JSON with `files`, `links_checked` and `broken`, a list of `{"file", "line", "target", "reason"}`. Reasons are `file not found` and `anchor not found`. The exit code is 1 when anything is broken. ## After running Group the broken links by file, fix the target when the file moved, and remove the link when the content is gone. For anchors, check whether the heading was reworded. ## Errors A path that does not exist exits with code 2.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.