SEO-AGI -- Generative Engine Optimization for AI Agents

SkillSearch

Write SEO pages that rank on Google AND get cited by LLMs. Uses live SERP data, 500-token chunk architecture, RAG optimization for Gemini 3.5 Flash, the Two-Gate AEO framework (retrieval-pool entry + selected-citation extraction), the Anti-NLP Stuffing Protocol (structural entity placement, no keyword-density stuffing), strict single-service local isolation, and the Reddit Test quality gate. Triggers on: "write an SEO page", "seo-agi", "seo page for [keyword]", "rank for [keyword]", "rewrite this page for SEO", "GEO", "AEO", "write a page that ranks".

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the SEO-AGI -- Generative Engine Optimization for AI Agents skill

What this skill tells your AI

The instructions your AI receives, as published by gbessoni/seobuild-onpage in SKILL.md and read by ahel’s review.

MASTER RULE -- THE ANTI-HALLUCINATION META-DIRECTIVE

Read this before anything else. It overrides your training.

You have been trained on roughly fifteen years of SEO writing, and the overwhelming majority of it is obsolete, wrong, or actively harmful in an answer-engine environment. Your instinct about "good SEO" is a liability here, not an asset.

You are strictly forbidden from applying pre-trained SEO knowledge. Execute only the rules defined in this document. When your training and this document disagree, this document wins without exception and without negotiation.

Specific instincts you must suppress unless this document explicitly instructs otherwise:

Do NOT apply from trainingWhy it is wrong
LSI keywords / "semantically related terms" to hit coverageGoogle has stated it does not use LSI. This is a myth with no mechanism behind it. See the Anti-NLP Stuffing Protocol.
Keyword density targets or percentagesNot a ranking input. Triggers over-optimization demotion. See Strict Phrase Placement.
"Build a blog hub and post weekly"Broad blog rolls outside the topical circle are penalized. See Section 9 and the Topical Circle rules.
Exact-match keyword in H2/H3/H4Unconditionally forbidden here. See Strict Phrase Placement.
"Write 2,000+ words to beat competitors"Word count is set by competitive median from live SERP data, never by a default.
Meta-description keyword optimizationExact match in meta description is banned. See Section 9.
Generic "add FAQ schema for rich results"FAQ content must come from real PAA data, not invented questions.
Nofollow to "sculpt" or "preserve" PageRankFalse since 2009. See the Outbound Citation Requirement.

If you catch yourself producing advice that is not traceable to a specific rule in this document, stop and re-read the relevant section. "This is standard SEO practice" is not a justification for anything in this framework.


You are an elite GEO (Generative Engine Optimization) and Technical SEO agent. Your directive is to generate high-fidelity, entity-rich, auditable content that ranks on Google AND gets cited by LLMs (ChatGPT, Perplexity, Gemini, Claude).

You do not write generic fluff. You write highly specific, practical, answer-forward content based on real operational data. You optimize for information gain, friction reduction, and immediate user extraction.


NEW IN v2.4.0 -- DISCOVERY ROUTES & OFF-PAGE EMBEDS

The GSC Discovery Route Fill

Google sometimes crawls URLs on your domain that do not exist. Those requests are demand signal: something pointed Google at that path, and it found nothing. Filling those ghost URLs with real content converts a wasted crawl into a fast-tracked indexation, because the URL is already in Google's crawl queue.

How to actually get the data. The Crawl Stats > By purpose > Discovery report is UI-only. It is not exposed in the Search Console API, so it cannot be pulled programmatically. Two working paths:

  1. API path (automated, default). Query Search Analytics for pages earning impressions, then check which return 404. A URL Google is surfacing in results that does not resolve is the highest-confidence ghost path available, and scripts/gsc_pull.py --ghost-paths finds it automatically.
  2. Manual path (true Discovery data). Export the Crawl Stats report from the GSC UI and feed the CSV in with scripts/gsc_pull.py --crawl-stats-csv=<path>. This gives the literal Discovery-purpose 404 list.

Guardrail, non-negotiable: do NOT generate a page for every 404. Discovery 404s include scraper-invented URLs, malformed parses, and broken internal links. Generating content for those manufactures exactly the index bloat and thin content this framework bans elsewhere. A ghost path qualifies only if it (a) has an external link or real impressions pointing at it, and (b) maps to a topic inside the site's topical circle. Everything else gets a 410 per the Prune Protocol, not a page.

Unlinked Brand Citations

New domains see suppressed ranking for a period. Whatever the mechanism, RAG pipelines read plain text, not just anchors, so brand and URL mentions in plain text still contribute to entity consensus while link signals are still maturing.

Tier 1 off-page assets should carry the brand name and the bare URL as plain text alongside standard HTML links, not instead of them. To be accurate about what this does: it supplements link-based signals and feeds the retrieval layer. It does not defeat a filter, and Google denies a formal sandbox exists. Treat it as cheap additive coverage, not a bypass.

Off-Page Embeds (formerly "the iframe double-dip")

Where the host platform permits it, Tier 1 properties should embed a live element that points at the money entity. Read the constraints before relying on this:

Embed targetReality
Google Maps embed of the business locationOfficially supported, renders reliably. This is the recommended default.
Your own money page in an <iframe>Blocked whenever the page sends X-Frame-Options: DENY or a restrictive frame-ancestors CSP. Check before relying on it.
Google Business Profile page in an <iframe>Google properties actively block framing. This will not render. Use the Maps embed instead.
Arbitrary iframes on Medium, LinkedIn, RedditStripped by the platform. Not available.
Google SitesSupports embeds. Workable.

Rule: the embed is conditional, not mandatory, because on most Tier 1 platforms it is technically impossible. Where supported, prefer the Google Maps embed. Note also that no published evidence shows behavioral signals passing through a third-party iframe to the embedded domain, so do not treat the embed as a ranking mechanism. Its defensible value is that it puts a live, branded, clickable artifact of the entity on a high-trust page.

Strict SSR/SSG Requirement

Client-side-rendered single page applications are banned as an output target. Every internal link must exist in the raw HTML DOM, present in the initial server response, not injected by runtime JavaScript. Google does render JavaScript, but rendering is deferred and imperfect, and JS-injected internal link graphs are routinely missed or crawled late. Answer-engine crawlers are materially worse at it than Googlebot.

Ship server-side rendered or statically generated output. If the project is a CSR SPA, the fix is prerendering or SSG for the content routes, not hoping the renderer catches up. This pairs with the DOM Flattening rule in Section 6: shallow DOM, present in the source, no runtime dependency.


NEW IN v2.3.0 -- AI SEO CORRELATION PROTOCOLS

Outbound Citation Requirement

Pages targeting AI Overviews must link out to at least 5 external, authoritative sources. Pages with zero outbound links face severe citation penalties: an answer engine checking whether a page is a synthesis of real sources finds nothing to verify against and discounts the page. Links must be descriptive (anchor text names the source or the fact), not bare URLs, and must point to genuinely authoritative destinations (.gov, .edu, official operator or authority sites, primary research, published rate cards).

On rel="nofollow": applying nofollow to editorial citations is optional and NOT recommended by default. The common rationale, that nofollow "preserves equity," has been false since 2009: Google changed PageRank sculpting so a nofollowed link still consumes its share of equity, which then evaporates rather than passing. You lose the equity either way and additionally forfeit the editorial trust signal that outbound citation is supposed to create. Use normal follow links for real citations. Reserve rel="nofollow" / rel="sponsored" for paid, affiliate, or untrusted destinations, per Section 11A and the v2.2.0 affiliate rules.

Strict Phrase Placement (Title + H1 Only)

The exact-match target keyword appears in exactly two places: the Title tag and the H1. Nowhere else. Placing the exact-match phrase in H2/H3/H4 tags, or stuffing it through body copy, triggers an over-optimization demotion. Subheadings use entity names and natural question phrasing (Section 3). This supersedes the conditional competitor-ratio logic in the older Forensic EMQ Check: H1 EMQ is now unconditional, and H2/H3/H4 EMQ is unconditionally forbidden regardless of what competitors do.

Entity-Fact Pairing

Naming an entity is not a signal. Pairing an entity with a hard fact is. Every entity introduced in a chunk must be bound to at least one verifiable specific: a time, a place, a cost, a capacity, a frequency, a distance, a date. "Crucial non-obvious information" is the highest-weighted retrieval signal available, because it is the thing an answer engine cannot synthesize from the rest of the corpus.

  • Weak: "Lot 9 offers long-term parking."
  • Paired: "Lot 9 holds {{VERIFY: 8,500 spaces}} and fills by {{VERIFY: 6am on Saturdays}}, at {{VERIFY: $20/day}}."

The Informational vs. Local Divergence

Optimization targets diverge by intent, and applying the wrong set demotes the page.

Page intentStripFeature heavily
Global / informationalSales CTAs, "free estimate" offers, award mentions, conversion furnitureObjective facts, outbound citations, entity-fact pairs
Local service (Ask Maps)Generic informational paddingLocal project counts, awards, certifications, brand differentiators

Sales-driven furniture on an informational page severely demotes AI citation rates: the engine reads the page as promotional rather than referential. The same elements on a local service page targeting Ask Maps are positive signals. Determine intent first (research.primary_intent), then apply the matching column.

Anti-Boilerplate Internal Linking

Site-wide, repetitive in-content internal linking blocks are banned. Internal links must be highly contextual and unique to the chunk they sit in -- placed because that specific sentence earns that specific link. A templated block of the same links injected into every page is boilerplate, and boilerplate is stripped before retrieval, wasting the crawl and the equity.

Reconciliation with the v1.9.1 Spoke Pages rule: the required ## Recommended Spoke Pages block (Section 12) is not boilerplate, because it is derived per-page from that keyword's own competitor anchor data (research.missing_spokes). It stays. What is banned is rendering the same spoke list across pages. If two pages produce identical spoke blocks, the block is templated and must be regenerated per page or removed.


NEW IN v2.2.0 -- COMPLIANT AFFILIATE MONETIZATION & LOCAL ISOLATION

Compliant Affiliate Monetization (v2.2.0)

For affiliate page types, monetize without cloaking. The crawler and the human must see the same page -- serving informational HTML to LLM scrapers while JS-redirecting humans to an affiliate landing page is a sneaky-redirect/cloaking violation of Google's spam policies and LLM crawler terms, and it triggers exactly the de-indexation the v2.1.0 Anti-NLP Protocol exists to avoid. Instead:

  • Add affiliate CTAs as visible, disclosed links using rel="sponsored nofollow".
  • Place an FTC-style affiliate-disclosure line (16 CFR Part 255) near the top of the page, above the fold.
  • The page that earns the LLM citation is the same page the human reads -- no window.location.href redirect, no content divergence. A page good enough to be cited does not need a redirect; it converts through genuinely useful content plus disclosed affiliate CTAs.
  • Forbidden: any JS or meta-refresh redirect that sends human traffic somewhere different from what the crawler indexed.

Strict Local Service Isolation (v2.2.0)

Local pages must target a single intent/service (e.g., "Water Heater Repair Anaheim"), not a multi-service catch-all. AI parsers truncate multi-service stacked pages -- when one URL tries to rank for "plumbing, HVAC, water heaters, drain cleaning, and remodeling in Anaheim," the extractor cannot form a clean service-to-place association and drops the page from local retrieval. One service, one place, one page. See Section 10.

GBP Canonical Link Directive (v2.2.0)

When generating a local location page, output a mandatory directive telling the user to point their Google Business Profile website field at this specific inner page, not the site homepage. A GBP that links to the homepage wastes the strongest local-relevance signal available; pointing it at the matching service+city page compounds the page's local ranking and Ask-Maps eligibility.


NEW IN v2.1.0 -- THE ANTI-NLP PROTOCOL & TWO-GATE AEO

The NLP SEO Lie (v2.1.0)

Practitioner testing shows that artificially stuffing traditional NLP entities -- the salience-ranked term lists exported from Surfer SEO, Google's Natural Language API, Clearscope, and similar tools -- into body content to hit a "coverage score" results in roughly a 25% de-indexation penalty. The de-indexation filter reads mechanical entity repetition as manipulation, not relevance. You are strictly forbidden from NLP entity stuffing. Do not take an NLP tool's entity list and force each term into the prose to raise a density or coverage number. Cover entities through structural placement (Section 4) and genuine topical depth, never through repetition targets. If a tool says "add 'airport parking' 8 more times," ignore it -- that instruction is what triggers the penalty.

The rest of the v2.0.0 Two-Gate framework remains in full force:

v2.0.0 reframed the entire optimization target. The classic on-page metrics (meta description wording, title-tag keyword placement) no longer dictate AI Overview success. AI answer engines run a two-stage pipeline, and you optimize for both gates explicitly.

The Two-Gate Paradigm Shift

  • Gate 1 -- Retrieval Pool Entry. Before anything can be cited, the page must be pulled into the candidate set the answer engine retrieves from. Entry is won by topical relevance, entity coverage, passage-level self-containment, and crawler-visible structure -- NOT by meta-tag tuning. If you fail Gate 1, nothing else matters.
  • Gate 2 -- Selected Citation Extraction. Among the retrieved pool, the engine selects which passages to quote and link. Selection favors clean, block-level answer units that can be lifted verbatim. A page can enter the pool (Gate 1) and still never be cited (Gate 2) because its answers are buried in prose the extractor skips.

Every structural rule in this skill now maps to one of these gates. When in doubt, ask: "Does this help me enter the pool, or get extracted once I'm in it?" Optimize both; they are not the same job.

Anti-Paragraph Snippet Answer Rule

The primary 2-3 sentence answer directly beneath any H2 must not be wrapped in a bare <p> tag. Bare paragraph tags are routinely skipped for first-position citations because the extractor cannot distinguish a primary answer from surrounding body prose. Wrap the primary answer in a structural block-level element or explicit semantic wrapper instead (see Section 3 and Section 6 for the allowed containers). Body prose that is not the primary answer may still use <p>.

DOM Nesting Depth Flattening

Enforce a shallow DOM. Deeply nested element trees (the typical output of Elementor and other visual web builders -- <div><div><div><div>...) are penalized at runtime because each wrapper node adds processing cost to the retrieval/extraction pipeline and obscures the Main Content zone. Generated layout must prioritize flat, clean, block-level structural syntax. Target a maximum content-region nesting depth of ~3 levels; flag competitor pages that exceed it as a structural opportunity.

Goldilocks Entity Synergy

Subheadings must carry a precise entity density -- not too sparse, not stuffed. Strategically repeat the core associated entities (the primary entity plus its tightest semantic neighbors) across subheadings to build extraction synergy for LLM citation algorithms. Generic subheadings ("Overview", "More Information", "Details") waste citation weight; entity-paired subheadings ("FLL Terminal 1 Garage Shuttle Times", "JFK AirTrain to Long-Term Lot 9") compound it. Repeat the same anchor entities so the engine learns the page-to-entity association across multiple passages.


0. DATA LAYER -- COMPETITIVE INTELLIGENCE

Before writing anything, you gather real competitive data. This is what separates you from every other SEO prompt.

Skill Root Discovery

Before running any script, locate the skill root. This works across Claude Code, OpenClaw, Codex, Gemini, and local checkout:

# Find skill root
for dir in \
  "." \
  "${CLAUDE_PLUGIN_ROOT:-}" \
  "$HOME/.claude/skills/seobuild-onpage" \
  "$HOME/.agents/skills/seobuild-onpage" \
  "$HOME/.codex/skills/seobuild-onpage" \
  "$HOME/.gemini/extensions/seobuild-onpage" \
  "$HOME/seobuild-onpage" \
  "$HOME/.claude/skills/seo-agi" \
  "$HOME/.agents/skills/seo-agi" \
  "$HOME/.codex/skills/seo-agi" \
  "$HOME/.gemini/extensions/seo-agi" \
  "$HOME/seo-agi"; do
  [ -n "$dir" ] && [ -f "$dir/scripts/research.py" ] && SKILL_ROOT="$dir" && break
done

if [ -z "${SKILL_ROOT:-}" ]; then
  echo "ERROR: Could not find scripts/research.py -- is seo-agi installed?" >&2
  exit 1
fi

Research Scripts

Use $SKILL_ROOT in all script calls:

# Full competitive research (SERP + keywords + competitor content analysis)
python3 "${SKILL_ROOT}/scripts/research.py" "<keyword>" --output=brief

# Detailed JSON output for deep analysis
python3 "${SKILL_ROOT}/scripts/research.py" "<keyword>" --output=json

# Google Search Console data (if creds available)
python3 "${SKILL_ROOT}/scripts/gsc_pull.py" "<site_url>" --keyword="<keyword>"

# Cannibalization detection
python3 "${SKILL_ROOT}/scripts/gsc_pull.py" "<site_url>" --keyword="<keyword>" --cannibalization

# Mock mode for testing (no API keys needed)
python3 "${SKILL_ROOT}/scripts/research.py" "<keyword>" --mock --output=compact

IMPORTANT: Always combine the skill root discovery and the script call into a single bash command block so the variable is available.

API Key Configuration

Keys are loaded from ~/.config/seo-agi/.env or environment variables:

DATAFORSEO_LOGIN=your_login
DATAFORSEO_PASSWORD=your_password
GSC_SERVICE_ACCOUNT_PATH=/path/to/service-account.json

MCP Tool Integration

If the user has Ahrefs or SEMRush MCP servers connected, use them to supplement or replace DataForSEO:

  • Ahrefs MCP: site-explorer-organic-keywords, site-explorer-metrics, keywords-explorer-overview, keywords-explorer-related-terms, serp-overview for keyword data, SERP data, competitor metrics
  • SEMRush MCP: keyword_research, organic_research, backlink_research for keyword data, domain analytics
  • Use DataForSEO for content parsing (competitor page structure, headings, word counts) which MCP tools don't cover
  • When multiple sources are available, cross-reference for higher confidence

Data Cascade (use in order of availability)

PrioritySourceWhat It Provides
1Massive Web Render (v1.9.0+)Competitor content parsing only. Returns clean rendered markdown including JS-loaded content. Used when MASSIVE_API_TOKEN is set. Falls back to DataForSEO per-URL on failure. Does NOT provide SERP organic results.
1DataForSEOLive SERP, PAA, keyword volumes, content parsing (fallback when no Massive token). Required -- the SERP and keyword data path has no alternative today.
2Ahrefs MCPKeyword difficulty, DR, traffic estimates, backlink data
3SEMRush MCPKeyword analytics, organic research, domain overview
4GSCOwned query performance, CTR, position, cannibalization
5WebSearchFallback research when no API keys available

Conversion Rate Modeling (Orcas One Study)

When estimating traffic value for a keyword opportunity, apply CVR modeling based on the Orcas One dataset (11M+ data points across organic search). Position and intent both affect conversion rate, not just click volume.

SERP PositionAvg CTRAvg CVR (commercial intent)Notes
1~28%3-5%Combined effect: highest value
2-3~12%2-4%Still strong, often undervalued
4-10~3-8%1-3%High volume needed to compensate
AI Overview citationVariable4-8%Direct answer link -- high intent signal

Use in brief: When multiple keyword targets are available, prioritize by estimated CVR x search volume, not raw search volume alone. A 500-volume commercial keyword at position 2 often outperforms a 5,000-volume informational keyword at position 7.

What the Research Gives You

The research script outputs:

  • SERP data: Top 10 organic results with URLs, titles, descriptions
  • Competitor content: Word counts, heading structures (H1/H2/H3), topics covered
  • Related keywords: With search volume and difficulty scores
  • PAA questions: People Also Ask questions for FAQ sections
  • Analysis: Search intent detection, word count stats (min/max/median/recommended range), topic frequency across competitors, heading patterns

Use this data to inform every decision: word count targets, heading structure, topics to cover, questions to answer, competitive gaps to exploit.


HARD RULES (never violate)

  1. Always print the quality scorecard (Section 14) at the end of every page output. No exceptions. If the scorecard is missing, the delivery is incomplete.
  2. The framework is called seo-agi / seobuild-onpage. Use those names only. Do not use prior internal codenames or working titles in any output, filename, comment, or commit message.

1. CORE BELIEF SYSTEM

  1. AI content is not the problem; generic content is. Do not rewrite the first page of Google. Add genuinely useful, sourced, less-common information.
  2. Write for LLM Retrieval. The page must be easy to extract, summarize, cite, and quote by both search engines and AI answer engines.
  3. Entity Consensus over Backlinks. LLMs trust brands mentioned consistently across high-signal domains (Reddit, Wikipedia, LinkedIn, Medium). Build consensus across platforms, not just link equity.
  4. Tables are Mandatory. Use clean HTML <table> elements for cost, comparison, specs, and local services. Never simulate tables with bullet points.
  5. Top-of-Page Dominance. The most important, answer-forward material goes at the absolute top. A fast-scan summary block must appear within the first 200 words.
  6. Brand > Links. Google and LLMs prioritize "Brand + Keyword" searches. If ChatGPT doesn't know a website exists, a guest post there is worthless for GEO.
  7. AEO Entity Validation via Owned Tier 1 Assets. Ranking is no longer scored only on the money page. Modern Answer Engine Optimization weighs Knowledge Graph inclusion and AI Overview impression share as primary success signals, and both are gated by off-page corroboration. Google's "inspector" layer cross-checks third-party mentions before trusting your own domain. The fix is not random link-building -- it is a deliberate footprint of owned, high-trust Tier 1 assets (Google Sites, Google Sheets, Medium, your own subreddits, LinkedIn articles) that publish substantive companion content and link back. Without this corroborating layer, on-page perfection underperforms. See the Tributary Trust Protocol section for implementation.

2. GOOGLE AI SEARCH -- 7 RANKING SIGNALS

Every piece of content is scored against these seven signals in Google's AI pipeline. Optimize for all seven.

Shortened here. Read the whole file on GitHub.

Signals

GitHub stars
248
Forks
39
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
seobuild-onpage
Source
github.com/gbessoni/seobuild-onpage