keyword-cluster
The keyword-cluster command transforms seed keywords into a publication-ready content architecture by clustering them into pillar pages and supporting spokes using SERP overlap analysis and intent grouping. Use it when planning topic hub structures, deduplicating cannibalizing pages, or mapping programmatic SEO rollouts for a website.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/indranilbanerjee/digital-marketing-pro/HEAD/commands/keyword-cluster.md -o ~/.claude/commands/keyword-cluster.mdkeyword-cluster.md
# Keyword Cluster
> If you see unfamiliar placeholders or need to check which keyword data sources are connected, see [CONNECTORS.md](../CONNECTORS.md).
Takes a set of seed keywords and produces a publication-ready cluster plan: pillar pages with their spokes, intent-grouped, prioritised by an opinionated scoring formula, with an internal-link map and a four-gate quality scorecard. Routes to `skills/keyword-cluster/SKILL.md`.
## Trigger
User runs `/digital-marketing-pro:keyword-cluster` or asks for:
- "Cluster these keywords into a content plan"
- "Build a pillar/spokes architecture for this topic"
- "Design a topic hub for X"
- "Dedupe my cannibalising pages"
- "Plan a programmatic SEO rollout"
## Inputs
1. **Seeds** — either a list of 3–20 seed keywords inline, or a path to a CSV with at least a `keyword` column (plus optional `volume`, `kd`, `intent`)
2. **Target country / language** (optional — uses brand profile default)
3. **SERP data** (strongly recommended) — JSON map of keyword → top-N result URLs from connected rank-tracker MCP. Without this, falls back to lower-confidence lexical clustering.
4. **Filter thresholds** (optional) — minimum search volume, maximum keyword difficulty
## Process
1. Load brand context + auto-apply industry / compliance rules
2. Optionally expand seeds via brand's keyword-research MCP (`/digital-marketing-pro:keyword-research`) if input is < 20 keywords
3. Filter seeds by min-volume / max-KD / banned-word lists
4. Fetch top-10 SERPs per keyword via connected rank-tracker (with budget guard at 500-credit threshold)
5. Run `scripts/keyword_cluster.py` with SERP mode (or lexical fallback)
6. Validate the four quality gates (cannibalisation / orphan / coverage / anchor_diversity) — surface `needs_review` diagnostics if any fail
7. Draft pillar-page briefs for clusters with `priority_score >= 0.5`
8. Build internal-link map
9. Sort by priority for build-order recommendation
10. Write `PLAN.md` to `${CLAUDE_PLUGIN_DATA}/{brand}/seo/keyword-cluster/{date}/`
## Output
Numbered intermediate files under `${CLAUDE_PLUGIN_DATA}/{brand}/seo/keyword-cluster/{YYYY-MM-DD}/`:
- `00-input.md`, `01-seed-expansion.md`, `02-filtered.csv`, `03-serps.json` (if SERP mode)
- `04-cluster-run.json` (raw script output), `05-quality-scorecard.md`
- `06-pillar-pages.md`, `07-internal-link-map.md`, `08-build-order.md`
- `PLAN.md` (the deliverable)
## After the cluster
Ask: "Would you like me to:
- Brief the top pillar pages? (`/digital-marketing-pro:content-brief`)
- Start writing the highest-priority pillar? (`/digital-marketing-pro:content-engine`)
- Apply the internal-link map to your CMS? (`/digital-marketing-pro:seo-implement`)
- Schedule a quarterly re-run via `/digital-marketing-pro:seo-drift`?"
For the full skill spec including the four quality gates, priority-score formula, and chain handoffs, see [skills/keyword-cluster/SKILL.md](../skills/keyword-cluster/SKILL.md).Design a statistically rigorous A/B or multivariate test plan — If/Then/Because hypothesis, control and variant specs, required sample size per variant (absolute vs relative MDE via sample-size-calculator.py), test duration, guardrail metrics, stopping rules, and go/no-go decision criteria. Triggers on \"/digital-marketing-pro:ab-test-plan\", \"set up an A/B test\", \"how long should my test run\", \"calculate sample size for an experiment\", \"is this test result significant\". Reads the brand profile and past campaign-tracker results to avoid re-testing validated hypotheses; finished tests are evaluated with significance-tester.py by the cro-specialist agent.
Generate 3-5 ad copy variations per platform — headlines, descriptions, and CTAs formatted to Google, Meta, LinkedIn, TikTok, X, and Pinterest specs — each scored 1-10 with policy-compliance flags, A/B testing groupings, and a message-match check against the landing page. Triggers on \"/digital-marketing-pro:ad-creative\", \"write ad copy for Meta\", \"give me RSA headline variations\", \"we need LinkedIn ad copy\", \"draft TikTok ad creative\". Reads the brand profile, guidelines, and compliance rules; routes video ad scripts to /digital-marketing-pro:video-script and gates AI-generated visuals for EU campaigns through /digital-marketing-pro:c2pa-metadata and /digital-marketing-pro:check.
Walk through adding a custom MCP server integration to the plugin — searches npm for an existing MCP package (or scaffolds a custom server from the plugin's guide), generates the exact .mcp.json entry, sets up environment-variable credentials, tests connectivity, and documents the tools the new server exposes. Triggers on \"/digital-marketing-pro:add-integration\", \"connect Ahrefs to the plugin\", \"add a new MCP server\", \"integrate our internal API\", \"hook up Stripe data\". Reads the brand profile and agency credential profiles at ~/.claude-marketing/credentials/ to map client-specific keys; custom builds follow skills/context-engine/custom-mcp-guide.md.
Audit how a brand appears across the 6 canonical AI answer surfaces — ChatGPT, Perplexity, Google AI Mode, AI Overviews, Gemini, Copilot — probing 10-25 queries into a numbered output bundle with per-platform visibility scorecards, citation-accuracy checks, a competitor matrix, content gaps, and an optimization playbook behind a four-gate quality scorecard. Triggers on \"/digital-marketing-pro:aeo-audit\", \"does ChatGPT know about our brand\", \"check our AI search visibility\", \"how does Perplexity describe us\", \"are we showing up in AI Overviews\". Reads the brand profile; reconciles probes against GSC actuals via /digital-marketing-pro:gsc-ai-performance and defines the AI-visibility scoring standard reused by geo-monitor and share-of-voice.
Strategy module for Answer Engine / Generative Engine Optimization — audits AI visibility, restructures content for citation, runs entity-consistency checks across Knowledge Graph, Wikidata, Wikipedia, Crunchbase, and LinkedIn, and produces JSON-LD schema specs, monitoring frameworks, and a 90-day LLM content strategy. Triggers on \"/digital-marketing-pro:aeo-geo\", \"how do we get cited by AI\", \"optimize for AI Overviews\", \"fix our entity consistency\", \"do we need llms.txt\". Reads the brand profile, compliance rules, and industry benchmarks; its measurement counterpart is /digital-marketing-pro:aeo-audit, with GSC actuals via /digital-marketing-pro:gsc-ai-performance.
Generate a portfolio-level dashboard across ALL client brands — per-client RAG health scores, campaign activity, budget pacing, aggregate KPIs, team utilization, pending approvals, upcoming deadlines, and an alerts panel — built for agency standups and weekly reviews. Triggers on \"/digital-marketing-pro:agency-dashboard\", \"how are all our clients doing\", \"portfolio health check\", \"budget pacing across accounts\", \"which accounts are at risk\". Enumerates every brand under ~/.claude-marketing/brands/ and pulls data via campaign-tracker.py, execution-tracker.py, and team-manager.py; drill into a single client with /digital-marketing-pro:performance-report or /digital-marketing-pro:client-report.
Invoke when the user needs to manage multiple client brands, view portfolio-level dashboards, generate client reports, manage SOPs, switch credential profiles, assign team tasks, configure regions, or generate executive summaries. Triggers on requests involving multi-client management, agency workflows, client onboarding, or portfolio oversight.
Invoke when the user needs help with marketing measurement, KPI definition, dashboard design, attribution reporting, performance analysis, competitive benchmarking, or translating data into marketing decisions. Triggers on requests involving metrics, reporting, analytics setup, or data interpretation.