Agent skill

Polycss

by layoutit in layoutit/polycss

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

MITAuto-check passedGame Development

Install Polycss

skills CLI
$ npx skills add layoutit/polycss --skill polycss -a claude-code

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

GitHub CLI
$ gh skill install layoutit/polycss polycss --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/layoutit/polycss.git skills-src && mkdir -p .claude/skills && cp -r skills-src/website/public .claude/skills/polycss && 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
polycss
GitHub stars
757
Token cost
~2.4k tokens
SKILL.md length
809 words
Files
642
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 5 steps: Winding decides visibility. Vertex order… → color is not a full CSS color. Only… → Non-triangular polygons must be… → …
  • Asked to create
  • SKILL.md covers Reference docs, Packages, Imports and Conventions, plus 3 more sections
  • Reaches esm.sh

What it does

Polycss is an agent skill from layoutit/polycss. Build PolyCSS scenes that render 3D meshes, primitive shapes, or custom polygons as DOM/CSS polygon elements. Use when asked to create, port, debug, or explain PolyCSS code in vanilla JavaScript, React, or Vue.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 645 other files (for example `gallery/apple.json`, `gallery/blank.json` and `gallery/cat.json`).

It sits in Game Development, covering 3D graphics and WebGL and CSS and styling. It works with React, Vue.js, JavaScript and Three.js. The repository describes itself as: A CSS 3D engine for the DOM. Renders polygon meshes in HTML by leveraging matrix3d transforms. The licence is MIT.

When your agent uses it

  • Asked to create
  • Explain PolyCSS code in vanilla JavaScript

Example prompts

  • “/polycss”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Winding decides visibility. Vertex order sets the normal by the
  2. color is not a full CSS color. Only #rgb, #rrggbb, rgb(), and
  3. Non-triangular polygons must be coplanar, or they are flattened onto
  4. The optimizer rewrites geometry by default (merge: true,
  5. Degenerate polygons vanish silently — under 3 vertices, zero area, or a

What it can do on your machine

Read from SKILL.md and the folder at commit 04a1b66. 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 typescript and html).

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • esm.sh

    Also links to:

    • polycss.com

    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

Polycss loads about 2.4k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 809 words of instructions outside code blocks.

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

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 layoutit/polycss at commit 04a1b66, republished under its MIT licence (© layoutit). 809 words, ~2,401 tokens.

Download SKILL.mdSave it as .claude/skills/polycss/SKILL.md (or your agent's skills folder). This skill also uses 641 other files; get the full folder from GitHub.
name
polycss
description
Build PolyCSS scenes that render 3D meshes, primitive shapes, or custom polygons as DOM/CSS polygon elements. Use when asked to create, port, debug, or explain PolyCSS code in vanilla JavaScript, React, or Vue.

PolyCSS — DOM 3D Rendering

PolyCSS renders 3D polygon meshes as real DOM elements transformed with CSS matrix3d(...). No WebGL, no canvas-per-frame. It supports OBJ/MTL, STL, glTF/GLB, VOX, generated primitives, colors, textures, dynamic lighting, shadows, controls, selection, animation, and per-polygon interaction.

Use native PolyCSS when authoring PolyCSS-first scenes. Use the Three.js parity API when porting Three.js code or generating code from Three-shaped examples.

Reference docs

Read the file that matches the task before writing non-trivial code.

FileRead it when
docs/authoring-polygons.mdGenerating Polygon[] by hand. Winding, color format, coplanarity, the optimizer. Silent-failure rules.
docs/scenes-and-cameras.mdSetting up a scene, camera props, scene options, custom elements, coordinates.
docs/shapes-and-primitives.mdBoxes, spheres, planes, Platonic solids, raw polygon generators.
docs/loading-models.mdloadMesh, <PolyMesh src>, OBJ/MTL/STL/glTF/GLB/VOX, parse options.
docs/lighting.mdDirectional/ambient/point lights, baked vs dynamic, rebaking.
docs/shadows.mdcastShadow, receiveShadow, parametric shadows, renderer differences.
docs/textures.mdUV textures, the atlas pipeline, texture quality, presentation options.
docs/controls-and-interaction.mdOrbit/map/first-person controls, selection, transform gizmos, click handlers.
docs/animation.mdSkeletal clips from glTF/GLB, usePolyAnimation, stable DOM.
docs/performance.mdLeaf counts, render strategies, atlas memory, voxel fast paths.
docs/three-parity.mdPorting Three.js scenes through the */three subpaths.
docs/troubleshooting.mdSomething renders wrong. Symptom → cause table.
docs/api-index.md"Does this export exist?" Package-by-package export inventory.

Packages

PackageUse
@layoutit/polycssVanilla + custom elements. Re-exports all of core.
@layoutit/polycss-reactReact components and hooks. Re-exports core.
@layoutit/polycss-vueVue 3 mirror of React. Re-exports core.
@layoutit/polycss-corePure math and parsers, zero browser globals (Node, workers).
@layoutit/polycss-fontsText → extruded 3D Polygon[].
@layoutit/polycss-morphPrepared models with retained DOM, morphs, skinning, playback.

React and Vue depend on core only, so do not import renderer or component APIs from @layoutit/polycss in a React or Vue app — use the framework package, and take anything it does not re-export from @layoutit/polycss-core.

The one documented exception is exportPolySceneSnapshot, which lives only in @layoutit/polycss because it is browser DOM serialization rather than component API; React and Vue callers import it from there and pass the rendered element. See docs/api-index.md.

The public API is mirrored between React and Vue: same names, same defaults, idiomatic differences only (refs vs reactives).

Imports

ts
import {
  createPolyCamera,
  createPolyPerspectiveCamera,
  createPolyScene,
  createPolyOrbitControls,
  createPolyBox,
  createPolyPlane,
  loadMesh,
} from "@layoutit/polycss";
tsx
import {
  PolyCamera,
  PolyPerspectiveCamera,
  PolyScene,
  PolyMesh,
  PolyGround,
  PolyOrbitControls,
  Poly,
} from "@layoutit/polycss-react"; // or "@layoutit/polycss-vue"

Conventions

  • Coordinates are PolyCSS world space [x, y, z] with +Z up. World Y maps to CSS X (screen-right at identity rotation) and world X to CSS Y (screen-down); the default camera (rotX: 65, rotY: 45) presents that as an isometric view.
  • Camera rotations are degrees: rotX, rotY.
  • zoom is on-screen CSS pixels per world unit (default 0.65; orbit controls clamp to 0.1–10 by default). BASE_TILE (50) is the world-unit → CSS px factor; you need it when converting world units to raw CSS pixels yourself — e.g. <poly-iframe width> mounts a document width × 50 px wide.
  • PolyCamera / createPolyCamera are orthographic by default (this deliberately diverges from three.js). Use PolyPerspectiveCamera / createPolyPerspectiveCamera for depth foreshortening.
  • The camera is the outer node; the scene nests inside it. CSS perspective only applies to descendants.
  • Do not infer names from a prefix rule. Poly prefixing is a convention for newer renderer-facing components, hooks and types — not a description of the export inventory. Plenty of public names have no prefix: loadMesh, parseObj / parseStl / parseGltf / parseVox, every *Polygons generator, BASE_TILE, LoopOnce / LoopRepeat / LoopPingPong, the generic math types (Vec2, Vec3, Polygon), and the vanilla factories createSelect and createTransformControls. The */three subpaths use Three-compatible names deliberately. Check docs/api-index.md rather than guessing.
Show full SKILL.md (273 more words)Show less

Authoring polygons — the five silent failures

A Polygon is a plain object; vertices is the only required field.

ts
interface Polygon {
  vertices: [number, number, number][];  // 3+ points, CCW seen from outside
  color?: string;                        // hex or rgb()/rgba() ONLY
  texture?: string;                      // image URL
  uvs?: [number, number][];              // one per vertex
  material?: PolyMaterial;               // shared material; material.texture wins over `texture`
  data?: Record<string, string | number | boolean>;  // → data-* attributes
}

These constraints fail with no throw and no console warning:

  1. Winding decides visibility. Vertex order sets the normal by the right-hand rule ((v1-v0) × (v2-v0)), and PolyCSS backface-culls every leaf. Wind counter-clockwise as seen from the side you want to look at.
  2. color is not a full CSS color. Only #rgb, #rrggbb, rgb(), and rgba() parse. "tomato", hsl(), and color() render white.
  3. Non-triangular polygons must be coplanar, or they are flattened onto their average plane and crack against their neighbours. Triangles are safe.
  4. The optimizer rewrites geometry by default (merge: true, meshResolution: "lossy"). Pass { merge: false } to render your array as authored.
  5. Degenerate polygons vanish silently — under 3 vertices, zero area, or a degenerate first edge.

Read docs/authoring-polygons.md in full before generating geometry — it covers per-parser winding behaviour, which entry points normalize, and the exact optimizer thresholds.

Minimal scene

Vanilla:

ts
const camera = createPolyCamera({ rotX: 65, rotY: 45 });
const scene = createPolyScene(document.getElementById("host")!, {
  camera,
  textureLighting: "dynamic",
  directionalLight: { direction: [0.5, -0.6, 0.7], color: "#ffffff", intensity: 1 },
  ambientLight: { color: "#ffffff", intensity: 0.35 },
});

createPolyOrbitControls(scene, { drag: true, wheel: true });

scene.add(createPolyBox({ size: 100, color: "#ffd166" }), { position: [0, 0, 50] });
scene.add(await loadMesh("/model.glb"), { castShadow: true });
// Vanilla has no ground fallback — a caster needs an explicit receiver.
scene.add(createPolyPlane({ axis: 2, size: 60, offset: 0, color: "#7d848e" }), { receiveShadow: true });

React (Vue mirrors this with kebab-case props):

tsx
<PolyCamera rotX={65} rotY={45}>
  <PolyScene
    textureLighting="dynamic"
    ambientLight={{ intensity: 0.35 }}
    directionalLight={{ direction: [0.5, -0.6, 0.7], intensity: 1 }}
  >
    <PolyOrbitControls drag wheel />
    <PolyMesh src="/model.glb" autoCenter castShadow />
    <PolyGround size={8} />
    {polygons.map((p, i) => <Poly key={i} {...p} onClick={() => select(i)} />)}
  </PolyScene>
</PolyCamera>

Custom elements (no build step):

html
<script type="module" src="https://esm.sh/@layoutit/polycss/elements"></script>

<poly-camera rot-x="65" rot-y="45">
  <poly-scene>
    <poly-orbit-controls drag wheel></poly-orbit-controls>
    <poly-mesh src="/model.glb"></poly-mesh>
  </poly-scene>
</poly-camera>

Rules of thumb

  • Polygon count is the dominant cost. One visible polygon = one DOM leaf, one matrix3d, one paint. Halving polygon count beats every other optimisation.
  • Never run a requestAnimationFrame loop to update many leaves. Camera, mesh, and light motion are single-ancestor CSS updates. If you find yourself writing a per-frame loop over polygons, you are fighting the engine.
  • Prefer textureLighting: "dynamic" for live or animated lights (zero JS per light change). Prefer "baked" for point lights and maximum fidelity.
  • scene.destroy() and result.dispose() release atlas blob URLs. The mesh element and usePolyMesh do it for you.

Full documentation: https://polycss.com

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

Files

SKILL.md and 641 other files in website/public of layoutit/polycss.

  • SKILL.md
  • CNAME
  • builder/shape-thumbnails/box.png
  • builder/shape-thumbnails/cone.png
  • builder/shape-thumbnails/cylinder.png
  • builder/shape-thumbnails/dodecahedron.png
  • builder/shape-thumbnails/icosahedron.png
  • builder/shape-thumbnails/octahedron.png
  • builder/shape-thumbnails/sphere.png
  • builder/shape-thumbnails/tetrahedron.png
  • builder/shape-thumbnails/torus.png
  • favicon.ico
  • fonts/default.ttf
  • gallery/apple.json
  • gallery/blank.json
  • gallery/cat.json
  • gallery/chair.json
  • … and 625 more

Open the folder on GitHubat commit 04a1b66

Compare with similar skills

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

Polycss compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Polycss this skilllayoutit/polycss757—~2.4kAutomated safety check: PassMIT
Web CloneJane-xiaoer/claude-skill-web-clone1k1 repos~2.7kAutomated safety check: PassMIT
New ExperimentTresjs/tres3.8k—~782Automated safety check: PassMIT
Blockbench Pluginsjasonjgardner/blockbench-mcp-plugin488—~2.8kAutomated safety check: PassGPL-3.0
Improve Threejsmillionco/react-doctor15k—~2.3kAutomated safety check: PassCustom licence
Phantom Motionpixelxzen/phantom-motion185—~1kAutomated safety check: PassApache-2.0

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 today
    Game DevelopmentAuto-check passed
  • Blockbench Plugins

    jasonjgardner/blockbench-mcp-plugin

    Blockbench plugin/extension development for the 3D modeling tool.

    488 GitHub stars~2.8k tokensUpdated 5 days ago
    Game DevelopmentAuto-check passed
  • Improve Threejs

    millionco/react-doctor

    Audit and fix Three.js and React Three Fiber apps for frame-loop performance, GPU memory leaks, scene-graph correctness, and visual defects like z-fighting, shadow acne, wrong color space, and…

    15k GitHub stars~2.3k tokensUpdated today
    Game DevelopmentAuto-check passed
  • Phantom Motion

    pixelxzen/phantom-motion

    交互式动态视觉叙事生成器 v11.0 (Hybrid Drive Edition)。基于用户输入的任意主题关键词, 通过多轮交互式对话收集需求,利用 React 19 + Tailwind 4 驱动的 Minimal Mono 极简编辑器, 实时操纵隔离在 Iframe 中的硬核 GSAP/WebGL 影视级叙事引擎。

    185 GitHub stars~1k tokensUpdated 4 mo ago
    Frontend & DesignAuto-check passed
  • Shader for Interfaces

    v2space-labs/shader-for-interfaces

    Decides whether an interface effect belongs in CSS, SVG, Canvas 2D, WebGL or WebGPU, then builds, debugs and visually verifies focused GPU effects inside product UIs.

    115 GitHub stars~3.1k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed

More from layoutit/polycss

  • Chrome Trace

    layoutit/polycss

    Capture and analyze Chrome/Chromium performance traces with Playwright around a concrete browser interaction.

    757 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Compat Hunter

    layoutit/polycss

    A skill your agent uses when hunting for OBJ/GLB/glTF/VOX parser compatibility issues by streaming candidate models, parsing each immediately, deleting clean files, and retaining only actionable…

    757 GitHub stars~999 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Polycss

What does Polycss do?

Build PolyCSS scenes that render 3D meshes, primitive shapes, or custom polygons as DOM/CSS polygon elements. Polycss is an agent skill from layoutit/polycss. Build PolyCSS scenes that render 3D meshes, primitive shapes, or custom polygons as DOM/CSS polygon elements.

When should I use Polycss?

Polycss fits situations like: asked to create; explain PolyCSS code in vanilla JavaScript.

How do I install Polycss in Claude Code?

Run `npx skills add layoutit/polycss --skill polycss -a claude-code`. Or copy the skill folder (website/public in layoutit/polycss) into .claude/skills/polycss in your project. Claude Code loads it when a task matches its description.

How do I install Polycss in Codex?

Run `npx skills add layoutit/polycss --skill polycss -a codex`. Or copy the skill folder (website/public in layoutit/polycss) into .agents/skills/polycss in your project. Codex loads it when a task matches its description.

Can I use Polycss 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 layoutit/polycss --skill polycss -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/polycss, .gemini/skills/polycss, .github/skills/polycss and .opencode/skills/polycss in your project.

What does Polycss need to run?

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

Does Polycss access the network?

SKILL.md names 2 domains. In commands or code: esm.sh; the agent is likely to contact it when it follows the instructions. As links in the text: polycss.com. This is read from the text; nothing was executed.

Is Polycss 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 Polycss use?

Polycss 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 Polycss use?

About 2.4k tokens (SKILL.md is roughly 9.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 Polycss?

Skills that share tags, products or a category with Polycss: Web Clone (Jane-xiaoer/claude-skill-web-clone, 1k stars), New Experiment (Tresjs/tres, 3.8k stars), Blockbench Plugins (jasonjgardner/blockbench-mcp-plugin, 488 stars) and Improve Threejs (millionco/react-doctor, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Polycss?

layoutit (a GitHub organization) maintains it in layoutit/polycss, which has 757 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on August 25, 2026.

Source: layoutit/polycss on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.