vue-best-practices

Codify Vue 3 best practices for Composition API, TypeScript, and SSR projects.

1|Updated Apr 4, 2023
One-click install
npx skills add https://github.com/ElderEvil/falloutProject --skill vue-best-practices-elderevil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-best-practices
Source: https://github.com/ElderEvil/falloutProject/tree/main/.agents/skills/vue-best-practices
Command: npx skills add https://github.com/ElderEvil/falloutProject --skill vue-best-practices-elderevil

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vue projects often struggle with inconsistent patterns, lack of shared conventions, and maintenance burden as teams diverge in how to structure components, manage state, and apply reactivity rules.

Core Features & Use Cases

  • Composition API guidance: recommended patterns, so teams write idiomatic Vue 3 code.
  • Reactivity & state management: best practices for refs, computed, watchers, and avoiding anti-patterns.
  • Performance & SSR considerations: tips for hydration, avoid heavy renders, and SSR pitfalls.
  • Architecture & testing: guidance on project structure, composables, and testing strategy with Vitest.

Quick Start

Review a Vue component and refactor it to use <script setup> and defineProps/defineEmits; ensure typings with TypeScript; apply a consistent naming and folder structure.

Frequently Asked Questions about vue-best-practices

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

FAQPage Schema
What are Vue 3 best practices for structuring components and managing state in scalable apps?

Vue 3 best practices for scalable apps recommend using the Composition API, organizing project architecture with composables, and managing state with Pinia to ensure consistent, reliable code across growing codebases.

How do I refactor a Vue component to use script setup and TypeScript?

Refactor a Vue component by adopting script setup with defineProps and defineEmits, applying TypeScript for strict typings, and enforcing a consistent naming and folder structure to improve maintainability.

What is the best way to handle reactivity and avoid anti-patterns in Vue 3?

The best way to handle Vue 3 reactivity is using refs and computed properties correctly, applying watchers appropriately, and avoiding common anti-patterns to maintain predictable state updates and rendering behavior.

Does this Vue 3 guidance cover SSR hydration pitfalls and performance optimization?

Yes, Vue 3 guidance covers SSR considerations by addressing hydration pitfalls, optimizing heavy renders, and applying performance tips to ensure robust server-side rendering and smooth client-side interactions.

Can I use these Vue 3 patterns with Vite, Vue Router, and Vitest?

Yes, these Vue 3 patterns integrate with Vite, Vue Router, and Pinia for architecture, while recommending Vitest for testing strategy to ensure maintainable development across small and large codebases.