v3-upsert-store

v3-upsert-store is a skill for Claude Code, Codex from un-pany/v3-admin-vite. It costs 83 tokens per session (2,382 once invoked), scanned A, original, MIT.

A workflow for creating or updating Pinia stores, which are shared state modules in Vue applications. It requires the store name, state fields, types, initial values, persistence choices, and actions.

In plain words
What is it for?
Use it to create or update files under src/pinia/stores, add state fields and actions, and optionally connect selected fields to localStorage, which keeps data in the browser.
Why use it?
It provides a defined way to add state and behavior while preserving existing store code. It also handles local-storage support when persistent fields are requested.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to create or update files under src/pinia/stores, add state fields and actions, and optionally connect selected fields to localStorage, which keeps data in the browser.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/un-pany/v3-admin-vite/v3-upsert-store
About the project

V3 Admin Vite is a Vue 3 administrative dashboard template built with Vite, TypeScript, Element Plus, Pinia, Vue Router, and Axios. Developers use it as a starting point for creating web-based administration interfaces, and it is designed to support AI-assisted coding tools. The catalogue entries are skills, rules, and instructions for working with the template.

un-pany/v3-admin-vite · 7,058 stars · on GitHub · un-pany.github.io

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 un-pany/v3-admin-vite --skill v3-upsert-store
Clone the repo
git clone --depth 1 https://github.com/un-pany/v3-admin-vite

Made for: Claude Code, Codex.

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 v3-upsert-store

README.md
[![agentmods](https://agentmods.dev/badge/skills/un-pany/v3-admin-vite/v3-upsert-store/github.svg)](https://agentmods.dev/skills/un-pany/v3-admin-vite/v3-upsert-store)
Your own site
<a href="https://agentmods.dev/skills/un-pany/v3-admin-vite/v3-upsert-store"><img src="https://agentmods.dev/badge/skills/un-pany/v3-admin-vite/v3-upsert-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 v3-upsert-store

Your own site · 80×15
<a href="https://agentmods.dev/skills/un-pany/v3-admin-vite/v3-upsert-store"><img src="https://agentmods.dev/badge/skills/un-pany/v3-admin-vite/v3-upsert-store.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,382 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.00083 $0.02382
Opus 5 $0.00042 $0.01191
Sonnet 5 $0.00017 $0.00476
Haiku 4.5 $0.00008 $0.00238

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

Security

Grade A, and why

v3-upsert-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.

.agents/skills/v3-upsert-store/SKILL.md · 251 lines

How it starts

The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.

创建或更新 Pinia Store

根据用户提供的 Store 名称、State 字段和 Actions 描述,生成或更新 Pinia Store 文件。

本 Skill 定义的是项目默认 Store 模式,当用户的实际需求与本 Skill 约定冲突时,以用户需求为准。

输入要求

用户需提供:

  1. Store 名称(如 counternotification)— 用于文件名和命名
  2. State 字段列表 — 每个字段需明确:
    • 字段名(英文,camelCase)
    • 类型(string / number / boolean / array / object / 自定义类型等)
    • 初始值
    • 是否需要持久化到 localStorage
  3. Actions 描述 — 需要哪些操作(如 reset、toggle、increment、fetch 等)

如果用户信息不完整,主动询问补全后再生成。

操作模式

创建新 Store

src/pinia/stores/<store名>.ts 不存在时,生成完整的 Store 文件。

更新已有 Store

当文件已存在时,在已有代码中追加新的 State 字段和 Actions,保留原有代码不动。追加时:

  • 新 State 声明插入到已有 State 声明之后
  • 新 Actions 插入到已有 Actions 之后(如有 // #region 分组则放在对应区域)
  • 更新 return 语句,追加新导出的字段和方法

生成文件

Store 文件

路径:src/pinia/stores/<store名>.ts

持久化相关(仅在用户指定持久化字段时生成)

  • src/common/constants/cache-key.tsCacheKey 类中追加新的 Key
  • src/common/utils/local-storage.ts 中追加对应的 get/set 函数

代码规范

Store 结构

完整的 Store 文件结构如下(以一个带持久化和辅助函数的 Store 为例):

import type { XxxType } from "@@/types/xxx"
import { getXxx, setXxx } from "@@/utils/local-storage"
import { pinia } from "@/pinia"

interface Sidebar {
  opened: boolean
  withoutAnimation: boolean
}

/** 辅助函数的用途描述 */
function helperFunction(param: string) {
  // ...
}

export const useXxxStore = defineStore("xxx", () => {
  // Token
  const token = ref<string>(getToken() || "")

  // 侧边栏状态
  const sidebar: Sidebar = reactive({
    opened: true,
    withoutAnimation: false
  })

  // 设置 Token
  const setToken = (value: string) => {
    token.value = value
  }

  // 切换侧边栏
  const toggleSidebar = (withoutAnimation: boolean) => {
    sidebar.opened = !sidebar.opened
    sidebar.withoutAnimation = withoutAnimation
  }

  return { token, sidebar, setToken, toggleSidebar }
})

/**
 * @description 在 SPA 应用中可用于在 pinia 实例被激活前使用 store
 * @description 在 SSR 应用中可用于在 setup 外使用 store
 */
export function useXxxStoreOutside() {
  return useXxxStore(pinia)
}

关键规则

  1. 必须使用 Setup Store 语法defineStore("id", () => { ... })),不使用 Options API
  2. 必须导出 useXxxStoreOutside 函数,且 JSDoc 注释原样保留(见上方模板)
  3. defineStore 第一个参数(Store ID):单词用小写(如 "user"),多词用 kebab-case(如 "tags-view"
  4. State 类型标注
    • ref 用泛型:ref<string>("")ref<number>(0)ref<string[]>([])
    • reactive 在变量上标注类型:const sidebar: Sidebar = reactive({...})
  5. Actions 统一使用箭头函数const xxx = (param: Type) => { ... }
  6. 注释风格
    • Store 内部的 State 和 Actions 用 // 单行注释,描述具体用途(如 // 切换侧边栏// 设置 Token
    • 不要使用 /** */ JSDoc 注释 Store 内部成员
    • 不要使用泛化的分区标题(如 // state// actions),每条注释直接描述对应内容
    • 模块级辅助函数(Store 外部)使用 /** */ JSDoc 注释
  7. // #region / // #endregion 仅在同一类操作有多组变体时使用(如 tags-view 的 add/del/delOthers/delAll),普通 Store 不需要
  8. 自动导入defineStorerefreactivewatchwatchEffectcomputed 无需手动 import
  9. Vue 类型导入是允许的:如 import type { Ref } from "vue"

Read the full file on GitHub · 251 lines

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 · 251 lines · 83 tokens per session scan A c30b982db254

Subscribe to this mod's changes

v3-upsert-store is a skill published in the GitHub repository un-pany/v3-admin-vite (7,058 stars, last pushed 2mo ago), licensed MIT. It adds 83 tokens to every session and 2,382 once invoked, about $0.0004 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.