backlink-gap
The backlink-gap skill identifies referring domains that link to multiple competitors but not to your site, then ranks them by a composite priority score based on domain authority, link-overlap signal, downstream traffic, and topical relevance. Use this skill when planning link-building campaigns, qualifying digital-PR prospects, conducting quarterly backlink audits, or launching new product pages that need targeted outreach prospects ranked by acquisition likelihood rather than raw authority alone.
git clone --depth 1 https://github.com/indranilbanerjee/digital-marketing-pro /tmp/backlink-gap && cp -r /tmp/backlink-gap/skills/backlink-gap ~/.claude/skills/backlink-gapSKILL.md
# /digital-marketing-pro:backlink-gap
## Purpose
Identify the highest-leverage backlink prospects — domains that link to multiple competitors but not to you — and rank them by an opinionated priority score that combines authority, link-overlap signal, downstream traffic, and topical relevance. Produces a numbered output bundle ready for outreach handoff.
## Context efficiency
Heavy skill. **Grep before Read** any referenced file, then `Read` only matched ranges with `offset` + `limit`. List `${CLAUDE_PLUGIN_DATA}/<brand>/` before opening files. On re-invocation mid-session, skip files already in context.
## When to Use
- Quarterly backlink audit — "where did our competitors grow links this quarter and we didn't?"
- Pre-launch link-building plan for a new product or content hub
- Digital PR qualification — separating "would-link-to-anyone" prospects from "high-confidence-will-link-to-our-space"
- Competitive recovery — a competitor displaced you and you want to know which links moved
- Onboarding a new client and need a "first 50 link targets" backlog
**Don't use** when you just need backlink *quantity* numbers (use the brand's connected backlink MCP directly) or when you need *anchor-text* analysis of your own profile (that's a separate audit — covered in `seo-audit`).
## Brand context (auto-applied)
1. Read `~/.claude-marketing/brands/_active-brand.json` for the active slug, then load `~/.claude-marketing/brands/{slug}/profile.json`
2. If no brand exists: ask "Set up a brand first (/digital-marketing-pro:brand-setup)?" — or proceed with defaults
3. Apply `skills/context-engine/industry-profiles.md` for industry-specific link-quality thresholds (YMYL industries should set higher `--min-dr`)
4. Apply `skills/context-engine/compliance-rules.md` to filter out blocked publishers (e.g., PBN-style or paid-link networks the brand has explicitly banned)
## Inputs
| Input | Source | Required? |
|---|---|---|
| Our backlinks CSV | Export from connected backlink MCP (Ahrefs / Semrush / SE Ranking / Moz) for the brand's primary domain | yes |
| Competitor backlinks CSVs (2+) | Same exporter, one per competitor (2 minimum for the link-overlap signal; 3-5 is the sweet spot) | yes |
| Min DR / DA filter | CLI flag, brand-profile default, or industry standard | optional |
| Top-N count | How many prospects to surface | optional |
**One competitor is allowed** (the script warns rather than errors) but the resulting "shared signal" is noise — single-competitor gap analysis is really just "who links to them" rather than "who consistently links in our space."
## Process (10 steps, numbered-file output)
All outputs go to `${CLAUDE_PLUGIN_DATA}/{brand}/seo/backlink-gap/{YYYY-MM-DD}/`.
1. **`00-input.md`** — capture our domain, competitor list (with rationale: why these N?), filter parameters, run timestamp
2. **`01-data-pull.md`** — pull backlinks for `{brand}.tld` and each competitor via brand's connected backlink MCP. **Budget guard**: if the MCP exposes credit cost, sum estimated cost and ask "Continue? (y/N — default N)" before fetching when total > 200 credits.
3. **`02-ours.csv`** — our backlink export (raw)
4. **`03-comp-{competitor}.csv`** — one CSV per competitor (raw)
5. **`04-gap-run.json`** — run the script:
```bash
python "${CLAUDE_PLUGIN_ROOT}/scripts/backlink_gap.py" \
--ours "${CLAUDE_PLUGIN_DATA}/{brand}/seo/backlink-gap/{date}/02-ours.csv" \
--competitors \
"${CLAUDE_PLUGIN_DATA}/{brand}/seo/backlink-gap/{date}/03-comp-competitor1.csv" \
"${CLAUDE_PLUGIN_DATA}/{brand}/seo/backlink-gap/{date}/03-comp-competitor2.csv" \
--min-dr {brand.profile.min_link_dr or 20} \
--top 100 \
--out "${CLAUDE_PLUGIN_DATA}/{brand}/seo/backlink-gap/{date}/04-gap-run.json"
```
`--competitors` takes an explicit space-separated list of CSV paths (`nargs="+"`) — **enumerate each `03-comp-*.csv` file; the script does not expand a `*` glob**, so a quoted `03-comp-*.csv` would fail with FileNotFoundError. List one path per competitor.
6. **`05-quality-scorecard.md`** — read `quality_scorecard` from `04-gap-run.json`. If `status: needs_review`, diagnose:
- `data_freshness: fail` → input CSV(s) older than 90 days. Re-pull data; backlink graphs decay fast.
- `sample_size: fail` → any input < 50 unique referring domains. Either the domain is too new or the export was truncated. Re-export with no row limit.
- `competitor_coverage: warn` → only 1 competitor. Add at least 1 more for genuine overlap signal.
- `link_overlap_signal: fail` → fewer than 5 referring domains link to ≥2 competitors. Either competitors are poorly chosen (they don't share a content space with each other) or the data is incomplete. Re-choose competitors.
7. **`06-prospect-shortlist.md`** — top 30 prospects, formatted for outreach handoff: domain, DR, link count across competitors, suggested outreach angle (guest post, broken-link, resource-page mention)
8. **`07-broken-link-candidates.md`** — subset where one or more competitor links return 4xx (run a quick HTTP HEAD pass on competitor backlink URLs — use the brand's connected web-fetch MCP). These are "easy wins" — pitch your URL as the replacement.
9. **`08-outreach-templates.md`** — three template variants: (a) cold-pitch resource-page, (b) broken-link replacement, (c) competitor mention. Each pre-filled with brand voice from the brand profile's voice fields + `skills/context-engine/guidelines-framework.md`.
10. **`PLAN.md`** — single-page summary: stats + scorecard + top 10 prospects with outreach angle + recommended cadence (3-5 pitches/week for sustainable outreach quality).
## Output format
```
${CLAUDE_PLUGIN_DATA}/{brand}/seo/backlink-gap/2026-06-04/
├── 00-input.md
├── 01-data-pull.md
├── 02-ours.csv
├── 03-comp-{competitor1}.csv
├── 03-comp-{competitor2}.csv
├── ...
├── 04-gap-run.json
├── 05-quality-scorecard.md
├── 06-prospect-shortlist.md
├── 07-broken-link-candidates.md
├── 08-outreach-templates.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.