Vue UI Skill
Use this skill when building Vue 3 applications, Vue Single-File Components, feature modules, routing, state, i18n, or tests.
Prefer Vue 3, TypeScript, <script setup>, Vite, and Composition API for new application work.
Architecture
Organize large apps by feature ownership and keep framework glue thin:
src/
app/ # app bootstrap, providers, router, i18n, global shell
components/ # shared presentational components
composables/ # reusable Composition API logic
features/ # feature-owned views, stores, services, components
layouts/ # route shells and page layout components
router/ # route records, guards, lazy route imports
services/ # API clients, storage, browser integrations
stores/ # cross-feature Pinia stores
styles/ # global styles, tokens, themes
test/ # test setup, factories, mocks
Keep domain rules in plain TypeScript modules, shared behavior in composables, and rendering in Vue components.
Core Defaults
- Use Single-File Components for component UI and colocated component styles.
- Use
<script setup lang="ts"> unless Options API compatibility is required.
- Prefer
ref, computed, and composables for local component logic.
- Use
reactive for cohesive object state, not for arbitrary bags of unrelated values.
- Use Pinia for app-level or cross-route state.
- Use Vue Router for route ownership, URL state, guards, and lazy route code splitting.
- Use Vue I18n in Composition API mode for translations, plurals, numbers, dates, and locale switching.
- Use Vite with
@vitejs/plugin-vue; use Vue CLI only for legacy maintenance.
- Use Vitest plus Vue Test Utils for unit and component tests.
Component Rules
- Keep templates readable: move complex expressions into named
computed values or methods.
- Treat props as immutable inputs; emit events or call commands to request changes.
- Define props and emits with TypeScript macros:
defineProps, withDefaults, and defineEmits.
- Keep business rules out of templates and route views.
- Use slots for visual extension points, not for passing hidden control flow.
- Prefer semantic HTML before ARIA.
- Use scoped styles for component-local rules and global tokens for theme decisions.
State
- Start with local
ref or computed state.
- Extract reusable logic to composables when multiple components need the same behavior.
- Use Pinia setup stores for cross-route state, auth/session state, user preferences, cached entities, and shared commands.
- Keep server cache concerns in a data-fetching layer; do not turn Pinia into a stale backend mirror by default.
- Persist only explicit, low-risk state and version persisted schemas.
Routing
- Define route records in one router module and lazy-load route views.
- Use
createWebHistory() for production SPAs and configure server fallback to index.html.
- Add an app-level not-found route for unmatched paths.
- Keep route components thin: layout, metadata, data owner, and feature entry point.
- Store shareable UI state in query params when users expect deep links.
- Use guards for authorization and navigation policy, not for general component setup.
I18n
- Use
createI18n({ legacy: false }) and useI18n() for Vue 3 Composition API apps.
- Keep translation keys stable and domain-oriented.
- Use plural, datetime, and number formatting APIs instead of manual string assembly.
- Avoid hardcoded visible text in reusable components.
- Keep locale loading and fallback behavior explicit.
- Coordinate
lang, dir, route metadata, and document title with web-i18n and web-seo-metadata.
Tooling
- Scaffold new apps with
npm create vue@latest or the package manager equivalent.
- Configure Vue SFC support with
@vitejs/plugin-vue.
- Use
vue-tsc for type-checking templates and SFC props from CI.
- Keep Vitest config close to Vite config unless the repository already separates it.
- Add
@vue/test-utils for mounted component tests.
- Prefer official Vue tooling and ecosystem libraries before custom framework glue.
Popular Libraries
pinia for state management.
vue-router for routing.
vue-i18n for internationalization.
@vueuse/core for reusable browser and reactivity composables.
@vue/test-utils for Vue component tests.
vitest for Vite-native unit and component testing.
eslint-plugin-vue plus TypeScript ESLint for linting SFCs.
vee-validate or vuelidate for complex forms when native validation and local rules are not enough.
unplugin-vue-router for typed route generation when route count or route params justify it.
References
- references/app-architecture.md: app structure, components, composables, and feature boundaries
- references/state-pinia.md: local state, composables, Pinia stores, persistence, and testing
- references/routing.md: Vue Router, lazy routes, guards, URL state, and SPA fallback
- references/i18n.md: Vue I18n Composition API patterns and locale behavior
- references/vite-vitest.md: Vite, Vitest, Vue Test Utils,
vue-tsc, and CI checks
Source: prachwal/web-ui-skills — distributed by TomeVault.
1---2name: vue-ui3description: Use when designing, refactoring, or reviewing Vue 3 applications and components, including Composition API, SFC structure, Pinia state, Vue Router, Vue I18n, Vite, Vitest, Vue Test Utils, accessibility, and production app architecture.4---56# Vue UI Skill78Use this skill when building Vue 3 applications, Vue Single-File Components, feature modules, routing, state, i18n, or tests.9Prefer Vue 3, TypeScript, `<script setup>`, Vite, and Composition API for new application work.1011## Architecture1213Organize large apps by feature ownership and keep framework glue thin:1415```text16src/17 app/ # app bootstrap, providers, router, i18n, global shell18 components/ # shared presentational components19 composables/ # reusable Composition API logic20 features/ # feature-owned views, stores, services, components21 layouts/ # route shells and page layout components22 router/ # route records, guards, lazy route imports23 services/ # API clients, storage, browser integrations24 stores/ # cross-feature Pinia stores25 styles/ # global styles, tokens, themes26 test/ # test setup, factories, mocks27```2829Keep domain rules in plain TypeScript modules, shared behavior in composables, and rendering in Vue components.3031## Core Defaults3233- Use Single-File Components for component UI and colocated component styles.34- Use `<script setup lang="ts">` unless Options API compatibility is required.35- Prefer `ref`, `computed`, and composables for local component logic.36- Use `reactive` for cohesive object state, not for arbitrary bags of unrelated values.37- Use Pinia for app-level or cross-route state.38- Use Vue Router for route ownership, URL state, guards, and lazy route code splitting.39- Use Vue I18n in Composition API mode for translations, plurals, numbers, dates, and locale switching.40- Use Vite with `@vitejs/plugin-vue`; use Vue CLI only for legacy maintenance.41- Use Vitest plus Vue Test Utils for unit and component tests.4243## Component Rules4445- Keep templates readable: move complex expressions into named `computed` values or methods.46- Treat props as immutable inputs; emit events or call commands to request changes.47- Define props and emits with TypeScript macros: `defineProps`, `withDefaults`, and `defineEmits`.48- Keep business rules out of templates and route views.49- Use slots for visual extension points, not for passing hidden control flow.50- Prefer semantic HTML before ARIA.51- Use scoped styles for component-local rules and global tokens for theme decisions.5253## State5455- Start with local `ref` or `computed` state.56- Extract reusable logic to composables when multiple components need the same behavior.57- Use Pinia setup stores for cross-route state, auth/session state, user preferences, cached entities, and shared commands.58- Keep server cache concerns in a data-fetching layer; do not turn Pinia into a stale backend mirror by default.59- Persist only explicit, low-risk state and version persisted schemas.6061## Routing6263- Define route records in one router module and lazy-load route views.64- Use `createWebHistory()` for production SPAs and configure server fallback to `index.html`.65- Add an app-level not-found route for unmatched paths.66- Keep route components thin: layout, metadata, data owner, and feature entry point.67- Store shareable UI state in query params when users expect deep links.68- Use guards for authorization and navigation policy, not for general component setup.6970## I18n7172- Use `createI18n({ legacy: false })` and `useI18n()` for Vue 3 Composition API apps.73- Keep translation keys stable and domain-oriented.74- Use plural, datetime, and number formatting APIs instead of manual string assembly.75- Avoid hardcoded visible text in reusable components.76- Keep locale loading and fallback behavior explicit.77- Coordinate `lang`, `dir`, route metadata, and document title with `web-i18n` and `web-seo-metadata`.7879## Tooling8081- Scaffold new apps with `npm create vue@latest` or the package manager equivalent.82- Configure Vue SFC support with `@vitejs/plugin-vue`.83- Use `vue-tsc` for type-checking templates and SFC props from CI.84- Keep Vitest config close to Vite config unless the repository already separates it.85- Add `@vue/test-utils` for mounted component tests.86- Prefer official Vue tooling and ecosystem libraries before custom framework glue.8788## Popular Libraries8990- `pinia` for state management.91- `vue-router` for routing.92- `vue-i18n` for internationalization.93- `@vueuse/core` for reusable browser and reactivity composables.94- `@vue/test-utils` for Vue component tests.95- `vitest` for Vite-native unit and component testing.96- `eslint-plugin-vue` plus TypeScript ESLint for linting SFCs.97- `vee-validate` or `vuelidate` for complex forms when native validation and local rules are not enough.98- `unplugin-vue-router` for typed route generation when route count or route params justify it.99100## References101102- [references/app-architecture.md](references/app-architecture.md): app structure, components, composables, and feature boundaries103- [references/state-pinia.md](references/state-pinia.md): local state, composables, Pinia stores, persistence, and testing104- [references/routing.md](references/routing.md): Vue Router, lazy routes, guards, URL state, and SPA fallback105- [references/i18n.md](references/i18n.md): Vue I18n Composition API patterns and locale behavior106- [references/vite-vitest.md](references/vite-vitest.md): Vite, Vitest, Vue Test Utils, `vue-tsc`, and CI checks107108---109> Source: [prachwal/web-ui-skills](https://github.com/prachwal/web-ui-skills) — distributed by [TomeVault](https://tomevault.io).110<!-- tomevault:4.0:skill_md:2026-04-26 -->