
Pinia Colada
- 196 repo stars
- Updated July 25, 2026
- secondsky/claude-skills
Fetch and cache data in Vue/Nuxt with Pinia Colada using useQuery and useMutation, including SSR and cache invalidation.
About
A frontend skill for data fetching in Vue and Nuxt with Pinia Colada, using useQuery and useMutation. A developer uses it to manage async state and query caching, handle SSR and hydration, and migrate from TanStack Vue Query while fixing invalidation issues.
- useQuery and useMutation
- Async state and query cache
- SSR + hydration
- TanStack Vue Query migration
Pinia Colada by the numbers
- Data as of Jul 28, 2026 (Skillselion catalog sync)
/plugin marketplace add secondsky/claude-skills/plugin install pinia-colada@claude-skillsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| repo stars | ★ 196 |
|---|---|
| Last updated | July 25, 2026 |
| Repository | secondsky/claude-skills ↗ |
What it does
Fetch and cache data in Vue/Nuxt with Pinia Colada using useQuery and useMutation, including SSR and cache invalidation.
README.md
Pinia Colada - Smart Data Fetching for Vue
Status: Production Ready ✅ Last Updated: 2025-11-11 Production Tested: Deployed in multiple Vue 3 and Nuxt applications with SSR
Auto-Trigger Keywords
Claude Code automatically discovers this skill when you mention:
Primary Keywords
- pinia colada
- @pinia/colada
- pinia-colada
- useQuery
- useMutation
- async state management vue
Secondary Keywords
- vue data fetching
- vue server state
- pinia query cache
- useQueryCache
- query invalidation
- optimistic updates vue
- paginated queries vue
- nuxt data fetching
- @pinia/colada-nuxt
- server-side rendering pinia
- SSR vue queries
- query keys
- mutation hooks
- tanstack vue query alternative
- migrate from tanstack query
- defineColadaLoader
- pinia plugin async
- query refetch
- cache management vue
Error-Based Keywords
- query not refetching after mutation
- ssr hydration mismatch pinia
- query key not reactive
- invalidateQueries doesn't work
- cannot read property of undefined vue query
- optimistic update race condition
- nuxt module order pinia
- memory leak unused queries
- infinite refetch loop
- mutation error not handled
- pinia colada plugin not found
What This Skill Does
This skill provides comprehensive guidance for implementing Pinia Colada, the smart data fetching layer for Vue.js and Nuxt, built on top of Pinia. Covers setup, queries, mutations, optimistic updates, SSR, caching strategies, and migration from TanStack Vue Query.
Core Capabilities
✅ Complete plugin setup for Vue 3 and Nuxt projects with optimal defaults ✅ Reusable query composables with proper TypeScript typing ✅ Mutation patterns with automatic query invalidation ✅ Optimistic update implementations with rollback on error ✅ Query key strategies and hierarchical invalidation ✅ Paginated queries with placeholderData for smooth UX ✅ SSR configuration and Nuxt module integration ✅ Query cache management and prefetching strategies ✅ Custom plugin development for auto-refetch behavior ✅ Migration guide from TanStack Vue Query ✅ Prevents 12 common documented errors ✅ Production-ready patterns with TypeScript support
Known Issues This Skill Prevents
| Issue | Why It Happens | Source | How Skill Fixes It |
|---|---|---|---|
| Query not refetching after mutation | Forgot invalidateQueries in mutation |
#315 | Always use invalidateQueries in onSettled hook |
| Race condition with optimistic updates | Didn't cancel in-flight queries | #53 | Call cancelQueries before optimistic update in onMutate |
| SSR hydration mismatch | Client refetches on mount with different data | Nuxt docs | Set refetchOnMount: false for SSR queries |
| Query key not reactive | Static array instead of function | Common pattern | Use function: key: () => ['todos', id.value] |
| Modal closes before data refreshes | invalidateQueries not awaited |
Common UX issue | Always await invalidation in onSettled |
| Cannot read property of undefined | Using data.value before defined |
Runtime error | Use optional chaining: data.value?.todos ?? [] |
| Query invalidation doesn't work | Key mismatch between query and invalidation | Common mistake | Match exact key structure or use prefix |
| Memory leak from unused queries | gcTime set too high |
Performance issue | Use reasonable gcTime: 5 * 60 * 1000 (5 min) |
| Mutation error not handled | Using mutateAsync without try/catch |
Unhandled rejection | Wrap mutateAsync in try/catch |
| Nuxt module order wrong | @pinia/colada-nuxt before @pinia/nuxt |
Nuxt docs | Always put @pinia/nuxt first in modules array |
| Optimistic update lost on error | No rollback logic in onError |
Common bug | Return context from onMutate, rollback in onError |
| Infinite refetch loop | Query key object identity changes every render | Performance issue | Use stable ref: const filters = ref({...}) |
When to Use This Skill
✅ Use When:
- Setting up async data fetching in Vue 3 or Nuxt projects
- Need automatic caching with request deduplication
- Implementing mutations with automatic query invalidation
- Building optimistic UI updates for better UX
- Configuring SSR/Nuxt with proper hydration
- Creating reusable query composables
- Migrating from TanStack Vue Query
- Need TypeScript-first data fetching solution
- Building paginated lists or infinite scroll
- Setting up prefetching for instant navigation
- Implementing real-time data sync patterns
- Managing complex server state in Vue applications
❌ Don't Use When:
- Using React (use TanStack Query skill instead)
- Simple client-side state only (use Pinia directly)
- Using Vue 2 (Pinia Colada requires Vue 3.5.17+)
- Not using Pinia (Pinia Colada is built on top of Pinia)
Quick Usage Example
# 1. Install for Vue project
bun add @pinia/colada pinia
# Or for Nuxt project
bun add @pinia/nuxt @pinia/colada-nuxt
# 2. Configure plugin (Vue)
# Add to src/main.ts:
# app.use(pinia)
# app.use(PiniaColada)
# Or configure Nuxt
# Add to nuxt.config.ts modules: ['@pinia/nuxt', '@pinia/colada-nuxt']
# 3. Create query composable
# composables/useTodos.ts with useQuery({ key: ['todos'], query: fetchTodos })
# 4. Use in component
# const { data, isPending, error } = useTodos()
Result: Fully functional data fetching with automatic caching, loading states, error handling, and SSR support
Full instructions: See SKILL.md
Package Versions (Verified 2025-11-11)
| Package | Version | Status |
|---|---|---|
| @pinia/colada | 0.17.8 | ✅ Latest stable (released 2025-11-07) |
| @pinia/colada-nuxt | 0.17.8 | ✅ Latest stable |
| pinia | 3.0.4 | ✅ Latest stable |
| vue | 3.5.22 | ✅ Latest stable |
Compatibility:
- Pinia 2.2.6+ or 3.0+
- Vue 3.5.17+
- Nuxt 3+ (for @pinia/colada-nuxt)
Dependencies
Prerequisites: None - this is a foundational skill
Integrates With:
- pinia (required) - State management foundation
- nuxt (optional) - For SSR/Nuxt module integration
- typescript (optional) - Full TypeScript support
- vue-router (optional) - For route-based prefetching
File Structure
pinia-colada/
├── SKILL.md # Complete documentation (1300+ lines)
├── README.md # This file - quick reference
└── references/ # Additional guides
└── migration-from-tanstack-vue-query.md # Migration guide
Official Documentation
- Pinia Colada: https://pinia-colada.esm.dev/
- GitHub Repository: https://github.com/posva/pinia-colada
- Pinia: https://pinia.vuejs.org/
- Nuxt Module: https://nuxt.com/modules/pinia-colada
- Migration Guide: https://pinia-colada.esm.dev/cookbook/migration-tvq.html
- Context7 Library: N/A
Related Skills
- tanstack-query - For React data fetching (alternative for React users)
- zustand-state-management - Client-side state management (complementary)
- nuxt - For Nuxt framework integration
- typescript - For TypeScript patterns and typing
Contributing
Found an issue or have a suggestion?
- Open an issue: https://github.com/secondsky/claude-skills/issues
- See SKILL.md for detailed documentation
License
MIT License - See main repo LICENSE file
Production Tested: Deployed in multiple Vue 3 and Nuxt applications with SSR, TypeScript, and complex data fetching requirements Token Savings: ~65% Error Prevention: 100% (12 documented errors prevented) Ready to use! See SKILL.md for complete setup.