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.

fix(install): move the launcher to scripts/ so hosted marketplaces accept the plugin

Agrici Danielb3b07907070d
diff --git a/.github/workflows/windows-smoke.yml b/.github/workflows/windows-smoke.yml
index 62f7773..939e2b8 100644
--- a/.github/workflows/windows-smoke.yml
+++ b/.github/workflows/windows-smoke.yml
@@ -7,7 +7,7 @@ on:
- ".github/workflows/windows-smoke.yml"
- "install.ps1"
- "uninstall.ps1"
- - "bin/claude-seo"
+ - "scripts/claude-seo"
- "requirements.txt"
- "scripts/runtime.py"
- "scripts/seo_updates.py"
diff --git a/AGENTS.md b/AGENTS.md
index 8276c4f..e1e19f1 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -13,7 +13,7 @@ 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
-./bin/claude-seo run portability_check.py
+./scripts/claude-seo run portability_check.py
```
The check confirms each `SKILL.md` has the minimum frontmatter every harness
@@ -106,19 +106,19 @@ provide execution capabilities.
**Running scripts directly** (Cursor doesn't have MCP):
```bash
# Page fetching with SSRF protection
-./bin/claude-seo run fetch_page.py https://example.com
+./scripts/claude-seo run fetch_page.py https://example.com
# HTML parsing for SEO elements
-./bin/claude-seo run parse_html.py https://example.com
+./scripts/claude-seo run parse_html.py https://example.com
# PageSpeed Insights
-./bin/claude-seo run pagespeed_check.py https://example.com --json
+./scripts/claude-seo run pagespeed_check.py https://example.com --json
# Drift baseline
-./bin/claude-seo run drift_baseline.py https://example.com
+./scripts/claude-seo run drift_baseline.py https://example.com
# DataForSEO (requires credentials)
-DATAFORSEO_USERNAME=user DATAFORSEO_PASSWORD=pass ./bin/claude-seo run dataforseo_merchant.py search "keyword"
+DATAFORSEO_USERNAME=user DATAFORSEO_PASSWORD=pass ./scripts/claude-seo run dataforseo_merchant.py search "keyword"
```
**Cursor Cloud gotchas:**
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7ea69a8..9be0efe 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
+- The plugin now installs from the claude.ai-hosted marketplace. Hosted sync
+ rejects any plugin that ships a top-level `bin/` directory with
+ `marketplace_sync_bin_directory_not_allowed`, which is exactly what the
+ launcher lived in, so the listing could never sync. `bin/claude-seo` moved to
+ `scripts/claude-seo`, where it resolves `runtime.py` as a sibling, and every
+ skill, agent, and doc now calls it through the documented plugin-relative
+ form `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run <script.py>` instead of
+ relying on undocumented `bin/` PATH injection. Manual installs are unchanged
+ in behaviour: `install.sh` and `install.ps1` copy the launcher to
+ `~/.claude/skills/seo/scripts/claude-seo` and rewrite that canonical token to
+ the absolute path in the Markdown they install. Fixes #298; supersedes #199.
- `seo-technical` no longer treats dynamic rendering as a valid setup to verify. Google
documents it as a workaround rather than a recommended solution, so the audit step now
flags it as technical debt. Adds a rendering-strategy table (SSR / SSG / CSR) and a
diff --git a/CLAUDE.md b/CLAUDE.md
index 345fcc1..8d7ad1d 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -194,7 +194,7 @@ claude-seo/
- Scripts must have docstrings, CLI interface, and JSON output
- Follow kebab-case naming for all skill directories
- Agents invoked via Agent tool, never via Bash
-- Bundled tools run through `claude-seo run`; plugin state uses `CLAUDE_PLUGIN_DATA`
+- Bundled tools run through `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run`; plugin state uses `CLAUDE_PLUGIN_DATA`
- Manual Python dependencies install into `~/.claude/skills/seo/.venv/`
- Test with `python3 -m pytest tests/` after changes (if applicable)
diff --git a/agents/seo-backlinks.md b/agents/seo-backlinks.md
index cb44c4d..1054c96 100644
--- a/agents/seo-backlinks.md
+++ b/agents/seo-backlinks.md
@@ -8,7 +8,7 @@ tools: Read, Bash, Write, Glob, Grep
You are a backlink profile analyst. When delegated tasks during an SEO audit:
-1. Check credentials: `claude-seo run backlinks_auth.py --check --json`
+1. Check credentials: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run backlinks_auth.py --check --json`
2. Determine tier (0 = CC+verify, 1 = +Moz, 2 = +Bing, 3 = +DataForSEO)
3. Run all available sources for the target domain
4. Merge results with confidence weighting
@@ -17,28 +17,28 @@ You are a backlink profile analyst. When delegated tasks during an SEO audit:
## Tier-Based Workflow
### Tier 0 (Always Available, No Config Needed)
-- Common Crawl domain metrics: `claude-seo run commoncrawl_graph.py <domain> --json`
+- Common Crawl domain metrics: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run commoncrawl_graph.py <domain> --json`
- PageRank, PageRank rank, harmonic centrality, harmonic centrality rank, crawl/ranking presence
-- If known backlinks provided, verify them: `claude-seo run verify_backlinks.py --target <url> --links <file> --json`
+- If known backlinks provided, verify them: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run verify_backlinks.py --target <url> --links <file> --json`
- Report domain-level metrics with **confidence: 0.50** note
- At Tier 0, fewer than 4 scoring factors have data, report **INSUFFICIENT DATA**, not a numeric score
- Never produce a misleading numeric score when most factors lack data sources
### Tier 1 (+ Moz API)
- All Tier 0 checks
-- Moz URL metrics: `claude-seo run moz_api.py metrics <url> --json`
+- Moz URL metrics: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py metrics <url> --json`
- DA, PA, Spam Score, link counts, referring domains
-- Moz referring domains: `claude-seo run moz_api.py domains <url> --json`
-- Moz anchor text: `claude-seo run moz_api.py anchors <url> --json`
-- Moz top pages: `claude-seo run moz_api.py pages <domain> --json`
+- Moz referring domains: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py domains <url> --json`
+- Moz anchor text: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py anchors <url> --json`
+- Moz top pages: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py pages <domain> --json`
- **Rate limit:** 1 request per 10 seconds (built into script). Plan calls carefully.
- Report metrics with **confidence: 0.85** note
### Tier 2 (+ Bing Webmaster)
- All Tier 1 checks
-- Bing inbound links: `claude-seo run bing_webmaster.py links <url> --json`
+- Bing inbound links: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run bing_webmaster.py links <url> --json`
- For comparison between two properties registered to the same Bing account:
- `claude-seo run bing_webmaster.py compare <url1> <url2> --json`
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run bing_webmaster.py compare <url1> <url2> --json`
- Report with **confidence: 0.70** for Bing data
- Never use Bing Webmaster data for an arbitrary competitor. Use Moz,
DataForSEO, or Common Crawl when the second property is not registered.
@@ -89,7 +89,7 @@ Before returning results, run the automated validator AND manual checks.
### Step 1: Automated validation
Save all collected data to a JSON file and run:
```bash
-claude-seo run validate_backlink_report.py --report report_data.json --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run validate_backlink_report.py --report report_data.json --json
```
The validator checks: schema claims, JS false negatives, H1 accuracy, reciprocal links,
CC interpretation, and health score sufficiency. If status is "FAIL", fix errors before proceeding.
@@ -112,7 +112,7 @@ If any check fails, fix the report before returning it.
## Fetching pages (v2.0.0)
-Use `claude-seo run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes full `raw_content`, `content`, `extracted_text`, `is_spa`, and `publication_date`; use `--max-text` only when explicit bounded output is needed. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes full `raw_content`, `content`, `extracted_text`, `is_spa`, and `publication_date`; use `--max-text` only when explicit bounded output is needed. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
Backlink verification (`/seo backlinks verify`) primarily reads outbound `<a>` tags, which are reliably present in raw HTML. `--mode never` is the right choice for speed on bulk verification jobs.
diff --git a/agents/seo-content.md b/agents/seo-content.md
index 38cf18e..2c4434d 100644
--- a/agents/seo-content.md
+++ b/agents/seo-content.md
@@ -67,7 +67,7 @@ Provide:
## Fetching pages (v2.0.0)
-Use `claude-seo run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `is_spa`, complete `extracted_text`, and `publication_date`; use `--output rendered.html` for the full HTML. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `is_spa`, complete `extracted_text`, and `publication_date`; use `--output rendered.html` for the full HTML. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
## Persistence Contract
diff --git a/agents/seo-drift.md b/agents/seo-drift.md
index 431d6d5..87ff909 100644
--- a/agents/seo-drift.md
+++ b/agents/seo-drift.md
@@ -17,10 +17,10 @@ elements by comparing current page state against stored baselines.
## Tools
All page fetching goes through the project's existing scripts with SSRF protection:
-- `claude-seo run drift_baseline.py <url>` -- capture a new baseline
-- `claude-seo run drift_compare.py <url>` -- compare current state to baseline
-- `claude-seo run drift_history.py <url>` -- show change history
-- `claude-seo run drift_report.py <file> --output report.html` -- generate HTML report
+- `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_baseline.py <url>` -- capture a new baseline
+- `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_compare.py <url>` -- compare current state to baseline
+- `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_history.py <url>` -- show change history
+- `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_report.py <file> --output report.html` -- generate HTML report
Never use curl, wget, or raw HTTP requests. All fetching is handled by
the bundled `fetch_page.py` module internally, which validates URLs against private/loopback
diff --git a/agents/seo-ecommerce.md b/agents/seo-ecommerce.md
index 4b59afb..e919994 100644
--- a/agents/seo-ecommerce.md
+++ b/agents/seo-ecommerce.md
@@ -18,16 +18,16 @@ When delegated tasks during an SEO audit or analysis:
1. Detect e-commerce signals: product schema, price elements, add-to-cart buttons,
shopping cart, product grids, Shopify/WooCommerce/Magento markers
-2. Analyze product pages with `claude-seo run render_page.py <URL> --mode auto` and `claude-seo run parse_html.py <URL>`
+2. Analyze product pages with `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto` and `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run parse_html.py <URL>`
3. Validate Product schema against Google's required and recommended fields
4. If DataForSEO credentials available, fetch marketplace data via
- `claude-seo run dataforseo_merchant.py`
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_merchant.py`
## Cost Guardrails
Before ANY DataForSEO Merchant API call:
```bash
-claude-seo run dataforseo_costs.py check <endpoint>
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py check <endpoint>
```
Only proceed if `"status": "approved"`. If `"needs_approval"`, surface the cost
@@ -36,7 +36,7 @@ the limitation.
After each API call, log the cost:
```bash
-claude-seo run dataforseo_costs.py log <endpoint> <actual_cost>
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py log <endpoint> <actual_cost>
```
## Analysis Priorities
@@ -65,7 +65,7 @@ Match existing claude-seo patterns:
## Fetching pages (v2.0.0)
-Use `claude-seo run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `raw_content` (pre-JS), `content` (post-JS), `is_spa`, `extracted_text` (boilerplate-stripped via trafilatura), and `publication_date` (htmldate). SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `raw_content` (pre-JS), `content` (post-JS), `is_spa`, `extracted_text` (boilerplate-stripped via trafilatura), and `publication_date` (htmldate). SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
E-commerce sites overwhelmingly inject product schema client-side (Shopify, Magento PWA, headless commerce on Next.js). Prefer `--mode always` for product page audits and compare `raw_content` vs `content` to confirm whether the JSON-LD is server-rendered.
diff --git a/agents/seo-geo.md b/agents/seo-geo.md
index 4b87a99..44a9fdf 100644
--- a/agents/seo-geo.md
+++ b/agents/seo-geo.md
@@ -65,7 +65,7 @@ Provide a structured report with:
## Fetching pages (v2.0.0)
-Use `claude-seo run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes full `raw_content`, `content`, `extracted_text`, `is_spa`, and `publication_date`; use `--max-text` only when explicit bounded output is needed. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes full `raw_content`, `content`, `extracted_text`, `is_spa`, and `publication_date`; use `--max-text` only when explicit bounded output is needed. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
AI citation analysis benefits from the `extracted_text` field, passage-level scoring should run against trafilatura's boilerplate-stripped output, not the full HTML, so navigation chrome and footers don't dilute the signal.
diff --git a/agents/seo-google.md b/agents/seo-google.md
index 38d9891..68acc42 100644
--- a/agents/seo-google.md
+++ b/agents/seo-google.md
@@ -8,7 +8,7 @@ tools: Read, Bash, Write, Glob, Grep # Write needed for report/data file output
You are a Google SEO API data analyst. When delegated tasks during an SEO audit:
-1. Check credentials: `claude-seo run google_auth.py --check --json`
+1. Check credentials: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_auth.py --check --json`
2. Determine tier (0 = API key, 1 = + service account, 2 = + GA4)
3. Execute tier-appropriate analysis
4. Format output to match claude-seo conventions
@@ -16,22 +16,22 @@ You are a Google SEO API data analyst. When delegated tasks during an SEO audit:
## Tier-Based Workflow
### Tier 0 (API Key Only)
-- Run PSI + CrUX on homepage: `claude-seo run pagespeed_check.py <url> --json`
-- Run CrUX History for origin: `claude-seo run crux_history.py <origin> --origin --json`
+- Run PSI + CrUX on homepage: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run pagespeed_check.py <url> --json`
+- Run CrUX History for origin: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run crux_history.py <origin> --origin --json`
- Report CWV field data with traffic-light ratings
### Tier 1 (+ Service Account)
- All Tier 0 checks
-- GSC top queries/pages (28 days): `claude-seo run gsc_query.py --property <prop> --json`
+- GSC top queries/pages (28 days): `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run gsc_query.py --property <prop> --json`
- Use only totals with `totals_complete: true` as site-wide totals. Query rows
can omit anonymized low-volume traffic and are not safe to sum as totals.
-- URL Inspection on homepage + key pages: `claude-seo run gsc_inspect.py <url> --json`
-- GSC sitemap status: `claude-seo run gsc_query.py sitemaps --property <prop> --json`
+- URL Inspection on homepage + key pages: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run gsc_inspect.py <url> --json`
+- GSC sitemap status: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run gsc_query.py sitemaps --property <prop> --json`
### Tier 2 (Full)
- All Tier 1 checks
-- GA4 organic traffic (28 days): `claude-seo run ga4_report.py --property <id> --json`
-- Top organic landing pages: `claude-seo run ga4_report.py --property <id> --report top-pages --json`
+- GA4 organic traffic (28 days): `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run ga4_report.py --property <id> --json`
+- Top organic landing pages: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run ga4_report.py --property <id> --report top-pages --json`
## Core Web Vitals Thresholds
@@ -58,7 +58,7 @@ After completing data collection at any tier, offer to generate a PDF report.
The report uses the enterprise template: white cover, navy accents, Times New Roman, charts at 85% width, Google logo on title page. No page-break-inside: avoid (causes white gaps).
```bash
-claude-seo run google_report.py --type full --data data.json --domain DOMAIN --format pdf --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_report.py --type full --data data.json --domain DOMAIN --format pdf --json
```
Report types: `cwv-audit`, `gsc-performance`, `indexation`, `full`.
Before presenting: verify `"review": {"status": "PASS"}` in the JSON output.
@@ -68,7 +68,7 @@ Before presenting: verify `"review": {"status": "PASS"}` in the JSON output.
If `output_dir` is provided by the audit orchestrator, write:
- `output_dir/findings/google.md`: PSI, CrUX, GSC, URL Inspection, GA4, and credential-tier findings
- Structured JSON-compatible findings for `audit-data.json` under the Google SEO Data category
-- Generated PDF/HTML/XLSX reports under `output_dir/` with `claude-seo run google_report.py --output-dir "$output_dir"`
+- Generated PDF/HTML/XLSX reports under `output_dir/` with `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_report.py --output-dir "$output_dir"`
## Error Handling
diff --git a/agents/seo-local.md b/agents/seo-local.md
index 5514a4d..8a77ba0 100644
--- a/agents/seo-local.md
+++ b/agents/seo-local.md
@@ -79,7 +79,7 @@ Provide a structured report with:
## Fetching pages (v2.0.0)
-Use `claude-seo run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes full `raw_content`, `content`, `extracted_text`, `is_spa`, and `publication_date`; use `--max-text` only when explicit bounded output is needed. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes full `raw_content`, `content`, `extracted_text`, `is_spa`, and `publication_date`; use `--max-text` only when explicit bounded output is needed. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
Map embeds, GBP widgets, and review carousels are commonly injected client-side. When auditing local pages on JS-heavy sites prefer `--mode always` so the audit reflects what users (and Google's crawler) actually see post-render.
diff --git a/agents/seo-performance.md b/agents/seo-performance.md
index 82d729e..c8d849d 100644
--- a/agents/seo-performance.md
+++ b/agents/seo-performance.md
@@ -25,7 +25,7 @@ Google evaluates the **75th percentile** of page visits, 75% of visits must meet
## When Analyzing Performance
1. Use PageSpeed Insights API if available
-2. Use `claude-seo run render_page.py <URL> --mode auto --json` before HTML/source inspection so SPA content is visible when needed
+2. Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --json` before HTML/source inspection so SPA content is visible when needed
3. Provide specific, actionable optimization recommendations
4. Prioritize by expected impact
@@ -67,10 +67,10 @@ Google evaluates the **75th percentile** of page visits, 75% of visits must meet
```bash
# PageSpeed Insights API (uses header-based API key handling)
-claude-seo run pagespeed_check.py URL --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run pagespeed_check.py URL --json
# SPA-aware HTML/render inspection
-claude-seo run render_page.py URL --mode auto --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py URL --mode auto --json
# Lighthouse CLI
npx lighthouse URL --output json
@@ -80,8 +80,8 @@ npx lighthouse URL --output json
If Google API credentials are configured, prefer CrUX field data over Lighthouse lab data for CWV assessment:
```bash
-claude-seo run pagespeed_check.py URL --json
-claude-seo run crux_history.py URL --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run pagespeed_check.py URL --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run crux_history.py URL --json
```
Field data (28-day Chrome user average) is more representative than lab data (single Lighthouse run). Use lab data as fallback when CrUX returns 404 (insufficient traffic).
diff --git a/agents/seo-schema.md b/agents/seo-schema.md
index 3bf5551..67c1d96 100644
--- a/agents/seo-schema.md
+++ b/agents/seo-schema.md
@@ -68,7 +68,7 @@ Provide:
## Fetching pages (v2.0.0)
-Use `claude-seo run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `is_spa`, complete `extracted_text`, and `publication_date`; use `--output rendered.html` for the full HTML. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `is_spa`, complete `extracted_text`, and `publication_date`; use `--output rendered.html` for the full HTML. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
Use the JSON response's `structured_data` summary for routine JSON-LD detection. It is extracted from the full HTML before the HTML fields are truncated, but emits only bounded validity, size, and type metadata. When full blocks are necessary for validation, pass `--json-ld-output <path>` and read the bounded UTF-8 JSON artifact. Never copy unbounded page markup into an agent prompt.
diff --git a/agents/seo-sitemap.md b/agents/seo-sitemap.md
index 7f43d0f..863ac18 100644
--- a/agents/seo-sitemap.md
+++ b/agents/seo-sitemap.md
@@ -10,7 +10,7 @@ You are a Sitemap Architecture specialist.
When working with sitemaps:
-1. Discover candidates with `claude-seo run sitemap_discovery.py <url> --json`.
+1. Discover candidates with `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run sitemap_discovery.py <url> --json`.
Use only validated `found` entries and retain declared failures as findings.
2. Validate XML format and URL status codes
3. Check for deprecated tags (priority, changefreq: both ignored by Google)
diff --git a/agents/seo-sxo.md b/agents/seo-sxo.md
index 2fb30cc..0e197a8 100644
--- a/agents/seo-sxo.md
+++ b/agents/seo-sxo.md
@@ -19,8 +19,8 @@ then comparing that against the target page.
### 1. Fetch and Parse Target Page
-- Fetch the target URL using `claude-seo run render_page.py "<url>" --mode auto --json` (SPA-aware SSRF-protected renderer)
-- Parse with `claude-seo run parse_html.py --url "<url>"` to extract SEO elements
+- Fetch the target URL using `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py "<url>" --mode auto --json` (SPA-aware SSRF-protected renderer)
+- Parse with `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run parse_html.py --url "<url>"` to extract SEO elements
- Identify: page type, title, H1, meta description, headings, word count, schema, CTAs, media
- If no keyword was provided, derive primary keyword from title + H1 overlap
@@ -85,7 +85,7 @@ Score the target page across 7 dimensions (100 points total):
## Pre-Delivery Checklist
Before presenting results, verify:
-- [ ] URL was fetched via `claude-seo run render_page.py --mode auto` (not raw curl)
+- [ ] URL was fetched via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py --mode auto` (not raw curl)
- [ ] At least 5 SERP results were analyzed
- [ ] Page type classification uses the taxonomy reference
- [ ] User stories cite specific SERP signals
@@ -95,7 +95,7 @@ Before presenting results, verify:
## Fetching pages (v2.0.0)
-Use `claude-seo run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `raw_content` (pre-JS), `content` (post-JS), `is_spa`, `extracted_text` (boilerplate-stripped via trafilatura), and `publication_date` (htmldate). SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `raw_content` (pre-JS), `content` (post-JS), `is_spa`, `extracted_text` (boilerplate-stripped via trafilatura), and `publication_date` (htmldate). SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
Search experience scoring needs the *rendered* DOM because users see what JS produces. Prefer `--mode always` so above-the-fold analysis matches what the persona actually encounters.
diff --git a/agents/seo-technical.md b/agents/seo-technical.md
index 29cfe13..69d7321 100644
--- a/agents/seo-technical.md
+++ b/agents/seo-technical.md
@@ -9,7 +9,7 @@ tools: Read, Bash, Write, Glob, Grep # Write needed for report/data file output
You are a Technical SEO specialist. When given a URL or set of URLs:
1. Fetch the page(s) and analyze HTML source
-2. Check sitemap availability with `claude-seo run sitemap_discovery.py <URL> --json`.
+2. Check sitemap availability with `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run sitemap_discovery.py <URL> --json`.
A robots.txt declaration is not a passing result unless the helper validates
it; continue through common fallbacks when a declaration is stale.
3. Analyze meta tags, canonical tags, and security headers
@@ -55,7 +55,7 @@ Provide a structured report with:
## Fetching pages (v2.0.0)
-Use `claude-seo run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `is_spa`, complete `extracted_text`, and `publication_date`; use `--output rendered.html` for the full HTML. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --json` for page HTML. `auto` does a raw fetch and only spins up Playwright when an SPA shell is detected; use `--mode always` to force a render or `--mode never` to skip Playwright entirely. The JSON exposes `is_spa`, complete `extracted_text`, and `publication_date`; use `--output rendered.html` for the full HTML. SSRF and DNS-rebinding protection live in the bundled `url_safety.py` module, never call `requests.get` directly on user-supplied URLs.
## Persistence Contract
diff --git a/agents/seo-visual.md b/agents/seo-visual.md
index 4996f2e..ba58a0f 100644
--- a/agents/seo-visual.md
+++ b/agents/seo-visual.md
@@ -29,8 +29,8 @@ pip install playwright && playwright install chromium
Use the managed screenshot and renderer commands for browser automation:
```bash
-claude-seo run capture_screenshot.py URL --all --output screenshots/
-claude-seo run render_page.py URL --mode auto --a11y-tree --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run capture_screenshot.py URL --all --output screenshots/
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py URL --mode auto --a11y-tree --json
```
## Viewports to Test
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 77a6e56..6924cc5 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -224,11 +224,23 @@ User Request (e.g., /seo page)
### Managed Python runtime
-Bundled tools are dispatched through `bin/claude-seo` and
+Bundled tools are dispatched through `scripts/claude-seo` and
`scripts/runtime.py`, never through a working-directory-relative Python command.
The launcher resolves Python 3.10 or newer, while the standard-library runtime
provides three operations: `run`, `setup`, and read-only `doctor`.
+The launcher lives in `scripts/` beside `runtime.py`, which it resolves as a
+sibling. A top-level `bin/` directory is not allowed: the claude.ai-hosted
+marketplace rejects such a plugin with `marketplace_sync_bin_directory_not_allowed`.
+Skills and agents therefore call the launcher by its plugin-relative path,
+`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run <script.py>`, which Claude Code
+expands in skill body content, in `allowed-tools` Bash rules, and as an
+environment variable for hook processes. The quoting keeps the command correct
+when the plugin root contains spaces. Manual installers (`install.sh`,
+`install.ps1`) copy the launcher to `~/.claude/skills/seo/scripts/claude-seo`
+and rewrite that canonical token to the absolute path in every Markdown file
+they install, because a manual install has no plugin root.
+
Plugin environments live under persistent `CLAUDE_PLUGIN_DATA`. Manual installs
keep the compatible `~/.claude/skills/seo/.venv` location. A state marker records
the runtime schema, requirements SHA-256, Python major and minor version, public
diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md
index eec66e7..f112f7d 100644
--- a/docs/INSTALLATION.md
+++ b/docs/INSTALLATION.md
@@ -72,7 +72,7 @@ used by every skill. It creates `~/.claude/skills/seo/.venv/` and never falls
back to global or user package installation.
```bash
-~/.claude/skills/seo/bin/claude-seo doctor
+~/.claude/skills/seo/scripts/claude-seo doctor
```
If core setup failed, rerun the inspected installer. If only Chromium failed,
@@ -87,7 +87,7 @@ The installer copies files to:
| Main skill | `~/.claude/skills/seo/` |
| Sub-skills | `~/.claude/skills/seo-*/` |
| Subagents | `~/.claude/agents/seo-*.md` |
-| Runtime launcher | `~/.claude/skills/seo/bin/claude-seo` |
+| Runtime launcher | `~/.claude/skills/seo/scripts/claude-seo` |
| Isolated Python | `~/.claude/skills/seo/.venv/` |
## Verify Installation
@@ -155,7 +155,7 @@ If the file doesn't exist, re-run the installer.
Run the managed setup again:
```bash
-~/.claude/skills/seo/bin/claude-seo setup
+~/.claude/skills/seo/scripts/claude-seo setup
```
### Playwright screenshot errors
@@ -163,8 +163,8 @@ Run the managed setup again:
Run the managed setup again and inspect the result:
```bash
-~/.claude/skills/seo/bin/claude-seo setup
-~/.claude/skills/seo/bin/claude-seo doctor
+~/.claude/skills/seo/scripts/claude-seo setup
+~/.claude/skills/seo/scripts/claude-seo doctor
```
### Permission errors on Unix
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 33fea50..6928e86 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -58,8 +58,8 @@ Dependencies belong in the managed runtime. For a plugin install, run:
For a manual install, run:
```bash
-~/.claude/skills/seo/bin/claude-seo doctor
-~/.claude/skills/seo/bin/claude-seo setup
+~/.claude/skills/seo/scripts/claude-seo doctor
+~/.claude/skills/seo/scripts/claude-seo setup
```
Do not install individual packages, use `pip --user`, or create a PATH shim.
diff --git a/extensions/ahrefs/docs/AHREFS-SETUP.md b/extensions/ahrefs/docs/AHREFS-SETUP.md
index a620a5b..1d7b9e1 100644
--- a/extensions/ahrefs/docs/AHREFS-SETUP.md
+++ b/extensions/ahrefs/docs/AHREFS-SETUP.md
@@ -53,7 +53,7 @@ The Python merge script is idempotent — re-running only replaces the
Ahrefs charges per "unit". A unit covers most read endpoints (domain
metrics, backlink data) at 1 unit each; bulk endpoints cost more. The
-`claude-seo run dataforseo_costs.py` cost tracker shipped with claude-seo
+`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py` cost tracker shipped with claude-seo
generalises across vendors — see the DataForSEO extension's
`references/cost-tiers.md` for the budget-preset pattern to mirror when
wiring Ahrefs accounting.
diff --git a/extensions/ahrefs/skills/seo-ahrefs/SKILL.md b/extensions/ahrefs/skills/seo-ahrefs/SKILL.md
index 443e0c1..2819593 100644
--- a/extensions/ahrefs/skills/seo-ahrefs/SKILL.md
+++ b/extensions/ahrefs/skills/seo-ahrefs/SKILL.md
@@ -46,7 +46,7 @@ provide the install command above.
Ahrefs API usage is metered per unit. Before running a batch (>= 50 URLs):
-1. Estimate cost with `claude-seo run dataforseo_costs.py` (the cost-tracker module is generic and supports Ahrefs unit accounting).
+1. Estimate cost with `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py` (the cost-tracker module is generic and supports Ahrefs unit accounting).
2. Surface the estimate to the orchestrator.
3. Log actual cost after each call.
diff --git a/extensions/banana/README.md b/extensions/banana/README.md
index c4b377c..2827591 100644
--- a/extensions/banana/README.md
+++ b/extensions/banana/README.md
@@ -39,7 +39,7 @@ The installer will:
CSV batch planning helper:
```bash
-claude-seo run --extension banana batch.py --csv requests.csv --model "$NANOBANANA_MODEL"
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana batch.py --csv requests.csv --model "$NANOBANANA_MODEL"
```
## Use Case Defaults
diff --git a/extensions/banana/docs/BANANA-SETUP.md b/extensions/banana/docs/BANANA-SETUP.md
index 2861800..7f8278f 100644
--- a/extensions/banana/docs/BANANA-SETUP.md
+++ b/extensions/banana/docs/BANANA-SETUP.md
@@ -31,14 +31,14 @@ add to `~/.claude/settings.json`:
Scripted setup helper:
```bash
-claude-seo run --extension banana setup_mcp.py --key YOUR_KEY
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana setup_mcp.py --key YOUR_KEY
```
## Verifying Installation
Run the validation script:
```bash
-claude-seo run --extension banana validate_setup.py
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana validate_setup.py
```
Or check manually:
diff --git a/extensions/banana/install.sh b/extensions/banana/install.sh
index a36bd8e..a56a10c 100755
--- a/extensions/banana/install.sh
+++ b/extensions/banana/install.sh
@@ -154,14 +154,15 @@ PY
cp "${SOURCE_DIR}/scripts/"*.py "${SKILL_DIR}/scripts/"
cp "${SOURCE_DIR}/references/"*.md "${SKILL_DIR}/references/"
- # Rewrite only files copied by this extension install. Manual installs do
- # not receive plugin bin/ PATH injection.
+ # Rewrite only files copied by this extension install. Manual installs have
+ # no ${CLAUDE_PLUGIN_ROOT}, so the canonical launcher token becomes the
+ # absolute installed path. The substitution is idempotent.
for installed_doc in "${SKILL_DIR}/SKILL.md" "${SKILL_DIR}/references/"*.md "${AGENT_DIR}/seo-image-gen.md"; do
[ -f "${installed_doc}" ] || continue
temp_doc="${installed_doc}.claude-seo-tmp"
- sed -e 's#claude-seo run#"$HOME/.claude/skills/seo/bin/claude-seo" run#g' \
- -e 's#claude-seo setup#"$HOME/.claude/skills/seo/bin/claude-seo" setup#g' \
- -e 's#claude-seo doctor#"$HOME/.claude/skills/seo/bin/claude-seo" doctor#g' \
+ sed -e 's#"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run#"$HOME/.claude/skills/seo/scripts/claude-seo" run#g' \
+ -e 's#"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" setup#"$HOME/.claude/skills/seo/scripts/claude-seo" setup#g' \
+ -e 's#"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" doctor#"$HOME/.claude/skills/seo/scripts/claude-seo" doctor#g' \
"${installed_doc}" > "${temp_doc}"
mv "${temp_doc}" "${installed_doc}"
done
diff --git a/extensions/banana/references/gemini-models.md b/extensions/banana/references/gemini-models.md
index 78fccf5..5b3909d 100644
--- a/extensions/banana/references/gemini-models.md
+++ b/extensions/banana/references/gemini-models.md
@@ -121,7 +121,7 @@ Verify current rate limits in Google-owned docs before planning batch work.
Do not use hard-coded pricing assumptions. Verify current pricing at
https://ai.google.dev/gemini-api/docs/pricing and store dated values in
-`~/.banana/pricing.json` via `claude-seo run --extension banana cost_tracker.py`.
+`~/.banana/pricing.json` via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana cost_tracker.py`.
## Image Output Specs
diff --git a/extensions/banana/references/seo-image-presets.md b/extensions/banana/references/seo-image-presets.md
index ce4880c..1a06977 100644
--- a/extensions/banana/references/seo-image-presets.md
+++ b/extensions/banana/references/seo-image-presets.md
@@ -123,7 +123,7 @@ preset format (see `references/presets.md` for schema details).
Users can create their own presets:
```bash
-claude-seo run --extension banana presets.py create my-brand
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana presets.py create my-brand
```
This creates `~/.banana/presets/my-brand.json` with the full schema.
diff --git a/extensions/banana/skills/seo-image-gen/SKILL.md b/extensions/banana/skills/seo-image-gen/SKILL.md
index 93ed287..f09bf4c 100644
--- a/extensions/banana/skills/seo-image-gen/SKILL.md
+++ b/extensions/banana/skills/seo-image-gen/SKILL.md
@@ -83,7 +83,7 @@ For every generation request:
If the user mentions a brand or has SEO presets configured:
```bash
-claude-seo run --extension banana presets.py list
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana presets.py list
```
Load matching preset and apply as defaults. Also check `${CLAUDE_SKILL_DIR}/references/seo-image-presets.md`
for SEO-specific preset templates.
@@ -121,7 +121,7 @@ After every successful generation, guide the user on:
Image generation costs money. Be transparent:
- Show estimated cost before generating (especially for batch)
-- Log every generation: `claude-seo run --extension banana cost_tracker.py log --model MODEL --resolution RES --prompt "brief"`
+- Log every generation: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana cost_tracker.py log --model MODEL --resolution RES --prompt "brief"`
- Run `cost_tracker.py summary` if user asks about usage
Pricing is not hard-coded. Check current Google pricing at
@@ -141,12 +141,12 @@ https://ai.google.dev/gemini-api/docs/pricing, store dated values in
| Error | Resolution |
|-------|-----------|
-| MCP not configured | Run `./extensions/banana/install.sh` or `claude-seo run --extension banana setup_mcp.py --key YOUR_KEY` |
+| MCP not configured | Run `./extensions/banana/install.sh` or `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana setup_mcp.py --key YOUR_KEY` |
| API key invalid | New key at https://aistudio.google.com/apikey |
| Rate limited (429) | Wait 60s, retry. Check current free-tier limits before batch operations |
| `IMAGE_SAFETY` | Rephrase prompt - see `references/prompt-engineering.md` Safety section |
-| MCP unavailable | Fall back: `claude-seo run --extension banana generate.py --prompt "..." --aspect-ratio "16:9" --model "$NANOBANANA_MODEL"` |
-| CSV batch input | Plan first: `claude-seo run --extension banana batch.py --csv requests.csv --model "$NANOBANANA_MODEL"` |
+| MCP unavailable | Fall back: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana generate.py --prompt "..." --aspect-ratio "16:9" --model "$NANOBANANA_MODEL"` |
+| CSV batch input | Plan first: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run --extension banana batch.py --csv requests.csv --model "$NANOBANANA_MODEL"` |
| Extension not installed | Show install instructions: `./extensions/banana/install.sh` |
## Cross-Skill Integration
diff --git a/extensions/bing-webmaster/docs/BING-WEBMASTER-SETUP.md b/extensions/bing-webmaster/docs/BING-WEBMASTER-SETUP.md
index 0c4c67a..27541a9 100644
--- a/extensions/bing-webmaster/docs/BING-WEBMASTER-SETUP.md
+++ b/extensions/bing-webmaster/docs/BING-WEBMASTER-SETUP.md
@@ -4,9 +4,9 @@
1. **Bing Webmaster Tools API**: inbound links, crawl stats, search
keywords, and competitor link comparison via
- `claude-seo run bing_webmaster.py` (already shipped with claude-seo).
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run bing_webmaster.py` (already shipped with claude-seo).
2. **IndexNow URL submission** for Amazon, Bing, Naver, Seznam.cz,
- Yandex, and Yep via `claude-seo run indexnow_submit.py`.
+ Yandex, and Yep via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run indexnow_submit.py`.
3. A unified `seo-bing` skill that routes the right command at the
right script.
diff --git a/extensions/bing-webmaster/install.sh b/extensions/bing-webmaster/install.sh
index ed6b936..e313bbf 100755
--- a/extensions/bing-webmaster/install.sh
+++ b/extensions/bing-webmaster/install.sh
@@ -53,7 +53,7 @@ PY
echo
echo "Done. Verify your IndexNow key is published:"
- echo " claude-seo run indexnow_submit.py --host example.com \\"
+ echo " \"\$HOME/.claude/skills/seo/scripts/claude-seo\" run indexnow_submit.py --host example.com \\"
echo " --key \$INDEXNOW_KEY --key-location \$INDEXNOW_KEY_LOCATION --verify-only"
}
main "$@"
diff --git a/extensions/bing-webmaster/skills/seo-bing/SKILL.md b/extensions/bing-webmaster/skills/seo-bing/SKILL.md
index 1d3742f..219089d 100644
--- a/extensions/bing-webmaster/skills/seo-bing/SKILL.md
+++ b/extensions/bing-webmaster/skills/seo-bing/SKILL.md
@@ -24,11 +24,11 @@ specifically for **Amazon/Bing/Naver/Seznam.cz/Yandex/Yep indexing** and
| Command | Underlying script |
|---|---|
-| `/seo bing links <url>` | `claude-seo run bing_webmaster.py links <url>` |
-| `/seo bing compare <urlA> <urlB>` | `claude-seo run bing_webmaster.py compare <urlA> <urlB>`; both properties must be registered to the API account |
-| `/seo bing submit <url>` (single URL) | `claude-seo run indexnow_submit.py --host ... --urls <url>` |
-| `/seo bing submit-batch <file>` | `claude-seo run indexnow_submit.py --host ... --urls-file <file>` |
-| `/seo bing verify-indexnow` | `claude-seo run indexnow_submit.py --host ... --verify-only` |
+| `/seo bing links <url>` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run bing_webmaster.py links <url>` |
+| `/seo bing compare <urlA> <urlB>` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run bing_webmaster.py compare <urlA> <urlB>`; both properties must be registered to the API account |
+| `/seo bing submit <url>` (single URL) | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run indexnow_submit.py --host ... --urls <url>` |
+| `/seo bing submit-batch <file>` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run indexnow_submit.py --host ... --urls-file <file>` |
+| `/seo bing verify-indexnow` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run indexnow_submit.py --host ... --verify-only` |
## When this skill applies
diff --git a/extensions/dataforseo/skills/seo-dataforseo/SKILL.md b/extensions/dataforseo/skills/seo-dataforseo/SKILL.md
index f385adf..a6c62c4 100644
--- a/extensions/dataforseo/skills/seo-dataforseo/SKILL.md
+++ b/extensions/dataforseo/skills/seo-dataforseo/SKILL.md
@@ -48,7 +48,7 @@ DataForSEO charges per API call. Be efficient:
**Before every DataForSEO MCP call**, run cost estimation:
```
-claude-seo run dataforseo_costs.py check <endpoint> [--count N]
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py check <endpoint> [--count N]
```
- If `"status": "approved"` → proceed with the API call
@@ -57,7 +57,7 @@ claude-seo run dataforseo_costs.py check <endpoint> [--count N]
**After each API call completes**, log the cost:
```
-claude-seo run dataforseo_costs.py log <endpoint> <actual_cost>
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py log <endpoint> <actual_cost>
```
**User commands for cost management:**
diff --git a/extensions/dataforseo/skills/seo-dataforseo/references/cost-tiers.md b/extensions/dataforseo/skills/seo-dataforseo/references/cost-tiers.md
index 1734a28..bd0a252 100644
--- a/extensions/dataforseo/skills/seo-dataforseo/references/cost-tiers.md
+++ b/extensions/dataforseo/skills/seo-dataforseo/references/cost-tiers.md
@@ -31,7 +31,7 @@
| **Aggressive** | $50.00 | $2.00 | threshold | Agency bulk work |
| **Unlimited** | $999.00 | -- | none | Trusted pipelines |
-Configure with: `claude-seo run dataforseo_costs.py config --mode threshold --threshold 0.50 --daily-limit 10.00`
+Configure with: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py config --mode threshold --threshold 0.50 --daily-limit 10.00`
## Cost Reduction Tips
@@ -44,11 +44,11 @@ Configure with: `claude-seo run dataforseo_costs.py config --mode threshold --th
## Approval Flow
Before any DataForSEO MCP call:
-1. Run `claude-seo run dataforseo_costs.py check <endpoint> [--count N]`
+1. Run `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py check <endpoint> [--count N]`
2. If `status: "approved"` → proceed
3. If `status: "needs_approval"` → show cost to user, ask to confirm
4. If `status: "blocked"` → inform user daily limit would be exceeded
-5. After call completes, log: `claude-seo run dataforseo_costs.py log <endpoint> <cost>`
+5. After call completes, log: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py log <endpoint> <cost>`
## Warn Endpoints
diff --git a/extensions/seranking/skills/seo-seranking/SKILL.md b/extensions/seranking/skills/seo-seranking/SKILL.md
index 0365df4..18f1cba 100644
--- a/extensions/seranking/skills/seo-seranking/SKILL.md
+++ b/extensions/seranking/skills/seo-seranking/SKILL.md
@@ -42,7 +42,7 @@ Report each as a percentage with a confidence note based on sample size.
## Cost guardrails
SE Ranking API uses unit accounting. Single AI visibility query is
-~5 units (1 per platform). Use `claude-seo run dataforseo_costs.py` to log
+~5 units (1 per platform). Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py` to log
spend across vendors.
## Cross-skill delegation
diff --git a/extensions/unlighthouse/skills/seo-unlighthouse/SKILL.md b/extensions/unlighthouse/skills/seo-unlighthouse/SKILL.md
index 69cbe29..348bc65 100644
--- a/extensions/unlighthouse/skills/seo-unlighthouse/SKILL.md
+++ b/extensions/unlighthouse/skills/seo-unlighthouse/SKILL.md
@@ -28,7 +28,7 @@ and aggregate the results. Useful when:
| `/seo unlighthouse <url> --device desktop` | Desktop form factor |
| `/seo unlighthouse <url> --max-routes 50 --output-dir ./reports` | Cap + persist |
-All flags forward through `claude-seo run unlighthouse_run.py`, which handles
+All flags forward through `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run unlighthouse_run.py`, which handles
url_safety pre-flight and subprocess timeout management.
## Output handling
@@ -44,4 +44,4 @@ returns it parsed. Aggregate fields:
- For single-URL field data (CrUX), use `seo-google psi` / `seo-google crux`.
- For LCP subpart decomposition on slow pages, use the
- `claude-seo run lcp_subparts.py` workflow (Phase C).
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run lcp_subparts.py` workflow (Phase C).
diff --git a/install.ps1 b/install.ps1
index 21b4965..98336a5 100644
--- a/install.ps1
+++ b/install.ps1
@@ -197,12 +197,14 @@ try {
Copy-Item -Recurse -Force "$ScriptsPath\*" $SkillScripts
}
- # Copy the stable launcher used by skill and agent instructions.
- $BinPath = Join-Path $TempDir 'bin'
- $SkillBin = Join-Path $SkillDir 'bin'
- if (Test-Path (Join-Path $BinPath 'claude-seo')) {
- New-Item -ItemType Directory -Force -Path $SkillBin | Out-Null
- Copy-Item -Force (Join-Path $BinPath 'claude-seo') (Join-Path $SkillBin 'claude-seo')
+ # Copy the stable launcher used by skill and agent instructions. It ships in
+ # scripts/ (never a top-level bin/, which hosted marketplaces reject) and
+ # resolves runtime.py as a sibling, so it lands beside the copied scripts.
+ $LauncherSource = Join-Path $ScriptsPath 'claude-seo'
+ $SkillLauncherDir = Join-Path $SkillDir 'scripts'
+ if (Test-Path $LauncherSource) {
+ New-Item -ItemType Directory -Force -Path $SkillLauncherDir | Out-Null
+ Copy-Item -Force $LauncherSource (Join-Path $SkillLauncherDir 'claude-seo')
}
# Copy hooks
@@ -263,10 +265,12 @@ try {
Copy-Item -Force $pluginManifest (Join-Path $SkillDir 'runtime-plugin.json')
}
- # Manual installs do not receive plugin bin/ PATH injection. Rewrite only
- # the canonical runtime token in installed Markdown. Claude Code's Bash tool
- # expands $HOME on Windows as well as Unix.
- $manualRunner = '"$HOME/.claude/skills/seo/bin/claude-seo" run'
+ # Manual installs have no ${CLAUDE_PLUGIN_ROOT}. Rewrite the canonical
+ # launcher token in installed Markdown to the absolute installed path.
+ # Claude Code's Bash tool expands $HOME on Windows as well as Unix. The
+ # replacement consumes the plugin-root token, so a second pass is a no-op.
+ $pluginRunner = '"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run'
+ $manualRunner = '"$HOME/.claude/skills/seo/scripts/claude-seo" run'
$installedDocs = @()
Get-ChildItem -Path $SkillsPath -Directory | ForEach-Object {
$sourceRoot = $_.FullName
@@ -306,11 +310,13 @@ try {
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
$installedDocs | ForEach-Object {
$text = [System.IO.File]::ReadAllText($_.FullName)
- $manualSetup = '"$HOME/.claude/skills/seo/bin/claude-seo" setup'
- $manualDoctor = '"$HOME/.claude/skills/seo/bin/claude-seo" doctor'
- $updated = $text.Replace('claude-seo run', $manualRunner)
- $updated = $updated.Replace('claude-seo setup', $manualSetup)
- $updated = $updated.Replace('claude-seo doctor', $manualDoctor)
+ $pluginSetup = '"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" setup'
+ $pluginDoctor = '"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" doctor'
+ $manualSetup = '"$HOME/.claude/skills/seo/scripts/claude-seo" setup'
+ $manualDoctor = '"$HOME/.claude/skills/seo/scripts/claude-seo" doctor'
+ $updated = $text.Replace($pluginRunner, $manualRunner)
+ $updated = $updated.Replace($pluginSetup, $manualSetup)
+ $updated = $updated.Replace($pluginDoctor, $manualDoctor)
if ($updated -ne $text) {
[System.IO.File]::WriteAllText($_.FullName, $updated, $utf8NoBom)
}
diff --git a/install.sh b/install.sh
index b94ccbc..fa80128 100755
--- a/install.sh
+++ b/install.sh
@@ -79,12 +79,13 @@ main() {
cp -r "${TEMP_DIR}/claude-seo/scripts/"* "${SKILL_DIR}/scripts/"
fi
- # Copy the stable runtime launcher. Manual installs use its explicit path;
- # plugin installs expose the repository bin/ directory automatically.
- if [ -f "${TEMP_DIR}/claude-seo/bin/claude-seo" ]; then
- mkdir -p "${SKILL_DIR}/bin"
- cp "${TEMP_DIR}/claude-seo/bin/claude-seo" "${SKILL_DIR}/bin/claude-seo"
- chmod +x "${SKILL_DIR}/bin/claude-seo"
+ # Copy the stable runtime launcher. It ships in scripts/ (never a top-level
+ # bin/, which hosted marketplaces reject) and resolves runtime.py as a
+ # sibling, so the manual layout below already matches the repository layout.
+ if [ -f "${TEMP_DIR}/claude-seo/scripts/claude-seo" ]; then
+ mkdir -p "${SKILL_DIR}/scripts"
+ cp "${TEMP_DIR}/claude-seo/scripts/claude-seo" "${SKILL_DIR}/scripts/claude-seo"
+ chmod +x "${SKILL_DIR}/scripts/claude-seo"
fi
# Copy hooks
@@ -134,14 +135,18 @@ main() {
cp "${TEMP_DIR}/claude-seo/requirements.txt" "${SKILL_DIR}/requirements.txt" 2>/dev/null || true
cp "${TEMP_DIR}/claude-seo/.claude-plugin/plugin.json" "${SKILL_DIR}/runtime-plugin.json" 2>/dev/null || true
- # Manual installs cannot rely on plugin bin/ PATH injection. Rewrite only
- # exact files copied from this checkout during this install.
+ # Manual installs have no ${CLAUDE_PLUGIN_ROOT}, so rewrite the canonical
+ # launcher token to the absolute installed path. Rewrite only exact files
+ # copied from this checkout during this install. The substitution is
+ # idempotent: it consumes the plugin-root token, so a second pass matches
+ # nothing. In a POSIX basic regular expression "$" is literal unless it ends
+ # the expression, so ${CLAUDE_PLUGIN_ROOT} needs no escaping here.
rewrite_doc() {
local doc="$1" temp_doc
temp_doc="${doc}.claude-seo-tmp"
- sed -e 's#claude-seo run#"$HOME/.claude/skills/seo/bin/claude-seo" run#g' \
- -e 's#claude-seo setup#"$HOME/.claude/skills/seo/bin/claude-seo" setup#g' \
- -e 's#claude-seo doctor#"$HOME/.claude/skills/seo/bin/claude-seo" doctor#g' \
+ sed -e 's#"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run#"$HOME/.claude/skills/seo/scripts/claude-seo" run#g' \
+ -e 's#"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" setup#"$HOME/.claude/skills/seo/scripts/claude-seo" setup#g' \
+ -e 's#"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" doctor#"$HOME/.claude/skills/seo/scripts/claude-seo" doctor#g' \
"${doc}" > "${temp_doc}"
mv "${temp_doc}" "${doc}"
}
@@ -180,7 +185,7 @@ main() {
echo "→ Creating isolated Python runtime..."
set +e
- "${SKILL_DIR}/bin/claude-seo" setup
+ "${SKILL_DIR}/scripts/claude-seo" setup
runtime_status=$?
set -e
if [ "${runtime_status}" -ne 0 ] && [ "${runtime_status}" -ne 10 ]; then
diff --git a/scripts/bing_webmaster.py b/scripts/bing_webmaster.py
index 847ab33..ad8bef0 100644
--- a/scripts/bing_webmaster.py
+++ b/scripts/bing_webmaster.py
@@ -550,7 +550,7 @@ def main():
result = {
"status": "error",
"data": None,
- "error": "No Bing Webmaster API key configured. Run: claude-seo run backlinks_auth.py --setup",
+ "error": "No Bing Webmaster API key configured. Run backlinks_auth.py --setup through the claude-seo launcher.",
"metadata": {"source": "bing_webmaster"},
}
if args.json:
diff --git a/bin/claude-seo b/scripts/claude-seo
similarity index 84%
rename from bin/claude-seo
rename to scripts/claude-seo
index a31fe66..1b7c0d2 100755
--- a/bin/claude-seo
+++ b/scripts/claude-seo
@@ -3,8 +3,12 @@ set -euo pipefail
# Stable entry point for bundled Python tools. The launcher uses only shell
# built-ins until a usable Python 3 interpreter has been identified.
+#
+# It lives in scripts/ rather than bin/ because hosted marketplaces reject any
+# plugin that ships a top-level bin/ directory. Skills, agents, and hooks call
+# it as "${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo"; runtime.py is a sibling.
launcher_dir="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
-runtime="${launcher_dir}/../scripts/runtime.py"
+runtime="${launcher_dir}/runtime.py"
if [[ ! -f "${runtime}" ]]; then
echo "Claude SEO runtime is missing. Reinstall Claude SEO." >&2
diff --git a/scripts/consistency_check.py b/scripts/consistency_check.py
index 1857ba9..a46d63b 100644
--- a/scripts/consistency_check.py
+++ b/scripts/consistency_check.py
@@ -177,7 +177,11 @@ def check_runtime_invocations(texts):
r"\b(?:python3|python|py\s+-3)\s+[^\n`]*?scripts/[A-Za-z0-9_./-]+\.py"
)
raw_path = re.compile(r"(?<![\w/])scripts/([A-Za-z0-9_]+\.py)\b")
- runtime = re.compile(r"\bclaude-seo\s+run(?:\s+--extension\s+[a-z0-9-]+)?\s+([A-Za-z0-9_-]+\.py)")
+ # The canonical form is "${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run <script>,
+ # so the closing quote may sit between the launcher name and the subcommand.
+ runtime = re.compile(
+ r"claude-seo[\"']?\s+run(?:\s+--extension\s+[a-z0-9-]+)?\s+([A-Za-z0-9_-]+\.py)"
+ )
for f in carriers:
content = read(f)
for match in bare.finditer(content):
@@ -185,7 +189,7 @@ def check_runtime_invocations(texts):
for script in sorted(set(raw_path.findall(content))):
errors.append(
f"{f}: unsupported raw script path scripts/{script}; "
- f"use claude-seo run {script}"
+ f'use "${{CLAUDE_PLUGIN_ROOT}}/scripts/claude-seo" run {script}'
)
for script in sorted(set(runtime.findall(content))):
if not os.path.isfile(os.path.join(REPO, "scripts", script)) and not any(
diff --git a/scripts/runtime.py b/scripts/runtime.py
index 0809d06..0db15bc 100755
--- a/scripts/runtime.py
+++ b/scripts/runtime.py
@@ -2,8 +2,11 @@
"""Cross-platform runtime for Claude SEO's bundled Python scripts.
This module deliberately uses only the Python standard library. It is launched
-by ``bin/claude-seo`` under a base Python, then dispatches work through the
-managed virtual environment created by ``setup``.
+by the sibling ``scripts/claude-seo`` launcher under a base Python, then
+dispatches work through the managed virtual environment created by ``setup``.
+Skills, agents, and hooks invoke that launcher as
+``"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo"``; the repository keeps no
+top-level ``bin/`` directory because hosted marketplaces reject one.
"""
from __future__ import annotations
diff --git a/skills/seo-audit/SKILL.md b/skills/seo-audit/SKILL.md
index 678c4b1..c2db1f4 100644
--- a/skills/seo-audit/SKILL.md
+++ b/skills/seo-audit/SKILL.md
@@ -14,7 +14,7 @@ metadata:
## Process
-1. **Render homepage**: use `claude-seo run render_page.py <url> --mode auto --json` to capture raw HTML, rendered HTML, extracted text, SPA status, and accessibility data when needed
+1. **Render homepage**: use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <url> --mode auto --json` to capture raw HTML, rendered HTML, extracted text, SPA status, and accessibility data when needed
2. **Detect business type**: analyze homepage signals per seo orchestrator
3. **Crawl site**: follow internal links up to 500 pages, respect robots.txt
4. **Delegate to subagents** (if available, otherwise run inline sequentially):
@@ -27,11 +27,11 @@ metadata:
- `seo-geo` -- AI crawler access, llms.txt, citability, brand mention signals
- `seo-local` -- GBP signals, NAP consistency, reviews, local schema, industry-specific local factors (spawn when Local Service industry detected: brick-and-mortar, SAB, or hybrid business type)
- `seo-maps` -- Geo-grid rank tracking, GBP audit, review intelligence, competitor radius mapping (spawn when Local Service detected AND DataForSEO MCP available)
- - `seo-google` -- CWV field data (CrUX), URL indexation (GSC), organic traffic (GA4) (spawn when Google API credentials detected via `claude-seo run google_auth.py --check`)
- - `seo-backlinks` -- Backlink profile data: DA/PA, referring domains, anchor text, toxic links (spawn when Moz or Bing API credentials detected via `claude-seo run backlinks_auth.py --check`, or always include Common Crawl domain-level metrics)
+ - `seo-google` -- CWV field data (CrUX), URL indexation (GSC), organic traffic (GA4) (spawn when Google API credentials detected via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_auth.py --check`)
+ - `seo-backlinks` -- Backlink profile data: DA/PA, referring domains, anchor text, toxic links (spawn when Moz or Bing API credentials detected via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run backlinks_auth.py --check`, or always include Common Crawl domain-level metrics)
- `seo-cluster` -- Semantic clustering analysis (spawn when content strategy signals detected: blog, pillar pages, topic clusters)
- `seo-sxo` -- Search experience analysis: page-type mismatch, user stories, persona scoring (always include in full audits)
- - `seo-drift` -- Drift analysis: compare against stored baseline (spawn when drift baseline exists for the URL via `claude-seo run drift_history.py <url>`)
+ - `seo-drift` -- Drift analysis: compare against stored baseline (spawn when drift baseline exists for the URL via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_history.py <url>`)
- `seo-ecommerce` -- Product schema, marketplace intelligence (spawn when E-commerce industry detected)
5. **Score** -- aggregate into SEO Health Score (0-100)
6. **Persist audit artifacts** -- write all outputs under `{domain}-audit/`
@@ -55,11 +55,11 @@ Delay between requests: 1 second
- `{domain}-audit/audit-data.json`: Structured audit envelope for report generation
- `{domain}-audit/findings/*.md`: Per-category specialist findings (`technical.md`, `content.md`, `schema.md`, `performance.md`, `visual.md`, etc.)
- `{domain}-audit/screenshots/`: Desktop + mobile captures (if Playwright available)
-- **PDF Report** (recommended): Generate a professional A4 PDF using `claude-seo run google_report.py --type full --data {domain}-audit/audit-data.json --domain <domain> --output-dir {domain}-audit/`. This produces a white-cover enterprise report with TOC, executive summary, charts (Lighthouse gauges, query bars, index donut), metric cards, threshold tables, prioritized recommendations with effort estimates, and implementation roadmap. Always offer PDF generation after completing an audit.
+- **PDF Report** (recommended): Generate a professional A4 PDF using `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_report.py --type full --data {domain}-audit/audit-data.json --domain <domain> --output-dir {domain}-audit/`. This produces a white-cover enterprise report with TOC, executive summary, charts (Lighthouse gauges, query bars, index donut), metric cards, threshold tables, prioritized recommendations with effort estimates, and implementation roadmap. Always offer PDF generation after completing an audit.
## Structured Audit Data Envelope
-Write `{domain}-audit/audit-data.json` with this shape so `claude-seo run google_report.py --type full --data {domain}-audit/audit-data.json --domain <domain> --output-dir {domain}-audit/` can generate a report even when Google API data is unavailable:
+Write `{domain}-audit/audit-data.json` with this shape so `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_report.py --type full --data {domain}-audit/audit-data.json --domain <domain> --output-dir {domain}-audit/` can generate a report even when Google API data is unavailable:
```json
{
@@ -170,7 +170,7 @@ If DataForSEO MCP tools are available, spawn the `seo-dataforseo` agent alongsid
## Google API Integration (Optional)
-If Google API credentials are configured (`claude-seo run google_auth.py --check`), spawn the `seo-google` agent to enrich the audit with real Google field data: CrUX Core Web Vitals (replaces lab-only estimates), GSC URL indexation status, search performance (clicks, impressions, CTR), and GA4 organic traffic trends. The Performance (CWV) category score benefits most from field data.
+If Google API credentials are configured (`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_auth.py --check`), spawn the `seo-google` agent to enrich the audit with real Google field data: CrUX Core Web Vitals (replaces lab-only estimates), GSC URL indexation status, search performance (clicks, impressions, CTR), and GA4 organic traffic trends. The Performance (CWV) category score benefits most from field data.
## Error Handling
diff --git a/skills/seo-backlinks/SKILL.md b/skills/seo-backlinks/SKILL.md
index 9cf5f8f..d9dd840 100644
--- a/skills/seo-backlinks/SKILL.md
+++ b/skills/seo-backlinks/SKILL.md
@@ -18,12 +18,12 @@ metadata:
Before analysis, detect available data sources:
1. **DataForSEO MCP** (premium): Check if `dataforseo_backlinks_summary` tool is available
-2. **Moz API** (free signup): `claude-seo run backlinks_auth.py --check moz --json`
-3. **Bing Webmaster** (free signup): `claude-seo run backlinks_auth.py --check bing --json`
+2. **Moz API** (free signup): `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run backlinks_auth.py --check moz --json`
+3. **Bing Webmaster** (free signup): `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run backlinks_auth.py --check bing --json`
4. **Common Crawl** (always available): Domain-level graph with PageRank
5. **Verification Crawler** (always available): Checks if known backlinks still exist
-Run `claude-seo run backlinks_auth.py --check --json` to detect all sources at once.
+Run `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run backlinks_auth.py --check --json` to detect all sources at once.
If no sources are configured beyond the always-available tier:
- Still produce a report using Common Crawl domain metrics
@@ -48,9 +48,9 @@ Produce all 7 sections below. Each section lists data sources in preference orde
**DataForSEO:** `dataforseo_backlinks_summary` → total backlinks, referring domains, domain rank, follow ratio, trend.
-**Moz API:** `claude-seo run moz_api.py metrics <url> --json` → Domain Authority, Page Authority, Spam Score, linking root domains, external links.
+**Moz API:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py metrics <url> --json` → Domain Authority, Page Authority, Spam Score, linking root domains, external links.
-**Common Crawl:** `claude-seo run commoncrawl_graph.py <domain> --json` → PageRank, harmonic centrality, and low-confidence rank/presence data.
+**Common Crawl:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run commoncrawl_graph.py <domain> --json` → PageRank, harmonic centrality, and low-confidence rank/presence data.
**Scoring:**
@@ -65,9 +65,9 @@ Produce all 7 sections below. Each section lists data sources in preference orde
**DataForSEO:** `dataforseo_backlinks_anchors`
-**Moz API:** `claude-seo run moz_api.py anchors <url> --json`
+**Moz API:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py anchors <url> --json`
-**Bing Webmaster:** `claude-seo run bing_webmaster.py links <url> --json` (extract anchor text from link details)
+**Bing Webmaster:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run bing_webmaster.py links <url> --json` (extract anchor text from link details)
**Healthy distribution benchmarks:**
@@ -86,9 +86,9 @@ Flag if exact-match anchors exceed 15% as a review heuristic; it may indicate un
**DataForSEO:** `dataforseo_backlinks_referring_domains`
-**Moz API:** `claude-seo run moz_api.py domains <url> --json` → domains with DA scores
+**Moz API:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py domains <url> --json` → domains with DA scores
-**Common Crawl:** `claude-seo run commoncrawl_graph.py <domain> --json` → domain-level rank/presence data, no verified referring-domain counts
+**Common Crawl:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run commoncrawl_graph.py <domain> --json` → domain-level rank/presence data, no verified referring-domain counts
Analyze:
- **TLD distribution**: .edu, .gov, .org = high authority. Excessive .xyz, .info = low quality
@@ -100,9 +100,9 @@ Analyze:
**DataForSEO:** `dataforseo_backlinks_bulk_spam_score` + toxic patterns from reference
-**Moz API:** Raw vendor spam_score from `claude-seo run moz_api.py metrics <url> --json` (source-label the value; apply thresholds only if verified against current Moz docs)
+**Moz API:** Raw vendor spam_score from `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py metrics <url> --json` (source-label the value; apply thresholds only if verified against current Moz docs)
-**Verification Crawler:** `claude-seo run verify_backlinks.py --target <url> --links <file> --json` (verify suspicious links still exist)
+**Verification Crawler:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run verify_backlinks.py --target <url> --links <file> --json` (verify suspicious links still exist)
**High-risk indicators (flag immediately):**
- Links from known PBN (Private Blog Network) domains
@@ -124,7 +124,7 @@ Load `../seo/references/backlink-quality.md` for the full 30 toxic patterns and
**DataForSEO:** `dataforseo_backlinks_backlinks` with target type "page"
-**Moz API:** `claude-seo run moz_api.py pages <domain> --json`
+**Moz API:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py pages <domain> --json`
Find:
- Which pages attract the most backlinks
@@ -136,11 +136,11 @@ Find:
**DataForSEO:** `dataforseo_backlinks_referring_domains` for both domains, then compare
-**Bing Webmaster:** `claude-seo run bing_webmaster.py compare <url1> <url2> --json`
+**Bing Webmaster:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run bing_webmaster.py compare <url1> <url2> --json`
only when both properties are registered and accessible to the same Bing API
account. For arbitrary competitors, use DataForSEO, Moz, or Common Crawl.
-**Moz API:** Compare DA/PA between domains via `claude-seo run moz_api.py metrics <url> --json` for each
+**Moz API:** Compare DA/PA between domains via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py metrics <url> --json` for each
Output:
- Domains linking to competitor but NOT to target = link building opportunities
@@ -152,7 +152,7 @@ Output:
**DataForSEO only:** `dataforseo_backlinks_backlinks` with date filters for 30/60/90 day changes
-**Verification Crawler:** For known links, verify current status with `claude-seo run verify_backlinks.py --target <url> --links <file> --json`
+**Verification Crawler:** For known links, verify current status with `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run verify_backlinks.py --target <url> --links <file> --json`
**Note:** Free sources cannot track new/lost links over time. If this section is requested without DataForSEO, inform the user: "Link velocity tracking requires the DataForSEO extension. Free sources provide point-in-time snapshots only."
diff --git a/skills/seo-cluster/SKILL.md b/skills/seo-cluster/SKILL.md
index 5dbddbb..9b2a181 100644
--- a/skills/seo-cluster/SKILL.md
+++ b/skills/seo-cluster/SKILL.md
@@ -80,7 +80,7 @@ the full algorithm.
- Skip pairs where both are long-tail variants of the same head term (assume same cluster)
**DataForSEO integration:** If DataForSEO MCP is available, use `serp_organic_live_advanced`
-instead of WebSearch for SERP data. Run `claude-seo run dataforseo_costs.py check serp_organic_live_advanced --count N`
+instead of WebSearch for SERP data. Run `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py check serp_organic_live_advanced --count N`
before each batch. If `"status": "needs_approval"`, show cost estimate and ask user.
If `"status": "blocked"`, fall back to WebSearch.
@@ -312,7 +312,7 @@ After cluster planning or execution completes, offer:
## Security
-- All URLs fetched via `claude-seo run render_page.py <url> --mode auto` (SPA-aware SSRF protection via `url_safety`)
+- All URLs fetched via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <url> --mode auto` (SPA-aware SSRF protection via `url_safety`)
- No credentials stored or transmitted
- Output files contain no PII or API keys
- DataForSEO cost checks run before every API call
diff --git a/skills/seo-dataforseo/SKILL.md b/skills/seo-dataforseo/SKILL.md
index 3613ffd..b2be216 100644
--- a/skills/seo-dataforseo/SKILL.md
+++ b/skills/seo-dataforseo/SKILL.md
@@ -48,7 +48,7 @@ DataForSEO charges per API call. Be efficient:
**Before every DataForSEO MCP call**, run cost estimation:
```
-claude-seo run dataforseo_costs.py check <endpoint> [--count N]
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py check <endpoint> [--count N]
```
- If `"status": "approved"` → proceed with the API call
@@ -57,7 +57,7 @@ claude-seo run dataforseo_costs.py check <endpoint> [--count N]
**After each API call completes**, log the cost:
```
-claude-seo run dataforseo_costs.py log <endpoint> <actual_cost>
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py log <endpoint> <actual_cost>
```
**User commands for cost management:**
diff --git a/skills/seo-dataforseo/references/cost-tiers.md b/skills/seo-dataforseo/references/cost-tiers.md
index 1734a28..bd0a252 100644
--- a/skills/seo-dataforseo/references/cost-tiers.md
+++ b/skills/seo-dataforseo/references/cost-tiers.md
@@ -31,7 +31,7 @@
| **Aggressive** | $50.00 | $2.00 | threshold | Agency bulk work |
| **Unlimited** | $999.00 | -- | none | Trusted pipelines |
-Configure with: `claude-seo run dataforseo_costs.py config --mode threshold --threshold 0.50 --daily-limit 10.00`
+Configure with: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py config --mode threshold --threshold 0.50 --daily-limit 10.00`
## Cost Reduction Tips
@@ -44,11 +44,11 @@ Configure with: `claude-seo run dataforseo_costs.py config --mode threshold --th
## Approval Flow
Before any DataForSEO MCP call:
-1. Run `claude-seo run dataforseo_costs.py check <endpoint> [--count N]`
+1. Run `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py check <endpoint> [--count N]`
2. If `status: "approved"` → proceed
3. If `status: "needs_approval"` → show cost to user, ask to confirm
4. If `status: "blocked"` → inform user daily limit would be exceeded
-5. After call completes, log: `claude-seo run dataforseo_costs.py log <endpoint> <cost>`
+5. After call completes, log: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py log <endpoint> <cost>`
## Warn Endpoints
diff --git a/skills/seo-drift/SKILL.md b/skills/seo-drift/SKILL.md
index a18467d..a16c330 100644
--- a/skills/seo-drift/SKILL.md
+++ b/skills/seo-drift/SKILL.md
@@ -95,16 +95,16 @@ Captures the current state of a page and stores it.
**Steps:**
1. Validate URL (SSRF protection via `google_auth.validate_url()`)
-2. Fetch page via `claude-seo run fetch_page.py <URL>`
-3. Parse HTML via `claude-seo run parse_html.py <URL>`
-4. Optionally fetch CWV via `claude-seo run pagespeed_check.py <URL>` (use `--skip-cwv` to skip)
+2. Fetch page via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run fetch_page.py <URL>`
+3. Parse HTML via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run parse_html.py <URL>`
+4. Optionally fetch CWV via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run pagespeed_check.py <URL>` (use `--skip-cwv` to skip)
5. Hash HTML body and schema content (SHA-256)
6. Store snapshot in SQLite
**Execution:**
```bash
-claude-seo run drift_baseline.py <url>
-claude-seo run drift_baseline.py <url> --skip-cwv
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_baseline.py <url>
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_baseline.py <url> --skip-cwv
```
**Output:** JSON with baseline ID, timestamp, URL, and summary of captured elements.
@@ -126,16 +126,16 @@ Fetches the current page state and diffs it against the most recent baseline.
**Execution:**
```bash
-claude-seo run drift_compare.py <url>
-claude-seo run drift_compare.py <url> --baseline-id 5
-claude-seo run drift_compare.py <url> --skip-cwv
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_compare.py <url>
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_compare.py <url> --baseline-id 5
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_compare.py <url> --skip-cwv
```
**Output:** JSON with all triggered rules, old/new values, severity, and actions.
After comparison, offer to generate an HTML report:
```bash
-claude-seo run drift_report.py <comparison_json_file> --output drift-report.html
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_report.py <comparison_json_file> --output drift-report.html
```
---
@@ -146,8 +146,8 @@ Shows all baselines and comparisons for a URL.
**Execution:**
```bash
-claude-seo run drift_history.py <url>
-claude-seo run drift_history.py <url> --limit 10
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_history.py <url>
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run drift_history.py <url> --limit 10
```
**Output:** JSON array of baselines (newest first) with timestamps and comparison summaries.
@@ -187,7 +187,7 @@ When drift is detected, recommend the appropriate specialized skill:
## Security
-- **All URL fetching** goes through `claude-seo run fetch_page.py`, which enforces SSRF protection
+- **All URL fetching** goes through `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run fetch_page.py`, which enforces SSRF protection
(blocks private IPs, loopback, reserved ranges, GCP metadata endpoints)
- **No curl, no subprocess HTTP calls** -- only the project's validated fetch pipeline
- **All SQLite queries** use parameterized placeholders (`?`), never string interpolation
diff --git a/skills/seo-ecommerce/SKILL.md b/skills/seo-ecommerce/SKILL.md
index 7902df1..f368935 100644
--- a/skills/seo-ecommerce/SKILL.md
+++ b/skills/seo-ecommerce/SKILL.md
@@ -42,8 +42,8 @@ Fetch and parse any product page for on-page SEO quality.
### Workflow
```
-1. claude-seo run render_page.py <url> --mode auto → raw/rendered HTML
-2. claude-seo run parse_html.py --url <url> → SEO elements
+1. "${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <url> --mode auto → raw/rendered HTML
+2. "${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run parse_html.py --url <url> → SEO elements
3. Analyze product-specific signals (below)
```
@@ -107,7 +107,7 @@ Live competitive analysis from Google Shopping results.
Before EVERY Merchant API call:
```bash
-claude-seo run dataforseo_costs.py check merchant_google_products_search
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py check merchant_google_products_search
```
- `"status": "approved"` -- proceed
@@ -116,20 +116,20 @@ claude-seo run dataforseo_costs.py check merchant_google_products_search
After each call:
```bash
-claude-seo run dataforseo_costs.py log merchant_google_products_search <cost>
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py log merchant_google_products_search <cost>
```
### Workflow
```bash
# Product search: who sells what at what price
-claude-seo run dataforseo_merchant.py search "<keyword>" --marketplace google
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_merchant.py search "<keyword>" --marketplace google
# Seller analysis: merchant ratings and dominance
-claude-seo run dataforseo_merchant.py sellers "<keyword>"
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_merchant.py sellers "<keyword>"
# Normalize results for analysis
-claude-seo run dataforseo_normalize.py results.json --module merchant
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_normalize.py results.json --module merchant
```
### Analysis Outputs
@@ -163,7 +163,7 @@ Cross-marketplace intelligence comparing Google Shopping and Amazon.
### Cost Guardrail (MANDATORY)
```bash
-claude-seo run dataforseo_costs.py check merchant_amazon_products_search
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_costs.py check merchant_amazon_products_search
```
Amazon endpoints are in the `warn_endpoints` set -- always requires user approval.
@@ -172,10 +172,10 @@ Amazon endpoints are in the `warn_endpoints` set -- always requires user approva
```bash
# Amazon product search
-claude-seo run dataforseo_merchant.py search "<keyword>" --marketplace amazon
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_merchant.py search "<keyword>" --marketplace amazon
# Cross-marketplace comparison
-claude-seo run dataforseo_merchant.py compare "<keyword>"
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_merchant.py compare "<keyword>"
```
### Cross-Marketplace Report
@@ -327,10 +327,10 @@ capability examples, and the relationship to AP2 (Agent Payments Protocol).
```bash
# Discover and validate the UCP profile
-claude-seo run ucp_check.py https://store.example.com --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run ucp_check.py https://store.example.com --json
# With endpoint reachability probes (HEAD each declared capability)
-claude-seo run ucp_check.py https://store.example.com --probe-endpoints --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run ucp_check.py https://store.example.com --probe-endpoints --json
```
The script returns: profile presence, version, declared capabilities,
diff --git a/skills/seo-ecommerce/references/marketplace-endpoints.md b/skills/seo-ecommerce/references/marketplace-endpoints.md
index ef28c80..13600ed 100644
--- a/skills/seo-ecommerce/references/marketplace-endpoints.md
+++ b/skills/seo-ecommerce/references/marketplace-endpoints.md
@@ -110,7 +110,7 @@ When consuming responses, normalize:
| Rating | Integer or float | Float rounded to 1 decimal |
| Reviews | String or int | Integer |
-Use `claude-seo run dataforseo_normalize.py --module merchant` for automatic normalization.
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run dataforseo_normalize.py --module merchant` for automatic normalization.
## Cost Reference
diff --git a/skills/seo-flow/SKILL.md b/skills/seo-flow/SKILL.md
index aaf129f..c6ff6a8 100644
--- a/skills/seo-flow/SKILL.md
+++ b/skills/seo-flow/SKILL.md
@@ -82,7 +82,7 @@ Load prompt files on demand, only for the stage the user requests.
2. Display the full index: all 41 prompts with stage, name, trigger conditions
### On `/seo flow sync`
-1. Run: `claude-seo run sync_flow.py`
+1. Run: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run sync_flow.py`
2. Display the JSON summary (files added, updated, unchanged)
3. Show attribution notice after sync completes
diff --git a/skills/seo-google/SKILL.md b/skills/seo-google/SKILL.md
index 4cca80d..1cc50c7 100644
--- a/skills/seo-google/SKILL.md
+++ b/skills/seo-google/SKILL.md
@@ -29,7 +29,7 @@ service account -- run `/seo google setup` for step-by-step instructions.
Before executing any command, check credentials:
```bash
-claude-seo run google_auth.py --check --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_auth.py --check --json
```
Config file: `~/.config/claude-seo/google-api.json`
@@ -89,7 +89,7 @@ Always communicate the detected tier before running commands.
Combined Lighthouse lab data + CrUX field data.
-**Script:** `claude-seo run pagespeed_check.py <url> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run pagespeed_check.py <url> --json`
**Reference:** `references/pagespeed-crux-api.md`
**Default:** Both mobile + desktop strategies, all Lighthouse categories.
@@ -100,13 +100,13 @@ Chrome user metrics). CrUX tries URL-level first, falls back to origin-level.
CrUX field data only (no Lighthouse run). Faster.
-**Script:** `claude-seo run pagespeed_check.py <url> --crux-only --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run pagespeed_check.py <url> --crux-only --json`
### `/seo google crux-history <url>`
25-week CrUX History trends. Shows whether CWV metrics are improving, stable, or degrading.
-**Script:** `claude-seo run crux_history.py <url> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run crux_history.py <url> --json`
**Reference:** `references/pagespeed-crux-api.md`
Output includes per-metric trend direction, percentage change, and weekly p75 values.
@@ -119,7 +119,7 @@ Output includes per-metric trend direction, percentage change, and weekly p75 va
Search Analytics: clicks, impressions, CTR, position for last 28 days.
-**Script:** `claude-seo run gsc_query.py --property <property> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run gsc_query.py --property <property> --json`
**Reference:** `references/search-console-api.md`
**Default:** 28 days, dimensions=query,page, type=web, limit=1000.
@@ -145,7 +145,7 @@ dimension rows, not the size of every pagination request.
URL Inspection: real indexation status from Google.
-**Script:** `claude-seo run gsc_inspect.py <url> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run gsc_inspect.py <url> --json`
Returns: verdict (PASS/FAIL), coverage state, robots.txt status, indexing state,
page fetch state, canonical selection, mobile usability, rich results.
@@ -154,7 +154,7 @@ page fetch state, canonical selection, mobile usability, rich results.
Batch inspection from a file (one URL per line). Rate limited to 2,000/day per site.
-**Script:** `claude-seo run gsc_inspect.py --batch <file> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run gsc_inspect.py --batch <file> --json`
### `/seo google sitemaps <property>`
@@ -162,7 +162,7 @@ List submitted sitemaps with status, errors, warnings. Sitemap contents report
submitted counts only; URL Inspection API is the indexation truth for whether
specific URLs are indexed.
-**Script:** `claude-seo run gsc_query.py sitemaps --property <property> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run gsc_query.py sitemaps --property <property> --json`
---
@@ -172,7 +172,7 @@ specific URLs are indexed.
Notify Google of a URL update.
-**Script:** `claude-seo run indexing_notify.py <url> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run indexing_notify.py <url> --json`
**Reference:** `references/indexing-api.md`
The Indexing API is officially for JobPosting and BroadcastEvent/VideoObject pages.
@@ -182,7 +182,7 @@ Always inform the user of this restriction. Daily quota: 200 publish requests.
Batch submit URLs from a file. Tracks quota usage.
-**Script:** `claude-seo run indexing_notify.py --batch <file> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run indexing_notify.py --batch <file> --json`
---
@@ -192,7 +192,7 @@ Batch submit URLs from a file. Tracks quota usage.
Organic traffic report: daily sessions, users, pageviews, bounce rate, engagement.
-**Script:** `claude-seo run ga4_report.py --property <id> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run ga4_report.py --property <id> --json`
**Reference:** `references/ga4-data-api.md`
**Default:** 28 days, filtered to Organic Search channel group.
@@ -202,7 +202,7 @@ Organic traffic report: daily sessions, users, pageviews, bounce rate, engagemen
Top organic landing pages ranked by sessions.
-**Script:** `claude-seo run ga4_report.py --property <id> --report top-pages --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run ga4_report.py --property <id> --report top-pages --json`
---
@@ -214,7 +214,7 @@ Some third-party studies report a 0.737 correlation between YouTube mentions and
Search YouTube for videos. Returns title, channel, views, likes, duration.
-**Script:** `claude-seo run youtube_search.py search "<query>" --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run youtube_search.py search "<query>" --json`
**Reference:** `references/youtube-api.md`
**Quota:** 100 units per search (10,000 units/day free).
@@ -222,7 +222,7 @@ Search YouTube for videos. Returns title, channel, views, likes, duration.
Detailed video info + tags + top 10 comments.
-**Script:** `claude-seo run youtube_search.py video <video_id> --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run youtube_search.py video <video_id> --json`
**Quota:** 2 units (video details + comments).
---
@@ -235,7 +235,7 @@ Google NLP entity/sentiment output for internal content-quality checks. Do not t
Full NLP analysis: entities, sentiment, content classification.
-**Script:** `claude-seo run nlp_analyze.py --url <url> --json` or `--text "..."`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run nlp_analyze.py --url <url> --json` or `--text "..."`
**Reference:** `references/nlp-api.md`
**Free tier:** 5,000 units/month. Requires billing enabled on GCP project.
@@ -243,7 +243,7 @@ Full NLP analysis: entities, sentiment, content classification.
Entity extraction only (faster, less quota).
-**Script:** `claude-seo run nlp_analyze.py --url <url> --features entities --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run nlp_analyze.py --url <url> --features entities --json`
---
@@ -255,7 +255,7 @@ Gold-standard keyword volume data. Requires Google Ads account.
Generate keyword ideas from seed terms.
-**Script:** `claude-seo run keyword_planner.py ideas "<seed>" --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run keyword_planner.py ideas "<seed>" --json`
**Reference:** `references/keyword-planner-api.md`
**Requires:** Ads developer token + customer ID in config (Tier 3).
@@ -263,7 +263,7 @@ Generate keyword ideas from seed terms.
Search volume for specific keywords (comma-separated).
-**Script:** `claude-seo run keyword_planner.py volume "<kw1>,<kw2>" --json`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run keyword_planner.py volume "<kw1>,<kw2>" --json`
---
@@ -296,7 +296,7 @@ After any analysis command, offer to generate a PDF/HTML report.
Generate a professional PDF report with charts and analytics.
-**Script:** `claude-seo run google_report.py --type <type> --data <json> --domain <domain> --format pdf`
+**Script:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_report.py --type <type> --data <json> --domain <domain> --format pdf`
| Type | Input | Output |
|------|-------|--------|
@@ -307,8 +307,8 @@ Generate a professional PDF report with charts and analytics.
**Workflow:**
1. Run data collection commands (pagespeed, gsc, inspect-batch, etc.)
-2. Save JSON output to file: `claude-seo run pagespeed_check.py <url> --json > data.json`
-3. Generate report: `claude-seo run google_report.py --type cwv-audit --data data.json --domain <domain>`
+2. Save JSON output to file: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run pagespeed_check.py <url> --json > data.json`
+3. Generate report: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_report.py --type cwv-audit --data data.json --domain <domain>`
**Convention:** After completing analysis, suggest: "Generate a report? Use `/seo google report <type>`"
diff --git a/skills/seo-google/references/auth-setup.md b/skills/seo-google/references/auth-setup.md
index 5f36214..8265533 100644
--- a/skills/seo-google/references/auth-setup.md
+++ b/skills/seo-google/references/auth-setup.md
@@ -106,7 +106,7 @@ Save to `~/.config/claude-seo/google-api.json`:
## Step 8: Verify Setup
```bash
-claude-seo run google_auth.py --check
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_auth.py --check
```
Expected output at Tier 2 (full):
diff --git a/skills/seo-hreflang/references/machine-translation-qa.md b/skills/seo-hreflang/references/machine-translation-qa.md
index 7384e7c..894632d 100644
--- a/skills/seo-hreflang/references/machine-translation-qa.md
+++ b/skills/seo-hreflang/references/machine-translation-qa.md
@@ -42,7 +42,7 @@ content abuse.
- For per-page hreflang validation, stay inside `seo-hreflang`.
- For broader scaled-content scoring (entropy of translated pages,
AI-pattern detection in body), defer to `seo-content` via
- `claude-seo run content_quality.py`.
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run content_quality.py`.
- For "is this translated by Google's own auto-translate widget"
detection, look for the `.goog-te-banner-frame` iframe. There is **no
per-mechanism exemption**: in June 2025 Google removed the
diff --git a/skills/seo-images/SKILL.md b/skills/seo-images/SKILL.md
index e12651f..51fe21a 100644
--- a/skills/seo-images/SKILL.md
+++ b/skills/seo-images/SKILL.md
@@ -106,7 +106,7 @@ Third-party reporting and Wikipedia describe a Rust-based JPEG XL decoder as shi
#### Detected lazy-loader methods (`lazy_method` field)
-`claude-seo run parse_html.py` classifies each image's lazy-loading mechanism via the
+`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run parse_html.py` classifies each image's lazy-loading mechanism via the
`lazy_method` field on every image entry. Five values:
| `lazy_method` | Signal detected | Common stack |
@@ -321,13 +321,13 @@ https://support.google.com/merchants/answer/14743464
```bash
# Audit a directory for the IPTC label (counts: missing, ai, captured, etc.)
-claude-seo run iptc_ai_label.py audit ./images/ --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run iptc_ai_label.py audit ./images/ --json
# Audit a single image
-claude-seo run iptc_ai_label.py audit ./hero.webp --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run iptc_ai_label.py audit ./hero.webp --json
# Inject the AI label into an image
-claude-seo run iptc_ai_label.py inject ./ai-hero.webp \
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run iptc_ai_label.py inject ./ai-hero.webp \
--source-type trainedAlgorithmicMedia
# Other vocabulary values:
diff --git a/skills/seo-sitemap/SKILL.md b/skills/seo-sitemap/SKILL.md
index 79fe5cd..3b486f5 100644
--- a/skills/seo-sitemap/SKILL.md
+++ b/skills/seo-sitemap/SKILL.md
@@ -20,7 +20,7 @@ metadata:
Discover candidates before reporting a sitemap missing:
```bash
-claude-seo run sitemap_discovery.py <url> --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run sitemap_discovery.py <url> --json
```
The helper reads every bounded `Sitemap:` declaration in robots.txt, validates
diff --git a/skills/seo-sxo/SKILL.md b/skills/seo-sxo/SKILL.md
index 337a3ce..fbb0bf8 100644
--- a/skills/seo-sxo/SKILL.md
+++ b/skills/seo-sxo/SKILL.md
@@ -43,8 +43,8 @@ well-optimized it is.
### Step 1: Target Acquisition
-1. Fetch the target URL via `claude-seo run render_page.py <URL> --mode auto` (SPA-aware and SSRF-safe)
-2. Parse with `claude-seo run parse_html.py <URL>` to extract: title, H1, meta description,
+1. Fetch the target URL via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto` (SPA-aware and SSRF-safe)
+2. Parse with `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run parse_html.py <URL>` to extract: title, H1, meta description,
headings hierarchy, word count, schema markup, CTAs, media elements
3. If no keyword provided, extract primary keyword from title tag + H1 overlap
4. Validate keyword is non-empty before proceeding
@@ -244,7 +244,7 @@ The SXO score is **separate** from the main SEO Health Score.
## Quality Checklist
Before delivering results, verify:
-- [ ] Target URL was fetched via `claude-seo run render_page.py <URL> --mode auto` (not raw curl/fetch)
+- [ ] Target URL was fetched via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto` (not raw curl/fetch)
- [ ] Page type classification uses taxonomy from references
- [ ] At least 5 SERP results were analyzed
- [ ] User stories cite specific SERP signals as evidence
diff --git a/skills/seo-technical/SKILL.md b/skills/seo-technical/SKILL.md
index eb528d5..534bfe0 100644
--- a/skills/seo-technical/SKILL.md
+++ b/skills/seo-technical/SKILL.md
@@ -20,7 +20,7 @@ metadata:
### 1. Crawlability
- robots.txt: exists, valid, not blocking important resources
-- XML sitemap: run `claude-seo run sitemap_discovery.py <url> --json`; require a
+- XML sitemap: run `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run sitemap_discovery.py <url> --json`; require a
valid entry in `found`, and report stale or unsafe robots.txt declarations
separately from working fallback locations
- Noindex tags: intentional vs accidental
@@ -189,7 +189,7 @@ It is also available through Lighthouse CLI with
```bash
# Render with Playwright + capture accessibility tree, then score
-claude-seo run agent_ux_check.py https://example.com --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run agent_ux_check.py https://example.com --json
```
The scanner outputs an Agent-UX score (0-100) plus itemized issues:
@@ -201,7 +201,7 @@ The scanner outputs an Agent-UX score (0-100) plus itemized issues:
The accessibility-tree snapshot uses Chromium's
`Accessibility.getFullAXTree` CDP command through Playwright. To capture the
tree without scoring, use
-`claude-seo run render_page.py <url> --a11y-tree --json`.
+`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <url> --a11y-tree --json`.
Surface findings as **opportunities**, not failures; don't gate audits on a
sub-100 Agent-UX score. WebMCP origin-trial/sign-up status needs verification,
@@ -235,7 +235,7 @@ If DataForSEO MCP tools are available, use `on_page_instant_pages` for real page
## Google API Integration (Optional)
-If Google API credentials are configured, use `claude-seo run pagespeed_check.py <url> --json` for real PSI + CrUX field data (replaces lab-only CWV estimates), `claude-seo run crux_history.py <url> --json` for 25-week CWV trends, and `claude-seo run gsc_inspect.py <url> --json` for real indexation status per URL.
+If Google API credentials are configured, use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run pagespeed_check.py <url> --json` for real PSI + CrUX field data (replaces lab-only CWV estimates), `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run crux_history.py <url> --json` for 25-week CWV trends, and `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run gsc_inspect.py <url> --json` for real indexation status per URL.
## Error Handling
diff --git a/skills/seo-technical/references/agent-friendly-pages.md b/skills/seo-technical/references/agent-friendly-pages.md
index 1054928..1cd72e0 100644
--- a/skills/seo-technical/references/agent-friendly-pages.md
+++ b/skills/seo-technical/references/agent-friendly-pages.md
@@ -165,9 +165,9 @@ Chrome DevTools and look for:
- Any `<div>` with `onclick` and no `role` / `tabindex` → custom widget that
agents won't see.
-`claude-seo run render_page.py <URL> --mode auto --a11y-tree --json` loads the
+`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py <URL> --mode auto --a11y-tree --json` loads the
page headlessly and captures Chromium's full accessibility tree through CDP.
-Use `claude-seo run agent_ux_check.py <URL> --json` for the bounded Agent-UX
+Use `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run agent_ux_check.py <URL> --json` for the bounded Agent-UX
heuristic and its explicit complete, partial, or unavailable score status.
## Last verified
diff --git a/skills/seo/SKILL.md b/skills/seo/SKILL.md
index 92e22e9..2cd6be0 100644
--- a/skills/seo/SKILL.md
+++ b/skills/seo/SKILL.md
@@ -14,10 +14,15 @@ metadata:
**Invocation:** `/seo $1 $2` where `$1` is the command and `$2` is the URL or argument.
-**Runtime:** Run bundled Python tools through `claude-seo run <script.py>`. Plugin
-installs expose this command automatically. Repository users run
-`./bin/claude-seo`; manual installers rewrite the command to the isolated
-launcher path. Never invoke bundled scripts with a bare Python interpreter.
+**Runtime:** Run bundled Python tools through
+`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run <script.py>`. That is the single
+canonical form used by every skill and agent. Claude Code expands
+`${CLAUDE_PLUGIN_ROOT}` to the installed plugin directory, so the launcher is
+found without any `PATH` entry; the repository ships no top-level `bin/`
+directory because hosted marketplaces reject one. Repository users run
+`./scripts/claude-seo`; manual installers rewrite the canonical form to
+`"$HOME/.claude/skills/seo/scripts/claude-seo"`. Never invoke bundled scripts
+with a bare Python interpreter.
Comprehensive SEO analysis across all industries (SaaS, local services,
e-commerce, publishers, agencies). Orchestrates 24 sub-skills (21 core + 1 framework
@@ -61,25 +66,28 @@ extension is also installable (see "Optional Extensions" below).
## Runtime Setup
Run setup only when the user explicitly invokes `/seo setup` or explicitly asks
-to repair dependencies. Execute `claude-seo setup`, report core and Chromium
+to repair dependencies. Execute
+`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" setup`, report core and Chromium
status separately, and do not fall back to global or user package installation.
-For diagnosis, execute `claude-seo doctor --json`; its output intentionally omits
-absolute paths and environment values. If any `claude-seo run` command reports
-that setup is required, suggest `/seo setup` and do not improvise a `pip install`.
+For diagnosis, execute
+`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" doctor --json`; its output
+intentionally omits absolute paths and environment values. If any
+`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run` command reports that setup is
+required, suggest `/seo setup` and do not improvise a `pip install`.
## Orchestration Logic
When the user invokes `/seo audit`, delegate to subagents in parallel:
1. Detect business type (SaaS, local, ecommerce, publisher, agency, other)
2. Spawn subagents: seo-technical, seo-content, seo-schema, seo-sitemap, seo-performance, seo-visual, seo-geo
-3. If Google API credentials detected (`claude-seo run google_auth.py --check`), also spawn seo-google agent
+3. If Google API credentials detected (`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_auth.py --check`), also spawn seo-google agent
4. If local business detected, also spawn seo-local agent
5. If local business detected AND DataForSEO MCP available, also spawn seo-maps agent
-6. If backlink APIs detected (`claude-seo run backlinks_auth.py --check`), also spawn seo-backlinks agent
+6. If backlink APIs detected (`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run backlinks_auth.py --check`), also spawn seo-backlinks agent
7. If Firecrawl MCP available, use `firecrawl_map` to discover all site URLs before analysis
8. If content strategy signals detected (blog, pillar pages, topic clusters), also spawn seo-cluster agent
9. If e-commerce detected, also spawn seo-ecommerce agent
-10. If drift baseline exists for this URL (`claude-seo run drift_history.py <url>`), also spawn seo-drift agent
+10. If drift baseline exists for this URL (`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run 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. **Synthesize via the 10-principle framework** (see "Synthesis Methodology" below), walk PERCEIVE → ANALYZE → VALIDATE → ACT before bucketing findings into Critical / High / Medium / Low
@@ -87,7 +95,7 @@ When the user invokes `/seo audit`, delegate to subagents in parallel:
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 `claude-seo run google_report.py`.
+After any analysis command completes, offer to generate a PDF report via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_report.py`.
## Synthesis Methodology
diff --git a/skills/seo/references/free-backlink-sources.md b/skills/seo/references/free-backlink-sources.md
index fcf125c..6a179d7 100644
--- a/skills/seo/references/free-backlink-sources.md
+++ b/skills/seo/references/free-backlink-sources.md
@@ -53,7 +53,7 @@ a report (`status: FAIL`) that carries a number in either case. See the
- **Signup:** https://moz.com/products/api (credit card required, not charged)
- **Data:** Domain Authority (0-100), Page Authority, Spam Score (1-17%), link counts,
referring domains, anchor text distribution
-- **Command:** `claude-seo run moz_api.py`
+- **Command:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run moz_api.py`
- **Commands:** `metrics`, `domains`, `anchors`, `pages`
- **Blind spots:** No link velocity, no toxic link patterns beyond Spam Score,
3-day update lag, smaller index than Ahrefs/Semrush
@@ -66,7 +66,7 @@ a report (`status: FAIL`) that carries a number in either case. See the
are accessible to the same API account
- **Data:** Inbound-link source URL, target URL, anchor text, sampled link
counts, and referring-domain comparison totals
-- **Command:** `claude-seo run bing_webmaster.py`
+- **Command:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run bing_webmaster.py`
- **Commands:** `links`, `counts`, `compare` (comparison requires both
properties to be registered to the same API account)
- **Blind spots:** Only Bing-indexed pages (~15% of web), verified sites only,
@@ -77,7 +77,7 @@ a report (`status: FAIL`) that carries a number in either case. See the
- **Releases:** Quarterly (e.g., cc-main-2025-18)
- **No auth needed:** Public data, free to download
- **Data:** Domain-level in-degree, PageRank, harmonic centrality, referring domains
-- **Command:** `claude-seo run commoncrawl_graph.py`
+- **Command:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run commoncrawl_graph.py`
- **Cache:** `~/.cache/claude-seo/commoncrawl/` (90-day TTL)
- **Blind spots:** No anchor text, no page-level data, monthly/quarterly freshness,
domain-level only (e.g., "nytimes.com links to example.com" but not which page)
@@ -85,7 +85,7 @@ a report (`status: FAIL`) that carries a number in either case. See the
### Verification Crawler (Always Available)
- **No auth needed:** Uses existing fetch_page.py + parse_html.py
- **Data:** Binary verification (link exists/lost/moved), anchor text, rel attributes
-- **Command:** `claude-seo run verify_backlinks.py`
+- **Command:** `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run verify_backlinks.py`
- **Input:** JSON file with `[{"source_url": "..."}]` entries
- **Polite crawling:** 1-second delay between requests to same domain
- **Best for:** Checking if known backlinks still exist, monitoring link health
diff --git a/skills/seo/references/thinking-framework.md b/skills/seo/references/thinking-framework.md
index f56bf05..7a6de47 100644
--- a/skills/seo/references/thinking-framework.md
+++ b/skills/seo/references/thinking-framework.md
@@ -25,12 +25,12 @@ not a recommendation.
Collect signals without interpreting them. For a website audit this means:
-- Raw HTML + rendered HTML (via `claude-seo run render_page.py`)
+- Raw HTML + rendered HTML (via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run 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 `claude-seo run pagespeed_check.py`)
+- Core Web Vitals field data from CrUX (via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run pagespeed_check.py`)
- AI-search citation patterns (via `seo-geo`)
- Competitor pages on the target's primary keywords
@@ -185,7 +185,7 @@ Stop strategizing. Produce the artifact:
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 `claude-seo run google_report.py` when the user asks for one.
+- A PDF via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run google_report.py` when the user asks for one.
- The smallest implementation of the highest-leverage recommendation,
not the full plan.
diff --git a/tests/test_audit_instructions.py b/tests/test_audit_instructions.py
index b60fc4e..1022240 100644
--- a/tests/test_audit_instructions.py
+++ b/tests/test_audit_instructions.py
@@ -10,7 +10,7 @@ REPO_ROOT = Path(__file__).resolve().parents[1]
def test_seo_audit_starts_with_render_page_auto() -> None:
text = (REPO_ROOT / "skills" / "seo-audit" / "SKILL.md").read_text(encoding="utf-8")
process = text[text.index("## Process"):text.index("## Crawl Configuration")]
- assert "claude-seo run render_page.py" in process
+ assert '"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run render_page.py' in process
assert "python3 scripts/render_page.py" not in process
assert "--mode auto" in process
assert "scripts/fetch_page.py` to retrieve HTML" not in process
diff --git a/tests/test_banana_install_layout.py b/tests/test_banana_install_layout.py
index d7c6bfb..80f08ed 100644
--- a/tests/test_banana_install_layout.py
+++ b/tests/test_banana_install_layout.py
@@ -17,7 +17,9 @@ def _text(path: Path) -> str:
def _runtime_extension_scripts(text: str) -> set[str]:
return set(
- re.findall(r"claude-seo run --extension banana ([A-Za-z0-9_]+\.py)", text)
+ re.findall(
+ r"claude-seo[\"']? run --extension banana ([A-Za-z0-9_]+\.py)", text
+ )
)
@@ -49,7 +51,8 @@ def test_standalone_installer_copies_scripts_beside_skill_file():
installer = _text(EXTENSION / "install.sh")
assert 'mkdir -p "${SKILL_DIR}/scripts" "${SKILL_DIR}/references"' in installer
assert 'cp "${SOURCE_DIR}/scripts/"*.py "${SKILL_DIR}/scripts/"' in installer
- assert '"$HOME/.claude/skills/seo/bin/claude-seo" run' in installer
+ assert '"$HOME/.claude/skills/seo/scripts/claude-seo" run' in installer
+ assert '"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run' in installer
def test_top_level_installer_keeps_extension_scripts_under_core_extension_tree():
diff --git a/tests/test_hosted_plugin_layout.py b/tests/test_hosted_plugin_layout.py
new file mode 100644
index 0000000..11dfb7c
--- /dev/null
+++ b/tests/test_hosted_plugin_layout.py
@@ -0,0 +1,131 @@
+"""Layout contract for the claude.ai-hosted marketplace.
+
+Hosted marketplace sync rejects any plugin that ships a top-level ``bin/``
+directory (``marketplace_sync_bin_directory_not_allowed``). The launcher
+therefore lives in ``scripts/`` beside ``runtime.py``, and every skill, agent,
+and doc invokes it through the documented plugin-relative variable:
+
+ "${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run <script.py>
+
+Claude Code substitutes ``${CLAUDE_PLUGIN_ROOT}`` in skill body content and in
+``allowed-tools`` Bash rules, and exports it to hook processes. The quoting
+keeps the command correct when the plugin root contains spaces. Manual
+installers rewrite that exact token to the absolute installed path.
+"""
+
+from __future__ import annotations
+
+import re
+import subprocess
+import sys
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[1]
+LAUNCHER = ROOT / "scripts" / "claude-seo"
+CANONICAL = '"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo"'
+MANUAL = '"$HOME/.claude/skills/seo/scripts/claude-seo"'
+
+# A bare invocation is ``claude-seo run`` with nothing in front of it. The
+# repository-relative form ``./scripts/claude-seo run`` and the canonical form
+# (which puts a closing quote between the name and the subcommand) do not match.
+BARE_INVOCATION = re.compile(r"(?<![A-Za-z0-9_/])claude-seo (?:run|setup|doctor)\b")
+
+# CHANGELOG.md records the historical bare form in released entries and must
+# keep reading as written.
+DOC_EXCLUSIONS = {"CHANGELOG.md"}
+
+
+def _tracked() -> list[str]:
+ out = subprocess.run(
+ ["git", "-C", str(ROOT), "ls-files"],
+ capture_output=True,
+ text=True,
+ check=True,
+ ).stdout
+ return out.splitlines()
+
+
+def _instruction_docs() -> list[str]:
+ docs = []
+ for rel in _tracked():
+ if not rel.endswith(".md") or rel in DOC_EXCLUSIONS:
+ continue
+ if rel.startswith(("research/", ".github/", "tests/")):
+ continue
+ if rel.startswith(("skills/", "agents/", "docs/", "extensions/")) or "/" not in rel:
+ docs.append(rel)
+ return docs
+
+
+def test_no_top_level_bin_directory() -> None:
+ assert not (ROOT / "bin").exists(), (
+ "a top-level bin/ directory makes hosted marketplace sync fail with "
+ "marketplace_sync_bin_directory_not_allowed"
+ )
+ assert not any(rel == "bin" or rel.startswith("bin/") for rel in _tracked())
+
+
+def test_launcher_lives_in_scripts_and_is_executable() -> None:
+ assert LAUNCHER.is_file()
+ assert LAUNCHER.stat().st_mode & 0o111, "the launcher must stay executable"
+ text = LAUNCHER.read_text(encoding="utf-8")
+ assert 'runtime="${launcher_dir}/runtime.py"' in text, (
+ "the launcher must resolve runtime.py as a sibling"
+ )
+ assert "/../scripts/" not in text
+
+
+def test_no_instruction_file_keeps_a_bare_launcher_invocation() -> None:
+ offenders = []
+ for rel in _instruction_docs():
+ for match in BARE_INVOCATION.finditer((ROOT / rel).read_text(encoding="utf-8")):
+ offenders.append(f"{rel}: {match.group(0)}")
+ assert not offenders, "bare launcher invocations found: " + "; ".join(offenders)
+
+
+def test_instruction_files_use_the_canonical_plugin_root_form() -> None:
+ carriers = [
+ rel
+ for rel in _instruction_docs()
+ if CANONICAL in (ROOT / rel).read_text(encoding="utf-8")
+ ]
+ assert len(carriers) > 30, "the canonical launcher form should be used repo-wide"
+ assert "skills/seo/SKILL.md" in carriers
+ assert "agents/seo-technical.md" in carriers
+
+
+def test_installers_reference_the_scripts_launcher() -> None:
+ unix = (ROOT / "install.sh").read_text(encoding="utf-8")
+ assert 'cp "${TEMP_DIR}/claude-seo/scripts/claude-seo" "${SKILL_DIR}/scripts/claude-seo"' in unix
+ assert 'chmod +x "${SKILL_DIR}/scripts/claude-seo"' in unix
+ assert '"${SKILL_DIR}/scripts/claude-seo" setup' in unix
+ for subcommand in ("run", "setup", "doctor"):
+ assert f"s#{CANONICAL} {subcommand}#{MANUAL} {subcommand}#g" in unix
+ assert "bin/claude-seo" not in unix
+
+ windows = (ROOT / "install.ps1").read_text(encoding="utf-8")
+ assert "Join-Path $ScriptsPath 'claude-seo'" in windows
+ assert "Join-Path $SkillDir 'scripts'" in windows
+ for subcommand in ("run", "setup", "doctor"):
+ assert f"'{CANONICAL} {subcommand}'" in windows
+ assert f"'{MANUAL} {subcommand}'" in windows
+ assert "bin/claude-seo" not in windows
+
+
+def test_launcher_runs_without_network_or_managed_runtime() -> None:
+ """``doctor --help`` is handled by argparse before any venv is touched."""
+ if sys.platform == "win32":
+ import shutil
+
+ if shutil.which("bash") is None:
+ import pytest
+
+ pytest.skip("bash is unavailable on this runner")
+ result = subprocess.run(
+ ["bash", str(LAUNCHER), "doctor", "--help"],
+ capture_output=True,
+ text=True,
+ cwd=str(ROOT),
+ )
+ assert result.returncode == 0, result.stderr
+ assert "usage: claude-seo doctor" in result.stdout
diff --git a/tests/test_runtime_installers.py b/tests/test_runtime_installers.py
index 7ec2d13..6c5e2f3 100644
--- a/tests/test_runtime_installers.py
+++ b/tests/test_runtime_installers.py
@@ -10,12 +10,12 @@ ROOT = Path(__file__).resolve().parents[1]
def test_unix_installer_delegates_to_runtime_without_global_pip() -> None:
text = (ROOT / "install.sh").read_text(encoding="utf-8")
- assert '"${SKILL_DIR}/bin/claude-seo" setup' in text
+ assert '"${SKILL_DIR}/scripts/claude-seo" setup' in text
assert "pip install --user" not in text
assert "python3 -m venv" not in text
- assert "claude-seo run" in text
- assert "claude-seo setup" in text
- assert "claude-seo doctor" in text
+ assert '"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run' in text
+ assert '"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" setup' in text
+ assert '"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" doctor' in text
assert '"${runtime_status}" -ne 0 ] && [ "${runtime_status}" -ne 10' in text
assert 'find "${HOME}/.claude/skills"' not in text
@@ -36,11 +36,11 @@ def test_windows_installer_delegates_to_runtime_without_path_mutation() -> None:
os.name != "posix", reason="the executable bit is a POSIX mode bit; Windows has none"
)
def test_launcher_is_executable() -> None:
- assert (ROOT / "bin/claude-seo").stat().st_mode & 0o100
+ assert (ROOT / "scripts/claude-seo").stat().st_mode & 0o100
def test_launcher_uses_safe_exec() -> None:
- text = (ROOT / "bin/claude-seo").read_text(encoding="utf-8")
+ text = (ROOT / "scripts/claude-seo").read_text(encoding="utf-8")
assert 'exec py -3 "${runtime}" "$@"' in text
assert 'exec python3 "${runtime}" "$@"' in text
assert 'exec python "${runtime}" "$@"' in text