vue-best-practices

Enforce Vue 3 Composition API best practices for script setup and state management.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/arthuryin1314/heimaHr --skill vue-best-practices-arthuryin1314
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-best-practices
Source: https://github.com/arthuryin1314/heimaHr/tree/main/.claude/skills/vue-best-practices
Command: npx skills add https://github.com/arthuryin1314/heimaHr --skill vue-best-practices-arthuryin1314

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps Vue developers write robust, maintainable Vue 3 code by following Composition API best practices and avoiding common pitfalls.

Core Features & Use Cases

  • Guides script setup usage with a focus on practical, reusable patterns.
  • Enforces safe reactivity patterns such as readonly state with explicit update methods to avoid unintended mutations.
  • Covers common pitfalls across the Vue 3 ecosystem including SSR, Vue Router, and Pinia integrations.
  • Real-world scenarios include migrating from Options API and coordinating multiple composables.

Quick Start

Convert a sample component to script setup, extract a small feature into a composable, and replace direct state mutations with controlled updates.

Frequently Asked Questions about vue-best-practices

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

FAQPage Schema
How do I prevent unintended mutations in Vue 3 readonly state?

To prevent unintended mutations in Vue 3 readonly state, enforce safe reactivity patterns by exposing readonly state with explicit update methods. This approach ensures components cannot directly mutate shared state without controlled interfaces.

What is the best way to organize Vue 3 script setup components?

The best way to organize Vue 3 script setup components is by extracting reusable logic into composables. This pattern promotes maintainability, separates concerns, and coordinates multiple composables effectively across your application.

How do I migrate an Options API component to Vue 3 Composition API?

Migrating an Options API component to Vue 3 Composition API involves converting to script setup, extracting discrete features into composables, and replacing direct state mutations with controlled update methods for robust code.

Does this Vue 3 best practices guidance cover SSR and Pinia integrations?

Yes, this Vue 3 best practices guidance covers SSR, Vue Router, and Pinia integrations. It addresses common pitfalls across the Vue 3 ecosystem to help engineers build robust, maintainable applications.

Why should I avoid directly mutating computed values in Vue 3?

You should avoid mutating computed values in Vue 3 because it breaks reactivity and causes unpredictable state changes. Enforcing readonly state with explicit update methods prevents these common pitfalls and ensures robust code.