pinia
Pinia state management for Vue 3 using Composition API (Setup Stores) — TypeScript-first, storeToRefs for reactivity, focused stores, and API calls in…
Skill by Vũ Lưu
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/vuluu2k-pinia
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/pinia
What's inside
- Skill name
pinia- Description
- Pinia state management for Vue 3 using Composition API (Setup Stores) — TypeScript-first, storeToRefs for reactivity, focused stores, and API calls in composables. Use when the project uses Vue 3 Composition API / <script setup>.
- License
- MIT
- Metadata
- author: Vũ Lưu · source: Hand-written based on https://pinia.vuejs.org and instructions/pinia.md · version: 2026.3.23
- Instructions
- 98 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (4)
- SKILL.md
- api-in-composables.md · references/
- setup-stores.md · references/
- using-in-components.md · references/
SKILL.md (first lines)
# Pinia (Composition API / Setup Stores)
> This skill focuses on **Setup Stores** with TypeScript and using them inside **Composition API / `<script setup>`** components.
## Key Rules (from instructions)
- **Prefer TypeScript** over JavaScript for all stores and composables.
- **Use `storeToRefs`** when destructuring state from stores to maintain reactivity.
- **Prefer smaller, focused stores** over large monolithic stores.
- **Keep API calls in separate composable functions** — do not embed them directly in store actions.
## Core
| Topic | Description | Reference |
|-------|-------------|-----------|
| Setup Stores | Define stores with `ref`, `computed`, functions inside `defineStore` | [setup-stores](references/setup-stores.md) |
| Using in Components | `storeToRefs`, direct action calls in `<script setup>` | [using-in-components](references/using-in-components.md) |
| API in Composables | Separate API calls from store actions via composable functions | [api-in-composables](references/api-in-composables.md) |
## Quick Reference
### Define a Setup Store (TypeScript)
```ts
// stores/counter.ts
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const name = ref('My App')
const doubled = computed(() => count.value * 2)
function increment() {
count.value++
}
return { count, name, doubled, increment }
})
```
### Use in a `<script setup>` Component
```vue
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { useCounterStore } from '@/stores/counter'
const store = useCounterStore()
// ✅ Use storeToRefs to keep reactivity when destructuring state/getters
const { count, doubled } = storeToRefs(store)
// ✅ Actions can be destructured directly (they are plain functions)
const { increment } = store
</script>
<template>
<p>Count: {{ count }} | Doubled: {{ doubled }}</p>
<button @click="increment">Increment</button>
</template>
```
### API Calls in Composables (not in stores)
```ts
// composables/useCounterApi.ts
import { useCounterStore } from '@/stores/counter'
export function useCounterApi() {
const store = useCounterStore()
async function fetchCount() {
const data = await fetch('/api/counter').then(r => r.json())
store.count = data.count
}
return { fetchCount }
}
```
```vue
<script setup lang="ts">
import { useCounterApi } from '@/composables/useCounterApi'
const { fetchCount } = useCounterApi()
</script>
```
## Key Rules Detail
- **Never** call `useStore()` at module top-level — only inside `setup()` / `<script setup>` / composables.
- `storeToRefs` extracts **reactive refs** for state and getters; actions remain plain functions and don't need `storeToRefs`.
- Each store should represent **one domain concern** — split user, cart, notifications into separate stores.
- Store actions should orchestrate state mutations only; delegate HTTP/fetch calls to composables.From vuluu2k/skills, MIT.
More from vuluu2k/skills
- 0.434score
pinia-options
Vũ Lưu
Pinia state management for Vue using Options API style — define stores with state, getters, actions, and use them in Options API components via…
SkillDFreshness: D★ 1Claude Code +9 - 0.433score
builderx_spa-permission
Vũ Lưu
Rule-based permission checking in BuilderX SPA using bitwise operations from @/composable/employeePermission.
SkillDFreshness: D★ 1Claude Code +9 - 0.433score
builderx_spa-api
Vũ Lưu
Standardized API fetching for BuilderX SPA using useApiget, useApipost, useApiDelete, and useApiProgress from @/composable/fetch.
SkillDFreshness: D★ 1Claude Code +9 - 0.433score
builderx_spa-design
Vũ Lưu
Standardized design system for BuilderX SPA.
SkillDFreshness: D★ 1Claude Code +9 - 0.430score
landing_page-contexts
Vũ Lưu
Guide to Context module patterns in landing_page_backend — Ecto queries, dynamic query building, Ecto.Multi, and Outbox messaging.
SkillDFreshness: D★ 1Claude Code +9 - 0.430score
landing_page-controllers
Vũ Lưu
Guide to Phoenix Controller structure in landing_page_backend using FallbackController, tuple responses, and permission plugs.
SkillDFreshness: D★ 1Claude Code +9 - 0.430score
builderx_api-schemas
Vũ Lưu
Guidelines for creating Ecto Schemas in builderx_api, including composite primary keys, custom json function and Ecto.Changeset.
SkillDFreshness: D★ 1Claude Code +9 - 0.430score
landing_page-vue2-editor
Vũ Lưu
Vue 2 Options API patterns for the Landing Page editor — Vuex namespaced stores, Ant Design Vue components, mixins, computed getters/setters, and axios API…
SkillDFreshness: D★ 1Claude Code +9 - 0.430score
landing_page-plugs
Vũ Lưu
Custom Plug middleware patterns in landing_page_backend — authentication (JWT/Passport), authorization, permission checking, and rate limiting.
SkillDFreshness: D★ 1Claude Code +9 - 0.430score
landing_page-schemas
Vũ Lưu
Guidelines for creating Ecto Schemas in landing_page_backend, including binary UUID primary keys, virtual fields, custom json/1 function, and multiple…
SkillDFreshness: D★ 1Claude Code +9 - 0.427score
builderx_api-controllers
Vũ Lưu
Guide to Phoenix Controller structure in builderx_api using FallbackController and standard tuple responses.
SkillDFreshness: D★ 1Claude Code +9 - 0.426score
deepinfra
Vũ Lưu
Guide to setting up and using DeepInfra API for LLM and image generation models.
SkillDFreshness: D★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Mar 23, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 2026.3.23
- License
- MIT
- Repository
- github.com/vuluu2k/skills
- Website
- vskill.vercel.app
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Vũ Lưu
- 0.434score
pinia-options
Vũ Lưu
Pinia state management for Vue using Options API style — define stores with state, getters, actions, and use them in Options API components via…
SkillDFreshness: D★ 1Claude Code +9 - 0.433score
builderx_spa-permission
Vũ Lưu
Rule-based permission checking in BuilderX SPA using bitwise operations from @/composable/employeePermission.
SkillDFreshness: D★ 1Claude Code +9 - 0.433score
builderx_spa-api
Vũ Lưu
Standardized API fetching for BuilderX SPA using useApiget, useApipost, useApiDelete, and useApiProgress from @/composable/fetch.
SkillDFreshness: D★ 1Claude Code +9 - 0.433score
builderx_spa-design
Vũ Lưu
Standardized design system for BuilderX SPA.
SkillDFreshness: D★ 1Claude Code +9 - 0.430score
builderx_api-schemas
Vũ Lưu
Guidelines for creating Ecto Schemas in builderx_api, including composite primary keys, custom json function and Ecto.Changeset.
SkillDFreshness: D★ 1Claude Code +9 - 0.430score
landing_page-contexts
Vũ Lưu
Guide to Context module patterns in landing_page_backend — Ecto queries, dynamic query building, Ecto.Multi, and Outbox messaging.
SkillDFreshness: D★ 1Claude Code +9
Cite this page
pinia skill. Agent Mart. https://agentmart.dev/skills/vuluu2k-pinia (last updated 2026-10-24)