Builds UIs with Vue 3 including Composition API, reactivity, components, and state management. Use when creating Vue applications, building reactive interfaces, or working with the Vue ecosystem.
Builds Vue 3 UIs using Composition API, reactivity, and SFCs. Use when creating Vue applications, building reactive interfaces, or working with Vue components, props, events, and composables.
/plugin marketplace add mgd34msu/goodvibes-plugin/plugin install goodvibes@goodvibes-marketThis skill inherits all available tools. When active, it can use any tool Claude has access to.
The progressive JavaScript framework for building user interfaces.
Create project:
npm create vue@latest my-app
cd my-app
npm install
npm run dev
<script setup lang="ts">
import { ref } from 'vue';
const count = ref(0);
function increment() {
count.value++;
}
</script>
<template>
<button @click="increment">Count: {{ count }}</button>
</template>
<style scoped>
button {
font-weight: bold;
}
</style>
<script setup lang="ts">
import { ref } from 'vue';
const count = ref(0);
const message = ref('Hello');
// Access with .value in script
count.value++;
message.value = 'World';
</script>
<template>
<!-- Auto-unwrapped in template -->
<p>{{ count }} - {{ message }}</p>
</template>
<script setup lang="ts">
import { reactive } from 'vue';
const state = reactive({
count: 0,
user: {
name: 'John',
email: 'john@example.com',
},
});
// Direct access, no .value
state.count++;
state.user.name = 'Jane';
</script>
<template>
<p>{{ state.count }} - {{ state.user.name }}</p>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
const firstName = ref('John');
const lastName = ref('Doe');
const fullName = computed(() => {
return `${firstName.value} ${lastName.value}`;
});
// Writable computed
const fullNameWritable = computed({
get: () => `${firstName.value} ${lastName.value}`,
set: (value) => {
const [first, last] = value.split(' ');
firstName.value = first;
lastName.value = last;
},
});
</script>
<script setup lang="ts">
import { ref, watch, watchEffect } from 'vue';
const count = ref(0);
const message = ref('');
// Watch single source
watch(count, (newVal, oldVal) => {
console.log(`Count: ${oldVal} -> ${newVal}`);
});
// Watch multiple sources
watch([count, message], ([newCount, newMsg], [oldCount, oldMsg]) => {
console.log('Changed');
});
// Watch with options
watch(
count,
(newVal) => console.log(newVal),
{ immediate: true, deep: true }
);
// Auto-track dependencies
watchEffect(() => {
console.log(`Count is ${count.value}`);
});
</script>
<!-- ChildComponent.vue -->
<script setup lang="ts">
interface Props {
title: string;
count?: number;
items?: string[];
}
const props = withDefaults(defineProps<Props>(), {
count: 0,
items: () => [],
});
</script>
<template>
<h1>{{ props.title }}</h1>
<p>Count: {{ props.count }}</p>
</template>
<!-- Parent -->
<ChildComponent title="Hello" :count="5" :items="['a', 'b']" />
<!-- ChildComponent.vue -->
<script setup lang="ts">
const emit = defineEmits<{
(e: 'update', value: number): void;
(e: 'delete', id: string): void;
}>();
function handleClick() {
emit('update', 42);
}
</script>
<template>
<button @click="handleClick">Update</button>
<button @click="emit('delete', '123')">Delete</button>
</template>
<!-- Parent -->
<ChildComponent @update="handleUpdate" @delete="handleDelete" />
<!-- CustomInput.vue -->
<script setup lang="ts">
const model = defineModel<string>();
</script>
<template>
<input v-model="model" />
</template>
<!-- Parent -->
<CustomInput v-model="message" />
<!-- UserForm.vue -->
<script setup lang="ts">
const firstName = defineModel<string>('firstName');
const lastName = defineModel<string>('lastName');
</script>
<template>
<input v-model="firstName" placeholder="First" />
<input v-model="lastName" placeholder="Last" />
</template>
<!-- Parent -->
<UserForm v-model:firstName="first" v-model:lastName="last" />
<!-- Card.vue -->
<template>
<div class="card">
<slot>Default content</slot>
</div>
</template>
<Card>
<p>Custom content</p>
</Card>
<!-- Layout.vue -->
<template>
<header>
<slot name="header" />
</header>
<main>
<slot />
</main>
<footer>
<slot name="footer" />
</footer>
</template>
<Layout>
<template #header>
<h1>Title</h1>
</template>
<p>Main content</p>
<template #footer>
<p>Footer</p>
</template>
</Layout>
<!-- List.vue -->
<script setup lang="ts">
defineProps<{ items: string[] }>();
</script>
<template>
<ul>
<li v-for="(item, index) in items" :key="index">
<slot :item="item" :index="index" />
</li>
</ul>
</template>
<List :items="['a', 'b', 'c']">
<template #default="{ item, index }">
{{ index }}: {{ item }}
</template>
</List>
<script setup lang="ts">
import {
onMounted,
onUpdated,
onUnmounted,
onBeforeMount,
onBeforeUpdate,
onBeforeUnmount,
} from 'vue';
onBeforeMount(() => {
console.log('Before mount');
});
onMounted(() => {
console.log('Mounted - DOM available');
});
onBeforeUpdate(() => {
console.log('Before update');
});
onUpdated(() => {
console.log('Updated');
});
onBeforeUnmount(() => {
console.log('Before unmount');
});
onUnmounted(() => {
console.log('Unmounted - cleanup');
});
</script>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
const inputRef = ref<HTMLInputElement | null>(null);
onMounted(() => {
inputRef.value?.focus();
});
</script>
<template>
<input ref="inputRef" />
</template>
<!-- Parent.vue -->
<script setup lang="ts">
import { provide, ref } from 'vue';
const theme = ref('dark');
const updateTheme = (newTheme: string) => {
theme.value = newTheme;
};
provide('theme', { theme, updateTheme });
</script>
<!-- DeepChild.vue -->
<script setup lang="ts">
import { inject } from 'vue';
const { theme, updateTheme } = inject('theme', {
theme: ref('light'),
updateTheme: () => {},
});
</script>
<template>
<p>Theme: {{ theme }}</p>
<button @click="updateTheme('light')">Light</button>
</template>
// composables/useMouse.ts
import { ref, onMounted, onUnmounted } from 'vue';
export function useMouse() {
const x = ref(0);
const y = ref(0);
function update(event: MouseEvent) {
x.value = event.pageX;
y.value = event.pageY;
}
onMounted(() => {
window.addEventListener('mousemove', update);
});
onUnmounted(() => {
window.removeEventListener('mousemove', update);
});
return { x, y };
}
<script setup lang="ts">
import { useMouse } from '@/composables/useMouse';
const { x, y } = useMouse();
</script>
<template>
<p>Mouse: {{ x }}, {{ y }}</p>
</template>
// composables/useFetch.ts
import { ref, watchEffect, toValue, type Ref } from 'vue';
export function useFetch<T>(url: Ref<string> | string) {
const data = ref<T | null>(null);
const error = ref<Error | null>(null);
const loading = ref(true);
watchEffect(async () => {
data.value = null;
error.value = null;
loading.value = true;
try {
const response = await fetch(toValue(url));
data.value = await response.json();
} catch (e) {
error.value = e as Error;
} finally {
loading.value = false;
}
});
return { data, error, loading };
}
<template>
<!-- Conditional -->
<p v-if="show">Visible</p>
<p v-else-if="other">Other</p>
<p v-else>Hidden</p>
<p v-show="show">Toggle visibility</p>
<!-- Loop -->
<ul>
<li v-for="item in items" :key="item.id">
{{ item.name }}
</li>
</ul>
<!-- Binding -->
<img :src="imageUrl" :alt="imageAlt" />
<div :class="{ active: isActive, disabled }" />
<div :style="{ color: textColor, fontSize: '16px' }" />
<!-- Events -->
<button @click="handleClick">Click</button>
<input @keyup.enter="submit" />
<form @submit.prevent="handleSubmit" />
<!-- Two-way binding -->
<input v-model="text" />
<input v-model.trim="text" />
<input v-model.number="age" type="number" />
</template>
// directives/vFocus.ts
import type { Directive } from 'vue';
export const vFocus: Directive = {
mounted(el) {
el.focus();
},
};
<script setup lang="ts">
import { vFocus } from '@/directives/vFocus';
</script>
<template>
<input v-focus />
</template>
<template>
<Transition name="fade">
<p v-if="show">Hello</p>
</Transition>
</template>
<style>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>
| Mistake | Fix |
|---|---|
| Forgetting .value | Use .value in script, auto-unwrap in template |
| Destructuring reactive | Use toRefs() to keep reactivity |
| Wrong ref type | ref for primitives, reactive for objects |
| Missing key in v-for | Always provide unique :key |
| Mutating props | Emit events to parent |
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.