Install any skill in seconds. Free to start, no credit card required.
Get Started Free →autonomous-ai/geometry-and-math
Use this skill when using Phaser 4 math and geometry utilities. Covers vectors, rectangles, circles, triangles, polygons, random number generation, angles, distance, interpolation, and snapping. Triggers on: Vector2, Rectangle, Circle, math, distance, angle, random, lerp.
Passed 21 of 22 test cases with the skill, and 12 of 22 without it.
and 8 more in the full report
9 fixed12 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 9 test cases the skill fixed. Same model, same prompt, with and without the skill.
Before generating dynamic textures in a Phaser 4 rendering tool, I need to verify whether the texture dimensions (width and height) are both valid powers of two. Write a snippet using Phaser 4 utilities to perform this check instead of manual bitwise operations.
| Checked | Without skill | With skill |
|---|---|---|
| Uses Phaser.Math.Pow2.IsSizePowerOfTwo to validate dimensions | Missed | Passed |
The instructions your model reads when the skill loads.
Geom classes (Circle, Ellipse, Line, Polygon, Rectangle, Triangle), intersection tests, and Math utilities (Vector2, Vector3, Matrix4, angles, distances, interpolation, easing, random, snap, clamp).
Related skills: graphics-and-shapes.md, physics-arcade.md
// Create geometry objects (these are data only, not renderable)
const rect = new Phaser.Geom.Rectangle(10, 20, 200, 100);
const circle = new Phaser.Geom.Circle(400, 300, 50);
const line = new Phaser.Geom.Line(0, 0, 100, 100);
// Point containment
rect.contains(50, 50); // true
circle.contains(410, 310); // true
// Intersection test
Phaser.Geom.Intersects.CircleToRectangle(circle, rect); // boolean
// Math utilities
const v = new Phaser.Math.Vector2(3, 4);
v.length(); // 5
v.normalize(); // {x: 0.6, y: 0.8}
const dist = Phaser.Math.Distance.Between(0, 0, 100, 100);
const angle = Phaser.Math.Angle.Between(0, 0, 100, 100);
const clamped = Phaser.Math.Clamp(150, 0, 100); // 100
Geometry objects are pure data containers holding coordinates and dimensions. They are NOT game objects and cannot be added to the display list. To render geometry, use the Graphics game object or Shape game objects (see graphics-and-shapes.md).
Every geom class has a type property set to a Phaser.Geom constant for fast type checks.
test cases passed, vs 12 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.