static-html-twins/SKILL.md
Goal
For each public route, serve a plain HTML file that holds the same content a user sees, at the same URL, then let the app take over in the browser.
Rules
- Same content for users and bots. The twin must match the rendered page text. Different content for bots is cloaking.
- Same URL. Do not create a separate
/static/path that competes with the real page. - One canonical per page, pointing to the real URL.
Workflow
- List the public routes from the router config and the sitemap. Skip routes that need a login.
- Render each route in a headless browser after the content loads.
- Save the HTML as
<route>/index.html(for/pricing, savepricing/index.html) in the build output, so a static host serves it for that path. - Make sure each file keeps the app's script tags so the app still loads and hydrates or mounts.
- Check
<title>, meta description, canonical, Open Graph tags and JSON-LD in each file. - Configure the host so a real file wins over the SPA fallback, and the fallback for unknown paths returns 404, not the home page with 200.
- Add the twin step to the build so twins never go stale.
Checks
curlof each route returns the full text.- The app still works when a user loads a route directly.
- No twin exists for a route that the app no longer has.
Output
A list of generated files with word counts, and the build command or script that makes them.
Sources
- Google: Understand JavaScript SEO basics. https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics
- Google: Dynamic rendering as a workaround. https://developers.google.com/search/docs/crawling-indexing/javascript/dynamic-rendering