pinia-store

pinia-store is a skill for Claude Code from YuDefine/nuxt-supabase-starter. It costs 56 tokens per session (661 once invoked), scanned A, original, MIT.

A set of project rules for organizing Pinia stores, which hold shared Vue application state such as user preferences, authentication, and interface settings.

In plain words
What is it for?
Use it when creating files in app/stores, defining stores with defineStore, managing shared state, or designing Pinia store patterns.
Why use it?
It keeps store files, names, state access, and data loading consistent across the application.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when creating files in app/stores, defining stores with defineStore, managing shared state, or designing Pinia store patterns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yudefine/nuxt-supabase-starter/pinia-store
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add YuDefine/nuxt-supabase-starter --skill pinia-store
Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pinia-store

README.md
[![agentmods](https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/pinia-store/github.svg)](https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/pinia-store)
Your own site
<a href="https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/pinia-store"><img src="https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/pinia-store/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pinia-store

Your own site · 80×15
<a href="https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/pinia-store"><img src="https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/pinia-store.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.00661
Opus 5 $0.00028 $0.00331
Sonnet 5 $0.00011 $0.00132
Haiku 4.5 $0.00006 $0.00066

Measured 11d ago against content hash ed37a42230d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

pinia-store scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

template/.claude/skills/pinia-store/SKILL.md · 102 lines

What it actually says

Pinia Store 架構規範

目錄結構

app/stores/
├── userPreferences.ts   # 使用者偏好設定
├── auth.ts              # 認證狀態
└── ui.ts                # UI 全域狀態

Store 模板

使用 Composition API 語法:

import { defineStore } from 'pinia'

export const useMyStore = defineStore('my-store', () => {
  const items = ref<Item[]>([])
  const isLoading = ref(false)
  const error = ref<Error | null>(null)

  const itemCount = computed(() => items.value.length)

  async function loadItems() {
    isLoading.value = true
    error.value = null
    try {
      const data = await $fetch('/api/v1/items')
      items.value = data
    } catch (e) {
      error.value = e as Error
    } finally {
      isLoading.value = false
    }
  }

  return {
    items: readonly(items),
    isLoading: readonly(isLoading),
    error: readonly(error),
    itemCount,
    loadItems,
  }
})

命名規範

  • Store 函式:use<Name>Store
  • Store ID:kebab-case
// ✅
export const useUserPreferencesStore = defineStore('user-preferences', ...)
// ❌
export const userPreferencesStore = defineStore('preferences', ...)

使用方式

<script setup lang="ts">
  const store = useMyStore()

  // 解構保持響應性
  const { items, isLoading } = storeToRefs(store)
  const { loadItems } = store
</script>

重要原則

  • 使用 readonly() 保護回傳的狀態,通過 action 修改
  • 避免在 Store 中使用 useState,使用 ref 替代
  • 錯誤處理:try/catch + error state + finally 重設 loading

參考資料

檔案 內容
references/patterns.md Plugin 自動初始化、Composable 包裝模式

檢查清單

  • Composition API 語法(defineStore('id', () => {...})
  • 命名遵循 use<Name>Store
  • 使用 readonly() 保護狀態
  • 完整錯誤處理(try/catch + error state)
  • 需要全域初始化則建立對應 Plugin
  • 不使用 useState
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 102 lines · 56 tokens per session scan A ed37a42230d1

Subscribe to this mod's changes

pinia-store is a skill published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed yesterday), licensed MIT. It adds 56 tokens to every session and 661 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

software-test-creation

Write failing tests for a TDD slice based on acceptance criteria and codebase conventions. Use when the "red" phase of red-green-refactor requires tests that define expected behavior before implementation exists. Discovers codebase test conventions first, writes test files that compile or parse but fail because the…

stencila/stencila · 82 tokens

prd-v07-implementation-loop

Execute implementation within EPICs following test-first development, continuous SoT updates, and code traceability during PRD v0.7 Build Execution. Triggers on requests to start building, implement an epic, begin coding, or when user asks "start building", "implement epic", "coding", "development", "build execution"…

mattgierhart/PRD-driven-context-engineering · 113 tokens

prd-v07-test-planning

Define test cases BEFORE implementation, ensuring every API, business rule, and user journey has verifiable acceptance criteria during PRD v0.7 Build Execution. Triggers on requests to define tests, plan test coverage, create test cases, or when user asks "define tests", "test planning", "what to test?", "test cases"…

mattgierhart/PRD-driven-context-engineering · 125 tokens

fuzzing-patterns

Use when writing fuzz tests for Solidity contracts. Covers property-based testing, input constraining with vm.assume/vm.bound, stateful vs stateless fuzzing, configuring runs, seed corpus, and interpreting counterexamples.

ccashwell/evm-cortex · 50 tokens

vision

Create or maintain a project's root CONTEXT.md — goals, product boundary, non-goals, decision principles, and a domain language glossary. Use when starting a new project, clarifying product direction, aligning a codebase for future agent work, defining a north star, pinning down domain terminology, or turning a vague…

howells/arc · 76 tokens

finish-it

Scope-cutting and shipping discipline from Derek Yu's 'Finishing a Game' and 'Death Loops', jam culture, and veteran shipping practice — diagnose why a game project stalled, cut to a shippable core, define a binary finish line, ship it. Use when: a game project is stalled or sprawling, 'I keep adding features', 'it's…

kyh/vibedgames · 115 tokens