ontological-layer-composer

Defines a data-driven layer grammar for composing 3D hex worlds in Three.js.

1|Updated Mar 31, 2025
One-click install
npx skills add https://github.com/Iker1211/Resources-Directory --skill ontological-layer-composer-iker1211
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ontological-layer-composer
Source: https://github.com/Iker1211/Resources-Directory/tree/main/skills/mnt/user-data/outputs/skills/ontological-layer-composer
Command: npx skills add https://github.com/Iker1211/Resources-Directory --skill ontological-layer-composer-iker1211

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing a 3D world composition system often leads to tangled code where rendering logic and world data are mixed together. This Skill establishes a clean contract between data files (registry.json, world.json) and the Three.js renderer, so world state stays declarative and the renderer stays dumb. ## Core Features & Use Cases - Three-layer grammar: Defines L0 tiles (exactly one per cell), L1 environment props (0-3 per cell), and L2 occupants (0-1, mutually exclusive with L1), plus separate UI and dungeon contexts. - Registry-driven validation: Each asset declares its layer, valid tile types, and compatibility rules in registry.json, so adding new asset packs requires zero code changes. - Validated place() function: Provides reference logic that enforces tile compatibility, occupant exclusivity, and context isolation before mutating world data. - Use Case: You are building a hex-grid strategy game in Three.js and need to place castles, trees, and rivers on tiles while guaranteeing that a castle never lands on a river and UI items never leak into the main scene. ## Quick Start Ask the AI to design a world composition system with a place() function that validates assets against tile types using a registry.json and world.json structure.

Frequently Asked Questions about ontological-layer-composer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a data-driven 3D world composition system in Three.js?▼

Separate world state into world.json (cell positions and contents) and registry.json (asset rules), then let a composer read both and pass validated data to the renderer. The renderer only draws what it receives and never applies placement rules.

How do I validate asset placement on a hex grid?▼

Validate in a place() function before mutating world data: check the asset exists in the registry, confirm its validOn list includes the cell's tileType, and enforce layer rules such as one occupant per cell and a maximum of three environment props.

Can UI and dungeon assets share the same Three.js scene as the hex world?▼

No. Assets tagged with layer 'ui' or 'dungeon' belong to separate contexts with their own renderers and cameras. Filter them out by registry layer before building the hex world's asset load set.

Why should environment arrays never be null in world.json?▼

A null environment breaks iteration and validation logic in the composer. Always initialize it as an empty array, and when an occupant is placed, reset environment to [] since layers L1 and L2 are mutually exclusive.

When should I use InstancedMesh versus cloned meshes for hex tiles?▼

Use InstancedMesh for layer 0 tiles and for environment props with five or more instances of the same type, since they repeat heavily. Use cloned meshes for occupants because each one is unique per cell.