Skip to content
Cursor Rules Generator
Frontend4 sections

Vue.js Cursor Rules Template

Generate production-ready Vue.js Cursor rules for Project Rules (.mdc), AGENTS.md, or legacy .cursorrules. This template encodes stack-specific conventions for projects using Vue.js. Progressive JavaScript framework with reactive data binding and composable APIs.

The Complete Vue.js Cursor Rules

The full rule set in all three formats Cursor understands — copy the one your project uses. Project Rules (.mdc) load per-file via globs, AGENTS.md is portable across AI tools, and .cursorrules is the legacy single-file format.

Replacing a legacy file? Read the guide to migrate .cursorrules to Cursor Project Rules (.mdc) before copying this template into your project.

.cursor/rules/vue-project-structure.mdc
---
description: "Project Structure"
alwaysApply: false
---
- Use the Composition API with <script setup> syntax.
- Organize components by feature, not by file type.
- Use    spaces for indentation.
- Use camelCase for component names.
- Keep Single-File Components (SFCs) focused and small.
- Group related composables in a composables/ directory.
.cursor/rules/vue-component-patterns.mdc
---
description: "Component Patterns"
alwaysApply: false
---
- Use defineProps with TypeScript generics for type safety.
- Use defineEmits for event declarations.
- Extract reusable logic into composables (useXxx convention).
- Use provide/inject for deep component communication.
- Prefer v-model for two-way binding on form components.
- Use defineExpose sparingly — prefer props and emits.
.cursor/rules/vue-reactivity.mdc
---
description: "Reactivity"
alwaysApply: false
---
- Use ref() for primitive values and reactive() for objects.
- Use computed() for derived state.
- Use watch() or watchEffect() for side effects with cleanup.
- Use shallowRef/shallowReactive for large datasets.
- Avoid mutating props directly — use emits or v-model.
- Use toRefs() when destructuring reactive objects.
.cursor/rules/vue-routing.mdc
---
description: "Routing"
alwaysApply: false
---
- Use Vue Router 4 with composition API.
- Define routes with lazy loading for code splitting.
- Use route params and query with useRoute().
- Use navigation guards (beforeEach) for auth and redirects.
- Use RouterLink for internal navigation.
- Use named routes for maintainable navigation.

Customize These Rules

The generator below is preloaded with the Vue.js template. Adjust indentation, quotes, naming, add your own rules, then download — no need to start from scratch on the homepage.

What This Template Covers

Required guidance

  • - Project Structure
  • - Component Patterns
  • - Reactivity
  • - Routing

Default style

  • - Indentation: 2 spaces
  • - Quotes: single
  • - Semicolons: disabled
  • - Naming: camelCase

Frequently Asked Questions

What does the Vue.js Cursor rules template include?
It includes 4 rule sections covering project structure, component patterns, reactivity and other Vue.js development conventions.
Can I generate Vue.js Project Rules and AGENTS.md from the same template?
Yes. The generator can export the same stack-specific guidance as modern Project Rules (.mdc), AGENTS.md, or a legacy .cursorrules file.
Should I combine Vue.js with other Cursor rules templates?
Yes. You can combine Vue.js with related templates such as TypeScript, Tailwind CSS, Docker, or backend frameworks when your project uses multiple technologies.