vue-patterns

Enforce Vue 3 Composition API policies for components and composables.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/cooldaemon/dotfiles --skill vue-patterns-cooldaemon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-patterns
Source: https://github.com/cooldaemon/dotfiles/tree/main/.claude/skills/vue-patterns
Command: npx skills add https://github.com/cooldaemon/dotfiles --skill vue-patterns-cooldaemon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides clear, actionable guidelines and best practices for writing modern Vue 3 applications using the Composition API, ensuring maintainable, performant, and scalable code.

Core Features & Use Cases

  • Component Policies: Enforces type-safe props, named emits, and the use of defineModel for two-way binding.
  • State Management: Recommends ref over reactive and emphasizes using InjectionKey with provide/inject.
  • Reactivity & Performance: Guides on watch vs. watchEffect, using shallowRef for large objects, and performance optimizations like defineAsyncComponent and v-memo.
  • Anti-Patterns: Highlights common mistakes and provides correct alternatives.
  • Use Case: A developer starting a new Vue 3 project can use this Skill to establish a consistent coding standard for their team, preventing common pitfalls and improving code quality from the outset.

Quick Start

Apply the Vue 3 Composition API best practices to the provided code snippet.

Frequently Asked Questions about vue-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the Vue 3 Composition API best practices for defining components?

Vue 3 Composition API best practices enforce type-safe props, named emits, and defineModel for two-way binding. Following these policies ensures robust, maintainable component definitions and prevents common anti-patterns.

How do I manage state in Vue 3 using ref and reactive?

State management in Vue 3 should prefer ref over reactive for consistency. It also emphasizes using InjectionKey with provide and inject to maintain type safety across your component hierarchy.

When should I use watch vs watchEffect in Vue 3?

Use watch vs watchEffect in Vue 3 based on dependency tracking needs. watch explicitly specifies dependencies, while watchEffect auto-tracks them. The Skill guides proper usage to optimize reactivity and performance.

How do I optimize Vue 3 performance for large objects and components?

Optimize Vue 3 performance by using shallowRef for large objects, defineAsyncComponent for lazy loading, and v-memo for template caching. These techniques reduce unnecessary reactivity overhead and rendering costs.

What are common Vue 3 Composition API anti-patterns to avoid?

Common Vue 3 Composition API anti-patterns include improper reactivity usage and untyped component definitions. This Skill highlights these frequent mistakes and provides correct alternatives to ensure code quality.

Can I use these Vue Composition API policies for a new TypeScript project?

Yes, you can apply these Vue Composition API policies to a new TypeScript project. They establish a consistent coding standard for your team, preventing common pitfalls and improving code quality from the outset.