AgentSkillsCN

pinia-best-practices

Pinia store的TypeScript配置与类型问题。涵盖storeToRefs类型丢失、getter循环引用以及setup store模式等问题。适用于在Vue 3项目中使用Pinia store、调试store类型错误或修复storeToRefs类型推断时使用。

SKILL.md
--- frontmatter
name: pinia-best-practices
description: 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.
license: MIT
metadata:
  author: hyf0
  version: "1.0.0"

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.

RuleImpactDescription
storeToRefs-type-lossHIGHFix incorrect nested ref types with Vue 3.5+

Efficiency Rules

Rules that help AI solve problems more effectively and consistently.

RuleImpactDescription
getters-circular-typesMEDIUMFix TypeScript any or circular errors in getters using this

Reference