vue-best-practices

Consolidate Vue 3 best practices into a browsable reference guide.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/jd-solanki/lekhan-internal-sync --skill vue-best-practices-jd-solanki
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-best-practices
Source: https://github.com/jd-solanki/lekhan-internal-sync/tree/main/.agents/skills/vue-best-practices
Command: npx skills add https://github.com/jd-solanki/lekhan-internal-sync --skill vue-best-practices-jd-solanki

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vue.js projects often suffer from inconsistent patterns, scattered best practices, and maintenance gaps as teams scale. This Skill codifies a cohesive set of Vue 3 patterns and conventions to improve reliability, readability, and performance.

Core Features & Use Cases

  • Composition API guidance: <script setup>, typed TS, and composables for modular logic.
  • Reactivity and state management: best practices for ref vs reactive, computed, watchers, and readonly state.
  • Component design patterns: proper emit naming, prop validation, provide/inject, and lifecycle usage; SSR-ready patterns; KeepAlive and dynamic components usage.
  • Performance optimization: avoid mutating computed values, proper key usage, and compact composition code organization.

Quick Start

To align an existing Vue project with these guidelines:

  • Audit all major Vue components for setup script usage and composition-based patterns.
  • Refactor key components to use Composition API and composables where appropriate.
  • Integrate reference docs into CI checks to enforce consistency.

Frequently Asked Questions about vue-best-practices

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

FAQPage Schema
What are the best practices for Vue 3 Composition API and script setup?

Vue 3 Composition API best practices involve using <script setup> for concise syntax, applying typed TypeScript, and isolating modular logic into reusable composables to improve component readability and maintainability.

How do I choose between ref and reactive for Vue 3 state management?

Choosing between ref and reactive in Vue 3 depends on your state structure; use refs for primitives and reactive for objects, while leveraging computed properties and readonly state to enforce reactivity and prevent unintended mutations.

How do I structure Vue 3 components for SSR readiness and KeepAlive usage?

Structure Vue 3 components for SSR readiness by following proper emit naming, prop validation, and provide/inject patterns, and use KeepAlive with dynamic components to cache state and optimize performance during server-side rendering.

What is the best way to optimize Vue 3 performance and avoid mutating computed values?

Optimize Vue 3 performance by avoiding computed value mutations, ensuring proper key usage in lists, and organizing composition code compactly to prevent unnecessary reactivity triggers and reduce rendering overhead.

How do I refactor an existing Vue project to align with Composition API guidelines?

Refactor an existing Vue project by auditing major components for <script setup> usage, migrating Options API logic to composables, and integrating reference docs into CI checks to enforce consistent Vue 3 patterns across your team.