{"id":"baa5a048-ca74-4741-bf36-6b3abb819c86","shortId":"JL4VYU","kind":"skill","title":"pinia","tagline":"Pinia 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.","description":"# Pinia\n\nPinia 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.\n\n> The skill is based on Pinia v3.0.4, generated at 2026-01-28.\n\n## Core References\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| Stores | Defining stores, state, getters, actions, storeToRefs, subscriptions | [core-stores](references/core-stores.md) |\n\n## Features\n\n### Extensibility\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| Plugins | Extend stores with custom properties, state, and behavior | [features-plugins](references/features-plugins.md) |\n\n### Composability\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| Composables | Using Vue composables within stores (VueUse, etc.) | [features-composables](references/features-composables.md) |\n| Composing Stores | Store-to-store communication, avoiding circular dependencies | [features-composing-stores](references/features-composing-stores.md) |\n\n## Best Practices\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| Testing | Unit testing with @pinia/testing, mocking, stubbing | [best-practices-testing](references/best-practices-testing.md) |\n| Outside Components | Using stores in navigation guards, plugins, middlewares | [best-practices-outside-component](references/best-practices-outside-component.md) |\n\n## Advanced\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| SSR | Server-side rendering, state hydration | [advanced-ssr](references/advanced-ssr.md) |\n| Nuxt | Nuxt integration, auto-imports, SSR best practices | [advanced-nuxt](references/advanced-nuxt.md) |\n| HMR | Hot module replacement for development | [advanced-hmr](references/advanced-hmr.md) |\n\n## Key Recommendations\n\n- **Prefer Setup Stores** for complex logic, composables, and watchers\n- **Use `storeToRefs()`** when destructuring state/getters to preserve reactivity\n- **Actions can be destructured directly** - they're bound to the store\n- **Call stores inside functions** not at module scope, especially for SSR\n- **Add HMR support** to each store for better development experience\n- **Use `@pinia/testing`** for component tests with mocked stores","tags":["pinia","skills","antfu","agent-skills"],"capabilities":["skill","source-antfu","skill-pinia","topic-agent-skills","topic-skills"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/antfu/skills/pinia","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add antfu/skills","source_repo":"https://github.com/antfu/skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 4987 github stars · SKILL.md body (2,345 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:45.574Z","embedding":null,"createdAt":"2026-04-18T20:25:28.146Z","updatedAt":"2026-05-18T18:52:45.574Z","lastSeenAt":"2026-05-18T18:52:45.574Z","tsv":"'-01':73 '-28':74 '2026':72 'action':85,230 'add':252 'advanc':173,185,198,208 'advanced-hmr':207 'advanced-nuxt':197 'advanced-ssr':184 'api':49,52 'app':26 'auto':192 'auto-import':191 'avoid':133 'base':66 'behavior':105 'best':141,154,168,195 'best-practices-outside-compon':167 'best-practices-test':153 'better':259 'bound':237 'call':241 'circular':134 'class':57 'communic':132 'complex':217 'compon':159,171,265 'compos':110,114,117,124,126,138,219 'composit':51 'core':75,89 'core-stor':88 'custom':101 'defin':15,81 'depend':135 'descript':78,95,112,144,175 'design':37 'destructur':225,233 'develop':206,260 'devtool':61 'direct':234 'especi':249 'etc':121 'experi':261 'extend':98 'extens':12,93 'featur':92,107,123,137 'features-compos':122 'features-composing-stor':136 'features-plugin':106 'first':56 'first-class':55 'function':244 'generat':70 'getter':84 'guard':164 'hmr':201,209,253 'hot':202 'hydrat':183 'implement':21 'import':193 'insid':243 'integr':62,190 'intuit':40 'key':211 'librari':7,34 'logic':218 'manag':6,33 'middlewar':166 'mock':151,268 'modul':203,247 'navig':163 'nuxt':188,189,199 'offici':3,31 'option':48 'outsid':158,170 'pattern':23 'pinia':1,2,27,28,68 'pinia/testing':150,263 'plugin':97,108,165 'practic':142,155,169,196 'prefer':213 'preserv':228 'properti':102 're':236 'reactiv':229 'recommend':212 'refer':76,79,96,113,145,176 'references/advanced-hmr.md':210 'references/advanced-nuxt.md':200 'references/advanced-ssr.md':187 'references/best-practices-outside-component.md':172 'references/best-practices-testing.md':157 'references/core-stores.md':91 'references/features-composables.md':125 'references/features-composing-stores.md':140 'references/features-plugins.md':109 'render':181 'replac':204 'safe':10,44 'scope':248 'server':179 'server-sid':178 'setup':214 'side':180 'skill':64 'skill-pinia' 'source-antfu' 'ssr':177,186,194,251 'state':5,32,83,103,182 'state/getters':226 'state/getters/actions':19 'store':16,22,80,82,90,99,119,127,129,131,139,161,215,240,242,257,269 'store-to-stor':128 'storetoref':86,223 'stub':152 'style':53 'subscript':87 'support':46,59,254 'test':146,148,156,266 'topic':77,94,111,143,174 'topic-agent-skills' 'topic-skills' 'type':9,43 'type-saf':8,42 'typescript':58 'unit':147 'use':13,115,160,222,262 'v3.0.4':69 'vue':4,25,36,116 'vueus':120 'watcher':221 'within':118 'work':17","prices":[{"id":"ae47c10b-d389-4eb8-ac8c-e54f4d79e719","listingId":"baa5a048-ca74-4741-bf36-6b3abb819c86","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"antfu","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T20:25:28.146Z"}],"sources":[{"listingId":"baa5a048-ca74-4741-bf36-6b3abb819c86","source":"github","sourceId":"antfu/skills/pinia","sourceUrl":"https://github.com/antfu/skills/tree/main/skills/pinia","isPrimary":false,"firstSeenAt":"2026-04-18T21:53:47.615Z","lastSeenAt":"2026-05-18T18:52:45.574Z"},{"listingId":"baa5a048-ca74-4741-bf36-6b3abb819c86","source":"skills_sh","sourceId":"antfu/skills/pinia","sourceUrl":"https://skills.sh/antfu/skills/pinia","isPrimary":true,"firstSeenAt":"2026-04-18T20:25:28.146Z","lastSeenAt":"2026-05-07T22:40:16.574Z"}],"details":{"listingId":"baa5a048-ca74-4741-bf36-6b3abb819c86","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"antfu","slug":"pinia","github":{"repo":"antfu/skills","stars":4987,"topics":["agent-skills","skills"],"license":"mit","html_url":"https://github.com/antfu/skills","pushed_at":"2026-05-01T16:46:24Z","description":"Anthony Fu's curated collection of agent skills.","skill_md_sha":"89cfa7dedeb3f9786c74ebfa03bd4415d5844abe","skill_md_path":"skills/pinia/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/antfu/skills/tree/main/skills/pinia"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"pinia","description":"Pinia 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."},"skills_sh_url":"https://skills.sh/antfu/skills/pinia"},"updatedAt":"2026-05-18T18:52:45.574Z"}}