pinia
하는 일
이 스킬은 Vue의 공식 상태 라이브러리인 Pinia로 Vue 앱의 공유 데이터를 정리하는 방법을 설명합니다. 앱의 여러 부분에서 같은 데이터가 필요한 개발자를 위한 것입니다.
사용하는 경우
- ✓앱의 많은 컴포넌트가 데이터를 공유해야 하는 Vue 앱을 만들 때.
- ✓상태, 게터, 액션이 있는 스토어를 설정하고 싶을 때.
- ✓Pinia 스토어를 테스트하거나 확장해야 할 때.
스킬 링크
https://github.com/antfu/skills/blob/main/skills/pinia/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“장바구니 항목과 합계를 모든 페이지에서 유지하는 Pinia 스토어를 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 공유 데이터를 담고 그것을 바꾸는 액션을 가진 스토어를 설정합니다. 타입, 테스트, 확장에 관한 Pinia 안내를 따릅니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Pinia
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 v4.0.3, generated at 2026-09-25.
Core References
| Topic | Description | Reference |
|---|---|---|
| Stores | Defining stores, state, getters, actions, storeToRefs, subscriptions | core-stores |
Features
Extensibility
| Topic | Description | Reference |
|---|---|---|
| Plugins | Extend stores with custom properties, state, and behavior | features-plugins |
Composability
| Topic | Description | Reference |
|---|---|---|
| Composables | Using Vue composables within stores (VueUse, etc.) | features-composables |
| Composing Stores | Store-to-store communication, avoiding circular dependencies | features-composing-stores |
Best Practices
| Topic | Description | Reference |
|---|---|---|
| Testing | Unit testing with @pinia/testing, mocking, stubbing | best-practices-testing |
| Outside Components | Using stores in navigation guards, plugins, middlewares | best-practices-outside-component |
Advanced
| Topic | Description | Reference |
|---|---|---|
| SSR | Server-side rendering, state hydration | advanced-ssr |
| Nuxt | Nuxt integration, auto-imports, SSR best practices | advanced-nuxt |
| HMR | Hot module replacement for development | advanced-hmr |
Key Recommendations
- Prefer Setup Stores for complex logic, composables, and watchers
- Use
storeToRefs()when destructuring state/getters to preserve reactivity - Actions can be destructured directly - they're bound to the store
- Call stores inside functions not at module scope, especially for SSR
- Add HMR support to each store for better development experience
- Use
@pinia/testingfor component tests with mocked stores
자주 묻는 질문
Pinia는 Vue 전용인가요?
네. Vue 앱을 위해 만들어졌으며, 이 스킬의 안내도 그 내용을 다룹니다.
스토어를 테스트할 수 있나요?
네. 스토어 테스트와 모킹에 대한 안내를 포함합니다.
TypeScript와 함께 쓸 수 있나요?
네. Pinia는 타입 안전성을 갖추도록 설계되었으며 TypeScript를 지원합니다.
상세 정보
작성자의 원본 설명
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.
repo: antfu/skills
인기도
- GitHub 스타
- 6.0k
- 순위
- #14442
- 라이선스
- MIT
- 업데이트
- 2026. 10. 30.
댓글
- …
이 저장소의 다른 스킬
antfu-create-pr
6.0k에이전트가 내 브랜치에서 GitHub 풀 리퀘스트를 열도록 돕고, 무엇이 왜 바뀌었는지 쉽게 설명한 요약을 함께 씁니다.
antfu-issue-triage
6.0k에이전트가 열린 GitHub 이슈와 풀 리퀘스트를 살펴 중복과 이미 해결된 항목을 찾고, 실행 전에 사용자에게 먼저 묻도록 돕습니다.
antfu-query
6.0k에이전트가 계획을 한 번에 한 단계씩 질문해, 함께 명확하고 검증된 이해에 이르도록 돕습니다.
antfu-simplify
6.0k에이전트가 코드 변경을 필요 없는 부분을 빼고 가장 작고 올바른 형태로 줄이도록 돕습니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.