---
name: "inbound-links"
description: "After an article is published, add 3 to 6 links to it from your existing live pages, in natural spots, pointing towards your core pages. Edits your CMS (Sanity) directly or as drafts."
---
# Inbound links (your site)
> **Shared from the growthvibes.ai content pipeline.** [How the whole pipeline works](https://growthvibes.ai/resources/how-i-built-an-seo-content-automation/). This is the skill we run, with our IDs, keys and private details taken out. Anything in angle brackets (`<like this>`) is yours to fill in. It is built to run unattended: it never asks questions, it decides and writes its assumptions down.
## What you need
- **A CMS connector that can edit and publish** (we use the Sanity MCP). The skill publishes small link edits by itself; switch that to drafts if you prefer to approve them.
- **Notion MCP** for the brief and the calendar row (optional: you can name the article instead).
- A newly published article and a site with live pages to link from.
## Fill in before the first run
- CMS project, database ids and your core pages, wherever placeholders appear.
Fourth step of the pipeline: brief, research, writer, **inbound links**. A new article starts with no links pointing at it. This skill finds the existing pages that should link to it, finds the natural spot in each, and prepares the edit.
Runs unattended. **Never ask questions.** Decide, log it, continue. This skill edits existing live pages and **publishes the edits itself**. There is no approval step and the author is not involved: the link (or the one added sentence) is the only change, and Phase 4 checks it before it goes live. A page that has an unpublished draft of the author's is skipped, because publishing would also publish his unfinished edits.
## Config
| Setting | Value |
|---|---|
| Sanity | project `<your Sanity project id>`, dataset `production`, types `post`, `service`, `caseStudy` |
| Notion Briefs | `<your Notion data source>` |
| Notion Content Calendar | `<your Notion data source>` |
| Internal linking plan | `<your internal linking plan file or report>` (the "In" list per article) |
| Links per article | at least 3 inbound, at most 6 |
## When to run
- A calendar row has just moved to `Published` and has no "Inbound links" note yet, or the author says "add inbound links for <article>".
- One article per run.
## Phase 0: Inputs
1. The new article from Sanity: slug, title, topic, primary keyword and what it covers (read its body). Check that it is published and live.
2. Its brief: the **Brief data** child page, `internal_links.inbound_tasks` (page, suggested anchor, section).
3. The topical map: the page's row says which pages should link to it (`links_from`) and its category and section. Use it first. Direction matters: outer pages (tutorials, guides, tool pages) link up to core pages, and core pages (the homepage and the two core service pages) are not edited unless the map lists them. Your internal linking plan is only a fallback while the map has no row for this page. If neither exists, log it and carry on.
4. When the new page is a core service page, the inbound sources are every live outer article in its category. Add the link to a few at a time, never all in one run.
5. A list of live pages in Sanity (published, `publishedAt` in the past): `post`, `caseStudy`, `service`, with slug, title, topic and body text.
## Phase 1: Choose the source pages
Candidates, in order: the brief's inbound tasks, the plan's "In" list, then other live pages that genuinely discuss this topic (same `topic` first), then the service pillar for the topic (see the topic table in the article-writer skill).
Drop a candidate if:
- it's a **placeholder** (body starts with "Placeholder article", contains template lines like "Explain the problem and who it is for" or "First step", or has under 150 words of real text),
- it's not live yet (future `publishedAt`) or is the new article itself,
- it **already links** to the new article (check every link in its body),
- a **draft** of it already exists with edits the author hasn't published. Never overwrite his work: skip it and say so in the log,
- it has no natural place for the link (Phase 2).
Aim for 3 to 6. Fewer than 3 usable pages: add what's usable and log why. Never force a link to hit a number.
## Phase 2: Find the spot, one source page at a time
Read the page's body. In order of preference:
1. **An existing phrase** of 2 to 6 words that already names the new article's topic. Link it. No new text.
2. **One new sentence** added to a section where the topic belongs. Write it in the author's voice (load `a humanizer skill, if you have one`): plain, no em dashes, no "check out our guide". Example: "I wrote the longer version in [AEO vs SEO: what actually changes](/resources/aeo-vs-seo/)."
3. Neither fits: skip the page.
Rules for the link:
- Anchor text names the target's topic, descriptive, never "click here" or "read more". Vary the anchors across pages, not exact-match every time.
- One link to the new article per source page, in the body text only. Not in headings, the TL;DR, an Owl tip, a table, code, a FAQ answer, an image caption or the first paragraph.
- Relative URLs: `/resources/<slug>/`. Never link to removed AI Labs tools or to placeholder posts.
- Don't change anything else on the page: no rewording, no new section.
## Phase 3: Apply
Edit with `patch_documents` on the published `_id`. It saves to a draft first, which Phase 4 checks and publishes. Replace the whole block you're editing, keeping its `_key` and style, with a link added in `markDefs` and the span split around the anchor. Every new span and the link annotation needs a fresh unique `_key`.
```json
{"post-get-cited-by-chatgpt": {"patches": [{"set": {
"body[_key==\"EXISTING_BLOCK_KEY\"]": {
"_type": "block", "_key": "EXISTING_BLOCK_KEY", "style": "normal",
"markDefs": [{"_type": "link", "_key": "ib1", "href": "/resources/aeo-vs-seo/"}],
"children": [
{"_type": "span", "_key": "ib2", "text": "Text before the anchor, ", "marks": []},
{"_type": "span", "_key": "ib3", "text": "AEO vs SEO", "marks": ["ib1"]},
{"_type": "span", "_key": "ib4", "text": ", text after the anchor.", "marks": []}
]
}
}}]}}
```
- Keep the block's existing `markDefs` and the marks on its existing spans (bold, other links). Copy them across.
- For a new sentence, insert a new block: `{"insert": {"after": "body[_key==\"BLOCK_KEY\"]", "items": [<new block>]}}`.
- If the block has a `listItem` or `level`, keep them.
**Services and case studies** work the same way on their `body`. A service with an empty or template body is skipped.
## Phase 4: Check, publish, confirm
1. Query the draft (`perspective: drafts`) and confirm for each page: the link is there, the `href` is correct, the anchor reads naturally in its sentence, and nothing else on the page changed. Fix or drop any that don't pass (discard the draft with `discard_drafts` for a dropped page).
2. **Publish** every page that passed with `publish_documents` on its id.
3. After about two minutes, fetch each live page and confirm the link is there. A missing link is logged, not retried more than once.
## Phase 5: Report
- Write an **Inbound links** note on the article's brief page by **adding** it at the end (append or insert). **Never replace the page's content**: a full replace deletes the brief and its Brief data and Research sub-pages. If your tool can only replace the whole page, skip the note there and put it in the calendar row's Notes instead. The note lists each source page, the anchor text, the section, and whether it is live. Add skipped pages with the reason.
- Add "Inbound links: published (N pages)" to the calendar row's Notes.
## Rules
1. Never ask. Decide, log, continue.
2. Publish what passed the check, automatically. Never publish a page that has the author's unpublished draft.
3. Never link from or to placeholder posts. Never overwrite a draft the author is working on.
4. One link per source page, in body text, in a place where it helps the reader.
5. Don't edit anything except the link or the one added sentence.
6. Never invent facts in an added sentence. It may only point to what the new article says.
7. No em dashes. Plain words.
8. At most 6 pages per run, at least 3 when usable pages exist.
A new article starts with zero links pointing at it. This is the last step of my content automation: it finds the live pages that should link to the new one and adds the link where it reads naturally.
What it does
Reads the new article and its brief’s inbound plan
Finds live pages on the same topic (articles, case studies, the service page)
Picks the natural sentence for the link, or adds one short sentence
Keeps link direction right: towards the core pages, not from core pages down
Edits 3 to 6 pages and publishes (or saves drafts, your call)
What you need
A CMS connector that can edit content (we use the Sanity MCP)
Optional: Notion MCP for the brief and the calendar
How it works
Check it’s live. No links to drafts.
Pick pages. From the brief’s plan, then relevant live pages; never placeholders.
Place links. One per page, in the paragraph that fits, with a descriptive anchor.
Publish and log. The calendar row gets a note with what changed.
Try asking
“Add inbound links for the article ai seo tools.”
“Add inbound links to my new post, drafts only.”
Install it
Download the ZIP above.
Claude Code: unzip it into .claude/skills/ in your project (or ~/.claude/skills/ for all projects). Keep the folder name; the scripts folder goes with it.
Add the keys from “What you need” to a .env file in your project, and connect the MCP servers it uses.
Claude.ai: upload the ZIP under Settings, Capabilities, Skills. The instructions work there too; the scripts need Claude Code.
Download the ZIP and unzip it into .claude/skills/ inside your project (or ~/.claude/skills/ for every project). Keep the folder name. The scripts folder inside it travels with the skill.
Can I use it in Claude.ai?
You can upload the ZIP under Settings, Capabilities, Skills, but the bundled scripts need a terminal, so Claude Code is the better home. The instructions still work in Claude.ai with the same connectors.
Is anything private left in it?
No. Our IDs, keys, database links and private details were removed. Anything in angle brackets is a placeholder for your own setup.