vue-create-pinia-store

Creates Pinia Setup Stores in Vue 3 with TypeScript-safe state and explicit returns.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/bmslabs/bmlabs-projects-templates --skill vue-create-pinia-store
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-create-pinia-store
Source: https://github.com/bmslabs/bmlabs-projects-templates/tree/main/view-vuejs/.github/skills/vue-create-pinia-store
Command: npx skills add https://github.com/bmslabs/bmlabs-projects-templates --skill vue-create-pinia-store

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes the creation of Pinia stores using the Setup Store pattern, ensuring strongly typed state, predictable reactivity, and consistent APIs across components.

Core Features & Use Cases

  • Setup Store-first pattern with defineStore and a return that exposes state, getters, and actions
  • Strong typing with TypeScript and safe destructuring via storeToRefs
  • Clear guidance for using stores inside guards and services, avoiding module-level useStore calls

Quick Start

Create or update a Pinia store using the Setup Store pattern and access it with storeToRefs.

Frequently Asked Questions about vue-create-pinia-store

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a type-safe Pinia store using the Setup Store pattern in Vue 3?

To create a type-safe Pinia store, use the Setup Store pattern with defineStore, returning state, getters, and actions explicitly while disallowing any 'any' types in the state. This enforces strong typing and consistent reactivity across components.

Why does my Pinia store lose reactivity when destructuring state in Vue 3?

Destructuring Pinia store state loses reactivity because properties are detached from the reactive proxy. To maintain reactivity, use the storeToRefs function for safe destructuring, which properly wraps state and getters as refs.

What is the best way to use Pinia stores inside Vue guards and services?

The best way to use Pinia stores in guards and services is to avoid module-level useStore calls. Instead, instantiate the store within the guard or service execution context to ensure the active Pinia instance is available.

Does the Pinia Setup Store pattern support explicit reset actions for typed state?

Yes, the Pinia Setup Store pattern supports explicit reset actions. When using defineStore with the setup function, you define and return a custom reset action to restore the typed state to its initial values.

When should I not use the 'any' type in Pinia store state?

You should never use the 'any' type in Pinia store state when applying standardized Setup Store patterns. Disallowing 'any' ensures strongly typed state, predictable reactivity, and consistent APIs across your Vue 3 components.