ai-infrastructure-hugg…
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
Nuxt patterns - file-based routing, data fetching (useFetch/useAsyncData), useState, server routes, middleware, auto-imports, layouts, SEO
$ npx -y skills add agents-inc/skills --skill web-meta-framework-nuxt --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/web-meta-framework-nuxtContext preview
The summary Claude sees to decide when to auto-load this skill.
Nuxt patterns - file-based routing, data fetching (useFetch/useAsyncData), useState, server routes, middleware, auto-imports, layouts, SEO
name: web-meta-framework-nuxt description: Nuxt patterns - file-based routing, data fetching (useFetch/useAsyncData), useState, server routes, middleware, auto-imports, layouts, SEO
> **Quick Guide:** `useFetch` for an API call in a component, `useAsyncData` for a custom source or > several fetches combined — both transfer the server's result to the client so nothing is fetched > twice. Server routes live in `server/api/`, shared state in `useState`, and composables and > components are auto-imported. Two facts change the answers below: `data` is a `shallowRef`, so > replace the object rather than mutating into it (or pass `deep: true`), and `data` and `error` > default to `undefined` rather than `null`.
**Detailed Resources:**
---
[examples/core.md](examples/core.md).
is options on them; follow [examples/data-fetching.md](examples/data-fetching.md).
utilities; follow [examples/server-routes.md](examples/server-routes.md).
[examples/middleware.md](examples/middleware.md).
---
<critical_requirements>
**Fetch through `useFetch` or `useAsyncData` rather than a bare `$fetch` in `<script setup>`.** Both carry the server's payload into hydration; a bare `$fetch` there runs twice, once per environment.
**Put API routes in `server/api/` and export a `defineEventHandler()` as the default.** The file suffix (`.get.ts`, `.post.ts`) is what restricts the method, and the directory is what adds the `/api` prefix.
**Attach middleware and page options through `definePageMeta`.** It is a compile-time macro, so its argument has to be statically analysable — no variables, no computed keys.
**Set metadata with `useHead` or `useSeoMeta`.** Both render server-side and merge with the defaults in `nuxt.config.ts`, which hand-written `<head>` markup does not.
**Keep `useState` values JSON-serializable.** The value is serialised into the HTML and revived on the client, so a function, class instance or Symbol breaks hydration.
**Read `to` and `from` inside route middleware rather than calling `useRoute()`.** The route object has not been committed yet at that point, so `useRoute()` answers with the previous route.
</critical_requirements>
---
**Auto-detection:** nuxt.config.ts, defineNuxtConfig, useFetch, useAsyncData, useState, useCookie, useRuntimeConfig, useNuxtApp, defineEventHandler, definePageMeta, defineNuxtRouteMiddleware, defineNuxtPlugin, navigateTo, abortNavigation, createError, clearError, showError, useHead, useSeoMeta, NuxtLayout, NuxtPage, NuxtLink, NuxtErrorBoundary, server/api, $fetch, h3, import.meta.client, import.meta.server
**Applies to:**
**Handled elsewhere:**
here
separate choice
deliberately does not provide
---
<philosophy>
Nuxt is a meta-framework for Vue 3: file-based routing, automatic code splitting, server-side rendering, and a data-fetching layer that knows about hydration. It runs on the Nitro server engine, so API routes live in the same project as the pages that call them.
Five ideas explain most of the API surface:
1. **Universal rendering by default** — a page renders on the server first, then hydrates 2. **Auto-imports** — composables, components and utilities are available without an import line, so an unfamiliar `useX` is usually Nuxt's own 3. **File-based conventions** — `pages/`, `server/`, `layouts/`, `middleware/` each mean something 4. **Hydration-aware fetching** — the composables exist because the naive fetch runs twice 5. **Shallow reactivity** — `data` is a `shallowRef`; deep tracking is a cost Nuxt does not pay by default
</philosophy>
---
<patterns>
File names in `pages/` become URL paths, and bracket depth chooses the kind of segment.
| File | URL | | ---------------------------- | ------------------------ | | `pages/index.vue` | `/`
The official skills marketplace for Agents Inc. 150+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?
Repo: agents-inc/skills
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking, virtual keys, and production…
Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client patterns
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and…
Replicate SDK patterns for TypeScript/Node.js -- client setup, predictions, streaming, webhooks, file handling, model versioning, deployments, and training
Together AI SDK patterns for TypeScript — client setup, chat completions, streaming, structured output, function calling, embeddings, image generation,…