Skip to content
Agentmart
Submit a tool

pinia-options

Pinia state management for Vue using Options API style — define stores with state, getters, actions, and use them in Options API components via…

Skill by Vũ Lưu

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/vuluu2k-pinia-options

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Pinia state management for Vue using Options API style — define stores with state, getters, actions, and use them in Options API components via mapState/mapWritableState/mapActions.

Use cases: frontend, backend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/pinia-options

What's inside

Skill name
pinia-options
Description
Pinia state management for Vue using Options API style — define stores with state, getters, actions, and use them in Options API components via mapState/mapWritableState/mapActions.
License
MIT
Metadata
author: Vũ Lưu · source: Hand-written based on https://pinia.vuejs.org · version: 2026.3.23
Instructions
65 lines in SKILL.md · view on GitHub

Files (3)

  • SKILL.md
  • core-option-stores.md · references/
  • using-in-options-api.md · references/

SKILL.md (first lines)

# Pinia (Options API Style)

> This skill focuses on **Option Stores** and using them inside **Options API components**.

## Core

| Topic | Description | Reference |
|-------|-------------|-----------|
| Option Stores | Define stores with state, getters, actions | [core-option-stores](references/core-option-stores.md) |
| Using in Options API | mapState, mapWritableState, mapActions | [using-in-options-api](references/using-in-options-api.md) |

## Quick Reference

### Define a store

```ts
// stores/counter.ts
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', {
  state: () => ({
    count: 0,
    name: 'My App'
  }),
  getters: {
    doubled: (state) => state.count * 2,
  },
  actions: {
    increment() {
      this.count++
    },
    async fetchData() {
      const data = await api.getData()
      this.name = data.name
    }
  }
})
```

### Use in an Options API component

```js
import { mapState, mapWritableState, mapActions } from 'pinia'
import { useCounterStore } from '@/stores/counter'

export default {
  computed: {
    ...mapState(useCounterStore, ['doubled']),       // readonly
    ...mapWritableState(useCounterStore, ['count'])  // writable
  },
  methods: {
    ...mapActions(useCounterStore, ['increment'])
  }
}
```

## Key Rules

- `state` must be a **function** returning an object — same as `data()` in Vue.
- `getters` are equivalent to `computed` — cached, receive `state` as parameter.
- `actions` are equivalent to `methods` — can be async, use `this` to access state.
- Options API components use `mapState` / `mapWritableState` / `mapActions` to connect to stores.
- Never call `useStore()` at module scope — only call it inside a function or method.

From vuluu2k/skills, MIT.

More from vuluu2k/skills

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Mar 23, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
2026.3.23
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Vũ Lưu

Cite this page

pinia-options skill. Agent Mart. https://agentmart.dev/skills/vuluu2k-pinia-options (last updated 2026-10-24)