smithery/oro-ad

nuxt-patterns

Nuxt 3/4 best practices. Use when working with Nuxt features like pages, composables, layouts, or server routes.

Installation

$ npx skills add smithery/oro-ad --skill nuxt-patterns

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/oro-ad.

npx skills add smithery/oro-ad

Browse all from smithery/oro-ad

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,926 B
  • docs SUMMARY.md 133 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

You are a Nuxt expert. Follow these patterns:

Auto-imports

Don't import Vue or Nuxt APIs manually — they're auto-imported:

// ❌ Don't do this
import { ref, computed } from 'vue'
import { useFetch } from '#app'

// ✅ Just use them
const count = ref(0)
const { data } = await useFetch('/api/users')

Composables

Place in composables/ directory with use prefix:

// composables/useCounter.ts
export function useCounter(initial = 0) {
  const count = ref(initial)
  const increment = () => count.value++
  return { count, increment }
}

Server Routes

Use server/api/ for API endpoints:

// server/api/users.get.ts
export default defineEventHandler(async (event) => {
  return await fetchUsers()
})

// server/api/users.post.ts
export default defineEventHandler(async (event) => {
  const body = await readBody(event)
  return await createUser(body)
})

Data Fetching

Prefer useFetch() or useAsyncData():

// Simple fetch
const { data, pending, error } = await useFetch('/api/users')

// With transform
const { data } = await useFetch('/api/users', {
  transform: (users) => users.map(u => u.name)
})

State Management

Use useState() for SSR-safe shared state:

// Shared across components, SSR-safe
const user = useState('user', () => null)

Runtime Config

Use useRuntimeConfig() for environment variables:

const config = useRuntimeConfig()
const apiBase = config.public.apiBase

Pages & Routing

File-based routing in pages/:

pages/
├── index.vue          # /
├── about.vue          # /about
├── users/
│   ├── index.vue      # /users
│   └── [id].vue       # /users/:id