outgoing-link-auditlisted
Install: claude install-skill karero/website-builder
# Outgoing Link Audit
Links to other people's sites rot: companies rebrand, move domains, or shut down.
The offline test gate (`tests/links.spec.ts`) can only catch domains you *already
know* are dead. This skill is the active sweep that *discovers* the rot.
Read-only with respect to the site: it diagnoses and reports. You apply fixes (and
add any newly-dead domain to the test) only after the user confirms.
## When to run
Monthly, or before a notable release / before launch. It hits third-party servers,
so it is deliberately **not** part of CI (`npm test` must stay hermetic and offline).
## Prerequisite: does the site even have external links?
If the build has no outgoing anchors there is nothing to audit — say so and stop:
```bash
cd "$(git rev-parse --show-toplevel)"
[ -d dist ] || npm run build >/dev/null
SITE_HOST=$(grep -oE "site:[[:space:]]*['\"]https?://[^'\"]+" astro.config.mjs \
| sed -E "s#.*://(www\.)?##; s#/.*##" | head -1)
grep -rhoE '<a [^>]*href="https?://[^"]+"' dist --include='*.html' \
| grep -oE 'href="https?://[^"]+"' | sed -E 's/^href="//; s/"$//' \
| grep -vE "://(www\.)?${SITE_HOST}(/|$|:)" | sort -u | wc -l
```
## Shortcut: the shared script does steps 1–3
`scripts/check_external_links.sh` already builds, extracts, fetches and prints the
grouped report (DEAD / REDIRECT / UNVERIFIED / OK). Run it first:
```bash
bash scripts/check_external_links.sh
```
Then apply **judgment** to its output (the bit a script can't do — see the box in
step