Skip to content

Universal SEO skill for Claude Code. 26 sub-skills + 19 sub-agents covering technical SEO, E-E-A-T, schema, GEO/AEO, agent readiness (Lighthouse Agentic Browsing, WebMCP, llms.txt), backlinks, local SEO, e-commerce, international SEO, Google APIs, and PDF/Excel reporting. 9 optional extensions for live SEO data.

feat: Phase J + K + audit cleanup on top of v2.0.0

Daniel6778786c2ef8
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2c82a74..f21df66 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -54,7 +54,6 @@ jobs:
python3 -m py_compile scripts/drift_report.py
python3 -m py_compile scripts/drift_history.py
python3 -m py_compile scripts/sync_flow.py
- python3 -m py_compile scripts/release_report.py
python3 -m py_compile scripts/release_sign.py
python3 -m py_compile scripts/verify_release.py
python3 -m py_compile scripts/content_quality.py
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39c3ddf..5b63571 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,67 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [2.0.0] - 2026-05-17
+
+v2 is backward-compatible by design — every v1.x command, script signature, and skill entry point still works. The release lands a hardened SSRF + DNS-rebinding safety layer, shared headless rendering across every fetcher, QRG-aligned content gates, four new Schema.org generators, five new MCP extensions, and multi-platform portability. Full narrative in [`docs/MIGRATION-v1-to-v2.md`](docs/MIGRATION-v1-to-v2.md).
+
+### Highlights
+
+- 248 tests (6.4× the v1.9.9 baseline of 39), every known SSRF bypass class closed at parse time.
+- 5 new MCP extensions: Ahrefs, SE Ranking, Profound, Bing Webmaster, Unlighthouse.
+- 4 new Schema.org generators: Reservation, OrderAction (potentialAction), DiscussionForumPosting, ProfilePage.
+- Multi-platform portability for Codex CLI, Cline, Aider (alongside existing Cursor + Antigravity).
+
+### Added
+
+- **Foundation:** `scripts/url_safety.py` (canonical SSRF + DNS-rebinding module, 83 test cases), `scripts/render_page.py` (shared Playwright Chromium renderer with `--mode auto` SPA detection, trafilatura extraction, htmldate publication-date extraction, 27 test cases). 8 fetcher subagents (seo-technical, seo-content, seo-schema, seo-geo, seo-local, seo-ecommerce, seo-backlinks, seo-sxo) now route through `render_page`.
+- **Content quality:** `content_quality.py` (QRG filler / AI-pattern / information-density scorer), `content_humanize.py` (40+ deterministic AI-phrasing replacements), `content_verify.py` (claim extraction + citation-gap detection), `domain_history.py` (WHOIS-driven expired-domain abuse check), `seo_updates.py` + `data/google-updates.json` (18 primary-source-verified Google updates, 1 documented-unverified gap-analysis claim).
+- **Technical depth:** `preload_check.py` (Speculation Rules + bfcache + prerender + LCP preload audit), `indexnow_submit.py` (Bing/Yandex/Seznam/Naver IndexNow submitter), `lcp_subparts.py` (LCP decomposition via CrUX), `unlighthouse_run.py` (multi-page Lighthouse via Unlighthouse CLI).
+- **Schema completeness:** `schema_generate.py` (`reservation`, `order`, `discussion`, `profile` subcommands), `schema_ecommerce_validate.py` (Product schema policy validator: `hasMerchantReturnPolicy`, `shippingDetails`, `MemberProgram`, EU `energyEfficiencyClass`, `ProductGroup`), reference doc `skills/seo-schema/references/deprecated-types-2024-2026.md`.
+- **AI search:** `parasite_risk.py` (site-reputation-abuse risk scanner per Nov 2024 Google policy), `skills/seo-geo/references/llmstxt-evidence.md` (evidence-based reframe of llms.txt as dev-tooling, not citation lever).
+- **Local + international + privacy:** `gbp_deprecation_lint.py` (retired GBP chat / `.business.site` / Q&A detector), `skills/seo-google/references/dma-consent-mode-v2.md` (EU CTR diagnostic + softened cookieless framing), `skills/seo-hreflang/references/machine-translation-qa.md` (untranslated-MT detection per Jan 2025 QRG §4.6.5).
+- **Portability:** `portability_check.py` (cross-platform SKILL.md frontmatter lint), AGENTS.md tool-name compatibility table for Codex CLI, Cline, Aider.
+- **Release signing:** `release_sign.py` (SHA-256 manifest of every git-tracked file), `verify_release.py` (verify a checkout against a signed manifest).
+- **Governance:** `.github/CODEOWNERS`, `.github/dependabot.yml` extended with npm ecosystem, `.github/workflows/v2.yml` (workflow_dispatch only), `SECURITY.md` uplift (threat model, 90-day coordinated disclosure timeline, residual risks).
+
+### Changed
+
+- `scripts/google_auth.py:validate_url` now delegates to `url_safety.validate_url`. Strict variant available as `url_safety.validate_url_strict`.
+- `scripts/fetch_page.py` exposes `--render {auto,always,never}`. Default `auto` runs raw fetch then renders if SPA signals detected; `always` forces Playwright; `never` preserves v1 behaviour.
+- `scripts/capture_screenshot.py` uses `url_safety.make_safe_playwright_route_handler` as defense-in-depth against subresource SSRF (data: allowed, private resolutions aborted, AF_UNSPEC IPv6-aware).
+- OAuth token files are now written with `os.open(path, O_WRONLY|O_CREAT|O_TRUNC, 0o600)` + explicit `os.fchmod(fd, 0o600)`. Legacy `0o644` files are remediated in place on next `_load_oauth_token`.
+- `plugin.json` / `marketplace.json` / `pyproject.toml` / `CITATION.cff` / `install.sh` / `install.ps1` / 32 SKILL.md files: version bumped to `2.0.0`. The 13-assertion manifest test (`tests/test_manifest_consistency.py`) gates this.
+
+### Fixed
+
+- **HIGH — DNS rebinding via redirect target.** `_pin_dns` previously intercepted only the originally-pinned hostname; redirect targets fell through to the unpatched resolver. Patched `socket.getaddrinfo` now validates every resolution while pinned. Closed in `a601268`.
+- **HIGH — Obfuscated IPv4 bypass in `validate_url`.** Decimal (`2130706433`), hex (`0x7f000001`), octal (`017700000001`), leading-zero (`127.0.0.001`, `0177.0.0.1`), and mixed-radix (`0x7f.0.0.1`) forms all returned safe. New `normalize_hostname()` canonicalizes via `socket.inet_aton`. Closed in `3c595c2`.
+- **HIGH — FQDN trailing-dot bypass.** `metadata.google.internal.` (single trailing dot) bypassed the exact-string blocklist. `normalize_hostname` now strips a single trailing dot. Closed in `3c595c2`.
+- **MEDIUM — IPv6 blind spot in Playwright route handler.** Resolver queried only `AF_INET`. Now uses `AF_UNSPEC` to catch dual-stack subresources whose AAAA record points at a private range. Closed in `3c595c2`.
+- **LOW — OAuth file-permission TOCTOU.** `os.open`'s mode argument is ignored if the file pre-existed. Explicit `os.fchmod(fd, 0o600)` on the open fd closes the race. Closed in `3c595c2`.
+
+### Breaking
+
+Two intentional behavioural breaks; full mitigation guidance in `docs/MIGRATION-v1-to-v2.md`.
+
+1. `scripts/backlinks_auth.py` no longer ships a silent SSRF-disabled fallback. If `url_safety` cannot be imported, the module raises `RuntimeError` at import time.
+2. `seo-schema` flags six retired rich-result types as **Critical** findings (`Vehicle`, `ClaimReview`, `EstimatedSalary`, `LearningVideo`, `SpecialAnnouncement`, `CourseInfo` carousel). Replacements documented in `skills/seo-schema/references/deprecated-types-2024-2026.md`.
+
+### Test coverage delta
+
+| Suite | v1.9.9 | v2.0.0 |
+|---|---:|---:|
+| Pre-existing (manifest + lazy + sync FLOW) | 39 | 39 |
+| `url_safety` (new) | — | 83 |
+| `render_page` (new) | — | 27 |
+| Content quality (new) | — | 25 |
+| Technical depth (new) | — | 17 |
+| Schema v2 (new) | — | 17 |
+| Parasite risk + extensions (new) | — | 22 |
+| GBP lint + polish (new) | — | 8 |
+| Portability (new) | — | 10 |
+| **Total** | **39** | **248** |
+
## [1.9.9] - 2026-05-11
Final 1.x patch release. v2 is in design; this release leaves the v1.x
diff --git a/data/google-updates.json b/data/google-updates.json
index 2003952..de6b45e 100644
--- a/data/google-updates.json
+++ b/data/google-updates.json
@@ -8,6 +8,22 @@
],
"last_verified": "2026-05-17",
"policy": "Every entry must cite a Google-owned URL. Third-party-only claims belong in unverified[]. Bump last_verified each time an entry is added or revised.",
+ "_schema_doc": {
+ "updates[]": {
+ "date": "ISO date YYYY-MM-DD (Google's announcement date).",
+ "name": "Short human-readable title.",
+ "kind": "One of: core | spam | core+spam | policy | qrg | product | schema | cwv.",
+ "source": "Required. Must resolve to a Google-owned domain (developers.google.com, web.dev, chrome.com, blog.google, support.google.com).",
+ "notes": "Optional. One-line summary of practitioner impact."
+ },
+ "unverified[]": {
+ "date": "ISO date or YYYY-MM-xx if exact date unconfirmed.",
+ "claim": "What third-party trackers reported.",
+ "third_party_sources": "Array of source URLs that originated the claim.",
+ "primary_source_check": "URL of the Google-owned page that would confirm or refute.",
+ "status": "Explicit recommendation. Audit scripts MUST NOT encode unverified claims until promoted to updates[]."
+ }
+ },
"updates": [
{
"date": "2024-03-05",
diff --git a/docs/MIGRATION-v1-to-v2.md b/docs/MIGRATION-v1-to-v2.md
index 6e4eed7..2a0765c 100644
--- a/docs/MIGRATION-v1-to-v2.md
+++ b/docs/MIGRATION-v1-to-v2.md
@@ -183,15 +183,15 @@ to `0o600` — no user action required.
| Manifest consistency | 13 | 13 |
| Lazy detection | 11 | 11 |
| Sync FLOW | 15 | 15 |
-| **`url_safety` (new)** | — | **52** |
+| **`url_safety` (new)** | — | **83** |
| **`render_page` (new)** | — | **27** |
| **Content quality (new)** | — | **25** |
| **Technical depth (new)** | — | **17** |
| **Schema v2 (new)** | — | **17** |
-| **Parasite risk + extensions (new)** | — | **21** |
+| **Parasite risk + extensions (new)** | — | **22** |
| **GBP lint + polish (new)** | — | **8** |
| **Portability (new)** | — | **10** |
-| **Total** | **39** | **247** |
+| **Total** | **39** | **248** |
-v2 adds 208 new test cases (5.3× the v1 baseline) covering every new
+v2 adds 209 new test cases (5.4× the v1 baseline) covering every new
function's failure modes plus every known SSRF bypass class.
diff --git a/extensions/firecrawl/install.sh b/extensions/firecrawl/install.sh
old mode 100644
new mode 100755
diff --git a/extensions/firecrawl/uninstall.sh b/extensions/firecrawl/uninstall.sh
old mode 100644
new mode 100755
diff --git a/scripts/agent_ux_check.py b/scripts/agent_ux_check.py
new file mode 100644
index 0000000..f92aed3
--- /dev/null
+++ b/scripts/agent_ux_check.py
@@ -0,0 +1,236 @@
+#!/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
+=============
+Per the reference doc, agent-UX standards (WebMCP) are early. Findings
+are surfaced as **opportunities**, not failures. The scoring exists to
+give the audit a quantitative axis without making it a hard SEO gate.
+
+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()
diff --git a/scripts/iptc_ai_label.py b/scripts/iptc_ai_label.py
new file mode 100644
index 0000000..e3ae6c2
--- /dev/null
+++ b/scripts/iptc_ai_label.py
@@ -0,0 +1,221 @@
+#!/usr/bin/env python3
+"""
+IPTC ``DigitalSourceType`` audit + injection for AI-generated images.
+
+Google Merchant Center requires AI-generated product images to carry
+the IPTC ``DigitalSourceType: TrainedAlgorithmicMedia`` label. This
+script wraps ``exiftool`` to (a) audit a file or directory for the
+label, and (b) inject the label where missing.
+
+Why a script and not just docs
+==============================
+``skills/seo-images/SKILL.md`` documents the exiftool one-liner, but
+audits should not depend on operators remembering to run it by hand.
+This wrapper exposes audit + inject as commands that integrate with
+the rest of claude-seo's CLI pattern and can be invoked from the
+seo-images skill or an agent loop.
+
+IPTC vocabulary
+===============
+- ``trainedAlgorithmicMedia`` fully AI-generated (diffusion-model
+ product imagery, AI-generated marketing photos)
+- ``compositeSynthetic`` captured + AI-generated mix
+- ``digitalCapture`` fully captured photo, no AI element
+
+CLI
+===
+ python iptc_ai_label.py audit ./images/
+ python iptc_ai_label.py audit ./hero.webp
+ python iptc_ai_label.py inject ./ai-hero.webp --source-type trainedAlgorithmicMedia
+ python iptc_ai_label.py audit ./images/ --json
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import os
+import shutil
+import subprocess
+import sys
+from pathlib import Path
+from typing import Iterable, Optional
+
+IPTC_VOCAB = {
+ "trainedAlgorithmicMedia": "https://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia",
+ "compositeSynthetic": "https://cv.iptc.org/newscodes/digitalsourcetype/compositeSynthetic",
+ "digitalCapture": "https://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture",
+ "negativeFilm": "https://cv.iptc.org/newscodes/digitalsourcetype/negativeFilm",
+ "positiveFilm": "https://cv.iptc.org/newscodes/digitalsourcetype/positiveFilm",
+}
+
+IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".webp", ".tif", ".tiff"}
+
+
+def exiftool_available() -> bool:
+ """Return True iff ``exiftool`` is on PATH."""
+ return shutil.which("exiftool") is not None
+
+
+def _iter_images(target: Path) -> Iterable[Path]:
+ if target.is_file():
+ if target.suffix.lower() in IMAGE_EXTENSIONS:
+ yield target
+ return
+ if target.is_dir():
+ for path in sorted(target.rglob("*")):
+ if path.is_file() and path.suffix.lower() in IMAGE_EXTENSIONS:
+ yield path
+
+
+def _read_source_type(image: Path) -> Optional[str]:
+ """Read XMP-iptcExt:DigitalSourceType from a single image. None if missing."""
+ if not exiftool_available():
+ raise RuntimeError("exiftool not installed; install via apt/brew")
+ try:
+ result = subprocess.run(
+ [
+ "exiftool",
+ "-XMP-iptcExt:DigitalSourceType",
+ "-s3", # value-only
+ str(image),
+ ],
+ capture_output=True,
+ text=True,
+ timeout=15,
+ )
+ except subprocess.TimeoutExpired:
+ return None
+ value = result.stdout.strip()
+ return value or None
+
+
+def audit(target: Path) -> dict:
+ """Audit a file or directory. Returns a JSON-serializable summary."""
+ report: dict = {
+ "target": str(target),
+ "exiftool_available": exiftool_available(),
+ "images": [],
+ "summary": {},
+ }
+ if not target.exists():
+ report["summary"] = {"error": "target-not-found"}
+ return report
+ if not report["exiftool_available"]:
+ report["summary"] = {"error": "exiftool-not-installed"}
+ return report
+
+ counts: dict[str, int] = {"missing": 0, "trainedAlgorithmicMedia": 0,
+ "compositeSynthetic": 0, "digitalCapture": 0,
+ "other": 0}
+ for image in _iter_images(target):
+ value = _read_source_type(image)
+ if value is None:
+ label = "missing"
+ else:
+ # Vocabulary values are returned either as bare names or as
+ # the full IPTC URI; normalise to the bare name.
+ short = value.rsplit("/", 1)[-1]
+ if short in counts:
+ label = short
+ else:
+ label = "other"
+ counts[label] += 1
+ report["images"].append({
+ "path": str(image),
+ "source_type": value,
+ "label": label,
+ })
+
+ report["summary"] = counts
+ report["summary"]["total"] = sum(counts.values())
+ return report
+
+
+def inject(image: Path, source_type: str) -> dict:
+ """Inject XMP-iptcExt:DigitalSourceType into a single image."""
+ out: dict = {"image": str(image), "source_type": source_type, "ok": False, "error": None}
+ if source_type not in IPTC_VOCAB:
+ out["error"] = (
+ f"unknown source_type {source_type!r}; "
+ f"valid: {sorted(IPTC_VOCAB)}"
+ )
+ return out
+ if not exiftool_available():
+ out["error"] = "exiftool-not-installed"
+ return out
+ if not image.exists():
+ out["error"] = "image-not-found"
+ return out
+ uri = IPTC_VOCAB[source_type]
+ try:
+ result = subprocess.run(
+ [
+ "exiftool",
+ f"-XMP-iptcExt:DigitalSourceType={uri}",
+ "-overwrite_original",
+ str(image),
+ ],
+ capture_output=True,
+ text=True,
+ timeout=30,
+ )
+ except subprocess.TimeoutExpired:
+ out["error"] = "exiftool-timeout"
+ return out
+ if result.returncode != 0:
+ out["error"] = result.stderr.strip() or "exiftool-failed"
+ return out
+ out["ok"] = True
+ return out
+
+
+def _cli() -> None:
+ parser = argparse.ArgumentParser(
+ description="IPTC DigitalSourceType audit + inject (Merchant Center policy)"
+ )
+ sub = parser.add_subparsers(dest="command", required=True)
+
+ p_audit = sub.add_parser("audit", help="Audit file or directory for the IPTC label")
+ p_audit.add_argument("target")
+ p_audit.add_argument("--json", action="store_true")
+
+ p_inject = sub.add_parser("inject", help="Inject DigitalSourceType into an image")
+ p_inject.add_argument("image")
+ p_inject.add_argument(
+ "--source-type",
+ default="trainedAlgorithmicMedia",
+ choices=sorted(IPTC_VOCAB),
+ )
+ p_inject.add_argument("--json", action="store_true")
+
+ args = parser.parse_args()
+
+ if args.command == "audit":
+ report = audit(Path(args.target))
+ if args.json:
+ print(json.dumps(report, indent=2))
+ sys.exit(0 if "error" not in report["summary"] else 2)
+ print(f"Target: {report['target']}")
+ if "error" in report["summary"]:
+ print(f"Error: {report['summary']['error']}", file=sys.stderr)
+ sys.exit(2)
+ print(f"Total images: {report['summary'].get('total')}")
+ for label in ("missing", "trainedAlgorithmicMedia", "compositeSynthetic",
+ "digitalCapture", "other"):
+ print(f" {label}: {report['summary'].get(label, 0)}")
+ sys.exit(0)
+ elif args.command == "inject":
+ out = inject(Path(args.image), args.source_type)
+ if args.json:
+ print(json.dumps(out, indent=2))
+ sys.exit(0 if out["ok"] else 2)
+ if out["ok"]:
+ print(f"Injected {args.source_type} into {args.image}")
+ sys.exit(0)
+ print(f"Error: {out['error']}", file=sys.stderr)
+ sys.exit(2)
+
+
+if __name__ == "__main__":
+ _cli()
diff --git a/scripts/release_report.py b/scripts/release_report.py
deleted file mode 100644
index 7bf9732..0000000
--- a/scripts/release_report.py
+++ /dev/null
@@ -1,1171 +0,0 @@
-#!/usr/bin/env python3
-"""
-release_report.py — Claude SEO v1.9.0 Pro Hub Challenge Release Report
-
-Usage:
- python scripts/release_report.py --output ~/Desktop/
- python scripts/release_report.py --output ~/Desktop/ --screenshots /path/
-
-Dependencies: matplotlib>=3.8.0, weasyprint>=61.0
-"""
-
-import argparse
-import json
-import re
-import sys
-from datetime import datetime
-from pathlib import Path
-from urllib.parse import quote
-
-import matplotlib
-matplotlib.use("Agg")
-import matplotlib.pyplot as plt
-import matplotlib.patches as mpatches
-import numpy as np
-
-
-# --- Brand ---
-
-BRAND = {
- "bg": "#0A0A0A",
- "card": "#111111",
- "card_inner":"#1A1A1A",
- "border": "#2D2D2D",
- "text": "#F5F5F0",
- "text_sec": "#888888",
- "accent": "#E07850",
- "green": "#4ADE80",
- "amber": "#f59e0b",
- "blue": "#60A5FA",
- "muted": "#888888",
-}
-
-SCREENSHOTS_DIR = str(Path.home() / "Downloads" / "pro-hub-challenge-march-screenshots")
-
-
-def _setup_matplotlib():
- plt.rcParams.update({
- "font.family": "sans-serif",
- "font.sans-serif": ["Space Grotesk", "DejaVu Sans", "Arial", "Helvetica"],
- "font.size": 11,
- "axes.titlesize": 14,
- "axes.titleweight": "bold",
- "axes.facecolor": BRAND["card"],
- "figure.facecolor": BRAND["bg"],
- "text.color": BRAND["text"],
- "axes.labelcolor": BRAND["text"],
- "axes.titlecolor": BRAND["text"],
- "xtick.color": BRAND["text_sec"],
- "ytick.color": BRAND["text_sec"],
- "axes.edgecolor": BRAND["border"],
- "axes.grid": True,
- "axes.spines.top": False,
- "axes.spines.right": False,
- })
-
-
-_setup_matplotlib()
-
-
-# --- Chart Functions ---
-
-def chart_contribution_flow(charts_dir: Path) -> str:
- entries = [
- ("Lutfiya Miller", "/seo cluster", "new", "New Skill"),
- ("Florian Schmitz", "/seo sxo", "new", "New Skill"),
- ("Dan Colta", "/seo drift", "new", "New Skill"),
- ("Matej Marjanovic", "/seo ecommerce", "new", "New Skill"),
- ("Chris Muller", "/seo hreflang", "enhanced", "Enhancement"),
- ("Benjamin", "claude-blog", "deferred", "Out of Scope"),
- ]
- status_colors = {
- "new": BRAND["green"],
- "enhanced": BRAND["accent"],
- "deferred": BRAND["muted"],
- }
-
- fig, ax = plt.subplots(figsize=(12, 8))
- ax.set_facecolor(BRAND["card"])
- fig.patch.set_facecolor(BRAND["bg"])
- ax.set_xlim(-0.2, 10.5)
- ax.set_ylim(-0.8, len(entries) - 0.2)
- ax.axis("off")
- ax.set_title("Pro Hub Challenge: Contribution Pipeline", fontsize=14,
- fontweight="bold", color=BRAND["text"], pad=12)
-
- for i, (name, skill, status, label) in enumerate(entries):
- y = len(entries) - 1 - i
- color = status_colors[status]
-
- left = mpatches.FancyBboxPatch(
- (0.05, y - 0.33), 2.9, 0.66,
- boxstyle="round,pad=0.04",
- linewidth=1.2, edgecolor=BRAND["border"], facecolor=BRAND["card_inner"]
- )
- ax.add_patch(left)
- ax.text(1.5, y, name, ha="center", va="center", fontsize=9.5,
- color=BRAND["text"], fontweight="bold")
-
- ax.annotate("", xy=(3.15, y), xytext=(2.95, y),
- arrowprops=dict(arrowstyle="-|>", color=color, lw=2.0, mutation_scale=14))
-
- right = mpatches.FancyBboxPatch(
- (3.2, y - 0.33), 5.6, 0.66,
- boxstyle="round,pad=0.04",
- linewidth=1.2, edgecolor=BRAND["border"], facecolor=BRAND["card_inner"]
- )
- ax.add_patch(right)
- ax.text(3.45, y, skill, ha="left", va="center", fontsize=9, color=BRAND["text"])
-
- badge = mpatches.FancyBboxPatch(
- (7.2, y - 0.23), 1.85, 0.46,
- boxstyle="round,pad=0.03",
- linewidth=0, facecolor=color
- )
- ax.add_patch(badge)
- txt_color = BRAND["bg"] if color != BRAND["muted"] else BRAND["text"]
- ax.text(8.12, y, label, ha="center", va="center", fontsize=8,
- color=txt_color, fontweight="bold")
-
- legend_elements = [
- mpatches.Patch(facecolor=BRAND["green"], label="New Skill"),
- mpatches.Patch(facecolor=BRAND["accent"], label="Enhancement"),
- mpatches.Patch(facecolor=BRAND["muted"], label="Out of Scope"),
- ]
- legend = ax.legend(handles=legend_elements, loc="lower right", fontsize=9,
- framealpha=0.9, edgecolor=BRAND["border"])
- legend.get_frame().set_facecolor(BRAND["card"])
- for t in legend.get_texts():
- t.set_color(BRAND["text"])
-
- plt.tight_layout()
- path = charts_dir / "contribution_flow.png"
- plt.savefig(path, dpi=200, bbox_inches="tight", facecolor=BRAND["bg"])
- plt.close()
- return str(path)
-
-
-def chart_skill_architecture(charts_dir: Path) -> str:
- categories = [
- "Orchestrator",
- "Technical Audit",
- "Content & Schema",
- "Local & Maps",
- "Planning & Strategy",
- "Intelligence (v1.9.0)",
- "E-commerce (v1.9.0)",
- "International",
- "Extensions",
- ]
- existing = [1, 4, 4, 2, 5, 0, 0, 2, 2]
- new_v190 = [0, 0, 0, 0, 0, 3, 1, 0, 0]
-
- y = np.arange(len(categories))
- h = 0.32
-
- fig, ax = plt.subplots(figsize=(12, 4.5))
- ax.set_facecolor(BRAND["card"])
- fig.patch.set_facecolor(BRAND["bg"])
-
- bars_e = ax.barh(y + h / 2, existing, h, label="Existing (v1.8.x)",
- color=BRAND["blue"], alpha=0.85)
- bars_n = ax.barh(y - h / 2, new_v190, h, label="New in v1.9.0",
- color=BRAND["accent"], alpha=0.95)
-
- ax.set_yticks(y)
- ax.set_yticklabels(categories, fontsize=10, color=BRAND["text"])
- ax.set_xlabel("Number of Skills", fontsize=10)
- ax.set_title("Claude SEO Skill Architecture: v1.9.0 (23 Total Skills)",
- fontsize=14, fontweight="bold", color=BRAND["text"], pad=12)
- ax.set_xlim(0, 7.5)
- ax.xaxis.set_major_locator(plt.MaxNLocator(integer=True))
- ax.tick_params(colors=BRAND["text_sec"])
- ax.spines["left"].set_color(BRAND["border"])
- ax.spines["bottom"].set_color(BRAND["border"])
- ax.set_axisbelow(True)
- ax.yaxis.grid(False)
- ax.xaxis.grid(True, color=BRAND["border"], linewidth=0.5)
-
- for bar in list(bars_e) + list(bars_n):
- w = bar.get_width()
- if w > 0:
- c = BRAND["blue"] if bar in bars_e else BRAND["accent"]
- ax.text(w + 0.08, bar.get_y() + bar.get_height() / 2,
- str(int(w)), va="center", fontsize=9, color=c)
-
- legend = ax.legend(fontsize=10, framealpha=0.9, edgecolor=BRAND["border"])
- legend.get_frame().set_facecolor(BRAND["card"])
- for t in legend.get_texts():
- t.set_color(BRAND["text"])
-
- plt.tight_layout()
- path = charts_dir / "skill_architecture.png"
- plt.savefig(path, dpi=200, bbox_inches="tight", facecolor=BRAND["bg"])
- plt.close()
- return str(path)
-
-
-def chart_review_scores(charts_dir: Path) -> str:
- labels = ["Round 1\nCode Review", "Round 2\nRe-Review",
- "Round 3\nMax-Effort", "Round 4\nSecurity Audit"]
- scores = [87, 93, 97, 85]
- dot_colors = [BRAND["amber"], BRAND["amber"], BRAND["green"], BRAND["amber"]]
-
- fig, ax = plt.subplots(figsize=(10, 5))
- ax.set_facecolor(BRAND["card"])
- fig.patch.set_facecolor(BRAND["bg"])
-
- x = np.arange(len(labels))
- ax.plot(x, scores, color=BRAND["accent"], linewidth=2.5, zorder=2)
- for xi, (yi, ci) in enumerate(zip(scores, dot_colors)):
- ax.scatter([xi], [yi], color=ci, s=130, zorder=3,
- edgecolors=BRAND["accent"], linewidth=1.5)
- ax.annotate(f"{yi}/100", (xi, yi),
- textcoords="offset points", xytext=(0, 13),
- ha="center", fontsize=11, fontweight="bold", color=BRAND["text"])
-
- ax.axhline(y=90, color=BRAND["green"], linestyle="--", alpha=0.4, linewidth=1)
- ax.axhline(y=80, color=BRAND["amber"], linestyle="--", alpha=0.4, linewidth=1)
- ax.text(3.55, 90.8, "Excellent (90+)", fontsize=8, color=BRAND["green"], alpha=0.8)
- ax.text(3.55, 80.8, "Good (80+)", fontsize=8, color=BRAND["amber"], alpha=0.8)
-
- ax.set_xticks(x)
- ax.set_xticklabels(labels, fontsize=9.5, color=BRAND["text"])
- ax.set_xlim(-0.4, 3.8)
- ax.set_ylim(76, 107)
- ax.set_ylabel("Score / 100", fontsize=10)
- ax.set_title("v1.9.0 Review Score Progression: 4 Rounds",
- fontsize=14, fontweight="bold", color=BRAND["text"], pad=12)
- ax.tick_params(colors=BRAND["text_sec"])
- ax.spines["left"].set_color(BRAND["border"])
- ax.spines["bottom"].set_color(BRAND["border"])
- ax.set_axisbelow(True)
- ax.yaxis.grid(True, color=BRAND["border"], linewidth=0.5)
-
- plt.tight_layout()
- path = charts_dir / "review_scores.png"
- plt.savefig(path, dpi=200, bbox_inches="tight", facecolor=BRAND["bg"])
- plt.close()
- return str(path)
-
-
-def chart_security_matrix(charts_dir: Path) -> str:
- severities = ["HIGH", "MEDIUM", "LOW"]
- fixed = [2, 2, 0]
- deferred = [2, 4, 5]
-
- x = np.arange(len(severities))
- w = 0.35
-
- fig, ax = plt.subplots(figsize=(9, 5))
- ax.set_facecolor(BRAND["card"])
- fig.patch.set_facecolor(BRAND["bg"])
-
- b1 = ax.bar(x - w / 2, fixed, w, label="Fixed in v1.9.0",
- color=BRAND["green"], alpha=0.9, edgecolor=BRAND["bg"])
- b2 = ax.bar(x + w / 2, deferred, w, label="Deferred to v1.9.1",
- color=BRAND["amber"], alpha=0.9, edgecolor=BRAND["bg"])
-
- for bar in list(b1) + list(b2):
- h = bar.get_height()
- if h > 0:
- ax.text(bar.get_x() + bar.get_width() / 2, h + 0.1,
- str(int(h)), ha="center", va="bottom",
- fontsize=11, fontweight="bold", color=BRAND["text"])
-
- ax.set_xticks(x)
- ax.set_xticklabels(severities, fontsize=12, color=BRAND["text"])
- ax.set_ylabel("Number of Findings", fontsize=10)
- ax.set_title("Security Audit: 15 Findings, Score 85/100",
- fontsize=14, fontweight="bold", color=BRAND["text"], pad=12)
- ax.set_ylim(0, 8.5)
- ax.yaxis.set_major_locator(plt.MaxNLocator(integer=True))
- ax.tick_params(colors=BRAND["text_sec"])
- legend = ax.legend(fontsize=10, framealpha=0.9, edgecolor=BRAND["border"])
- legend.get_frame().set_facecolor(BRAND["card"])
- for t in legend.get_texts():
- t.set_color(BRAND["text"])
- ax.spines["left"].set_color(BRAND["border"])
- ax.spines["bottom"].set_color(BRAND["border"])
- ax.set_axisbelow(True)
- ax.yaxis.grid(True, color=BRAND["border"], linewidth=0.5)
- ax.text(0.98, 0.96, "0 CRITICAL | 4 Fixed | 11 Deferred",
- transform=ax.transAxes, ha="right", va="top",
- fontsize=9, color=BRAND["text_sec"], style="italic")
-
- plt.tight_layout()
- path = charts_dir / "security_matrix.png"
- plt.savefig(path, dpi=200, bbox_inches="tight", facecolor=BRAND["bg"])
- plt.close()
- return str(path)
-
-
-# --- CSS ---
-
-def _build_css() -> str:
- return """<style>
- @page {
- size: A4;
- background: #0A0A0A;
- margin: 20mm 16mm 22mm 16mm;
- @bottom-center {
- content: "Page " counter(page) " of " counter(pages);
- font-size: 9pt; color: #888888;
- font-family: 'Space Grotesk', 'DejaVu Sans', system-ui, sans-serif;
- }
- @bottom-right {
- content: "Claude SEO v1.9.0";
- font-size: 8pt; color: #2D2D2D;
- font-family: 'Space Grotesk', 'DejaVu Sans', system-ui, sans-serif;
- }
- }
-
- @page :first {
- margin: 0;
- background: #0A0A0A;
- @bottom-left { content: none; }
- @bottom-center { content: none; }
- @bottom-right { content: none; }
- }
-
- @page toc {
- background: #0A0A0A;
- @bottom-center { content: counter(page); font-size: 9pt; color: #888888; }
- }
-
- * { box-sizing: border-box; margin: 0; padding: 0; }
-
- body {
- font-family: 'Space Grotesk', 'Inter', 'DejaVu Sans', system-ui, sans-serif;
- font-size: 10pt; line-height: 1.55;
- color: #F5F5F0; background: #0A0A0A;
- }
-
- /* Title Page */
- .title-page {
- page: first;
- width: 210mm;
- background: #0A0A0A;
- text-align: center; color: #F5F5F0;
- padding: 32mm 28mm 28mm 28mm;
- border-top: 5mm solid #E07850;
- }
-
- .title-page .badge {
- background: #111111; border: 1px solid #2D2D2D;
- border-radius: 20px; padding: 4px 16px;
- font-size: 8.5pt; letter-spacing: 2px;
- text-transform: uppercase; margin-bottom: 8mm;
- display: inline-block; color: #888888;
- }
-
- .title-page h1 {
- font-size: 28pt; font-weight: 700;
- margin-bottom: 4mm; line-height: 1.15; color: #F5F5F0;
- }
-
- .title-page .subtitle {
- font-size: 12pt; color: #888888;
- margin-bottom: 10mm; font-weight: 400;
- }
-
- .title-metrics { display: table; width: 100%; table-layout: fixed; margin: 8mm auto; }
- .title-metrics .mc {
- display: table-cell; text-align: center; padding: 4mm 2mm;
- border: 1px solid #2D2D2D; background: #111111;
- }
- .title-metrics .mc:first-child { border-radius: 6px 0 0 6px; }
- .title-metrics .mc:last-child { border-radius: 0 6px 6px 0; }
- .title-metrics .big { font-size: 22pt; font-weight: 700; color: #E07850; line-height: 1; }
- .title-metrics .small { font-size: 7pt; color: #888888; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1mm; }
-
- .title-page .meta {
- font-size: 8.5pt; color: #888888;
- margin-top: 10mm; padding-top: 4mm;
- border-top: 1px solid #2D2D2D;
- }
-
- /* TOC */
- .toc-page { page: toc; page-break-before: always; padding: 16mm; }
- .toc-page h2 {
- font-size: 17pt; color: #F5F5F0;
- margin-bottom: 6mm; padding-bottom: 3mm;
- border-bottom: 2px solid #E07850;
- }
- .toc-list { list-style: none; padding: 0; }
- .toc-list li {
- padding: 2.5mm 0; border-bottom: 1px solid #1A1A1A;
- overflow: hidden; font-size: 10.5pt; color: #F5F5F0;
- }
- .toc-badge {
- float: right; padding: 1px 7px; border-radius: 10px;
- font-size: 8pt; font-weight: bold;
- color: #0A0A0A; background: #E07850;
- }
- .toc-badge.green { background: #4ADE80; color: #0A0A0A; }
- .toc-badge.muted { background: #2D2D2D; color: #888888; }
-
- /* Sections */
- div.section { page-break-before: always; }
-
- .section-header {
- background: #111111; border-left: 4px solid #E07850;
- padding: 4mm 5mm; margin-bottom: 5mm;
- page-break-after: avoid;
- }
- .section-header h2 { font-size: 15pt; color: #F5F5F0; margin-bottom: 1mm; }
- .section-header .smeta { font-size: 8.5pt; color: #888888; }
-
- h3 {
- font-size: 11.5pt; color: #E07850;
- margin-top: 5mm; margin-bottom: 3mm;
- padding-bottom: 1mm; border-bottom: 1px solid #2D2D2D;
- page-break-after: avoid;
- }
-
- h4 {
- font-size: 10.5pt; color: #F5F5F0;
- margin-top: 3mm; margin-bottom: 2mm;
- page-break-after: avoid;
- }
-
- p { margin-bottom: 2.5mm; color: #D0CFC8; }
-
- /* Boxes */
- .highlight { background: #1A1200; border-left: 3px solid #E07850; padding: 3mm 4mm; margin: 3mm 0; font-size: 9.5pt; color: #D0CFC8; }
- .success-box { background: #0D1F0D; border-left: 3px solid #4ADE80; padding: 3mm 4mm; margin: 3mm 0; font-size: 9.5pt; color: #D0CFC8; }
- .info-box { background: #0D1020; border-left: 3px solid #60A5FA; padding: 3mm 4mm; margin: 3mm 0; font-size: 9.5pt; color: #D0CFC8; }
-
- /* Tables */
- table { width: 100%; border-collapse: collapse; margin: 3mm 0 5mm 0; font-size: 9pt; }
- thead th {
- background: #1A1A1A; color: #F5F5F0;
- font-weight: 600; padding: 3mm 4mm;
- text-align: left; border-bottom: 1px solid #2D2D2D;
- }
- tbody td { padding: 2mm 3mm; border-bottom: 1px solid #1A1A1A; vertical-align: top; color: #D0CFC8; }
- tbody tr:nth-child(even) { background: #0F0F0F; }
-
- .st-fixed { color: #4ADE80; font-weight: bold; }
- .st-deferred { color: #f59e0b; font-weight: bold; }
- .st-new { color: #60A5FA; font-weight: bold; }
- .sev-high { color: #f59e0b; font-weight: bold; }
- .sev-medium { color: #60A5FA; }
- .sev-low { color: #888888; }
-
- /* Charts */
- .chart-container { text-align: center; margin: 4mm 0; }
- .chart-container img { max-width: 100%; max-height: 165mm; height: auto; }
- .chart-caption { font-size: 8pt; color: #888888; font-style: italic; margin-top: 2mm; text-align: center; }
-
- /* Two-column */
- .two-col { display: table; width: 100%; table-layout: fixed; margin: 3mm 0; }
- .two-col .col { display: table-cell; vertical-align: top; padding: 0 2mm; }
-
- /* Four metric cards */
- .four-col { display: table; width: 100%; table-layout: fixed; margin: 3mm 0; }
- .four-col .col { display: table-cell; vertical-align: top; padding: 0 1.5mm; }
-
- .metric-card { background: #111111; border: 1px solid #2D2D2D; border-radius: 6px; padding: 3mm; text-align: center; margin: 2mm 0; }
- .metric-card .value { font-size: 16pt; font-weight: 700; line-height: 1.2; color: #E07850; }
- .metric-card .label { font-size: 7pt; color: #888888; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1mm; }
- .metric-card .delta { font-size: 8pt; color: #4ADE80; margin-top: 0.5mm; }
-
- /* Contributor Cards */
- .ccard { background: #111111; border: 1px solid #2D2D2D; border-radius: 6px; padding: 3mm 4mm; margin: 4mm 0; border-left: 4px solid #E07850; }
- .ccard h4 { margin-top: 0; border-bottom: none; padding-bottom: 0; color: #F5F5F0; }
- .ccard .cmeta { font-size: 8.5pt; color: #888888; margin-bottom: 2mm; font-style: italic; }
-
- /* Screenshots */
- .sshot { text-align: center; margin: 3mm 0; border: 1px solid #2D2D2D; border-radius: 4px; padding: 2mm; background: #111111; }
- .sshot img { max-width: 100%; height: auto; }
- .sshot-cap { font-size: 8pt; color: #888888; font-style: italic; margin-top: 1.5mm; }
-
- /* Code blocks */
- .code-block {
- background: #111111; color: #E07850;
- padding: 3mm 4mm; border-radius: 4px; border: 1px solid #2D2D2D;
- font-family: 'DejaVu Sans Mono', 'Courier New', monospace;
- font-size: 8pt; line-height: 1.6; margin: 3mm 0;
- white-space: pre-wrap; word-break: break-all;
- }
-
- /* Roadmap items */
- .ritem { background: #111111; border-radius: 4px; padding: 3mm 4mm; margin: 3mm 0; border-left: 3px solid #2D2D2D; }
- .ritem.high { border-left-color: #f59e0b; background: #1A1000; }
- .ritem.medium { border-left-color: #60A5FA; background: #0D1020; }
-
- /* Misc */
- ul { margin-left: 5mm; margin-bottom: 3mm; }
- li { margin-bottom: 1.5mm; color: #D0CFC8; }
- hr.divider { border: none; border-top: 1px solid #2D2D2D; margin: 5mm 0; }
- ol { margin-left: 5mm; margin-bottom: 3mm; }
- code { font-family: 'DejaVu Sans Mono', monospace; font-size: 8.5pt; color: #E07850; background: #1A1A1A; padding: 0 2px; border-radius: 2px; }
-</style>
-"""
-
-
-# --- HTML Helpers ---
-
-def _chart_html(path: str, caption: str, fig_num: int) -> str:
- if not path:
- return ""
- return (
- f'<div class="chart-container">\n'
- f' <img src="{_file_url(path)}" style="width:90%;" alt="{caption}">\n'
- f' <div class="chart-caption">Figure {fig_num}: {caption}</div>\n'
- f'</div>\n'
- )
-
-
-def _mc(value: str, label: str, delta: str = "") -> str:
- delta_html = f'<div class="delta">{delta}</div>' if delta else ""
- return (
- f'<div class="metric-card">'
- f'<div class="value">{value}</div>'
- f'<div class="label">{label}</div>'
- f'{delta_html}'
- f'</div>'
- )
-
-
-def _file_url(path: str) -> str:
- """Return a properly URL-encoded file:// URI (handles spaces in paths)."""
- return "file://" + quote(str(path), safe="/:@")
-
-
-def _screenshot_html(abs_path: str, caption: str, max_h: str = "72mm") -> str:
- if not abs_path or not Path(abs_path).exists():
- return ""
- return (
- f'<div class="sshot">\n'
- f' <img src="{_file_url(abs_path)}" style="max-height:{max_h}; max-width:100%; height:auto;" alt="{caption}">\n'
- f' <div class="sshot-cap">{caption}</div>\n'
- f'</div>\n'
- )
-
-
-# --- Section Builders ---
-
-def _build_title_page(logo_path: str = "") -> str:
- date = datetime.now().strftime("%B %Y")
- logo_html = ""
- if logo_path and Path(logo_path).exists():
- logo_html = (
- f'<div style="margin-bottom:8mm;">'
- f'<img src="{_file_url(logo_path)}" style="max-height:28mm; max-width:160mm;" alt="AI Marketing Hub Pro">'
- f'</div>\n'
- )
- return f"""
-<div class="title-page">
- {logo_html}<div class="badge">Claude Code &nbsp;&#183;&nbsp; Agent Skills Standard</div>
- <h1>Claude SEO v1.9.0<br>Release Report</h1>
- <div class="subtitle">Pro Hub Challenge: Community-Driven Extension</div>
- <div class="title-metrics">
- <div class="mc"><div class="big">4</div><div class="small">New Skills</div></div>
- <div class="mc"><div class="big">5</div><div class="small">Contributors</div></div>
- <div class="mc"><div class="big">61</div><div class="small">Files Changed</div></div>
- <div class="mc"><div class="big">85</div><div class="small">Security Score</div></div>
- </div>
- <div class="meta">
- Version 1.9.0 &nbsp;&#183;&nbsp; {date} &nbsp;&#183;&nbsp; github.com/AgriciDaniel/claude-seo
- </div>
-
- <div style="margin-top:14mm; padding:5mm 6mm; background:#111111; border:1px solid #2D2D2D; border-radius:6px; text-align:left;">
- <div style="font-size:8pt; color:#888888; text-transform:uppercase; letter-spacing:1px; margin-bottom:3mm;">In This Report</div>
- <div style="display:table; width:100%;">
- <div style="display:table-cell; width:50%; padding-right:3mm; vertical-align:top;">
- <ul style="list-style:none; padding:0; margin:0; font-size:9pt; color:#D0CFC8;">
- <li style="margin-bottom:2mm;">5 community submissions, 4 new skills shipped</li>
- <li style="margin-bottom:2mm;">$600 Claude Credits prize pool distributed</li>
- <li style="margin-bottom:2mm;">4 review rounds, peak score 97/100</li>
- <li style="margin-bottom:2mm;">85/100 cybersecurity audit (8 specialist agents)</li>
- </ul>
- </div>
- <div style="display:table-cell; width:50%; vertical-align:top;">
- <ul style="list-style:none; padding:0; margin:0; font-size:9pt; color:#D0CFC8;">
- <li style="margin-bottom:2mm;">XSS vulnerability in cluster-map.html fixed</li>
- <li style="margin-bottom:2mm;">DataForSEO cost guardrail bypass closed</li>
- <li style="margin-bottom:2mm;">fcntl locking added for concurrent agents</li>
- <li style="margin-bottom:2mm;">CI coverage expanded from 21 to 28 scripts</li>
- </ul>
- </div>
- </div>
- </div>
-</div>
-"""
-
-
-def _build_toc() -> str:
- rows = [
- ("1", "Executive Summary", "", ""),
- ("2", "Pro Hub Challenge", "Community, $600 Prize Pool", ""),
- ("3", "Community Contributions", "5 Integrations, 4 New Skills", ""),
- ("4", "Architecture Evolution", "19 to 23 Skills", ""),
- ("5", "Review Process", "4 Rounds, Peak 97/100", "green"),
- ("6", "Security Audit", "85/100, 4 Fixes Applied", ""),
- ("7", "DataForSEO Cost Guardrails", "Technical Deep-Dive", "muted"),
- ("8", "What's Next", "v1.9.1 Priorities", "muted"),
- ]
- items = ""
- for num, title, desc, badge_cls in rows:
- badge = f'<span class="toc-badge {badge_cls}">{num}</span>'
- sub = f'<span style="color:#888888; font-size:8.5pt;"> &ndash; {desc}</span>' if desc else ""
- items += f'<li>{badge} <strong>{title}</strong>{sub}</li>\n'
-
- return f"""
-<div class="toc-page">
- <h2>Table of Contents</h2>
- <ul class="toc-list">
-{items} </ul>
- <div style="margin-top:10mm; padding:4mm 5mm; background:#111111; border-left:3px solid #E07850; border-radius:0 4px 4px 0; font-size:9pt; color:#D0CFC8;">
- v1.9.0 is the first community-driven Claude SEO release. Six members submitted skills for the inaugural Pro Hub Challenge. Five shipped. This report covers the contributions, architecture changes, review process, and security findings in full.
- </div>
-</div>"""
-
-
-def _build_executive_summary() -> str:
- return f"""
-<div class="section">
- <div class="section-header">
- <h2>1. Executive Summary</h2>
- <div class="smeta">Claude SEO v1.9.0, April 2026</div>
- </div>
-
- <p>v1.9.0 is the first community-driven release. Six members submitted skills for the inaugural Pro Hub Challenge. Five shipped. Four are entirely new Tier-4 skills. The release also adds DataForSEO cost guardrails and passed a four-round quality review including a dedicated cybersecurity audit.</p>
-
- <div class="four-col">
- <div class="col">{_mc("23", "Total Skills", "+4 new")}</div>
- <div class="col">{_mc("17", "Subagents", "+4 new")}</div>
- <div class="col">{_mc("30", "Scripts", "+7 new")}</div>
- <div class="col">{_mc("61", "Files Changed", "31 mod, 30 new")}</div>
- </div>
-
- <div class="four-col">
- <div class="col">{_mc("6", "Submissions", "Pro Hub Challenge")}</div>
- <div class="col">{_mc("5", "Integrated", "4 new, 1 enhanced")}</div>
- <div class="col">{_mc("85/100", "Security", "4 fixes applied")}</div>
- <div class="col">{_mc("4", "Review Rounds", "Peak: 97/100")}</div>
- </div>
-
- <div class="two-col" style="margin-top:4mm;">
- <div class="col">
- <div class="success-box">
- <h4 style="margin-top:0; border:none; padding:0; color:#4ADE80;">Community</h4>
- <ul>
- <li>First Pro Hub Challenge, $600 Claude Credits prize pool</li>
- <li>5 of 6 submissions integrated into the official release</li>
- <li>4 new skills added to the ecosystem</li>
- <li>All contributors credited in CONTRIBUTORS.md and skill frontmatter</li>
- </ul>
- </div>
- </div>
- <div class="col">
- <div class="info-box">
- <h4 style="margin-top:0; border:none; padding:0; color:#60A5FA;">Technical</h4>
- <ul>
- <li>XSS in cluster-map.html fixed with escapeHtml() wrapping</li>
- <li>Cost guardrail bypass chain discovered and closed</li>
- <li>fcntl file locking for concurrent agent safety</li>
- <li>CI expanded from 21 to 28 tracked scripts</li>
- </ul>
- </div>
- </div>
- </div>
-</div>
-"""
-
-
-def _build_challenge_section(chart_path: str, fig_num: int, ss: Path = None) -> tuple:
- chart = _chart_html(chart_path,
- "Pro Hub Challenge: 6 submissions through review to integration outcomes",
- fig_num)
- ss = ss or Path(SCREENSHOTS_DIR)
- post_img = _screenshot_html(str(ss / "Pro hub challenge post.png"),
- "Original challenge announcement post", max_h="62mm")
- winner_img = _screenshot_html(str(ss / "Pro hub challenge post winner.png"),
- "Winner announcement in AI Marketing Hub Pro", max_h="62mm")
- html = f"""
-<div class="section">
- <div class="section-header">
- <h2>2. Pro Hub Challenge</h2>
- <div class="smeta">Community, $600 Claude Credits Prize Pool, 6 Submissions</div>
- </div>
-
- <p>The Pro Hub Challenge is a community extension program in AI Marketing Hub Pro. Members submit Claude Code skills for claude-seo or related tools. Winning submissions get integrated into the official release. The inaugural challenge offered $600 in Claude Credits across prize tiers.</p>
-
- {chart}
-
- <h3>Timeline</h3>
- <table>
- <thead><tr><th>Stage</th><th>Outcome</th></tr></thead>
- <tbody>
- <tr><td>Challenge announced</td><td>$600 prize pool declared</td></tr>
- <tr><td>Submissions closed</td><td>6 entries received</td></tr>
- <tr><td>Round 1: code review</td><td>87/100</td></tr>
- <tr><td>Round 2: re-review</td><td>93/100</td></tr>
- <tr><td>Round 3: max-effort plan</td><td>97/100</td></tr>
- <tr><td>Round 4: cybersecurity audit</td><td>85/100</td></tr>
- <tr><td>Security fixes applied</td><td>4 vulnerabilities resolved</td></tr>
- <tr><td>v1.9.0 shipped</td><td>5 of 6 integrated</td></tr>
- </tbody>
- </table>
-
- <h3>Announcement &amp; Winners</h3>
- {post_img}
- {winner_img}
-</div>
-"""
- return html, fig_num + 1
-
-
-def _build_contributions_section(ss: Path = None) -> str:
- ss = ss or Path(SCREENSHOTS_DIR)
- contributors = [
- {
- "name": "Lutfiya Miller",
- "skill": "/seo cluster",
- "type": "New Skill",
- "img": str(ss / "Lutfiya.png"),
- "desc": "SERP-based semantic topic clustering. Groups keywords by Google result overlap: 7-10 shared results is the same post, 4-6 is a hub cluster, 2-3 are interlink candidates.",
- "points": [
- "Interactive SVG cluster-map.html visualization (hub-spoke layout)",
- "No paid API required: uses SERP overlap algorithm",
- "XSS in SVG rendering fixed during integration (escapeHtml wrapping)",
- "De-branded from original submission",
- ],
- },
- {
- "name": "Florian Schmitz",
- "skill": "/seo sxo",
- "type": "New Skill",
- "img": str(ss / "florian.png"),
- "desc": "Search Experience Optimization. Analyzes page-type mismatch between what Google serves and what the page delivers. Surfaces intent gaps that kill rankings despite strong technical SEO.",
- "points": [
- "Page-type taxonomy: informational, transactional, navigational, commercial",
- "Persona scoring: visitor intent vs. page intent alignment",
- "Consolidated from four original SKILL.md files that each exceeded 500 lines",
- ],
- },
- {
- "name": "Dan Colta",
- "skill": "/seo drift",
- "type": "New Skill",
- "img": str(ss / "dan.png"),
- "desc": "Git for SEO. Captures baselines of SEO-critical page elements, then diffs against current state to catch regressions before they impact rankings.",
- "points": [
- "17 comparison rules across 3 severity levels (CRITICAL, WARNING, INFO)",
- "SQLite persistence at ~/.cache/claude-seo/drift/baselines.db",
- "Parameterized SQL throughout, html.escape() on all report output",
- ],
- },
- {
- "name": "Matej Marjanovic",
- "skill": "/seo ecommerce",
- "type": "New Skill",
- "img": str(ss / "Matej.png"),
- "desc": "E-commerce SEO covering product schema, marketplace intelligence via DataForSEO Merchant API (Google Shopping and Amazon), and category page optimization.",
- "points": [
- "Product and ItemList schema templates added to schema/templates.json",
- "DataForSEO Merchant API integration for live competitive pricing",
- "Category hierarchy and breadcrumb analysis",
- ],
- },
- {
- "name": "Chris Muller",
- "skill": "/seo hreflang",
- "type": "Enhancement",
- "img": str(ss / "chris.png"),
- "desc": "Extended seo-hreflang with Cultural Adaptation Profiles for DACH, French, Spanish, and Japanese markets. Covers number formats, date conventions, currency display, and content parity.",
- "points": [
- "4 cultural profiles: DACH (de-AT/CH/DE), fr-FR, es-ES/MX, ja-JP",
- "Locale format reference: number, date, currency conventions per region",
- "3 new reference files in skills/seo-hreflang/references/",
- ],
- },
- ]
-
- cards = ""
- for c in contributors:
- points = "".join(f"<li>{p}</li>" for p in c["points"])
- type_color = "#E07850" if c["type"] == "New Skill" else "#4ADE80"
- sshot = _screenshot_html(c["img"], f"{c['name']}'s submission post", max_h="52mm")
- cards += f"""<div class="ccard">
- <h4>{c["name"]} &ndash; <span style="color:#60A5FA;">{c["skill"]}</span>
- <span style="float:right; font-size:8pt; color:{type_color}; font-weight:bold;">{c["type"]}</span>
- </h4>
- <div class="cmeta">Pro Hub Challenge submission, integrated in v1.9.0</div>
- <p>{c["desc"]}</p>
- <ul>{points}</ul>
- {sshot}
-</div>
-"""
-
- return f"""
-<div class="section">
- <div class="section-header">
- <h2>3. Community Contributions</h2>
- <div class="smeta">5 Integrations, 4 New Skills, 1 Enhancement</div>
- </div>
-
- <p>Each submission passed code review, security audit, de-branding check, and line-limit check (SKILL.md at 500 lines max, reference files at 200 lines max). Security fixes were applied to three submissions during integration.</p>
-
-{cards}
-</div>
-"""
-
-
-def _build_architecture_section(chart_path: str, fig_num: int) -> tuple:
- chart = _chart_html(chart_path,
- "Claude SEO skill architecture: 23 skills by category (orange = v1.9.0 additions)",
- fig_num)
- html = f"""
-<div class="section">
- <div class="section-header">
- <h2>4. Architecture Evolution</h2>
- <div class="smeta">Skills 19 to 23, Agents 13 to 17, Scripts 23 to 30</div>
- </div>
-
- <h3>Skill Architecture Map</h3>
- {chart}
-
- <h3>Before / After</h3>
- <table>
- <thead><tr><th>Component</th><th>v1.8.2</th><th>v1.9.0</th><th>Delta</th></tr></thead>
- <tbody>
- <tr><td>Skills (SKILL.md directories)</td><td>19</td><td>23</td><td class="st-new">+4</td></tr>
- <tr><td>Subagents (agents/*.md)</td><td>13</td><td>17</td><td class="st-new">+4</td></tr>
- <tr><td>Python scripts (CI-tracked)</td><td>23</td><td>30</td><td class="st-new">+7</td></tr>
- <tr><td>Reference files</td><td>~25</td><td>~38</td><td class="st-new">+13</td></tr>
- <tr><td>Schema templates</td><td>8</td><td>10</td><td class="st-new">+2</td></tr>
- <tr><td>Orchestrator routing commands</td><td>18</td><td>23</td><td class="st-new">+5</td></tr>
- </tbody>
- </table>
-
- <h3>New Scripts (7)</h3>
- <p>Seven new Python scripts shipped with v1.9.0. DataForSEO additions: <code>dataforseo_costs.py</code> (cost estimation, approval workflow, fcntl budget locking), <code>dataforseo_merchant.py</code> (Google Shopping + Amazon via Merchant API), <code>dataforseo_normalize.py</code> (shared response normalization). SEO drift additions: <code>drift_baseline.py</code> (SQLite baseline capture, SSRF-protected), <code>drift_compare.py</code> (17-rule comparison engine, parameterized SQL), <code>drift_report.py</code> (HTML reporting with html.escape() throughout), <code>drift_history.py</code> (read-only timeline query).</p>
-</div>
-"""
- return html, fig_num + 1
-
-
-def _build_review_section(chart_path: str, fig_num: int) -> tuple:
- chart = _chart_html(chart_path,
- "Review score progression across 4 rounds: peak 97/100, security audit 85/100",
- fig_num)
- html = f"""
-<div class="section">
- <div class="section-header">
- <h2>5. Review Process</h2>
- <div class="smeta">4 Rounds, Peak 97/100, 8+ Issues Caught</div>
- </div>
-
- <h3>Score Progression</h3>
- {chart}
-
- <h3>What Each Round Caught</h3>
- <table>
- <thead>
- <tr><th>Round</th><th>Score</th><th>Key Findings</th></tr>
- </thead>
- <tbody>
- <tr>
- <td>1: Code Review</td><td>87/100</td>
- <td>Step numbering collision in orchestrator. Agent count wrong in seo-audit skill.</td>
- </tr>
- <tr>
- <td>2: Re-Review</td><td>93/100</td>
- <td>install.ps1 version not bumped. AGENTS.md count off by one. Dead import in dataforseo_merchant.py.</td>
- </tr>
- <tr>
- <td>3: Max-Effort Plan</td><td>97/100</td>
- <td>CONTRIBUTING.md insertion at line 25 would have orphaned subsections. New commands placed in wrong location in README.</td>
- </tr>
- <tr>
- <td>4: Security Audit</td><td>85/100</td>
- <td>XSS in SVG rendering. Cost guardrail bypass chain. CI coverage gap. Concurrent write race condition in cost ledger.</td>
- </tr>
- </tbody>
- </table>
-</div>
-"""
- return html, fig_num + 1
-
-
-def _build_security_section(chart_path: str, fig_num: int) -> tuple:
- chart = _chart_html(chart_path,
- "Security findings by severity: 4 fixed in v1.9.0, 11 deferred to v1.9.1",
- fig_num)
- html = f"""
-<div class="section">
- <div class="section-header">
- <h2>6. Security Audit</h2>
- <div class="smeta">85/100, OWASP Top 10:2025, STRIDE, MITRE ATT&amp;CK, 8 Specialist Agents</div>
- </div>
-
- <p>The /cybersecurity skill ran an 8-agent parallel audit: vulnerability scanning, authentication, secrets detection, dependency analysis, infrastructure-as-code, threat intelligence, AI-generated code patterns, and business logic. 15 findings total across 3 severity tiers. 10 of the 11 deferred findings were already present in v1.8.x. The audit formally documented them for the first time. All deferred items target v1.9.1.</p>
-
- <h3>Findings Distribution</h3>
- {chart}
-
- <h3>Fixes Applied in v1.9.0</h3>
- <table>
- <thead><tr><th>Finding</th><th>Severity</th><th>Resolution</th></tr></thead>
- <tbody>
- <tr>
- <td>XSS in cluster-map.html: truncate() output inserted raw into SVG DOM</td>
- <td class="sev-high">HIGH</td>
- <td class="st-fixed">Fixed: escapeHtml() added at render points</td>
- </tr>
- <tr>
- <td>Cost guardrail bypass: unknown endpoint defaulted to $0.05, reset cleared spend without confirmation</td>
- <td class="sev-high">HIGH</td>
- <td class="st-fixed">Fixed: unknown endpoint returns needs_approval, reset requires --confirm with audit trail</td>
- </tr>
- <tr>
- <td>CI coverage gap: 7 new scripts absent from compile check</td>
- <td class="sev-medium">MEDIUM</td>
- <td class="st-fixed">Fixed: ci.yml expanded from 21 to 28 tracked scripts</td>
- </tr>
- <tr>
- <td>Concurrent write race condition in cost ledger</td>
- <td class="sev-medium">MEDIUM</td>
- <td class="st-fixed">Fixed: fcntl shared lock for reads, exclusive for writes</td>
- </tr>
- </tbody>
- </table>
-</div>
-"""
- return html, fig_num + 1
-
-
-def _build_guardrails_section() -> str:
- return """
-<div class="section">
- <div class="section-header">
- <h2>7. DataForSEO Cost Guardrails</h2>
- <div class="smeta">Technical Deep-Dive, Approval Workflow, fcntl Locking</div>
- </div>
-
- <p>DataForSEO calls accumulate cost fast when multiple subagents run in parallel. v1.9.0 adds a cost estimation and approval workflow in <code>scripts/dataforseo_costs.py</code>.</p>
-
- <h3>The Bypass Chain (Closed)</h3>
- <ol>
- <li>Unknown endpoints defaulted to $0.05 per call, bypassing the approval gate by using an undocumented endpoint name.</li>
- <li>The reset command cleared cumulative spend with no confirmation, letting a misconfigured agent wipe the budget ledger and restart a spending cycle.</li>
- </ol>
-
- <div class="code-block"># Unknown endpoint: explicit approval required
-unit_cost = COST_TABLE.get(endpoint)
-if unit_cost is None:
- return {"status": "needs_approval", "approval_reason": "unknown_endpoint", ...}
-
-# Reset requires --confirm and logs a tamper-evident audit entry
-def cmd_reset(args):
- if not args.confirm:
- return {"status": "blocked", "message": "Reset requires --confirm flag."}</div>
-
- <h3>Concurrent Safety</h3>
- <p>The cost ledger is a JSON file read and written by multiple parallel subagents. v1.9.0 adds <code>fcntl.flock()</code>: shared lock for reads, exclusive lock for writes. Windows falls back to an unguarded write with a warning.</p>
-</div>
-"""
-
-
-def _build_next_section() -> str:
- return """
-<div class="section">
- <div class="section-header">
- <h2>8. What's Next</h2>
- <div class="smeta">v1.9.1 Security Priorities, Community Growth</div>
- </div>
-
- <div class="ritem high">
- <h4>H1: validate_url() DNS Rebinding Gap
- <span style="float:right; color:#f59e0b; font-size:8.5pt;">HIGH, Deferred</span>
- </h4>
- <p>validate_url() checks IPs at parse time but not at request time. A DNS rebinding attack can serve a public IP at validation, then switch to a private address at request. Fix: re-validate resolved IPs at the socket layer.</p>
- </div>
-
- <div class="ritem high">
- <h4>H2: Install Script Shell Injection
- <span style="float:right; color:#f59e0b; font-size:8.5pt;">HIGH, Deferred</span>
- </h4>
- <p>install.sh and install.ps1 use unquoted variables. A path with spaces or shell metacharacters could inject commands. Fix: quote all variable expansions.</p>
- </div>
-
- <div class="ritem medium">
- <h4>M1: OAuth Token File Permissions (0644)
- <span style="float:right; color:#60A5FA; font-size:8.5pt;">MEDIUM, Deferred</span>
- </h4>
- <p>OAuth token files are written with default permissions, making them world-readable on systems with permissive umask. Fix: chmod 600 immediately after writing.</p>
- </div>
-
- <div class="success-box" style="margin-top:5mm;">
- <h4 style="margin-top:0; border:none; padding:0; color:#4ADE80;">April Challenge. $600. One Word.</h4>
- <p>Challenge v2 is live in AI Marketing Hub Pro. The keyword is <strong style="color:#4ADE80;">LEADS</strong>. Build anything that touches lead generation: Claude Code skills, n8n workflows, MCP servers, dashboards, scrapers, pipelines. If it helps someone capture, qualify, nurture, or convert leads, it counts.</p>
- <div style="display:table; width:100%; margin-top:3mm;">
- <div style="display:table-cell; width:50%; vertical-align:top;">
- <p style="margin-bottom:1mm;"><strong>Prizes</strong></p>
- <ul style="margin-bottom:0;">
- <li>1st Place: $400 in Claude Credits</li>
- <li>2nd Place: $200 in Claude Credits</li>
- </ul>
- </div>
- <div style="display:table-cell; width:50%; vertical-align:top;">
- <p style="margin-bottom:1mm;"><strong>Rules</strong></p>
- <ul style="margin-bottom:0;">
- <li>GitHub repo or .zip + 1-2 min demo video</li>
- <li>Must be functional, solo or team welcome</li>
- <li>Deadline: April 28</li>
- </ul>
- </div>
- </div>
- </div>
-
- <hr class="divider">
- <p style="font-size:8.5pt; color:#888888; text-align:center; margin-top:4mm;">
- Claude SEO is open-source (Agent Skills standard) &nbsp;&#183;&nbsp;
- github.com/AgriciDaniel/claude-seo &nbsp;&#183;&nbsp;
- AI Marketing Hub: skool.com/ai-marketing-hub-pro
- </p>
-</div>
-"""
-
-
-# --- PDF Review ---
-
-def _review_pdf(pdf_path: Path, html_content: str) -> dict:
- issues = []
- result: dict = {"status": "PASS", "issues": []}
-
- if not pdf_path.exists():
- return {"status": "FAIL", "issues": ["PDF not created"]}
-
- size_kb = pdf_path.stat().st_size / 1024
- result["file_size_kb"] = round(size_kb, 1)
-
- if size_kb < 30:
- issues.append(f"PDF suspiciously small: {size_kb:.1f} KB")
-
- section_count = html_content.count('class="section"')
- if section_count < 6:
- issues.append(f"Only {section_count} sections (expected >= 6)")
-
- chart_count = html_content.count("chart-container")
- if chart_count < 4:
- issues.append(f"Only {chart_count} charts (expected 4)")
-
- from urllib.parse import unquote
- for img_path_raw in re.findall(r'src="file://([^"]+)"', html_content):
- img_path = unquote(img_path_raw)
- if not Path(img_path).exists():
- issues.append(f"Missing image: {img_path}")
-
- try:
- import pypdf
- reader = pypdf.PdfReader(str(pdf_path))
- result["page_count"] = len(reader.pages)
- if len(reader.pages) < 10:
- issues.append(f"Only {len(reader.pages)} pages (expected >= 10)")
- except ImportError:
- result["page_count"] = "unknown (install pypdf)"
-
- if issues:
- result["status"] = f"WARN ({len(issues)} issues)"
- result["issues"] = issues
- return result
-
-
-# --- Report Generation ---
-
-def generate_report(output_dir: str, screenshots_dir: str = SCREENSHOTS_DIR) -> str:
- out = Path(output_dir).expanduser().resolve()
- charts_dir = out / "claude-seo-v190-charts"
- charts_dir.mkdir(parents=True, exist_ok=True)
-
- ss = Path(screenshots_dir)
- # Use white-text logo for dark background (note: double space in filename)
- logo_path = str(ss / "AI MArketing hub pro logo with white text.png")
- if not Path(logo_path).exists():
- logo_path = str(ss / "AI MArketing hub pro logo with black text.png")
-
- pdf_path = out / "Claude-SEO-v1.9.0-Release-Report.pdf"
-
- print("Generating charts...")
- flow_path = chart_contribution_flow(charts_dir)
- arch_path = chart_skill_architecture(charts_dir)
- review_path = chart_review_scores(charts_dir)
- sec_path = chart_security_matrix(charts_dir)
- print(f" 4 charts saved to {charts_dir}")
-
- fig_n = [1]
-
- def nf() -> int:
- n = fig_n[0]; fig_n[0] += 1; return n
-
- print("Building HTML sections...")
- challenge_html, _ = _build_challenge_section(flow_path, nf(), ss)
- arch_html, _ = _build_architecture_section(arch_path, nf())
- review_html, _ = _build_review_section(review_path, nf())
- sec_html, _ = _build_security_section(sec_path, nf())
-
- sections = [
- _build_title_page(logo_path),
- _build_toc(),
- _build_executive_summary(),
- challenge_html,
- _build_contributions_section(ss),
- arch_html,
- review_html,
- sec_html,
- _build_guardrails_section(),
- _build_next_section(),
- ]
-
- full_html = _build_css() + "\n".join(sections)
-
- print("Rendering PDF via WeasyPrint...")
- try:
- from weasyprint import HTML
- HTML(string=full_html).write_pdf(str(pdf_path))
- except ImportError:
- html_out = out / "Claude-SEO-v1.9.0-Release-Report.html"
- html_out.write_text(full_html, encoding="utf-8")
- print(f"WeasyPrint not installed. HTML saved: {html_out}")
- return str(html_out)
-
- print("Running quality check...")
- review = _review_pdf(pdf_path, full_html)
- print(f" Status : {review['status']}")
- print(f" Pages : {review.get('page_count', '?')}")
- print(f" Size : {review.get('file_size_kb', '?')} KB")
- for issue in review.get("issues", []):
- print(f" WARNING : {issue}")
-
- print(f"\nReport saved: {pdf_path}")
- return str(pdf_path)
-
-
-# --- CLI ---
-
-def main():
- parser = argparse.ArgumentParser(
- description="Generate Claude SEO v1.9.0 Pro Hub Challenge Release Report"
- )
- parser.add_argument("--output", "-o", default="~/Desktop",
- help="Output directory (default: ~/Desktop)")
- parser.add_argument("--screenshots", default=SCREENSHOTS_DIR,
- help=f"Screenshots directory (default: {SCREENSHOTS_DIR})")
- args = parser.parse_args()
-
- try:
- path = generate_report(args.output, args.screenshots)
- print(json.dumps({"status": "success", "path": path}, indent=2))
- except Exception as exc:
- print(json.dumps({"status": "error", "message": str(exc)}, indent=2),
- file=sys.stderr)
- sys.exit(1)
-
-
-if __name__ == "__main__":
- main()
diff --git a/scripts/render_page.py b/scripts/render_page.py
index 6b6bcec..149dbfe 100644
--- a/scripts/render_page.py
+++ b/scripts/render_page.py
@@ -163,9 +163,17 @@ def render_page(
timeout_ms: int = 15000,
block_resources: Optional[list[str]] = None,
extract_content: bool = True,
+ extract_accessibility: bool = False,
user_agent: Optional[str] = None,
) -> dict:
- """Render or fetch ``url`` per the chosen mode. See module docstring."""
+ """Render or fetch ``url`` per the chosen mode. See module docstring.
+
+ ``extract_accessibility``: when True and the page is rendered (mode
+ 'always' or 'auto'+SPA), the Playwright accessibility-tree snapshot is
+ captured and attached to ``result['accessibility_tree']``. Used by
+ ``agent_ux_check.py`` for agent-friendliness scoring (Google AI
+ optimization guide / web.dev agent UX criteria).
+ """
result: dict = {
"url": url,
"status_code": None,
@@ -174,6 +182,7 @@ def render_page(
"is_spa": None,
"extracted_text": None,
"publication_date": None,
+ "accessibility_tree": None,
"headers": {},
"redirect_chain": [],
"console_errors": [],
@@ -268,6 +277,15 @@ def render_page(
)
result["render_engine"] = "playwright-chromium"
+ if extract_accessibility:
+ try:
+ result["accessibility_tree"] = page.accessibility.snapshot(
+ interesting_only=False
+ )
+ except Exception:
+ # Accessibility snapshot is best-effort; never block the audit.
+ result["accessibility_tree"] = None
+
browser.close()
except PlaywrightTimeout:
result["error"] = f"playwright navigation timed out after {timeout_ms}ms"
@@ -333,6 +351,11 @@ def _cli() -> None:
action="store_true",
help="skip trafilatura and htmldate post-processing",
)
+ parser.add_argument(
+ "--a11y-tree",
+ action="store_true",
+ help="capture Playwright accessibility-tree snapshot (forces render)",
+ )
parser.add_argument(
"--json",
action="store_true",
@@ -341,13 +364,15 @@ def _cli() -> None:
parser.add_argument("--output", "-o", help="write HTML content to file")
args = parser.parse_args()
+ effective_mode = "always" if args.a11y_tree else args.mode
res = render_page(
args.url,
- mode=args.mode,
+ mode=effective_mode,
viewport=args.viewport,
timeout_ms=args.timeout_ms,
block_resources=args.block or None,
extract_content=not args.no_extract,
+ extract_accessibility=args.a11y_tree,
)
if args.json:
diff --git a/scripts/ucp_check.py b/scripts/ucp_check.py
new file mode 100644
index 0000000..0582ef6
--- /dev/null
+++ b/scripts/ucp_check.py
@@ -0,0 +1,248 @@
+#!/usr/bin/env python3
+"""
+UCP (Universal Commerce Protocol) profile auditor.
+
+Fetches a site's ``/.well-known/ucp`` document, validates its structure
+against the early UCP spec (Google + Shopify + Etsy + Walmart + payment
+partners), enumerates declared capabilities, and probes each declared
+endpoint for reachability. Output is JSON.
+
+Audit posture
+=============
+Per ``skills/seo-ecommerce/references/ucp-universal-commerce-protocol.md``,
+UCP adoption is early. Missing profiles are reported as
+**opportunities**, not failures. The scanner exists so claude-seo
+audits can surface forward-looking ecommerce signals without making
+them a hard scoring gate.
+
+SSRF
+====
+Both the discovery fetch and every endpoint probe go through
+``url_safety.safe_requests_get`` / ``url_safety.validate_url_strict``.
+Capability endpoints declared as private-IP, loopback, or metadata-IP
+URLs are rejected at validation time and reported as ``ssrf-blocked``.
+
+CLI
+===
+ python ucp_check.py https://store.example.com
+ python ucp_check.py https://store.example.com --json
+ python ucp_check.py https://store.example.com --probe-endpoints
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import os
+import sys
+from typing import Optional
+from urllib.parse import urljoin, 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 ( # noqa: E402
+ URLSafetyError,
+ safe_requests_get,
+ validate_url_strict,
+)
+
+
+KNOWN_CAPABILITIES = {
+ "dev.ucp.shopping.checkout": "Initiate checkout, return totals + payment intent",
+ "dev.ucp.shopping.fulfillment": "Quote shipping options + delivery windows",
+ "dev.ucp.shopping.discount": "Apply promo codes / loyalty discounts",
+ "dev.ucp.shopping.cart": "Add / remove / update items in agent-managed carts",
+ "dev.ucp.shopping.catalog": "Search / list products via agent queries",
+ "dev.ucp.shopping.order": "Order status, lookup, history",
+ "dev.ucp.shopping.returns": "Return initiation + status",
+}
+
+
+def discovery_url_for(site: str) -> str:
+ """Return the canonical UCP discovery URL for a site root."""
+ parsed = urlparse(site)
+ if not parsed.scheme:
+ site = "https://" + site
+ parsed = urlparse(site)
+ base = f"{parsed.scheme}://{parsed.netloc}/"
+ return urljoin(base, ".well-known/ucp")
+
+
+def parse_profile(payload: str) -> dict:
+ """Parse a UCP profile JSON document and report structural findings."""
+ report: dict = {
+ "valid_json": False,
+ "version": None,
+ "capabilities": [],
+ "merchant": None,
+ "issues": [],
+ "unknown_capabilities": [],
+ }
+ try:
+ data = json.loads(payload)
+ except json.JSONDecodeError as exc:
+ report["issues"].append(f"invalid-json: {exc.msg} (line {exc.lineno})")
+ return report
+ if not isinstance(data, dict):
+ report["issues"].append("profile-not-object")
+ return report
+ report["valid_json"] = True
+
+ version = data.get("version")
+ if version is None:
+ report["issues"].append("missing-version")
+ elif not isinstance(version, str):
+ report["issues"].append("version-not-string")
+ else:
+ report["version"] = version
+
+ merchant = data.get("merchant")
+ if merchant is None:
+ report["issues"].append("missing-merchant")
+ elif isinstance(merchant, dict):
+ report["merchant"] = {
+ "name": merchant.get("name"),
+ "id": merchant.get("id"),
+ }
+ if not merchant.get("name"):
+ report["issues"].append("merchant-name-empty")
+ else:
+ report["issues"].append("merchant-not-object")
+
+ caps = data.get("capabilities")
+ if caps is None:
+ report["issues"].append("missing-capabilities")
+ elif not isinstance(caps, list):
+ report["issues"].append("capabilities-not-array")
+ else:
+ for idx, cap in enumerate(caps):
+ if not isinstance(cap, dict):
+ report["issues"].append(f"capability-{idx}-not-object")
+ continue
+ cap_id = cap.get("id")
+ cap_version = cap.get("version")
+ cap_endpoint = cap.get("endpoint")
+ entry = {
+ "id": cap_id,
+ "version": cap_version,
+ "endpoint": cap_endpoint,
+ "issues": [],
+ }
+ if not cap_id:
+ entry["issues"].append("missing-id")
+ elif cap_id not in KNOWN_CAPABILITIES:
+ report["unknown_capabilities"].append(cap_id)
+ if not cap_version:
+ entry["issues"].append("missing-version")
+ if not cap_endpoint:
+ entry["issues"].append("missing-endpoint")
+ report["capabilities"].append(entry)
+
+ return report
+
+
+def probe_endpoint(url: str, *, timeout: int = 10) -> dict:
+ """HEAD-probe a declared capability endpoint via url_safety."""
+ out: dict = {"url": url, "reachable": False, "status_code": None, "error": None}
+ try:
+ validate_url_strict(url)
+ except URLSafetyError as exc:
+ out["error"] = f"ssrf-blocked: {exc}"
+ return out
+ try:
+ resp = safe_requests_get(url, timeout=timeout, allow_redirects=True)
+ out["status_code"] = resp.status_code
+ out["reachable"] = 200 <= resp.status_code < 500
+ except Exception as exc:
+ out["error"] = str(exc)
+ return out
+
+
+def audit_site(
+ site: str,
+ *,
+ probe_endpoints: bool = False,
+ timeout: int = 10,
+) -> dict:
+ """Fetch and audit a site's UCP profile. Returns a JSON-serializable dict."""
+ discovery = discovery_url_for(site)
+ report: dict = {
+ "site": site,
+ "discovery_url": discovery,
+ "profile_present": False,
+ "status_code": None,
+ "parse": None,
+ "endpoint_probes": [],
+ "summary": "",
+ }
+ try:
+ validate_url_strict(discovery)
+ except URLSafetyError as exc:
+ report["summary"] = f"discovery-url-blocked-by-url-safety: {exc}"
+ return report
+ try:
+ resp = safe_requests_get(discovery, timeout=timeout, allow_redirects=True)
+ except Exception as exc:
+ report["summary"] = f"fetch-failed: {exc}"
+ return report
+ report["status_code"] = resp.status_code
+ if resp.status_code == 404:
+ report["summary"] = "no-ucp-profile (forward-looking opportunity)"
+ return report
+ if resp.status_code >= 400:
+ report["summary"] = f"http-{resp.status_code} on discovery"
+ return report
+ report["profile_present"] = True
+ parsed = parse_profile(resp.text)
+ report["parse"] = parsed
+
+ if probe_endpoints and parsed.get("capabilities"):
+ for cap in parsed["capabilities"]:
+ endpoint = cap.get("endpoint")
+ if endpoint:
+ report["endpoint_probes"].append(probe_endpoint(endpoint, timeout=timeout))
+
+ n_caps = len(parsed.get("capabilities") or [])
+ n_issues = len(parsed.get("issues") or [])
+ report["summary"] = f"profile-found: {n_caps} capabilities, {n_issues} structural issues"
+ return report
+
+
+def _cli() -> None:
+ parser = argparse.ArgumentParser(description="UCP profile auditor")
+ parser.add_argument("site", help="Site root URL (e.g. https://store.example.com)")
+ parser.add_argument(
+ "--probe-endpoints",
+ action="store_true",
+ help="HEAD-probe each declared capability endpoint",
+ )
+ parser.add_argument(
+ "--timeout", type=int, default=10, help="Per-request timeout (seconds)"
+ )
+ parser.add_argument("--json", action="store_true", help="JSON output")
+ args = parser.parse_args()
+
+ report = audit_site(
+ args.site, probe_endpoints=args.probe_endpoints, timeout=args.timeout
+ )
+ if args.json:
+ print(json.dumps(report, indent=2))
+ sys.exit(0 if report.get("profile_present") else 0)
+
+ print(f"Site: {report['site']}")
+ print(f"Discovery: {report['discovery_url']}")
+ print(f"Status: {report['status_code']}")
+ print(f"Summary: {report['summary']}")
+ if report.get("parse"):
+ parsed = report["parse"]
+ print(f"Version: {parsed.get('version')}")
+ print(f"Capabilities ({len(parsed.get('capabilities') or [])}):")
+ for cap in parsed.get("capabilities") or []:
+ print(f" - {cap.get('id')} (v{cap.get('version')}) -> {cap.get('endpoint')}")
+ if parsed.get("issues"):
+ print(f"Structural issues: {', '.join(parsed['issues'])}")
+
+
+if __name__ == "__main__":
+ _cli()
diff --git a/scripts/url_safety.py b/scripts/url_safety.py
index 50ffa28..73bef2d 100644
--- a/scripts/url_safety.py
+++ b/scripts/url_safety.py
@@ -552,6 +552,8 @@ def _cli() -> None:
if args.json:
print(json.dumps(result, indent=2))
+ if result["ok"] != "true":
+ sys.exit(2)
else:
if result["ok"] == "true":
extra = f" -> {result['pinned_ip']}" if result["pinned_ip"] else ""
diff --git a/skills/seo-content/SKILL.md b/skills/seo-content/SKILL.md
index 1218525..2392027 100644
--- a/skills/seo-content/SKILL.md
+++ b/skills/seo-content/SKILL.md
@@ -15,6 +15,24 @@ metadata:
# Content Quality & E-E-A-T Analysis
+## Google's "Who / How / Why" Test (canonical heuristic)
+
+Before scoring E-E-A-T sub-factors, every page audit should pass Google's
+own three-question heuristic from the helpful-content guide:
+
+| Question | What to look for |
+|---|---|
+| **Who** created it? | Visible byline, author bio page, professional credentials. Required where readers expect it; non-negotiable for YMYL. |
+| **How** was it created? | Process disclosure where readers would reasonably ask — especially for AI-assisted content. Original research / first-hand evidence / lived experience. |
+| **Why** does it exist? | "To help people" rather than "to attract search clicks." Watch for niche entry without expertise, content churn for freshness signals, content written to a word-count target. |
+
+Primary source:
+https://developers.google.com/search/docs/fundamentals/creating-helpful-content
+
+When all three answers are weak, the page is at risk under the core ranking
+system's helpfulness signals (formerly the standalone Helpful Content System,
+merged into core during the March 2024 update).
+
## E-E-A-T Framework (updated Sept 2025 QRG)
Read `skills/seo/references/eeat-framework.md` for full criteria.
@@ -138,7 +156,7 @@ Optimize for AI search engines (ChatGPT, Perplexity, Google AI Overviews):
- **Multi-platform tracking:** Monitor visibility across Google AI Overviews, AI Mode, ChatGPT, Perplexity, and Bing Copilot, not just traditional rankings. Treat AI citation as a standalone KPI alongside organic rankings and traffic.
**Generative Engine Optimization (GEO):**
-GEO is the emerging discipline of optimizing content specifically for AI-generated answers. Key GEO signals include: quotability (clear, concise extractable facts), attribution (source citations within your content), structure (well-organized heading hierarchy), and freshness (regularly updated data). Cross-reference the `seo-geo` skill for detailed GEO workflows.
+Per Google's AI optimization guide, "AEO" and "GEO" are rebranded labels for SEO — AI Overviews and AI Mode are grounded in the same ranking and quality systems as classic Search. The optimization signals that matter (quotability, attribution, heading hierarchy, freshness) are SEO fundamentals applied to AI-search surfaces, not a separate discipline. Cross-reference the `seo-geo` skill for detailed workflows; both surfaces share the primary-source synthesis in `skills/seo-geo/references/google-ai-optimization-guide.md`.
## Content Freshness
diff --git a/skills/seo-ecommerce/SKILL.md b/skills/seo-ecommerce/SKILL.md
index 01fd39d..13cf22a 100644
--- a/skills/seo-ecommerce/SKILL.md
+++ b/skills/seo-ecommerce/SKILL.md
@@ -290,12 +290,41 @@ Validate and generate Product schema following Google's current requirements.
| Skill | Integration Point |
|-------|------------------|
| **seo-schema** | Delegates Product schema generation; reuses validation logic |
-| **seo-images** | Product image audit (alt text, format, dimensions) |
+| **seo-images** | Product image audit (alt text, format, dimensions) — plus `DigitalSourceType: TrainedAlgorithmicMedia` IPTC label for AI-generated product images (Merchant Center requirement) |
| **seo-content** | Product description E-E-A-T and uniqueness analysis |
| **seo-dataforseo** | Organic keyword rankings for gap analysis |
| **seo-technical** | Core Web Vitals for product pages (LCP on hero image) |
| **seo-google** | Google Merchant Center feed validation via GSC |
+## UCP — Universal Commerce Protocol (forward-looking)
+
+Google-led standard (co-developed with Shopify, Etsy, Walmart, Wayfair, Visa,
+Mastercard, etc.) for letting AI agents discover, negotiate, and transact with
+merchants without one-off integrations. Already powers direct buying from AI
+Mode and Gemini.
+
+Merchants already on **Google Merchant Center** with clean Product schema can
+declare a UCP profile at `/.well-known/ucp` listing capabilities
+(`dev.ucp.shopping.checkout`, `.fulfillment`, `.discount`). See
+`references/ucp-universal-commerce-protocol.md` for audit criteria,
+capability examples, and the relationship to AP2 (Agent Payments Protocol).
+
+### Audit command
+
+```bash
+# Discover and validate the UCP profile
+python scripts/ucp_check.py https://store.example.com --json
+
+# With endpoint reachability probes (HEAD each declared capability)
+python scripts/ucp_check.py https://store.example.com --probe-endpoints --json
+```
+
+The script returns: profile presence, version, declared capabilities,
+structural issues (missing fields, unknown capability IDs), and (with
+`--probe-endpoints`) per-endpoint reachability. SSRF-blocked endpoints are
+reported explicitly. Missing profile is reported as opportunity, not failure
+— UCP adoption is early.
+
---
## Error Handling
diff --git a/skills/seo-ecommerce/references/ucp-universal-commerce-protocol.md b/skills/seo-ecommerce/references/ucp-universal-commerce-protocol.md
new file mode 100644
index 0000000..606277b
--- /dev/null
+++ b/skills/seo-ecommerce/references/ucp-universal-commerce-protocol.md
@@ -0,0 +1,120 @@
+# UCP — Universal Commerce Protocol (May 2026)
+
+UCP is a Google-led open standard, co-developed with Shopify and endorsed by
+Etsy, Target, Walmart, Wayfair, plus payment partners (Stripe, Visa,
+Mastercard, Adyen, Amex). Its purpose: let **AI agents discover, negotiate,
+and transact with merchants without one-off integrations**.
+
+For commerce sites, UCP sits next to **Google Merchant Center feeds** and
+**Google Business Profile** as the third leg of agent-era discovery. Adoption
+is early but the cost of declaring a profile is low.
+
+**Primary source:** Google AI optimization guide references UCP; the spec
+itself is co-published at developer.google.com / merchant.google.com (consult
+Google for the current canonical URL — the standard is moving).
+
+## What UCP is and isn't
+
+| What it is | What it isn't |
+|---|---|
+| A capability-declaration + negotiation protocol | A new payment processor |
+| Transport-agnostic (REST, MCP, A2A) | A replacement for Merchant Center feeds |
+| Compatible with AP2 (Agent Payments Protocol) for cryptographic user-consent proof on autonomous purchases | A way to skip being merchant of record |
+| Adopted by AI Mode in Search and Gemini today | A "ranking factor" — Google has not framed it that way |
+
+Merchants stay **Merchant of Record** under UCP — they keep customer
+relationships and post-purchase ownership.
+
+## How to declare a UCP profile
+
+Publish a profile at `/.well-known/ucp` describing capabilities and versions.
+The general shape (consult the live spec for exact field names):
+
+```jsonc
+{
+ "version": "1.0",
+ "capabilities": [
+ {
+ "id": "dev.ucp.shopping.checkout",
+ "version": "1.0",
+ "endpoint": "https://api.example.com/ucp/checkout"
+ },
+ {
+ "id": "dev.ucp.shopping.fulfillment",
+ "version": "1.0",
+ "endpoint": "https://api.example.com/ucp/fulfillment"
+ },
+ {
+ "id": "dev.ucp.shopping.discount",
+ "version": "1.0",
+ "endpoint": "https://api.example.com/ucp/discount"
+ }
+ ],
+ "merchant": {
+ "name": "Example Co.",
+ "id": "merchant-center-id-here"
+ }
+}
+```
+
+Platforms (AI Mode in Search, Gemini, and eventually others) auto-discover
+the profile and negotiate. Google has built a reference implementation
+powering direct buying from AI Mode and Gemini.
+
+## Common capabilities to declare
+
+| Capability ID (shape) | Purpose |
+|---|---|
+| `dev.ucp.shopping.checkout` | Initiate checkout, return totals + payment intent |
+| `dev.ucp.shopping.fulfillment` | Quote shipping options and delivery windows |
+| `dev.ucp.shopping.discount` | Apply promo codes / loyalty discounts at quote time |
+| `dev.ucp.shopping.cart` | Add / remove / update items in agent-managed carts |
+
+Exact identifiers are governed by the live spec. The pattern is
+`dev.ucp.<domain>.<verb>` with semantic versioning.
+
+## What claude-seo audits
+
+`/seo ecommerce <url>` should report:
+
+1. **Presence:** does `/.well-known/ucp` resolve to a valid JSON document?
+2. **Capability coverage:** which capabilities are declared? Flag missing
+ checkout / fulfillment / discount as opportunities, not failures (the
+ protocol is early).
+3. **Endpoint reachability:** are declared endpoints HTTPS, valid TLS, not
+ returning 5xx?
+4. **Version coherence:** does the declared protocol version match a known
+ release? Flag pre-release or unrecognized versions.
+
+The audit should **not** score the absence of UCP as a critical failure today
+— adoption is early. Frame it as a forward-looking opportunity, especially
+for merchants already on Google Merchant Center.
+
+## How UCP interacts with existing surfaces
+
+| Existing surface | Relationship to UCP |
+|---|---|
+| Google Merchant Center feed | Required upstream — UCP capabilities reference Merchant Center products by ID |
+| Google Business Profile | Independent — UCP is product / order; GBP is store / location |
+| Product schema (`hasMerchantReturnPolicy`, `shippingDetails`) | Complementary — UCP exposes the same data at the API layer; schema exposes it at the page layer |
+| AP2 (Agent Payments Protocol) | Pair — UCP handles discovery + checkout structure; AP2 handles cryptographic proof of user consent |
+
+A merchant that already has clean Merchant Center feeds, complete Product
+schema, and a checkout API can declare a UCP profile in a sprint.
+
+## Audit posture
+
+- **Tier 1 (e-commerce sites already on Merchant Center):** recommend
+ declaring a UCP profile as a forward-looking opportunity.
+- **Tier 2 (DTC sites not on Merchant Center):** do not recommend UCP yet —
+ Merchant Center is the prerequisite to most flows.
+- **Tier 3 (informational / B2B sites):** ignore UCP entirely.
+
+## Last verified
+
+2026-05-18. The standard is moving fast. Re-check when:
+
+- The canonical spec URL stabilizes (currently published on Google developer
+ docs, but exact path may change).
+- AP2 reaches stable release.
+- Additional platforms (beyond AI Mode + Gemini) announce UCP consumption.
diff --git a/skills/seo-geo/SKILL.md b/skills/seo-geo/SKILL.md
index 1b953b1..8e49bc1 100644
--- a/skills/seo-geo/SKILL.md
+++ b/skills/seo-geo/SKILL.md
@@ -17,7 +17,24 @@ metadata:
category: seo
---
-# AI Search / GEO Optimization (February 2026)
+# AI Search / GEO Optimization (May 2026)
+
+## Primary Source: Google's AI Optimization Guide
+
+Google's official position, published under Search Central docs:
+
+> "Optimizing for generative AI search is **still SEO** from Google's
+> perspective. AEO and GEO are rebranded labels for the same work."
+
+Read `references/google-ai-optimization-guide.md` for the full synthesis,
+myth-busting list (`llms.txt`, chunking, AI-rephrasing, mention-farming —
+all rejected by Google as ineffective), and the Who/How/Why test for
+content quality.
+
+Audits should frame GEO findings as **SEO fundamentals applied to AI-search
+surfaces**, not as a separate optimization discipline. When community
+recommendations contradict Google's primary source, defer to Google and note
+the contradiction in the report.
## Key Statistics
@@ -146,6 +163,8 @@ Check `robots.txt` for these AI crawlers:
## llms.txt Standard
+Read `references/llmstxt-evidence.md` for the primary-source evidence (Mueller, Illyes, SE Ranking 300k-domain study, OtterlyAI server-log audit) on why `/llms.txt` is not currently a citation lever for major AI search systems. claude-seo reports presence but assigns no citation-ranking weight.
+
The emerging **llms.txt** standard provides AI crawlers with structured content guidance.
**Location:** `/llms.txt` (root of domain)
diff --git a/skills/seo-geo/references/google-ai-optimization-guide.md b/skills/seo-geo/references/google-ai-optimization-guide.md
new file mode 100644
index 0000000..adea8ba
--- /dev/null
+++ b/skills/seo-geo/references/google-ai-optimization-guide.md
@@ -0,0 +1,125 @@
+# Google AI Optimization Guide — primary-source synthesis (May 2026)
+
+Google published a dedicated **AI optimization guide** under Search Central
+docs. Its position is the most-cited primary source for how AI Overviews and
+AI Mode interact with Search ranking. Every claude-seo audit that touches GEO
+should treat this doc as the canonical reference and reject community claims
+that contradict it.
+
+**Primary source:**
+https://developers.google.com/search/docs/fundamentals/ai-optimization-guide
+
+## TL;DR
+
+> "Optimizing for generative AI search is **still SEO** from Google's
+> perspective. AEO and GEO are rebranded labels for the same work."
+> — Google, AI optimization guide
+
+AI Overviews and AI Mode are grounded in the same ranking and quality systems
+as classic Search. Two AI techniques layer on top:
+
+1. **RAG / grounding** — retrieves indexed pages, generates a response with
+ clickable source links.
+2. **Query fan-out** — issues multiple related sub-queries and pulls in
+ additional results before answering.
+
+**Eligibility floor:** a page must be **indexed and eligible to be shown with
+a snippet in Google Search** to appear in any AI feature. There is no separate
+"AI index". Everything that follows is SEO fundamentals applied through this
+lens.
+
+## The myth-busting section (most important)
+
+Google explicitly says you **do NOT need to**:
+
+| Claim Google rejects | Source |
+|---|---|
+| Create `llms.txt` or AI-specific markup files | AI optimization guide §"Myths" |
+| "Chunk" your content into small pieces for AI | Same |
+| Rewrite content for AI with specific phrasings or long-tail keyword variations | Same |
+| Chase inauthentic mentions across blogs / forums / videos | Same |
+| Over-invest in structured data specifically for AI features | Same |
+
+What **does** matter, per Google: unique, non-commodity, first-hand content.
+Their example contrasts "7 Tips for First-Time Homebuyers" (commodity) with
+"Why We Waived the Inspection & Saved Money: A Look Inside the Sewer Line"
+(lived experience).
+
+> **Cross-reference:** the llms.txt myth is independently confirmed by
+> [[llmstxt-evidence]] (Mueller, Illyes, SE Ranking 300k-domain study,
+> OtterlyAI server-log audit). Both files must stay aligned.
+
+## The "creating helpful content" companion guide
+
+The AI optimization guide links to Google's E-E-A-T guidance:
+
+**Primary source:**
+https://developers.google.com/search/docs/fundamentals/creating-helpful-content
+
+Key actionable test — **Who / How / Why**:
+
+- **Who** created it — bylines expected where readers expect them; author
+ background pages required for YMYL.
+- **How** it was created — especially for AI-assisted content; disclose
+ process where readers would reasonably ask.
+- **Why** it exists — "to help people," not "to attract search clicks."
+
+YMYL ("Your Money or Your Life") topics get extra weight: health, finance,
+safety. Sept 2025 QRG expanded YMYL to include political / social topics.
+
+Google's listed warning signs to self-audit against:
+
+- Writing to a target word count (there isn't one)
+- Entering niches with no expertise just for traffic
+- Faking publication-date freshness
+- Mass content churn for "freshness" signals
+
+## AI content policy
+
+**Primary source:**
+https://developers.google.com/search/blog/2023/02/google-search-and-ai-content
+(plus the Search Essentials spam policies)
+
+Generative AI content is fine if it meets Search Essentials. It crosses into
+spam when used to **scale low-value pages** (QRG §4.6.5 scaled content abuse,
+§4.6.6 low-effort main content).
+
+Two operational requirements with concrete enforcement surfaces:
+
+1. **Merchant Center — AI-generated product images:** must carry IPTC
+ `DigitalSourceType: TrainedAlgorithmicMedia` metadata. See
+ `skills/seo-images/SKILL.md` for the audit + injection pattern.
+2. **AI-generated product titles and descriptions:** must be separately
+ specified and labeled as AI-generated in the merchant feed.
+
+## Forward-looking: agent-friendly pages and WebMCP
+
+The AI optimization guide pivots near the end to **AI agents** — not just
+summarizers. Agents interact with sites through three channels: screenshots
+plus a vision model, raw HTML/DOM, and the browser accessibility tree.
+
+Full audit criteria: `skills/seo-technical/references/agent-friendly-pages.md`.
+
+The guide also name-drops **WebMCP** (proposed standard for direct
+site↔agent interaction) and **UCP** (Universal Commerce Protocol — Google +
+Shopify + Etsy + Walmart + Visa/Mastercard). UCP audit criteria:
+`skills/seo-ecommerce/references/ucp-universal-commerce-protocol.md`.
+
+## How claude-seo treats this guide
+
+1. `seo-geo` audits cite this URL as the authoritative source whenever the
+ user asks about AEO/GEO frameworks.
+2. The myth-busting list above gates community-sourced AI-SEO recommendations
+ — if a recommendation contradicts Google's stated position, flag it.
+3. Where a third-party claim and Google contradict, claude-seo defers to
+ Google and notes the contradiction explicitly.
+4. `seo-ecommerce` and `seo-images` enforce the two operational requirements
+ above for sites using AI to generate product content.
+
+## Last verified
+
+2026-05-18. Re-check the source doc each quarter. Update this file whenever:
+
+- Google publishes new myth-busting / clarification.
+- Any of the linked policy docs revise eligibility or enforcement language.
+- The UCP / WebMCP standards advance (currently early stage).
diff --git a/skills/seo-images/SKILL.md b/skills/seo-images/SKILL.md
index f8b799e..281096a 100644
--- a/skills/seo-images/SKILL.md
+++ b/skills/seo-images/SKILL.md
@@ -306,6 +306,62 @@ convert input.jpg \
**IMPORTANT:** WebP supports EXIF and XMP but NOT IPTC natively. For WebP files,
use XMP fields instead of IPTC. exiftool handles this conversion automatically.
+### AI-Generated Images: `DigitalSourceType` (Merchant Center requirement)
+
+For product images produced by generative AI, **Google Merchant Center requires**
+IPTC `DigitalSourceType: TrainedAlgorithmicMedia` metadata. This is an
+operational policy requirement, not a ranking factor — feeds missing this label
+on AI-generated imagery can be disapproved.
+
+Primary source:
+https://developers.google.com/search/docs/fundamentals/ai-optimization-guide
+(references the underlying Merchant Center policy on AI media labeling).
+
+**Audit command:**
+
+```bash
+# Audit a directory for the IPTC label (counts: missing, ai, captured, etc.)
+python scripts/iptc_ai_label.py audit ./images/ --json
+
+# Audit a single image
+python scripts/iptc_ai_label.py audit ./hero.webp --json
+
+# Inject the AI label into an image
+python scripts/iptc_ai_label.py inject ./ai-hero.webp \
+ --source-type trainedAlgorithmicMedia
+
+# Other vocabulary values:
+# compositeSynthetic (mix of captured + AI elements)
+# digitalCapture (fully captured photograph)
+```
+
+**Raw exiftool equivalents** (for ad-hoc usage):
+
+```bash
+# Inject manually
+exiftool \
+ -XMP-iptcExt:DigitalSourceType="https://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia" \
+ ai-generated-product.jpg
+
+# Audit: find images missing the label across a directory
+exiftool -if 'not $XMP-iptcExt:DigitalSourceType' \
+ -filename -DigitalSourceType *.jpg *.webp *.png
+```
+
+The IPTC vocabulary also defines:
+- `trainedAlgorithmicMedia` — fully AI-generated (use this for diffusion-model
+ product imagery)
+- `compositeSynthetic` — mixes captured + AI-generated elements
+- `digitalCapture` — fully captured photograph (no AI element)
+
+When `/seo images optimize` is run on AI-generated assets, prompt the user to
+confirm the source type and inject the matching IPTC value automatically.
+
+For **AI-generated product titles and descriptions**, Google Merchant Center
+also requires the AI-generated text to be separately specified and labeled in
+the feed. This is enforced at the feed layer, not the page layer — flag this
+in cross-reference with `seo-ecommerce`.
+
### Metadata Audit
```bash
diff --git a/skills/seo-technical/SKILL.md b/skills/seo-technical/SKILL.md
index 572e7dc..8aafa44 100644
--- a/skills/seo-technical/SKILL.md
+++ b/skills/seo-technical/SKILL.md
@@ -133,6 +133,35 @@ Google updated its JavaScript SEO documentation in December 2025 with critical c
- Supported by search engines other than Google
- Recommend implementation for faster indexing on non-Google engines
+## Agent-Friendly Pages (forward-looking)
+
+AI agents (not just AI summarizers) increasingly read sites through three
+channels: vision models on screenshots, raw HTML/DOM, and the **accessibility
+tree** (the cleanest signal). Audit criteria — semantic HTML (real `<button>`
+and `<a>`, not `<div onclick>`), label associations, interactive target sizing,
+layout stability across templates, `cursor: pointer` correctness — live in
+`references/agent-friendly-pages.md`.
+
+### Audit command
+
+```bash
+# Render with Playwright + capture accessibility tree, then score
+python scripts/agent_ux_check.py https://example.com --json
+```
+
+The scanner outputs an Agent-UX score (0-100) plus itemized issues:
+- HTML findings: real buttons / anchors, `<div onclick>` widgets, semantic
+ landmarks, inputs without `<label for>`, inputs without ARIA labels
+- Accessibility tree findings: total nodes, interactive nodes, unnamed
+ interactive elements, `role="generic"` ratio
+
+The accessibility-tree snapshot uses Playwright's
+`page.accessibility.snapshot(interesting_only=False)`. To capture the tree
+without scoring, use `python scripts/render_page.py <url> --a11y-tree --json`.
+
+Surface findings as **opportunities**, not failures. The standards (WebMCP,
+agent UX heuristics) are early — don't gate audits on a sub-100 score.
+
## Output
### Technical Score: XX/100
diff --git a/skills/seo-technical/references/agent-friendly-pages.md b/skills/seo-technical/references/agent-friendly-pages.md
new file mode 100644
index 0000000..688de09
--- /dev/null
+++ b/skills/seo-technical/references/agent-friendly-pages.md
@@ -0,0 +1,137 @@
+# Agent-friendly pages — audit reference (May 2026)
+
+The next wave of AI search is not summarization — it's **agents** acting on the
+user's behalf (search, compare, buy, book). Google's AI optimization guide and
+the linked web.dev article describe three channels through which agents
+interpret your site:
+
+1. **Screenshots + vision model** — interprets visual hierarchy, button
+ prominence, layout. Slow and token-expensive.
+2. **Raw HTML / DOM** — nesting, IDs, classes, data attributes.
+3. **The accessibility tree** — the browser-native semantic distillation
+ (roles, names, states). The cleanest signal of the three.
+
+Modern agents combine all three. Optimizing for the **accessibility tree** is
+the single highest-leverage move; if your accessibility tree is broken, no
+amount of visual polish saves you.
+
+**Primary sources:**
+- Google AI optimization guide:
+ https://developers.google.com/search/docs/fundamentals/ai-optimization-guide
+- web.dev (referenced from the guide above): article on building
+ agent-friendly websites
+
+## Audit checklist
+
+### 1. Use real interactive elements
+
+| Pass | Fail |
+|---|---|
+| `<button>` for actions | `<div onclick="...">` |
+| `<a href="...">` for navigation | `<div onclick="window.location...">` |
+| `<input>` / `<select>` / `<textarea>` | Custom `contenteditable` widgets |
+
+If you cannot use a real interactive tag, supply ARIA: `role="button"`,
+`role="link"`, `tabindex="0"`, plus key handlers for `Enter` and `Space`.
+
+**Why it matters:** the accessibility tree exposes real interactive elements
+with their roles. Custom div widgets often appear in the tree with no role at
+all — agents skip them.
+
+### 2. Label associations
+
+Every form input must have an associated label:
+
+```html
+<label for="email">Email</label>
+<input id="email" type="email" name="email">
+```
+
+Or use `aria-label` / `aria-labelledby` where a visible label isn't possible.
+Agents that read the accessibility tree get the field purpose directly from
+the associated label — without it, the input is a void.
+
+### 3. Interactive target size
+
+Visual-analysis pipelines filter out interactive elements smaller than **~8
+square pixels** of unobscured area. Tap-target accessibility minimums (24×24
+WCAG AA, 44×44 Apple HIG) are stricter and pass the agent gate by default.
+
+Audit: any clickable element below 24×24px is a candidate for agent
+invisibility, in addition to the WCAG failure.
+
+### 4. Don't cover interactive nodes with transparent overlays
+
+Vision models discard covered nodes when computing what's "interactive at this
+position". Common offenders:
+
+- Full-card click handlers that overlay every child link.
+- Transparent cookie-consent layers persisting beyond consent.
+- Modal portals with `pointer-events: auto` left on after dismiss.
+- "Ghost" tracking pixels with `position: absolute; inset: 0`.
+
+### 5. Layout stability
+
+If "Add to cart" lives in different positions on `/category/shoes` vs
+`/category/bags`, screenshot-based agents have to relearn the page each
+visit. Keep functionally identical actions in the same screen quadrant across
+templates.
+
+Cross-reference: this overlaps with **CLS** (Cumulative Layout Shift) in Core
+Web Vitals, but the agent-UX concern is broader — it covers page-to-page
+stability, not just within-page shift.
+
+### 6. `cursor: pointer` as a legitimate signal
+
+Vision models read `cursor: pointer` (set by default on `<a>` / `<button>`) as
+a hint that an element is actionable. Do not override it to `cursor: default`
+on truly interactive elements just for visual minimalism.
+
+Inverse: do not apply `cursor: pointer` to non-interactive elements — that
+makes agents click things that do nothing.
+
+### 7. Stable, meaningful selectors
+
+Agents that fall back to DOM parsing rely on:
+
+- Real semantic tags (`<nav>`, `<main>`, `<article>`, `<section>`, `<aside>`)
+- Stable `id` attributes on top-level layout containers
+- `data-*` attributes that describe purpose, not implementation
+
+Avoid auto-generated class names like `__sc_a4b7d9e2` as the only handle on a
+critical interactive element — agents can target them but cannot tell what
+they mean.
+
+## Forward-looking: WebMCP
+
+Google's AI optimization guide name-drops **WebMCP**, a proposed standard for
+direct site-to-agent interaction (analogous to MCP in the Claude / Anthropic
+ecosystem, but operating at the page level). There is an early preview
+program; broad adoption is not expected before 2027.
+
+**Audit posture:** mention WebMCP in reports as a forward-looking signal worth
+tracking. Do not flag the absence of WebMCP support as a finding — the
+standard is not yet stable.
+
+## Quick-audit one-liner
+
+For a fast smoke check, capture the accessibility tree via Lighthouse or
+Chrome DevTools and look for:
+
+- Any interactive element with `role="generic"` → broken semantics.
+- Any input without an `accessible name` → missing label.
+- Any `<div>` with `onclick` and no `role` / `tabindex` → custom widget that
+ agents won't see.
+
+`scripts/render_page.py --mode auto` already loads pages headlessly; extending
+it with an accessibility-tree dump (`page.accessibility.snapshot()` in
+Playwright) is the natural place to land an automated agent-UX check in a
+future iteration.
+
+## Last verified
+
+2026-05-18. Update when:
+
+- WebMCP graduates from preview to stable.
+- Google publishes a separate agent-UX scoring framework.
+- web.dev publishes a follow-up article with revised criteria.
diff --git a/skills/seo/SKILL.md b/skills/seo/SKILL.md
index 094c1b3..9b6feee 100644
--- a/skills/seo/SKILL.md
+++ b/skills/seo/SKILL.md
@@ -68,12 +68,35 @@ When the user invokes `/seo audit`, delegate to subagents in parallel:
10. If drift baseline exists for this URL (`python scripts/drift_history.py <url>`), also spawn seo-drift agent
11. Always include seo-sxo in full audits (search experience applies to all sites)
12. Collect results and generate unified report with SEO Health Score (0-100)
-13. Create prioritized action plan (Critical -> High -> Medium -> Low)
-14. **Offer PDF report**: "Generate a professional PDF report? Use `/seo google report full`"
+13. **Synthesize via the 10-principle framework** (see "Synthesis Methodology" below) — walk PERCEIVE → ANALYZE → VALIDATE → ACT before bucketing findings into Critical / High / Medium / Low
+14. Create prioritized action plan with dependency sequencing + falsifiability per recommendation
+15. **Offer PDF report**: "Generate a professional PDF report? Use `/seo google report full`"
For individual commands, load the relevant sub-skill directly.
After any analysis command completes, offer to generate a PDF report via `scripts/google_report.py`.
+## Synthesis Methodology
+
+Audits are not just findings — they are findings synthesized into a coherent
+strategy. claude-seo uses a 10-principle thinking framework grouped into four
+phases: **PERCEIVE** (observe-external · observe-internal · listen),
+**ANALYZE** (think · connect-lateral · connect-system), **VALIDATE** (feel ·
+accept), **ACT** (create · grow).
+
+Full audits (`/seo audit`, `/seo page`) walk every phase before emitting the
+action plan. Narrower commands (`/seo schema`, `/seo images`, etc.) pass at
+least THINK + ACCEPT before emitting (sound first principle, surfaced
+falsifiability). The Critical / High / Medium / Low priority buckets are the
+**output** of validation, not a substitute for it.
+
+Full methodology + per-principle SEO mapping: `references/thinking-framework.md`.
+
+Each emitted recommendation should carry:
+- The first-principle observation it rests on (THINK)
+- The dependency on / unblock relationship to other recommendations (CONNECT-system)
+- An explicit "how would we know this failed?" check (ACCEPT)
+- A leading indicator the user can monitor without re-running the audit (GROW)
+
## Industry Detection
Detect business type from homepage signals:
diff --git a/skills/seo/references/thinking-framework.md b/skills/seo/references/thinking-framework.md
new file mode 100644
index 0000000..95301d8
--- /dev/null
+++ b/skills/seo/references/thinking-framework.md
@@ -0,0 +1,238 @@
+# The 10-Principle Audit Synthesis Framework
+
+This is the canonical methodology claude-seo uses to assemble raw findings
+into strategically coherent recommendations. Every full-site audit and
+deep-page analysis walks through these ten principles before producing the
+final action plan.
+
+The principles group into four phases:
+
+| Phase | Principles |
+|---|---|
+| **PERCEIVE** | OBSERVE (external) · OBSERVE (internal) · LISTEN |
+| **ANALYZE** | THINK · CONNECT (lateral) · CONNECT (system) |
+| **VALIDATE** | FEEL · ACCEPT |
+| **ACT** | CREATE · GROW |
+
+A recommendation that has not passed through all four phases is a finding,
+not a recommendation.
+
+---
+
+## PERCEIVE
+
+### 1. OBSERVE — the external input
+
+Collect signals without interpreting them. For a website audit this means:
+
+- Raw HTML + rendered HTML (via `scripts/render_page.py`)
+- Schema.org markup actually present (via `seo-schema`)
+- SERP visibility for the site's published topics (via `seo-dataforseo` /
+ Google APIs when available)
+- Backlink + brand-mention landscape (via `seo-backlinks`)
+- Core Web Vitals field data from CrUX (via `scripts/pagespeed_check.py`)
+- AI-search citation patterns (via `seo-geo`)
+- Competitor pages on the target's primary keywords
+
+**Discipline:** do not score yet. Do not classify yet. Just collect.
+
+### 2. OBSERVE — internal metacognition
+
+Audit your own assumptions about the site before assembling
+recommendations. Common assumption traps in SEO:
+
+- Assuming the homepage represents the site (often it doesn't —
+ programmatic pages or category pages drive traffic)
+- Assuming "low traffic" means "low value" (intent-matched low-volume can
+ outconvert high-volume informational queries)
+- Assuming the brand wants what the analyst thinks is "best practice"
+ (their constraint might be brand voice, legal, or trade-offs you don't
+ see)
+- Assuming a CMS limitation is unfixable (often it isn't)
+- Assuming a 1.x finding still applies in 2.x (Google updates change the
+ ground)
+
+**Discipline:** for each major recommendation, ask "what assumption is
+this resting on?" If the answer surprises you, surface the assumption in
+the report so the user can reject it explicitly.
+
+### 3. LISTEN — active receptivity
+
+Read what the site, user intent, and platform signals are actually saying
+— not what you expect them to say.
+
+- Read the page's existing copy before recommending a rewrite. The brand
+ voice is data.
+- Read the SERP for target keywords before deciding what page type to
+ build. The SERP is Google's revealed preference for that intent.
+- Read user reviews / community discussions / Reddit threads for what
+ customers actually ask about (versus what the marketing team thinks
+ they ask about).
+- Read the user's prior conversations + memory if available — they may
+ have ruled out approaches already.
+
+**Discipline:** if a recommendation contradicts the SERP for the same
+intent, the SERP wins unless you can explain why this site is the
+exception.
+
+---
+
+## ANALYZE
+
+### 4. THINK — critical processing
+
+Reduce the findings to first principles:
+
+- What is the **page type** (informational, transactional, navigational,
+ local, commercial-investigation) and does the current layout serve
+ that intent?
+- What is the **eligibility floor** for AI features (indexed + can be
+ shown with a snippet)? If the page is not indexed, no AI work
+ matters yet.
+- What is the **highest-leverage constraint** binding the site right
+ now? (Often: a single technical defect — non-indexable, slow LCP,
+ missing canonical — that gates everything else.)
+- What does **Google's primary-source guidance** say about the
+ recommendation? When community claims and Google contradict, defer
+ to Google (see `skills/seo-geo/references/google-ai-optimization-guide.md`).
+
+**Discipline:** the highest-leverage constraint goes first in the action
+plan, even if it's less interesting than the "growth" recommendations.
+
+### 5. CONNECT — lateral / associative
+
+Combine findings from sub-skills that the user wouldn't naturally pair.
+Examples that frequently produce the highest-value recommendations:
+
+- `seo-content` thin-content finding × `seo-cluster` SERP-overlap data →
+ consolidate three weak pages into one cluster hub.
+- `seo-schema` missing Product schema × `seo-ecommerce` UCP-not-declared
+ → both close the same agent-era buying gap; bundle as one
+ recommendation.
+- `seo-geo` low AI-citation rate × `seo-backlinks` brand-mention
+ underweight → mentions matter 3× more than backlinks for AI
+ citations; reframe link-building budget into PR / Reddit / YouTube.
+- `seo-technical` SPA detection × `seo-content` missing main-content
+ → JS-blocked content is the upstream cause of the content finding.
+
+**Discipline:** any single sub-skill finding that survives connection
+unchanged should be skeptical — it might be a symptom, not a cause.
+
+### 6. CONNECT — system orchestration
+
+Wire the validated recommendations into an executable sequence:
+
+- Which recommendation **unblocks** the most others? Do that first.
+- Which recommendations **depend** on each other? Sequence them.
+- Which recommendations can be **parallelized**? Surface that to the
+ user so they can dispatch them.
+- Which recommendations need a **tool that's not yet installed** (e.g.
+ Firecrawl for site crawl, DataForSEO for SERP data)? Flag the gap.
+
+**Discipline:** the action plan is a dependency graph, not a list. If
+two recommendations cannot be done in either order, say so.
+
+---
+
+## VALIDATE
+
+### 7. FEEL — emotional intelligence + intuition
+
+Pure-logic recommendations break on contact with the actual reader /
+business / stakeholder. Pressure-test against:
+
+- **User experience.** Would the recommendation make the page worse for
+ a human reader? (Common failure: stuffing FAQ schema for a site Google
+ doesn't even show rich results for.)
+- **Brand voice.** Would the recommendation conflict with the site's
+ existing tone? (Common failure: recommending "answer-first" rewrites
+ on a luxury brand that uses suspense as a UX device.)
+- **Operator capacity.** Is this realistic for the team that has to ship
+ it? (Common failure: recommending 30 new location pages to a 2-person
+ agency.)
+- **Hard-earned intuition.** When the data is ambiguous, trust pattern
+ recognition from past sites in the same vertical.
+
+**Discipline:** if you can't articulate the human cost of a
+recommendation, you haven't fully validated it.
+
+### 8. ACCEPT — intellectual humility
+
+Each recommendation should carry the falsifiability that comes with
+honesty:
+
+- If the hypothesis behind the recommendation is wrong, what would
+ prove it? (Set a measurable check.)
+- If the user has tried this and it didn't work before, surface that.
+ Don't re-recommend the same thing.
+- If a constraint cannot be removed (legal, brand, technical), the
+ recommendation has to pivot — not double down.
+- If a v1 recommendation is now stale because Google's guidance shifted,
+ retract it explicitly.
+
+**Discipline:** every recommendation gets a "how would we know this
+failed?" line. No invisible bets.
+
+---
+
+## ACT
+
+### 9. CREATE — generative output
+
+Stop strategizing. Produce the artifact:
+
+- A markdown report with prioritized actions, dependencies, and
+ measurable outcomes.
+- Generated schema JSON-LD ready to paste into the site.
+- A content brief with target keywords, outline, and internal links.
+- A PDF via `scripts/google_report.py` when the user asks for one.
+- The smallest implementation of the highest-leverage recommendation,
+ not the full plan.
+
+**Discipline:** ship the artifact. Analysis paralysis is the enemy.
+
+### 10. GROW — iterative loop
+
+The audit is a snapshot, not a verdict. Build the feedback loop:
+
+- Capture a baseline via `/seo drift baseline <url>` so subsequent
+ audits can prove what changed.
+- Define one or two leading indicators the user should monitor (CrUX
+ trend, GSC impressions for a target cluster, brand-mention growth on
+ Reddit / YouTube).
+- Schedule a re-audit cadence appropriate to the site's velocity
+ (weekly for a high-churn ecommerce; quarterly for a B2B SaaS).
+- Surface what claude-seo itself **could not measure** (offline
+ conversion, brand lift, customer interviews) so the human closes
+ those loops.
+
+**Discipline:** the last paragraph of every audit names what the next
+audit should look for.
+
+---
+
+## How to invoke the framework
+
+Every full-site audit (`/seo audit`) and deep-page audit (`/seo page`)
+walks through PERCEIVE → ANALYZE → VALIDATE → ACT before emitting the
+action plan. The Critical / High / Medium / Low priority bucketing
+happens **after** the validation phase, not instead of it.
+
+Single-purpose commands (`/seo schema`, `/seo images`, `/seo technical`,
+etc.) can skip the full loop when the user is asking a narrow question
+— but their recommendations should still pass at least THINK + ACCEPT
+before being emitted (does this rest on a sound first principle, and is
+the falsifiability surfaced?).
+
+## When to escalate to the user
+
+These principles are claude-seo's; they are not the user's. Surface them
+for the user when:
+
+- A recommendation requires accepting an assumption you'd rather not own
+ (CONNECT-lateral often produces these — surface the link and let the
+ user confirm).
+- The validation phase flagged a brand-voice / operator-capacity / hard
+ constraint you can see but cannot resolve.
+- The audit found no upstream constraint and is recommending an
+ optimization that may be premature.
diff --git a/tests/test_manifest_consistency.py b/tests/test_manifest_consistency.py
index 9a96020..7fa0b22 100644
--- a/tests/test_manifest_consistency.py
+++ b/tests/test_manifest_consistency.py
@@ -373,3 +373,62 @@ def test_canonical_math_adds_up():
f"plugin.json canonical phrasing breakdown {breakdown!r} sums to "
f"{sum(parts)} but headline claims {headline}. Math must add up."
)
+
+
+def test_reference_files_have_at_least_one_link():
+ """Every skills/*/references/*.md file must be cited somewhere in the repo.
+
+ Guards against orphan reference files — docs on disk that no SKILL.md,
+ agent, top-level doc, or other reference file actually links to. Catches
+ drift like the v2.0.0-era incident where llmstxt-evidence.md landed in
+ references/ but was reachable only through a sibling cross-link, not
+ through its parent SKILL.md.
+
+ Cross-skill references are legitimate (e.g. skills/seo/references/
+ backlink-quality.md is cited from seo-backlinks/SKILL.md) so the search
+ is repo-wide rather than per-parent-skill.
+
+ Searches the full filename (`name.md`) and the Obsidian-style wikilink
+ form (`[[name]]`) across: every SKILL.md, every agent .md, every doc/*.md,
+ top-level README/CHANGELOG/CLAUDE/AGENTS/CONTRIBUTING, and every other
+ reference file. Each reference is excluded from its own search.
+ """
+ ref_files = list((REPO_ROOT / "skills").glob("*/references/*.md"))
+ if not ref_files:
+ return # no references at all — nothing to check
+
+ search_paths: list[Path] = []
+ search_paths += list((REPO_ROOT / "skills").glob("*/SKILL.md"))
+ search_paths += list((REPO_ROOT / "agents").glob("*.md"))
+ search_paths += list((REPO_ROOT / "docs").glob("*.md"))
+ for doc in ("README.md", "CHANGELOG.md", "CLAUDE.md",
+ "AGENTS.md", "CONTRIBUTING.md"):
+ candidate = REPO_ROOT / doc
+ if candidate.exists():
+ search_paths.append(candidate)
+ # Reference files can cite each other (e.g. via [[wikilink]]).
+ search_paths += ref_files
+
+ text_by_path = {p: p.read_text() for p in search_paths}
+
+ orphans = []
+ for ref in ref_files:
+ slug = ref.stem # 'llmstxt-evidence'
+ filename = ref.name # 'llmstxt-evidence.md'
+ wikilink = f"[[{slug}]]"
+ found = False
+ for other_path, text in text_by_path.items():
+ if other_path == ref:
+ continue
+ if filename in text or wikilink in text:
+ found = True
+ break
+ if not found:
+ orphans.append(str(ref.relative_to(REPO_ROOT)))
+
+ assert not orphans, (
+ "Orphan reference files (on disk, not cited anywhere repo-wide):\n "
+ + "\n ".join(orphans)
+ + "\n\nFix: link the file from its parent SKILL.md, a related "
+ "reference doc, or a top-level doc — or delete if obsolete."
+ )
diff --git a/tests/test_parasite_risk_and_extensions.py b/tests/test_parasite_risk_and_extensions.py
index 56894e1..904aca7 100644
--- a/tests/test_parasite_risk_and_extensions.py
+++ b/tests/test_parasite_risk_and_extensions.py
@@ -133,6 +133,24 @@ def test_extension_install_script_is_executable(name: str) -> None:
assert mode & stat.S_IXUSR, f"{name}/install.sh must be executable for chmod"
+def test_every_extension_install_and_uninstall_is_executable() -> None:
+ """All extensions ship executable install.sh + uninstall.sh — including v1 ones."""
+ ext_root = _REPO_ROOT / "extensions"
+ failures = []
+ for ext in sorted(p for p in ext_root.iterdir() if p.is_dir()):
+ for script_name in ("install.sh", "uninstall.sh"):
+ script = ext / script_name
+ if not script.exists():
+ continue
+ mode = script.stat().st_mode
+ if not (mode & stat.S_IXUSR):
+ failures.append(f"{ext.name}/{script_name}")
+ assert not failures, (
+ "Extension scripts missing user-exec bit (chmod +x):\n "
+ + "\n ".join(failures)
+ )
+
+
@pytest.mark.parametrize(
"name,skill_dir",
[
diff --git a/tests/test_phase_j_executable.py b/tests/test_phase_j_executable.py
new file mode 100644
index 0000000..730b533
--- /dev/null
+++ b/tests/test_phase_j_executable.py
@@ -0,0 +1,351 @@
+"""
+Tests for Phase J executable layer:
+ scripts/ucp_check.py — UCP profile discovery + validation
+ scripts/iptc_ai_label.py — IPTC DigitalSourceType audit + inject
+ scripts/agent_ux_check.py — agent-friendly page scorer
+ scripts/render_page.py — extract_accessibility extension
+
+Tests are pure (no network, no exiftool, no Playwright). External
+dependencies are either mocked or short-circuited via the public API
+surface of each script.
+"""
+
+from __future__ import annotations
+
+import json
+import sys
+from pathlib import Path
+from unittest import mock
+
+import pytest
+
+_REPO_ROOT = Path(__file__).resolve().parents[1]
+_SCRIPTS = _REPO_ROOT / "scripts"
+if str(_SCRIPTS) not in sys.path:
+ sys.path.insert(0, str(_SCRIPTS))
+
+import agent_ux_check # noqa: E402
+import iptc_ai_label # noqa: E402
+import render_page # noqa: E402
+import ucp_check # noqa: E402
+
+
+# ---------------------------------------------------------------------------
+# ucp_check
+# ---------------------------------------------------------------------------
+
+
+def test_discovery_url_for_normalizes_to_well_known():
+ assert (
+ ucp_check.discovery_url_for("https://store.example.com")
+ == "https://store.example.com/.well-known/ucp"
+ )
+ # Bare hostname gets https:// prefixed.
+ assert (
+ ucp_check.discovery_url_for("store.example.com")
+ == "https://store.example.com/.well-known/ucp"
+ )
+ # Path on the input is discarded.
+ assert (
+ ucp_check.discovery_url_for("https://store.example.com/path/here")
+ == "https://store.example.com/.well-known/ucp"
+ )
+
+
+def test_parse_profile_rejects_malformed_json():
+ report = ucp_check.parse_profile("{ not json")
+ assert report["valid_json"] is False
+ assert any("invalid-json" in issue for issue in report["issues"])
+
+
+def test_parse_profile_valid_minimal_profile():
+ payload = json.dumps({
+ "version": "1.0",
+ "merchant": {"name": "Example Co.", "id": "MC-42"},
+ "capabilities": [
+ {
+ "id": "dev.ucp.shopping.checkout",
+ "version": "1.0",
+ "endpoint": "https://api.example.com/ucp/checkout",
+ }
+ ],
+ })
+ report = ucp_check.parse_profile(payload)
+ assert report["valid_json"] is True
+ assert report["version"] == "1.0"
+ assert report["merchant"] == {"name": "Example Co.", "id": "MC-42"}
+ assert len(report["capabilities"]) == 1
+ assert report["capabilities"][0]["id"] == "dev.ucp.shopping.checkout"
+ assert report["issues"] == []
+
+
+def test_parse_profile_flags_missing_fields_and_unknown_capability():
+ payload = json.dumps({
+ "capabilities": [
+ {
+ "id": "dev.ucp.unknown.thing",
+ # missing version, missing endpoint
+ },
+ {
+ # missing id
+ "version": "1.0",
+ "endpoint": "https://api.example.com/x",
+ },
+ ],
+ })
+ report = ucp_check.parse_profile(payload)
+ assert "missing-version" in report["issues"]
+ assert "missing-merchant" in report["issues"]
+ assert "dev.ucp.unknown.thing" in report["unknown_capabilities"]
+ cap0 = report["capabilities"][0]
+ assert "missing-version" in cap0["issues"]
+ assert "missing-endpoint" in cap0["issues"]
+ cap1 = report["capabilities"][1]
+ assert "missing-id" in cap1["issues"]
+
+
+def test_parse_profile_rejects_non_object_root():
+ report = ucp_check.parse_profile(json.dumps(["not", "an", "object"]))
+ assert "profile-not-object" in report["issues"]
+
+
+def test_known_capabilities_cover_core_commerce_verbs():
+ # Sanity check on the documented vocabulary.
+ for cap in ("dev.ucp.shopping.checkout",
+ "dev.ucp.shopping.fulfillment",
+ "dev.ucp.shopping.discount"):
+ assert cap in ucp_check.KNOWN_CAPABILITIES
+
+
+# ---------------------------------------------------------------------------
+# iptc_ai_label
+# ---------------------------------------------------------------------------
+
+
+def test_iptc_vocab_contains_required_merchant_center_value():
+ # Google Merchant Center requires this exact label on AI-generated images.
+ assert "trainedAlgorithmicMedia" in iptc_ai_label.IPTC_VOCAB
+ uri = iptc_ai_label.IPTC_VOCAB["trainedAlgorithmicMedia"]
+ assert uri.startswith("https://cv.iptc.org/")
+ assert uri.endswith("/trainedAlgorithmicMedia")
+
+
+def test_audit_reports_target_not_found(tmp_path):
+ report = iptc_ai_label.audit(tmp_path / "nope.jpg")
+ assert report["summary"] == {"error": "target-not-found"}
+
+
+def test_audit_reports_exiftool_unavailable(tmp_path, monkeypatch):
+ # Create a real file so we get past the target-exists check.
+ img = tmp_path / "a.jpg"
+ img.write_bytes(b"\xff\xd8\xff\xd9") # tiny stub
+ monkeypatch.setattr(iptc_ai_label, "exiftool_available", lambda: False)
+ report = iptc_ai_label.audit(img)
+ assert report["summary"] == {"error": "exiftool-not-installed"}
+
+
+def test_inject_rejects_unknown_source_type(tmp_path):
+ img = tmp_path / "a.jpg"
+ img.write_bytes(b"\xff\xd8\xff\xd9")
+ out = iptc_ai_label.inject(img, "totallyMadeUpType")
+ assert out["ok"] is False
+ assert "unknown source_type" in out["error"]
+
+
+def test_inject_reports_missing_exiftool(tmp_path, monkeypatch):
+ img = tmp_path / "a.jpg"
+ img.write_bytes(b"\xff\xd8\xff\xd9")
+ monkeypatch.setattr(iptc_ai_label, "exiftool_available", lambda: False)
+ out = iptc_ai_label.inject(img, "trainedAlgorithmicMedia")
+ assert out["ok"] is False
+ assert out["error"] == "exiftool-not-installed"
+
+
+def test_inject_succeeds_when_subprocess_returns_zero(tmp_path, monkeypatch):
+ img = tmp_path / "a.jpg"
+ img.write_bytes(b"\xff\xd8\xff\xd9")
+ monkeypatch.setattr(iptc_ai_label, "exiftool_available", lambda: True)
+
+ fake_result = mock.Mock(returncode=0, stdout="ok", stderr="")
+ with mock.patch.object(iptc_ai_label.subprocess, "run", return_value=fake_result):
+ out = iptc_ai_label.inject(img, "trainedAlgorithmicMedia")
+ assert out["ok"] is True
+ assert out["error"] is None
+
+
+def test_audit_classifies_files_via_mocked_exiftool(tmp_path, monkeypatch):
+ # Lay out three images: one labeled correctly, one unlabeled, one with a
+ # different source type. Mock _read_source_type to return canned values.
+ for name in ("ai.jpg", "missing.jpg", "real.jpg"):
+ (tmp_path / name).write_bytes(b"\xff\xd8\xff\xd9")
+
+ monkeypatch.setattr(iptc_ai_label, "exiftool_available", lambda: True)
+ values = {
+ tmp_path / "ai.jpg": (
+ "https://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia"
+ ),
+ tmp_path / "missing.jpg": None,
+ tmp_path / "real.jpg": (
+ "https://cv.iptc.org/newscodes/digitalsourcetype/digitalCapture"
+ ),
+ }
+ monkeypatch.setattr(iptc_ai_label, "_read_source_type",
+ lambda p: values[p])
+ report = iptc_ai_label.audit(tmp_path)
+ summary = report["summary"]
+ assert summary["total"] == 3
+ assert summary["trainedAlgorithmicMedia"] == 1
+ assert summary["digitalCapture"] == 1
+ assert summary["missing"] == 1
+
+
+# ---------------------------------------------------------------------------
+# agent_ux_check
+# ---------------------------------------------------------------------------
+
+
+def test_analyze_html_counts_semantic_tags_and_widgets():
+ html = """
+ <html><body>
+ <nav><a href="/x">x</a></nav>
+ <main>
+ <button>Click</button>
+ <button>Other</button>
+ <div onclick="doThing()">Fake button</div>
+ </main>
+ </body></html>
+ """
+ findings = agent_ux_check.analyze_html(html)
+ assert findings["real_buttons"] == 2
+ assert findings["real_anchors"] == 1
+ assert findings["div_onclick_widgets"] == 1
+ assert findings["semantic_landmarks"] >= 2 # nav + main
+
+
+def test_analyze_html_detects_unlabeled_inputs():
+ html = """
+ <form>
+ <label for="email">Email</label>
+ <input id="email" type="email">
+ <input id="phone" type="tel">
+ </form>
+ """
+ findings = agent_ux_check.analyze_html(html)
+ # phone has no <label for="phone"> — should count as unlabeled.
+ assert findings["inputs_without_label"] == 1
+ # Both inputs lack ARIA labels (one has visible label, but no aria-*).
+ assert findings["inputs_without_aria"] >= 1
+
+
+def test_analyze_accessibility_tree_handles_none_input():
+ findings = agent_ux_check.analyze_accessibility_tree(None)
+ assert findings["tree_present"] is False
+ assert findings["total_nodes"] == 0
+
+
+def test_analyze_accessibility_tree_counts_roles_and_names():
+ tree = {
+ "role": "WebArea",
+ "name": "Example",
+ "children": [
+ {"role": "button", "name": "Submit"},
+ {"role": "button", "name": ""}, # unnamed interactive
+ {"role": "link", "name": "Home"},
+ {"role": "generic", "name": "", "children": [
+ {"role": "generic", "name": ""},
+ ]},
+ ],
+ }
+ findings = agent_ux_check.analyze_accessibility_tree(tree)
+ assert findings["tree_present"] is True
+ assert findings["role_button"] == 2
+ assert findings["role_link"] == 1
+ assert findings["role_generic"] == 2
+ assert findings["unnamed_interactive"] == 1
+ # WebArea + 2 buttons + 1 link + 2 generics
+ assert findings["total_nodes"] == 6
+
+
+def test_score_clean_page_scores_high():
+ html_findings = {
+ "real_buttons": 5,
+ "real_anchors": 10,
+ "div_onclick_widgets": 0,
+ "semantic_landmarks": 3,
+ "inputs_without_aria": 0,
+ "inputs_without_label": 0,
+ }
+ a11y_findings = {
+ "tree_present": True,
+ "total_nodes": 50,
+ "interactive_nodes": 15,
+ "role_button": 5,
+ "role_link": 10,
+ "role_generic": 10,
+ "unnamed_interactive": 0,
+ }
+ scored = agent_ux_check.score(html_findings, a11y_findings)
+ assert scored["score"] == 100
+ assert scored["issues"] == []
+
+
+def test_score_deducts_for_div_onclick_and_unnamed_interactives():
+ html_findings = {
+ "real_buttons": 0,
+ "real_anchors": 0,
+ "div_onclick_widgets": 3, # -> -15
+ "semantic_landmarks": 1,
+ "inputs_without_aria": 0,
+ "inputs_without_label": 0,
+ }
+ a11y_findings = {
+ "tree_present": True,
+ "total_nodes": 20,
+ "interactive_nodes": 5,
+ "role_button": 0,
+ "role_link": 0,
+ "role_generic": 2,
+ "unnamed_interactive": 2, # -> -6
+ }
+ scored = agent_ux_check.score(html_findings, a11y_findings)
+ assert scored["score"] < 100
+ assert any("div onclick" in issue for issue in scored["issues"])
+ assert any("accessible name" in issue for issue in scored["issues"])
+
+
+# ---------------------------------------------------------------------------
+# render_page extension
+# ---------------------------------------------------------------------------
+
+
+def test_render_page_result_dict_includes_accessibility_tree_key():
+ # The new key must always be present, defaulting to None when not requested,
+ # so downstream consumers can treat the field as optional without KeyError.
+ result = render_page.render_page(
+ "http://this-host-should-not-resolve.invalid.example/",
+ mode="never",
+ )
+ assert "accessibility_tree" in result
+ assert result["accessibility_tree"] is None
+
+
+def test_render_page_accepts_extract_accessibility_kwarg():
+ # Pure signature check: passing extract_accessibility must not raise.
+ # The actual URL fails (intentional invalid host), but the kwarg must be
+ # accepted by the function signature even on the error path.
+ result = render_page.render_page(
+ "http://this-host-should-not-resolve.invalid.example/",
+ mode="never",
+ extract_accessibility=True,
+ )
+ assert "accessibility_tree" in result
+
+
+def test_render_page_cli_exposes_a11y_tree_flag():
+ # Smoke check: the argparse parser knows --a11y-tree. Invoking the parser
+ # via render_page._cli with --help would sys.exit, so just inspect the
+ # source module instead.
+ import inspect
+ src = inspect.getsource(render_page._cli)
+ assert "--a11y-tree" in src
+ assert "extract_accessibility" in src
diff --git a/tests/test_render_page.py b/tests/test_render_page.py
index 3f6e181..ddeda22 100644
--- a/tests/test_render_page.py
+++ b/tests/test_render_page.py
@@ -266,7 +266,8 @@ def test_render_page_result_dict_has_all_documented_fields() -> None:
result = render_page.render_page("https://x.example/", mode="never")
expected_fields = {
"url", "status_code", "content", "raw_content", "is_spa",
- "extracted_text", "publication_date", "headers", "redirect_chain",
- "console_errors", "render_engine", "render_ms", "mode_used", "error",
+ "extracted_text", "publication_date", "accessibility_tree",
+ "headers", "redirect_chain", "console_errors", "render_engine",
+ "render_ms", "mode_used", "error",
}
assert set(result.keys()) == expected_fields