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-report-tool.js

View on GitHub
const { execSync } = require("child_process");
const fs = require("fs");
const path = require("path");

const SKILL_DIR = "/root/.claude/skills/geo-eval-ecommerce";
const ALLOWED_ENGINES = ["chatgpt", "claude", "gemini", "deepseek"];

module.exports = { run };

async function run(context, input) {
  const { logStep, outputDir } = context;

  logStep("validate-input", "started", "Validating product info and engines");
  const { productInfo, engines: rawEngines } = input;

  if (!productInfo || !productInfo.name || !productInfo.brand || !productInfo.category || !productInfo.price_range) {
    logStep("validate-input", "failed", "Missing required productInfo fields");
    return { ok: false, summary: "Validation failed", error: "productInfo must include name, brand, category, and price_range." };
  }
  if (!productInfo.usps || !Array.isArray(productInfo.usps) || productInfo.usps.length === 0) {
    logStep("validate-input", "failed", "usps is required and must be non-empty array");
    return { ok: false, summary: "Validation failed", error: "productInfo.usps must be a non-empty array." };
  }
  if (!productInfo.competitors || !Array.isArray(productInfo.competitors) || productInfo.competitors.length === 0) {
    logStep("validate-input", "failed", "competitors is required and must be non-empty array");
    return { ok: false, summary: "Validation failed", error: "productInfo.competitors must be a non-empty array." };
  }

  const engineList = (rawEngines && Array.isArray(rawEngines) && rawEngines.length > 0)
    ? rawEngines.filter(function(e) { return ALLOWED_ENGINES.includes(e); })
    : ALLOWED_ENGINES.slice();

  if (engineList.length === 0) {
    logStep("validate-input", "failed", "No valid engines specified");
    return { ok: false, summary: "Validation failed", error: "engines must contain at least one of: " + ALLOWED_ENGINES.join(", ") };
  }

  logStep("validate-input", "succeeded", "Product: " + productInfo.name + ", Engines: " + engineList.join(","));

  logStep("build-profile", "started", "Writing product info and building profile");

  var tmpJsonPath = path.join(outputDir, "product_info_input.json");
  var normalizedInfo = {
    name: productInfo.name,
    brand: productInfo.brand,
    asin: productInfo.asin || null,
    category: productInfo.category,
    price_range: productInfo.price_range,
    usps: productInfo.usps,
    channels: productInfo.channels || ["Amazon"],
    product_url: productInfo.product_url || null,
    competitors: productInfo.competitors.slice(0, 5).map(function(c) {
      return { name: c.name || "", price: c.price || "", description: c.description || "" };
    }),
    target_users: productInfo.target_users || "",
    core_scenario: productInfo.core_scenario || "",
    pain_points: productInfo.pain_points || ""
  };

  fs.mkdirSync(outputDir, { recursive: true });
  fs.writeFileSync(tmpJsonPath, JSON.stringify(normalizedInfo, null, 2), "utf-8");

  var profileSlug;
  try {
    var buildCmd = "cd " + JSON.stringify(SKILL_DIR) + " && python3 scripts/profile_builder.py " + JSON.stringify(tmpJsonPath);
    var buildOut = execSync(buildCmd, { encoding: "utf-8", timeout: 60000, stdio: ["pipe", "pipe", "pipe"] });
    var slugMatch = buildOut.match(/Profile slug:\s*(.+)/);
    if (slugMatch) {
      profileSlug = slugMatch[1].trim();
    } else {
      var createdMatch = buildOut.match(/Created:\s*profiles\/([^\/]+)/);
      profileSlug = createdMatch ? createdMatch[1].trim() : null;
    }
    if (!profileSlug) {
      logStep("build-profile", "failed", "Could not extract profile slug");
      return { ok: false, summary: "Profile build failed", error: "Could not determine profile slug. Output: " + buildOut.slice(0, 200) };
    }
  } catch (err) {
    var errMsg = (err.stderr || err.message || "").slice(0, 300);
    logStep("build-profile", "failed", errMsg);
    return { ok: false, summary: "Profile build failed", error: "profile_builder.py failed: " + errMsg };
  }

  logStep("build-profile", "succeeded", "Profile slug: " + profileSlug);

  logStep("run-pipeline", "started", "Running pipeline for profile=" + profileSlug);

  var runId;
  try {
    var pipelineCmd = "cd " + JSON.stringify(SKILL_DIR) + " && python3 -m scripts.cli --base-dir " + JSON.stringify(SKILL_DIR) + " run --profile " + JSON.stringify(profileSlug) + " --engines " + JSON.stringify(engineList.join(","));
    var pipelineOut = execSync(pipelineCmd, { encoding: "utf-8", timeout: 600000, stdio: ["pipe", "pipe", "pipe"] });
    var runIdMatch = pipelineOut.match(/run_id=([^\s\n]+)/);
    if (runIdMatch) {
      runId = runIdMatch[1].trim();
    }
    if (!runId) {
      logStep("run-pipeline", "failed", "Could not extract run_id");
      return { ok: false, summary: "Pipeline failed", error: "Could not determine run_id. Output: " + pipelineOut.slice(0, 300) };
    }
  } catch (err) {
    var pipeErrMsg = (err.stderr || err.stdout || err.message || "").slice(0, 500);
    logStep("run-pipeline", "failed", pipeErrMsg.slice(0, 200));
    return { ok: false, summary: "Pipeline execution failed", error: "CLI pipeline failed: " + pipeErrMsg };
  }

  logStep("run-pipeline", "succeeded", "Run completed: " + runId);

  logStep("verify-report", "started", "Checking report.html exists");

  var runDir = path.join(SKILL_DIR, "data", "runs", profileSlug, runId);
  var reportPath = path.join(runDir, "report.html");

  if (!fs.existsSync(reportPath)) {
    logStep("verify-report", "failed", "report.html not found");
    return { ok: false, summary: "Report generation failed", error: "report.html not found in run directory" };
  }

  var reportStat = fs.statSync(reportPath);
  if (reportStat.size < 1024) {
    logStep("verify-report", "failed", "report.html too small");
    return { ok: false, summary: "Report generation failed", error: "report.html is too small, likely incomplete" };
  }

  logStep("verify-report", "succeeded", "Report exists: " + reportStat.size + " bytes");

  logStep("finalize", "started", "Copying report and extracting metrics");

  var reportFileName = "geo-report-" + profileSlug + ".html";
  var destPath = path.join(outputDir, reportFileName);
  fs.copyFileSync(reportPath, destPath);

  var metrics = { mentionRate: 0, avgPosition: null, primaryRate: 0, totalEvaluations: 0 };
  var engineBreakdown = {};

  var preagPath = path.join(runDir, "preaggregate.json");
  if (fs.existsSync(preagPath)) {
    try {
      var preag = JSON.parse(fs.readFileSync(preagPath, "utf-8"));
      var smry = preag.summary || {};
      var engStats = preag.engine_stats || {};
      var recStr = preag.recommendation_strengths || {};
      var totalEvals = smry.total_evaluations || 0;

      metrics = {
        mentionRate: smry.mention_rate || 0,
        avgPosition: smry.avg_position || null,
        primaryRate: totalEvals > 0 ? (recStr.primary || 0) / totalEvals : 0,
        totalEvaluations: totalEvals
      };

      var engineKeys = Object.keys(engStats);
      for (var i = 0; i < engineKeys.length; i++) {
        var ek = engineKeys[i];
        var es = engStats[ek];
        engineBreakdown[ek] = {
          mentionRate: es.mention_rate || 0,
          primaryCount: (es.rec_strengths || {}).primary || 0
        };
      }
    } catch (e) {
      logStep("finalize", "info", "Could not parse preaggregate.json");
    }
  }

  logStep("finalize", "succeeded", "Report: " + reportFileName);

  var summaryText = "GEO evaluation complete: mention_rate=" + (metrics.mentionRate * 100).toFixed(1) + "%, avg_position=" + (metrics.avgPosition ? metrics.avgPosition.toFixed(1) : "N/A") + ", primary_rate=" + (metrics.primaryRate * 100).toFixed(1) + "%, total=" + metrics.totalEvaluations + " evaluations";

  return {
    ok: true,
    summary: summaryText,
    data: {
      reportFile: reportFileName,
      runId: runId,
      profileSlug: profileSlug,
      metrics: metrics,
      engineBreakdown: engineBreakdown
    }
  };
}
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