From harness-claude
Manages shared application state across Vue components with Pinia stores in Options or Setup style. Replaces Vuex in Vue 3 apps with DevTools support.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Manage shared application state with Pinia stores in the Options or Setup style
Guides Pinia for Vue state management: defining stores, state/getters/actions, plugins, composables, testing, SSR, Nuxt integration, and HMR.
Guides Pinia state management in Vue: defining stores, state/getters/actions, plugins, composables, testing, SSR, HMR, Nuxt integration.
Provides Pinia best practices for Vue: store setup fixes, reactivity pitfalls like destructuring/methods, state patterns including URL-synced filters and large-app conventions.
Share bugs, ideas, or general feedback.
Manage shared application state with Pinia stores in the Options or Setup style
defineStore('id', { state, getters, actions }) or the Setup syntax.defineStore('id', () => { ... }).storeToRefs() when destructuring reactive state from a store.import { defineStore } from 'pinia';
import { ref, computed } from 'vue';
export const useCounterStore = defineStore('counter', () => {
const count = ref(0);
const doubled = computed(() => count.value * 2);
function increment() {
count.value++;
}
return { count, doubled, increment };
});
const store = useCounterStore().store.$reset() (Options API stores only) to reset state to initial values.Pinia is the official state management library for Vue 3. It replaces Vuex with a simpler, type-safe API. Pinia stores are reactive — components that use store state automatically re-render when it changes. Stores are lazy-loaded on first use.
Trade-offs:
provide/inject or composables may suffice$reset() — you must implement reset logic manuallyWhen NOT to use:
ref() or reactive() in <script setup>provide/injecthttps://patterns.dev/vue/pinia-pattern