Individual skill

native-effects

Use when creating, applying, inspecting, editing, or exporting native WebGPU effects in a Design inline HTML screen.

templates/design/.agents/skills/native-effects/SKILL.md

Read pinned source

Source commit ff01b4009091c2140edb34d6f790ec64e7823356

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
No
Observed behavior
Network or broad shell
Last checked
Nov 2, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
7,645
Repository last updated
Nov 7, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Native WebGPU effects

The native shader catalog returned by `get-shader` (`format: "native-v2"`) contains the exact definition versions available in Design. Each entry is one original shader with useful default properties the user can customize; do not create visual variants as preset entries. Previously saved GLSL blocks remain renderable and removable; new shader authoring uses native WGSL.

Read the definitions and their full property schemas with `get-shader`, then read the selected file with `get-shader` or `read-source-file`. Keep its `versionHash` and call `edit-native-shader` with `expectedVersionHash`. Apply a definition by its exact `definitionId` and `definitionVersion`; omit `params` to use all declared defaults or pass property-keyed overrides. For example, `an-native-mesh-anchors` version `5` has a `palette` color-ramp property. To shift it from blue to teal, apply with `params: { palette: [{ position: 0, color: { space: "srgb", components: [0.145, 0.388, 0.922], alpha: 1 } }, { position: 1, color: { space: "srgb", components: [0.078, 0.722, 0.651], alpha: 1 } }] }`. Stop positions run from 0 to 1; color components are normalized sRGB values from 0 to 1. For a selected element without a stable authored `data-agent-native-node-id`, pass a unique same-file `targetSelector`; the action stamps its stable ID and applies the effect in one guarded write. Do not copy generated runtime scripts into source. Fill apply appends another native Fill on the same authored layer, preserving existing Fill instances and CSS paints. Target authored `nodeId` values from the source or projection, rather than layer display names. The manifest `instances` array orders native Fills from bottom to top; the inspector lists the frontmost first. Only one enabled native Layer can be newly applied per target; Backdrop uses its own placement.

## Create with AI

The Shader fill and effect pickers open the existing AgentSidebar with a draft request. Let the user describe the appearance, then use the supplied designId, fileId, authored nodeId or targetSelector, and placement. Create native WebGPU WGSL with declared editable properties; this workflow creates native WGSL rather than historical GLSL blocks. Read `get-shader` and the selected source first so the definition uses the current native manifest, uniform, pass, and resource contracts.

Save the validated custom definition with `edit-native-shader` operation `define-definition` and the current `expectedVersionHash`. Read back with `get-shader` to obtain the saved definition's exact execution hash, approve that version with `approve-definition` and `expectedExecutionHash`, then apply its ID/version to the selected target. Re-read the source hash after each write. Approval is scoped to the current Design and caller; changed executable content needs its own exact-hash approval. Preserve built-in IDs and versions. For a revision, save a new version, approve its execution hash, and use `revise-definition` for the intended instances.

Folded Mesh uses the native indexed-mesh render contract: set `mesh: { columns, rows }` on the render pass, with safe-integer dimensions from 16 to 256 and at most 32,768 cells; omit `draw` and `dispatch` on that pass. WGSL vertex stages address the runtime's shared grid with `@builtin(vertex_index)`. Version `3` retains the 28 numeric controls from version `2` and adds up to four editable lights and four noise bands through shared record-array controls. Light records contain normalized position and direction, color, intensity, amount, and normalized focus; noise-band records contain left/right/top/bottom bounds, feather, strength, frequency, color fade, and normalized focus. Child field units and display scales are part of the returned schema; frequency is cycles per UV axis and displays with `×`. The native record-array contract uses ordered rows, exact field keys, and at most four rows. Angles display in degrees, time offset in seconds, and normalized values in percent; line density displays as a count. Compact packing places scalar properties in consecutive float lanes, aligns `vec2` values to two lanes, and aligns structured paint/color blocks to `vec4`. Folded Mesh versions `1` and `2` use the legacy 128-float (32-`vec4`) capacity; version `3` opts into 256 floats (64 `vec4`s). Read `get-shader` for exact property keys, defaults, units, and WGSL before creating or editing a definition.