From harness-claude
Create and manage reactive primitives and objects in Vue 3 Composition API using ref, reactive, computed, and toRefs. Use for component state like forms, counters, and composables.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Create and manage reactive primitive values and objects using ref and reactive
Explains Vue 3 Proxy-based reactivity with refs, reactive, shallowRef, customRef, computed, and watchers for managing complex state in applications.
Creates Vue composables accepting maybe-reactive inputs (MaybeRef/MaybeRefOrGetter), normalizing with toValue/toRef in reactive effects for reusable, predictable behavior.
> Extract and reuse stateful logic across components using Vue composables
Share bugs, ideas, or general feedback.
Create and manage reactive primitive values and objects using ref and reactive
ref() for primitives (strings, numbers, booleans) — access via .value.reactive() for objects — access properties directly (no .value).computed() for derived values that should auto-update.reactive() object — it breaks reactivity. Use toRefs() if needed.import { ref, reactive, computed, toRefs } from 'vue';
const count = ref(0); // ref for primitive
const user = reactive({ name: 'Alice', age: 30 }); // reactive for object
const greeting = computed(() => `Hello, ${user.name}!`);
count.value++; // ref needs .value
user.age = 31; // reactive — direct access
{{ count }} not {{ count.value }}.shallowRef() or shallowReactive() for large objects where deep reactivity is not needed.Vue 3's reactivity system is built on ES6 Proxy. ref() wraps a value in a reactive container with a .value property. reactive() wraps an entire object, making all properties reactive. computed() creates a cached, read-only reactive value derived from other reactive sources.
Trade-offs:
ref requires .value in JavaScript (not in templates) — a common source of bugs for new Vue developersreactive() loses reactivity when destructured — use toRefs() to safely destructureshallowRef/shallowReactive for performancereactive() object entirely (state = newObj) does not trigger updates — mutate properties insteadWhen NOT to use:
const without wrappingshallowRef with manual trigger via triggerRef()https://patterns.dev/vue/reactive-refs