---
name: "konva-react-canvas-shapes"
description: "Build high-performance 2D diagramming tools and games with react-konva."
metadata:
  author: "Anton Lavrenov"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create react-konva stage"
  - "add transformer handles konva"
  - "drag and drop canvas shape konva"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Konva & react-konva High-Performance Canvas Stage

Manages multi-layer 2D canvas stages using Konva / react-konva: Stage, Layer, FastLayer, Shape components, Transformer selection handles, drag-and-drop, and high-DPI scaling.

## When to Invoke
Invoke this skill whenever you need to:
- create react-konva stage
- add transformer handles konva
- drag and drop canvas shape konva

## Execution SOP & Rules
1. Structure components: <Stage width={800} height={600}><Layer>...</Layer></Stage>.
2. Attach draggable prop on shapes: <Rect draggable onDragEnd={handleDragEnd} />.
3. Separate static background artwork onto a separate Layer to prevent unnecessary redraws.
4. Bind <Transformer ref={trRef} /> to active node references to provide interactive resize handles.

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