$npx -y skills add Affitor/affiliate-skills --skill internal-linking-optimizerAnalyze site's internal link structure and optimize for hub-and-spoke SEO architecture. Triggers on: "optimize internal links", "internal linking", "link structure", "hub and spoke links", "orphan pages", "link equity", "internal link audit", "fix my internal links", "link archit
| 1 | # Internal Linking Optimizer |
| 2 | |
| 3 | Analyze your site's internal link structure and generate an optimized hub-and-spoke linking plan. Finds orphan pages (no internal links pointing to them), identifies link equity bottlenecks, and creates specific linking instructions to maximize SEO impact. |
| 4 | |
| 5 | ## Stage |
| 6 | |
| 7 | S6: Analytics & Optimization — This is analytics/audit work on existing content. Internal linking is the most underutilized SEO lever — it's 100% in your control and costs nothing. |
| 8 | |
| 9 | ## When to Use |
| 10 | |
| 11 | - User wants to improve their site's SEO through better internal linking |
| 12 | - User asks about "orphan pages", "link structure", "hub and spoke" |
| 13 | - User says "internal linking", "link audit", "link equity" |
| 14 | - After publishing new content — new pages need internal links within 48 hours |
| 15 | - After `keyword-cluster-architect` — cluster structure defines the ideal link architecture |
| 16 | - Monthly maintenance task alongside `content-decay-detector` |
| 17 | |
| 18 | ## Input Schema |
| 19 | |
| 20 | ```yaml |
| 21 | site_url: string # REQUIRED — site to analyze |
| 22 | # e.g., "myblog.com" |
| 23 | |
| 24 | pages: object[] # OPTIONAL — known pages with their topics |
| 25 | - url: string |
| 26 | title: string |
| 27 | topic_cluster: string # Which topical cluster it belongs to |
| 28 | is_hub: boolean # Is this a hub page? |
| 29 | |
| 30 | hub_pages: string[] # OPTIONAL — URLs of your hub/pillar pages |
| 31 | # Default: auto-detected |
| 32 | |
| 33 | new_pages: string[] # OPTIONAL — recently published pages needing links |
| 34 | # Default: none |
| 35 | ``` |
| 36 | |
| 37 | **Chaining from S3 keyword-cluster-architect**: Use `keyword_clusters.hub` and `keyword_clusters.clusters` to define ideal link architecture. |
| 38 | |
| 39 | ## Workflow |
| 40 | |
| 41 | ### Step 1: Discover Site Structure |
| 42 | |
| 43 | 1. `web_search`: `site:[site_url]` — discover indexed pages |
| 44 | 2. Map pages to topic clusters (if not provided) |
| 45 | 3. Identify current hub pages (pages that link to many others) |
| 46 | 4. Note orphan pages (pages with few/no internal links pointing to them) |
| 47 | |
| 48 | ### Step 2: Analyze Current Link Structure |
| 49 | |
| 50 | Read `shared/references/seo-strategy.md` for internal linking rules. |
| 51 | |
| 52 | For each page group: |
| 53 | - Count internal links TO this page (inlinks) |
| 54 | - Count internal links FROM this page (outlinks) |
| 55 | - Check link depth from homepage (should be ≤ 3 clicks) |
| 56 | - Identify the anchor text used |
| 57 | |
| 58 | ### Step 3: Identify Issues |
| 59 | |
| 60 | Flag: |
| 61 | 1. **Orphan pages** — no or few internal links pointing to them |
| 62 | 2. **Hub pages with weak linking** — hub should link to ALL spokes in its cluster |
| 63 | 3. **Missing spoke-to-spoke links** — related spokes should link to each other |
| 64 | 4. **Broken contextual flow** — pages that should link to each other but don't |
| 65 | 5. **Over-linked pages** — too many outlinks dilute link equity |
| 66 | 6. **Missing reverse links** — spoke links to hub but hub doesn't link back |
| 67 | |
| 68 | ### Step 4: Generate Linking Instructions |
| 69 | |
| 70 | For each issue, provide specific instructions: |
| 71 | |
| 72 | ``` |
| 73 | Page: [URL] |
| 74 | Action: Add internal link to [target URL] |
| 75 | Anchor text: "[suggested anchor]" |
| 76 | Location: [where in the content to add it] |
| 77 | Priority: [P0/P1/P2] |
| 78 | Reason: [why this link matters] |
| 79 | ``` |
| 80 | |
| 81 | ### Step 5: Self-Validation |
| 82 | |
| 83 | - [ ] Instructions are specific (exact URLs, anchor text, location) |
| 84 | - [ ] Hub-and-spoke architecture is logical |
| 85 | - [ ] Anchor text is natural and keyword-relevant |
| 86 | - [ ] No recommendations to over-link (max 3-5 internal links per 1000 words) |
| 87 | - [ ] New pages have at least 2-3 internal links pointing to them |
| 88 | |
| 89 | ## Output Schema |
| 90 | |
| 91 | ```yaml |
| 92 | output_schema_version: "1.0.0" |
| 93 | internal_links: |
| 94 | site: string |
| 95 | pages_analyzed: number |
| 96 | issues_found: number |
| 97 | links_to_add: number |
| 98 | |
| 99 | orphan_pages: string[] # Pages with zero/few inlinks |
| 100 | hub_pages: string[] # Identified hub pages |
| 101 | |
| 102 | link_actions: |
| 103 | - source_url: string # Page to add the link ON |
| 104 | target_url: string # Page to link TO |
| 105 | anchor_text: string # Suggested anchor text |
| 106 | location: string # Where in the content |
| 107 | priority: string # "P0" | "P1" | "P2" |
| 108 | reason: string |
| 109 | |
| 110 | link_structure: # Current state summary |
| 111 | total_pages: number |
| 112 | avg_inlinks: number |
| 113 | avg_outlinks: number |
| 114 | max_depth: number |
| 115 | |
| 116 | chain_metadata: |
| 117 | skill_sl |