vuex-vue2
Provides comprehensive guidance for Vuex 2.x state management in Vue 2 applications including state, mutations, actions, getters, modules, and plugins. Use when the user asks about Vuex for Vue 2, needs to manage state in Vue 2 applications, or implement Vuex patterns.
Best use case
vuex-vue2 is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Provides comprehensive guidance for Vuex 2.x state management in Vue 2 applications including state, mutations, actions, getters, modules, and plugins. Use when the user asks about Vuex for Vue 2, needs to manage state in Vue 2 applications, or implement Vuex patterns.
Provides comprehensive guidance for Vuex 2.x state management in Vue 2 applications including state, mutations, actions, getters, modules, and plugins. Use when the user asks about Vuex for Vue 2, needs to manage state in Vue 2 applications, or implement Vuex patterns.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "vuex-vue2" skill to help with this workflow task. Context: Provides comprehensive guidance for Vuex 2.x state management in Vue 2 applications including state, mutations, actions, getters, modules, and plugins. Use when the user asks about Vuex for Vue 2, needs to manage state in Vue 2 applications, or implement Vuex patterns.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/vuex-vue2/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How vuex-vue2 Compares
| Feature / Agent | vuex-vue2 | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Provides comprehensive guidance for Vuex 2.x state management in Vue 2 applications including state, mutations, actions, getters, modules, and plugins. Use when the user asks about Vuex for Vue 2, needs to manage state in Vue 2 applications, or implement Vuex patterns.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
## When to use this skill
Use this skill whenever the user wants to:
- Install and set up Vuex in a Vue 2 project
- Manage application state with Vuex
- Use Vuex store in Vue components
- Understand Vuex core concepts (state, getters, mutations, actions)
- Use Vuex modules for large applications
- Handle Vuex plugins and devtools
- Understand Vuex API and methods
- Troubleshoot Vuex issues
## How to use this skill
This skill is organized to match the Vuex official documentation structure (https://vuex.vuejs.org/zh/, https://vuex.vuejs.org/zh/guide/, https://vuex.vuejs.org/zh/api/). When working with Vuex:
1. **Identify the topic** from the user's request:
- Installation/安装 → `examples/guide/installation.md`
- Quick Start/快速开始 → `examples/guide/quick-start.md`
- Core Concepts/核心概念 → `examples/core-concepts/`
- Advanced/高级 → `examples/advanced/`
- API/API 文档 → `api/`
2. **Load the appropriate example file** from the `examples/` directory:
**Guide (使用指南)**:
- `examples/guide/intro.md` - Introduction to Vuex
- `examples/guide/installation.md` - Installation guide
- `examples/guide/quick-start.md` - Quick start guide
- `examples/guide/what-is-vuex.md` - What is Vuex
**Core Concepts (核心概念)**:
- `examples/core-concepts/state.md` - State
- `examples/core-concepts/getters.md` - Getters
- `examples/core-concepts/mutations.md` - Mutations
- `examples/core-concepts/actions.md` - Actions
- `examples/core-concepts/modules.md` - Modules
**Advanced (高级)**:
- `examples/advanced/plugins.md` - Plugins
- `examples/advanced/strict-mode.md` - Strict mode
- `examples/advanced/form-handling.md` - Form handling
- `examples/advanced/testing.md` - Testing
- `examples/advanced/hot-reload.md` - Hot reload
3. **Follow the specific instructions** in that example file for syntax, structure, and best practices
**Important Notes**:
- Vuex is for Vue 2.x
- Store is the central state management
- State is reactive
- Mutations are synchronous
- Actions are asynchronous
- Each example file includes key concepts, code examples, and key points
4. **Reference API documentation** in the `api/` directory when needed:
- `api/store-api.md` - Store API
- `api/state-api.md` - State API
- `api/getters-api.md` - Getters API
- `api/mutations-api.md` - Mutations API
- `api/actions-api.md` - Actions API
- `api/modules-api.md` - Modules API
- `api/plugins-api.md` - Plugins API
5. **Use templates** from the `templates/` directory:
- `templates/installation.md` - Installation templates
- `templates/store-setup.md` - Store setup templates
- `templates/component-usage.md` - Component usage templates
### 1. Understanding Vuex
Vuex is a state management pattern and library for Vue.js applications. It serves as a centralized store for all the components in an application.
**Key Concepts**:
- **Store**: Centralized state container
- **State**: Application state (data)
- **Getters**: Computed properties for store
- **Mutations**: Synchronous state changes
- **Actions**: Asynchronous operations
- **Modules**: Store organization
### 2. Installation
**Using npm**:
```bash
npm install vuex@3
```
**Using yarn**:
```bash
yarn add vuex@3
```
**Using CDN**:
```html
<script src="https://unpkg.com/vuex@3"></script>
```
### 3. Basic Setup
```javascript
// store/index.js
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
count: 0
},
mutations: {
increment(state) {
state.count++
}
}
})
export default store
```
```javascript
// main.js
import Vue from 'vue'
import store from './store'
new Vue({
store,
render: h => h(App)
}).$mount('#app')
```
### Doc mapping (one-to-one with official documentation)
- `examples/guide/` or `examples/getting-started/` → https://vuex.vuejs.org/zh/guide/
- `api/` → https://vuex.vuejs.org/zh/api/
## Examples and Templates
This skill includes detailed examples organized to match the official documentation structure. All examples are in the `examples/` directory (see mapping above).
**To use examples:**
- Identify the topic from the user's request
- Load the appropriate example file from the mapping above
- Follow the instructions, syntax, and best practices in that file
- Adapt the code examples to your specific use case
**To use templates:**
- Reference templates in `templates/` directory for common scaffolding
- Adapt templates to your specific needs and coding style
## API Reference
Detailed API documentation is available in the `api/` directory, organized to match the official Vuex API documentation structure (https://vuex.vuejs.org/zh/api/):
### Store API (`api/store-api.md`)
- Store constructor options
- Store instance properties
- Store instance methods
### State API (`api/state-api.md`)
- State definition
- State access
- State reactivity
### Getters API (`api/getters-api.md`)
- Getter definition
- Getter access
- Getter arguments
### Mutations API (`api/mutations-api.md`)
- Mutation definition
- Mutation commit
- Mutation payload
### Actions API (`api/actions-api.md`)
- Action definition
- Action dispatch
- Action context
### Modules API (`api/modules-api.md`)
- Module definition
- Module namespacing
- Module registration
### Plugins API (`api/plugins-api.md`)
- Plugin definition
- Plugin usage
- Built-in plugins
**To use API reference:**
1. Identify the API you need help with
2. Load the corresponding API file from the `api/` directory
3. Find the API signature, parameters, return type, and examples
4. Reference the linked example files for detailed usage patterns
5. All API files include links to relevant example files in the `examples/` directory
## Best Practices
1. **Use mutations for synchronous changes**: Mutations must be synchronous
2. **Use actions for async operations**: Actions can contain async operations
3. **Keep state normalized**: Avoid nested state structures
4. **Use modules for large apps**: Organize store with modules
5. **Use getters for computed state**: Derive state with getters
6. **Follow naming conventions**: Use consistent naming patterns
7. **Use TypeScript**: Leverage TypeScript for type safety
## Resources
- **Official Documentation**: https://vuex.vuejs.org/zh/
- **Guide**: https://vuex.vuejs.org/zh/guide/
- **API Documentation**: https://vuex.vuejs.org/zh/api/
- **GitHub Repository**: https://github.com/vuejs/vuex
## Keywords
Vuex, vuex, Vue 2, state management, 状态管理, store, state, getters, mutations, actions, modules, 存储, 状态, 获取器, 变更, 动作, 模块, Vuex store, Vuex state, Vuex getters, Vuex mutations, Vuex actions, Vuex modules, Vuex plugins, centralized state, reactive state, synchronous mutations, asynchronous actionsRelated Skills
vue2
Provides comprehensive guidance for Vue 2.x development including Options API, components, directives, lifecycle hooks, computed properties, watchers, Vuex state management, and Vue Router. Use when the user asks about Vue 2, needs to create Vue 2 components, implement reactive data binding, handle component communication, or work with Vue 2 ecosystem tools.
tui-vuex-detail
Generate and render a pixel-precise ASCII TUI Vuex Detail component with complete output blocks (TUI_RENDER, COMPONENT_SPEC, PENCIL_SPEC, PENCIL_BATCH_DESIGN) for Pencil MCP drawing workflows. Use when the user asks to create a vuex detail in a terminal UI, text-based interface, or Pencil MCP project.
uview-vue2
Builds Vue 2 mobile UIs in uni-app using the uView UI component library with Button, Input, Form, Table, Modal, Tabs, and built-in $u tools (toast, http, storage, route). Use when the user needs to create uni-app interfaces with uView UI for Vue 2, customize themes via SCSS variables, or use $u utility methods.
vant-vue3
Provides structured guidance for Vant of Vue 3.0. Use when the user needs Vant with Vue 3, asks about mobile UI components such as Button, Cell, Form, Dialog, Toast, Popup, ConfigProvider, theme customization, project setup, or wants to implement mobile-first interfaces with vant or van- components.
layui-vue3
Provides comprehensive guidance for Layui Vue component library including components, layer dialogs, and utilities. Use when the user asks about Layui Vue, needs to use Layui components in Vue 3, or implement UI components.
element-plus-vue3
Provides comprehensive guidance for Element Plus Vue 3 component library including installation, components, themes, internationalization, and API reference. Use when the user asks about Element Plus for Vue 3, needs to build Vue 3 applications with Element Plus, or customize component styles.
bootstrap-vue3
Provides comprehensive guidance for Bootstrap Vue 3 component library including Bootstrap components, grid system, utilities, and Vue 3 integration. Use when the user asks about Bootstrap Vue 3, needs to use Bootstrap components in Vue 3, or implement responsive layouts.
vue3
Guidance for Vue 3 using the official guide and API reference. Use when the user needs Vue 3 concepts, patterns, or API details to build components, apps, and tooling.
vue-router
Provides comprehensive guidance for Vue Router including route configuration, navigation, dynamic routes, nested routes, route guards, programmatic navigation, and route meta. Use when the user asks about Vue Router, needs to set up routing, implement navigation guards, handle route parameters, or manage route transitions.
vue-router-v4
Provides comprehensive guidance for Vue Router v4 including route configuration, navigation, nested routes, route guards, and Vue 3 integration. Use when the user asks about Vue Router v4, needs to set up routing for Vue 3 applications, implement navigation guards, or work with Vue Router v4 features.
vue-router-v3
Guidance for Vue Router v3 using the official Installation, Guide, and API docs. Use when users need routing setup, navigation patterns, or API details for Vue 2 projects.
pinia
Provides comprehensive guidance for Pinia state management including stores, state, getters, actions, plugins, and TypeScript support. Use when the user asks about Pinia, needs to manage application state, create stores, implement state persistence, or migrate from Vuex.