/croftweaver:internal-link-auditfrom Croftweaver
Audits an Astro site's internal link graph from dist/, identifying orphaned, thin, and deep pages, then suggests where to add missing links using the site-architecture strategy.
Ships in Croftweaver. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Pages rot in the OTHER direction too: not the links that go dead, but the pages that
nothing links TO. A page can be in the sitemap, pass every QA spec, and still be
orphaned — reachable by no internal link, so crawlers find it late (or never) and
no human browsing the site ever lands on it. The classic cause: a footer/nav link
group that lists only ONE of a sibling set (e.g. one acme-vs-<competitor> comparison),
leaving the rest linked from nowhere.
This is the internal-link twin of outgoing-link-audit:
| offline CI gate | active sweep (this) | |
|---|---|---|
| outgoing (dead/rebranded) | tests/links.spec.ts | outgoing-link-audit |
| internal (orphan/thin) | tests/orphans.spec.ts | internal-link-audit |
Read-only with respect to the site: it diagnoses and suggests. You apply fixes only after the user confirms.
This skill does not invent its own linking rules — it measures the built site against
the strategy in site-architecture (its "Internal Linking Strategy" section, plus its
"3-Click Rule"; read them before suggesting fixes). The strategies, and how this audit
checks each:
Strategy (from site-architecture) | How the audit enforces it |
|---|---|
| No orphan pages — every page has ≥1 inbound internal link | ORPHANS list (0 inbound) — the hard gate tests/orphans.spec.ts also fails on this |
| Hub-and-spoke / topic clusters — hub links all spokes, spokes link the hub and each other | sibling sets that don't cross-link surface as orphans/thin; suggest the hub + cross-links |
| Important pages get the most inbound links — home, pricing, key features | the inbound COUNT ranking shows whether your money pages actually lead |
| Descriptive, keyword-bearing anchor text — not "click here" | judgment: read the anchor text of the links you add/keep (see website-seo-geo) |
| 3-Click Rule — important pages within ~3 clicks of home | DEEP list (>3 clicks from home, computed by BFS) |
| Contextual links beat boilerplate — in-body editorial links > nav/footer | THIN list flags pages held up only by the global nav/footer |
(Linking to the clean canonical URL — no .html, no redirect/trailing-slash hop — is link
hygiene the navigation spec already guards; apply it to every link you add, step 4.)
Before a release / launch, after adding any batch of pages (the moment a set of siblings gets created but only some get linked), or when Google Search Console flags "Crawled - currently not indexed" / "Discovered - not indexed" / orphaned pages.
Unlike outgoing-link-audit, this makes no network calls — it reads the local
build — so it's cheap to run any time.
scripts/check_internal_links.sh builds (if needed), extracts every internal anchor
from dist/, and prints the inbound-link graph grouped as ORPHANS / THIN / OK.
Run it first:
bash scripts/check_internal_links.sh
Then apply judgment to its output (the part a script can't do — which related page should link to each orphan, and with what anchor text) and hand off the fixes.
Audit the built dist/ so it matches what Cloudflare serves. For every page, the
script counts the distinct other pages that link to it (self-links and the home
root excluded; query/fragment/www/trailing-slash variants collapse to one target,
matching the test) and its click depth from home (BFS). Classify each page:
tests/orphans.spec.ts fails on.Then sanity-check the inbound RANKING against intent: your most important pages (home, pricing, primary feature/conversion pages) should be among the most-linked. A key conversion page sitting at 1 inbound link is a strategy miss even though it isn't technically orphaned.
For each orphan/thin page, the fix is not "link it from anywhere" — it's to add a link where it's topically earned, so the link helps a real reader:
/acme-vs-crm, /acme-vs-chat, /acme-vs-calendar, …
exist, every comparison page should link to its siblings (a "Compare with other
tools" block), and a hub/overview page should list them all. A footer "Product"
group that names only acme-vs-crm is the bug — add the siblings to that
group in src/config.ts, or build the hub page.website-seo-geo). Vary it
naturally across links; don't paste the exact-match phrase every time..html, no trailing slash, no
redirect hop (so equity isn't lost to a 301 and navigation.spec stays green).Judgment, not just counts: a deliberately-unlinked page (a paid-campaign landing page reached only from an ad, a print-QR page) is correctly orphaned — it should go in
orphan-exempt.txtwith a reason, not get a forced link. Use the model to tell a real orphan from an intentional one.
Group by severity. Lead with ORPHANS (the actionable ones), then THIN, then DEEP, then OK as a count. For each orphan/thin/deep page, name the specific page(s) that should link to it and the suggested anchor text.
For each finding, after the user confirms:
src/pages/*.astro, a content-collection entry,
or a nav/footer group in src/config.ts). Use keyword-bearing anchor text and the
clean URL (no .html, no trailing slash).orphan-exempt.txt, on its own
line, with the reason after a # instead.npm run build && npm test to confirm green (orphans.spec.ts must pass),
then commit.website-new-page step 8 hands a freshly built page to this skill. A new page must meet three
points, which scripts/check_page_links.py counts from dist/ for that one page, from the
site's pages as built (it needs nothing else from the site):
<main>, and not inside a <header>, <nav>, <footer> or <aside>.<a> inside its own <main> (a breadcrumb <nav> inside <main> counts;
JSON-LD does not). A breadcrumb outside <main> is a miss the owner may accept.Run it after a fresh npm run build, with the page's path, the site's address from
astro.config.mjs, and --hub with the hub's path, or --no-hub where the owner's brief says
the page has none:
python3 "${CLAUDE_SKILL_DIR}/scripts/check_page_links.py" dist /<page-path> \
--site https://<host> (--hub /<hub-path> | --no-hub)
Exit 0: met. Exit 1: each miss is listed, with the pages that link here: fix the links, or put the
miss in the PR with the owner's reason to accept it. Exit 2: it cannot judge (no dist/, a
--site with no host, no file for the page or hub, neither flag, --hub for a page with no
<main>, a page with a <base> element, two files for one address, or a folder it cannot read);
say so in the PR.
It cannot see CSS, so whether a counted link is visible and reads naturally is yours to judge,
and to write in the PR. Also judge, never counted: sibling pages link each other where it helps
a reader; anchor text names the target's topic; high-traffic pages (home, FAQ) link to it where
it fits; about 5 to 10 internal links per 1,000 words.
Where the site has scripts/check_internal_links.sh, run it too, after the same fresh build (it
reuses an existing dist/), for the orphans the new page caused elsewhere: it exits 0 whatever it
finds, so exit 1 means it could not run. Put its message in the PR as printed and count the
report as not run. Where the site has no such script, say so in one line in the PR, and that this
skill can bring the site's link checks up to the kit's version in a PR of its own: the page PR
does not add them.
dist/ is the build of src/, which is
what Cloudflare serves.outgoing-link-audit;
dead in-site links and #fragment integrity are the navigation + anchors specs
in website-qa. This skill answers the orthogonal question: is every page a link
target, linked the way the strategy says?site-architecture (its Internal Linking Strategy section) —
this skill is its enforcement arm against the built site, not a second rulebook. When
the two could drift, site-architecture wins; flag the gap rather than re-deciding here.tests/orphans.spec.ts) only knows pass/fail on reachability-from-
home; this skill is the richer report (inbound COUNT per page, THIN pages, link
suggestions) you act on to keep it green.scripts/check_internal_links.sh resolves only root-relative
(/about) and absolute-on-host links — the kit's convention. It does not resolve
page-relative hrefs (about, ./team, ../pricing), so a page reachable only via one
is over-reported as ORPHAN/THIN by the script. The gate tests/orphans.spec.ts does
resolve them and is authoritative — trust the gate over the script for those, and prefer
root-relative links so the two never diverge.scripts/check_page_links.py (opens in a new tab)scripts/tests/fixtures/README.md (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/404.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/chain/c3.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/chain/c3b.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/chain/c4.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/div-linker1.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/div-linker2.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/fold/s1.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/fold/s2.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/fold/s3.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/fold/s5.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/fold/sh.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/footer-only.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/header-only.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/hub-nav.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/hub-nav/spoke.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/hub-nomain.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/hub-nomain/spoke.html (opens in a new tab)scripts/tests/fixtures/astro-7.4.13_built-site/built/hub.html (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub karero/croftweaver --plugin croftweaver40 skills in this plugin
/ai-seoWhen the user wants to optimize content for AI search engines, get cited by LLMs, or appear in AI-generated answers. Also use when the user mentions 'AI SEO,' 'AEO,' 'GEO,' 'LLMO,' 'answer engine optimization,' 'generative engine optimization,' 'LLM optimization,' 'AI Overviews,' 'optimize for ChatGPT,' 'optimize for Perplexity,' 'AI citations,' 'AI visibility,' 'zero-click search,' 'how do I show up in AI answers,' 'LLM mentions,' or 'optimize for Claude/Gemini.' Use this whenever someone wants their content to be cited or surfaced by AI assistants and AI search engines. For traditional technical and on-page SEO audits, see seo-audit. For structured data implementation, see schema-markup./astro-i18n-setupTurn a new-website scaffold into a turnkey multi-language site: Astro i18n routing (clean default locale + prefixed others), self-referencing hreflang + x-default in the Base layout, i18n sitemap alternates, a language switcher, and the test-harness changes that keep the green-from-commit-1 gate honest across locales. Run at scaffold time when new-website Q4 = "two+ languages at launch", OR later to add a second language to a single-locale site whose default stays unprefixed (phased rollout). Trigger phrases: "multi-language site", "add i18n", "DE+EN site", "internationalization", "hreflang setup", "two languages at launch".
Other plugins' skills for the same job