Agent skill

Nuxt Data

by secondsky in secondsky/claude-skills

Nuxt 5 data management with useFetch, useAsyncData, useState, and Pinia.

MITAuto-check passedDevelopment

Install Nuxt Data

skills CLI
$ npx skills add secondsky/claude-skills --skill nuxt-data -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install secondsky/claude-skills nuxt-data --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/nuxt-v5/skills/nuxt-data .claude/skills/nuxt-data && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nuxt-data
GitHub stars
227
Token cost
~2.6k tokens
SKILL.md length
329 words
Files
4 (incl. references)
Skills in repo
169
Repo updated
First seen
Licence
MIT

At a glance

Nuxt 5 data management with useFetch, useAsyncData, useState, and Pinia.

  • Creating composables
  • SKILL.md covers Quick Reference, When to Load References, Composables and Data Fetching, plus 4 more sections
  • Runs TypeScript scripts from its folder; calls bun
  • Debugging reactive/SSR data issues

What it does

Nuxt Data is an agent skill from secondsky/claude-skills. Nuxt 5 data management with useFetch, useAsyncData, useState, and Pinia. Use when creating composables, fetching data, managing state, or debugging reactive/SSR data issues.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/composables.md`, `references/data-fetching.md` and `templates/composables/useAuth.ts`).

It sits in Development, covering State management and Debugging. It works with Nuxt. The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • Creating composables
  • Debugging reactive/SSR data issues

Example prompts

  • “/nuxt-data”

Requirements

  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit 8837836. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript), which the agent can run.

    Shell commands in SKILL.md call:

    • bun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nuxt Data loads about 2.6k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 46 tokens; SKILL.md has 329 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 329 words, ~2,605 tokens.

Download SKILL.mdSave it as .claude/skills/nuxt-data/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
nuxt-data
description
Nuxt 5 data management with useFetch, useAsyncData, useState, and Pinia. Use when creating composables, fetching data, managing state, or debugging reactive/SSR data issues.
license
MIT
metadata.version
5.0.0
metadata.author
Claude Skills Maintainers
metadata.category
Framework
metadata.framework
Nuxt
metadata.framework-version
5.x
metadata.last-verified
2026-03-30

Nuxt 5 Data Management

Composables, data fetching, and state management patterns for Nuxt 5 applications.

Use when: creating custom composables, fetching data with useFetch or useAsyncData, managing global state with useState, integrating Pinia, debugging reactive data issues, or implementing SSR-safe state patterns.

Quick Reference

Data Fetching Methods
MethodUse CaseSSRCachingReactive
useFetchSimple API callsYesYesYes
useAsyncDataCustom async logicYesYesYes
$fetchClient-side only, eventsNoNoNo

When to Load References

Load references/composables.md when:

  • Writing custom composables with complex state
  • Debugging state management issues or memory leaks
  • Implementing SSR-safe patterns with browser APIs
  • Building authentication or complex state composables

Load references/data-fetching.md when:

  • Implementing API data fetching with reactive parameters
  • Troubleshooting shallow vs deep reactivity issues
  • Debugging data not refreshing when params change
  • Implementing pagination, infinite scroll, or search

Composables

useState - The Foundation

useState creates SSR-safe, shared reactive state that persists across component instances.

typescript
// composables/useCounter.ts
export const useCounter = () => {
  const count = useState('counter', () => 0)

  const increment = () => count.value++
  const decrement = () => count.value--
  const reset = () => count.value = 0

  return { count, increment, decrement, reset }
}
useState vs ref - Critical Distinction
typescript
// CORRECT: Shared state (singleton pattern)
export const useAuth = () => {
  const user = useState('auth-user', () => null)
  return { user }
}

// WRONG: Creates new instance every call!
export const useAuth = () => {
  const user = ref(null)
  return { user }
}

Rule: Use useState for shared/global state. Use ref for local component state only.

clearNuxtState Resets to Defaults (v5 Change)
typescript
// Nuxt 5: clearNuxtState resets state to its initial value, not undefined
const count = useState('counter', () => 42)
count.value = 100

clearNuxtState('counter')
// count.value is now 42 (the initial default), not undefined
Complete Authentication Composable
typescript
// composables/useAuth.ts
export const useAuth = () => {
  const user = useState<User | null>('auth-user', () => null)
  const isAuthenticated = computed(() => !!user.value)
  const isLoading = useState('auth-loading', () => false)

  const login = async (email: string, password: string) => {
    isLoading.value = true
    try {
      const data = await $fetch('/api/auth/login', {
        method: 'POST',
        body: { email, password }
      })
      user.value = data.user
      return { success: true }
    } catch (error) {
      return { success: false, error: error.message }
    } finally {
      isLoading.value = false
    }
  }

  const logout = async () => {
    await $fetch('/api/auth/logout', { method: 'POST' })
    user.value = null
    navigateTo('/login')
  }

  const checkSession = async () => {
    if (import.meta.server) return
    try {
      const data = await $fetch('/api/auth/session')
      user.value = data.user
    } catch {
      user.value = null
    }
  }

  return { user, isAuthenticated, isLoading, login, logout, checkSession }
}
SSR-Safe Browser APIs
typescript
// composables/useLocalStorage.ts
export const useLocalStorage = <T>(key: string, defaultValue: T) => {
  const data = useState<T>(key, () => defaultValue)

  if (import.meta.client) {
    const stored = localStorage.getItem(key)
    if (stored) {
      data.value = JSON.parse(stored)
    }

    watch(data, (newValue) => {
      localStorage.setItem(key, JSON.stringify(newValue))
    }, { deep: true })
  }

  return data
}

Data Fetching

useFetch - Basic Usage
typescript
const { data, error, pending, refresh } = await useFetch('/api/users')

const { data: users } = await useFetch('/api/users', {
  method: 'GET',
  query: { limit: 10, offset: 0 },
  headers: { 'X-Custom-Header': 'value' }
})
Reactive Parameters
vue
<script setup lang="ts">
const page = ref(1)
const search = ref('')

const { data: users, pending } = await useFetch('/api/users', {
  query: {
    page,
    search,
    limit: 10
  }
})
</script>
Transform Data
typescript
const { data: userNames } = await useFetch('/api/users', {
  transform: (users) => users.map(u => u.name)
})
useAsyncData - Custom Logic
typescript
const { data } = await useAsyncData('dashboard', async () => {
  const [users, posts, stats] = await Promise.all([
    $fetch('/api/users'),
    $fetch('/api/posts'),
    $fetch('/api/stats')
  ])
  return { users, posts, stats }
})
Error Handling
typescript
const { data, error, status } = await useFetch('/api/users')

if (error.value) {
  console.error('Error:', error.value.message)
  console.error('Status:', error.value.statusCode)
}

if (status.value === 'error') {
  showError(error.value)
}
Manual Refresh
typescript
const { data, refresh, execute } = await useFetch('/api/users', {
  immediate: false
})

await execute()
await refresh()
await refresh({ dedupe: true })
Shallow vs Deep Reactivity
typescript
// Nuxt 5 default: Shallow reactivity
const { data } = await useFetch('/api/user')
data.value.name = 'New Name'  // Won't trigger reactivity!

// Enable deep reactivity for mutations
const { data } = await useFetch('/api/user', {
  deep: true
})
data.value.name = 'New Name'  // Now works!

// Or refresh instead of mutating
const { data, refresh } = await useFetch('/api/user')
await $fetch('/api/user', { method: 'PATCH', body: { name: 'New Name' } })
await refresh()
Caching and Deduplication
typescript
const { data } = await useFetch('/api/users', {
  key: 'users-list',
  dedupe: 'cancel',
  getCachedData: (key, nuxtApp) => {
    return nuxtApp.payload.data[key]
  }
})
Lazy Loading Data
typescript
const { data, pending } = useLazyFetch('/api/users')
const { data: data2, pending: pending2 } = useLazyAsyncData('users', () => $fetch('/api/users'))
$fetch - Client-Side Only
typescript
const submitForm = async () => {
  const result = await $fetch('/api/submit', {
    method: 'POST',
    body: formData.value
  })
}

State Management

Shared Cart Example
typescript
// composables/useCart.ts
interface CartItem {
  id: string
  name: string
  price: number
  quantity: number
}

export const useCart = () => {
  const items = useState<CartItem[]>('cart-items', () => [])

  const total = computed(() =>
    items.value.reduce((sum, item) => sum + item.price * item.quantity, 0)
  )

  const addItem = (product: Omit<CartItem, 'quantity'>) => {
    const existing = items.value.find(i => i.id === product.id)
    if (existing) {
      existing.quantity++
    } else {
      items.value.push({ ...product, quantity: 1 })
    }
  }

  const removeItem = (id: string) => {
    items.value = items.value.filter(i => i.id !== id)
  }

  const clearCart = () => {
    items.value = []
  }

  return { items, total, addItem, removeItem, clearCart }
}
Pinia Integration
bash
bun add pinia @pinia/nuxt
typescript
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@pinia/nuxt']
})

// stores/auth.ts
import { defineStore } from 'pinia'

export const useAuthStore = defineStore('auth', {
  state: () => ({
    user: null as User | null,
    token: null as string | null
  }),

  getters: {
    isAuthenticated: (state) => !!state.user,
    userName: (state) => state.user?.name ?? 'Guest'
  },

  actions: {
    async login(email: string, password: string) {
      const { user, token } = await $fetch('/api/auth/login', {
        method: 'POST',
        body: { email, password }
      })
      this.user = user
      this.token = token
    },

    logout() {
      this.user = null
      this.token = null
    }
  }
})

Common Anti-Patterns

Using ref Instead of useState
typescript
// WRONG
export const useAuth = () => {
  const user = ref(null)
  return { user }
}

// CORRECT
export const useAuth = () => {
  const user = useState('auth-user', () => null)
  return { user }
}
Non-Deterministic Transform
typescript
// WRONG - Causes hydration mismatch!
const { data } = await useFetch('/api/users', {
  transform: (users) => users.sort(() => Math.random() - 0.5)
})

// CORRECT
const { data } = await useFetch('/api/users', {
  transform: (users) => users.sort((a, b) => a.name.localeCompare(b.name))
})
Mutating Shallow Refs
typescript
// WRONG
const { data } = await useFetch('/api/user')
data.value.name = 'New Name'

// CORRECT - Enable deep
const { data } = await useFetch('/api/user', { deep: true })

// CORRECT - Replace entire value
data.value = { ...data.value, name: 'New Name' }

// CORRECT - Refresh after mutation
await $fetch('/api/user', { method: 'PATCH', body: { name: 'New Name' } })
await refresh()

Troubleshooting

Data Not Refreshing When Params Change:

  • Ensure params are reactive: { query: { page } } where page = ref(1)
  • Check you're using the ref itself, not .value

Hydration Mismatch with useState:

  • Ensure key is unique: useState('unique-key', () => value)
  • Avoid Math.random() or Date.now() in initial values

State Lost on Navigation:

  • Use useState instead of ref for persistent state

clearNuxtState not working as expected:

  • v5 resets to initial default value, not undefined
  • Check that the initial factory function returns the expected default
  • nuxt-core: Project setup, routing, configuration
  • nuxt-server: Server routes, API patterns (Nitro v3)
  • nuxt-production: Performance, testing, deployment

Version: 5.0.0 | Last Updated: 2026-03-30 | License: MIT

© secondsky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in plugins/nuxt-v5/skills/nuxt-data of secondsky/claude-skills.

  • SKILL.md
  • references/composables.md
  • references/data-fetching.md
  • templates/composables/useAuth.ts

Open the folder on GitHubat commit 8837836

Compare with similar skills

Nuxt Data next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nuxt Data compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nuxt Data this skillsecondsky/claude-skills227—~2.6kAutomated safety check: PassMIT
Vue PiniaMindrally/skills268—~2.4kAutomated safety check: PassApache-2.0
PiniaJetBrains/skills3649 repos~682Automated safety check: PassNone
Asyncredux Observersmarcglasberg/async_redux238—~3.4kAutomated safety check: PassCustom licence
Bug Finder for daisyUIsaadeghi/daisyui43k—~2.3kAutomated safety check: PassMIT
AO Desktop App LauncherOrchestratorInc/agent-orchestrator13k—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • Vue Pinia

    Mindrally/skills

    Vue 3 state management with Pinia using the Composition API, covering setup stores, SSR/Nuxt integration, persistence, and testing.

    268 GitHub stars~2.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Pinia

    JetBrains/skills

    Official

    Pinia official Vue state management library, type-safe and extensible.

    364 GitHub starsUsed in 9 repos~682 tokens
    Frontend & DesignAuto-check passed
  • Asyncredux Observers

    marcglasberg/async_redux

    Set up observers for debugging and monitoring. An agent skill from marcglasberg/async_redux.

    238 GitHub stars~3.4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Bug Finder for daisyUI

    saadeghi/daisyui

    Investigates suspected bugs in the daisyUI monorepo through read-only analysis, then writes a decision-ready fix plan in tmp/bugs without changing any product code.

    43k GitHub stars~2.3k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • AO Desktop App Launcher

    OrchestratorInc/agent-orchestrator

    Launches, restarts and troubleshoots the real AO Electron desktop app from a checkout, with isolated or real local data and checks for stale processes.

    13k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Analyzes Chrome or Electron DevTools Performance trace exports with Python scripts to find where render time actually goes, without opening DevTools.

    9.3k GitHub stars~809 tokensUpdated today
    DevelopmentAuto-check passed

More from secondsky/claude-skills

All 169 skills in this repo
  • Tanstack AI

    secondsky/claude-skills

    TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.

    227 GitHub starsUsed in 1 repo~3.6k tokens
    Auto-check: notes
  • Auto Animate

    secondsky/claude-skills

    AutoAnimate (@formkit/auto-animate) zero-config animations for React.

    227 GitHub stars~2.9k tokensUpdated 10 days ago
    Auto-check passed
  • Base UI React

    secondsky/claude-skills

    MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.

    227 GitHub stars~1.9k tokensUpdated 10 days ago
    Auto-check passed
  • Cloudflare Images

    secondsky/claude-skills

    This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…

    227 GitHub stars~3.6k tokensUpdated 10 days ago
    Auto-check: notes
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 10 days ago
    Auto-check: notes
  • Cloudflare Sandbox

    secondsky/claude-skills

    Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.

    227 GitHub stars~4.5k tokensUpdated 10 days ago
    Auto-check passed

Works with

Questions about Nuxt Data

What does Nuxt Data do?

Nuxt 5 data management with useFetch, useAsyncData, useState, and Pinia. Nuxt Data is an agent skill from secondsky/claude-skills. Nuxt 5 data management with useFetch, useAsyncData, useState, and Pinia.

When should I use Nuxt Data?

Nuxt Data fits situations like: creating composables; debugging reactive/SSR data issues.

How do I install Nuxt Data in Claude Code?

Run `npx skills add secondsky/claude-skills --skill nuxt-data -a claude-code`. Or copy the skill folder (plugins/nuxt-v5/skills/nuxt-data in secondsky/claude-skills) into .claude/skills/nuxt-data in your project. Claude Code loads it when a task matches its description.

How do I install Nuxt Data in Codex?

Run `npx skills add secondsky/claude-skills --skill nuxt-data -a codex`. Or copy the skill folder (plugins/nuxt-v5/skills/nuxt-data in secondsky/claude-skills) into .agents/skills/nuxt-data in your project. Codex loads it when a task matches its description.

Can I use Nuxt Data in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secondsky/claude-skills --skill nuxt-data -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nuxt-data, .gemini/skills/nuxt-data, .github/skills/nuxt-data and .opencode/skills/nuxt-data in your project.

What does Nuxt Data need to run?

Going by SKILL.md and its folder, Nuxt Data needs TypeScript for the scripts in its folder and the command-line tools its instructions call (bun). Our summary lists: Node.js.

Does Nuxt Data access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Nuxt Data safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Nuxt Data use?

Nuxt Data is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nuxt Data use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.2k tokens, read only when the agent opens those files.

What are the alternatives to Nuxt Data?

Skills that share tags, products or a category with Nuxt Data: Vue Pinia (Mindrally/skills, 268 stars), Pinia (JetBrains/skills, 364 stars), Asyncredux Observers (marcglasberg/async_redux, 238 stars) and Bug Finder for daisyUI (saadeghi/daisyui, 43k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nuxt Data?

secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.

Source: secondsky/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.