Comprehensive best practices guide for Vue.js 3 applications. Contains guidelines across multiple categories to ensure idiomatic, maintainable, and scalable Vue.js code, including Tailwind CSS integration patterns for utility-first styling and PrimeVue component library best practices.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionvue-best-practicesExecute the skills CLI command in your project's root directory to begin installation:
Fetches vue-best-practices from dedalus-erp-pas/foundation-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate vue-best-practices. Access via /vue-best-practices in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
2
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
2
stars
Comprehensive best practices guide for Vue.js 3 applications. Contains guidelines across multiple categories to ensure idiomatic, maintainable, and scalable Vue.js code, including Tailwind CSS integration patterns for utility-first styling and PrimeVue component library best practices.
Reference these guidelines when:
| Category | Focus | Prefix |
|---|---|---|
| Composition API | Proper use of Composition API patterns | composition- |
| Component Design | Component structure and organization | component- |
| Reactivity | Reactive state management patterns | reactive- |
| Props & Events | Component communication patterns | props- |
| Template Patterns | Template syntax best practices | template- |
| Code Organization | Project and code structure | organization- |
| TypeScript | Type-safe Vue.js patterns | typescript- |
| Error Handling | Error boundaries and handling | error- |
| Tailwind CSS | Utility-first styling patterns | tailwind- |
| PrimeVue | Component library integration patterns | primevue- |
composition-script-setup - Always use <script setup> for single-file componentscomposition-ref-vs-reactive - Use ref() for primitives, reactive() for objectscomposition-computed-derived - Use computed() for all derived statecomposition-watch-side-effects - Use watch()/watchEffect() only for side effectscomposition-composables - Extract reusable logic into composablescomposition-lifecycle-order - Place lifecycle hooks after reactive state declarationscomposition-avoid-this - Never use this in Composition APIcomponent-single-responsibility - One component, one purposecomponent-naming-convention - Use PascalCase for components, kebab-case in templatescomponent-small-focused - Keep components under 200 linescomponent-presentational-container - Separate logic from presentation when beneficialcomponent-slots-flexibility - Use slots for flexible component compositioncomponent-expose-minimal - Only expose what's necessary via defineExpose()reactive-const-refs - Always declare refs with constreactive-unwrap-template - Let Vue unwrap refs in templates (no .value)reactive-shallow-large-data - Use shallowRef()/shallowReactive() for large non-reactive datareactive-readonly-props - Use readonly() to prevent mutationsreactive-toRefs-destructure - Use toRefs() when destructuring reactive objectsreactive-avoid-mutation - Prefer immutable updates for complex stateprops-define-types - Always define prop types with defineProps<T>()props-required-explicit - Be explicit about required vs optional propsprops-default-values - Provide sensible defaults with withDefaults()props-immutable - Never mutate props directlyprops-validation - Use validator functions for complex prop validationevents-define-emits - Always define emits with defineEmits<T>()events-naming - Use kebab-case for event names in templatesevents-payload-objects - Pass objects for events with multiple valuestemplate-v-if-v-show - Use v-if for conditional rendering, v-show for togglingtemplate-v-for-key - Always use unique, stable :key with v-fortemplate-v-if-v-for - Never use v-if and v-for on the same elementtemplate-computed-expressions - Move complex expressions to computed propertiestemplate-event-modifiers - Use event modifiers (.prevent, .stop) appropriatelytemplate-v-bind-shorthand - Use shorthand syntax (: for v-bind, @ for v-on)template-v-model-modifiers - Use v-model modifiers (.trim, .number, .lazy)organization-feature-folders - Organize by feature, not by typeorganization-composables-folder - Keep composables in dedicated composables/ folderorganization-barrel-exports - Use index files for clean importsorganization-consistent-naming - Follow consistent naming conventionsorganization-colocation - Colocate related files (component, tests, styles)typescript-generic-components - Use generics for reusable typed componentstypescript-prop-types - Use TypeScript interfaces for prop definitionstypescript-emit-types - Type emit payloads explicitlytypescript-ref-typing - Specify types for refs when not inferredtypescript-template-refs - Type template refs with ref<InstanceType<typeof Component> | null>(null)error-boundaries - Use onErrorCaptured() for component error boundarieserror-async-handling - Handle errors in async operations explicitlyerror-provide-fallbacks - Provide fallback UI for error stateserror-logging - Log errors appropriately for debuggingtailwind-utility-first - Apply utility classes directly in templates, avoid custom CSStailwind-class-order - Use consistent class ordering (layout → spacing → typography → visual)tailwind-responsive-mobile-first - Use mobile-first responsive design (sm:, md:, lg:)tailwind-component-extraction - Extract repeated utility patterns into Vue componentstailwind-dynamic-classes - Use computed properties or helper functions for dynamic classestailwind-complete-class-strings - Always use complete class strings, never concatenatetailwind-state-variants - Use state variants (hover:, focus:, active:) for interactionstailwind-dark-mode - Use dark: prefix for dark mode supporttailwind-design-tokens - Configure design tokens in Tailwind config for consistencytailwind-avoid-apply-overuse - Limit @apply usage; prefer Vue components for abstractionprimevue-use-natively - Use PrimeVue components as-is with their documented props and APIprimevue-design-tokens - Customize appearance exclusively through design tokens and definePreset()primevue-no-pt-overrides - NEVER use PassThrough (pt) API to restyle componentsprimevue-no-unstyled-mode - NEVER use unstyled mode to strip and rebuild component stylesprimevue-no-wrapper-components - NEVER wrap PrimeVue components just to override their stylingprimevue-props-api - Use built-in props (severity, size, outlined, rounded, raised, text) for variantsprimevue-css-layers - Configure CSS layer ordering for clean Tailwind coexistenceprimevue-typed-components - Leverage PrimeVue's TypeScript support for type safetyprimevue-accessibility - Maintain WCAG compliance with proper aria attributesprimevue-lazy-loading - Use async components for large PrimeVue importsThe Composition API is the recommended approach for Vue.js 3. Follow these patterns:
<script setup>: More concise, better TypeScript inference, and improved performanceuse prefix convention (e.g., useAuth, useFetch)Well-designed components are the foundation of maintainable Vue applications:
Understanding Vue's reactivity system is crucial:
ref() for primitives and values you'll reassign; use reactive() for objects you'll mutatecomputed() insteadwatch() for side effects like API calls or localStoragetoRefs()Proper component communication ensures maintainable code:
defineProps<T>()defineEmits<T>() for type-safe event handlingmodelValue prop and update:modelValue emitRecommended structure for <script setup>:
<script setup lang="ts">
// 1. Imports
import { ref, computed, watch, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import type { User } from '@/types'
// 2. Props and Emits
const props = defineProps<{
userId: string
initialData?: User
}>()
const emit = defineEmits<{
submit: [user: User]
cancel: []
}>()
// 3. Composables
const router = useRouter()
const { user, loading, error } = useUser(props.userId)
// 4. Reactive State
const formData = ref({ name: '', email: '' })
const isEditing = ref(false)
// 5. Computed Properties
const isValid = computed(() => {
return formData.value.name.length > 0 && formData.value.email.includes('@')
})
// 6. Watchers (for side effects only)
watch(() => props.userId, (newId) => {
fetchUserData(newId)
})
// 7. Methods
function handleSubmit() {
if (isValid.value) {
emit('submit', formData.value)
}
}
// 8. Lifecycle Hooks
onMounted(() => {
if (props.initialData) {
formData.value = { ...props.initialData }
}
})
</script>
Correct: Well-structured composable
// composables/useUser.ts
import { ref, computed, watch } from 'vue'
import type { Ref } from 'vue'
import type { User } from '@/types'
export function useUser(userId: Ref<string> | string) {
// State
const user = ref<User | null>(null)
const loading = ref(false)
const error = ref<Error | null>(null)
// Computed
const fullName = computed(() => {
if (!user.value) return ''
return `${user.value.firstName} ${user.value.lastName}`
})
// Methods
async function fetchUser(id: string) {
loading.value = true
error.value = null
try {
const response = await api.getUser(id)
user.value = response.data
} catch (e) {
error.value = e as Error
} finally {
loading.value = false
}
}
// Auto-fetch when userId changes (if reactive)
if (isRef(userId)) {
watch(userId, (newId) => fetchUser(newId), { immediate: true })
} else {
fetchUser(userId)
}
// Return
return {
Implementation Guide
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Steps
- 1Install skill using provided installation command
- 2Test with simple use case relevant to your work
- 3Evaluate output quality and relevance
- 4Iterate on prompts to improve results
- 5Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Related Skills
react-vite-best-practices
58asyrafhussin/agent-skills
Frontend2 shared tagstypescript-best-practices
164jwynia/agent-skills
Backend2 shared tagsnestjs-best-practices
76kadajett/agent-nestjs-skills
Productivity2 shared tagsfrontend-design
662anthropics/claude-code
Frontendsame categoryui-animation
243mblode/agent-skills
Frontendsame categorypremium-frontend-ui
236github/awesome-copilot
Frontendsame categoryReviews
4.4★★★★★66 reviews- NNikhil Iyer★★★★★Dec 24, 2024
I recommend vue-best-practices for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- PPratham Ware★★★★★Dec 20, 2024
Useful defaults in vue-best-practices — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- CChinedu Jain★★★★★Dec 12, 2024
I recommend vue-best-practices for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- DDev Anderson★★★★★Dec 8, 2024
Useful defaults in vue-best-practices — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- MMaya Khan★★★★★Dec 4, 2024
vue-best-practices fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- OOmar Diallo★★★★★Nov 27, 2024
vue-best-practices is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- NNia Ghosh★★★★★Nov 23, 2024
vue-best-practices has been reliable in day-to-day use. Documentation quality is above average for community skills.
- CCharlotte Martinez★★★★★Nov 15, 2024
Keeps context tight: vue-best-practices is the kind of skill you can hand to a new teammate without a long onboarding doc.
- YYash Thakker★★★★★Nov 11, 2024
vue-best-practices is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- CChinedu Harris★★★★★Nov 3, 2024
Keeps context tight: vue-best-practices is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 66
1 / 7Discussion
Comments — not star reviews- No comments yet — start the thread.