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(content-verify): detect a bare percentage statistic

Rudy Celeklibf6d9005207b
diff --git a/scripts/content_verify.py b/scripts/content_verify.py
index a34c205..273471b 100644
--- a/scripts/content_verify.py
+++ b/scripts/content_verify.py
@@ -64,7 +64,7 @@ _CLAIM_PATTERNS: tuple[tuple[re.Pattern, str], ...] = (
(re.compile(r"\b\d+(?:\.\d+)?\s*%\s+of\s+[a-zA-Z]+(?:\s+[a-zA-Z]+){0,4}",
re.IGNORECASE),
"statistic"),
- (re.compile(r"\b\d+(?:\.\d+)?\s*%\b"), "statistic"),
+ (re.compile(r"\b\d+(?:\.\d+)?\s*%"), "statistic"),
(re.compile(r"\$\s?\d+(?:\.\d+)?\s*(?:million|billion|trillion|k|M|B)\b",
re.IGNORECASE), "quantity"),
(re.compile(r"\b\d{1,3}(?:,\d{3})+(?:\.\d+)?\s+\w+", re.IGNORECASE),
diff --git a/tests/test_content_quality.py b/tests/test_content_quality.py
index b6e7b63..3a87b5f 100644
--- a/tests/test_content_quality.py
+++ b/tests/test_content_quality.py
@@ -312,6 +312,25 @@ def test_verify_empty_text_returns_zero_claims() -> None:
assert result["uncited_ratio"] == 0.0
+def test_verify_detects_a_bare_percentage_statistic() -> None:
+ # A bare percentage not followed by "of ..." is the canonical unsourced
+ # statistic this tool exists to flag. A trailing \b after "%" in the
+ # pattern could never match (a percentage is followed by a space or
+ # punctuation, both non-word), so these claims were silently missed.
+ for text in ("The bounce rate hit 85%.", "Conversions rose by 30% overall.",
+ "Prices rose 3.5% this quarter."):
+ result = content_verify.verify(text)
+ assert result["claim_count"] == 1, text
+ assert result["claims"][0]["kind"] == "statistic", text
+
+
+def test_verify_bare_percentage_does_not_double_count_percent_of() -> None:
+ # "47% of marketers" must still be one claim, not two (the longer
+ # "% of ..." match wins over the bare-"%" match on the same span).
+ result = content_verify.verify("47% of marketers report gains.")
+ assert result["claim_count"] == 1
+
+
# ---------------------------------------------------------------------------
# seo_updates
# ---------------------------------------------------------------------------