Skills
Skill 5 of 19
Pinia official Vue state management library, type-safe and extensible.
1 minute · 199 words · 7 sections
Install
npx skills add antfu/skills --skill pinianpx skills add antfu/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
Pinia is the official state management library for Vue, designed to be intuitive and type-safe. It supports both Options API and Composition API styles, with first-class TypeScript support and devtools integration.
The skill is based on Pinia v3.0.4, generated at 2026-01-28.
| Topic | Description | Reference |
|---|---|---|
| Stores | Defining stores, state, getters, actions, storeToRefs, subscriptions | core-stores (opens in a new tab) |
| Topic | Description | Reference |
|---|---|---|
| Plugins | Extend stores with custom properties, state, and behavior | features-plugins (opens in a new tab) |
| Topic | Description | Reference |
|---|---|---|
| Composables | Using Vue composables within stores (VueUse, etc.) | features-composables (opens in a new tab) |
| Composing Stores | Store-to-store communication, avoiding circular dependencies | features-composing-stores (opens in a new tab) |
| Topic | Description | Reference |
|---|---|---|
| Testing | Unit testing with @pinia/testing, mocking, stubbing | best-practices-testing (opens in a new tab) |
| Outside Components | Using stores in navigation guards, plugins, middlewares | best-practices-outside-component (opens in a new tab) |
| Topic | Description | Reference |
|---|---|---|
| SSR | Server-side rendering, state hydration | advanced-ssr (opens in a new tab) |
| Nuxt | Nuxt integration, auto-imports, SSR best practices | advanced-nuxt (opens in a new tab) |
| HMR | Hot module replacement for development | advanced-hmr (opens in a new tab) |
storeToRefs() when destructuring state/getters to preserve reactivity@pinia/testing for component tests with mocked storesPinia official Vue state management library, type-safe and extensible. Use when defining stores, working with state/getters/actions, or implementing store patterns in Vue apps.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
main, last pushed 23 June 2026.SKILL.md, not by matching a directory convention. One layout observed: skills/*/SKILL.md.h1 and no skipped levels:/antfu/skills.md, and each skill at its own .md URL.10 files · 28 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 5.
Documentation the agent loads on demand, rather than up front.
Everything else published alongside the skill.