Skip to content

Commit 7db6bac

Browse files
AgriciDanielclaude
andcommitted
feat: v1.7.0 - Google SEO APIs, PDF reports, security hardening
Add complete Google SEO APIs skill with 11 Python scripts, 10 reference files, and seo-google subagent. Enterprise PDF report generator with WeasyPrint + matplotlib charts. 4-tier credential system (API key, OAuth, GA4, Ads). SSRF protection via validate_url() in all API scripts. .gitignore hardened for credential files. OAuth tokens no longer store client_secret. README and CLAUDE.md updated with report rules, color palette, and cross-skill enforcement. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent aacac6c commit 7db6bac

53 files changed

Lines changed: 8379 additions & 43 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"homepage": "https://github.com/AgriciDaniel/claude-seo",
1717
"repository": "https://github.com/AgriciDaniel/claude-seo",
1818
"license": "MIT",
19-
"keywords": ["seo", "technical-seo", "e-e-a-t", "schema-markup", "local-seo", "geo", "ai-search"],
19+
"keywords": ["seo", "technical-seo", "e-e-a-t", "schema-markup", "local-seo", "geo", "ai-search", "google-api", "search-console", "pagespeed", "crux"],
2020
"category": "seo",
21-
"tags": ["seo", "audit", "technical", "content", "schema", "local", "geo"]
21+
"tags": ["seo", "audit", "technical", "content", "schema", "local", "geo", "google-api"]
2222
}
2323
]
2424
}

.claude-plugin/plugin.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "claude-seo",
3-
"version": "1.6.1",
3+
"version": "1.7.0",
44
"description": "Comprehensive SEO analysis skill for Claude Code. Covers technical SEO, content quality (E-E-A-T), schema markup, image optimization, sitemap architecture, AI search optimization (GEO), local SEO (GBP, citations, reviews, map pack), maps intelligence, and strategic planning across all industries.",
55
"author": {
66
"name": "AgriciDaniel",
@@ -21,6 +21,10 @@
2121
"ai-search",
2222
"sitemap",
2323
"image-optimization",
24-
"hreflang"
24+
"hreflang",
25+
"google-search-console",
26+
"pagespeed",
27+
"crux",
28+
"ga4"
2529
]
2630
}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ venv/
3131
env/
3232
.env/
3333

34+
# Secrets and credentials (NEVER commit these)
35+
.env
36+
.env.*
37+
*.env
38+
**/.env
39+
**/client_secret*.json
40+
**/service_account*.json
41+
**/oauth-token.json
42+
**/.google-token.json
43+
3444
# Node (if any)
3545
node_modules/
3646

@@ -86,6 +96,10 @@ seo audit demo.gif
8696
seo command demo.gif
8797
.github-audit/
8898

99+
# Generated Google SEO reports
100+
Google-SEO-Report-*.html
101+
Google-SEO-Report-*.pdf
102+
89103
# Site-specific analysis outputs
90104
LOCAL-SEO-ANALYSIS-*.md
91105
LOCAL-SEO-ANALYSIS-*.html

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.7.0] - 2026-03-28
9+
10+
### Added
11+
- **Google SEO APIs skill**: `skills/seo-google/SKILL.md` with 21 commands across 4 credential tiers
12+
- **Google subagent**: `agents/seo-google.md` for enriched audit data (CWV field data, indexation status, organic traffic)
13+
- **11 Python scripts**: google_auth.py, gsc_query.py, gsc_inspect.py, pagespeed_check.py, crux_history.py, indexing_notify.py, ga4_report.py, google_report.py, youtube_search.py, nlp_analyze.py, keyword_planner.py
14+
- **10 reference files**: auth-setup.md, search-console-api.md, pagespeed-crux-api.md, indexing-api.md, ga4-data-api.md, youtube-api.md, nlp-api.md, keyword-planner-api.md, supplementary-apis.md, rate-limits-quotas.md
15+
- **PDF report generator**: `scripts/google_report.py` with enterprise A4 template, WeasyPrint + matplotlib charts, post-generation quality review
16+
- **OAuth web credential flow**: Browser-based auth with localhost:8085 callback, token refresh, manual code exchange fallback
17+
- **4-tier credential system**: Tier 0 (API key: PSI/CrUX), Tier 1 (+OAuth/SA: GSC/Indexing), Tier 2 (+GA4), Tier 3 (+Ads Keyword Planner)
18+
- **Python dependencies**: google-api-python-client, google-auth, google-auth-oauthlib, google-auth-httplib2, google-analytics-data, matplotlib, weasyprint
19+
20+
### Security
21+
- SSRF protection: `validate_url()` blocks private IPs, loopback, and GCP metadata endpoints in all Google API scripts
22+
- `.gitignore` hardened with 8 credential patterns: `.env`, `client_secret*.json`, `oauth-token.json`, `service_account*.json`
23+
- OAuth tokens no longer store `client_secret` (reads from client_secret.json file only)
24+
- Removed hardcoded user paths from all scripts (mobile_analysis.py, capture scripts)
25+
26+
### Changed
27+
- Sub-skill count: 14 -> 15 core (+ 2 extensions)
28+
- Subagent count: 9 -> 10 core (+ 2 extension) with conditional Google API spawning
29+
- seo-audit spawns seo-google agent when Google API credentials detected
30+
- seo-technical and seo-performance can use CrUX field data when available
31+
- Report Generation Rules added to CLAUDE.md with color palette, dependency, and cross-skill enforcement
32+
- README updated with Google APIs, local SEO, maps, and PDF report features
33+
34+
---
35+
836
## [1.6.1] - 2026-03-27
937

1038
### Added

CLAUDE.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
This repository contains **Claude SEO**, a Tier 4 Claude Code skill for comprehensive
66
SEO analysis across all industries. It follows the Agent Skills open standard and the
7-
3-layer architecture (directive, orchestration, execution). 14 core sub-skills (+ 2
8-
extensions), 9 core subagents (+ 2 extension agents), and an extensible reference
7+
3-layer architecture (directive, orchestration, execution). 15 core sub-skills (+ 2
8+
extensions), 10 core subagents (+ 2 extension agents), and an extensible reference
99
system cover technical SEO, content quality,
1010
schema markup, image optimization, sitemap architecture, AI search optimization,
1111
local SEO (GBP, citations, reviews, map pack), and maps intelligence (geo-grid
@@ -17,7 +17,7 @@ rank tracking, GBP auditing, review intelligence, competitor radius mapping).
1717
claude-seo/
1818
CLAUDE.md # Project instructions (this file)
1919
.claude-plugin/
20-
plugin.json # Plugin manifest (v1.6.1)
20+
plugin.json # Plugin manifest (v1.7.0)
2121
marketplace.json # Marketplace catalog for distribution
2222
skills/ # 17 skills (auto-discovered)
2323
seo/ # Main orchestrator skill
@@ -37,11 +37,14 @@ claude-seo/
3737
seo-programmatic/SKILL.md # Programmatic SEO at scale
3838
seo-competitor-pages/SKILL.md # Competitor comparison pages
3939
seo-hreflang/SKILL.md # International SEO / hreflang
40+
seo-google/ # Google SEO APIs
41+
SKILL.md
42+
references/ # API reference files (7 files)
4043
seo-dataforseo/SKILL.md # Live SEO data via DataForSEO MCP
4144
seo-image-gen/ # AI image generation for SEO assets
4245
SKILL.md
4346
references/ # Image gen reference files (7 files)
44-
agents/ # 11 subagents (auto-discovered)
47+
agents/ # 12 subagents (auto-discovered)
4548
seo-technical.md # Crawlability, indexability, security
4649
seo-content.md # E-E-A-T, readability, thin content
4750
seo-schema.md # Structured data validation
@@ -51,6 +54,7 @@ claude-seo/
5154
seo-geo.md # AI crawler access, GEO, citability
5255
seo-local.md # GBP, NAP, citations, reviews, local schema
5356
seo-maps.md # Geo-grid, GBP audit, reviews, competitor radius
57+
seo-google.md # Google API analyst (CrUX, GSC, GA4)
5458
seo-dataforseo.md # DataForSEO data analyst
5559
seo-image-gen.md # SEO image audit analyst
5660
hooks/ # Quality gate hooks
@@ -67,7 +71,7 @@ claude-seo/
6771

6872
| Command | Purpose |
6973
|---------|---------|
70-
| `/seo audit <url>` | Full site audit with 9 parallel subagents |
74+
| `/seo audit <url>` | Full site audit with 10 parallel subagents |
7175
| `/seo page <url>` | Deep single-page analysis |
7276
| `/seo technical <url>` | Technical SEO audit (9 categories) |
7377
| `/seo content <url>` | E-E-A-T and content quality analysis |
@@ -81,6 +85,7 @@ claude-seo/
8185
| `/seo local <url>` | Local SEO analysis (GBP, citations, reviews, map pack) |
8286
| `/seo maps [command] [args]` | Maps intelligence (geo-grid, GBP audit, reviews, competitors) |
8387
| `/seo hreflang <url>` | International SEO / hreflang audit |
88+
| `/seo google [command] [url]` | Google SEO APIs (GSC, PageSpeed, CrUX, Indexing, GA4) |
8489
| `/seo image-gen [use-case] <desc>` | AI image generation for SEO assets (extension) |
8590

8691
## Development Rules
@@ -93,6 +98,21 @@ claude-seo/
9398
- Python dependencies install into `~/.claude/skills/seo/.venv/`
9499
- Test with `python -m pytest tests/` after changes (if applicable)
95100

101+
## Report Generation Rules
102+
103+
- **All SEO reports must use `scripts/google_report.py`** as the canonical report generator
104+
- **Dependencies**: `matplotlib>=3.8.0` (charts) + `weasyprint>=61.0` (HTML-to-PDF), both in `requirements.txt`
105+
- **Format**: A4 PDF via WeasyPrint + matplotlib charts at 200 DPI
106+
- **Style**: Clean white title page with navy (#1e3a5f) accent, Times New Roman body font
107+
- **Color palette**: Navy #1e3a5f (headers), dark gold #b8860b (accents), forest green #2d6a4f (pass), warm amber #d4740e (warnings), deep red #c53030 (fail), warm cream #faf9f7 (backgrounds)
108+
- **Structure**: Title page → TOC with scores → Executive Summary → Data sections → Recommendations → Methodology
109+
- **Charts**: 85% width, max-height 120mm, figure captions on every chart, saved to `charts/` at 200 DPI
110+
- **No `page-break-inside: avoid`** on any element (causes white gaps in WeasyPrint)
111+
- **Post-generation review**: `_review_pdf()` runs automatically, checking for empty images, thin sections, duplicates
112+
- **Before presenting any PDF to the user**: verify the review passes (`"status": "PASS"`)
113+
- **Cross-skill enforcement**: After completing ANY analysis command (audit, page, technical, content, schema, geo, local, maps), offer: "Generate a PDF report? Use `/seo google report`"
114+
- **Google logo** appears on title page when using Google API data ("Powered by Google APIs")
115+
96116
## Ecosystem
97117

98118
Part of the Claude Code skill family:

README.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<!-- Updated: 2026-03-06 -->
1+
<!-- Updated: 2026-03-28 -->
22

33
![Claude SEO](screenshots/cover-image.jpeg)
44

55
# Claude SEO - SEO Audit Skill for Claude Code
66

7-
Comprehensive SEO analysis skill for Claude Code. Covers technical SEO, on-page analysis, content quality (E-E-A-T), schema markup, image optimization, sitemap architecture, AI search optimization (GEO), and strategic planning.
7+
Comprehensive SEO analysis skill for Claude Code. Covers technical SEO, on-page analysis, content quality (E-E-A-T), schema markup, image optimization, sitemap architecture, AI search optimization (GEO), local SEO, maps intelligence, Google SEO APIs (Search Console, PageSpeed, CrUX, GA4), PDF report generation, and strategic planning.
88

99
![SEO Command Demo](screenshots/seo-command-demo.gif)
1010

@@ -113,7 +113,11 @@ claude
113113
| `/seo plan <type>` | Strategic SEO planning (saas, local, ecommerce, publisher, agency) |
114114
| `/seo programmatic <url>` | Programmatic SEO analysis and planning |
115115
| `/seo competitor-pages <url>` | Competitor comparison page generation |
116+
| `/seo local <url>` | Local SEO analysis (GBP, citations, reviews, map pack) |
117+
| `/seo maps [command]` | Maps intelligence (geo-grid, GBP audit, reviews, competitors) |
116118
| `/seo hreflang <url>` | Hreflang/i18n SEO audit and generation |
119+
| `/seo google [command] [url]` | Google SEO APIs (GSC, PageSpeed, CrUX, Indexing, GA4) |
120+
| `/seo google report [type]` | Generate PDF/HTML report with charts (cwv-audit, gsc-performance, full) |
117121

118122
### `/seo programmatic [url|plan]`
119123
**Programmatic SEO Analysis & Planning**
@@ -183,6 +187,28 @@ New for 2026 - optimize for:
183187
- Perplexity
184188
- Other AI-powered search
185189

190+
### Google SEO APIs (New in v1.7.0)
191+
Direct integration with Google's SEO data:
192+
- **PageSpeed Insights + CrUX**: Lab and field Core Web Vitals data
193+
- **Search Console**: Top queries, URL inspection, sitemap status
194+
- **Indexing API**: Notify Google of new/updated/removed URLs
195+
- **GA4**: Organic traffic, top landing pages, device/country breakdown
196+
- **PDF Reports**: Enterprise A4 reports with charts via WeasyPrint + matplotlib
197+
198+
4-tier credential system — get value at every level:
199+
| Tier | Auth | APIs |
200+
|------|------|------|
201+
| 0 | API key | PSI, CrUX, CrUX History |
202+
| 1 | + OAuth/SA | + GSC, URL Inspection, Indexing |
203+
| 2 | + GA4 config | + GA4 organic traffic |
204+
| 3 | + Ads token | + Keyword Planner |
205+
206+
### Local SEO & Maps Intelligence (New in v1.6.0)
207+
- Google Business Profile optimization
208+
- NAP consistency auditing
209+
- Citation and review analysis
210+
- Geo-grid rank tracking and competitor radius mapping
211+
186212
### Quality Gates
187213
- Warning at 30+ location pages
188214
- Hard stop at 50+ location pages
@@ -192,9 +218,9 @@ New for 2026 - optimize for:
192218
## Architecture
193219

194220
```
195-
~/.claude/skills/seo/ # Main skill
196-
~/.claude/skills/seo-*/ # Sub-skills (12 total)
197-
~/.claude/agents/seo-*.md # Subagents (7 total)
221+
~/.claude/skills/seo/ # Main orchestrator skill
222+
~/.claude/skills/seo-*/ # Sub-skills (15 + 2 extensions)
223+
~/.claude/agents/seo-*.md # Subagents (10 + 2 extensions)
198224
```
199225

200226
### Video & Live Schema (New)
@@ -219,6 +245,7 @@ See `schema/templates.json` for ready-to-use JSON-LD snippets.
219245
- Python 3.10+
220246
- Claude Code CLI
221247
- Optional: Playwright for screenshots
248+
- Optional: Google API credentials for enriched data (see `/seo google setup`)
222249

223250
## Uninstall
224251

agents/seo-google.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: seo-google
3+
description: Google SEO API analyst. Fetches CWV field data via CrUX, indexation status via GSC, and organic traffic via GA4 for enriched audit data.
4+
model: sonnet
5+
maxTurns: 15
6+
tools: Read, Bash, Write, Glob, Grep # Write needed for report/data file output
7+
---
8+
9+
You are a Google SEO API data analyst. When delegated tasks during an SEO audit:
10+
11+
1. Check credentials: `python scripts/google_auth.py --check --json`
12+
2. Determine tier (0 = API key, 1 = + service account, 2 = + GA4)
13+
3. Execute tier-appropriate analysis
14+
4. Format output to match claude-seo conventions
15+
16+
## Tier-Based Workflow
17+
18+
### Tier 0 (API Key Only)
19+
- Run PSI + CrUX on homepage: `python scripts/pagespeed_check.py <url> --json`
20+
- Run CrUX History for origin: `python scripts/crux_history.py <origin> --origin --json`
21+
- Report CWV field data with traffic-light ratings
22+
23+
### Tier 1 (+ Service Account)
24+
- All Tier 0 checks
25+
- GSC top queries/pages (28 days): `python scripts/gsc_query.py --property <prop> --json`
26+
- URL Inspection on homepage + key pages: `python scripts/gsc_inspect.py <url> --json`
27+
- GSC sitemap status: `python scripts/gsc_query.py sitemaps --property <prop> --json`
28+
29+
### Tier 2 (Full)
30+
- All Tier 1 checks
31+
- GA4 organic traffic (28 days): `python scripts/ga4_report.py --property <id> --json`
32+
- Top organic landing pages: `python scripts/ga4_report.py --property <id> --report top-pages --json`
33+
34+
## Core Web Vitals Thresholds
35+
36+
| Metric | Good | Needs Improvement | Poor |
37+
|--------|------|-------------------|------|
38+
| LCP | ≤ 2,500ms | 2,500-4,000ms | > 4,000ms |
39+
| INP | ≤ 200ms | 200-500ms | > 500ms |
40+
| CLS | ≤ 0.1 | 0.1-0.25 | > 0.25 |
41+
42+
INP replaced FID on March 12, 2024. Never reference FID.
43+
44+
## Output Format
45+
46+
Match existing claude-seo patterns:
47+
- Tables for metrics with traffic-light ratings
48+
- Scores as XX/100
49+
- Priority: Critical > High > Medium > Low
50+
- Note data source as "Google API (field data)" to distinguish from static analysis
51+
- Include data freshness notes (CrUX: 28-day rolling, GSC: 2-3 day lag, GA4: 1 day lag)
52+
53+
## Report Generation (MANDATORY)
54+
55+
After completing data collection at any tier, ALWAYS offer to generate a PDF report.
56+
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).
57+
58+
```bash
59+
python scripts/google_report.py --type full --data data.json --domain DOMAIN --format pdf --json
60+
```
61+
Report types: `cwv-audit`, `gsc-performance`, `indexation`, `full`.
62+
Before presenting: verify `"review": {"status": "PASS"}` in the JSON output.
63+
64+
## Error Handling
65+
66+
- If credentials are missing, report which tier is available and what can still be checked
67+
- If CrUX returns 404, note insufficient Chrome traffic and fall back to PSI lab data
68+
- If GSC returns 403, report the service account email and instruct on adding permissions
69+
- Never fail silently -- always report what succeeded and what failed

agents/seo-performance.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ curl "https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=URL&key=API
7171
npx lighthouse URL --output json
7272
```
7373

74+
## Google API Integration (Optional)
75+
76+
If Google API credentials are configured, prefer CrUX field data over Lighthouse lab data for CWV assessment:
77+
```bash
78+
python scripts/pagespeed_check.py URL --json
79+
python scripts/crux_history.py URL --json
80+
```
81+
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).
82+
7483
## Output Format
7584

7685
Provide:

agents/seo-technical.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: seo-technical
33
description: Technical SEO specialist. Analyzes crawlability, indexability, security, URL structure, mobile optimization, Core Web Vitals, and JavaScript rendering.
44
model: sonnet
55
maxTurns: 20
6-
tools: Read, Bash, Write, Glob, Grep
6+
tools: Read, Bash, Write, Glob, Grep # Write needed for report/data file output
77
---
88

99
You are a Technical SEO specialist. When given a URL or set of URLs:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "claude-seo"
3-
version = "1.5.0"
3+
version = "1.7.0"
44
description = "Comprehensive SEO analysis skill for Claude Code"
55
requires-python = ">=3.11"
66
license = "MIT"

0 commit comments

Comments
 (0)