ClaudeVueProjectTemplate
CLAUDE.md0 starsChanged 7 months agoMITView on GitHub
Detailed patterns with code examples live in .claude/rules/. The summary below is the quick reference that applies on every turn.
In this repository2 other files it gives its agents.
- accessibility-auditSkill
- vue-performance-auditSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 46
All component files use PascalCase: UserCard.vue, BaseButton.vue
- Very specific: line 47
Always use <script setup lang="ts"> — never Options API or defineComponent
- Very specific: line 49
Use defineModel() for two-way bindings instead of manual prop+emit patterns
- Very specific: line 55
Prefer interface over type for object shapes
- Very specific: line 56
Never use enum — use as const maps instead
- Distinctive: line 62
All Pinia stores use the Setup Store syntax (not Options Store)
- Distinctive: line 64
Keep server-fetched data in stores.
- Very specific: line 65
Always destructure store state with storeToRefs — plain destructuring breaks reactivity
- Very specific: line 69
All composables are prefixed with use: useAuth.ts, useNotification.ts
- Very specific: line 71
Prefer VueUse primitives (useLocalStorage, useFetch, etc.) over custom re-implementations
- Distinctive: line 82
Use CSS custom properties for theming.
- Very specific: line 87
Always use the @/ alias for src/ — never use relative ../../ paths across feature boundaries
- Distinctive: line 92
Never swallow errors silently — always log or surface them
- Very specific: line 93
Use a central error handler composable (useErrorHandler) instead of scattered try/catch
- Distinctive: line 94
Do not expose raw error messages or stack traces to the UI
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project: [App Name]
Commands
npm run dev # Start Vite dev server
npm run build # Production build (runs tsc + vite build)
npm run preview # Preview production build locally
npm run test # Run Vitest unit tests
npm run lint # ESLint check
npm run typecheck # Run tsc --noEmitStack
- Vue 3 with Composition API (
<script setup>only — no Options API) - TypeScript 5, strict mode enabled
- Vite for bundling and dev server
- Vue Router 4 for client-side routing
- Pinia for global state management
- VueUse for composable utilities
- Vitest + Vue Test Utils for unit tests
Project Structure
src/
├── assets/ # Static assets (images, fonts, global CSS)
├── components/ # Shared UI components (PascalCase filenames)
├── composables/ # Reusable logic hooks (useXxx.ts)
├── layouts/ # Page layout wrappers
├── pages/ # Route-level components (maps to router)
├── router/ # Vue Router config (index.ts)
├── stores/ # Pinia stores (useXxxStore.ts)
├── types/ # Shared TypeScript interfaces and types
└── utils/ # Pure helper functions (no Vue/component deps)Conventions
Detailed patterns with code examples live in
.claude/rules/. The summary below is the quick reference that applies on every turn.
Components
- All component files use PascalCase:
UserCard.vue,BaseButton.vue - Always use
<script setup lang="ts">— never Options API ordefineComponent - Define props and emits with
defineProps<{}>()anddefineEmits<{}>() - Use
defineModel()for two-way bindings instead of manual prop+emit patterns - Prefix generic reusable components with
Base:BaseInput,BaseModal - Prefix layout components with
Thefor singletons:TheHeader,TheSidebar
TypeScript
- Prefer
interfaceovertypefor object shapes - Never use
enum— useas constmaps instead - No
any— useunknownand narrow explicitly - Strict mode is on: unused variables and implicit returns are errors
State Management
- All Pinia stores use the Setup Store syntax (not Options Store)
- Store files are named
useXxxStore.tsand live insrc/stores/ - Keep server-fetched data in stores; keep local UI state in components
- Always destructure store state with
storeToRefs— plain destructuring breaks reactivity
Composables
- All composables are prefixed with
use:useAuth.ts,useNotification.ts - Live in
src/composables/— never inline reusable logic inside components - Prefer VueUse primitives (
useLocalStorage,useFetch, etc.) over custom re-implementations
Routing
- Route names use kebab-case strings:
'user-profile','settings-account' - Lazy-load all page components:
component: () => import('@/pages/UserPage.vue') - Route meta types are declared in
src/router/index.tsviaRouteMetainterface extension
Styling
- Scoped styles by default:
<style scoped> - Use CSS custom properties for theming; avoid hardcoded color/size values in components
- Utility classes (if using Tailwind) are preferred over component-scoped styles for layout
Imports
- Always use the
@/alias forsrc/— never use relative../../paths across feature boundaries - Named exports everywhere; default exports only for
.vuecomponents (Vue convention)
Error Handling
- Never swallow errors silently — always log or surface them
- Use a central error handler composable (
useErrorHandler) instead of scatteredtry/catch - Do not expose raw error messages or stack traces to the UI
Watch Out For
tsc --noEmitruns as part ofnpm run build. Fix type errors before building — Vite does not block on them during dev- Vue Router
<RouterView>requires a matching named route or it renders nothing silently - Pinia stores are not available before
app.use(pinia)— never call stores at module top level definePropsanddefineEmitsmust use the generic syntax in<script setup>for proper type inference- VueUse composables require the component instance context — do not call them inside plain
.tsutility files
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

