From epieczko-betty
**docs.lint.links** validates Markdown links to detect broken internal or external links, with optional autofix mode to correct common issues.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin epieczko-bettyThis skill uses the workspace's default tool permissions.
**docs.lint.links** validates Markdown links to detect broken internal or external links, with optional autofix mode to correct common issues.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
docs.lint.links validates Markdown links to detect broken internal or external links, with optional autofix mode to correct common issues.
This skill helps maintain documentation quality by:
.md files in a repository.md extension issuespython skills/docs.lint.links/docs_link_lint.py [root_dir] [options]
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
root_dir | string | No | . | Root directory to search for Markdown files |
--no-external | boolean | No | false | Skip checking external links (faster) |
--autofix | boolean | No | false | Automatically fix common issues (case mismatches, .md extension issues) |
--timeout | integer | No | 10 | Timeout for external link checks in seconds |
--exclude | string | No | - | Comma-separated list of patterns to exclude (e.g., 'node_modules,.git') |
--output | string | No | json | Output format (json or text) |
| Output | Type | Description |
|---|---|---|
lint_results | object | JSON object containing link validation results with issues and statistics |
issues | array | Array of link issues found, each with file, line, link, issue type, and suggested fix |
summary | object | Summary statistics including files checked, issues found, and fixes applied |
Check all markdown files in the current directory for broken links:
python skills/docs.lint.links/docs_link_lint.py
Check only internal links (much faster):
python skills/docs.lint.links/docs_link_lint.py --no-external
Automatically fix case mismatches and .md extension issues:
python skills/docs.lint.links/docs_link_lint.py --autofix
Check markdown files in the docs directory:
python skills/docs.lint.links/docs_link_lint.py docs/
Exclude certain directories from checking:
python skills/docs.lint.links/docs_link_lint.py --exclude "node_modules,vendor,.venv"
Get human-readable text output instead of JSON:
python skills/docs.lint.links/docs_link_lint.py --output text
Use a longer timeout for external link checks:
python skills/docs.lint.links/docs_link_lint.py --timeout 30
{
"status": "success",
"summary": {
"files_checked": 42,
"files_with_issues": 3,
"total_issues": 5,
"autofix_enabled": false,
"total_fixes_applied": 0
},
"issues": [
{
"file": "docs/api.md",
"line": 15,
"link": "../README.MD",
"issue_type": "internal_broken",
"message": "File not found: ../README.MD (found case mismatch: README.md)",
"suggested_fix": "../README.md"
},
{
"file": "docs/guide.md",
"line": 23,
"link": "https://example.com/missing",
"issue_type": "external_broken",
"message": "External link is broken: HTTP 404"
}
]
}
Markdown Link Lint Results
==================================================
Files checked: 42
Files with issues: 3
Total issues: 5
Issues found:
--------------------------------------------------
docs/api.md:15
Link: ../README.MD
Issue: File not found: ../README.MD (found case mismatch: README.md)
Suggested fix: ../README.md
docs/guide.md:23
Link: https://example.com/missing
Issue: External link is broken: HTTP 404
These are relative file paths that don't resolve:
README.MD when file is README.md.md extension: guide when file is guide.md.md extension: file.md when file is fileThese are HTTP/HTTPS URLs that return errors:
When --autofix is enabled, the skill will automatically correct:
.md extension: If a link is missing .md but the file exists with it.md extension: If a link has .md but the file exists without itThe autofix preserves:
#section)?version=1.0)Note: Autofix modifies files in place. It's recommended to use version control or create backups before using this option.
The skill detects the following link formats:
[text](url)<https://example.com>[text][ref] with [ref]: url definitions[text][] using text as referenceBy default, the following patterns are excluded from scanning:
.git/node_modules/.venv/ and venv/__pycache__/Additional patterns can be excluded using the --exclude parameter.
Add to your CI pipeline to catch broken links:
# .github/workflows/docs-lint.yml
name: Documentation Link Check
on: [push, pull_request]
jobs:
lint-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check documentation links
run: |
python skills/docs.lint.links/docs_link_lint.py --no-external
Add to .git/hooks/pre-commit:
#!/bin/bash
python skills/docs.lint.links/docs_link_lint.py --no-external --output text
if [ $? -ne 0 ]; then
echo "Documentation has broken links. Please fix before committing."
exit 1
fi
# workflows/documentation.yaml
steps:
- skill: docs.lint.links
args:
- "docs/"
- "--autofix"
- skill: docs.lint.links
args:
- "docs/"
- "--output=text"
Checking external links can be slow because:
Recommendations:
--no-external for fast local checks--timeout to adjust timeout for slow networksFor repositories with many markdown files:
--exclude to skip irrelevant directoriesnode_modulesThe skill returns:
0 if no broken links are found1 if broken links are found or an error occursThis makes it suitable for use in CI/CD pipelines and pre-commit hooks.
No external dependencies
All functionality uses Python standard library modules:
re - Regular expression matching for link extractionurllib - HTTP requests for external link checkingpathlib - File system operationsjson - JSON output formattingdocumentation, linting, validation, links, markdown
0.1.0 - Initial implementation with link validation and autofix support