Agent skill

Vtj UI Integration

by hexianWeb in hexianWeb/Third-Person-MC

Integrates Vue UI with Three.js while maintaining strict separation.

MITAuto-check passedGame Development

Install Vtj UI Integration

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

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

GitHub CLI
$ gh skill install hexianWeb/Third-Person-MC vtj-ui-integration --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-ui-integration .claude/skills/vtj-ui-integration && 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-ui-integration
GitHub stars
194
Token cost
~2.2k tokens
SKILL.md length
209 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Integrates Vue UI with Three.js while maintaining strict separation.

  • Handling UI-to-scene communication via events
  • SKILL.md covers Overview, When to Use, 架构图 and 职责分离, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve 3D graphics and WebGL

What it does

Vtj UI Integration is an agent skill from hexianWeb/Third-Person-MC. Integrates Vue UI with Three.js while maintaining strict separation. Use when building HUDs, menus, or handling UI-to-scene communication via events.

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

  • Handling UI-to-scene communication via events
  • Tasks that involve 3D graphics and WebGL

Example prompts

  • “Use the vtj-ui-integration skill to integrate Vue UI with Three.js while maintaining strict separation”
  • “/vtj-ui-integration”

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 UI Integration loads about 2.2k tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 209 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
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). 209 words, ~2,229 tokens.

Download SKILL.mdSave it as .claude/skills/vtj-ui-integration/SKILL.md (or your agent's skills folder).
name
vtj-ui-integration
description
Integrates Vue UI with Three.js while maintaining strict separation. Use when building HUDs, menus, or handling UI-to-scene communication via events.

vite-threejs UI Integration (Vue ↔ Three.js)

Overview

本项目采用 严格的层分离架构:

  • Vue 层:UI、用户输入、菜单、HUD
  • Three.js 层:3D 场景、渲染、游戏逻辑

两层之间 禁止直接操作,所有通信通过 Pinia + mitt 完成。

When to Use

  • 创建需要与 3D 场景交互的 Vue 组件
  • 从 Three.js 更新 UI 状态
  • 处理用户输入并影响 3D 场景
  • 管理游戏状态(暂停、菜单、设置)

架构图

┌─────────────────────────────────────────────────────────────┐
│                         Vue UI Layer                         │
│  ┌─────────────────┐          ┌─────────────────┐           │
│  │   Components    │◄────────►│   Pinia Stores  │           │
│  │   (src/vue/)    │          │   (src/pinia/)  │           │
│  └─────────────────┘          └────────┬────────┘           │
└────────────────────────────────────────┼────────────────────┘
                                         │ emitter.emit()
                                         ▼
┌─────────────────────────────────────────────────────────────┐
│                      mitt Event Bus                          │
│                  (src/js/utils/event-bus.js)                 │
└─────────────────────────────────────────────────────────────┘
                                         │ emitter.on()
                                         ▼
┌─────────────────────────────────────────────────────────────┐
│                      Three.js Layer                          │
│  ┌─────────────────┐          ┌─────────────────┐           │
│  │   Components    │◄────────►│   Experience    │           │
│  │   (src/js/)     │          │   (singleton)   │           │
│  └─────────────────┘          └─────────────────┘           │
└─────────────────────────────────────────────────────────────┘

职责分离

层职责示例
Vue界面渲染、用户输入、菜单导航HUD、暂停菜单、设置面板
Three.js3D 渲染、物理、动画、游戏逻辑玩家移动、地形生成、相机控制
Vue 层 (src/vue/)
src/vue/
├── components/
│   ├── hud/           # 游戏内 HUD(血条、快捷栏等)
│   │   ├── HealthBar.vue
│   │   ├── Hotbar.vue
│   │   └── GameHud.vue
│   ├── menu/          # 菜单系统
│   │   ├── UiRoot.vue       # 菜单根组件
│   │   ├── MainMenu.vue
│   │   ├── PauseMenu.vue
│   │   └── SettingsMenu.vue
│   └── ui/            # 共享 UI 元素
Three.js 层 (src/js/)
src/js/
├── experience.js      # 单例入口
├── world/             # 场景元素
├── camera/            # 相机系统
├── interaction/       # 交互系统
└── utils/
    └── event-bus.js   # mitt 实例

通信模式

模式一:UI → Three.js(最常用)

场景:用户在 UI 操作,需要影响 3D 场景

javascript
// 1. Pinia Store 定义 action
// src/pinia/uiStore.js
function toPlaying() {
  screen.value = 'playing'
  isPaused.value = false
  emitter.emit('ui:pause-changed', false)  // 通知 Three.js
  emitter.emit('game:request_pointer_lock')
}

// 2. Three.js 组件监听
// src/js/world/player.js
constructor() {
  this._handlePause = this._handlePause.bind(this)
  emitter.on('ui:pause-changed', this._handlePause)
}

_handlePause(paused) {
  this.isPaused = paused
}

destroy() {
  emitter.off('ui:pause-changed', this._handlePause)
}
模式二:Three.js → UI

场景:3D 场景状态变化,需要更新 UI

javascript
// 1. Three.js 中发送事件
// src/js/world/player.js
takeDamage(amount) {
  this.health -= amount
  emitter.emit('game:player-health-changed', { 
    health: this.health, 
    maxHealth: this.maxHealth 
  })
}

// 2. Vue 组件监听
// src/vue/components/hud/HealthBar.vue
<script setup>
import emitter from '@three/utils/event-bus.js'
import { onMounted, onUnmounted, ref } from 'vue'

const health = ref(100)
const maxHealth = ref(100)

function handleHealthChange({ health: h, maxHealth: max }) {
  health.value = h
  maxHealth.value = max
}

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

onUnmounted(() => {
  emitter.off('game:player-health-changed', handleHealthChange)
})
</script>
模式三:设置变更

场景:用户修改设置,Three.js 需要响应

javascript
// 1. Pinia Store
// src/pinia/settingsStore.js
function setShadowQuality(quality) {
  shadowQuality.value = quality
  emitter.emit('shadow:quality-changed', quality)
  saveSettings()
}

// 2. Three.js Renderer 响应
// src/js/renderer.js
emitter.on('shadow:quality-changed', (quality) => {
  this.updateShadowMapSize(quality)
})

Vue 组件模板

带事件监听的组件
vue
<script setup>
import emitter from '@three/utils/event-bus.js'
import { onMounted, onUnmounted, ref } from 'vue'

// 状态
const value = ref(0)

// 事件处理函数(必须保存引用以便清理)
function handleEvent(data) {
  value.value = data.value
}

// 生命周期
onMounted(() => {
  emitter.on('game:some-event', handleEvent)
})

onUnmounted(() => {
  emitter.off('game:some-event', handleEvent)  // 必须清理!
})

// 发送事件到 Three.js
function triggerAction() {
  emitter.emit('ui:some-action', { param: 'value' })
}
</script>
菜单组件
vue
<script setup>
import { useUiStore } from '@pinia/uiStore.js'

const ui = useUiStore()

function handlePlay() {
  ui.toPlaying()  // Pinia action 内部会 emit 事件
}

function handleSettings() {
  ui.toSettings('mainMenu')
}
</script>

<template>
  <div class="menu">
    <button @click="handlePlay">Play</button>
    <button @click="handleSettings">Settings</button>
  </div>
</template>

现有 Stores

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

事件命名规范

详见 vtj-state-management skill,此处简要回顾:

前缀来源示例
ui:Vue UIui:pause-changed
game:游戏逻辑game:create_world
settings:设置变更settings:environment-changed
core:系统级core:ready, core:resize

路径别名

Vue 组件中使用标准别名:

javascript
// ✅ GOOD: 使用别名
import emitter from '@three/utils/event-bus.js'
import { useUiStore } from '@pinia/uiStore.js'

// ❌ BAD: 相对路径
import emitter from '../../../js/utils/event-bus.js'
别名路径
@src/
@uisrc/vue/
@ui-componentssrc/vue/components/
@piniasrc/pinia/
@threesrc/js/

Common Mistakes

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

function handleTeleport() {
  const exp = new Experience()
  exp.world.player.setPosition(0, 0, 0)  // ❌ 违反层分离
}

// GOOD: 通过事件通信
function handleTeleport() {
  emitter.emit('game:player-teleport', { x: 0, y: 0, z: 0 })
}
❌ 忘记清理事件监听
vue
<script setup>
// BAD: 没有 onUnmounted 清理
onMounted(() => {
  emitter.on('game:event', handleEvent)  // 内存泄漏!
})

// GOOD: 完整生命周期
onMounted(() => {
  emitter.on('game:event', handleEvent)
})

onUnmounted(() => {
  emitter.off('game:event', handleEvent)
})
</script>
❌ 在 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.on('game:event', (data) => this.handle(data))  // 无法 off

// GOOD: 保存引用
this._boundHandler = this.handle.bind(this)
emitter.on('game:event', this._boundHandler)
// ...
emitter.off('game:event', this._boundHandler)
❌ 在 Vue 中导入 Three.js 组件类
javascript
// BAD: 导入并实例化 Three.js 组件
import Player from '@three/world/player.js'

const player = new Player()  // ❌ Vue 不应该创建 3D 组件

// GOOD: 只通过事件/状态交互
emitter.emit('game:spawn-player', { x: 0, y: 0, z: 0 })

允许的例外

独立预览场景

用于 UI 预览的独立 Three.js 场景(如皮肤预览)可以在 Vue 组件中创建:

javascript
// src/js/components/skin-preview-scene.js
// 这是独立场景,不使用 Experience 单例
class SkinPreviewScene {
  constructor(canvas) {
    this.scene = new THREE.Scene()
    this.camera = new THREE.PerspectiveCamera(...)
    this.renderer = new THREE.WebGLRenderer({ canvas })
  }
}
vue
<!-- src/vue/components/menu/SkinSelector.vue -->
<script setup>
import SkinPreviewScene from '@three/components/skin-preview-scene.js'
import { onMounted, onUnmounted, ref } from 'vue'

const canvasRef = ref(null)
let preview = null

onMounted(() => {
  preview = new SkinPreviewScene(canvasRef.value)
})

onUnmounted(() => {
  preview?.destroy()
})
</script>

这是唯一允许 Vue 直接操作 Three.js 的情况,因为是隔离的预览场景。

Quick Reference

需求解决方案
UI 触发 3D 动作Pinia action → emitter.emit()
3D 更新 UIemitter.emit() → Vue emitter.on()
共享状态Pinia Store
即时通知mitt 事件
Vue 读取 3D 状态通过 Pinia(3D 写入 Pinia 或 emit 事件)
禁止原因
Vue 直接操作 Experience破坏层分离
Vue 导入 3D 组件类职责混淆
Three.js 直接写 Pinia违反单向数据流
匿名事件监听器无法清理,内存泄漏

© 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-ui-integration of hexianWeb/Third-Person-MC.

Open the folder on GitHubat commit 490203c

Compare with similar skills

Vtj UI Integration 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 UI Integration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Vtj UI Integration this skillhexianWeb/Third-Person-MC194—~2.2kAutomated safety check: PassMIT
Web CloneJane-xiaoer/claude-skill-web-clone1k2 repos~2.7kAutomated safety check: PassMIT
New ExperimentTresjs/tres3.8k—~782Automated safety check: PassMIT
Polycsslayoutit/polycss759—~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 2 repos~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 today
    Game DevelopmentAuto-check passed
  • Polycss

    layoutit/polycss

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

    759 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 16 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 today
    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 10 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.

    194 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.

    194 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.

    194 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.

    194 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.

    194 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.

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

Works with

Questions about Vtj UI Integration

What does Vtj UI Integration do?

Integrates Vue UI with Three.js while maintaining strict separation. Vtj UI Integration is an agent skill from hexianWeb/Third-Person-MC.js while maintaining strict separation.

When should I use Vtj UI Integration?

Vtj UI Integration fits situations like: handling UI-to-scene communication via events; tasks that involve 3D graphics and WebGL.

How do I install Vtj UI Integration in Claude Code?

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

How do I install Vtj UI Integration in Codex?

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

Can I use Vtj UI Integration 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-ui-integration -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-ui-integration, .gemini/skills/vtj-ui-integration, .github/skills/vtj-ui-integration and .opencode/skills/vtj-ui-integration in your project.

What does Vtj UI Integration need to run?

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

Does Vtj UI Integration 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 UI Integration 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 UI Integration use?

Vtj UI Integration 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 UI Integration use?

About 2.2k tokens (SKILL.md is roughly 8.9k 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 UI Integration?

Skills that share tags, products or a category with Vtj UI Integration: Web Clone (Jane-xiaoer/claude-skill-web-clone, 1k stars), New Experiment (Tresjs/tres, 3.8k stars), Polycss (layoutit/polycss, 759 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 UI Integration?

hexianWeb (a GitHub user) maintains it in hexianWeb/Third-Person-MC, which has 194 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.