seoskills.sh
Catalog/Keyword Research/N-gram SERP Intent Clusterer

N-gram SERP Intent Clusterer

Clusters a keyword list by the overlap of their live SERP results and fuses n-gram intent signals, then labels each clu…

Updated

New

Use this skill

$ npx skills add seoskills.sh/serp-intent-clusterer
Repository
seoskills.sh
GitHub stars
License
MIT

About this skill

N-gram SERP Intent Clusterer is a Keyword Research skill for AI agents, published in the seoskills.sh catalog. Reach for it when your work involves keyword discovery, search intent mapping, and topical strategy. Install it with one command and it runs inside your own agent, so the work happens in your workflow, not a separate SEO tool.

SKILL.md

N-gram SERP Intent Clusterer

AGENT ROLE: Autonomous keyword-clustering agent. Group keywords by SERP-result overlap (the only ground-truth signal for "same intent"), label intent, and emit the JSON in references/output.schema.json. Cluster by evidence, not by string similarity alone.

OBJECTIVE

Partition a keyword set into clusters where Google returns substantially the same URLs (⇒ one page can rank for all), assign each cluster a dominant intent, and name the canonical target URL.

INPUTS

  • keywords (REQUIRED string[]).
  • overlap_threshold (OPTIONAL, default 3): min shared top-10 URLs for two keywords to be linked.
  • top_n (OPTIONAL, default 10): SERP depth to compare.
  • location/hl (OPTIONAL): default "United States"/"en".

AUTHENTICATION (SERP API)

  1. REQUIRE env SERP_API_KEY. IF unset THEN STOP error.code="AUTH_MISSING_API_KEY".
  2. Endpoint (SerpApi shape): GET https://serpapi.com/search.json?engine=google&q={kw}&num={top_n}&api_key={key}.
  3. Record serp_provider in output; the fetch layer is swappable for DataForSEO.

EXPECTED TOOL CALLS

  • Run scripts/cluster_intent.py --keywords keywords.json --overlap 3.
  • One SERP fetch per keyword; extract the ordered organic_results[].link set.

PROCEDURE (deterministic)

STEP 1 — FETCH the top-top_n organic URLs for every keyword (normalize to registrable-domain + path). STEP 2 — BUILD an undirected graph: node = keyword; edge (a,b) IF |urls(a) ∩ urls(b)| >= overlap_threshold. STEP 3 — CLUSTER = connected components (single-linkage on SERP overlap). STEP 4 — INTENT per cluster: compute n-grams over the cluster's keywords + SERP titles; map modifier n-grams to intent via references-free rules — buy|price|cheap|deal|coupon|for sale→transactional; best|top|review|vs|alternative→commercial; how|what|why|guide|tutorial|ideas→informational; brand/domain tokens→navigational. Dominant = highest-weighted. STEP 5 — CANONICAL TARGET: the URL appearing in the most keywords' SERPs within the cluster (modal URL); IF the user's own domain ranks, prefer it and note owns_target=true. STEP 6 — EMIT clusters sorted by size desc; singletons returned as size-1 clusters.

RATE LIMITS & ERROR HANDLING

  • SERP APIs bill per search. On 429/quota THEN backoff 2^attempt (max 5); after that STOP error.code="RATE_LIMITED" with partial = keywords fetched. Never silently drop.
  • On 5xx/timeout retry ≤3 then mark that keyword status="serp_error" and exclude it from clustering (report in skipped).
  • Concurrency ≤ 3.

MISSING / INSUFFICIENT DATA

  • IF a keyword returns < 3 organic URLs THEN it cannot be reliably clustered → return as singleton with low_confidence=true.
  • Never merge two keywords below overlap_threshold even if strings look similar (string similarity ≠ intent).

OUTPUT

One JSON object per references/output.schema.json. No prose.

FILES

  • scripts/cluster_intent.py — SERP fetch, overlap graph, connected-component clustering, intent labeling.
  • references/output.schema.json — output contract.

Not using the CLI? Copy the SKILL.md and paste it straight into ChatGPT, Claude, or any agent.

Embed a badge

seoskills.sh install badge

More in Keyword Research

Keyword Researchcalm-north/seojuice-skills

find-keywords

Build a prioritized keyword list for a website, topic, or campaign. Use when the user asks about keyword research, finding keywords to target, building a keyword list, search demand, keyword difficulty, intent mapping, or which keywords to prioritize. For writing content around keywords, see brief. For grouping keywords into clusters, see build-clusters.

6.9K installs
Keyword Researchagricidaniel/claude-seo

seo-plan

Strategic SEO planning for new or existing websites. Industry-specific templates, competitive analysis, content strategy, and implementation roadmap. Use when user says "SEO plan", "SEO strategy", "SEO planning", "content strategy", "keyword strategy", "content calendar", "site architecture", or "SEO roadmap".

5.4K installs
Keyword Researchagricidaniel/claude-seo

seo-cluster

SERP-based semantic topic clustering for content architecture planning. Groups keywords by actual Google SERP overlap (not text similarity), designs hub-and-spoke content clusters with internal link matrices, and generates interactive visualizations. Optionally executes content creation if claude-blog is installed. Use when user says "topic cluster", "content cluster", "semantic clustering", "pillar page", "hub and spoke", "content architecture", "keyword grouping", or "cluster plan".

5K installs
Keyword Researchagricidaniel/claude-seo

seo-sxo

Search Experience Optimization: reads Google SERPs backwards to detect page-type mismatches, derives user stories from search intent signals, and scores pages from multiple persona perspectives. Identifies why well-optimized pages fail to rank by analyzing what Google rewards for each keyword. Use when user says "SXO", "search experience", "page type mismatch", "SERP analysis", "user story", "persona scoring", "why isn't my page ranking", "intent mismatch", or "wireframe".

4.4K installs
Keyword Researchcalm-north/seojuice-skills

target-serp

Identify and capture SERP features for target keywords — featured snippets, People Also Ask boxes, knowledge panels, and rich results. Use when the user asks about featured snippets, position zero, PAA optimization, rich results, schema markup for SERP features, or how to get more SERP real estate.

2K installs
Keyword Researchnexscope-ai/amazon-skills

amazon-keyword-research

Amazon keyword research and market opportunity analysis for sellers. Retrieve autocomplete suggestions (long-tail keywords), analyze competitor landscape, and assess market opportunity for any keyword on 12 Amazon marketplaces (US/UK/DE/FR/IT/ES/JP/CA/AU/IN/MX/BR). No API key required. Make sure to use this skill whenever the user mentions Amazon product research, finding products to sell on Amazon, Amazon keyword ideas, niche analysis, competition analysis for Amazon, market opportunity on Amazon, comparing Amazon keywords, evaluating whether a product is worth selling, Amazon autocomplete da

1.3K installs