npx skills add ...
npx skills add infrasity-labs/dev-gtm-claude-skills --skill orphan-pages-internal-linking-opportunities
Audit any domain for orphan blog pages, map internal links across all blog posts, generate keyword-backed interlinking briefs via DataForSEO, and produce a self-contained downloadable HTML report. Invoke with the target domain as the argument.
npx skills add infrasity-labs/dev-gtm-claude-skills --skill orphan-pages-internal-linking-opportunities
You are running a complete SEO orphan page audit. The user has provided a domain as input via args. Your job is to execute every phase below in order, using the tools available, and produce a single downloadable HTML report file saved to the current working directory.
Input domain: {args}
Normalize the input domain:
http, prepend https://www. and the base domain resolves with it, use www.BASE_URL (e.g., https://www.example.com)Fetch BASE_URL/robots.txt using WebFetch. Look for any Sitemap: directive — if found, use that URL as the sitemap location. If not found, default to BASE_URL/sitemap.xml.
Fetch the sitemap URL. Determine its type:
<sitemapindex> tag present): extract all <loc> child sitemap URLs, fetch each one, and merge all <loc> URLs from every child sitemap into a single master URL list<urlset> tag): extract all <loc> URLs directlyStore the full master URL list.
From the master URL list:
Analyze all URL patterns to identify the blog/content section. Look for the URL prefix that appears most frequently in a uniform pattern. Common prefixes to check: /blog/, /articles/, /posts/, /insights/, /resources/, /learn/, /news/, /guides/
Select the prefix that best represents the blog content (most URLs, most uniform structure). If multiple prefixes qualify, include all of them.
Filter the master URL list to only include URLs matching the identified blog prefix(es). Exclude index/listing pages (e.g., BASE_URL/blog with no further slug). Store as BLOG_URLS.
If no blog prefix is identifiable from the sitemap, fetch BASE_URL homepage and look for a blog/articles navigation link, then fetch that page and extract all post URLs from it.
Log the total count: "Found {N} blog posts at {BASE_URL}"
Run a Workflow to crawl all blog posts in parallel. The workflow should:
Script logic:
BLOG_URLS as the items list{ source_url, outbound_blog_links: [...] }{ type: 'object', properties: { source_url: { type: 'string' }, outbound_blog_links: { type: 'array', items: { type: 'string' } } }, required: ['source_url', 'outbound_blog_links'] }After the workflow completes, aggregate results:
inbound_count map: { url -> number } initialized to 0 for all BLOG_URLSinbound_sources map: { url -> [source_url, ...] } initialized to [] for all BLOG_URLSoutbound_blog_links and increment the inbound count + push the source URL for each valid linkClassify every page:
ORPHAN_URLSLOW_LINKED_URLSHEALTHY_URLSBuild FULL_INBOUND_MAP: array of { url, inbound, linked_from } sorted descending by inbound count.
Run a Workflow to get the top US search volume keyword for each orphan page. The workflow should:
Script logic:
ORPHAN_URLS as the items listmcp__claude_ai_DataForSEO__kw_data_google_ads_search_volume, then calls it with the keyword variants, location_code: 2840 (United States), language_code: "en"anchor_textanchor_textpage_summary of what the page covers{ orphan_url, anchor_text, us_monthly_volume, page_summary }{ type: 'object', properties: { orphan_url: { type: 'string' }, anchor_text: { type: 'string' }, us_monthly_volume: { type: 'number' }, page_summary: { type: 'string' } }, required: ['orphan_url', 'anchor_text', 'us_monthly_volume', 'page_summary'] }Store results as KEYWORD_DATA: map of { orphan_url -> { anchor_text, us_monthly_volume, page_summary } }
Run a Workflow using a 2-stage pipeline over ORPHAN_URLS:
Stage 1 — Pass through keyword data (already computed, no agent needed — use the KEYWORD_DATA directly)
Stage 2 — For each orphan, spawn an agent that:
orphan_url, anchor_text, page_summary, and the full BLOG_URLS listBLOG_URLS (exclude the orphan itself; prefer well-linked, non-orphan pages)source_url: the full URL of the source pagewhere_to_place: specific, precise description of the location within that page — naming the H2/H3 section, which paragraph, what content surrounds it. Must be specific enough that a content editor can navigate there without guessingcontext_copy: minimum 300 characters of naturally flowing copy to be inserted at that location. The anchor_text MUST appear exactly once within it as <a href="ORPHAN_URL">ANCHOR_TEXT</a>. Copy must read as if it was always part of the article — not promotional, not forced. Same anchor text across all 3 placements.{ orphan_url, anchor_text, placements: [{ source_url, where_to_place, context_copy }, ...] }placements as array of 3 objects each requiring source_url, where_to_place, context_copyAfter the workflow completes, post-process every context_copy:
anchor_text appears as a hyperlink (href="orphan_url" present)anchor_text (case-insensitive) and replace with <a href="orphan_url">anchor_text</a>Store as BRIEFS.
Using the Write tool, save a single self-contained HTML file to the current working directory named orphan-audit-{domain}-{YYYYMMDD}.html where {domain} is the base domain (no protocol, no www, dots replaced with hyphens) and {YYYYMMDD} is today's date.
The HTML file must be completely self-contained — all CSS inline in a <style> tag, no external CDN or font imports, works offline. Use clean, professional design with the following structure:
Section 1 — Header
window.print() or direct file save)Section 2 — Executive Summary Four stat cards in a row:
{BLOG_URLS.length}{ORPHAN_URLS.length} + percentage of total{LOW_LINKED_URLS.length} (1–2 inbound links){HEALTHY_URLS.length} (3+ inbound links)A horizontal bar showing the proportion of orphan / low-linked / healthy visually.
Section 3 — Orphan Pages List
Table with columns: # | Page URL (clickable link) | Anchor Text | US Monthly Volume
One row per orphan page.
Section 4 — Inbound Link Map (Non-Orphan Pages)
Table sorted descending by inbound count: Page URL | Inbound Links | Linked From
For the "Linked From" column, list each source URL on a new line or as a comma-separated list.
Section 5 — Interlinking Briefs For each orphan page, a card containing:
<pre> or <div> with a "Copy" button that uses navigator.clipboard.writeText() to copy the HTMLSection 6 — Footer
<script> tag)navigator.clipboard.writeText(element.innerText)After saving the HTML file:
/blog/ — always detect the URL pattern from the actual sitemapanchor_text string appears in all 3 context_copy blocks for that orphan, always as a hyperlinkorphan-audit-{domain}-{YYYYMMDD}.html saved in the user's current working directory