outgoing-link-audit
Skill9 starsChanged 30 days agoMITView on GitHub
Liveness audit of every OUTGOING (external) link on an Astro site built with the new-website kit. Builds the site, extracts each external href from dist/, fetches it, and classifies it OK / REDIRECT / REBRAND / DEAD — flagging links that 404, time out, or now redirect to a different domain (a rebrand), with the source page and a suggested fix. This is the network-dependent complement to the offline `tests/links.spec.ts` guard (which only blocks already-known-dead domains from regressing). Run it about once a month, or before a release/launch. Trigger phrases: "audit outgoing links", "check external links", "are our links still live", "monthly link check", "any dead links", "did any linked site rebrand", "link rot check", "review outgoing links".
1 other project uses a version of this.
Adopted by
Most recently taken up by
- karero/website-builderword for word, first seen Oct 14, 2026
Other versions1 project uses a version of this.
Word for word · 1
- karero/website-builder★ 9100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- skills/new-website/templates/AGENTS.mdAGENTS.md
- skills/new-website/templates/CLAUDE.mdCLAUDE.md
- ai-seoSkill
- astro-i18n-setupSkill
- business-listings-setupSkill
- copywritingSkill
- customer-researchSkill
- double-knuthSkill
- facts-checkSkill
- imageSkill
- independent-reviewSkill
- internal-link-auditSkill
- keystatic-setupSkill
- new-websiteSkill
- og-imagesSkill
- schema-markupSkill
- search-console-insightsSkill
- search-console-setupSkill
- seo-auditSkill
- seo-repositionSkill
- site-architectureSkill
- website-brand-kitSkill
- website-contact-formSkill
- website-content-guideSkill
- website-design-systemSkill
- website-hero-carouselSkill
- website-launch-checkSkill
- website-motionSkill
- website-new-pageSkill
- website-permissionsSkill
- website-positioning-checkSkill
- website-positioningSkill
- website-qaSkill
- website-reviewSkill
- website-scorecardSkill
- website-seo-geoSkill
- website-storySkill
- website-taglineSkill
- website-team-setupSkill
- website-testimonialsSkill
- wordpress-inspectorSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Read-only with respect to the site: it diagnoses and reports.
- Distinctive: line 32
If the build has no outgoing anchors there is nothing to audit — say so and stop:
- Distinctive: line 68
Use a real browser User-Agent — several hosts return 403 to a bare curl.
- Very specific: line 94
Update the link in the source page (src/pages/*.astro or a content collection entry).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
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 -lShortcut: 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 scripts/check_external_links.shThen apply judgment to its output (the bit a script can't do — see the box in step 2) and do step 4 (fixes). The procedure below explains what the script does and is the manual fallback.
Procedure
1. Build, then extract every external link
Audit the built output so it matches exactly what Cloudflare serves. The script
derives your own host from site: in astro.config.mjs and excludes it; everything
else absolute and http(s) from an <a href> is an outgoing link. To keep "which
page is this on?" for the report, run grep -rl "<url>" dist per finding.
2. Fetch each unique URL and classify
Use a real browser User-Agent — several hosts return 403 to a bare curl. Follow redirects but record the final URL and status. Classify each result:
- OK — final code
200and the final host is the same registrable domain. - REDIRECT —
200but final host differs only bywww/scheme/trailing path. Usually harmless; note it, low priority. - REBRAND / MOVED —
200but the final host is a different domain. This is the high-value finding: update the link to the new canonical URL. - DEAD —
4xx,5xx, connection error, or timeout. Re-check once (could be transient); if it stays dead, flag for removal/replacement.
Judgment, not just codes: a
403/429can mean "bot-blocked", not "dead" — try a second UA or note it as unverified rather than calling a live page dead. A200that lands on a parked / "for sale" page is effectively dead even though the code is green. Use the model for these calls; let the script do the fetching.
3. Report
Group findings by severity. For each: the URL, the classification, the final URL (if changed), and the source page(s). Lead with REBRAND + DEAD (the actionable ones); list OK as a count.
4. Hand off the fixes
For each REBRAND/DEAD link, after the user confirms:
- Update the link in the source page (
src/pages/*.astroor a content collection entry). Use the new canonical URL. - If a domain is now permanently dead/rebranded, add it to
tests/links.spec.ts→STALE_DOMAINSwith the reason, so it can never be re-introduced. This is how the offline guard stays current — the audit feeds it. - Re-run
npm run build && npm testto confirm green, then commit.
Scope notes
- Audits the active branch you're on;
dist/is the build ofsrc/, which is what Cloudflare serves and what we fetch from. - Internal-link health (clean, resolving, no
.htmlhops) is already covered by thenavigation+seospecs inwebsite-qa— this skill is external links only.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

