# Pinia Best Practices

> Pinia store TypeScript configuration and typing issues. Covers storeToRefs type loss, getters circular references, and setup store patterns. Use when working with Pinia stores in Vue 3 projects, debugging store type errors, or fixing storeToRefs type inference. Use when this capability is needed.

- Skill: `tomevault-io/pinia-best-practices` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/pinia-best-practices`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/pinia-best-practices/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/pinia-best-practices

---


# Pinia Best Practices

TypeScript configuration and common pitfalls for Pinia stores in Vue 3 applications.

## When to Apply

- Working with Pinia stores in TypeScript projects
- Debugging `storeToRefs` type issues
- Fixing getter circular type references
- Setting up type-safe store patterns

---

## Capability Rules

Rules that enable AI to solve problems it cannot solve without the skill.

| Rule | Impact | Description |
|------|--------|-------------|
| [storeToRefs-type-loss](rules/storeToRefs-type-loss.md) | HIGH | Fix incorrect nested ref types with Vue 3.5+ |

---

## Efficiency Rules

Rules that help AI solve problems more effectively and consistently.

| Rule | Impact | Description |
|------|--------|-------------|
| [getters-circular-types](rules/getters-circular-types.md) | MEDIUM | Fix TypeScript `any` or circular errors in getters using `this` |

---

## Reference

- [Pinia Documentation](https://pinia.vuejs.org/)
- [Pinia TypeScript Guide](https://pinia.vuejs.org/core-concepts/#typescript)

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/jianxcao) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

