---
title: "Nuxt Hooks"
description: "Nuxt hooks provided by nuxt-ai-ready for extending functionality."
canonical_url: "https://nuxtseo.com/docs/ai-ready/api/nuxt-hooks"
last_updated: "2026-09-25T17:47:05.100Z"
---

Use these hooks in `nuxt.config.ts` to change build-time output. Mutate the supplied payload; return values are ignored.

## `'ai-ready:page:markdown'`{lang="ts"}

**Type:** `(ctx: ParsedMarkdownResult & { route: string }) => void | Promise<void>`{lang="ts"}

Called per page during prerender. Modify markdown content before it's written to `llms-full.txt` and stored page data.

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  hooks: {
    'ai-ready:page:markdown': (ctx) => {
      ctx.markdown += '\n\nSee /support for help.'
    }
  }
})
```

**Context:**

| Property      | Type                                       | Description                                       |
| ------------- | ------------------------------------------ | ------------------------------------------------- |
| `route`       | `string`                                   | Page route (e.g., `/about`)                       |
| `markdown`    | `string`                                   | Generated markdown (modify this)                  |
| `title`       | `string`                                   | Page title                                        |
| `description` | `string`                                   | Page description                                  |
| `headings`    | `Array<Record<string, string>>`{lang="ts"} | Extracted headings from page                      |
| `updatedAt`   | `string?`                                  | Date extracted from page metadata, when available |

Runs during prerendering, including `nuxi generate`{lang="bash"} and `nuxi build --prerender`{lang="bash"}.

## `'ai-ready:llms-txt'`{lang="ts"}

**Type:** `(payload: { sections: LlmsTxtSection[] | undefined, notes: string[] }) => void | Promise<void>`{lang="ts"}

Runs during module setup, before llms.txt configuration is finalized. Add sections or notes to the supplied payload.

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  hooks: {
    'ai-ready:llms-txt': (payload) => {
      payload.sections ??= []
      payload.sections.push({
        title: 'Custom APIs',
        description: 'Additional endpoints',
        links: [
          { title: 'Search', href: '/api/search', description: 'Search endpoint' }
        ]
      })
      payload.notes.push('Built with Nuxt AI Ready')
    }
  }
})
```

**Payload:**

| Property   | Type                            | Description                                             |
| ---------- | ------------------------------- | ------------------------------------------------------- |
| `sections` | `LlmsTxtSection[] \| undefined` | Sections with title, description, links                 |
| `notes`    | `string[]`                      | Heading-free context rendered before file-list sections |

Change the arrays directly. This hook does not run for each HTTP request.

## `'ai-ready:agent-skills'`{lang="ts"}

**Type:** `(payload: { skills: AgentSkillConfig[] }) => void | Promise<void>`{lang="ts"}

Runs after the module combines local and configured skills, before it resolves the root alias and publication routes.
Mutate `payload.skills` to add or remove entries. See [Agent Skills Discovery](/docs/ai-ready/guides/agent-skills) for entry shapes.

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
