fixing-broken-links — Claude Code skill: what it does, how to install
This skill scans project files for dead URLs and broken local paths, verifies responses with curl, and repairs or removes missing links.
npx skills add spencerpauly/awesome-cursor-skills --skill fixing-broken-links -a claude-codeWhat fixing-broken-links does
The skill extracts links from target files, including Markdown syntax [text](url), raw URLs, HTML href and src attributes, and local relative paths. It inspects external endpoints via curl with a 10-second timeout. Local paths are tested with [ -f "path" ].
Status codes 200 through 299 pass immediately, while redirects log target destinations. If a server returns 403, the skill retries with a browser user-agent header because some hosts block raw curl calls. Code 429 triggers a retry after a pause. Aggressive rate limits on GitHub and npm will trip batch runs, so requests to these hosts must be spaced out.
Broken links trigger a web search. If a replacement is found, the skill updates the file. When a resource disappeared permanently, it swaps in a web.archive.org mirror, comments it out, or strips the link while keeping anchor text. It completes the run by generating a summary table.
What it helps with
- find broken external links and missing local file paths in documentation
- test URL status codes in batches using
curl - replace outdated links with current URLs or
web.archive.orgsnapshots - strip dead links while preserving anchor text
Example prompts for the agent
- Check all links in
README.mdand fix URLs returning 404 - Run fixing-broken-links across the
docsdirectory and output a summary table - Find broken links in
resources/foo/SKILL.mdand replace dead pages with web.archive.org mirrors
How to install fixing-broken-links
1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill fixing-broken-links -a claude-code2Manually: put the files in place
~/.claude/skills/fixing-broken-links/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/fixing-broken-links/
1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill fixing-broken-links -a codex2Manually: put the files in place
.agents/skills/fixing-broken-links/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill fixing-broken-links -a cursor2Manually: put the files in place
.cursor/skills/fixing-broken-links/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install spencerpauly/awesome-cursor-skills fixing-broken-links2Manually: put the files in place
.github/skills/fixing-broken-links/SKILL.md1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill fixing-broken-links -a gemini-cli2Platform CLI
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/fixing-broken-linksManually: put the files in place
.devin/skills/fixing-broken-links/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill fixing-broken-links -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about fixing-broken-links
How do I install fixing-broken-links in Claude Code?
Run npx skills add spencerpauly/awesome-cursor-skills --skill fixing-broken-links -a claude-code in your terminal.
What does fixing-broken-links do?
It scans project files for links, tests external URLs with curl, and checks local file paths on disk. When a link fails, it updates the URL, inserts an archive link, or removes it while keeping the text.
How does the skill handle 403 status codes and rate limiting?
When a server returns 403, the skill retries the request using a browser user-agent header. If it receives a 429 rate-limit status, it pauses briefly before retrying once.
Source text
SKILL.md · CC0-1.0
---
name: fixing-broken-links
description: Crawl all links in a file or project, test each for a valid HTTP response, report broken ones, and fix or remove them.
user-invocable: true
---
# Fixing Broken Links
Scan a file (or set of files) for URLs, test every link, and fix any that are broken.
## Workflow
### 1. Extract All Links
Read the target file(s) and collect every URL:
- Markdown links: `[text](url)`
- Bare URLs: `https://...`
- HTML `href` and `src` attributes
- Reference-style link definitions: `[id]: url`
- Local relative paths: `./path/to/file`, `resources/foo/SKILL.md`
### 2. Test Each Link
**For external URLs:**
- Use `curl -sL -o /dev/null -w "%{http_code}" --max-time 10 "<url>"` to get the HTTP status code
- Batch independent checks for speed (run multiple curl commands in parallel or in quick succession)
- Classify results:
- `200`–`299` → OK
- `301`/`302` → OK but note the redirect target
- `403` → Might be valid (some sites block curl); try with a browser user-agent header
- `404` → Broken
- `429` → Rate limited; retry once after a short pause
- `000` or timeout → Retry once; if still failing, mark as unreachable
**For local file paths:**
- Check if the file exists on disk with `[ -f "path" ]`
- If it's a relative path, resolve it from the file's directory
### 3. Fix Broken Links
For each broken link:
1. Search the web for the correct/current URL (the resource may have moved)
2. If found, replace the old URL with the new one
3. If the resource no longer exists, note it and either:
- Remove the link and leave the text
- Comment it out with a note
- Replace with an archived version (web.archive.org)
### 4. Report
Produce a summary table:
```
| URL | Status | Action |
|-----|--------|--------|
| https://example.com/page | 200 | OK |
| https://old.example.com/moved | 404 → 301 | Updated to https://new.example.com/page |
| ./docs/missing.md | MISSING | Removed link |
```
## Tips
- For large files with many links, batch curl calls to avoid slowdowns
- Some sites (GitHub, npm) rate-limit aggressively — space out requests
- Always re-read the file after making changes to confirm replacements didn't break formatting
- For Markdown files, verify link syntax is preserved: `[text](url)` not `[text]( url )` (no extra spaces)
© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills