Awesome-omni-skill vuejs3
VueJS 3 development standards and best practices with Composition API and TypeScript Triggers on: **/*.vue, **/*.ts, **/*.js, **/*.scss
install
source · Clone the upstream repo
git clone https://github.com/diegosouzapw/awesome-omni-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/vuejs3" ~/.claude/skills/diegosouzapw-awesome-omni-skill-vuejs3 && rm -rf "$T"
manifest:
skills/development/vuejs3/SKILL.mdsource content
VueJS 3 Development Instructions
Instructions for building high-quality VueJS 3 applications with the Composition API, TypeScript, and modern best practices.
Project Context
- Vue 3.x with Composition API as default
- TypeScript for type safety
- Single File Components (
) with.vue
syntax<script setup> - Modern build tooling (Vite recommended)
- Pinia for application state management
- Official Vue style guide and best practices
Development Standards
Architecture
- Favor the Composition API (
functions and composables) over the Options APIsetup - Organize components and composables by feature or domain for scalability
- Separate UI-focused components (presentational) from logic-focused components (containers)
- Extract reusable logic into composable functions in a
directorycomposables/ - Structure store modules (Pinia) by domain, with clearly defined actions, state, and getters
TypeScript Integration
- Enable
mode instrict
for maximum type safetytsconfig.json - Use
ordefineComponent
with<script setup lang="ts">
anddefinePropsdefineEmits - Leverage
for typed props and default valuesPropType<T> - Use interfaces or type aliases for complex prop and state shapes
- Define types for event handlers, refs, and
/useRoute
hooksuseRouter - Implement generic components and composables where applicable
Component Design
- Adhere to the single responsibility principle for components
- Use PascalCase for component names and kebab-case for file names
- Keep components small and focused on one concern
- Use
syntax for brevity and performance<script setup> - Validate props with TypeScript; use runtime checks only when necessary
- Favor slots and scoped slots for flexible composition
State Management
- Use Pinia for global state: define stores with
defineStore - For simple local state, use
andref
withinreactivesetup - Use
for derived statecomputed - Keep state normalized for complex structures
- Use actions in Pinia stores for asynchronous logic
- Leverage store plugins for persistence or debugging
Composition API Patterns
- Create reusable composables for shared logic, e.g.,
,useFetchuseAuth - Use
andwatch
with precise dependency listswatchEffect - Cleanup side effects in
oronUnmounted
cleanup callbackswatch - Use
/provide
sparingly for deep dependency injectioninject - Use
or third-party data utilities (Vue Query)useAsyncData
Styling
- Use
for component-level styles or CSS Modules<style scoped> - Consider utility-first frameworks (Tailwind CSS) for rapid styling
- Follow BEM or functional CSS conventions for class naming
- Leverage CSS custom properties for theming and design tokens
- Implement mobile-first, responsive design with CSS Grid and Flexbox
- Ensure styles are accessible (contrast, focus states)
Performance Optimization
- Lazy-load components with dynamic imports and
defineAsyncComponent - Use
for async component loading fallbacks<Suspense> - Apply
andv-once
for static or infrequently changing elementsv-memo - Profile with Vue DevTools Performance tab
- Avoid unnecessary watchers; prefer
where possiblecomputed - Tree-shake unused code and leverage Vite’s optimization features
Data Fetching
- Use composables like
(Nuxt) or libraries like Vue QueryuseFetch - Handle loading, error, and success states explicitly
- Cancel stale requests on component unmount or param change
- Implement optimistic updates with rollbacks on failure
- Cache responses and use background revalidation
Error Handling
- Use global error handler (
) for uncaught errorsapp.config.errorHandler - Wrap risky logic in
; provide user-friendly messagestry/catch - Use
hook in components for local boundarieserrorCaptured - Display fallback UI or error alerts gracefully
- Log errors to external services (Sentry, LogRocket)
Forms and Validation
- Use libraries like VeeValidate or @vueuse/form for declarative validation
- Build forms with controlled
bindingsv-model - Validate on blur or input with debouncing for performance
- Handle file uploads and complex multi-step forms in composables
- Ensure accessible labeling, error announcements, and focus management
Routing
- Use Vue Router 4 with
andcreateRoutercreateWebHistory - Implement nested routes and route-level code splitting
- Protect routes with navigation guards (
,beforeEnter
)beforeEach - Use
anduseRoute
inuseRouter
for programmatic navigationsetup - Manage query params and dynamic segments properly
- Implement breadcrumb data via route meta fields
Testing
- Write unit tests with Vue Test Utils and Vitest
- Focus on behavior, not implementation details
- Use
andmount
for component isolationshallowMount - Mock global plugins (router, Pinia) as needed
- Add end-to-end tests with Cypress or Playwright
- Test accessibility using axe-core integration
Security
- Avoid using
; sanitize any HTML inputs rigorouslyv-html - Use CSP headers to mitigate XSS and injection attacks
- Validate and escape data in templates and directives
- Use HTTPS for all API requests
- Store sensitive tokens in HTTP-only cookies, not
localStorage
Accessibility
- Use semantic HTML elements and ARIA attributes
- Manage focus for modals and dynamic content
- Provide keyboard navigation for interactive components
- Add meaningful
text for images and iconsalt - Ensure color contrast meets WCAG AA standards
Implementation Process
- Plan component and composable architecture
- Initialize Vite project with Vue 3 and TypeScript
- Define Pinia stores and composables
- Create core UI components and layout
- Integrate routing and navigation
- Implement data fetching and state logic
- Build forms with validation and error states
- Add global error handling and fallback UIs
- Add unit and E2E tests
- Optimize performance and bundle size
- Ensure accessibility compliance
- Document components, composables, and stores
Additional Guidelines
- Follow Vue’s official style guide (vuejs.org/style-guide)
- Use ESLint (with
) and Prettier for code consistencyplugin:vue/vue3-recommended - Write meaningful commit messages and maintain clean git history
- Keep dependencies up to date and audit for vulnerabilities
- Document complex logic with JSDoc/TSDoc
- Use Vue DevTools for debugging and profiling
Common Patterns
- Renderless components and scoped slots for flexible UI
- Compound components using provide/inject
- Custom directives for cross-cutting concerns
- Teleport for modals and overlays
- Plugin system for global utilities (i18n, analytics)
- Composable factories for parameterized logic