Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add spencerpauly/awesome-cursor-skills --skill fixing-broken-links -a claude-code
Open on GitHub

What 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.org snapshots
  • strip dead links while preserving anchor text

Example prompts for the agent

  • Check all links in README.md and fix URLs returning 404
  • Run fixing-broken-links across the docs directory and output a summary table
  • Find broken links in resources/foo/SKILL.md and 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-code

2Manually: put the files in place

~/.claude/skills/fixing-broken-links/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/fixing-broken-links/

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

Similar skills

All skills for Writing and docs →

From the same set64

screenshotting-changelog Builds a visual changelog for a pull request: captures pages before and after your UI edits and drops the image pairs into the PR body. CX Codex +1 401installs updating-npm-package Updates npm dependencies safely by checking npmjs.com and adapting to the version jump. It runs tests on minor updates and finds migration guides for major ones. CX Codex +1 398installs react-native-patterns This skill guides an agent building React Native and Expo apps, covering navigation, platform-specific code, styling, lists, and native modules. CX Codex +1 399installs adding-docker This skill writes a Dockerfile, docker-compose setup and .dockerignore for your app. Useful when you want a container without hand-writing the configs. CX Codex +1 398installs converting-css-modules-to-tailwind Moves one component off CSS Modules and onto Tailwind utility classes, then removes the module file and its import. CX Codex +1 392installs generating-images This skill generates and edits images through the OpenAI Image API on gpt-image-2. Handy when you need an OG banner, an icon or a mockup without leaving the agent chat. CX Codex +1 388installs adding-error-tracking This skill wires Sentry into a web app: error tracking, performance traces and source maps. Useful when you want crash reporting without hand-rolling the config. CX Codex +1 386installs tailing-build-output Monitors build output in real time, catches errors as they stream, and patches source files before Webpack, Turbo, or Docker finishes. CX Codex +1 384installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor