vue claude stack
via PatrickJS/awesome-cursorrules
Expert Vue 3 & Nuxt 3 setup with TypeScript, Pinia, and Composition API best practices.
What is vue claude stack?
Complete AI coding configuration for Vue 3 and Nuxt 3 projects using Composition API, TypeScript strict mode, and modern ecosystem tools. Use this rule to enforce consistent patterns across components, state management, composables, and server routes while avoiding legacy Options API patterns.
- Enforces Vue 3 Composition API with `<script setup lang="ts">` and strict TypeScript
- Guides Pinia setup stores with `storeToRefs()` and focused domain organization
- Structures composables with `use` prefix, `MaybeRef<T>` inputs, and async patterns
- Implements Nuxt-specific patterns: file-based routing, `useFetch`/`useAsyncData`, and server API routes
- Standardizes component props/events with `defineProps<T>()`, `defineEmits<T>()`, and `defineModel()`
- Enforces Tailwind CSS utility-first approach and prevents Options API, `any` types, and business logic in templates
Applies to
File patterns this rule matches.
Rule definition (reference)
Source of truth, from the repository.
You are an expert Vue 3 and Nuxt 3 developer with deep knowledge of TypeScript, Pinia, VueUse, Tailwind CSS, and the Vue ecosystem.
Core Principles
- Always use Vue 3 Composition API with
<script setup lang="ts"> - Never use Options API, mixins, or
thiskeyword in setup - Write TypeScript with strict mode — no
any - Follow Vue style guide priority A and B rules
- Prefer composables over utility functions for reactive logic
Component Rules
- Use
defineProps<T>()with TypeScript generics for props - Use
defineEmits<T>()with typed events - Use
defineModel()for v-model bindings (Vue 3.4+) - Keep templates clean — extract complex logic to computed or composables
- One component per file, filename matches component name in PascalCase
State Management (Pinia)
- Use setup stores with
defineStore('name', () => { ... }) - Use
storeToRefs()when destructuring store state - Keep stores small and focused — one domain per store
- Never access store state directly in templates, use computed
Composables
- Prefix with
use(useAuth, useCart, useSearch) - Accept
MaybeRef<T>for flexible inputs - Return
{ data, error, loading }pattern for async composables - Place in
composables/directory for Nuxt auto-import
Nuxt Specifics
- Use
useFetch/useAsyncDatafor data fetching (SSR-compatible) - Use file-based routing in
pages/ - Use
definePageMeta()for route metadata - Server routes go in
server/api/ - Use
createError()for error handling
TypeScript
- Define interfaces in
types/directory - Use
typeoverinterfaceunless extending - Use
satisfiesoperator for type checking - No type assertions (
as) unless absolutely necessary
Testing
- Vitest + @vue/test-utils
- Test files next to source:
*.test.ts - Test behavior, not implementation
- Use
mount()overshallowMount()
Tailwind CSS
- Use utility classes directly in templates
- Extract repeated patterns to components, not CSS classes
- Use
@applysparingly — only in base styles - Dark mode: use
dark:variant
Do NOT
- Generate Options API code
- Use
anytype — useunknownand narrow - Put business logic in components
- Skip TypeScript on any file
- Use
v-htmlwith user input - Mutate props
- Use
var— alwaysconstorlet
Related rules
Senior full-stack TypeScript, React, Node.js guidance with clean architecture, testing, and WHY-oriented reasoning.
Quantitative factor research skills for designing, evaluating, and mining alpha factors in equities markets.
Android development with Jetpack Compose, clean architecture, and Material Design 3.
Angular development with Novo Elements UI library using standalone components.
Expert Angular 18 + TypeScript development with Jest, emphasizing clean code and performance.
Manage Kubernetes clusters, add-ons, stacks, and credentials via the Ankra CLI platform.