pinia
Create and maintain Pinia stores using Setup Stores pattern with TypeScript.
Skill by xiaoland
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/xiaoland-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
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
- Runs as
- Node.js package
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
- Create and maintain Pinia stores using Setup Stores pattern with TypeScript. Use when creating state management stores, defining store state/getters/actions, composing stores, or integrating with Vue components. Handles store architecture, type safety, and reactive state patterns.
- License
- Apache-2.0
- Compatibility
- Requires Vue 3, Pinia, TypeScript
- Metadata
- author: xiaoland · version: 1.0
- Instructions
- 132 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (5)
- SKILL.md
- storeName.ts · assets/
- composables.md · references/
- setup-stores.md · references/
- typescript.md · references/
SKILL.md (first lines)
---
name: pinia
description: Create and maintain Pinia stores using Setup Stores pattern with TypeScript. Use when creating state management stores, defining store state/getters/actions, composing stores, or integrating with Vue components. Handles store architecture, type safety, and reactive state patterns.
license: Apache-2.0
compatibility: Requires Vue 3, Pinia, TypeScript
metadata:
author: xiaoland
version: "1.0"
---
# Developing Pinia Stores
## When to use this skill
Use this skill when you need to:
- Create new Pinia stores for state management
- Define store state, getters, and actions
- Compose multiple stores together
- Integrate stores with Vue components
- Handle async operations in stores
- Refactor stores for better type safety or structure
## Store File Structure
- `storeName.ts`: Store definition with state, getters, and actions
- Place stores in `stores/` directory (e.g., `stores/user.ts`, `stores/cart.ts`)
- Use `use<Name>Store` naming convention (e.g., `useUserStore`, `useCartStore`)
## Instructions
### Creating a New Store
Follow these steps to create a new Pinia store:
1. **Create store file**: `stores/storeName.ts`
2. **Define the store** using Setup Store pattern:
- Import `defineStore` from Pinia
- Import `ref`, `computed` from Vue
- Define state as `ref()` values
- Define getters as `computed()` properties
- Define actions as plain functions
- Return all public state, getters, and actions
- See [setup-stores.md](references/setup-stores.md) for patterns
3. **Add TypeScript types**:
- Type all state refs explicitly
- Let TypeScript infer computed types when possible
- Type action parameters and return values
- See [typescript.md](references/typescript.md) for patterns
4. **Handle async operations** (if needed):
- Add loading/error state refs
- Use try/catch/finally in async actions
- Clean up state appropriately
### Modifying an Existing Store
1. **Understand current state**:
- Review existing state, getters, and actions
- Identify dependencies on other stores
2. **Make changes**:
- Add/modify state refs as needed
- Update getters if derived state changes
- Update actions for new behavior
- Ensure all new exports are returned
3. **Update consumers**:
- Check components using the store
- Update destructuring if new state/actions added
- Verify reactivity is preserved
### Using Stores in Components
```vue
<script setup lang="ts">
import { useCounterStore } from '@/stores/counter'
import { storeToRefs } from 'pinia'
const store = useCounterStore()
// Destructure reactive state/getters with storeToRefs
const { count, doubleCount } = storeToRefs(store)
// Actions can be destructured directly
const { increment, reset } = store
</script>
```
### Quality Checklist
Before completing work on any store, verify:
- [ ] Store uses Setup Store pattern (not Options API)
- [ ] All state is typed explicitly
- [ ] Getters use `computed()` for reactivity
- [ ] Async actions have loading/error handling
- [ ] No circular dependencies between stores
- [ ] Store is properly exported and named (`use<Name>Store`)
- [ ] Components use `storeToRefs()` for destructuring state
## Best Practices
**Naming**:
- Store IDs: lowercase with hyphens (`'user-settings'`)
- Store functions: `use<Name>Store` pattern (`useUserSettingsStore`)
- State: descriptive nouns (`items`, `currentUser`, `isLoading`)
- Getters: descriptive, often prefixed with `is`/`has`/`get` (`isLoggedIn`, `totalItems`)
- Actions: verbs describing the action (`fetchUser`, `addItem`, `reset`)
**State Management**:
- Keep stores focused on a single domain
- Prefer multiple small stores over one large store
- Use `shallowRef()` for large objects that don't need deep reactivity
- Initialize state with sensible defaultsFrom xiaoland/agents, Apache-2.0.
More from xiaoland/agents
- 0.414score
dev-vue-component
xiaoland
Create, modify, and maintain Vue 3 components with TypeScript and SCSS.
SkillDFreshness: DClaude Code +9 - 0.414score
vercel-ai-sdk-integration
xiaoland
Integrate Vercel AI SDK v6 with Vue.js applications (client-side).
SkillDFreshness: DClaude Code +9 - 0.414score
code-smell-checker
xiaoland
Review code for maintainability issues and classic code smells.
SkillDFreshness: DClaude Code +9 - 0.410score
develop-fastapi-app
zhanymkanov, xiaoland
Build production-ready FastAPI applications with best practices for project structure, async patterns, Pydantic models, dependency injection, database…
SkillDFreshness: DClaude Code +9 - 0.409score
typescript-best-practice
xiaoland
TypeScript best practices and patterns for writing clean, type-safe, and maintainable code.
SkillDFreshness: DClaude Code +9 - 0.409score
vue-story
xiaoland
Create and maintain Histoire stories for Vue 3 components.
SkillDFreshness: DClaude Code +9 - 0.406score
friendly-python
xiaoland
Practical guidance for writing, refactoring, and reviewing friendly Python code with a Pythonic, readable, and maintainable style.
SkillDFreshness: DClaude Code +9 - 0.405score
implement-design
xiaoland
Translates Figma designs into production-ready code with 1:1 visual fidelity.
SkillDFreshness: DClaude Code +9 - 0.405score
code-connect-components
xiaoland
Connects Figma design components to code components using Code Connect.
SkillDFreshness: DClaude Code +9 - 0.405score
mantic-sh
xiaoland
Use Mantic.sh for context-aware code search in local repositories.
SkillDFreshness: DClaude Code +9 - 0.396score
create-design-system-rules
xiaoland
Generates custom design system rules for the user's codebase.
SkillDFreshness: DClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jan 7, 2026 (9 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0
- License
- Apache-2.0
- Repository
- github.com/xiaoland/agents
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from xiaoland
- 0.414score
code-smell-checker
xiaoland
Review code for maintainability issues and classic code smells.
SkillDFreshness: DClaude Code +9 - 0.414score
dev-vue-component
xiaoland
Create, modify, and maintain Vue 3 components with TypeScript and SCSS.
SkillDFreshness: DClaude Code +9 - 0.414score
vercel-ai-sdk-integration
xiaoland
Integrate Vercel AI SDK v6 with Vue.js applications (client-side).
SkillDFreshness: DClaude Code +9 - 0.409score
typescript-best-practice
xiaoland
TypeScript best practices and patterns for writing clean, type-safe, and maintainable code.
SkillDFreshness: DClaude Code +9 - 0.409score
vue-story
xiaoland
Create and maintain Histoire stories for Vue 3 components.
SkillDFreshness: DClaude Code +9 - 0.406score
friendly-python
xiaoland
Practical guidance for writing, refactoring, and reviewing friendly Python code with a Pythonic, readable, and maintainable style.
SkillDFreshness: DClaude Code +9
Cite this page
pinia skill. Agent Mart. https://agentmart.dev/skills/xiaoland-pinia (last updated 2026-10-24)