Build type-safe Nuxt 3 applications with Nitro API patterns. Covers validation, fetch patterns, auth, SSR, composables, background tasks, and real-time features.
View on GitHubgallop-systems/claude-skills
all
skills/nuxt-nitro-api/SKILL.md
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/gallop-systems/claude-skills/blob/main/skills/nuxt-nitro-api/SKILL.md -a claude-code --skill nuxt-nitro-apiInstallation paths:
.claude/skills/nuxt-nitro-api/# Nuxt 3 / Nitro API Patterns This skill provides patterns for building type-safe Nuxt 3 applications with Nitro backends. ## When to Use This Skill Use this skill when: - Working in a Nuxt 3 project with TypeScript - Building API endpoints with Nitro - Implementing authentication with nuxt-auth-utils - Handling SSR + client-side state - Creating background tasks or real-time features ## Reference Files For detailed patterns, see these topic-focused reference files: - [validation.md](./validation.md) - Zod validation with h3, Standard Schema, error handling - [fetch-patterns.md](./fetch-patterns.md) - useFetch vs $fetch vs useAsyncData - [auth-patterns.md](./auth-patterns.md) - nuxt-auth-utils, OAuth, WebAuthn, middleware - [page-structure.md](./page-structure.md) - Keep pages thin, components do the work - [composables-utils.md](./composables-utils.md) - When to use composables vs utils - [ssr-client.md](./ssr-client.md) - SSR + localStorage, hydration, VueUse - [deep-linking.md](./deep-linking.md) - URL params sync with filters and useFetch - [nitro-tasks.md](./nitro-tasks.md) - Background jobs, scheduled tasks, job queues - [sse.md](./sse.md) - Server-Sent Events for real-time streaming - [server-services.md](./server-services.md) - Third-party service integration patterns ## Example Files Working examples from a Nuxt project: - [validation-endpoint.ts](./examples/validation-endpoint.ts) - API endpoint with Zod validation - [auth-middleware.ts](./examples/auth-middleware.ts) - Server auth middleware - [auth-utils.ts](./examples/auth-utils.ts) - Reusable auth helpers - [deep-link-page.vue](./examples/deep-link-page.vue) - URL params sync with filters - [sse-endpoint.ts](./examples/sse-endpoint.ts) - SSE streaming endpoint - [service-util.ts](./examples/service-util.ts) - Server-side service pattern ## Core Principles 1. **Let Nitro infer types** - Never add manual type params to `$fetch<Type>()` or `useFetch<Type>()` 2. **Use h3 validation** - `getValid