Nuxt + AI Readiness
Nuxt's universal rendering is great for AI, but missing llms.txt and structured data leave your app invisible. Here's how to fix it.
Why Nuxt Apps Need AI Optimization
Nuxt 3 with Nitro provides excellent SSR by default, but most apps still lack the files and metadata AI agents need to discover and understand your content.
No llms.txt
AI models can't get a structured overview of your site without llms.txt — Nuxt doesn't generate it by default.
Missing nuxt-llms module
The nuxt-llms module auto-generates llms.txt from your content, but most apps don't have it installed.
SPA mode pages
Pages using routeRules with SPA mode or ssr: false are invisible to AI crawlers.
No agent discovery files
agent-card.json and .well-known/ endpoints aren't set up, limiting AI agent integration.
What w2agent Generates
After auditing your Nuxt app, w2agent generates Nitro-native files:
server/routes/llms.txt.tsNitro cached event handler with 1hr SWR cache — reads from public/ or generates fallback.
server/middleware/content-negotiation.tsRedirects AI bots requesting text/markdown at root to /llms.txt.
public/llms.txtStatic fallback served directly by Nitro — works on any hosting.
server/routes/.well-known/agent-card.json.tsCached JSON handler for AI agent discovery.
Example: Nitro cached handler for llms.txt
// server/routes/llms.txt.ts
import { defineCachedEventHandler } from "#imports";
export default defineCachedEventHandler(
async () => {
const fs = await import("node:fs");
const path = await import("node:path");
const filePath = path.join(process.cwd(), "public", "llms.txt");
if (fs.existsSync(filePath)) {
return fs.readFileSync(filePath, "utf-8");
}
return "# My Site\n\n> AI-ready content\n";
},
{ swr: true, maxAge: 3600 },
);Nuxt-Specific Checks
| Check | What It Tests |
|---|---|
| SEO module detection | Checks if @nuxtjs/seo is installed for automatic sitemap, robots.txt, and meta tag generation. |
| LLMs module detection | Detects nuxt-llms for automatic llms.txt generation from your Nuxt content. |
| Schema.org coverage | Validates JSON-LD structured data across pages, including @nuxtjs/schema-org usage. |
| SSR rendering verification | Ensures pages are server-rendered, not SPA-only — AI crawlers need pre-rendered HTML. |
Step-by-Step Integration
Run the audit
npx w2agent audit https://your-nuxt-app.comGenerate files
npx w2agent generate https://your-nuxt-app.comAdd to your app
Copy the generated server/routes/ into your Nuxt app. Nitro cached handlers serve llms.txt with 1hr cache + SWR. Static fallbacks go to public/.
Deploy
Deploy to any Nitro-compatible host (Vercel, Netlify, Cloudflare). The postbuild script regenerates content on each deploy.
Audit your Nuxt site now
Get a free AI readiness score and generate the files your site needs.
Start Free AuditRun from your terminal
npx w2agent audit https://example.comnpx w2agent generate https://example.comnpx w2agent integrate https://example.comnpx w2agent mcp deploy https://example.com