---
name: "twojs-renderer-agnostic-shapes"
description: "Write once and render 2D vector scenes across SVG, Canvas 2D, and WebGL with Two.js."
metadata:
  author: "Jono Brandel"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "draw shapes with two.js"
  - "switch two.js renderer webgl canvas"
  - "animate two.js group"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Two.js Renderer-Agnostic 2D Drawing

Draws 2D scenes using Two.js: Two.Group hierarchies, shape primitives, gradients, anchor point manipulation, and seamless switching between SVG, Canvas, and WebGL rendering backends.

## When to Invoke
Invoke this skill whenever you need to:
- draw shapes with two.js
- switch two.js renderer webgl canvas
- animate two.js group

## Execution SOP & Rules
1. Initialize Two instance with new Two({ width, height, type: Two.Types.canvas }).
2. Add shapes with two.makeRectangle(), two.makeCircle(), or two.makePath().
3. Group related elements using two.makeGroup() and transform the group as a single unit.
4. Call two.update() to render changes, or two.play() to start continuous animation.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
