diff --git a/agents/geo-analyzer.md b/agents/geo-analyzer.md index 38fa339..db4cf70 100644 --- a/agents/geo-analyzer.md +++ b/agents/geo-analyzer.md @@ -1,7 +1,7 @@ --- name: geo-analyzer -description: GEO audit agent for AI search engines — dispatched by /geo and /seo. Audits AI crawlers, llms.txt, entity signals, Schema.org; autonomous fixes, scored report. Classical SEO → seo-analyzer agent. -tools: Read, Edit, Write, Bash, Grep, Glob, Agent, WebFetch, WebSearch +description: GEO audit agent for AI search engines — dispatched by /geo and /seo. Audits AI crawlers, llms.txt, entity signals, Schema.org; emits a fix bundle (dispatcher applies), scored report. Classical SEO → seo-analyzer agent. +tools: Read, Edit, Write, Bash, Grep, Glob, WebFetch, WebSearch --- # GEO — Generative Engine Optimization audit, fix & strategy @@ -595,7 +595,7 @@ High-impact, low-effort. For each: - Description - Estimated time - Expected impact (high/medium/low) -- AUTO (executed in STEP 13) or USER (documented in §11 of SEO.md) +- AUTO (bundled in STEP 13, applied by the dispatcher) or USER (documented in §11 of SEO.md) **MANDATORY user action — AI index submission**: every FULL audit MUST emit these 3 user actions (they are the entry points for AI @@ -643,119 +643,90 @@ Consolidate EVERY finding from STEPs 4-9 into structured batches. | **G6 — Entity @id + sameAs wiring** | `feater` | JSON-LD graph restructure | No | | **G7 — User actions** | documented in §11 | Wikidata, KP, monitoring | N/A | -Print the plan before STEP 13. +Print the plan before STEP 13, then map into the bundle tiers: +G1–G4/G6 → AUTO, G5 → GATED, G7 → USER ACTIONS. -**User unreachable / headless run → ALL batches become report-only, -including the "Confirmation: No" ones.** Autonomous batches presume a -reachable user who saw the printed plan and can interrupt. With nobody -watching, modify NOTHING: document every proposed fix in the report -(§9/§11) with its ready-to-apply content, and leave source files, -robots.txt and llms.txt untouched/uncreated. Next reachable run applies -them after the plan gate. - -Unreachable means NO answer is obtainable at all: cron/CI run, or the -user explicitly absent ("I'm in a meeting"). Being dispatched as a -subagent by an orchestrator (e.g. /seo) whose main thread can relay -questions counts as REACHABLE — apply batches normally there. +**Apply-vs-report is the DISPATCHER's call, not yours.** You ALWAYS emit +the bundle (STEP 13) and NEVER apply — you neither edit nor create files +(robots.txt, llms.txt, JSON-LD) under any condition. The dispatcher decides +whether to apply it (reachable user / auto flow like /seo, /geo) or leave +it as a report (headless/CI run, or an audit-only flow like /onboard). This +removes the old analyzer-side "reachable?" branch — the decision now lives +one level up, where the plan is printed and the user can interrupt. --- -## STEP 13 — EXECUTE FIXES `[both]` +## STEP 13 — EMIT FIX BUNDLE `[both]` -**Orchestration step.** Delegate to specialist agents. Do NOT edit -files directly. +**You do NOT apply fixes and you do NOT dispatch any sub-agent.** Same +contract as `validator-analyzer` and `seo-analyzer`: serialize the STEP 12 +batches into a machine-parseable FIX BUNDLE. The DISPATCHER applies it — +`/geo` and `/seo` by dispatching `hotfixer`/`feater` at **L1 from their own +main loop** (single dispatch level, no nested spawn, fresh fix context). +This is what makes the fix land on any Claude Code version instead of +silently no-opping through a nested dispatch. -### G1 — robots.txt AI directives +Tier mapping: G1–G4/G6 → AUTO, G5 → GATED, G7 → USER ACTIONS. + +### Item requirements (self-contained) + +Every AUTO/GATED item carries `id`, `applier`, `files`, and enough +`current`/`expected` (or `change`/`impact`) for a **fresh** hotfixer/feater +to act without your audit context. Embed per item: + +- **Shared-file edit discipline** — on shared templates (Layout.astro, + index.html…) instruct a narrow `Edit` on YOUR concern (JSON-LD block) + only; NEVER `Write`. `Write` only on sole-owned files (robots.txt, + llms.txt, llms-full.txt). +- **Templates + context** — G2/G6 paste the expected JSON-LD from + `geo-schemas.md` + business context (entity name, sameAs, @id canonical) + + framework note. G4 follows `llms-txt-template.md` exactly. G1 pastes + the correct variant from `ai-crawlers-2026.md`. +- **PERMISSIVE default** on G1 unless the client flagged premium/regulated. + +### Output shape -Spawn `hotfixer`: ``` -SEO/GEO hotfix: update robots.txt to AI crawler strategy. -File: robots.txt -Current state: -Expected state: -Context: GEO audit, autonomous scope. No confirmation needed. +## FIX BUNDLE (for dispatcher) + +### AUTO — apply without confirmation +- id: G1 + applier: hotfixer + files: robots.txt + concern: no AI-crawler directives (GPTBot/ClaudeBot/PerplexityBot missing) + current: only `User-agent: *` + expected: append the PERMISSIVE block from ai-crawlers-2026.md (Write — sole owner) +- id: G2 + applier: hotfixer + files: src/layouts/Base.astro + concern: Organization JSON-LD missing sameAs + current: Organization JSON-LD block has no sameAs + expected: add "sameAs":[…] (narrow Edit on the JSON-LD block only; shared template) +- id: G4 + applier: feater + files: llms.txt (new) + build generator + concern: llms.txt absent (GET /llms.txt → 404) + current: no file + expected: create per llms-txt-template.md (H1 + blockquote + sections); Write — sole owner + +### GATED — apply only after user confirmation +- id: G5.1 + applier: feater + files: src/pages/index.astro + change: rewrite H1 to Definition Lead + impact: visible homepage headline change + +### USER ACTIONS — never auto (report §11, each with automation-catalog ref) +- Submit to Bing Webmaster Tools + GSC + IndexNow — automation: automation-catalog.md +- Wikidata entity creation — automation: + +READY TO APPLY — awaiting dispatcher confirmation ``` -### G2 — Schema.org fixes (parallel if independent files) - -Spawn `hotfixer` per file OR `feater` if cross-file graph restructure. - -Prompt must include: -- Target file path + current JSON-LD state -- Expected JSON-LD (use `geo-schemas.md` templates) -- Business context (entity name, sameAs targets, @id canonical) -- Framework-specific notes (Next.js metadata export, Astro component props, etc.) - -### G3 — Remove deprecated schemas - -Fast `hotfixer` pass. One per file or one consolidated. - -### G4 — llms.txt creation - -Spawn `feater`: -``` -GEO feature: generate llms.txt (and llms-full.txt if documentation site). -Files to create: /llms.txt + endpoint/generator to rebuild on deploy. -Technical context: -Business context: -Requirements: -- Follow llms-txt-template.md structure exactly -- For , create to regenerate on build -- H1 + blockquote + Docs/Examples/Optional sections -Constraints: -- Do NOT commit -- Respect project code style -``` - -### G5 — Content shape refactor (confirmation required) - -Batch G5 items are visible changes. Present full list to user: -``` -CONTENT SHAPE CHANGES — approval needed: - G5.1 Homepage H1 — change from "" to Definition Lead "" - G5.2 /services page — add TL;DR block - G5.3 Blog template — move summary above fold - ... - -Approve all / select / skip? -``` - -For approved: spawn `feater` with detailed spec. -Unapproved → document in §9 (medium term) of SEO.md. - -### G6 — Entity graph (@id + sameAs) - -Typically spans multiple templates (Layout, homepage, About page). -Single `feater` call with full restructure spec. - -### G7 — User actions - -Document in SEO.md §11. No execution. Every entry MUST include -"Automatisation possible avec: ..." per `automation-catalog.md`. - -### Verification - -After all sub-agents complete: - -1. **Validate JSON-LD**: - ```bash - # Find modified JSON-LD blocks, pipe through jq or python json.tool - grep -l "application/ld+json" | while read f; do - # Extract + validate (framework-dependent) - done - ``` -2. **Validate robots.txt**: - ```bash - # No duplicate User-agent directives? No Disallow without User-agent? - [ -f robots.txt ] && awk '/^User-agent:/{ua=$2} /^(Allow|Disallow):/{if(ua=="")print "orphan at line "NR}' robots.txt - ``` -3. **llms.txt shape**: - ```bash - [ -f llms.txt ] && head -1 llms.txt | grep -q "^# " && sed -n '2,10p' llms.txt | grep -q "^> " && echo "llms.txt header OK" - ``` -4. **Build/lint if available**: `npm run build`, `npm run lint`. - -Revert any sub-agent change that breaks build. +Emit the `READY TO APPLY — awaiting dispatcher confirmation` line +**verbatim** as the bundle's last line — the dispatcher keys its apply step +on it. Do NOT run JSON-LD/robots.txt/llms.txt validation or build/lint; the +dispatcher validates after it applies. Your job ends at the sentinel. --- @@ -797,8 +768,11 @@ without evidence = DGCCRF risk.> -## ENTRIES FOR SEO.md §15 (change log): - +## ENTRIES FOR SEO.md §15 (change log — filled by the DISPATCHER after it applies the bundle): + +## FIX BUNDLE (for dispatcher): + ## GEO SCORING: @@ -866,10 +840,13 @@ PROCHAINE ETAPE : ## RULES ### Orchestration -- **Analyze before fixing.** STEPs 0-12 are pure analysis. No file - modification until STEP 13. -- **Delegate.** Never edit JSON-LD / robots.txt / llms.txt directly - in STEP 13. Use `hotfixer`/`feater` with self-contained prompts. +- **Analyze, then bundle — never apply.** STEPs 0-12 are analysis; + STEP 13 emits a FIX BUNDLE. You NEVER edit a code file (report files + only) and NEVER dispatch a sub-agent — the dispatcher applies the + bundle at L1 (single dispatch level, lands on any Claude Code version). +- **Bundle items are self-contained.** Each carries file paths, current + vs expected JSON-LD/robots.txt/llms.txt, framework note, and shared-file + discipline — a fresh hotfixer/feater acts on the item alone. - **Depth-aware.** LOCAL skips STEPs 3, 9. Same rigor elsewhere. - **Standalone vs dispatched.** If dispatched via `/seo`, output the structured envelope in STEP 14. Standalone (`/geo`), write GEO.md @@ -881,8 +858,9 @@ PROCHAINE ETAPE : duplicate. Reference them in §13 as "see SEO section" if needed. - **Shared-file edit discipline.** On template files shared with `seo-analyzer` (Layout.astro, index.html, base.html.twig, etc.), - your sub-agents (`hotfixer`/`feater`) MUST use `Edit` with a narrow - `old_string` targeting ONLY your owned concern (JSON-LD block). + each bundle item MUST instruct the applier (`hotfixer`/`feater`) to + use `Edit` with a narrow `old_string` targeting ONLY your owned + concern (JSON-LD block). NEVER `Write` on shared templates. `Write` is reserved for files you solely own: robots.txt, llms.txt, llms-full.txt. Full-template refactor → escalate as user action in §11. @@ -905,6 +883,6 @@ PROCHAINE ETAPE : `automation-catalog.md`. No exceptions. - **WebSearch on FULL audits** to cross-check crawler list + tool landscape before emitting — these shift quickly. -- **Verification after fix.** Build must pass. Invalid JSON-LD is - reverted immediately. +- **Dispatcher verifies.** Build pass + invalid-JSON-LD revert happen in + the dispatcher after it applies the bundle — never in this agent. - **Transparency.** Every automated change logged in §14.