vue-pinia-best-practices
改善 Vue Pinia Store 模式
Vue 應用程式經常出問題,因為 store 設定、解構以及 URL 狀態規則很容易被忽略。此技能為 Claude、Codex 和 Claude Code 提供聚焦的 Pinia 指引,以建立可靠的 stores 與可預測的反應性。
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "vue-pinia-best-practices" from https://skillstore.io/skills/vuejs-ai-vue-pinia-best-practices.md and its manifest at https://skillstore.io/api/skills/vuejs-ai-vue-pinia-best-practices/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「vue-pinia-best-practices」。 A Vue app crashes with getActivePinia during startup.
預期結果:
回應會識別過早存取 store、檢查 plugin 順序,並建議在使用 stores 的 router guards 之前先安裝 Pinia。
正在使用「vue-pinia-best-practices」。 A component destructures name and isLoggedIn from a Pinia store and the UI stops updating.
預期結果:
回應會說明 state 與 getters 需要 storeToRefs,而 actions 可維持為直接的函式參照。
正在使用「vue-pinia-best-practices」。 A products page stores filters only in Pinia and loses them on refresh.
預期結果:
回應會建議將可分享的 filters 放在 URL query parameters 中,並將私密或不可分享的 state 保留在 store 中。
安全審計
安全AI review found the static findings are documentation examples, not executable skill behavior. Dynamic imports, fetch calls, Authorization headers, and Object.keys appear inside Pinia guidance snippets using local app paths; no prompt injection, credential exfiltration, or command execution intent was found.
風險因素
⚡ 包含腳本 (2)
⚙️ 外部命令 (2)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/vuejs-ai-vue-pinia-best-practices/audits/5?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/vuejs-ai-vue-pinia-best-practices?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/vuejs-ai-vue-pinia-best-practices?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/vuejs-ai-vue-pinia-best-practices/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/vuejs-ai-vue-pinia-best-practices.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>學術引用 (APA · BibTeX · CFF)
APA 引用
github.com/vuejs-ai. (2026). vue-pinia-best-practices security audit report (audit version 5) [Author version 1.0.0]. Skillstore. https://skillstore.io/skills/vuejs-ai-vue-pinia-best-practices/audits/5BibTeX 引用
@techreport{github-com-vuejs-ai-vuejs-ai-vue-pinia-best-practices-2026,
author = {github.com/vuejs-ai},
title = {vue-pinia-best-practices security audit report (audit version 5)},
institution = {Skillstore},
year = {2026},
number = {5},
url = {https://skillstore.io/skills/vuejs-ai-vue-pinia-best-practices/audits/5},
note = {Author version 1.0.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "vue-pinia-best-practices security audit report (audit version 5)"
version: "1.0.0"
type: report
authors:
- name: "github.com/vuejs-ai"
date-released: "2026-07-07"
url: "https://skillstore.io/skills/vuejs-ai-vue-pinia-best-practices/audits/5"
identifiers:
- type: other
value: "skillstore:vuejs-ai-vue-pinia-best-practices:audit:5"
description: "Skillstore immutable audit report identifier"
Skillstore 評分
評分依據 證據置信度: 高你可以打造什麼
修復 Pinia 啟動失敗
使用此技能找出為何 store 會在 Pinia 安裝前被呼叫,並調整 app 或 router 的設定順序。
審查 Store 反應性錯誤
使用此技能在 Vue components 中找出直接解構、缺少 storeToRefs 使用,以及方法綁定錯誤。
設計可擴展的狀態模式
使用此技能判斷資料何時應屬於 Pinia、URL query parameters、component state,或更簡單的 reactive store。
試試這些提示
Review my Vue app setup for Pinia ordering problems. Explain why getActivePinia errors happen and show the smallest safe fix.
Inspect this component for Pinia destructuring or method binding issues. Tell me what should use storeToRefs and what can be destructured directly.
Review this Pinia setup store for SSR, DevTools, and plugin compatibility. Identify any state that should be returned or renamed.
Map this feature state across Pinia, URL query parameters, and local component state. Explain the tradeoffs for refresh, sharing, privacy, and debugging.
最佳實務
- 在 plugins、router guards 或會呼叫 stores 的 modules 之前安裝 Pinia。
- 對 state 與 getters 使用 storeToRefs,並直接解構 actions。
- 將可分享的 filters 保留在 URL 中,並將 stores 留給應用程式狀態。
避免
- 在 Vue app 安裝 Pinia 之前,於 module scope 呼叫 useStore。
- 直接解構 Pinia state 或 getters,並期待反應式更新。
- 未審查隱私、安全性與 hydration 需求,就持久化每個 store 欄位。
常見問題
此技能適用於哪個 Vue 版本?
它能協助處理 getActivePinia 錯誤嗎?
它能取代 Pinia 文件嗎?
它能自動遷移 Vuex 程式碼嗎?
它涵蓋 SSR 相關考量嗎?
它能安全地用於私有應用程式碼嗎?
開發者詳細資訊
授權
MIT
作者版本
v1.0.0
Skillstore 修訂
r1
引用
36e07d5e13068e5be64447e8f20b427cf2cbd21a
維護新鮮度
2026/7/18
使用量
18 次下載 · 177 次瀏覽