Nuxt

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.ts

Nitro cached event handler with 1hr SWR cache — reads from public/ or generates fallback.

server/middleware/content-negotiation.ts

Redirects AI bots requesting text/markdown at root to /llms.txt.

public/llms.txt

Static fallback served directly by Nitro — works on any hosting.

server/routes/.well-known/agent-card.json.ts

Cached 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

CheckWhat It Tests
SEO module detectionChecks if @nuxtjs/seo is installed for automatic sitemap, robots.txt, and meta tag generation.
LLMs module detectionDetects nuxt-llms for automatic llms.txt generation from your Nuxt content.
Schema.org coverageValidates JSON-LD structured data across pages, including @nuxtjs/schema-org usage.
SSR rendering verificationEnsures pages are server-rendered, not SPA-only — AI crawlers need pre-rendered HTML.

Step-by-Step Integration

1

Run the audit

npx w2agent audit https://your-nuxt-app.com
2

Generate files

npx w2agent generate https://your-nuxt-app.com
3

Add 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/.

4

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 Audit

Run from your terminal

npx w2agent audit https://example.com
npx w2agent generate https://example.com
npx w2agent integrate https://example.com
npx w2agent mcp deploy https://example.com
Nuxt AI Readiness | w2agent