/frontend-vue:state-piniafrom frontend-vue
Use when a Vue app needs state that more than one component reads or writes — the current user or workspace, lists from the server, selections, filters, marks — or when creating, editing, reviewing or splitting a Pinia store, deciding whether something belongs in a store at all, loading server data into one, or wiring server state through TanStack Query for Vue. NOT for behaviour composables (frontend-vue:composables-vueuse), not for component-local state (frontend-vue:sfc-conventions).
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 Pinia installed, and state that crosses component boundaries.
Out: one setup-syntax store per domain concept, holding only the app's state and the actions that
change it; server data either lives in the store with explicit loading and error state or goes through
TanStack Query for Vue; components read through the store's refs and computeds and never mutate
foreign state directly. The checkable expectations are in evals/rubric.json.
| State | Home |
|---|---|
| read or written by several features, or must survive navigation | a Pinia store |
| the server's answer to a query, cached, refetched, invalidated | TanStack Query for Vue; a store only when the project does not use it |
| behaviour with a lifecycle (listeners, timers) | a composable (frontend-vue:composables-vueuse) |
| derived from props, or local to one component | the component |
// src/features/workspace/workspace.store.ts — the open workspace and what the server computed for it.
import { defineStore } from 'pinia';
import { ref, shallowRef, computed } from 'vue';
import { getState, postMarks, type WorkspaceState, type Marks } from '@/api/workspace';
import { openCount } from '@/lib/moves';
export const useWorkspaceStore = defineStore('workspace', () => {
const id = ref('');
const snapshot = shallowRef<WorkspaceState | null>(null);
const loading = ref(false);
const error = ref<string | null>(null);
const moves = computed(() => (snapshot.value ? openCount(snapshot.value.turn, snapshot.value.marks) : 0));
const load = async (workspaceId: string) => {
loading.value = true;
error.value = null;
try {
snapshot.value = await getState(workspaceId);
id.value = workspaceId;
} catch (cause) {
error.value = cause instanceof Error ? cause.message : String(cause);
} finally {
loading.value = false;
}
};
const mark = async (marks: Partial<Marks>) => {
if (!snapshot.value) {
return;
}
snapshot.value = { ...snapshot.value, marks: await postMarks(id.value, marks) };
};
return { id, snapshot, loading, error, moves, load, mark };
});
defineStore(id, () => { … })), never the options object.<feature>.store.ts).store.snapshot = … from outside.shallowRef replaced wholesale, not a deep reactive tree.const store = useWorkspaceStore() then store.moves, or
storeToRefs(store) when destructuring. Never destructure the store itself.useLocalStorage from VueUse inside the store, or a Pinia persistence
plugin the project already has; no hand-written localStorage calls.useQuery with a key that
includes the identifiers, useMutation with invalidation; the store then holds selections and
preferences only. Choosing between the two is a meta:reuse-first decision written once per
project in its ADR.grep -rn "defineStore(" src → every store is the setup form and one concept.grep -rn "store\.[a-z]* = " src/components src/features --include=*.vue → nothing: components
go through actions.grep -rn "localStorage" src/features/*/*.store.ts → nothing hand-written.loading and error for every async action, and the component shows them.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub aquivalabs/bladeforge --plugin frontend-vue11 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)./composables-vueuseComposables, VueUse firstUse 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)./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).