Agent skill

Vtj State Management

by hexianWeb in hexianWeb/Third-Person-MC

Manages state between Vue and Three.js via Pinia and mitt. An agent skill from hexianWeb/Third-Person-MC.

MITAuto-check passedGame Development

Install Vtj State Management

skills CLI
$ npx skills add hexianWeb/Third-Person-MC --skill vtj-state-management -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hexianWeb/Third-Person-MC vtj-state-management --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hexianWeb/Third-Person-MC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agent/skills/vtj-state-management .claude/skills/vtj-state-management && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
vtj-state-management
GitHub stars
195
Token cost
~2.2k tokens
SKILL.md length
238 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Manages state between Vue and Three.js via Pinia and mitt. An agent skill from hexianWeb/Third-Person-MC.

  • Synchronizing UI state
  • SKILL.md covers Overview, When to Use, 双通道架构 and Pinia Store 模式, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Emitting events

What it does

Vtj State Management is an agent skill from hexianWeb/Third-Person-MC. Manages state between Vue and Three.js via Pinia and mitt. Use when synchronizing UI state, emitting events, or implementing cross-layer communication.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development, covering 3D graphics and WebGL and State management. It works with Three.js and Vue.js. The repository describes itself as: Three.js web version Minecraft in browser. The licence is MIT.

When your agent uses it

  • Synchronizing UI state
  • Emitting events
  • Implementing cross-layer communication

Example prompts

  • “Use the vtj-state-management skill to manage state between Vue and Three.js via Pinia and mitt. An agent skill from hexianWeb/Third-Person-MC”
  • “/vtj-state-management”

What it can do on your machine

Read from SKILL.md and the folder at commit 490203c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript and vue).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Vtj State Management loads about 2.2k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 238 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hexianWeb/Third-Person-MC at commit 490203c, republished under its MIT licence (© hexianWeb). 238 words, ~2,187 tokens.

Download SKILL.mdSave it as .claude/skills/vtj-state-management/SKILL.md (or your agent's skills folder).
name
vtj-state-management
description
Manages state between Vue and Three.js via Pinia and mitt. Use when synchronizing UI state, emitting events, or implementing cross-layer communication.

vite-threejs State Management (Pinia + mitt)

Overview

本项目使用 双通道状态管理:

  • Pinia:持久化状态,Vue 和 Three.js 双向同步
  • mitt:即时事件通知,跨层通信

核心原则:Pinia 管状态,mitt 管事件。状态变更通过 Pinia,通知 Three.js 通过 mitt emit。

When to Use

  • 需要在 Vue UI 和 Three.js 之间共享状态
  • 需要从 UI 触发 3D 场景行为
  • 需要从 3D 场景通知 UI 更新
  • 管理游戏设置、用户偏好等持久状态

双通道架构

┌─────────────────────────────────────────────────────────────┐
│                         Vue UI Layer                         │
│  ┌─────────────────┐          ┌─────────────────┐           │
│  │   Components    │◄────────►│   Pinia Stores  │           │
│  └─────────────────┘          └────────┬────────┘           │
└────────────────────────────────────────┼────────────────────┘
                                         │ emitter.emit()
                                         ▼
┌─────────────────────────────────────────────────────────────┐
│                      mitt Event Bus                          │
└─────────────────────────────────────────────────────────────┘
                                         │ emitter.on()
                                         ▼
┌─────────────────────────────────────────────────────────────┐
│                      Three.js Layer                          │
│  ┌─────────────────┐          ┌─────────────────┐           │
│  │   Components    │◄────────►│   Experience    │           │
│  └─────────────────┘          └─────────────────┘           │
└─────────────────────────────────────────────────────────────┘

Pinia Store 模式

Store 定义
javascript
// src/pinia/settingsStore.js
import emitter from '@three/utils/event-bus.js'
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useSettingsStore = defineStore('settings', () => {
  // 状态
  const shadowQuality = ref('high')
  
  // Action:修改状态 + 通知 Three.js
  function setShadowQuality(quality) {
    shadowQuality.value = quality
    emitter.emit('shadow:quality-changed', quality)  // 通知 Three.js
    saveSettings()  // 持久化
  }
  
  return { shadowQuality, setShadowQuality }
})
在 Vue 中使用
vue
<script setup>
import { useSettingsStore } from '@pinia/settingsStore.js'

const settings = useSettingsStore()

function handleQualityChange(quality) {
  settings.setShadowQuality(quality)
}
</script>

<template>
  <select v-model="settings.shadowQuality" @change="handleQualityChange">
    <option value="low">Low</option>
    <option value="medium">Medium</option>
    <option value="high">High</option>
  </select>
</template>
在 Three.js 中使用
javascript
// 方式一:监听 mitt 事件(推荐)
import emitter from './utils/event-bus.js'

emitter.on('shadow:quality-changed', (quality) => {
  this.updateShadowQuality(quality)
})

// 方式二:直接读取 Pinia(需要时)
import { useSettingsStore } from '@pinia/settingsStore.js'

const settings = useSettingsStore()
const quality = settings.shadowQuality

mitt Event Bus

事件总线定义
javascript
// src/js/utils/event-bus.js
import mitt from 'mitt'
const emitter = mitt()
export default emitter
事件命名规范
前缀来源用途示例
ui:Vue UIUI 状态变化ui:pause-changed
game:Vue/Three.js游戏逻辑事件game:create_world
settings:Pinia Store设置变更通知settings:environment-changed
core:Experience核心系统事件core:ready, core:resize
shadow:渲染相关阴影设置shadow:quality-changed
事件使用模式
javascript
// 发送事件(Vue/Pinia 层)
emitter.emit('game:create_world', { seed, terrain, trees })
emitter.emit('ui:pause-changed', true)
emitter.emit('settings:environment-changed', { skyMode: 'HDR' })

// 监听事件(Three.js 层)
emitter.on('game:create_world', ({ seed, terrain, trees }) => {
  this.world.reset({ seed, terrain, trees })
})

emitter.on('ui:pause-changed', (paused) => {
  this.isPaused = paused
})

// 移除监听(destroy 时)
this._boundHandler = this.handleEvent.bind(this)
emitter.on('some:event', this._boundHandler)
// ...
emitter.off('some:event', this._boundHandler)

通信模式

模式一:UI → Three.js(最常用)
javascript
// 1. Pinia Store 中定义 action
function setEnvFogDensity(value) {
  envFogDensity.value = value
  emitter.emit('settings:environment-changed', { fogDensity: value })
  saveSettings()
}

// 2. Three.js 组件监听
emitter.on('settings:environment-changed', (patch) => {
  if (patch.fogDensity !== undefined) {
    this.updateFog(patch.fogDensity)
  }
})
模式二:Three.js → UI
javascript
// 1. Three.js 中发送事件
emitter.emit('game:player-health-changed', { health: 80, maxHealth: 100 })

// 2. Vue 组件监听
import emitter from '@three/utils/event-bus.js'
import { onMounted, onUnmounted, ref } from 'vue'

const health = ref(100)

onMounted(() => {
  emitter.on('game:player-health-changed', handleHealthChange)
})

onUnmounted(() => {
  emitter.off('game:player-health-changed', handleHealthChange)
})

function handleHealthChange({ health: newHealth }) {
  health.value = newHealth
}
模式三:状态同步(双向)
javascript
// Pinia Store 持有状态
const isPaused = ref(false)

function toPauseMenu() {
  isPaused.value = true
  emitter.emit('ui:pause-changed', true)
}

function toPlaying() {
  isPaused.value = false
  emitter.emit('ui:pause-changed', false)
}

// Three.js 层响应
emitter.on('ui:pause-changed', (paused) => {
  this.isPaused = paused
})

现有 Stores

Store文件职责
useUiStoreuiStore.js屏幕状态、菜单导航、世界管理
useSettingsStoresettingsStore.js游戏设置、持久化、Three.js 通知
useHudStorehudStore.jsHUD 状态(血量、快捷栏等)
useSkinStoreskinStore.js皮肤选择状态

现有事件

core: 系统事件
事件数据触发时机
core:ready-所有资源加载完成
core:resize-窗口尺寸变化
core:tick-每帧更新
ui: UI 事件
事件数据触发时机
ui:pause-changedboolean暂停/恢复
game: 游戏事件
事件数据触发时机
game:create_world{ seed, terrain, trees }创建新世界
game:reset_world{ seed, terrain, trees }重置世界
game:request_pointer_lock-请求锁定鼠标
settings: 设置事件
事件数据触发时机
settings:environment-changed{ skyMode?, sunIntensity?, ... }环境设置变更
settings:postprocess-changed{ speedLines }后期处理变更
settings:camera-rig-changed{ fov, bobbing }相机设置变更
settings:chunks-changed{ viewDistance?, unloadPadding? }区块设置变更
settings:front-view-changed{ enabled }前视图开关
settings:mouse-sensitivity-changednumber鼠标灵敏度变更
shadow: 阴影事件
事件数据触发时机
shadow:quality-changedstring阴影质量变更

Common Mistakes

❌ 直接在 Vue 中操作 Three.js
javascript
// BAD: Vue 组件直接操作 Three.js
import Experience from '@three/experience.js'

function handleClick() {
  const exp = new Experience()
  exp.world.player.setPosition(0, 0, 0)  // ❌ 直接操作
}

// GOOD: 通过 mitt 事件
function handleClick() {
  emitter.emit('game:player-teleport', { x: 0, y: 0, z: 0 })
}
❌ 忘记清理事件监听
javascript
// BAD: 没有清理
constructor() {
  emitter.on('some:event', (data) => this.handle(data))
}

// GOOD: 保存引用并清理
constructor() {
  this._boundHandler = this.handle.bind(this)
  emitter.on('some:event', this._boundHandler)
}

destroy() {
  emitter.off('some:event', this._boundHandler)
}
❌ 在 Three.js 中直接修改 Pinia 状态
javascript
// BAD: Three.js 直接写 Pinia
import { useUiStore } from '@pinia/uiStore.js'

function onPlayerDeath() {
  const ui = useUiStore()
  ui.screen = 'gameOver'  // ❌ 直接写状态
}

// GOOD: 通过事件让 Vue 层处理
function onPlayerDeath() {
  emitter.emit('game:player-died')
}

// Vue 层响应
emitter.on('game:player-died', () => {
  ui.toGameOver()
})
❌ 事件命名不规范
javascript
// BAD: 无前缀、大小写混乱
emitter.emit('pauseChanged', true)
emitter.emit('CreateWorld', data)

// GOOD: 使用规范前缀
emitter.emit('ui:pause-changed', true)
emitter.emit('game:create_world', data)
❌ 事件数据结构不一致
javascript
// BAD: 有时传对象,有时传原始值
emitter.emit('settings:fog-changed', 0.01)
emitter.emit('settings:fog-changed', { density: 0.01 })

// GOOD: 统一使用对象(可扩展)
emitter.emit('settings:environment-changed', { fogDensity: 0.01 })

Quick Reference

场景使用
持久化状态Pinia Store
UI → Three.js 通知Pinia action + emitter.emit()
Three.js → UI 通知emitter.emit()
Three.js 读取状态Pinia Store 或 emitter.on()
事件清理destroy() 中 emitter.off()
事件前缀用途
core:系统级(ready/resize/tick)
ui:UI 状态变化
game:游戏逻辑
settings:设置变更
shadow:渲染相关

© hexianWeb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agent/skills/vtj-state-management of hexianWeb/Third-Person-MC.

Open the folder on GitHubat commit 490203c

Compare with similar skills

Vtj State Management next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Vtj State Management compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Vtj State Management this skillhexianWeb/Third-Person-MC195—~2.2kAutomated safety check: PassMIT
Web CloneJane-xiaoer/claude-skill-web-clone1k1 repos~2.7kAutomated safety check: PassMIT
New ExperimentTresjs/tres3.8k—~782Automated safety check: PassMIT
Polycsslayoutit/polycss761—~2.4kAutomated safety check: PassMIT
Tresjs Core Skilldskilld-dev/vue-ecosystem-skills181—~2.2kAutomated safety check: PassMIT
Lint Commit PRTresjs/tres3.8k—~1.1kAutomated safety check: PassMIT

Similar skills

  • Web Clone

    Jane-xiaoer/claude-skill-web-clone

    网站复刻 / 克隆方法论。USE WHEN 用户说 复刻网站、克隆网站、clone website、抄个站、仿站、 照着这个站做一个、reproduce site、还原某个网页效果、把这个站搬下来改成我的、 复刻某个交互/WebGL/Canvas/Three.js 效果。提供「先拿真源码 → 判路径 → 逆向拆解 → 搭工程 → 替换内容」的可移植决策树,覆盖静态站 /…

    1k GitHub starsUsed in 1 repo~2.7k tokens
    Game DevelopmentAuto-check passed
  • New Experiment

    Tresjs/tres

    Create a new experiment in TresJS Lab with all necessary files

    3.8k GitHub stars~782 tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Polycss

    layoutit/polycss

    Build PolyCSS scenes that render 3D meshes, primitive shapes, or custom polygons as DOM/CSS polygon elements.

    761 GitHub stars~2.4k tokensUpdated 1 mo ago
    Game DevelopmentAuto-check passed
  • Tresjs Core Skilld

    skilld-dev/vue-ecosystem-skills

    Declarative Three.js using Vue components. An agent skill from skilld-dev/vue-ecosystem-skills.

    181 GitHub stars~2.2k tokensUpdated 17 days ago
    Game DevelopmentAuto-check passed
  • Lint Commit PR

    Tresjs/tres

    Lint local changes, auto-fix, conventional commit, and optionally create PR

    3.8k GitHub stars~1.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Inspira UI

    secondsky/claude-skills

    120+ Vue/Nuxt animated components with TailwindCSS v4, motion-v, GSAP, Three.js.

    227 GitHub stars~2.6k tokensUpdated 11 days ago
    Frontend & DesignAuto-check passed

More from hexianWeb/Third-Person-MC

All 12 skills in this repo
  • Vtj Debug Panel

    hexianWeb/Third-Person-MC

    Configures Tweakpane debug panels for 3D components. An agent skill from hexianWeb/Third-Person-MC.

    195 GitHub stars~638 tokensUpdated 2 mo ago
    Auto-check passed
  • Vtj Camera System

    hexianWeb/Third-Person-MC

    Configures third-person camera systems with collision avoidance.

    195 GitHub stars~1.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Vtj Component Model

    hexianWeb/Third-Person-MC

    Creates 3D components using the Experience singleton pattern.

    195 GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Vtj Input System

    hexianWeb/Third-Person-MC

    Handles mouse, keyboard, and touch input via the IMouse and InputManager systems.

    195 GitHub stars~1.8k tokensUpdated 2 mo ago
    Auto-check passed
  • Vtj Performance

    hexianWeb/Third-Person-MC

    Optimizes Three.js rendering performance. An agent skill from hexianWeb/Third-Person-MC.

    195 GitHub stars~802 tokensUpdated 2 mo ago
    Auto-check passed
  • Vtj Raycasting System

    hexianWeb/Third-Person-MC

    Implements ray picking and collision detection. An agent skill from hexianWeb/Third-Person-MC.

    195 GitHub stars~2k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Vtj State Management

What does Vtj State Management do?

Manages state between Vue and Three.js via Pinia and mitt. An agent skill from hexianWeb/Third-Person-MC. Vtj State Management is an agent skill from hexianWeb/Third-Person-MC.js via Pinia and mitt.

When should I use Vtj State Management?

Vtj State Management fits situations like: synchronizing UI state; emitting events; implementing cross-layer communication.

How do I install Vtj State Management in Claude Code?

Run `npx skills add hexianWeb/Third-Person-MC --skill vtj-state-management -a claude-code`. Or copy the skill folder (.agent/skills/vtj-state-management in hexianWeb/Third-Person-MC) into .claude/skills/vtj-state-management in your project. Claude Code loads it when a task matches its description.

How do I install Vtj State Management in Codex?

Run `npx skills add hexianWeb/Third-Person-MC --skill vtj-state-management -a codex`. Or copy the skill folder (.agent/skills/vtj-state-management in hexianWeb/Third-Person-MC) into .agents/skills/vtj-state-management in your project. Codex loads it when a task matches its description.

Can I use Vtj State Management in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hexianWeb/Third-Person-MC --skill vtj-state-management -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/vtj-state-management, .gemini/skills/vtj-state-management, .github/skills/vtj-state-management and .opencode/skills/vtj-state-management in your project.

What does Vtj State Management need to run?

SKILL.md names no scripts, command-line tools or credentials: Vtj State Management is instructions for the agent only.

Does Vtj State Management access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Vtj State Management safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Vtj State Management use?

Vtj State Management is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Vtj State Management use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Vtj State Management?

Skills that share tags, products or a category with Vtj State Management: Web Clone (Jane-xiaoer/claude-skill-web-clone, 1k stars), New Experiment (Tresjs/tres, 3.8k stars), Polycss (layoutit/polycss, 761 stars) and Tresjs Core Skilld (skilld-dev/vue-ecosystem-skills, 181 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Vtj State Management?

hexianWeb (a GitHub user) maintains it in hexianWeb/Third-Person-MC, which has 195 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on July 27, 2026.

Source: hexianWeb/Third-Person-MC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.