vue-best-practices
Use before planning or building a Vue 3 app or feature, with or without Nuxt: a workflow for component boundaries, data flow, composables and state, then…
от onmax★ 729 звёзд на GitHub
Установить vue-best-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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
- Keep state predictable: one source of truth, derive everything else.
- Make data flow explicit: Props down, Events up for most cases.
- Decompose by responsibility: keep each implementation focused and the contracts between implementations explicit.
- Avoid unnecessary re-renders: use computed properties and watchers wisely.
- Readability counts: write clear, self-documenting code.
1) Confirm architecture before coding (required)
- Default stack: Vue 3 + Composition API +
<script setup lang="ts">. - If the project explicitly uses Options API, load
vue-options-api-best-practicesskill if available. - If the project explicitly uses JSX, load
vue-jsx-best-practicesskill if available.
1.1 Must-read core references (required)
- Before implementing any Vue task, make sure to read and apply these core references:
references/reactivity.mdreferences/sfc.mdreferences/component-data-flow.mdreferences/composables.md
- Keep these references in active working context for the entire task, not only when a specific issue appears.
1.2 Plan component boundaries before coding (required)
For a non-trivial feature or structural refactor, sketch responsibilities, state owners, and the contracts that cross their boundaries. For local fixes, preserve existing boundaries unless they obstruct the change.
- Identify substantial UI responsibilities, stateful workflows, and DOM lifecycles in the affected feature. Sketch their owners, consumers, and the contracts needed for coordination.
- Judge cohesion by behavior that changes together or maintains a shared invariant. Being on the same page, reading the same data, or having only one consumer does not by itself justify one implementation.
- Let root/route components compose features and coordinate page behavior. Apply the same responsibility review inside feature components and composables; moving a whole feature to a child or a
useFeature()function is not sufficient decomposition. - Follow the project's layout and scale the design to the affected behavior. A local fix does not require a project-wide component map or new architectural layers.
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
- Must-read reference from
1.1: reactivity - Keep source state minimal (
ref/reactive), derive everything possible withcomputed. - Use watchers for side effects if needed.
- Avoid recomputing expensive logic in templates.
SFC structure and template safety
- Must-read reference from
1.1: sfc - Keep SFC sections in this order:
<script>→<template>→<style>. - Keep SFC responsibilities cohesive; use the boundary criteria below when splitting.
- Keep templates declarative; move branching/derivation to script.
- Apply Vue template safety rules (
v-html, list rendering, conditional rendering choices).
Choose useful boundaries
- Extract substantial, separable UI responsibilities and stateful workflows when doing so reduces the code a consumer or maintainer must understand. Single-use components and composables are valid; reuse is not a prerequisite. Keep the state and event handling needed by a UI responsibility with that UI.
- During a structural refactor, implement useful boundaries for the responsibilities identified above. Review what remains together as well as what was extracted. A small public API can hide an implementation that still needs decomposition.
- Treat file length, UI section count, and API size as review signals, not extraction thresholds. Keep a small cohesive production feature in one SFC when extra boundaries would not hide meaningful complexity.
- If a split adds extensive forwarding or mutual callbacks, first move local state and DOM behavior to their UI owner, then identify genuinely shared dependencies and their lifetime. Use explicit contracts or scoped context as appropriate. Merge only when the boundary has no useful responsibility to encapsulate, not merely to reduce wiring.
- Group inputs only when they form a cohesive concept. Passing a whole controller, grouping unrelated handlers, or adding catch-all events does not reduce the dependencies consumers must understand.
Component data flow
- Must-read reference from
1.1: component-data-flow - Use props down, events up as the primary model.
- Use
v-modelonly for true two-way component contracts. - Use typed, scoped provide/inject for shared descendant dependencies when intermediate components only relay them; reassess component boundaries first. See the data-flow reference for scope and ownership.
- Kee
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/animation-class-based-technique.md
- references/animation-state-driven-technique.md
- references/component-async.md
- references/component-data-flow.md
- references/component-fallthrough-attrs.md
- references/component-keep-alive.md
- references/component-slots.md
- references/component-suspense.md
- references/component-teleport.md
- references/component-transition-group.md
- references/component-transition.md
- references/composables.md
- references/directives.md
- references/perf-avoid-component-abstraction-in-lists.md
- references/perf-v-once-v-memo-directives.md
- references/perf-virtualize-large-lists.md
- references/plugins.md
- references/reactivity.md
- references/render-functions.md
- references/sfc.md
- references/state-management.md
- references/updated-hook-performance.md
FAQ
Что делает скилл vue-best-practices?
Use before planning or building a Vue 3 app or feature, with or without Nuxt: a workflow for component boundaries, data flow, composables and state, then performance once behavior is correct. Prefers the Composition API with `<script setup>` and TypeScript.
Как установить скилл vue-best-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл vue-best-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…