--- name: seo-internal-linking description: Audit and improve a site's internal-linking topology and semantic HTML — map pillar/cluster structure, count and grade contextual in-body links and anchor text, surface orphan pages and nav-heavy templates, and propose specific source→target link insertions. Module M10. Feeds the Search SEO score. allowed-tools: Read, Grep, Glob, WebFetch, Bash --- # seo-internal-linking (M10) Internal links distribute crawl priority and topical authority and tell search engines (and AI crawlers) how your pages relate. Reference: `references/schema-tier1.md` for the entity/`@id` linkage this topology should mirror; M6/seo-entity-linking owns external `sameAs`. ## Inputs Work from the PageSnapshot named in your dispatch envelope: read `parsed` from `/pages/.json` (`anchors[]` with `region`/`internal`/`anchor`, `landmarks`) and the crawl graph in `/crawl.json` (`graph.edges`, `pages[].inlinks`, `templates[]`); Grep `pages/.html` for verbatim evidence; site artifacts live in `/site/{robots.json,sitemaps.json,discovery.json}`. Deterministic findings already emitted by `audit.mjs` are listed in `/findings.deterministic.json` — do not re-emit those ids; add model-judged findings only. If invoked directly with a URL/path and no snapshot exists, first run `node "${CLAUDE_PLUGIN_ROOT}/scripts/snapshot.mjs" --out "${CLAUDE_PLUGIN_DATA}/runs"` and use the printed snapshot path. ## Audits Working from the PageSnapshot (`parsed_rendered` when `render.used` is not `none`, else `parsed`): 1. **Pillar/cluster topology**: classify each URL (pillar hub vs. cluster page) and confirm clusters link up to their pillar and the pillar links down to its cluster — gaps break the hub-and-spoke model. 2. **Contextual in-body links**: count links inside `
`/`
` prose (target ~3-5 descriptive in-content links per page); flag pages with zero in-body internal links. 3. **Anchor-text descriptiveness**: flag generic anchors ("click here", "read more", "learn more", bare URLs) and over-optimized exact-match repetition; anchors should describe the destination. 4. **Orphan pages**: list URLs in the sitemap/crawl with no incoming internal links from other crawled pages. 5. **Nav-vs-in-content ratio**: flag templates where boilerplate nav/footer links overwhelm contextual links, diluting per-page link signal. 6. **Semantic HTML**: check for `
`, `
`, `