vue_skill

This skill helps you develop Vue 3 components and composables by applying Composition API patterns, props/emits guidance, and VueUse integration.
  • TypeScript

431

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill onmax/nuxt-skills --skill vue

  • SKILL.md3.2 KB

Overview

This skill provides practical guidance for editing .vue files, building Vue 3 components, authoring composables, and testing Vue code with modern Composition API patterns. It focuses on pragmatic patterns: props and emits best practices, VueUse integration, reactive destructuring, and TypeScript-aware component design. Use it to write clear, testable, and performant Vue 3 code.

How this skill works

The skill inspects the current file context and recommends focused guidance based on file type: components, composables, utils, tests, TypeScript patterns, or router code. It suggests only the single relevant reference to load for the task to minimize context usage and avoid unrelated suggestions. For each area it offers concrete patterns, lifecycle and reactivity tips, and testing setups (Vitest + @vue/test-utils).

When to use it

  • Editing .vue component files in components/
  • Creating reusable composables (use* functions)
  • Building client-side utilities or formatters
  • Writing unit tests or composable tests (.spec.ts/.test.ts)
  • Refactoring props/emits or integrating VueUse patterns
  • Adding TypeScript typings for components or routes

Best practices

  • Load a single focused reference for the file type to avoid noisy context
  • Prefer reactive destructuring with toRef/toRefs to keep reactivity predictable
  • Define props and emits explicitly; use defineEmits/defineProps and typed interfaces for clarity
  • Integrate VueUse composables for common utilities rather than reinventing them
  • Use Vitest with @vue/test-utils for component and composable tests and mock router behavior when needed
  • Keep utils pure and well-typed; avoid coupling utils to Vue reactivity unless necessary

Example use cases

  • Convert an Options API component to Vue 3 Composition API with typed props and emits
  • Create a composable that wraps VueUse state and lifecycle hooks for reuse across components
  • Write unit tests for a component that uses router navigation and mock route params
  • Refactor a utility in utils/ into a pure, tested function and call it from a component
  • Implement typed route params and navigation guards with unplugin-vue-router patterns

FAQ

No. Use this skill for client-side Vue 3 work. For Nuxt server routes, middleware, or file-based routing, use a Nuxt-focused reference instead.

How do I handle reactive destructuring safely?

Use toRef or toRefs when destructuring props or reactive objects so reactivity is preserved. Avoid plain object destructuring on refs unless you wrap values back into refs.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational