agentleFS
Aarvion-AIAarvion-AI/stackwise-skills/skills/vue-expert/SKILL.md

vue-expert

Skill5 starsChanged 3 months agoMITView on GitHub

Use when working with .vue single-file components, nuxt.config.ts, vite.config.ts with @vitejs/plugin-vue, Pinia stores, or tasks mentioning Vue, Vue 3, Nuxt, Composition API, script setup, ref/reactive, composables, useFetch, or SSR hydration. Builds Vue 3.5+/Nuxt 4 features, designs composables and Pinia setup stores, debugs reactivity and hydration bugs, and writes Vitest + Vue Testing Library tests. Invoke for component implementation, state management, Nuxt server routes, reactivity debugging, SSR fixes, and component testing.

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use mcp-developer, csharp-developer and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JeffallanSkill

    mcp-developer

    Use when building, debugging, or extending MCP servers or clients that connect AI systems with external tools and data sources. Invoke to implement tool handlers, configure resource providers, set up stdio/HTTP/SSE transport layers, validate schemas with Zod or Pydantic, debug protocol compliance issues, or scaffold complete MCP server/client projects using TypeScript or Python SDKs.

    Also in 6 projects that use this

  • JeffallanSkill

    csharp-developer

    Use when building C# applications with .NET 8+, ASP.NET Core APIs, or Blazor web apps. Builds REST APIs using minimal or controller-based routing, configures database access with Entity Framework Core, implements async patterns and cancellation, structures applications with CQRS via MediatR, and scaffolds Blazor components with state management. Invoke for C#, .NET, ASP.NET Core, Blazor, Entity Framework, EF Core, Minimal API, MAUI, SignalR.

    Also in 7 projects that use this

  • +9 more from Jeffallan

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create or refactor Pinia stores (setup-store style) and wire them into components

    line 21
  2. Very specific:

    Add Nuxt 4 pages, layouts, middleware, or Nitro server routes (server/api/)

    line 22
  3. Distinctive:

    Write component and composable tests with Vitest + Vue Testing Library

    line 25
  4. Very specific:

    Verify types and lint: - Run pnpm vue-tsc --noEmit (or pnpm nuxi typecheck in Nuxt) and pnpm eslint ..

    line 31
  5. Very specific:

    Test: - Write or update Vitest + Vue Testing Library tests for the change (render, interact via @testing-library/user-event, assert on the …

    line 32
  6. Very specific:

    Prove it works: - Run the dev server (pnpm dev) and exercise the changed flow, or for Nuxt SSR changes run pnpm build && node …

    line 33

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Vue Expert

Turns Claude into a senior Vue 3.5+/Nuxt 4 engineer who writes idiomatic <script setup lang="ts"> code, designs reactive state that survives SSR, and never ships Options API or Vue 2 idioms.

When to Use This Skill

  • Build or modify Vue single-file components (.vue) with Composition API and TypeScript
  • Design composables (useX) with correct reactivity, cleanup, and SSR safety
  • Create or refactor Pinia stores (setup-store style) and wire them into components
  • Add Nuxt 4 pages, layouts, middleware, or Nitro server routes (server/api/)
  • Debug reactivity bugs: lost reactivity from destructuring, stale watchers, shallowRef misuse
  • Fix SSR/hydration mismatches and data-fetching duplication in Nuxt
  • Write component and composable tests with Vitest + Vue Testing Library

Core Workflow

  1. Analyze - Inspect the project before writing anything: check package.json for Vue/Nuxt/Pinia versions, whether it is a Nuxt app (nuxt.config.ts) or plain Vite SPA, auto-import config, existing composable/store conventions, and the test runner setup (vitest.config.ts, existing *.spec.ts). Match existing directory conventions (app/ vs src/ in Nuxt 4).
  2. Implement - Write <script setup lang="ts"> only. Use defineProps/defineEmits with type-only declarations, defineModel() for two-way binding, ref/computed for state, composables for shared logic, Pinia setup stores for app state. In Nuxt, fetch data with useFetch/useAsyncData (never bare $fetch in setup) and put API logic in Nitro routes under server/. Load the matching reference file from the Reference Guide before writing unfamiliar patterns.
  3. Verify types and lint - Run pnpm vue-tsc --noEmit (or pnpm nuxi typecheck in Nuxt) and pnpm eslint .; fix all reported issues and re-run until clean before proceeding.
  4. Test - Write or update Vitest + Vue Testing Library tests for the change (render, interact via @testing-library/user-event, assert on the DOM). Run pnpm vitest run; fix all failures and re-run until clean before proceeding.
  5. Prove it works - Run the dev server (pnpm dev) and exercise the changed flow, or for Nuxt SSR changes run pnpm build && node .output/server/index.mjs and confirm no hydration warnings in the console. If anything fails, fix it and re-verify (steps 3-4) until clean.

Reference Guide

Load detailed guidance only when the task needs it:

TopicReferenceLoad When
Script setup, props/emits/defineModel, ref vs reactive vs shallowRef, composables designreferences/composition-api.mdWriting or reviewing any .vue component or useX composable
Pinia setup stores, storeToRefs, SSR state, testing storesreferences/state-pinia.mdTask touches app-level state, a stores/ directory, or defineStore
Nuxt 4 structure, useFetch/useAsyncData, Nitro server routes, middleware, runtime configreferences/nuxt-patterns.mdProject has nuxt.config.ts or task mentions Nuxt, server routes, or data fetching
Reactivity edge cases: destructuring, watch vs watchEffect, hydration mismatchesreferences/reactivity-pitfalls.mdDebugging "not updating"/"fires twice"/hydration warnings, or writing watchers
Vitest + Vue Testing Library setup, component/composable/Nuxt testingreferences/testing.mdWriting or fixing any test for Vue/Nuxt code

Key Patterns

Typed props with defaults and defineModel (Vue 3.5+) - no withDefaults needed; props can be destructured reactively:

<script setup lang="ts">
const { label, size = 'md' } = defineProps<{ label: string; size?: 'sm' | 'md' | 'lg' }>()
const modelValue = defineModel<string>({ required: true })
const emit = defineEmits<{ submit: [value: string] }>()
</script>

<template>
  <input v-model="modelValue" :placeholder="label" @keyup.enter="emit('submit', modelValue)" />
</template>

Composable returning refs, with cleanup - return plain refs (not a reactive bag), accept MaybeRefOrGetter, clean up with onScopeDispose:

import { ref, toValue, watchEffect, onScopeDispose, type MaybeRefOrGetter } from 'vue'

export function useEventSource(url: MaybeRefOrGetter<string>) {
  const data = ref<string | null>(null)
  const status = ref<'connecting' | 'open' | 'closed'>('connecting')
  let es: EventSource | undefined

  watchEffect(() => {
    es?.close()
    es = new EventSource(toValue(url))
    es.onmessage = (e) => (data.value = e.data)
    es.onopen = () => (status.value = 'open')
  })
  onScopeDispose(() => es?.close())

  return { data, status }
}

Pinia setup store - ref = state, computed = getters, functions = actions; always return everything used outside:

export const useCartStore = defineStore('cart', () => {
  const items = ref<CartItem[]>([])
  const total = computed(() => items.value.reduce((s, i) => s + i.price * i.qty, 0))
  async function add(productId: string) {
    const item = await $fetch<CartItem>(`/api/cart/${productId}`, { method: 'POST' })
    items.value.push(item)
  }
  return { items, total, add }
})

Nuxt data fetching + typed server route - types flow from the Nitro handler to the client automatically:

// server/api/products/[id].get.ts
export default defineEventHandler(async (event) => {
  const id = getRouterParam(event, 'id')
  const product = await db.product.findUnique({ where: { id } })
  if (!product) throw createError({ statusCode: 404, statusMessage: 'Not found' })
  return product
})
<script setup lang="ts">
const route = useRoute()
const { data: product, status, error } = await useFetch(`/api/products/${route.params.id}`)
</script>

Common Mistakes

  • Destructuring reactive() or a store kills reactivity. const { count } = reactive(...) or const { items } = useCartStore() yields dead plain values. Use toRefs/storeToRefs for state - but destructure actions directly (they are plain functions). Props destructured from defineProps ARE reactive in 3.5+, but only inside the same <script setup>; pass a getter (() => size) when handing them to watch or a composable.
  • ref vs reactive vs shallowRef chosen wrong. Default to ref for everything, including objects (.value is uniform and survives reassignment). reactive cannot be reassigned or destructured - reserve it for a fixed-shape local object you never replace. Use shallowRef for large immutable payloads (API responses, editor/map instances) and trigger updates by replacing .value wholesale; mutating deep properties of a shallowRef silently does nothing.
  • watch given a .value or plain property watches nothing. watch(count.value, ...) and watch(props.id, ...) pass a snapshot. Watch the ref itself (watch(count, ...)) or a getter (watch(() => props.id, ...)). Prefer watch with explicit sources over watchEffect for async work - watchEffect only tracks dependencies read before the first await.
  • Fetching in Nuxt with bare $fetch in setup double-fetches. It runs on the server and again on the client with no payload transfer. Use useFetch/useAsyncData in components; use $fetch only inside event handlers and server code.
  • Options API, Vue.observable, mixins, this.$emit, filters - Vue 2/Options idioms that dominate training data. Do not emit them in new code; only touch them in explicit migration tasks (map data to refs, computed options to computed(), mixins to composables).
  • Hydration mismatch from browser-only or random values in render. Date.now(), Math.random(), window.*, or locale-dependent formatting in templates renders differently on server and client. Gate with <ClientOnly>, useId() for stable IDs, or compute in onMounted.
  • Testing implementation details via wrapper.vm or shallow mounting. With Vue Testing Library, query by role/text as a user would, use @testing-library/user-event, and await the interaction; assert emitted events via emitted() only when the DOM cannot show the outcome.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.