1 vue rules available
One Claude rule matches vue: a Vue 3 expert rule covering the Composition API. Scoping it with paths to .vue files, composables and stores keeps it out of Claude Code sessions about the API server.
Claude Code loads persistent project instructions from CLAUDE.md files and from Markdown rules in .claude/rules/. Rules can be scoped to file paths with a paths frontmatter field, and CLAUDE.md can import other files with @path syntax. The rules in this directory are written as plain instruction prompts: in Claude Code, save them as CLAUDE.md or .claude/rules/ content; in Claude.ai or the Claude API, use the same text as project instructions or a system prompt instead.
.claude/rules/vue.mdStarting point, not a tested configuration for your repository. Loaded when Claude Code works with files matching paths. Review the instructions, adapt the file paths and run your project's existing checks.
---
paths:
- "**/*.vue"
- "src/composables/**/*.ts"
- "src/stores/**/*.ts"
---
# Vue.js instructions for Claude Code
## Focus for this project
- Name extracted composables useXxx and return refs or computed values, not raw reactive objects that lose reactivity when destructured.
- Run vue-tsc in the shell and report the actual result.
- If the project uses Pinia, put cross-page state in a store instead of a module-level ref.
## Vue.js conventions
- Use <script setup lang="ts"> with type-based defineProps<{ ... }>() and defineEmits for new components; keep the Options API only in files that already use it.
- Use computed for derived values and watch only for side effects.
- Put shared logic in composables named useXxx under src/composables.
- Do not mutate props; emit an event or use defineModel for two-way binding.
## Before you finish
- Run npx vue-tsc --noEmit, the lint script and the unit tests (for example Vitest) and report the actual output. If you cannot run them, say so and list the exact commands instead of saying they pass.
- Summarize which of the rules above affected the change.
- You have shell access: run the checks yourself instead of asking the user to, unless a command needs credentials or would deploy.
Create your own Claude rules for Vue.js and share with the community.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
Imports with @path can nest up to four hops deep, according to the docs. Claude Code can read AGENTS.md as project instructions without extra configuration, but by default only when there is no CLAUDE.md in the working directory or above it. The docs list this behavior for version 2.1.277 and later and describe a setting (claude-md-and-agents-md) that loads both files. If you maintain AGENTS.md for other tools, you can also import it from CLAUDE.md with @AGENTS.md.
Documentation checked 2026-11-05: Claude Code docs: Manage Claude's memory
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
You ask Claude Code to extract duplicated fetch logic from two components into a composable.
OrdersView.vue and InvoicesView.vue both fetch /api/customers with the same loading/error code. Extract it.
src/composables/useCustomers.ts returning data, error and loading refs, both views using it, and real vue-tsc output.
Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.