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/agent_ux_check.py

View on GitHub
#!/usr/bin/env python3
"""
Agent-friendly page auditor.

Scores a page against the checklist in
``skills/seo-technical/references/agent-friendly-pages.md`` — the
web.dev-sourced criteria Google's AI optimization guide references for
agent UX. Findings cover the three channels agents use:

1. Accessibility-tree quality (the cleanest signal)
2. Raw HTML semantics (real ``<button>`` / ``<a>`` vs ``<div onclick>``)
3. Layout / interactive-element sizing

Audit posture
=============
Findings are surfaced as **opportunities**, not failures. The scoring
exists to give the audit a quantitative axis without making it a hard
SEO gate.

NOTE: this score is a local 0-100 heuristic and is **distinct** from
Google's Lighthouse "Agentic Browsing" category, which reports a
**fractional pass-ratio (X of N), not a 0-100 score** (Chrome 150+).
Do not present this heuristic as the official Lighthouse agentic score.
See ``skills/seo-technical/references/agent-friendly-pages.md``.

Implementation
==============
Calls ``render_page.render_page`` with ``extract_accessibility=True``
to get both the rendered HTML and the Playwright accessibility-tree
snapshot. Then walks both for the checklist items.

CLI
===
    python agent_ux_check.py https://example.com
    python agent_ux_check.py https://example.com --json
"""

from __future__ import annotations

import argparse
import json
import os
import re
import sys
from typing import Optional

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


_ONCLICK_DIV_RE = re.compile(
    r"<div\b[^>]*\bonclick\s*=\s*[\"'][^\"']+[\"']", re.IGNORECASE
)
_INPUT_WITHOUT_LABEL_RE = re.compile(
    r"<input\b(?![^>]*\baria-label\s*=)(?![^>]*\baria-labelledby\s*=)[^>]*>",
    re.IGNORECASE,
)
_LABEL_FOR_RE = re.compile(r'<label\b[^>]*\bfor\s*=\s*[\"\']([^\"\']+)[\"\']', re.IGNORECASE)
_INPUT_ID_RE = re.compile(r'<input\b[^>]*\bid\s*=\s*[\"\']([^\"\']+)[\"\']', re.IGNORECASE)
_BUTTON_RE = re.compile(r"<button\b", re.IGNORECASE)
_ANCHOR_HREF_RE = re.compile(r"<a\b[^>]*\bhref\s*=", re.IGNORECASE)
_SEMANTIC_LANDMARK_RE = re.compile(
    r"<(?:nav|main|article|section|aside|header|footer)\b", re.IGNORECASE
)


def _walk_tree(node: Optional[dict]):
    """Yield every node in a Playwright accessibility snapshot."""
    if not node:
        return
    yield node
    for child in node.get("children") or []:
        yield from _walk_tree(child)


def analyze_html(html: str) -> dict:
    """Walk raw rendered HTML for the agent-UX checklist."""
    findings: dict = {
        "real_buttons": len(_BUTTON_RE.findall(html)),
        "real_anchors": len(_ANCHOR_HREF_RE.findall(html)),
        "div_onclick_widgets": len(_ONCLICK_DIV_RE.findall(html)),
        "semantic_landmarks": len(_SEMANTIC_LANDMARK_RE.findall(html)),
        "inputs_without_aria": 0,
        "inputs_without_label": 0,
    }

    # Inputs without ARIA labels — first cut, then check label[for] coverage.
    aria_less = _INPUT_WITHOUT_LABEL_RE.findall(html)
    findings["inputs_without_aria"] = len(aria_less)

    label_targets = set(_LABEL_FOR_RE.findall(html))
    input_ids = _INPUT_ID_RE.findall(html)
    unlabeled = [iid for iid in input_ids if iid not in label_targets]
    findings["inputs_without_label"] = len(unlabeled)

    return findings


def analyze_accessibility_tree(tree: Optional[dict]) -> dict:
    """Walk a Playwright accessibility snapshot for the checklist items."""
    findings: dict = {
        "tree_present": tree is not None,
        "total_nodes": 0,
        "interactive_nodes": 0,
        "role_button": 0,
        "role_link": 0,
        "role_generic": 0,
        "unnamed_interactive": 0,
    }
    if tree is None:
        return findings
    interactive_roles = {"button", "link", "textbox", "checkbox", "radio",
                          "combobox", "menuitem", "tab"}
    for node in _walk_tree(tree):
        findings["total_nodes"] += 1
        role = (node.get("role") or "").lower()
        name = (node.get("name") or "").strip()
        if role == "button":
            findings["role_button"] += 1
        elif role == "link":
            findings["role_link"] += 1
        elif role == "generic":
            findings["role_generic"] += 1
        if role in interactive_roles:
            findings["interactive_nodes"] += 1
            if not name:
                findings["unnamed_interactive"] += 1
    return findings


def score(html_findings: dict, a11y_findings: dict) -> dict:
    """Combine HTML + a11y-tree findings into a 0-100 agent-UX score."""
    score = 100
    issues: list[str] = []

    if html_findings["div_onclick_widgets"] > 0:
        deduction = min(20, html_findings["div_onclick_widgets"] * 5)
        score -= deduction
        issues.append(
            f"{html_findings['div_onclick_widgets']} div onclick widget(s) "
            f"(-{deduction})"
        )
    if html_findings["semantic_landmarks"] == 0:
        score -= 10
        issues.append("no semantic landmarks (nav/main/article/...) (-10)")
    if html_findings["inputs_without_label"] > 0:
        deduction = min(20, html_findings["inputs_without_label"] * 4)
        score -= deduction
        issues.append(
            f"{html_findings['inputs_without_label']} input(s) without label[for] "
            f"(-{deduction})"
        )

    if a11y_findings["tree_present"]:
        if a11y_findings["unnamed_interactive"] > 0:
            deduction = min(20, a11y_findings["unnamed_interactive"] * 3)
            score -= deduction
            issues.append(
                f"{a11y_findings['unnamed_interactive']} interactive node(s) "
                f"without accessible name (-{deduction})"
            )
        # A high role=generic ratio suggests broken semantics (lots of divs).
        total = a11y_findings["total_nodes"] or 1
        generic_ratio = a11y_findings["role_generic"] / total
        if generic_ratio > 0.5:
            score -= 10
            issues.append(
                f"role=generic dominates the a11y tree "
                f"({generic_ratio:.0%}) (-10)"
            )

    return {"score": max(0, score), "issues": issues}


def audit(url: str, *, timeout_ms: int = 15000) -> dict:
    """Audit a URL for agent-friendliness. Forces rendered mode."""
    page = render_page(
        url,
        mode="always",
        timeout_ms=timeout_ms,
        extract_content=False,
        extract_accessibility=True,  # type: ignore[call-arg]
    )
    report: dict = {
        "url": page.get("url"),
        "status_code": page.get("status_code"),
        "render_error": page.get("error"),
        "html_findings": {},
        "a11y_findings": {},
        "score": None,
        "issues": [],
    }
    if page.get("error"):
        return report
    html = page.get("content") or ""
    a11y = page.get("accessibility_tree")

    report["html_findings"] = analyze_html(html)
    report["a11y_findings"] = analyze_accessibility_tree(a11y)
    scored = score(report["html_findings"], report["a11y_findings"])
    report["score"] = scored["score"]
    report["issues"] = scored["issues"]
    return report


def _cli() -> None:
    parser = argparse.ArgumentParser(
        description="Agent-friendly page auditor (semantic HTML + a11y tree)"
    )
    parser.add_argument("url")
    parser.add_argument("--timeout-ms", type=int, default=15000)
    parser.add_argument("--json", action="store_true")
    args = parser.parse_args()

    report = audit(args.url, timeout_ms=args.timeout_ms)
    if args.json:
        print(json.dumps(report, indent=2))
        sys.exit(0 if report["score"] is not None else 1)

    if report["render_error"]:
        print(f"Render error: {report['render_error']}", file=sys.stderr)
        sys.exit(1)

    print(f"URL: {report['url']}")
    print(f"Status: {report['status_code']}")
    print(f"Agent-UX score: {report['score']}/100")
    if report["issues"]:
        print("Issues:")
        for issue in report["issues"]:
            print(f"  - {issue}")
    print("\nHTML findings:")
    for k, v in report["html_findings"].items():
        print(f"  {k}: {v}")
    print("\nA11y tree findings:")
    for k, v in report["a11y_findings"].items():
        print(f"  {k}: {v}")


if __name__ == "__main__":
    _cli()
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