Check a page for accessibility
Review supplied markup or descriptions for practical accessibility issues and fixes.
5,226,474 AI resources indexedWorking toward the worldβs largest AI resource index.
An MCP server that provides on-demand skill loading for AI coding assistants.
---
name: nuxt-c95c0a8ee4bf
description: Build Vue 3 SSR/SSG applications with proper data fetching, hydration, and server patterns.
metadata: {"clawdbot":{"emoji":"π","requires":{"bins":["node"]},"os":["linux","darwin","win32"]}}
---
# Nuxt 3 Patterns
## Data Fetching
- `useFetch` deduplicates and caches requests during SSR β use it in components, not `$fetch` which fetches twice (server + client)
- `$fetch` is for event handlers and server routes only β in `<script setup>` it causes hydration mismatches
- `useFetch` runs on server during SSR β check `process.server` if you need client-only data
- Add `key` option to `useFetch` when URL params change but path stays same β without it, cache returns stale data
- `useLazyFetch` doesn't block navigation β use for non-critical data, but handle the pending state
## Hydration Traps
- `Date.now()` or `Math.random()` in templates cause hydration mismatches β compute once in setup or use `<ClientOnly>`
- Browser-only APIs (localStorage, window) crash SSR β wrap in `onMounted` or `process.client` check
- Conditional rendering based on client-only state mismatches β use `<ClientOnly>` component with fallback
- `v-if` with async data shows flash of wrong content β use `v-show` or skeleton states instead
## Auto-imports
- Components in `components/` auto-import with folder-based naming β `components/UI/Button.vue` becomes `<UIButton>`
- Composables in `composables/` must be named `use*` for auto-import β `utils.ts` exports won't auto-import
- Server utils in `server/utils/` auto-import in server routes only β not available in client code
- Disable auto-imports per-file with `// @ts-nocheck` or explicitly import to avoid naming collisions
## Server Routes
- Files in `server/api/` become API routes β `server/api/users.get.ts` handles GET /api/users
- Method suffix (`.get.ts`, `.post.ts`) is required for method-specific handlers β without it, handles all methods
- `getQuery(event)` for query params, `readBody(event)` for POST body β don't access `event.req` directly
- Return value is auto-serialized to JSON β throw `createError({ statusCode: 404 })` for errors
## State Management
- `useState` is SSR-safe and persists across navigation β regular `ref()` resets on each page
- `useState` key must be unique app-wide β collisions silently share state between components
- Pinia stores need `storeToRefs()` to keep reactivity when destructuring β without it, values lose reactivity
- Don't initialize state with browser APIs in `useState` default β it runs on server too
## Middleware
- Global middleware in `middleware/` with `.global.ts` suffix runs on every route β order is alphabetical
- Route middleware defined in `definePageMeta` runs after global β use for auth checks on specific pages
- `navigateTo()` in middleware must be returned β forgetting `return` continues to the original route
- Server middleware in `server/middleware/` runs on all server requests including API routes
## Configuration
- `runtimeConfig` for server secrets, `runtimeConfig.public` for client-safe values β env vars override with `NUXT_` prefix
- `app.config.ts` for build-time config that doesn't need env vars β it's bundled into the app
- `nuxt.config.ts` changes require restart β `app.config.ts` changes hot-reload
## SEO and Meta
- `useSeoMeta` for standard meta tags β type-safe and handles og:/twitter: prefixes automatically
- `useHead` for custom tags, scripts, and links β more flexible but no type safety for meta names
- Meta in `definePageMeta` is static β use `useSeoMeta` in setup for dynamic values
- `titleTemplate` in `nuxt.config` for consistent titles β `%s - My Site` pattern
## Plugins
- Plugins run before app creation β use `nuxtApp.hook('app:created')` for post-creation logic
- `provide` in plugins makes values available via `useNuxtApp()` β but composables are cleaner
- Plugin order: numbered prefixes (`01.plugin.ts`) run first, then alphabetical β dependencies need explicit ordering
- Client-only plugins: `.client.ts` suffix β server-only: `.server.ts` suffix
## Build and Deploy
- `nuxt generate` creates static files β but API routes won't work without a server
- `nuxt build` creates server bundle β deploy the `.output` directory
- ISR with `routeRules`: `'/blog/**': { isr: 3600 }` β caches pages for 1 hour
- Prerender specific routes: `routeRules: { '/about': { prerender: true } }` β builds static HTML at build time
---
name: nuxt-c95c0a8ee4bf
description: Build Vue 3 SSR/SSG applications with proper data fetching, hydration, and server patterns.
metadata: {"clawdbot":{"emoji":"π","requires":{"bins":["node"]},"os":["linux","darwin","win32"]}}
---
# Nuxt 3 Patterns
## Data Fetching
- `useFetch` deduplicates and caches requests during SSR β use it in components, not `$fetch` which fetches twice (server + client)
- `$fetch` is for event handlers and server routes only β in `<script setup>` it causes hydration mismatches
- `useFetch` runs on server during SSR β check `process.server` if you need client-only data
- Add `key` option to `useFetch` when URL params change but path stays same β without it, cache returns stale data
- `useLazyFetch` doesn't block navigation β use for non-critical data, but handle the pending state
## Hydration Traps
- `Date.now()` or `Math.random()` in templates cause hydration mismatches β compute once in setup or use `<ClientOnly>`
- Browser-only APIs (localStorage, window) crash SSR β wrap in `onMounted` or `process.client` check
- Conditional rendering based on client-only state mismatches β use `<ClientOnly>` component with fallback
- `v-if` with async data shows flash of wrong content β use `v-show` or skeleton states instead
## Auto-imports
- Components in `components/` auto-import with folder-based naming β `components/UI/Button.vue` becomes `<UIButton>`
- Composables in `composables/` must be named `use*` for auto-import β `utils.ts` exports won't auto-import
- Server utils in `server/utils/` auto-import in server routes only β not available in client code
- Disable auto-imports per-file with `// @ts-nocheck` or explicitly import to avoid naming collisions
## Server Routes
- Files in `server/api/` become API routes β `server/api/users.get.ts` handles GET /api/users
- Method suffix (`.get.ts`, `.post.ts`) is required for method-specific handlers β without it, handles all methods
- `getQuery(event)` for query params, `readBody(event)` for POST body β don't access `event.req` directly
- Return value is auto-serialized to JSON β throw `createError({ statusCode: 404 })` for errors
## State Management
- `useState` is SSR-safe and persists across navigation β regular `ref()` resets on each page
- `useState` key must be unique app-wide β collisions silently share state between components
- Pinia stores need `storeToRefs()` to keep reactivity when destructuring β without it, values lose reactivity
- Don't initialize state with browser APIs in `useState` default β it runs on server too
## Middleware
- Global middleware in `middleware/` with `.global.ts` suffix runs on every route β order is alphabetical
- Route middleware defined in `definePageMeta` runs after global β use for auth checks on specific pages
- `navigateTo()` in middleware must be returned β forgetting `return` continues to the original route
- Server middleware in `server/middleware/` runs on all server requests including API routes
## Configuration
- `runtimeConfig` for server secrets, `runtimeConfig.public` for client-safe values β env vars override with `NUXT_` prefix
- `app.config.ts` for build-time config that doesn't need env vars β it's bundled into the app
- `nuxt.config.ts` changes require restart β `app.config.ts` changes hot-reload
## SEO and Meta
- `useSeoMeta` for standard meta tags β type-safe and handles og:/twitter: prefixes automatically
- `useHead` for custom tags, scripts, and links β more flexible but no type safety for meta names
- Meta in `definePageMeta` is static β use `useSeoMeta` in setup for dynamic values
- `titleTemplate` in `nuxt.config` for consistent titles β `%s - My Site` pattern
## Plugins
- Plugins run before app creation β use `nuxtApp.hook('app:created')` for post-creation logic
- `provide` in plugins makes values available via `useNuxtApp()` β but composables are cleaner
- Plugin order: numbered prefixes (`01.plugin.ts`) run first, then alphabetical β dependencies need explicit ordering
- Client-only plugins: `.client.ts` suffix β server-only: `.server.ts` suffix
## Build and Deploy
- `nuxt generate` creates static files β but API routes won't work without a server
- `nuxt build` creates server bundle β deploy the `.output` directory
- ISR with `routeRules`: `'/blog/**': { isr: 3600 }` β caches pages for 1 hour
- Prerender specific routes: `routeRules: { '/about': { prerender: true } }` β builds static HTML at build time
Imported from the listed AgentSkill.sh category. Complete supplied package files and notices are retained. Required external tools and credentials are not installed. No bundled code was executed during import. Individual agent task behavior has not been tested.