Lovable SEO & AEO Optimization Skill
This skill ensures that applications built or migrated in Lovable.dev adhere to strict SEO and Answer Engine Optimization (AEO) best practices so that traditional engines (Google, Bing) and AI crawlers (ChatGPT, Perplexity, Claude) properly index, understand, and cite the application.
Tech Stack Expectations
- Framework: TanStack Start (Server-Side Rendering enabled for clean HTML output)
- Database/CMS: Supabase (PostgreSQL for dynamic metadata storage)
- Framework Utility:
<Head>components / meta helpers for dynamic routing
Core SEO & AEO Implementation Protocols
1. Dynamic Route Metadata & Open Graph
Every page and dynamic route (blog posts, courses, landing pages) MUST include:
- Unique, keyword-targeted
<title>and<meta name="description">. - Canonical URLs (
<link rel="canonical" href="...">) to prevent duplicate content flags. - Complete Open Graph (
og:title,og:description,og:image,og:url) and Twitter Card tags. - For dynamic paths, metadata must be pulled dynamically from Supabase database fields during SSR rendering.
2. Structured Data / Schema Markup (The AEO Engine)
AI engines rely heavily on semantic HTML and JSON-LD markup to extract factual context.
- Global Schema: Inject
OrganizationandWebSiteJSON-LD on root/homepage components. - Entity Schemas: Implement specific schemas based on content type:
BlogPosting/Articlefor blogs/news.CourseorEducationalOccupationalProgramfor courses/trainings.Service/Productfor offerings and landing pages.FAQPagefor Q&A sections (critically important for AI citations).
- All JSON-LD markup must be validated, injection-safe standard
<script type="application/ld+json">.
3. Public Assets for Search & AI Crawlers
Ensure the following files are properly generated in the /public directory:
robots.txt: Must allow general user-agents and explicitly permit AI crawlers:GPTBot(OpenAI)ClaudeBot(Anthropic)PerplexityBot(Perplexity)Applebot-Extended- Reference the exact location of
sitemap.xml.
sitemap.xml: Server-generated XML sitemap looping over static routes and active database records (blogs, courses). Ensure zero trailing whitespace or invalid formatting.llms.txt&llms-full.txt: Markdown context summary located at root specifically designed for LLM consumption, outlining site ownership, services, topics, and primary links.
4. Migration & 301 URL Redirects
When migrating from legacy CMS systems (e.g., WordPress):
- Audit legacy URL paths.
- Match existing routes 1:1 wherever possible.
- If route structures change, configure middleware or route handlers in TanStack Start to issue permanent
301redirects from old URLs to new endpoints.
Lovable Prompt Generation Format
When generating prompts for the user to execute inside Lovable:
- Explicit Placement: Specify exact file targets (e.g.,
src/routes/__root.tsx,public/robots.txt,public/llms.txt). - SSR Focus: Remind Lovable to render head metadata server-side rather than relying on purely client-side React hooks (
react-helmet). - Validation Steps: Instruct Lovable to verify that no duplicate tags exist and that XML formatting is strict.