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(matomo): meet the repository bar for docs, routing, and the agent contract

Agrici Daniel5ec056a640b2
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index a7d5a69..46465df 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -5,7 +5,7 @@
"name": "AgriciDaniel"
},
"metadata": {
- "description": "Comprehensive SEO analysis plugin for Claude Code. 25 sub-skills and 18 sub-agents, plus 8 optional MCP extensions (DataForSEO, Firecrawl, Banana, Ahrefs, SE Ranking, Profound, Bing Webmaster, Unlighthouse). v2.3.0 adds a local-target allowlist and proxy validation to the SSRF guard, refreshes Google guidance through September 2026, hardens the JSON-LD hook, fixes AI crawler guidance, and raises audit agent turn budgets."
+ "description": "Comprehensive SEO analysis plugin for Claude Code. 25 sub-skills and 18 sub-agents, plus 9 optional MCP extensions (DataForSEO, Firecrawl, Banana, Ahrefs, SE Ranking, Profound, Bing Webmaster, Matomo, Unlighthouse). v2.3.0 adds a local-target allowlist and proxy validation to the SSRF guard, refreshes Google guidance through September 2026, hardens the JSON-LD hook, fixes AI crawler guidance, and raises audit agent turn budgets."
},
"plugins": [
{
diff --git a/AGENTS.md b/AGENTS.md
index 09c1634..e0e3bd9 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -166,7 +166,7 @@ skills/ # 25 sub-skills (auto-discovered)
seo-dataforseo/ # DataForSEO (extension)
seo-image-gen/ # AI images (extension)
agents/ # 18 subagents
-scripts/ # 54 Python scripts, including the managed runtime
+scripts/ # 56 Python scripts, including the managed runtime
schema/ # JSON-LD templates
extensions/ # 9 MCP extensions: DataForSEO, Firecrawl, Banana, Ahrefs, SE Ranking, Profound, Bing Webmaster, Matomo, Unlighthouse
```
diff --git a/README.md b/README.md
index 6d4aa57..6e1d28b 100644
--- a/README.md
+++ b/README.md
@@ -143,7 +143,7 @@ claude
![Claude SEO sub-skill ecosystem: 25 modules grouped into 8 categories (audit, content, schema, technical, AI search, local + maps, commerce + intl, extensions) around the central orchestrator](assets/sub-skills.svg)
-32 user-invocable `/seo` commands across the orchestrator, its sub-skills, and 9 MCP extensions. Full reference in [docs/COMMANDS.md](docs/COMMANDS.md).
+33 user-invocable `/seo` commands across the orchestrator, its sub-skills, and 9 MCP extensions. Full reference in [docs/COMMANDS.md](docs/COMMANDS.md).
| Command | Description |
|---------|-------------|
diff --git a/extensions/matomo/agents/seo-matomo.md b/extensions/matomo/agents/seo-matomo.md
index 35e0678..7a5d160 100644
--- a/extensions/matomo/agents/seo-matomo.md
+++ b/extensions/matomo/agents/seo-matomo.md
@@ -2,14 +2,14 @@
name: seo-matomo
description: Matomo Reporting API analyst. Fetches organic traffic, top landing pages, device / country breakdowns, and referrer analysis from a self-hosted or Matomo Cloud instance. Pairs with seo-google for users who want GA4 alternative or supplement.
model: sonnet
-maxTurns: 15
+maxTurns: 35
tools: Read, Bash, Write, Glob, Grep
---
You are a Matomo analytics data analyst. When delegated tasks during an SEO audit:
-1. Check credentials: `claude-seo run matomo_auth.py --check --json`
-2. Confirm the configured site ID: `claude-seo run matomo_report.py check --json`
+1. Check credentials: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_auth.py --check --json`
+2. Confirm the configured site ID: `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py check --json`
3. Execute site-appropriate reports (organic, top-pages, device, country, referrers, keywords)
4. Format output to match claude-seo conventions
5. Offer to write the structured `findings/matomo.md` file when an `output_dir` is provided
@@ -27,12 +27,12 @@ You are a Matomo analytics data analyst. When delegated tasks during an SEO audi
| Command | What it returns |
|---|---|
-| `claude-seo run matomo_report.py organic --json` | Per-day organic visits + top landing pages |
-| `claude-seo run matomo_report.py top-pages --json` | Top organic landing pages only |
-| `claude-seo run matomo_report.py device --json` | Desktop / Smartphone / Tablet split |
-| `claude-seo run matomo_report.py country --json` | Country breakdown (ISO-3166-1 alpha-2) |
-| `claude-seo run matomo_report.py referrers --json` | Channel breakdown (direct / search / website / social / campaign) + search-engine split |
-| `claude-seo run matomo_report.py keywords --json` | Organic search keywords (often "(not provided)") |
+| `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py organic --json` | Per-day organic visits + top landing pages |
+| `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py top-pages --json` | Top organic landing pages only |
+| `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py device --json` | Desktop / Smartphone / Tablet split |
+| `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py country --json` | Country breakdown (ISO-3166-1 alpha-2) |
+| `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py referrers --json` | Channel breakdown (direct / search / website / social / campaign) + search-engine split |
+| `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py keywords --json` | Organic search keywords (often "(not provided)") |
All commands accept `--site-id`, `--days` (default 28), `--limit` (default 50).
@@ -60,7 +60,9 @@ Match existing claude-seo patterns:
## Audit Persistence
-If `output_dir` is provided by the audit orchestrator, write:
+If `output_dir` is provided by the audit orchestrator, write a partial findings
+file after the first analysis pass and overwrite it with the complete findings
+before finishing, so a turn-budget stop never loses completed work:
- `output_dir/findings/matomo.md`: organic trend, top landing pages,
device / country split, referrer split, search-engine split, organic
keywords with anonymized share noted
diff --git a/extensions/matomo/docs/MATOMO-SETUP.md b/extensions/matomo/docs/MATOMO-SETUP.md
index cddcf23..eee4257 100644
--- a/extensions/matomo/docs/MATOMO-SETUP.md
+++ b/extensions/matomo/docs/MATOMO-SETUP.md
@@ -4,8 +4,8 @@
1. **Matomo Reporting API** for organic traffic, landing pages, devices,
countries, referrers, and search keywords via
- `claude-seo run matomo_report.py`.
-2. **Live credential probe** via `claude-seo run matomo_auth.py --check`
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py`.
+2. **Live credential probe** via `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_auth.py --check`
used by the `/seo matomo` skill and by the audit orchestrator to
decide whether to spawn the `seo-matomo` agent.
3. A unified `seo-matomo` skill that routes the right command at the
@@ -55,9 +55,9 @@ will fail with `SSLError` on untrusted certificates.
## Verify
```bash
-claude-seo run matomo_auth.py --check
-claude-seo run matomo_report.py check --json
-claude-seo run matomo_report.py organic --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_auth.py --check
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py check --json
+"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py organic --json
```
`--check` runs `API.getMatomoVersion` against your instance and reports
diff --git a/extensions/matomo/install.sh b/extensions/matomo/install.sh
index 6ac924d..b811179 100755
--- a/extensions/matomo/install.sh
+++ b/extensions/matomo/install.sh
@@ -63,8 +63,8 @@ PY
echo
echo "Done. Verify with:"
- echo " claude-seo run matomo_auth.py --check"
- echo " claude-seo run matomo_report.py check --json"
+ echo " \"\${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo\" run matomo_auth.py --check"
+ echo " \"\${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo\" run matomo_report.py check --json"
echo "Full docs: extensions/matomo/docs/MATOMO-SETUP.md"
}
main "$@"
\ No newline at end of file
diff --git a/extensions/matomo/skills/seo-matomo/SKILL.md b/extensions/matomo/skills/seo-matomo/SKILL.md
index c62c4e1..d935998 100644
--- a/extensions/matomo/skills/seo-matomo/SKILL.md
+++ b/extensions/matomo/skills/seo-matomo/SKILL.md
@@ -2,7 +2,7 @@
name: seo-matomo
description: Matomo Reporting API extension. Self-hosted or Matomo Cloud analytics as a GA4 alternative or complement. Organic traffic, landing pages, device / country breakdowns, referrers, search keywords. Triggers on "Matomo", "self-hosted analytics", "analytics ohne Google", "GA4 alternative", "Matomo Reporting", "Piwik".
metadata:
- version: "2.2.5"
+ version: "2.3.0"
compatibility: "Requires MATOMO_URL, MATOMO_API_TOKEN, and (optionally) MATOMO_SITE_ID in ~/.claude/settings.json env. Run extensions/matomo/install.sh to configure."
---
@@ -24,13 +24,13 @@ against Matomo Cloud and self-hosted instances.
| Command | Underlying script |
|---|---|
-| `/seo matomo check` | `claude-seo run matomo_auth.py --check` |
-| `/seo matomo organic [site-id]` | `claude-seo run matomo_report.py organic --site-id <id>` |
-| `/seo matomo top-pages` | `claude-seo run matomo_report.py top-pages` |
-| `/seo matomo device` | `claude-seo run matomo_report.py device` |
-| `/seo matomo country` | `claude-seo run matomo_report.py country` |
-| `/seo matomo referrers` | `claude-seo run matomo_report.py referrers` |
-| `/seo matomo keywords` | `claude-seo run matomo_report.py keywords` |
+| `/seo matomo check` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_auth.py --check` |
+| `/seo matomo organic [site-id]` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py organic --site-id <id>` |
+| `/seo matomo top-pages` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py top-pages` |
+| `/seo matomo device` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py device` |
+| `/seo matomo country` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py country` |
+| `/seo matomo referrers` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py referrers` |
+| `/seo matomo keywords` | `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_report.py keywords` |
All commands accept `--days` (default 28), `--limit`, `--site-id`, and
`--json`. The site ID falls back to `MATOMO_SITE_ID` from settings.
@@ -55,7 +55,7 @@ All commands accept `--days` (default 28), `--limit`, `--site-id`, and
- For AI Overview / GEO citability work, route to `seo-geo`. Matomo
offers no LLM-specific signals.
- During `/seo audit`, the orchestrator spawns the `seo-matomo` agent
- (analogous to `seo-google`) whenever `claude-seo run matomo_auth.py
+ (analogous to `seo-google`) whenever `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_auth.py
--check` succeeds. Both agents can be active simultaneously when the
user has both GA4 and Matomo configured.
@@ -63,7 +63,7 @@ All commands accept `--days` (default 28), `--limit`, `--site-id`, and
- Missing credentials: report which env vars / config keys are unset and
remind the user to run `extensions/matomo/install.sh` or
- `python scripts/matomo_auth.py --setup`.
+ `"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_auth.py --setup`.
- HTTP 401/403 from Matomo: the token lacks view access for the given
site. Verify the token scope in Matomo Administration -> Personal ->
Security -> API Tokens. The skill never logs the token.
diff --git a/scripts/consistency_check.py b/scripts/consistency_check.py
index a46d63b..688a398 100644
--- a/scripts/consistency_check.py
+++ b/scripts/consistency_check.py
@@ -14,7 +14,8 @@ reference-graph checks that no other tool covers:
``scripts/presets.py`` invocations before the 2026-07 full review).
4. Routing tables in ``skills/seo/SKILL.md`` and ``docs/COMMANDS.md`` agree with each
other and with the skill directories on disk.
-5. ``agents/<name>.md`` path mentions exist (``seo-newagent`` doc example whitelisted).
+5. ``agents/<name>.md`` path mentions exist in ``agents/`` or in any
+ ``extensions/<ext>/agents/`` tree (``seo-newagent`` doc example whitelisted).
6. ``skills/seo-flow/references/flow-prompts.lock`` SHA-256 integrity.
7. Orphan-file candidates (tracked files whose basename is mentioned nowhere else);
reported as warnings, never errors.
@@ -221,15 +222,28 @@ def check_routing(files):
def check_agent_refs(files, texts):
+ """``agents/<name>.md`` mentions must resolve to a real agent file.
+
+ Path-aware, like the script-reference check: an agent resolves against the
+ repo-root ``agents/`` tree, and additionally against any extension's own
+ ``extensions/<ext>/agents/`` tree. Extension-supplied agents
+ (``seo-matomo``) ship only inside their extension and are copied into
+ ``~/.claude/agents/`` at install time, so a mention of them is live, not
+ dead. Extensions whose agent is mirrored into the core tree
+ (``seo-dataforseo``, ``seo-image-gen``) resolve either way.
+ """
agents = {os.path.basename(f)[:-3] for f in files
if f.startswith("agents/") and f.endswith(".md")}
+ ext_agents = {os.path.basename(f)[:-3] for f in files
+ if re.match(r'extensions/[^/]+/agents/[a-z0-9-]+\.md$', f)}
+ known = agents | ext_agents
pat = re.compile(r'agents/([a-z0-9-]+)\.md')
errors = []
for f in texts:
- if f.startswith("agents/"):
+ if f.startswith("agents/") or f in SELF_DOC:
continue
for m in sorted(set(pat.findall(read(f)))):
- if m not in agents and m not in DOC_EXAMPLE_AGENTS:
+ if m not in known and m not in DOC_EXAMPLE_AGENTS:
errors.append(f"{f}: dead agent ref agents/{m}.md")
return errors
diff --git a/scripts/matomo_auth.py b/scripts/matomo_auth.py
index cbef6c6..8c782ea 100644
--- a/scripts/matomo_auth.py
+++ b/scripts/matomo_auth.py
@@ -320,8 +320,8 @@ TIER 1: MATOMO REPORTING API (one token, your own instance)
Matomo instances frequently live outside the public internet.
VERIFY CONFIGURATION:
- python scripts/matomo_auth.py --check
- python scripts/matomo_auth.py --tier
+ "${{CLAUDE_PLUGIN_ROOT}}/scripts/claude-seo" run matomo_auth.py --check
+ "${{CLAUDE_PLUGIN_ROOT}}/scripts/claude-seo" run matomo_auth.py --tier
""")
@@ -398,4 +398,4 @@ def main() -> int:
if __name__ == "__main__":
- sys.exit(main())
\ No newline at end of file
+ sys.exit(main())
diff --git a/scripts/matomo_report.py b/scripts/matomo_report.py
index 6e2ea9f..40f7a76 100644
--- a/scripts/matomo_report.py
+++ b/scripts/matomo_report.py
@@ -702,4 +702,4 @@ def _print_human(result: dict, command: str) -> None:
if __name__ == "__main__":
- sys.exit(main())
\ No newline at end of file
+ sys.exit(main())
diff --git a/skills/seo-audit/SKILL.md b/skills/seo-audit/SKILL.md
index 7e5bb54..c73eae8 100644
--- a/skills/seo-audit/SKILL.md
+++ b/skills/seo-audit/SKILL.md
@@ -175,7 +175,7 @@ If Google API credentials are configured (`"${CLAUDE_PLUGIN_ROOT}/scripts/claude
## Matomo Integration (Optional)
-If Matomo credentials are configured (`claude-seo run matomo_auth.py --check`), spawn the `seo-matomo` agent to enrich the audit with self-hosted analytics: organic visits trend, top landing pages, device and country breakdowns, channel / search-engine split, and organic keywords. Works as a GA4 alternative (when only Matomo is configured) or as a complement (when both GA4 and Matomo are present). Matomo numbers will not match GA4 exactly because of segmentation differences (`referrerType==search` vs `sessionDefaultChannelGroup == "Organic Search"`) and attribution-window rules.
+If Matomo credentials are configured (`"${CLAUDE_PLUGIN_ROOT}/scripts/claude-seo" run matomo_auth.py --check`), spawn the `seo-matomo` agent to enrich the audit with self-hosted analytics: organic visits trend, top landing pages, device and country breakdowns, channel / search-engine split, and organic keywords. Works as a GA4 alternative (when only Matomo is configured) or as a complement (when both GA4 and Matomo are present). Matomo numbers will not match GA4 exactly because of segmentation differences (`referrerType==search` vs `sessionDefaultChannelGroup == "Organic Search"`) and attribution-window rules.
## Error Handling
diff --git a/tests/test_audit_agent_turn_budget.py b/tests/test_audit_agent_turn_budget.py
index 96ca4b7..532fc65 100644
--- a/tests/test_audit_agent_turn_budget.py
+++ b/tests/test_audit_agent_turn_budget.py
@@ -20,6 +20,7 @@ from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
AUDIT_SKILL = ROOT / "skills" / "seo-audit" / "SKILL.md"
AGENTS_DIR = ROOT / "agents"
+EXTENSION_AGENTS_GLOB = "extensions/*/agents"
EARLY_WRITE_SENTENCE = (
"write a partial findings\nfile after the first analysis pass and overwrite it with the complete findings\nbefore finishing, so a turn-budget stop never loses completed work"
@@ -34,6 +35,21 @@ def _discover_audit_agents() -> set[str]:
return set(re.findall(r"`(seo-[a-z-]+)`", text))
+def _agent_path(name: str) -> Path:
+ """Resolve an audit subagent to its file, core tree first, then extensions.
+
+ Extension-supplied agents (``seo-matomo``) ship under
+ ``extensions/<name>/agents/`` and are installed into ``~/.claude/agents/``
+ by the extension installer, so they carry the same turn-budget and
+ early-write obligations as the core agents the orchestrator spawns.
+ """
+ core = AGENTS_DIR / f"{name}.md"
+ if core.is_file():
+ return core
+ matches = sorted(ROOT.glob(f"{EXTENSION_AGENTS_GLOB}/{name}.md"))
+ return matches[0] if matches else core
+
+
def test_audit_skill_still_names_the_known_subagent_set():
# Locks the known set so a future addition/removal to seo-audit's
# delegation list is a deliberate, reviewed change.
@@ -41,7 +57,7 @@ def test_audit_skill_still_names_the_known_subagent_set():
"seo-technical", "seo-content", "seo-schema", "seo-sitemap",
"seo-performance", "seo-visual", "seo-geo", "seo-local", "seo-maps",
"seo-google", "seo-backlinks", "seo-cluster", "seo-sxo", "seo-drift",
- "seo-ecommerce", "seo-dataforseo",
+ "seo-ecommerce", "seo-dataforseo", "seo-matomo",
}
@@ -55,7 +71,7 @@ def test_every_audit_agent_has_a_turn_budget_at_least_30():
assert agents, "expected at least one audit subagent"
failures = []
for name in sorted(agents):
- path = AGENTS_DIR / f"{name}.md"
+ path = _agent_path(name)
assert path.is_file(), f"missing agent file for {name}"
turns = _max_turns(path.read_text(encoding="utf-8"))
if turns is None or turns < MIN_MAX_TURNS:
@@ -75,7 +91,7 @@ def test_named_reporters_agents_have_at_least_40_turns():
def test_every_audit_agent_has_the_early_write_instruction():
missing = []
for name in sorted(_discover_audit_agents()):
- text = (AGENTS_DIR / f"{name}.md").read_text(encoding="utf-8")
+ text = _agent_path(name).read_text(encoding="utf-8")
if EARLY_WRITE_SENTENCE not in text:
missing.append(name)
assert not missing, f"agents missing the early-write instruction: {missing}"
diff --git a/tests/test_consistency_check.py b/tests/test_consistency_check.py
index bdb4c51..eb5097c 100644
--- a/tests/test_consistency_check.py
+++ b/tests/test_consistency_check.py
@@ -87,3 +87,31 @@ def test_flow_lock_still_detects_content_change(tmp_path, monkeypatch):
assert consistency_check.check_flow_lock(locked) == [
f"flow lock: hash mismatch {locked[0]}"
]
+
+
+def test_agent_refs_resolve_inside_an_extension_tree():
+ """An extension-supplied agent is a live reference, not a dead one.
+
+ ``seo-matomo`` ships only at ``extensions/matomo/agents/seo-matomo.md``
+ (no core mirror, unlike ``seo-dataforseo``). Its installer copies it into
+ ``~/.claude/agents/``, so the installers' ``agents/seo-matomo.md``
+ mentions must resolve. Before this rule was path-aware, all three Matomo
+ installer scripts were reported as dead agent refs.
+ """
+ files = ["agents/seo-technical.md", "extensions/matomo/agents/seo-matomo.md"]
+ texts = ["extensions/matomo/install.sh"]
+ assert consistency_check.check_agent_refs(files, texts) == []
+
+
+def test_agent_refs_still_catch_a_genuinely_missing_agent():
+ files = ["agents/seo-technical.md", "extensions/matomo/agents/seo-matomo.md"]
+ errors = consistency_check.check_agent_refs(files, ["extensions/matomo/uninstall.sh"])
+ assert errors == []
+ # A name that exists in neither tree is still an error.
+ original = consistency_check.read
+ try:
+ consistency_check.read = lambda rel, **kw: "see agents/seo-nonexistent.md"
+ errors = consistency_check.check_agent_refs(files, ["docs/COMMANDS.md"])
+ finally:
+ consistency_check.read = original
+ assert errors == ["docs/COMMANDS.md: dead agent ref agents/seo-nonexistent.md"]
diff --git a/tests/test_matomo_report.py b/tests/test_matomo_report.py
index 2769a18..ec0849b 100644
--- a/tests/test_matomo_report.py
+++ b/tests/test_matomo_report.py
@@ -13,7 +13,6 @@ Covers:
from __future__ import annotations
import json
-import os
import sys
from pathlib import Path
from unittest.mock import Mock, patch
@@ -26,7 +25,6 @@ sys.path.insert(0, str(ROOT / "scripts"))
import matomo_auth # noqa: E402
import matomo_report # noqa: E402
-
SECRET_TOKEN = "abcdef0123456789abcdef0123456789"
@@ -498,4 +496,4 @@ def test_main_missing_site_id_exits_one(monkeypatch, capsys):
rc = matomo_report.main()
assert rc == 1
captured = capsys.readouterr()
- assert "--site-id" in captured.err or "MATOMO_SITE_ID" in captured.err
\ No newline at end of file
+ assert "--site-id" in captured.err or "MATOMO_SITE_ID" in captured.err