diff --git a/.env.example b/.env.example index 0c77f45..91fbe99 100644 --- a/.env.example +++ b/.env.example @@ -4,3 +4,12 @@ # Used by: lib/toggle-external.sh enable|disable magic # Get a key at: https://21st.dev/magic (dashboard → API keys) MAGIC_API_KEY=your_21st_dev_magic_api_key_here + +# ── Google SEO data layer (lib/seo-data) — used by /seo FULL ── +# OAuth Desktop client: GCP console → APIs & Services → Credentials → OAuth client (Desktop). +# Scope requested at consent: webmasters.readonly. One-time setup: make seo-connect +GOOGLE_OAUTH_CLIENT_ID= +GOOGLE_OAUTH_CLIENT_SECRET= +# CrUX + PageSpeed API key (GCP console → Credentials → API key, restricted to those APIs). +# Get it: https://developer.chrome.com/docs/crux/api +CRUX_API_KEY= diff --git a/.gitignore b/.gitignore index cd80599..6cab62b 100644 --- a/.gitignore +++ b/.gitignore @@ -113,6 +113,11 @@ install-*.log .env.* !.env.example +# seo-data engine local artifacts (live under ~/.claude, never committed) +.venv-seo-data/ +seo-data/tokens.json +__pycache__/ + # OS .DS_Store Thumbs.db diff --git a/.gitleaks.toml b/.gitleaks.toml index 462c78d..d11491c 100644 --- a/.gitleaks.toml +++ b/.gitleaks.toml @@ -34,4 +34,7 @@ paths = [ # for stray COPIES of secrets outside this file; flagging the vault # itself on every run is pure noise, not signal. '''(^|/)\.env$''', + # seo-data OAuth token store — legitimate local secret (like ~/.claude/.env), + # 0600, outside git. Allowlisted so `make scan-secrets` doesn't flag the vault. + '''(^|/)\.claude/seo-data/tokens\.json$''', ] diff --git a/Makefile b/Makefile index 03ca995..7d8d1da 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help install plugin link doctor update new-skill profile profile-list profile-current profile-reset onboard test scan-secrets +.PHONY: help install plugin link doctor update new-skill profile profile-list profile-current profile-reset onboard test scan-secrets seo-connect help: ## Show available commands @grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " make %-14s %s\n", $$1, $$2}' @@ -22,8 +22,14 @@ onboard: link ## Onboard an existing project (run from the project directory) @echo "Open Claude Code in your project directory and run: /onboard" @echo "Or with hints: /onboard Python FastAPI monorepo" +seo-connect: ## Connect a Google account for /seo FULL (creates venv, OAuth consent) + @python3 -m venv "$$HOME/.claude/.venv-seo-data" + @"$$HOME/.claude/.venv-seo-data/bin/pip" install -q -r lib/seo-data/requirements.txt + @bash -c 'read -r -p "Label for this account (e.g. client-a): " label; \ + "$$HOME/.claude/.venv-seo-data/bin/python3" lib/seo-data/connect.py --label "$$label"' + test: ## Run deterministic tests (lib/tests/*.test.sh + lib/gitflow-test.sh + lib/tests/run-*.sh) - @fail=0; for t in lib/tests/*.test.sh lib/gitflow-test.sh lib/tests/run-*.sh; do \ + @fail=0; for t in lib/tests/*.test.sh lib/seo-data/*.test.sh lib/gitflow-test.sh lib/tests/run-*.sh; do \ echo "== $$t"; \ case "$$(basename "$$t")" in \ run-release-candidate.sh) RC_WORK=$$(mktemp -d) RC_TAG=1 bash "$$t" || fail=1 ;; \ diff --git a/agents/resources/automation-catalog.md b/agents/resources/automation-catalog.md index 8c4fb16..87f7ba7 100644 --- a/agents/resources/automation-catalog.md +++ b/agents/resources/automation-catalog.md @@ -69,6 +69,11 @@ Therefore: submit to GSC + Bing Webmaster minimum on every FULL audit. - **Google Search Console** (FREE) — https://search.google.com/search-console Covers Google search + AI Overviews grounding. URL inspection tool requests live re-indexing (faster than waiting for crawl). +- **Connexion GSC pour /seo (données réelles)** — `make seo-connect` + (depuis le repo claude-config, une fois par compte) : consentement + OAuth lecture seule (webmasters.readonly), stocke un refresh token + local (0600). Ensuite /seo FULL lit requêtes/positions/indexation + sans réinvite. - **IndexNow protocol** (FREE) — https://www.indexnow.org Proactive ping to Bing + Yandex + Seznam + DuckDuckGo. One-line API call per URL change. Plugins: Yoast (built-in), RankMath, diff --git a/agents/seo-analyzer.md b/agents/seo-analyzer.md index 0d0c1c2..21246ad 100644 --- a/agents/seo-analyzer.md +++ b/agents/seo-analyzer.md @@ -198,12 +198,18 @@ verify WebFetch + WebSearch available. If missing: ``` PLUGIN CHECK -curl/Bash : YES (always) -WebFetch : YES / NO / N/A (LOCAL) -WebSearch : YES / NO / N/A (LOCAL) -STATUS : READY | DEGRADED (missing: ) +curl/Bash : YES (always) +WebFetch : YES / NO / N/A (LOCAL) +WebSearch : YES / NO / N/A (LOCAL) +GSC/CrUX creds : READY (account: