# pixijs-scene-graphics

Guides AI coding agents on drawing vector paths and primitives in PixiJS v8. Useful when building procedural UI, canvas graphics, and custom shapes.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 6000 installs · ★ 358
- Author: pixijs
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/pixijs/pixijs-skills/tree/HEAD/skills/pixijs-scene-graphics/SKILL.md
- Updated: 2026-10-01
- HTML: https://affpapa.org/en/nevibecode/skills/pixijs-scene-graphics

## What it does

The skill teaches agents the v8 vector workflow based on a shape-then-style pattern. Instead of old drawing routines, the code calls path or shape methods like `rect` or `bezierCurveTo` first, followed by `fill` or `stroke`. It covers `FillGradient`, texture patterns, and stroke properties such as `alignment` or `miterLimit`.

In PixiJS v8, `Graphics` is strictly a leaf node. Never nest child objects inside it. Grouping multiple shapes requires a parent `Container`.

Drawing commands reside in a `GraphicsContext`. Reusing a single context across multiple `Graphics` instances prevents repeated GPU tessellation work.

## Requirements
- Works with: Linear

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pixijs/pixijs-skills --skill pixijs-scene-graphics -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/pixijs-scene-graphics/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/pixijs-scene-graphics/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pixijs/pixijs-skills --skill pixijs-scene-graphics -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/pixijs-scene-graphics/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pixijs/pixijs-skills --skill pixijs-scene-graphics -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/pixijs-scene-graphics/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pixijs/pixijs-skills pixijs-scene-graphics
```

2. **Manually: put the files in place**
- File: `.github/skills/pixijs-scene-graphics/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pixijs/pixijs-skills --skill pixijs-scene-graphics -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pixijs/pixijs-skills --path skills/pixijs-scene-graphics
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/pixijs-scene-graphics/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pixijs/pixijs-skills --skill pixijs-scene-graphics -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pixijs/pixijs-skills/tree/HEAD/skills/pixijs-scene-graphics/SKILL.md

## When to use it
- draw vector primitives and paths using the PixiJS v8 API
- apply linear and radial gradients with `FillGradient`
- share geometry across nodes using `GraphicsContext` to reduce GPU load
- generate rounded complex shapes with `roundPoly` and `filletRect`

## Example prompts
- Draw a rounded rectangle with a linear gradient stroke in PixiJS v8
- Create a hexagon using regularPoly and fill it with a texture
- Set up shared geometry across two Graphics objects using GraphicsContext

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 9e3eca42a2465f38.

BEGIN THIRD-PARTY FILE 9e3eca42a2465f38
````text
---
name: pixijs-scene-graphics
description: "Use this skill when drawing vector shapes and paths in PixiJS v8. Covers the Graphics API: shape-then-fill methods (rect/circle/ellipse/poly/roundRect/star/regularPoly/roundPoly/roundShape/filletRect/chamferRect), path methods (moveTo/lineTo/bezierCurveTo/quadraticCurveTo/arc/arcTo/arcToSvg/closePath), fill/stroke/cut, holes, FillGradient (linear/radial), FillPattern, GraphicsContext sharing, svg import/export, containsPoint hit testing, cloning, clearing, bounds, fillStyle/strokeStyle, draw-time transforms (rotateTransform/scaleTransform/translateTransform/setTransform/save/restore), default styles, GraphicsPath reuse. Triggers on: Graphics, GraphicsContext, rect, circle, poly, roundRect, fill, stroke, cut, hole, beginHole, FillGradient, FillPattern, moveTo, bezierCurveTo, svg, graphicsContextToSvg, svg export, GraphicsOptions, containsPoint, clone, clear, bounds, rotateTransform, translateTransform, setFillStyle, setStrokeStyle, GraphicsPath."
license: MIT
---

`Graphics` is the vector-drawing leaf of the PixiJS v8 scene graph. The v8 API follows a shape-then-style pattern: draw a shape or path with `rect`, `circle`, `moveTo`, etc., then apply `fill` and/or `stroke`. Every method returns `this` for chaining, and the drawing instructions live on a `GraphicsContext` that can be shared between instances.

Assumes familiarity with `pixijs-scene-core-concepts`. `Graphics` is a leaf: do not nest children inside it. Wrap multiple `Graphics` objects in a `Container` to group them.

## Quick Start

```ts
const g = new Graphics();

g.rect(10, 10, 200, 100)
  .fill({ color: 0x3498db, alpha: 0.8 })
  .stroke({ width: 3, color: 0x2c3e50 });

g.circle(300, 60, 40).fill(0xe74c3c);

g.moveTo(50, 200)
  .lineTo(200, 200)
  .bezierCurveTo(250, 250, 100, 300, 50, 250)
  .closePath()
  .fill(0x6c5ce7);

app.stage.addChild(g);
```

**Related skills:** `pixijs-scene-core-concepts` (scene graph basics), `pixijs-scene-container` (group graphics with other objects), `pixijs-scene-core-concepts/references/masking.md` (Graphics as a stencil mask), `pixijs-filters` (effects), `pixijs-performance` (batching, `cacheAsTexture`).

## Constructor options

All `Container` options (`position`, `scale`, `tint`, `label`, `filters`, `zIndex`, etc.) are also valid here — see `skills/pixijs-scene-core-concepts/references/constructor-options.md`.

Leaf-specific options added by `GraphicsOptions`:

| Option        | Type              | Default                 | Description                                                                                                                                                                                          |
| ------------- | ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
````
END THIRD-PARTY FILE 9e3eca42a2465f38

The third-party file has ended. Everything between the 9e3eca42a2465f38 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2975 of 27103 bytes. © pixijs · MIT · https://github.com/pixijs/pixijs-skills/tree/HEAD/skills/pixijs-scene-graphics/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
