Skip to content

The-AI-Directory-Company/agents-and-skills / skills/discovery-gseo

discovery-gseo

Verified

Find, evaluate, and prioritize keyword and content opportunities for both search engine ranking and AI platform citation — using live browser automation, SERP analysis, competitor intelligence, community listening, and GEO-aware scoring to produce a prioritized content plan that drives traffic and AI visibility.

scripts/competitor-gap-analysis.py

View on GitHub
#!/usr/bin/env python3
"""
competitor-gap-analysis.py — Compare user domain vs competitors for keyword gaps.

Identifies keywords and topics that competitors cover but the user's site does not.
Uses WebSearch site: queries as the free baseline, with optional DataForSEO/Ahrefs
API integration for comprehensive gap data.

Usage:
    python3 competitor-gap-analysis.py --domain yourdomain.com --competitors comp1.com,comp2.com
    python3 competitor-gap-analysis.py --domain yourdomain.com --competitors comp1.com --seeds seeds.txt

AI Agent Usage:
    Free path (WebSearch):
    1. For each competitor: WebSearch("site:competitor.com") → estimate total indexed pages
    2. For each competitor + each seed keyword:
       WebSearch("site:competitor.com [seed]") → find their relevant pages
    3. Catalog competitor pages by topic/keyword from titles and URLs
    4. WebSearch("site:userdomain.com") → catalog user's pages
    5. Compare: topics competitors cover that user doesn't = gaps
    6. For each gap: estimate opportunity (volume proxy from result count)

    Paid path (DataForSEO / Ahrefs API):
    1. Call keyword gap API: user domain vs competitor domains
    2. Get exact keywords, volumes, positions per domain
    3. Extract "Missing" keywords (competitors rank, user doesn't)
    4. Extract "Weak" keywords (competitors rank higher)
"""

import argparse
import json
import sys


def analyze_gaps_websearch(domain, competitors, seeds):
    """
    Free gap analysis using WebSearch site: queries.

    AI Agent should:
    1. WebSearch("site:{competitor}") for each competitor → count results
    2. WebSearch("site:{competitor} {seed}") for each competitor + seed → list pages
    3. WebSearch("site:{domain}") → list user's pages
    4. Compare topic coverage → identify gaps
    """
    gaps = []

    # Placeholder structure — agent fills with real WebSearch data
    for competitor in competitors:
        for seed in seeds:
            gap = {
                "keyword": seed,
                "competitor_domain": competitor,
                "competitor_has_content": True,  # Agent verifies via site: search
                "user_has_content": False,  # Agent verifies via site: search
                "competitor_page_url": "",  # Agent extracts from search results
                "competitor_page_title": "",
                "volume_estimate": "unknown",  # No volume data in free path
                "opportunity": "unknown",
            }
            gaps.append(gap)

    return gaps


def analyze_gaps_paid(domain, competitors, api_type="dataforseo"):
    """
    Paid gap analysis using DataForSEO or Ahrefs API.

    AI Agent should:
    - DataForSEO: Call /v3/dataforseo_labs/google/domain_intersection/live
      with target domain and competitor domains
    - Ahrefs: Call Content Gap API with target + competitors
    - Extract: keyword, volume, KD, position per domain, gap type (missing/weak)
    """
    # Agent fills with real API data
    return []


def main():
    parser = argparse.ArgumentParser(
        description="Compare user domain vs competitors for keyword gaps."
    )
    parser.add_argument(
        "--domain", type=str, required=True, help="User's domain (e.g., yourdomain.com)"
    )
    parser.add_argument(
        "--competitors",
        type=str,
        required=True,
        help="Comma-separated competitor domains",
    )
    parser.add_argument(
        "--seeds",
        type=str,
        help="Path to seeds file for topic-guided gap analysis",
    )
    parser.add_argument(
        "--api",
        type=str,
        choices=["websearch", "dataforseo", "ahrefs"],
        default="websearch",
        help="Data source for gap analysis (default: websearch)",
    )
    parser.add_argument("--tools", type=str, help="Path to tools.json inventory file")

    args = parser.parse_args()

    competitors = [c.strip() for c in args.competitors.split(",") if c.strip()]

    seeds = []
    if args.seeds:
        try:
            with open(args.seeds, "r") as f:
                seeds = [line.strip() for line in f if line.strip()]
        except FileNotFoundError:
            print(json.dumps({"error": f"Seeds file not found: {args.seeds}"}))
            sys.exit(1)

    if not seeds:
        seeds = [""]  # Agent should still run site: queries without seed filtering

    if args.api == "websearch":
        gaps = analyze_gaps_websearch(args.domain, competitors, seeds)
        method = "websearch"
    elif args.api == "dataforseo":
        gaps = analyze_gaps_paid(args.domain, competitors, "dataforseo")
        method = "dataforseo"
    else:
        gaps = analyze_gaps_paid(args.domain, competitors, "ahrefs")
        method = "ahrefs"

    # Identify top opportunities (gaps with highest estimated value)
    top_opportunities = sorted(
        [g for g in gaps if g.get("user_has_content") is False],
        key=lambda x: x.get("volume_estimate", 0) if isinstance(x.get("volume_estimate"), (int, float)) else 0,
        reverse=True,
    )[:20]

    result = {
        "user_domain": args.domain,
        "competitors": competitors,
        "method": method,
        "total_gaps": len([g for g in gaps if g.get("user_has_content") is False]),
        "gaps": gaps,
        "top_opportunities": top_opportunities,
    }

    print(json.dumps(result, indent=2))


if __name__ == "__main__":
    main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall