Skip to content

balsm-health/website / .claude/skills/seo

Comprehensive SEO analysis for any website or business type. Full site audits, single-page analysis, technical SEO (crawlability, indexability, Core Web Vitals with INP), schema markup, content quality (E-E-A-T), image optimization, sitemap analysis, and GEO for AI Overviews/ChatGPT/Perplexity. Industry detection for SaaS, e-commerce, local, publishers, agencies. Triggers on: SEO, audit, schema, Core Web Vitals, sitemap, E-E-A-T, AI Overviews, GEO, technical SEO, content quality, page speed.

FileKindSize
LICENSE.txtmarkdown143 B
SKILL.mdskill md16.9 KB
bin/claude-seoexecutablescript1.5 KB
extensions/banana/references/cost-tracking.mdmarkdown1.2 KB
extensions/banana/references/gemini-models.mdmarkdown5.8 KB
extensions/banana/references/mcp-tools.mdmarkdown3.7 KB
extensions/banana/references/post-processing.mdmarkdown5.1 KB
extensions/banana/references/presets.mdmarkdown2.2 KB
extensions/banana/references/prompt-engineering.mdmarkdown20.9 KB
extensions/banana/references/seo-image-presets.mdmarkdown4.0 KB
extensions/banana/scripts/batch.pyexecutablescript3.3 KB
extensions/banana/scripts/cost_tracker.pyexecutablescript7.2 KB
extensions/banana/scripts/edit.pyexecutablescript5.6 KB
extensions/banana/scripts/generate.pyexecutablescript6.4 KB
extensions/banana/scripts/presets.pyexecutablescript4.9 KB
extensions/banana/scripts/setup_mcp.pyexecutablescript4.5 KB
extensions/banana/scripts/validate_setup.pyexecutablescript3.8 KB
hooks/hooks.jsonconfig416 B
hooks/run-python-hook.jsscript1.7 KB
hooks/validate-schema.pyexecutablescript5.9 KB
pdf/google-seo-reference.mdmarkdown8.0 KB
references/backlink-quality.mdmarkdown3.4 KB
references/cwv-thresholds.mdmarkdown6.9 KB
references/eeat-framework.mdmarkdown8.1 KB
references/free-backlink-sources.mdmarkdown5.6 KB
references/local-schema-types.mdmarkdown9.2 KB
references/local-seo-signals.mdmarkdown9.6 KB
references/maps-api-endpoints.mdmarkdown5.9 KB
references/maps-free-apis.mdmarkdown6.0 KB
references/maps-gbp-checklist.mdmarkdown5.9 KB
references/maps-geo-grid.mdmarkdown4.3 KB
references/quality-gates.mdmarkdown5.1 KB
references/schema-types.mdmarkdown7.8 KB
references/thinking-framework.mdmarkdown9.3 KB
requirements.txtmanifest1.5 KB
runtime-plugin.jsonconfig1.5 KB
schema/templates.jsonconfig9.4 KB
scripts/agent_ux_check.pyscript8.2 KB
scripts/analyze_visual.pyexecutablescript7.2 KB
scripts/backlinks_auth.pyscript16.1 KB
scripts/bing_webmaster.pyscript21.8 KB
scripts/capture_screenshot.pyexecutablescript6.4 KB
scripts/commoncrawl_graph.pyscript15.6 KB
scripts/consistency_check.pyscript12.5 KB
scripts/content_humanize.pyscript7.2 KB
scripts/content_quality.pyscript9.7 KB
scripts/content_verify.pyscript7.1 KB
scripts/crux_history.pyscript10.7 KB
scripts/dataforseo_costs.pyscript15.8 KB
scripts/dataforseo_merchant.pyexecutablescript16.7 KB
scripts/dataforseo_normalize.pyexecutablescript14.7 KB
scripts/domain_history.pyscript9.6 KB
scripts/drift_baseline.pyscript13.5 KB
scripts/drift_compare.pyscript22.3 KB
scripts/drift_history.pyscript3.4 KB
scripts/drift_report.pyscript11.0 KB
scripts/fetch_page.pyexecutablescript9.4 KB
scripts/ga4_report.pyscript16.8 KB
scripts/gbp_deprecation_lint.pyexecutablescript4.7 KB
scripts/google_auth.pyscript31.0 KB
scripts/google_report.pyscript97.6 KB
scripts/gsc_inspect.pyscript11.0 KB
scripts/gsc_query.pyscript18.6 KB
scripts/indexing_notify.pyscript10.3 KB
scripts/indexnow_submit.pyscript8.8 KB
scripts/iptc_ai_label.pyscript7.6 KB
scripts/keyword_planner.pyscript10.8 KB
scripts/lcp_subparts.pyscript7.2 KB
scripts/moz_api.pyscript14.7 KB
scripts/nlp_analyze.pyscript12.1 KB
scripts/pagespeed_check.pyscript22.9 KB
scripts/parasite_risk.pyexecutablescript8.6 KB
scripts/parse_html.pyexecutablescript8.8 KB
scripts/portability_check.pyscript7.8 KB
scripts/preload_check.pyscript8.1 KB
scripts/release_sign.pyscript5.6 KB
scripts/render_page.pyscript20.9 KB
scripts/runtime.pyexecutablescript15.1 KB
scripts/schema_ecommerce_validate.pyscript11.8 KB
scripts/schema_generate.pyscript12.0 KB
scripts/seo_updates.pyscript4.8 KB
scripts/sitemap_discovery.pyscript10.0 KB
scripts/sync_flow.pyscript11.9 KB
scripts/ucp_check.pyscript8.4 KB
scripts/unlighthouse_run.pyscript5.6 KB
scripts/url_safety.pyscript22.0 KB
scripts/validate_backlink_report.pyscript11.7 KB
scripts/verify_backlinks.pyscript12.9 KB
scripts/verify_release.pyscript4.8 KB
scripts/youtube_search.pyscript12.3 KB

scripts/parasite_risk.py

View on GitHub
#!/usr/bin/env python3
"""
Parasite-SEO risk scanner.

Per Google's 2024-11-19 policy clarification, "no amount of first-party
involvement alters the third-party nature" of a section. Section-level
risk is now a Critical finding to surface in any audit of an established
editorial domain.

This scanner crawls a small set of representative URLs on a site,
classifies each into a content "topic", and flags subfolders where
the topic diverges from the site's primary corpus. Three signals:

  1. **Third-party authorship density** — bylines containing words like
     "Partner Content", "Sponsored", "Advertising", "Brand Studio".
  2. **Commercial-intent skew vs. site primary corpus** — affiliate
     code in outbound links, "Buy now" CTAs, price comparison tables,
     coupons.
  3. **Topical drift between subfolders** — root corpus is editorial
     but a single subfolder reads as pure commerce.

The output is **advisory**: the scanner cannot determine the actual
contractual relationship between the site and the content producer.
But it identifies the patterns Google's policy targets so the
audit user can investigate.

Inputs
======
A list of URLs from one host. Typically obtained by sampling
sitemaps or running `seo-sitemap`'s URL extractor.

Output
======
Per-subfolder risk: high/medium/low/unknown plus the contributing
signals. The script does not score the whole site — section-level
risk is the operational unit (per Google's policy).
"""

from __future__ import annotations

import argparse
import json
import os
import re
import sys
from collections import Counter, defaultdict
from typing import Iterable
from urllib.parse import urlparse

_SCRIPTS_DIR = os.path.dirname(os.path.abspath(__file__))
if _SCRIPTS_DIR not in sys.path:
    sys.path.insert(0, _SCRIPTS_DIR)
from url_safety import URLSafetyError, safe_requests_get  # noqa: E402


# Indicators of third-party authored content. Each adds 1 hit per page.
_THIRD_PARTY_BYLINE_PATTERNS = (
    r"\bPartner\s+Content\b",
    r"\bSponsored\s+Content\b",
    r"\bSponsored\s+by\b",
    r"\bBrand\s+Studio\b",
    r"\bIn\s+Partnership\s+With\b",
    r"\bAdvertisement\b",
    r"\bAdvertorial\b",
    r"\bPaid\s+Post\b",
    r"\bPromoted\b",
    r"\bPaid\s+Content\b",
)
_THIRD_PARTY_RE = re.compile("|".join(_THIRD_PARTY_BYLINE_PATTERNS), re.IGNORECASE)


# Commercial-intent signals. Each adds 1 hit per page.
_COMMERCE_PATTERNS = (
    r"\bBuy\s+Now\b",
    r"\bShop\s+Now\b",
    r"\bAdd\s+to\s+Cart\b",
    r"\bCompare\s+Prices\b",
    r"\bBest\s+\w+\s+Deals?\b",
    r"\bPromo\s+Code\b",
    r"\bCoupon\b",
    r"\bDiscount\s+Code\b",
    r"\bAffiliate\s+Disclosure\b",
)
_COMMERCE_RE = re.compile("|".join(_COMMERCE_PATTERNS), re.IGNORECASE)


# Outbound affiliate-link signatures. Each adds 1 hit per outbound link.
_AFFILIATE_LINK_RE = re.compile(
    r"\b(?:tag=|aff_id=|affid=|partnerid=|ref_=|utm_source=|utm_campaign=)",
    re.IGNORECASE,
)


def _subfolder(url: str) -> str:
    """Return the first path segment of a URL as the section key."""
    path = urlparse(url).path or "/"
    parts = [p for p in path.split("/") if p]
    return f"/{parts[0]}/" if parts else "/"


def _audit_page(url: str, html: str) -> dict:
    third_party_hits = len(_THIRD_PARTY_RE.findall(html))
    commerce_hits = len(_COMMERCE_RE.findall(html))
    affiliate_link_hits = len(_AFFILIATE_LINK_RE.findall(html))
    return {
        "url": url,
        "third_party_hits": third_party_hits,
        "commerce_hits": commerce_hits,
        "affiliate_link_hits": affiliate_link_hits,
    }


def _classify(rows: list[dict]) -> dict:
    """Aggregate signals per subfolder and emit a risk label."""
    by_section: dict[str, list[dict]] = defaultdict(list)
    for row in rows:
        by_section[_subfolder(row["url"])].append(row)

    report: dict[str, dict] = {}
    for section, pages in by_section.items():
        n = len(pages)
        third_party_rate = sum(p["third_party_hits"] for p in pages) / n
        commerce_rate = sum(p["commerce_hits"] for p in pages) / n
        affiliate_rate = sum(p["affiliate_link_hits"] for p in pages) / n

        flags: list[str] = []
        risk = "low"

        if third_party_rate >= 1.0:
            flags.append("third-party-authorship-density")
        if commerce_rate >= 2.0:
            flags.append("commercial-intent-skew")
        if affiliate_rate >= 3.0:
            flags.append("affiliate-density")

        if "third-party-authorship-density" in flags:
            risk = "high"
        elif "commercial-intent-skew" in flags and "affiliate-density" in flags:
            risk = "high"
        elif flags:
            risk = "medium"

        report[section] = {
            "page_count": n,
            "third_party_hits_per_page": round(third_party_rate, 2),
            "commerce_hits_per_page": round(commerce_rate, 2),
            "affiliate_link_hits_per_page": round(affiliate_rate, 2),
            "flags": flags,
            "risk": risk,
            "sample_urls": [p["url"] for p in pages[:3]],
        }

    # Cross-section drift: if one section has > 2x the *mean* commerce
    # rate of the site, flag it as drift even when its own absolute
    # threshold is below. Mean is more useful than median for the
    # common "1 outlier section, N quiet sections" pattern. The
    # absolute threshold above still catches sections that are bad on
    # their own merits.
    rates = [v["commerce_hits_per_page"] for v in report.values() if v["page_count"] > 0]
    if rates:
        mean_rate = sum(rates) / len(rates)
        for section, row in report.items():
            if mean_rate > 0 and row["commerce_hits_per_page"] > 2 * mean_rate:
                if "commercial-intent-drift" not in row["flags"]:
                    row["flags"].append("commercial-intent-drift")
                if row["risk"] == "low":
                    row["risk"] = "medium"

    return report


def scan(urls: Iterable[str], *, timeout: int = 20) -> dict:
    rows: list[dict] = []
    errors: list[dict] = []
    for url in urls:
        try:
            resp = safe_requests_get(url, timeout=timeout, allow_redirects=True)
            rows.append(_audit_page(resp.url, resp.text))
        except URLSafetyError as exc:
            errors.append({"url": url, "error": f"url_safety: {exc}"})
        except Exception as exc:  # noqa: BLE001 — surface every transport error
            errors.append({"url": url, "error": str(exc)})

    sections = _classify(rows)
    severities = Counter(v["risk"] for v in sections.values())
    overall_risk = "high" if severities.get("high", 0) > 0 else (
        "medium" if severities.get("medium", 0) > 0 else "low"
    )

    return {
        "pages_audited": len(rows),
        "errors": errors,
        "by_section": sections,
        "summary": dict(severities),
        "overall_risk": overall_risk,
    }


def main() -> int:
    parser = argparse.ArgumentParser(
        description="Parasite-SEO risk scanner (Google site-reputation policy)."
    )
    parser.add_argument(
        "urls", nargs="*",
        help="URLs to audit. Mix freely with --urls-file.",
    )
    parser.add_argument(
        "--urls-file",
        help="Path to a file with one URL per line.",
    )
    parser.add_argument("--json", action="store_true")
    args = parser.parse_args()

    targets: list[str] = list(args.urls)
    if args.urls_file:
        from pathlib import Path
        for line in Path(args.urls_file).read_text(encoding="utf-8").splitlines():
            line = line.strip()
            if line and not line.startswith("#"):
                targets.append(line)

    if not targets:
        print("Error: pass URLs via positional args or --urls-file.",
              file=sys.stderr)
        return 2

    result = scan(targets)

    if args.json:
        json.dump(result, sys.stdout, indent=2)
        sys.stdout.write("\n")
    else:
        print(f"Overall risk: {result['overall_risk']}")
        print(f"Pages audited: {result['pages_audited']}")
        if result["errors"]:
            print(f"Errors:        {len(result['errors'])}")
        print()
        for section, row in result["by_section"].items():
            print(f"  Section {section}  ({row['page_count']} pages)  "
                  f"risk={row['risk']}")
            print(f"    third-party/page: {row['third_party_hits_per_page']}")
            print(f"    commerce/page:    {row['commerce_hits_per_page']}")
            print(f"    affiliate/page:   {row['affiliate_link_hits_per_page']}")
            if row["flags"]:
                print(f"    flags:            {', '.join(row['flags'])}")

    return 0 if result["overall_risk"] != "high" else 1


if __name__ == "__main__":
    sys.exit(main())
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