/frontend-vue:composables-vueusefrom frontend-vue
Use when a Vue component needs behaviour that is not display — reading or writing local storage, the colour scheme or a media query, the clock, window size, an event source or websocket, a debounce or throttle, the clipboard, focus, keyboard shortcuts, intersection, drag position, fetch with abort — or when about to write a use* composable, review one, or decide whether a piece of logic belongs in a composable, a store or a component. VueUse is checked first. NOT for app-wide state (frontend-vue:state-pinia) and NOT for React hooks (frontend-react:hooks-registry).
Ships in frontend-vue. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
In: a Vue 3 project with VueUse available or installable, and behaviour a component needs that is not rendering.
Out: the behaviour comes from VueUse when VueUse has it, from a composable of ours when it is
business logic or a composition of several, and from the component only when it is one line; our
composables follow the use* contract below. The checkable expectations are in evals/rubric.json.
use*, open the VueUse function list and search for the concept.
The common wins: useLocalStorage, useSessionStorage, usePreferredDark, useMediaQuery,
useDark, useNow, useTimeAgo, useIntervalFn, useEventSource, useWebSocket, useFetch,
useDebounceFn, useThrottleFn, refDebounced, useClipboard, useFocusTrap (integrations),
onKeyStroke, useMagicKeys, useIntersectionObserver, useResizeObserver, useElementSize,
useDraggable, useSortable (integrations), useEventListener, onClickOutside, useTitle,
useScroll, useVirtualList, watchDebounced, computedAsync, createSharedComposable.computed or one event handler. Do not create a
composable for one line, and do not wrap a VueUse call in useOurLocalStorage that adds nothing.The ladder above VueUse (platform, libraries, comparison) is meta:reuse-first; this skill is its
Vue rung.
// src/composables/useFeedSearch.ts — the feed filtered by words, with the query remembered per workspace.
import { computed, type Ref } from 'vue';
import { useLocalStorage, refDebounced } from '@vueuse/core';
import { matchesQuery, type FeedItem } from '@/lib/feed';
export const useFeedSearch = (items: Ref<FeedItem[]>, workspaceId: Ref<string>) => {
const query = useLocalStorage(computed(() => `feed-query:${workspaceId.value}`), '');
const debounced = refDebounced(query, 150);
const rows = computed(() => items.value.filter((item) => matchesQuery(item, debounced.value)));
return { query, rows };
};
use<Thing>, one file per composable in src/composables/ (or beside its feature),
the pure part in src/lib/ under a unit test.MaybeRefOrGetter) when they can change; use toValue inside.onScopeDispose (or let VueUse do it); a composable that adds a listener
removes it.createSharedComposable, or a store when the state is the app's (frontend-vue:state-pinia).onMounted or through a template ref.| It is | Then |
|---|---|
| local to one component and one line | inline |
| reusable behaviour with its own lifecycle | a composable |
| the app's state that several features read and write | a Pinia store |
| derived from props only | a computed in the component |
use*: name the VueUse function that was checked and why it did not fit, in the
PR or a one-line comment at the top of the file.grep -rn "addEventListener\|setInterval\|localStorage" src/components → nothing; those live
in composables, and in VueUse first.src/lib/, and the composable's return value
is an object of refs and functions.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
11 skills in this plugin
/bem-stylesBEM in scoped stylesUse when writing or reviewing the styles of a Vue component — the <style scoped> block, BEM class names for its block, elements and modifiers, state classes bound from the template, design tokens as CSS variables, SCSS inside the component, Stylelint complaints about selector patterns, or moving rules from a global stylesheet into a component. Also when two components share a class name by accident. NOT for the SCSS token system itself or rem sizing (frontend-css:scss-modules, frontend-css:rem), nor for React components (frontend-react:component-structure)./component-architectureComponent architectureUse before creating a Vue component or when deciding where one lives and what it may know — a reusable UI primitive, a feature component bound to the domain, a layout piece of the app chrome, a page or view, a component that only exists for one parent. Also when a component grew into two, when a feature reaches into another feature's component, when a page holds logic, or when asked "where does X go" in a Vue project. NOT for the inside of the .vue file (frontend-vue:sfc-conventions), nor for React (frontend-react:component-placement)./motionUse when adding or reviewing motion in a Vue app — a sheet or dialog that fades in, a list whose rows enter and leave, a highlight that pulses on new items, a route transition, a drawer that slides, a counter that animates, a skeleton shimmer — or when choosing between CSS transitions, Vue Transition and TransitionGroup, the View Transitions API, and a motion library. Also when motion must respect prefers-reduced-motion. NOT for the dot-animal or canvas drawing of a specific app, and NOT for React (Motion for React is its own choice)./nuxt-conventionsNuxt conventionsUse when the project is Nuxt 3 or 4 — creating pages, layouts, server routes or middleware, fetching data with useFetch or useAsyncData, relying on auto-imports, choosing rendering (SSR, SSG, SPA, hybrid routes), configuring modules in nuxt.config, handling runtime config and environment, or reviewing a Nuxt file placement. NOT for a plain Vite + Vue Router app (frontend-vue:component-architecture) and NOT for the inside of a component (frontend-vue:sfc-conventions)./sfc-conventionsSingle-file component conventionsUse when writing, editing or reviewing a Vue single-file component — the <script setup lang="ts"> block, props and emits and their types, defineModel, slots, template syntax, refs and computeds, watchers, lifecycle, the order of blocks in the .vue file, component and file naming. Also for converting an Options API or a JavaScript component to Composition API with TypeScript. NOT for where a component lives (frontend-vue:component-architecture), its styles (frontend-vue:bem-styles), a Pinia store (frontend-vue:state-pinia), or a reusable composable (frontend-vue:composables-vueuse)./skeleton-componentsSkeleton components — decide first, then build one beside the componentUse when a Vue component renders data that loads asynchronously and you must decide whether it needs a loading skeleton, or how to build one — a panel that shows a blank gap or a "Loading…" line while a Pinia store, useFetch, useAsyncState or a TanStack Query for Vue query is pending, a request to add a loading state, a Suspense fallback, a question whether to install a skeleton library, or a review of async-data UI. NOT for the shimmer animation itself or its reduced-motion rule (frontend-vue:motion), and NOT for React (frontend-react:skeleton-components).npx claudepluginhub aquivalabs/bladeforge --plugin frontend-vue