Agent skill

Vtj Anti Patterns

by hexianWeb in hexianWeb/Third-Person-MC

Prevents common mistakes and prohibited practices in vite-threejs projects.

MITAuto-check passedGame Development

Install Vtj Anti Patterns

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

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

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

At a glance

Prevents common mistakes and prohibited practices in vite-threejs projects.

  • Works in 11 steps: 类型安全 → 错误处理 → 资源管理 → …
  • Tasks that involve 3D graphics and WebGL
  • SKILL.md covers Overview, 禁止清单, 检查清单 and 严重程度
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Vtj Anti Patterns is an agent skill from hexianWeb/Third-Person-MC. Prevents common mistakes and prohibited practices in vite-threejs projects. Use before writing code to avoid bugs, memory leaks, and maintenance issues.

Its SKILL.md is about 1.5k 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 Performance optimization. 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

  • Tasks that involve 3D graphics and WebGL
  • Tasks that involve Performance optimization

Example prompts

  • “Use the vtj-anti-patterns skill to prevent common mistakes and prohibited practices in vite-threejs projects”
  • “/vtj-anti-patterns”

Workflow steps

11 steps, taken from the step headings in SKILL.md.

  1. 类型安全
  2. 错误处理
  3. 资源管理
  4. 输入处理
  5. 层分离
  6. 调试方法
  7. 时间访问
  8. 着色器
  9. 性能
  10. Git 操作
  11. 组件结构

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

    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 Anti Patterns loads about 1.5k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 289 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
~1.5k

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). 289 words, ~1,494 tokens.

Download SKILL.mdSave it as .claude/skills/vtj-anti-patterns/SKILL.md (or your agent's skills folder).
name
vtj-anti-patterns
description
Prevents common mistakes and prohibited practices in vite-threejs projects. Use before writing code to avoid bugs, memory leaks, and maintenance issues.

vite-threejs Anti-Patterns (禁止事项)

Overview

本文档列出本项目中 禁止的做法。违反这些规则会导致 bug、内存泄漏或维护困难。

在编写任何代码之前,请先检查此列表。

禁止清单

1. 类型安全
禁止原因正确做法
as any隐藏类型错误正确定义类型
@ts-ignore绕过检查修复类型问题
@ts-expect-error绕过检查修复类型问题
javascript
// ❌ FORBIDDEN
const value = someObject as any
// @ts-ignore
problematicCode()

// ✅ CORRECT
const value = someObject // 确保类型正确
2. 错误处理
禁止原因正确做法
空 catch 块吞掉错误,调试困难记录或重新抛出
删除失败的测试隐藏问题修复测试或标记 skip
javascript
// ❌ FORBIDDEN
try {
  riskyOperation()
}
catch (e) {} // 空 catch!

// ✅ CORRECT
try {
  riskyOperation()
}
catch (e) {
  console.error('Operation failed:', e)
  // 或重新抛出
  throw e
}
3. 资源管理
禁止原因正确做法
缺少 destroy()内存泄漏涉及 Object3D 必须实现
不清理事件监听内存泄漏destroy() 中 emitter.off()
不 dispose 材质/几何体GPU 内存泄漏销毁时 dispose()
javascript
// ❌ FORBIDDEN: 创建 mesh 但没有 destroy
class BadComponent {
  constructor() {
    this.mesh = new THREE.Mesh(...)
    this.scene.add(this.mesh)
    emitter.on('event', this.handler.bind(this))
  }
  // 没有 destroy() → 泄漏!
}

// ✅ CORRECT
class GoodComponent {
  constructor() {
    this.mesh = new THREE.Mesh(...)
    this.scene.add(this.mesh)
    this._boundHandler = this.handler.bind(this)
    emitter.on('event', this._boundHandler)
  }

  destroy() {
    emitter.off('event', this._boundHandler)
    this.scene.remove(this.mesh)
    this.mesh.geometry?.dispose()
    this.mesh.material?.dispose()
    this.mesh = null
  }
}
4. 输入处理
禁止原因正确做法
手动计算 NDC不一致,易出错使用 iMouse.normalizedMouse
直接监听 window 事件绕过输入系统使用 mitt 事件
匿名事件监听器无法清理保存函数引用
javascript
// ❌ FORBIDDEN
const x = (event.clientX / window.innerWidth) * 2 - 1
window.addEventListener('keydown', e => this.handle(e))
emitter.on('event', data => this.process(data))

// ✅ CORRECT
const ndc = this.iMouse.normalizedMouse
emitter.on('input:jump', this._boundHandler) // 保存引用
5. 层分离
禁止原因正确做法
Vue 直接操作 Three.js破坏解耦通过 mitt 事件
Vue 导入 3D 组件类职责混淆只通过事件交互
Three.js 直接写 Pinia违反数据流emit 事件让 Vue 处理
javascript
// ❌ FORBIDDEN (在 Vue 中)
import Experience from '@three/experience.js'
const exp = new Experience()
exp.world.player.setPosition(0, 0, 0)

// ✅ CORRECT
emitter.emit('game:player-teleport', { x: 0, y: 0, z: 0 })
6. 调试方法
禁止原因正确做法
debuggerInit()命名不一致使用 debugInit()
setDebug()命名不一致使用 debugInit()
直接访问 debug.ui跳过 active 检查先检查 debug.active
javascript
// ❌ FORBIDDEN
debuggerInit() { ... }
setDebug() { ... }
this.debug = this.experience.debug.ui

// ✅ CORRECT
constructor() {
  this.debug = this.experience.debug
  if (this.debug.active) {
    this.debugInit()
  }
}
debugInit() {
  this.debugFolder = this.debug.ui.addFolder(...)
}
7. 时间访问
禁止原因正确做法
通过参数传递 deltaTime不一致通过 Experience 访问
javascript
// ❌ FORBIDDEN
update(deltaTime) {
  this.mesh.rotation.y += deltaTime
}

// ✅ CORRECT
update() {
  const delta = this.experience.time.delta
  this.mesh.rotation.y += delta * 0.001
}
8. 着色器
禁止原因正确做法
着色器放 js 目录组织混乱放 src/shaders/
无调试面板的 uniform无法调参必须有 debugInit
颜色不用 view: 'color'调参困难Tweakpane 用 color view
javascript
// ❌ FORBIDDEN
import shader from './world/effect.glsl'  // 在 js 目录

folder.addBinding(config, 'color')  // 没有 view: 'color'

// ✅ CORRECT
import shader from '@/shaders/effect/fragment.glsl'

folder.addBinding(config, 'color', { view: 'color' })
9. 性能
禁止原因正确做法
每个对象创建几何体内存浪费共享几何体
splice 移除实例O(n) 复杂度swap-and-pop
主线程阻塞操作卡顿使用 IdleQueue
忘记 needsUpdate渲染不更新修改后标记
javascript
// ❌ FORBIDDEN
blocks.forEach((b) => {
  const geo = new THREE.BoxGeometry(1, 1, 1) // 每个都创建!
})
instances.splice(index, 1) // O(n)

// ✅ CORRECT
const sharedGeo = new THREE.BoxGeometry(1, 1, 1) // 共享
instances[index] = instances[instances.length - 1]
instances.pop() // O(1)
10. Git 操作
禁止原因正确做法
未请求时 commit过度主动只在明确请求时
无验证就声称完成可能有问题先运行诊断
修改 bug 时重构范围蔓延Bug 修复要最小化
11. 组件结构
禁止原因正确做法
不使用 Experience 单例不一致new Experience() 获取
提取全部依赖冗余只取所需
继承 EventEmitter已弃用使用 mitt
javascript
// ❌ FORBIDDEN
class BadComponent extends EventEmitter {
  constructor() {
    // 提取全部
    this.scene = exp.scene
    this.camera = exp.camera
    this.renderer = exp.renderer
    this.time = exp.time
    this.sizes = exp.sizes
    this.iMouse = exp.iMouse // 大部分用不到
  }
}

// ✅ CORRECT
class GoodComponent {
  constructor() {
    this.experience = new Experience()
    // 只取需要的
    this.scene = this.experience.scene
    this.resources = this.experience.resources
  }
}

检查清单

在提交代码前,确认以下事项:

  • 没有 as any、@ts-ignore、@ts-expect-error
  • 没有空的 catch 块
  • 涉及 Object3D 的类都有 destroy() 方法
  • 所有事件监听在 destroy 中清理
  • 射线拾取使用 iMouse.normalizedMouse
  • Vue 和 Three.js 之间只通过 mitt 通信
  • 调试方法命名为 debugInit()
  • 时间通过 this.experience.time 访问
  • 着色器在 src/shaders/ 目录
  • ShaderMaterial 的 uniform 有调试面板
  • 颜色控件使用 view: 'color'
  • 没有主线程阻塞操作
  • InstancedMesh 修改后调用 needsUpdate = true

严重程度

级别说明示例
🔴 CRITICAL必然导致 bug 或崩溃缺少 destroy、空 catch
🟠 HIGH导致性能问题或内存泄漏splice 移除、不 dispose
🟡 MEDIUM违反架构规范跨层直接操作
🟢 LOW代码风格问题命名不一致

所有级别的违规都应避免。

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

Open the folder on GitHubat commit 490203c

Compare with similar skills

Vtj Anti Patterns 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 Anti Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Vtj Anti Patterns this skillhexianWeb/Third-Person-MC194—~1.5kAutomated 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
Optimize Performancetextura-agency/next16-claude-starter132—~3.7kAutomated safety check: NotesUnlicense
Threejs Debug Profilermintdotgg/mint-threejs-skills114—~435Automated 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 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.

    759 GitHub stars~2.4k tokensUpdated 1 mo ago
    Game DevelopmentAuto-check passed
  • Optimize Performance

    textura-agency/next16-claude-starter

    Make a page in this starter actually smooth — build it, scroll it in real Chrome on PC and on an emulated phone, fix what the measurement blames, re-measure to prove it.

    132 GitHub stars~3.7k tokensUpdated yesterday
    Game DevelopmentAuto-check: notes
  • Threejs Debug Profiler

    mintdotgg/mint-threejs-skills

    Diagnose Three.js rendering, loading, animation, resize, audio, physics, input, mobile, and performance problems using reproduction and measured evidence.

    114 GitHub stars~435 tokensUpdated 2 mo ago
    Game DevelopmentAuto-check passed
  • Debug and profile Three.js browser games: blank canvases, render and runtime bugs, asset and audio loading, animation, resize, mobile input, plus performance profiling of draw calls, triangles…

    1.2k GitHub starsUsed in 1 repo~602 tokens
    Game DevelopmentAuto-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 Anti Patterns

What does Vtj Anti Patterns do?

Prevents common mistakes and prohibited practices in vite-threejs projects. Vtj Anti Patterns is an agent skill from hexianWeb/Third-Person-MC. Prevents common mistakes and prohibited practices in vite-threejs projects.

When should I use Vtj Anti Patterns?

Vtj Anti Patterns fits situations like: tasks that involve 3D graphics and WebGL; tasks that involve Performance optimization.

How do I install Vtj Anti Patterns in Claude Code?

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

How do I install Vtj Anti Patterns in Codex?

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

Can I use Vtj Anti Patterns 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-anti-patterns -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-anti-patterns, .gemini/skills/vtj-anti-patterns, .github/skills/vtj-anti-patterns and .opencode/skills/vtj-anti-patterns in your project.

What does Vtj Anti Patterns need to run?

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

Does Vtj Anti Patterns 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 Anti Patterns 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 Anti Patterns use?

Vtj Anti Patterns 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 Anti Patterns use?

About 1.5k tokens (SKILL.md is roughly 6k 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 Anti Patterns?

Skills that share tags, products or a category with Vtj Anti Patterns: Web Clone (Jane-xiaoer/claude-skill-web-clone, 1k stars), New Experiment (Tresjs/tres, 3.8k stars), Polycss (layoutit/polycss, 759 stars) and Optimize Performance (textura-agency/next16-claude-starter, 132 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Vtj Anti Patterns?

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.