Internal Link Pass
Finds published pages that genuinely relate to each other and adds contextual internal links between them, then reports every anchor it added so you can scan the run in one place.
What gets installed
- A Link Demo Posts type with 3 related posts and no links yet
- A Link Report type that names every anchor added
- Elena, SEO Analyst as the agent
- One weekly workflow, schedule off until you enable it
Installs into an existing project. Nothing you already have is overwritten.
How it works
Why this is different
Relevance comes from search_content, which is semantic: it matches on meaning across the whole bucket rather than on shared keywords. Tools that bolt linking onto a CMS from outside only see the pages you hand them.
The prompt
Add internal links between published pages that genuinely relate to each other, and report every anchor you add. Rules, in order of importance. Read them before you write anything. 1. The only edit you may make to a body field is wrapping text that is already there in a link. Do not reword, rewrite, reorder, reformat, summarize, or add sentences. If the body cannot be linked without changing the prose, skip the object and say so in the report. 2. Never insert a link inside a heading, a code block, a blockquote, a table, or existing link text. 3. Match the format of the field you are editing: markdown links for markdown and rich-text fields, an anchor tag for HTML fields. How to do the pass. 4. Read at most {{max_objects}} published objects that have a body field. Stop at that number even if more remain. 5. For each one, use search_content to find other published objects in this bucket that cover a related subject. Only link when the target actually covers the phrase you are linking: a link that surprises the reader is worse than no link. 6. Link to {{link_path}}/SLUG, where SLUG is the target object's slug. If the body already contains internal links, copy the path pattern they use instead, since it reflects how the site is actually routed. 7. At most 3 links per object, at most one link per target per object, and never link an object to itself. 8. Skip any phrase that is already linked. Skip the object entirely if you would be adding a link to a page that already links back in the same paragraph. 9. Write the change with update_object, sending only the body field. When finished, create one object in the link-report type recording: - run_date: today - objects_updated: how many objects you changed - links_added: how many anchors you added in total - summary: a markdown list with one line per anchor, in the form "source-slug: \"anchor text\" to target-slug" - details: JSON array of { source_slug, anchor_text, target_slug } Every edit creates a revision, so a human can revert an individual object from its revision history if they disagree with a link. Name every anchor in the summary so that review is possible without opening each page. If you found no genuine opportunities, create the report with zero changes rather than forcing links.
Reviewing a run
The agent only wraps text that is already in the body, and the report names every anchor in the form source-slug: "anchor text" to target-slug. Every edit writes a revision, so an individual object can be reverted from its revision history without undoing the rest of the run. Start with the default of 5 objects per run before raising it.
Cost
The pass reads each candidate body plus its search results, so cost scales with objects per run rather than with links added.
Reading this as an agent? Plain markdown version.
Translates your published pages into another language as native Cosmic locale variants, leaving the originals untouched and filing each translation as a draft for review.
Scans AI and developer tooling news each week, drops anything you already covered, and drafts a linked rundown post with a stated through-line. Every edition lands as a draft.
Reads your real traffic from Cosmic Insights, finds the published pages losing readers, and files a prioritized refresh queue with the numbers that justify each one. Never touches the posts.
Start automating with AI workflows
No credit card required • Free forever