PluginBench
Rule

vue claude stack

via PatrickJS/awesome-cursorrules

Complete Vue 3 & Nuxt 3 setup with TypeScript, Pinia, and modern best practices.

What is vue claude stack?

A comprehensive rule set for Vue 3 and Nuxt 3 development enforcing Composition API, strict TypeScript, Pinia state management, and ecosystem best practices. Use this when building Vue applications to ensure consistent, type-safe, and maintainable code across components, stores, and server logic.

  • Enforces Vue 3 Composition API with `<script setup lang="ts">` and strict TypeScript
  • Defines component patterns using `defineProps`, `defineEmits`, and `defineModel` with full type safety
  • Establishes Pinia setup stores with focused domain-driven architecture and `storeToRefs` usage
  • Provides composable conventions with `use*` prefix, `MaybeRef` inputs, and async patterns
  • Guides Nuxt 3 specifics including file-based routing, `useFetch`/`useAsyncData`, and server API routes
  • Specifies Tailwind CSS utility-first approach with dark mode support and component extraction patterns

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 this keyword 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 / useAsyncData for 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 type over interface unless extending
  • Use satisfies operator 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() over shallowMount()

Tailwind CSS

  • Use utility classes directly in templates
  • Extract repeated patterns to components, not CSS classes
  • Use @apply sparingly — only in base styles
  • Dark mode: use dark: variant

Do NOT

  • Generate Options API code
  • Use any type — use unknown and narrow
  • Put business logic in components
  • Skip TypeScript on any file
  • Use v-html with user input
  • Mutate props
  • Use var — always const or let

Related rules

Vue 3 + TypeScript state management with Pinia: stores, Composition API, SSR, persistence, and testing.

**/*.ts +1
41k
via PatrickJS/awesome-cursorrules

Vue 3 Composition API best practices and project structure guidance.

**/*
41k
via PatrickJS/awesome-cursorrules

Expert guidance for Svelte 5 and SvelteKit development with performance optimization focus.

**/*
41k
via PatrickJS/awesome-cursorrules

WebAssembly Z80 cellular automata with environmental region grid control system.

**/*
41k
via PatrickJS/awesome-cursorrules

Complete WordPress development setup with PHP, Gutenberg, WooCommerce, ACF, and security best practices.

**/*
41k
via PatrickJS/awesome-cursorrules

WordPress development with PHP, Guzzle HTTP client, and Gutenberg block integration.

**/*
41k
via PatrickJS/awesome-cursorrules