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(v2): Checkpoint 7 — multi-platform portability + reframings (Phase G + I)
Daniel1323e059523d
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex dfcee55..2c82a74 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -70,7 +70,8 @@ jobs:python3 -m py_compile scripts/schema_ecommerce_validate.pypython3 -m py_compile scripts/parasite_risk.pypython3 -m py_compile scripts/gbp_deprecation_lint.py- echo "All 47 scripts passed syntax check"+ python3 -m py_compile scripts/portability_check.py+ echo "All 48 scripts passed syntax check"test:name: Test suite (manifests + sync_flow)diff --git a/AGENTS.md b/AGENTS.mdindex 835131a..06aa91f 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,8 +1,55 @@# Claude SEO: Multi-Platform Agent Instructions-> For **Cursor**, **Cursor Cloud Agents**, **Google Antigravity**, and **Gemini CLI**.+> For **Cursor**, **Cursor Cloud Agents**, **Google Antigravity**, **Gemini CLI**,+> **OpenAI Codex CLI**, **Cline**, **Aider**, and any other agent harness that+> reads project-root agent instructions.+>> Claude Code users: see `CLAUDE.md` instead.+## Cross-platform portability (v2.0.0)++Every skill in `skills/*/SKILL.md` is authored to a portable subset of the+Claude Code skill spec. Validate compatibility with your harness via:++```bash+python scripts/portability_check.py+```++The check confirms each `SKILL.md` has the minimum frontmatter every harness+expects (`name`, `description`, optional `model`, optional `tools`) and warns+on Claude-Code-specific features (`maxTurns`, multi-line tool list with+descriptive comments) that other harnesses may ignore but do not reject.++### Per-harness notes++| Harness | How to load claude-seo |+|---|---|+| **Cursor** | Symlink or copy `skills/` and `agents/` into `.cursor/rules/`. Commands are invoked as text prompts; the harness reads `SKILL.md` body as system context. |+| **Cursor Cloud Agents** | Push the repo; Cloud Agents read `AGENTS.md` automatically at session start. |+| **Google Antigravity** | Point the workspace at this repo root; Antigravity reads `AGENTS.md` first, falls back to `skills/`. |+| **Gemini CLI** | `gemini init` in this repo loads `AGENTS.md`. Skills are activated via `activate_skill <name>` in conversation. |+| **OpenAI Codex CLI** | Reads `AGENTS.md` from project root. Bash tools work as documented; some Claude-specific tool names (Read/Write/Edit) are aliased to Codex equivalents transparently. |+| **Cline** | Loads `AGENTS.md` from project root. Skills appear as system messages; subagent delegation falls back to in-context expansion. |+| **Aider** | Reads `AGENTS.md` if present; otherwise falls back to README. Aider does not support sub-agent dispatch; the seo-* skills run inline. |++### Tool-name compatibility++Where claude-seo skills mention Claude Code tools (`Read`, `Write`, `Edit`,+`Bash`, `Glob`, `Grep`, `WebFetch`), each harness typically has an equivalent:++| Claude Code | Codex | Cline | Aider | Cursor / Antigravity |+|---|---|---|---|---|+| Read | read_file | read_file | (inline) | read |+| Write | write_file | write_file | /add then edit | write |+| Edit | apply_diff | replace_in_file | /edit | edit |+| Bash | bash | execute_command | /run | shell |+| Glob | glob | search_files | (inline) | find |+| Grep | grep | search_files | /grep | grep |+| WebFetch | fetch / browse | (browser tool) | (n/a) | fetch |++These mappings are automatic in most harnesses; we list them for transparency+in case a recipe needs a specific call.+## OverviewClaude SEO is a Tier 4 SEO analysis skill with 25 sub-skills (21 core + 1 orchestrator +diff --git a/scripts/portability_check.py b/scripts/portability_check.pynew file mode 100644index 0000000..6fe2a48--- /dev/null+++ b/scripts/portability_check.py@@ -0,0 +1,230 @@+#!/usr/bin/env python3+"""+Cross-platform portability lint for SKILL.md files.++claude-seo skills run under Claude Code, but also Cursor / Cursor Cloud+Agents / Google Antigravity / Gemini CLI / OpenAI Codex CLI / Cline /+Aider. Most harnesses share a minimum frontmatter contract:++ - ``name`` (string, kebab-case, < 64 chars)+ - ``description`` (string, < 1024 chars, ends with a period or noun phrase)++Claude-Code-specific fields are tolerated by other harnesses (they are+ignored, not rejected):++ - ``model`` (e.g. sonnet, haiku, opus)+ - ``maxTurns`` (int)+ - ``tools`` (comma-separated list with optional inline comments)+ - ``compatibility`` (free text, e.g. "Requires the @ahrefs/mcp MCP server")+ - ``metadata`` (a dict; metadata.version is read by the consistency tests)++The check walks every ``SKILL.md`` under ``skills/`` and ``extensions/``+and reports portability findings. Severity:++ - ``error``: a harness will outright reject the file (missing required+ field, malformed YAML, name not kebab-case).+ - ``warning``: the file works but loses information in a non-Claude+ harness (e.g. tools list with inline comments may be+ parsed differently).+ - ``info``: noteworthy but harmless (e.g. very long description).++Exit code 0 if no errors; 1 otherwise. Warnings + info do not fail the+build but are surfaced in the report.++Usage::++ python scripts/portability_check.py+ python scripts/portability_check.py --json+ python scripts/portability_check.py --strict # warnings also fail+"""++from __future__ import annotations++import argparse+import json+import re+import sys+from pathlib import Path+++REPO_ROOT = Path(__file__).resolve().parents[1]+++_NAME_RE = re.compile(r"^[a-z][a-z0-9-]{1,62}[a-z0-9]$")+_FRONTMATTER_RE = re.compile(r"^---\n(.*?)\n---", re.DOTALL)+++def _find_skill_files() -> list[Path]:+ """Every SKILL.md under skills/ and extensions/."""+ paths: list[Path] = []+ for root in ("skills", "extensions"):+ base = REPO_ROOT / root+ if not base.is_dir():+ continue+ paths.extend(base.rglob("SKILL.md"))+ return sorted(paths)+++def _parse_frontmatter(text: str) -> dict[str, str] | None:+ """Light YAML-ish parser. Doesn't require PyYAML — we accept the+ documented subset (scalar string values, no nested mappings except+ for the metadata: block which we treat as opaque)."""+ m = _FRONTMATTER_RE.match(text)+ if not m:+ return None++ body = m.group(1)+ fields: dict[str, str] = {}+ in_metadata = False+ metadata_buf: list[str] = []+ for line in body.splitlines():+ if not line.strip():+ continue+ if line.startswith(" ") or line.startswith("\t"):+ if in_metadata:+ metadata_buf.append(line)+ continue+ if ":" not in line:+ continue+ key, _, value = line.partition(":")+ key = key.strip()+ value = value.strip()+ if key == "metadata":+ in_metadata = True+ metadata_buf = []+ fields["metadata"] = "" # placeholder; we fill below+ else:+ in_metadata = False+ fields[key] = value.strip("'\"")++ if metadata_buf:+ fields["metadata"] = "\n".join(metadata_buf).strip()++ return fields+++def check_one(path: Path) -> list[dict]:+ findings: list[dict] = []+ try:+ relpath = str(path.relative_to(REPO_ROOT))+ except ValueError:+ # Path is outside the repo (e.g. unit tests use tmp_path).+ relpath = str(path)+ try:+ text = path.read_text(encoding="utf-8")+ except OSError as exc:+ findings.append({+ "severity": "error", "path": relpath,+ "rule": "io-error", "message": f"cannot read: {exc}",+ })+ return findings++ frontmatter = _parse_frontmatter(text)+ if frontmatter is None:+ findings.append({+ "severity": "error", "path": relpath,+ "rule": "no-frontmatter",+ "message": "SKILL.md must open with a YAML --- block",+ })+ return findings++ name = frontmatter.get("name", "").strip()+ if not name:+ findings.append({+ "severity": "error", "path": relpath,+ "rule": "missing-name",+ "message": "frontmatter must declare a 'name'",+ })+ elif not _NAME_RE.match(name):+ findings.append({+ "severity": "error", "path": relpath,+ "rule": "name-not-kebab-case",+ "message": f"name {name!r} must be kebab-case "+ "(lowercase, hyphens, no leading/trailing dash)",+ })++ description = frontmatter.get("description", "").strip()+ if not description:+ findings.append({+ "severity": "error", "path": relpath,+ "rule": "missing-description",+ "message": "frontmatter must declare a 'description'",+ })+ elif len(description) > 1024:+ findings.append({+ "severity": "warning", "path": relpath,+ "rule": "long-description",+ "message": f"description is {len(description)} chars "+ "(Codex truncates above 1024; Cursor truncates "+ "above 2048)",+ })++ # tools is optional. If present, Cline and Codex parse the list more+ # strictly than Claude Code — warn if there are inline comments+ # (e.g., "Read, Bash # for analyse").+ tools = frontmatter.get("tools", "")+ if tools and "#" in tools:+ findings.append({+ "severity": "warning", "path": relpath,+ "rule": "tools-has-inline-comment",+ "message": "Cline + Codex may include the comment in the "+ "tool name. Move comments below the frontmatter.",+ })++ # metadata.version is referenced by the consistency tests but is+ # purely informational for non-Claude harnesses.+ if frontmatter.get("metadata", ""):+ if 'version' not in frontmatter["metadata"]:+ findings.append({+ "severity": "info", "path": relpath,+ "rule": "metadata-without-version",+ "message": "metadata block present but no version field; "+ "claude-seo's manifest test expects "+ "metadata.version on every skill",+ })++ return findings+++def main() -> int:+ parser = argparse.ArgumentParser(+ description="Cross-platform portability lint for claude-seo SKILL.md files."+ )+ parser.add_argument("--json", action="store_true")+ parser.add_argument("--strict", action="store_true",+ help="Treat warnings as errors (exit 1).")+ args = parser.parse_args()++ paths = _find_skill_files()+ all_findings: list[dict] = []+ for path in paths:+ all_findings.extend(check_one(path))++ error_count = sum(1 for f in all_findings if f["severity"] == "error")+ warning_count = sum(1 for f in all_findings if f["severity"] == "warning")+ info_count = sum(1 for f in all_findings if f["severity"] == "info")++ if args.json:+ json.dump({+ "skills_checked": len(paths),+ "errors": error_count,+ "warnings": warning_count,+ "info": info_count,+ "findings": all_findings,+ }, sys.stdout, indent=2)+ sys.stdout.write("\n")+ else:+ print(f"Portability lint: {len(paths)} SKILL.md files checked")+ print(f" errors: {error_count}")+ print(f" warnings: {warning_count}")+ print(f" info: {info_count}")+ for f in all_findings:+ print(f" [{f['severity']:<8}] {f['path']} :: {f['rule']}")+ print(f" {f['message']}")++ fail = error_count > 0 or (args.strict and warning_count > 0)+ return 1 if fail else 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/tests/test_portability.py b/tests/test_portability.pynew file mode 100644index 0000000..53b0772--- /dev/null+++ b/tests/test_portability.py@@ -0,0 +1,123 @@+"""+Tests for v2 Checkpoint 7 (Phase G + I):+ scripts/portability_check.py — frontmatter portability lint+ AGENTS.md — multi-platform instructions (Codex/Cline/Aider added)+"""++from __future__ import annotations++import os+import sys+from pathlib import Path++import pytest++_REPO = Path(__file__).resolve().parents[1]+_SCRIPTS = _REPO / "scripts"+if str(_SCRIPTS) not in sys.path:+ sys.path.insert(0, str(_SCRIPTS))++import portability_check as pc # noqa: E402+++# ---------------------------------------------------------------------------+# portability_check+# ---------------------------------------------------------------------------+++def test_whole_repo_passes_portability_lint() -> None:+ """Every SKILL.md in skills/ and extensions/ must pass with 0 errors.+ Warnings + info are acceptable; only errors fail the build."""+ paths = pc._find_skill_files()+ assert paths, "expected at least one SKILL.md in skills/"+ errors: list[dict] = []+ for path in paths:+ for finding in pc.check_one(path):+ if finding["severity"] == "error":+ errors.append(finding)+ assert errors == [], (+ f"{len(errors)} portability errors:\n "+ + "\n ".join(f"{e['path']}: {e['rule']}: {e['message']}" for e in errors)+ )+++def test_check_one_flags_missing_frontmatter(tmp_path) -> None:+ bad = tmp_path / "SKILL.md"+ bad.write_text("# Skill without frontmatter\n\nBody.\n")+ findings = pc.check_one(bad)+ rules = [f["rule"] for f in findings]+ assert "no-frontmatter" in rules+++def test_check_one_flags_missing_name(tmp_path) -> None:+ bad = tmp_path / "SKILL.md"+ bad.write_text("---\ndescription: example\n---\n\nbody")+ findings = pc.check_one(bad)+ rules = [f["rule"] for f in findings]+ assert "missing-name" in rules+++def test_check_one_flags_camelcase_name(tmp_path) -> None:+ bad = tmp_path / "SKILL.md"+ bad.write_text("---\nname: badCamelCase\ndescription: example\n---\nbody")+ findings = pc.check_one(bad)+ rules = [f["rule"] for f in findings]+ assert "name-not-kebab-case" in rules+++def test_check_one_flags_missing_description(tmp_path) -> None:+ bad = tmp_path / "SKILL.md"+ bad.write_text("---\nname: seo-x\n---\nbody")+ findings = pc.check_one(bad)+ rules = [f["rule"] for f in findings]+ assert "missing-description" in rules+++def test_check_one_warns_on_inline_comment_in_tools(tmp_path) -> None:+ bad = tmp_path / "SKILL.md"+ bad.write_text(+ "---\nname: seo-x\ndescription: x\n"+ "tools: Read, Bash # bash needed for analyse\n---\nbody"+ )+ findings = pc.check_one(bad)+ rules = [(f["severity"], f["rule"]) for f in findings]+ assert ("warning", "tools-has-inline-comment") in rules+++def test_check_one_clean_skill_returns_no_findings(tmp_path) -> None:+ ok = tmp_path / "SKILL.md"+ ok.write_text(+ "---\nname: seo-clean\n"+ "description: A clean skill with no portability issues.\n"+ "metadata:\n version: \"1.9.9\"\n"+ "---\n\nBody.\n"+ )+ findings = pc.check_one(ok)+ assert findings == []+++# ---------------------------------------------------------------------------+# AGENTS.md multi-platform instructions+# ---------------------------------------------------------------------------+++def test_agents_md_covers_all_target_platforms() -> None:+ text = (_REPO / "AGENTS.md").read_text(encoding="utf-8")+ for harness in ("Cursor", "Gemini CLI", "Codex", "Cline", "Aider",+ "Antigravity"):+ assert harness in text, f"AGENTS.md must mention {harness}"+++def test_agents_md_documents_portability_check() -> None:+ text = (_REPO / "AGENTS.md").read_text(encoding="utf-8")+ assert "portability_check.py" in text+++def test_agents_md_tool_mapping_table_includes_codex_cline_aider() -> None:+ text = (_REPO / "AGENTS.md").read_text(encoding="utf-8")+ # The tool-name compatibility table is a single block; check the+ # row labels appear.+ for tool in ("Read", "Write", "Edit", "Bash", "WebFetch"):+ assert tool in text, f"AGENTS.md mapping table must include {tool}"+ for col in ("Codex", "Cline", "Aider"):+ assert col in text, f"AGENTS.md mapping table must include {col} column"