Skip to content

nexscope-ai/nexscope-ecommerce-skills / ecommerce-geo-score-check

ecommerce.geo-score-check

Verified

Score an ecommerce URL for SEO + GEO readiness and AI citation visibility. Triggers on "geo score", "SEO + GEO score", "check ecommerce GEO", "Amazon/Shopify GEO", "GEO readiness audit". Covers product pages, store pages, marketplace listings, category pages, and homepages, scored from crawlable evidence (not live AI polling).

FileKindSize
.nexscope-manifest.jsonconfig218 B
SKILL.mdskill md14.9 KB
geo-ai-visibility-report-optimized.htmlother86.9 KB
geo-eval-ecommerce/assets/config.jsonconfig388 B
geo-eval-ecommerce/assets/prompts/evaluator.mdmarkdown7.8 KB
geo-eval-ecommerce/profiles/_template/product.mdmarkdown914 B
geo-eval-ecommerce/profiles/_template/queries.csvother1.7 KB
geo-eval-ecommerce/profiles/_template/query_rules.mdmarkdown1.3 KB
geo-eval-ecommerce/profiles/airscape-planetary-design-kilo-coffee-st/product.mdmarkdown1.9 KB
geo-eval-ecommerce/profiles/airscape-planetary-design-kilo-coffee-st/queries.csvother3.2 KB
geo-eval-ecommerce/profiles/airscape-planetary-design-kilo-coffee-st/query_rules.mdmarkdown525 B
geo-eval-ecommerce/profiles/aisi-hair-ombre-blonde-wig-glueless-curl/product.mdmarkdown1.2 KB
geo-eval-ecommerce/profiles/aisi-hair-ombre-blonde-wig-glueless-curl/queries.csvother2.6 KB
geo-eval-ecommerce/profiles/aisi-hair-ombre-blonde-wig-glueless-curl/query_rules.mdmarkdown428 B
geo-eval-ecommerce/profiles/apple-macbook-air-13-m5-2026/product.mdmarkdown1.4 KB
geo-eval-ecommerce/profiles/apple-macbook-air-13-m5-2026/queries.csvother2.3 KB
geo-eval-ecommerce/profiles/apple-macbook-air-13-m5-2026/query_rules.mdmarkdown746 B
geo-eval-ecommerce/profiles/boat-neck-sleeveless-tank-top-shirred-wa/product.mdmarkdown1.1 KB
geo-eval-ecommerce/profiles/boat-neck-sleeveless-tank-top-shirred-wa/queries.csvother2.5 KB
geo-eval-ecommerce/profiles/boat-neck-sleeveless-tank-top-shirred-wa/query_rules.mdmarkdown761 B
geo-eval-ecommerce/profiles/coffee-canister/product.mdmarkdown1.4 KB
geo-eval-ecommerce/profiles/coffee-canister/queries.csvother1.3 KB
geo-eval-ecommerce/profiles/coffee-canister/query_rules.mdmarkdown356 B
geo-eval-ecommerce/profiles/hanging-egg-swing-chair-with-stand-white/product.mdmarkdown1.1 KB
geo-eval-ecommerce/profiles/hanging-egg-swing-chair-with-stand-white/queries.csvother2.7 KB
geo-eval-ecommerce/profiles/hanging-egg-swing-chair-with-stand-white/query_rules.mdmarkdown766 B
geo-eval-ecommerce/profiles/iphone-17-pro/product.mdmarkdown1.4 KB
geo-eval-ecommerce/profiles/iphone-17-pro/queries.csvother2.1 KB
geo-eval-ecommerce/profiles/iphone-17-pro/query_rules.mdmarkdown731 B
geo-eval-ecommerce/profiles/nike-shox-r4-se-fade/product.mdmarkdown1.3 KB
geo-eval-ecommerce/profiles/nike-shox-r4-se-fade/queries.csvother2.3 KB
geo-eval-ecommerce/profiles/nike-shox-r4-se-fade/query_rules.mdmarkdown738 B
geo-eval-ecommerce/profiles/ninja-10-in-1-double-oven-with-flexdoor-/product.mdmarkdown1.8 KB
geo-eval-ecommerce/profiles/ninja-10-in-1-double-oven-with-flexdoor-/queries.csvother2.7 KB
geo-eval-ecommerce/profiles/ninja-10-in-1-double-oven-with-flexdoor-/query_rules.mdmarkdown764 B
geo-eval-ecommerce/profiles/rare-beauty/product.mdmarkdown1.5 KB
geo-eval-ecommerce/profiles/rare-beauty/queries.csvother1.6 KB
geo-eval-ecommerce/profiles/rare-beauty/query_rules.mdmarkdown1.1 KB
geo-eval-ecommerce/profiles/rhode-peptide-lip-tint-sweet-pea/product.mdmarkdown1.2 KB
geo-eval-ecommerce/profiles/rhode-peptide-lip-tint-sweet-pea/queries.csvother2.3 KB
geo-eval-ecommerce/profiles/rhode-peptide-lip-tint-sweet-pea/query_rules.mdmarkdown750 B
geo-eval-ecommerce/profiles/roc-inflatable-stand-up-paddle-board-10f/product.mdmarkdown1.5 KB
geo-eval-ecommerce/profiles/roc-inflatable-stand-up-paddle-board-10f/queries.csvother2.7 KB
geo-eval-ecommerce/profiles/roc-inflatable-stand-up-paddle-board-10f/query_rules.mdmarkdown781 B
geo-eval-ecommerce/profiles/skullcandy-crusher-evo-wireless-headphon/product.mdmarkdown1.2 KB
geo-eval-ecommerce/profiles/skullcandy-crusher-evo-wireless-headphon/queries.csvother2.4 KB
geo-eval-ecommerce/profiles/skullcandy-crusher-evo-wireless-headphon/query_rules.mdmarkdown760 B
geo-eval-ecommerce/scripts/__init__.pyscript0 B
geo-eval-ecommerce/scripts/_next_steps.pyscript5.1 KB
geo-eval-ecommerce/scripts/api_capture_runner.pyscript9.0 KB
geo-eval-ecommerce/scripts/api_client_base.pyscript8.2 KB
geo-eval-ecommerce/scripts/cli.pyscript10.0 KB
geo-eval-ecommerce/scripts/evaluator.pyscript6.9 KB
geo-eval-ecommerce/scripts/html_report.pyscript39.8 KB
geo-eval-ecommerce/scripts/loader.pyscript4.4 KB
geo-eval-ecommerce/scripts/normalizer.pyscript3.0 KB
geo-eval-ecommerce/scripts/preaggregate.pyscript7.0 KB
geo-eval-ecommerce/scripts/profile_builder.pyscript9.5 KB
geo-eval-ecommerce/scripts/send_report_email.pyscript4.4 KB
geo-eval-ecommerce/scripts/task_builder.pyscript2.9 KB
geo-eval-ecommerce/scripts/test_raw_api.pyscript2.6 KB
geo-eval-report-tool.jsscript7.8 KB
references/report-template.htmlother22.7 KB

geo-eval-ecommerce/scripts/preaggregate.py

View on GitHub
"""Aggregate eval results into ecommerce GEO statistics."""
import json
from pathlib import Path
from collections import Counter, defaultdict


def build_preaggregate(run_dir):
    """Build preaggregate statistics from eval results."""
    eval_dir = Path(run_dir) / "eval"
    normalized_dir = Path(run_dir) / "normalized"

    evals = []
    for f in sorted(eval_dir.glob("*.json")):
        try:
            evals.append(json.loads(f.read_text(encoding="utf-8")))
        except (json.JSONDecodeError, IOError):
            continue

    if not evals:
        return {"error": "No eval files found"}

    # Basic counts
    total = len(evals)
    engines = list(set(e.get("engine", "") for e in evals))
    queries = list(set(e.get("query_id", "") for e in evals))

    # Target product visibility
    mentioned_count = sum(1 for e in evals if e.get("mentioned"))
    mention_rate = mentioned_count / total if total else 0

    # Mention forms
    mention_forms = Counter(e.get("mention_form", "not_mentioned") for e in evals)

    # Recommendation strength
    rec_strengths = Counter(e.get("recommendation_strength", "not_mentioned") for e in evals)

    # Position stats (when mentioned)
    positions = [e.get("position") for e in evals if e.get("position") and isinstance(e.get("position"), int)]
    avg_position = sum(positions) / len(positions) if positions else None

    # Sentiment
    sentiments = Counter(e.get("sentiment", "n/a") for e in evals)

    # Per-engine breakdown
    engine_stats = {}
    for engine in engines:
        engine_evals = [e for e in evals if e.get("engine") == engine]
        engine_mentioned = sum(1 for e in engine_evals if e.get("mentioned"))
        engine_stats[engine] = {
            "total": len(engine_evals),
            "mentioned": engine_mentioned,
            "mention_rate": engine_mentioned / len(engine_evals) if engine_evals else 0,
            "avg_position": None,
            "mention_forms": dict(Counter(e.get("mention_form", "not_mentioned") for e in engine_evals)),
            "rec_strengths": dict(Counter(e.get("recommendation_strength", "not_mentioned") for e in engine_evals)),
        }
        ep = [e.get("position") for e in engine_evals if e.get("position") and isinstance(e.get("position"), int)]
        if ep:
            engine_stats[engine]["avg_position"] = sum(ep) / len(ep)

    # Competitor analysis
    competitor_counts = Counter()
    competitor_positions = defaultdict(list)
    competitor_strengths = defaultdict(list)
    for e in evals:
        for comp in e.get("competitors_mentioned", []):
            name = comp.get("name", "")
            if name:
                competitor_counts[name] += 1
                if comp.get("position"):
                    competitor_positions[name].append(comp["position"])
                competitor_strengths[name].append(comp.get("recommendation_strength", "mention_only"))

    top_competitors = []
    for name, count in competitor_counts.most_common(10):
        positions_list = competitor_positions.get(name, [])
        top_competitors.append({
            "name": name,
            "mention_count": count,
            "mention_rate": count / total,
            "avg_position": sum(positions_list) / len(positions_list) if positions_list else None,
            "primary_rate": competitor_strengths[name].count("primary") / len(competitor_strengths[name]) if competitor_strengths[name] else 0,
        })

    # Product recommendations aggregation
    all_products = []
    for e in evals:
        for pr in e.get("product_recommendations", []):
            all_products.append(pr)

    product_counts = Counter(p.get("product_name", "") for p in all_products if p.get("product_name"))
    brand_counts = Counter(p.get("brand", "") for p in all_products if p.get("brand"))
    merchant_counts = Counter(p.get("merchant_source", "") for p in all_products if p.get("merchant_source"))

    # Shopping signals
    signal_stats = {
        "has_price_info": sum(1 for e in evals if e.get("shopping_signals", {}).get("has_price_info")),
        "has_purchase_links": sum(1 for e in evals if e.get("shopping_signals", {}).get("has_purchase_links")),
        "has_comparison_table": sum(1 for e in evals if e.get("shopping_signals", {}).get("has_product_comparison_table")),
        "has_pros_cons": sum(1 for e in evals if e.get("shopping_signals", {}).get("has_pros_cons")),
    }

    buy_signals = Counter(e.get("shopping_signals", {}).get("buy_signal_strength", "none") for e in evals)

    all_merchants = []
    for e in evals:
        all_merchants.extend(e.get("shopping_signals", {}).get("merchants_mentioned", []))
    merchant_coverage = dict(Counter(all_merchants).most_common(10))

    # Citation/source analysis
    all_sources = {}
    for e in evals:
        sa = e.get("source_analysis", {})
        if isinstance(sa, dict):
            all_sources.update(sa)

    source_types = Counter(v.get("content_type", "other") for v in all_sources.values() if isinstance(v, dict))
    source_platforms = Counter(v.get("platform", "other") for v in all_sources.values() if isinstance(v, dict))
    official_sources = sum(1 for v in all_sources.values() if isinstance(v, dict) and v.get("is_official"))

    # Missed opportunities
    missed = [e.get("missed_opportunity") for e in evals if e.get("missed_opportunity")]

    return {
        "schema_version": "preaggregate.v1",
        "summary": {
            "total_evaluations": total,
            "engines": engines,
            "queries": queries,
            "mention_rate": round(mention_rate, 3),
            "mentioned_count": mentioned_count,
            "avg_position": round(avg_position, 1) if avg_position else None,
        },
        "mention_forms": dict(mention_forms),
        "recommendation_strengths": dict(rec_strengths),
        "sentiments": dict(sentiments),
        "engine_stats": engine_stats,
        "top_competitors": top_competitors,
        "product_recommendations": {
            "total_products_recommended": len(all_products),
            "unique_products": len(product_counts),
            "top_products": [{"name": n, "count": c} for n, c in product_counts.most_common(10)],
            "top_brands": [{"name": n, "count": c} for n, c in brand_counts.most_common(10)],
            "merchant_distribution": [{"name": n, "count": c} for n, c in merchant_counts.most_common(10)],
        },
        "shopping_signals": {
            "signal_rates": {k: v / total for k, v in signal_stats.items()},
            "buy_signal_distribution": dict(buy_signals),
            "merchant_coverage": merchant_coverage,
        },
        "source_analysis": {
            "total_sources": len(all_sources),
            "content_types": dict(source_types),
            "platforms": dict(source_platforms),
            "official_source_count": official_sources,
        },
        "missed_opportunities": missed[:10],
    }


def save_preaggregate(run_dir, preaggregate):
    """Save preaggregate to run directory."""
    path = Path(run_dir) / "preaggregate.json"
    path.write_text(json.dumps(preaggregate, ensure_ascii=False, indent=2), encoding="utf-8")
    return path
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall