Index of every page on this site: llms.txt
All skills
oahc09 avatar

/cocosair-primitives-mesh

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Build primitive geometry, Mesh buffers and MeshRenderer bindings. Use for vertex attributes, indices, wireframes or AIR_E_PRIMITIVE_DESCRIPTOR validation.

  • 9 files
  • 64.8 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-primitives-mesh

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈45 tokens for metadata: the name and description. ≈548 when used: this file. ≈16k more on demand in 8 files.

Description uses 2.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈181 characters, or 2.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Cocos AIR primitives and mesh authoring

Stop once you can answer the task. Do not read another same-topic reference for the same question.

Scope: Procedural shape geometry, Mesh layouts, attribute access and renderer hooks.

Environment: use package imports in apps; source paths require an AIR checkout. See context.

Quick Start

For complete setup and teardown, read Quick Start.

Siblings: direct dependencies; reuse loaded skills.

Triggers

  • Generate primitive shapes without Creator assets
  • Validate AIR_E_PRIMITIVE_DESCRIPTOR and segment limits
  • Transform or wireframe geometry on the CPU
  • Build a Primitive asset or custom Mesh struct
  • Read or copy vertex attributes and indices
  • Update dynamic mesh buffers after creation
  • Set a renderer instanced attribute

Exact API and symptom mappings: triggers.

Contracts

Geometry is not a renderer: attach a MeshRenderer and material under a visible camera. Validate descriptor limits and vertex/index layouts; keep mesh ownership explicit.

Read references/contracts.md only when the task needs exact option rules, limits, error behavior or source annotations. Prefer the topic references below for a narrower question.

Common Mistakes

  • [HIGH] Convert IGeometry with utils.createMesh before assigning mesh.
  • [HIGH] Descriptor shapes are only box, sphere, cylinder and cone.
  • [HIGH] primitives.cone takes radius, height, then optional options.
  • [MEDIUM] Descriptor includeNormal does not strip a channel.
  • [MEDIUM] Use AttributeName for mesh attribute reads.

Read relevant wrong/right examples before implementation.

Reference map

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ed38648. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
layer
subsystem
All 1 allowed tools
Read Edit Write Bash
Other metadata
compatibility
Cocos AIR source checkout or installed cocosair.js package. Browser rendering requires WebGL 2; source tooling requires Node.js >=18. Use the host-provided tools and user-authorized workspace.
when_to_use
[
  "generate a box, sphere, cylinder or cone",
  "attach procedural geometry to a renderer",
  "author custom vertex buffers and indices",
  "read or copy mesh attributes",
  "a primitive descriptor fails validation"
]
owns
[
  "primitive-geometry",
  "mesh-buffers",
  "vertex-attributes",
  "mesh-indices",
  "mesh-renderer",
  "wireframe"
]
not_for
[
  "draw-call batching and instancing -> cocosair-performance",
  "skeletal binding or morph weights -> cocosair-skinning-morph",
  "material uniforms and effects -> cocosair-materials-effects"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "构建基本几何和原生 Mesh,检查顶点属性、索引、边界与渲染器写入契约。用于代码生成几何或自定义网格。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-primitives-mesh