Vue best practices

From JetBrains/skills · View interactive version

Vue best practices is an AI agent skill from the GitHub repository JetBrains/skills. MUST be used for Vue.js tasks. Strongly recommends Composition API with `<script setup>` and TypeScript as the standard approach. Covers Vue 3, SSR, Volar, vue-tsc. Load for any Vue, .vue files, Vue Router, Pinia, or Vite with Vue work. ALWAYS use Composition API unless the project explicitly requir

How to use this skill

Skill file

Vue Best Practices Workflow

Use this skill as an instruction set. Follow the workflow in order unless the user explicitly asks for a different order.

Core Principles

1) Confirm architecture before coding (required)

1.1 Must-read core references (required)

1.2 Plan component boundaries before coding (required)

Create a brief component map before implementation for any non-trivial feature.

2) Apply essential Vue foundations (required)

These are essential, must-know foundations. Apply all of them in every Vue task using the core references already loaded in section 1.1.

Reactivity

SFC structure and template safety

Keep components focused

Split a component when it has more than one clear responsibility (e.g. data orchestration + UI, or multiple independent UI sections).

Apply objective split triggers. Split the component if any condition is true:

Entry/root and route view rule:

Component data flow

Composables

3) Consider optional features only when requirements call for them

3.1 Standard optional features

Do not add these by default. Load the matching reference only when the requirement exists.

3.2 Less-common optional features

Use these only when there is explicit product or technical need.

4) Run performance optimization after behavior is correct

Performance work is a post-functionality pass. Do not optimize before core behavior is implemented and verified.

5) Final self-check before finishing

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.