--- name: seo-rendering description: "Make sure search crawlers and AI fetchers receive real content, links, metadata and structured data in the initial HTML. Use for single-page apps, client-side rendering, hydration problems, framework rendering modes (SSR, SSG, ISR, prerendering, islands), content or links that appear only after JavaScript, JavaScript-injected canonicals or JSON-LD, SPA soft 404s, hash routing, and reports like 'Google or ChatGPT sees an empty page'. Implements rendering changes in the framework and verifies the server HTML. Not for Core Web Vitals tuning (seo-performance)." --- # SEO rendering: real content in the initial HTML Make the first HTML response of every public route contain its primary content, internal links, title, description, canonical and JSON-LD, so that crawlers which render JavaScript late, and fetchers which never render it, see the same page users see. Change the rendering mode in the framework, not with crawler-specific workarounds, and prove it on the server output. ## Use when / hand off Use this skill when: - the site is a single-page app (Vite, Create React App, Vue CLI, Angular without SSR) or uses client-only routes; - someone reports that Google, ChatGPT, Perplexity or a link preview "sees an empty page", a loading spinner or the wrong title; - content, links, canonicals or JSON-LD are added only after hydration or after a client-side fetch; - routes use `#/` hash URLs, unknown paths return 200 with an app shell, or prerendering, ISR or islands are misconfigured. Hand off when the work is mainly: | Need | Skill | | --- | --- | | LCP, INP, CLS tuning, hydration cost as a speed problem | [seo-performance](../seo-performance/SKILL.md) | | Which URL is canonical, robots directives, redirect correctness | [seo-technical](../seo-technical/SKILL.md) | | Title and description wording | [seo-metadata](../seo-metadata/SKILL.md) | | JSON-LD types and properties | [seo-structured-data](../seo-structured-data/SKILL.md) | | Whether AI crawlers are allowed at all | [geo-ai-access](../geo-ai-access/SKILL.md) | | Markdown alternates, llms.txt, agent-facing documents | [geo-agent-readiness](../geo-agent-readiness/SKILL.md) | ## Before you change anything 1. Read the repository's instructions (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, deploy docs) and follow them where they conflict with this skill. 2. Define the CLI: `SG` means `python3 -I /scripts/seo_geo.py`, where `` is two directories above this `SKILL.md` (in Claude Code: `python3 -I "${CLAUDE_PLUGIN_ROOT}/scripts/seo_geo.py"`). 3. Run `SG stack .` (or reuse its result). Read `frameworks`, `rendering_hints` (for example `output: 'export'`, `ssr: false`, client-only imports, a Vite SPA) and `recipe_anchors`; open those sections of [framework-recipes.md](../../references/framework-recipes.md) and check the installed framework version. 4. Find the real files that decide rendering: framework config (`next.config.*`, `nuxt.config.ts`, `astro.config.*`, `svelte.config.js`, `react-router.config.ts`, `angular.json`, `app.routes.server.ts`), route-level flags, layout components, data-fetching hooks and host fallback rules (`_redirects`, `vercel.json`, nginx, Apache). 5. Agree the target with the user: built output (offline default), a production server started locally (needs their consent), or the live site (explicit consent, owned site, `--live`). Development servers are not a valid target: they inject scripts and render differently. 6. Do not rely on a host web-fetch tool that summarizes pages or strips ``; read build output or the raw response. A host browser tool may be used for an optional rendered comparison; never install one. 7. Note available evidence (Search Console URL Inspection screenshots or exports, rendered-HTML captures from the user) and say plainly what is missing. 8. Write reports and baselines only under `.seo-geo-god/` in the repository (outside the build output) and suggest adding it to `.gitignore`; baselines may be committed if the team wants CI comparisons. ## Workflow Detect, inspect the real files, run the deterministic checks, decide with cited facts, implement the smallest correct change, re-run the same checks, report. Audit-only requests stop after step 4. 1. **Find client-only code paths.** Search the routes that matter (home, top templates, product or article pages): | Stack | Patterns that keep content out of server HTML | | --- | --- | | Next.js | `dynamic(() => import(...), { ssr: false })`; data fetched in `useEffect`; `if (typeof window === 'undefined') return null`; client-side auth gates on public pages | | Nuxt | `ssr: false`; `routeRules` with `ssr: false`; ``; fetches in `onMounted` | | Astro | `client:only` islands | | SvelteKit | `export const ssr = false`; fetches in `onMount`; `adapter-static` `fallback` | | React Router or Remix | `ssr: false` (SPA mode); data only in `clientLoader` | | Angular | no `@angular/ssr`; `RenderMode.Client` routes | | Vite SPA or CRA | `createRoot(...).render` or `createApp(...).mount('#app')` into an empty `index.html` | | Hash routing | `HashRouter`, `createHashRouter`, `createWebHashHistory`, `mode: 'hash'`, `href="#/..."` | 2. **Inspect the server output.** Build with the project's documented command, then: - static output: `SG audit-build dist --base-url https://example.com --format md` and read the [REND001](../../references/rule-catalog.md#rend001) to [REND005](../../references/rule-catalog.md#rend005), [LINK004](../../references/rule-catalog.md#link004) and [HTTP005](../../references/rule-catalog.md#http005) findings; - one page in detail: `SG audit-page dist/pricing/index.html --url https://example.com/pricing/`; - server-rendered apps (with consent): start the production server locally and run `SG audit-url http://localhost:3000 --live --allow-local localhost:3000 --max-pages 100`; the same run reports [HTTP004](../../references/rule-catalog.md#http004) when an unknown URL returns 200; - key phrases: pick two or three sentences, a product name and a price from each template and confirm they appear in the built file (`rg -c "exact phrase" dist/pricing/index.html`). 3. **Optional rendered comparison.** Only if the host already provides a browser tool: compare visible text, link count, title, canonical, robots meta and JSON-LD types between the raw response and the rendered DOM. Anything present only after rendering is a finding. Without a browser tool, report "rendered output not compared". 4. **Decide** with the fix ladder (smallest change that puts content in HTML): | Finding | Fix | Facts | | --- | --- | --- | | Whole site is a client shell ([REND001](../../references/rule-catalog.md#rend001)) | Prerender public routes at build (SSG); move public pages to the framework's SSR or SSG mode; keep the SPA for signed-in screens | [F-T-22](../../references/current-facts.md#f-t-22), [F-T-23](../../references/current-facts.md#f-t-23) | | Thin server HTML with heavy scripts ([REND002](../../references/rule-catalog.md#rend002)) | Fetch the data on the server (server component, `load`, `loader`, `useAsyncData`, `getStaticProps`) and render it | [F-T-22](../../references/current-facts.md#f-t-22) | | Content only in `