pinia
Skill8 starsChanged 3 months agoMITView on GitHub
Pinia state management for Vue 3. Use defineStore() with Composition API style (setup stores). Covers store definition, state, getters, actions, TypeScript, store composition, SSR, and best practices.
- Installs packages
- Sends data out
24 other projects use a version of this.
Adopted by
Most recently taken up by
- oberemokis/skillstheir own version, first seen Nov 29, 2026
- martinholovsky/claude-skills-generatortheir own version, first seen Nov 29, 2026
- onmax/nuxt-skillstheir own version, first seen Nov 26, 2026
- thanhdat2508/agent-skillstheir own version, first seen Nov 22, 2026
- full-stack-skills/vue-skillstheir own version, first seen Nov 22, 2026
- ragna-ai/ragna-studiotheir own version, first seen Nov 16, 2026
Used with
Projects with it also use nitro.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillnitro
Build and deploy universal JavaScript servers with Nitro v3. Use when working with nitro.config.ts, defineNitroConfig, defineHandler, defineConfig, server.ts entry, filesystem routing, route rules, useStorage, defineCachedHandler, useDatabase, definePlugin, runtime hooks, Vercel/Cloudflare deployment, or migrating from Nitro v2/nitropack.
Also in 5 projects that use this
Other versions24 projects use a version of this.
Word for word · 1
- belos-street/skill-kit★ 8100% same
Edited · 0
None found.
Wrote their own version · 23
- moeru-ai/airi★ 52ksame name
- antfu/skills★ 6.1ksame name
- onmax/nuxt-skills★ 731same name
- oyjt/uniapp-vue3-template★ 628same name
- JetBrains/skills★ 386same name
- konnga/skill-buddy★ 149same name
- uni-helper/skills★ 107same name
- martinholovsky/claude-skills-generator★ 48same name
- Contentrain/studio★ 4same name
- full-stack-skills/vue-skills★ 4same name
13 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/nestjs-best-practices/AGENTS.mdAGENTS.md
- skills/react-native-skills/AGENTS.mdAGENTS.md
- ai-collab-system-bootstrapSkill
- ant-design-vueSkill
- belos-streetSkill
- bunSkill
- fastify-best-practicesSkill
- frontend-designSkill
- golang-best-practicesSkill
- grill-meSkill
- langchainSkill
- nestjs-best-practicesSkill
- nextjsSkill
- ragSkill
- react-best-practicesSkill
- react-best-practicesSkill
- react-native-skillsSkill
- reactSkill
- brainstormingSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- superpowersSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
- ui-templatesSkill
- unocssSkill
- vibe-flowSkill
- vue-best-practicesSkill
- vue-router-best-practicesSkill
- vueSkill
- zustandSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 21 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 55
When to use Pinia vs provide/inject → See pinia-vs-provide-inject
“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pinia state management for Vue 3 using Composition API style stores.
Store Definition
- Defining stores with defineStore() → See define-store-composition-api
- Choosing between setup stores and options stores → See setup-vs-options-store
- Organizing store files and directory structure → See store-organization
- Using store composables in components → See store-in-components
- Creating reusable store patterns → See store-composition-patterns
State
- Mutating state directly vs using actions → See state-mutation-best-practices
- Resetting state to initial values → See state-reset-pattern
- Using reactive vs ref for state → See state-reactive-vs-ref
- State persistence with localStorage → See state-persistence
- Deep reactivity with nested objects → See state-deep-reactivity
- State hydration from API → See state-hydration
Getters
- Getters not caching computed values → See getter-computed-caching
- Passing arguments to getters → See getter-pass-arguments
- Accessing other store getters → See getter-cross-store-access
- Getter performance with expensive operations → See getter-performance-optimization
Actions
- Async actions and error handling → See action-async-error-handling
- Calling actions from other stores → See action-cross-store-calls
- Action composition and reusability → See action-composition-patterns
- Batch state updates in actions → See action-batch-updates
- Testing actions with mocked dependencies → See action-testing-strategies
TypeScript
- Typing store state with interfaces → See typescript-state-typing
- Typing getters and actions → See typescript-getters-actions-typing
- Using Pinia with TypeScript generics → See typescript-generic-stores
- Type-safe store composition → See typescript-store-composition
- Type inference for auto-imported stores → See typescript-auto-import-types
Store Composition
- Combining multiple stores → See store-composition
- Avoiding circular dependencies between stores → See store-circular-dependencies
- Shared state across stores → See store-shared-state
- Extracting common store logic → See store-logic-extraction
Best Practices
- Store size and performance → See store-performance-optimization
- When to use Pinia vs provide/inject → See pinia-vs-provide-inject
- Testing Pinia stores → See testing-pinia-stores
- Migrating from Vuex to Pinia → See migrating-from-vuex
Quick Reference
Basic Setup Store (Composition API)
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const doubleCount = computed(() => count.value * 2)
function increment() {
count.value++
}
function $reset() {
count.value = 0
}
return { count, doubleCount, increment, $reset }
})Using Store in Component
<script setup lang="ts">
import { useCounterStore } from '@/stores/counter'
const counter = useCounterStore()
</script>
<template>
<div>
<p>Count: {{ counter.count }}</p>
<p>Double: {{ counter.doubleCount }}</p>
<button @click="counter.increment">Increment</button>
</div>
</template>Store with TypeScript
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
interface User {
id: number
name: string
email: string
}
export const useUserStore = defineStore('user', () => {
const user = ref<User | null>(null)
const isAuthenticated = computed(() => user.value !== null)
async function login(email: string, password: string) {
const response = await fetch('/api/login', {
method: 'POST',
body: JSON.stringify({ email, password })
})
user.value = await response.json()
}
function logout() {
user.value = null
}
return { user, isAuthenticated, login, logout }
})Store Composition
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { useAuthStore } from './auth'
import { useCartStore } from './cart'
export const useCheckoutStore = defineStore('checkout', () => {
const authStore = useAuthStore()
const cartStore = useCartStore()
const isProcessing = ref(false)
async function checkout() {
if (!authStore.isAuthenticated) {
throw new Error('User not authenticated')
}
isProcessing.value = true
try {
await processPayment(cartStore.items)
cartStore.clear()
} finally {
isProcessing.value = false
}
}
return { isProcessing, checkout }
})Key Imports
// Core
import { defineStore } from 'pinia'
import { createPinia } from 'pinia'
// Vue Composition API (used in setup stores)
import { ref, reactive, computed, watch } from 'vue'
// Store instance
import { storeToRefs } from 'pinia'
// Type utilities
import type { StoreDefinition } from 'pinia'Installation
npm install pinia
# or
yarn add pinia
# or
pnpm add piniaSetup in main.ts
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
const app = createApp(App)
const pinia = createPinia()
app.use(pinia)
app.mount('#app')Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

