From nuxt-modern-dev
Use when writing Vue 3 components or composables, choosing Options vs Composition API, handling reactivity, provide/inject, or script setup patterns.
How this skill is triggered — by the user, by Claude, or both
Slash command
/nuxt-modern-dev:vue3-compositionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Baseline:** Vue 3 Composition API with `<script setup lang="ts">`. Confirm the exact Vue version from the repository lockfile.
Baseline: Vue 3 Composition API with <script setup lang="ts">. Confirm the exact Vue version from the repository lockfile.
| ALWAYS | NEVER |
|---|---|
<script setup lang="ts"> for new components | Options API for new code |
Composables named useXxx, return object | Return bare refs without naming |
readonly() for state consumers must not mutate | Mutate props |
| Tailwind utilities for styling | Scoped CSS / inline styles (see tailwindcss4) |
composables/useXxx.tsprovide / inject with typed keysref / reactive in the componentnuxt4-frontend (useFetch / useAsyncData)<script setup lang="ts">
interface Props {
title: string
count?: number
}
const props = withDefaults(defineProps<Props>(), { count: 0 })
const emit = defineEmits<{ save: [id: string] }>()
const open = ref(false)
</script>
<template>
<section class="space-y-2">
<h2 class="text-lg font-semibold">{{ props.title }}</h2>
<button class="rounded-lg bg-slate-900 px-3 py-2 text-white" @click="open = !open">
Toggle
</button>
</section>
</template>
// composables/useToggle.ts
export function useToggle(initial = false) {
const on = ref(initial)
function toggle() {
on.value = !on.value
}
return { on: readonly(on), toggle }
}
props → lose reactivity unless toRefs / storeToRefsreactive + reassignment → prefer ref for reassignable stateawait in Nuxt → prefer Nuxt async data APIs| When | Read |
|---|---|
| Nuxt-specific structure / data | nuxt4-frontend skill |
| Styling | tailwindcss4 skill |
npx claudepluginhub pstuart/pstuart --plugin nuxt-modern-devProvides Vue 3 Composition API patterns, component architecture, and testing practices. Use when editing .vue files, creating composables, or testing Vue code.
Guides Vue.js 3 development with Composition API patterns, component architecture, Pinia state management, Vue Router navigation, and Nuxt SSR patterns. Activates for Vue, Nuxt, Vite, or Pinia projects.
Provides Vue 3 Composition API guidance on setup(), script setup syntax, ref vs reactive for scalable, maintainable apps.