Use these hooks in nuxt.config.ts to change build-time output. Mutate the supplied payload; return values are ignored.
'ai-ready:page:markdown'
Type: (ctx: ParsedMarkdownResult & { route: string }) => void | Promise<void>
Called per page during prerender. Modify markdown content before it's written to llms-full.txt and stored page data.
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>> | Extracted headings from page |
updatedAt | string? | Date extracted from page metadata, when available |
Runs during prerendering, including nuxi generate and nuxi build --prerender.
'ai-ready:llms-txt'
Type: (payload: { sections: LlmsTxtSection[] | undefined, notes: string[] }) => void | Promise<void>
Runs during module setup, before llms.txt configuration is finalized. Add sections or notes to the supplied payload.
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'
Type: (payload: { skills: AgentSkillConfig[] }) => void | Promise<void>
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 for entry shapes.