Agent skill · Audited from source
Makepad 2.0 Shaders
skill · ZhangHanDong/makepad-skillsLicence not declaredAudited 12 Oct 2026 · source 7cbc563d4f32
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 7cbc563d4f32 and found no filesystem, network or shell access and no hard-coded secrets. What it does: CRITICAL: Use for Makepad 2.0 shader system. Triggers on: makepad shader, Sdf2d, pixel shader, draw_bg, draw_text, draw_quad, makepad gpu, shader function, pixel fn, vertex fn, instance, uniform, shader variable, sdf,…
Cite
Cite this page
ModelsAtlas. “Makepad 2.0 Shaders (ZhangHanDong/makepad-skills)”. Retrieved 12 Oct 2026. https://modelsatlas.com/skills/zhanghandong/makepad-2-0-shaders
Trust audit
Audit 0.4.1 · source read 12 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 1 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass, no license.
Findings (1)
LOWInventory / provenanceinv.no_license
- Why
- no LICENSE file and no repo licence
- Fix
- add a licence
Audit 0.4.1 · source sha 7cbc563d4f32 · 12 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- PublisherZhangHanDong GitHub userOwner of the repository this skill is read from
- Source folderZhangHanDong/makepad-skills/skills/makepad-2.0-shadersThe exact folder we audited
- LicenceNot declaredAs the repository states it
- Commit pinned for this verdict7cbc563d4f32A new audit runs when the source changes
- Repository statusNot archivedLast push 188 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: CRITICAL: Use for Makepad 2.0 shader system. Triggers on: makepad shader, Sdf2d, pixel shader, draw_bg, draw_text, draw_quad, makepad gpu, shader function, pixel fn, vertex fn, instance, uniform, shader variable, sdf,…
---
name: makepad-2.0-shaders
description: |
CRITICAL: Use for Makepad 2.0 shader system. Triggers on:
makepad shader, Sdf2d, pixel shader, draw_bg, draw_text, draw_quad,
makepad gpu, shader function, pixel fn, vertex fn, instance, uniform,
shader variable, sdf, premultiply, Pal.premul, GaussShadow,
makepad graphics, custom draw, DrawQuad, DrawVector,
着色器, 像素, 渲染, 自定义绘制, 距离场
---
# Makepad 2.0 Shader Skill
> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-03-03
## Overview
Makepad uses a custom GPU shader system integrated into the widget property tree. Shaders are defined inline using `pixel: fn() { ... }` and `vertex: fn() { ... }` blocks within `draw_bg`, `draw_text`, or custom draw objects.
## Documentation
Refer to the local files for detailed documentation:
- `./references/shader-reference.md` - Shader syntax, variables, built-ins, custom functions
- `./references/sdf2d-reference.md` - SDF2D primitives, combinators, drawing operations
---
## Shader Basics
### Pixel Shader Structure
```
draw_bg +: {
// Declare variables
instance hover: 0.0 // Animatable per-instance
uniform accent: #4488ff // Shared across all instances
pixel: fn() {
let sdf = Sdf2d.viewport(self.pos * self.rect_size)
// ... SDF operations ...
return sdf.result
}
}
```
### Variable Types
| Type | Declaration | Animatable | Scope |
|------|-------------|-----------|-------|
| `instance` | `instance hover: 0.0` | Yes (via Animator) | Per-widget instance |
| `uniform` | `uniform color: #fff` | No | Shared across instances |
| `texture_2d` | `texture_2d tex: none` | No | Texture sampler |
| `varying` | `varying uv: vec2` | No | Vertex → fragment |
### Built-in Variables
| Variable | Type | Description |
|----------|------|-------------|
| `self.pos` | `vec2` | Normalized position (0.0 to 1.0) |
| `self.rect_size` | `vec2` | Widget size in pixels |
| `self.dpi_factor` | `float` | Screen DPI factor |
| `self.draw_pass.time` | `float` | Time in seconds |
---
## CRITICAL: Premultiply Alpha
**Every pixel shader MUST return premultiplied alpha color!**
```
// WRONG - non-premultiplied
pixel: fn() {
return vec4(1.0, 0.0, 0.0, 0.5)
}
// CORRECT - use Pal.premul()
pixel: fn() {
return Pal.premul(vec4(1.0, 0.0, 0.0, 0.5))
}
// ALSO CORRECT - sdf.result is already premultiplied
pixel: fn() {
let sdf = Sdf2d.viewport(self.pos * self.rect_size)
sdf.circle(cx, cy, r)
sdf.fill(#f00)
return sdf.result
}
```
---
## SDF2D Quick Reference
### Setup
```
let sdf = Sdf2d.viewport(self.pos * self.rect_size)
```
### Primitives
```
sdf.circle(cx, cy, radius)
sdf.rect(x, y, w, h)
sdf.box(x, y, w, h, border_radius)
sdf.hexagon(cx, cy, radius)
sdf.arc(cx, cy, radius, start_angle, end_angle, thickness)
sdf.move_to(x, y)
sdf.line_to(x, y)
sdf.close_path()
```
### Drawing
```
sdf.fill(color) // Filled shape
sdf.stroke(color, width) // Outlined shape
sdf.glow(color, amount) // Glow effect
sdf.clear(color) // Clear with color
```
### Combinators
```
sdf.union() // Add shapes together
sdf.intersect() // Keep overlap only
sdf.subtract() // Remove second from first
sdf.gloop(radius) // Smooth union
sdf.blend(amount) // Linear blend
```
### Transforms
```
sdf.translate(x, y)
sdf.rotate(angle, cx, cy)
sdf.scale(factor, cx, cy)
```
---
## Color Operations
```
// Mix two colors
mix(#f00, #00f, 0.5) // 50% blend
// Premultiply alpha
Pal.premul(vec4(r, g, b, a))
// HSV conversions
Pal.hsv2rgb(vec4(h, s, v, 1.0))
Pal.rgb2hsv(color)
// Random
Math.random_2d(vec2(x, y))
```
---
## Common Shader Patterns
### Gradient Background
```
draw_bg +: {
pixel: fn() {
let grad = mix(#1a1a2e, #16213e, self.pos.y)
return Pal.premul(vec4(grad.xyz, 1.0))
}
}
```
### Hover Color Change
```
draw_bg +: {
instance hover: 0.0
color: #333
pixel: fn() {
return Pal.premul(mix(self.color, self.color * 1.3, self.hover))
}
}
```
### Box Shadow
```
draw_bg +: {
pixel: fn() {
let sdf = Sdf2d.viewport(self.pos * self.rect_size)
// Shadow
sdf.box(2.0, 2.0, self.rect_size.x - 4.0, self.rect_size.y - 4.0, 8.0)
sdf.fill(GaussShadow.box_shadow(sdf, 4.0, #0005))
// Card
sdf.box(0.0, 0.0, self.rect_size.x - 2.0, self.rect_size.y - 2.0, 8.0)
sdf.fill(#2a2a3d)
return sdf.result
}
}
```
### Rounded Button with States
```
draw_bg +: {
instance hover: 0.0
instance down: 0.0
uniform color_bg: #4488ff
uniform color_hover: #5599ff
uniform color_down: #3377ee
pixel: fn() {
let sdf = Sdf2d.viewport(self.pos * self.rect_size)
sdf.box(0.0, 0.0, self.rect_size.x, self.rect_size.y, 6.0)
let color = mix(self.color_bg, self.color_hover, self.hover)
let color = mix(color, self.color_down, self.down)
sdf.fill(color)
return sdf.result
}
}
```
---
## Custom Shader Functions
```
draw_bg +: {
fn wave(pos: vec2, time: float) -> float {
return sin(pos.x * 10.0 + time * 3.0) * 0.1
}
pixel: fn() {
let w = self.wave(self.pos, self.draw_pass.time)
let color = mix(#1a1a2e, #4488ff, self.pos.y + w)
return Pal.premul(vec4(color.xyz, 1.0))
}
}
```
---
## Splash Shader Capability Boundary
**Splash CAN:**
- Override `pixel: fn()`, `vertex: fn()`, `get_color: fn()` on existing draw types via `+:`
- Define helper shader functions within `+:` blocks
- Set instance/uniform variables on existing draw types
- Use all SDF2D, color, math built-ins in shader functions
**Splash CANNOT:**
- Create new DrawQuad/DrawText/DrawSvg types (must define in Rust)
- Add new instance fields to existing shaders (GPU layout is compile-time)
**Rule:** Rust defines the draw type struct + registers it; Splash overrides how it draws.
See `./references/shader-reference.md` "Splash Shader Capabilities & Boundaries" for the fuExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 7cbc563
git clone https://github.com/ZhangHanDong/makepad-skills git -C makepad-skills checkout 7cbc563d4f32
The author documents no install command, so this uses the repository directly. Our verdict covers commit 7cbc563d4f32 only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| Cursor | Mentioned in its text, not tested | Skills for Cursor · About Cursor |
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
7cbc563d4f32
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/zhanghandong/makepad-2-0-shaders/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →ZhangHanDong/makepad-skills
CRITICAL: Use for Makepad 2.0 animation system. Triggers on: makepad animation, makepad animator, Animator, AnimatorState, hover effect, makepad transition, animation state, Forward, Snap, Loop, ease function, makepad…
ZhangHanDong/makepad-skills
CRITICAL: Use for Makepad 2.0 app structure and Rust integration. Triggers on: makepad app, makepad getting started, app_main!, App::run, MatchEvent, AppMain, handle_event, handle_actions, ScriptVm, from_script_mod,…
ZhangHanDong/makepad-skills
CRITICAL: Entry-level skill for Makepad 2.0 GUI development. This is the FIRST skill to load for any Makepad task — it provides design judgment anchors ABOVE the other 13 Makepad 2.0 skills. Triggers on: makepad,…
ZhangHanDong/makepad-skills
CRITICAL: Use for Makepad 2.0 DSL syntax and property system. Triggers on: makepad dsl, script_mod!, makepad syntax, makepad property, makepad 2.0 syntax, colon syntax, merge operator, named instance, let binding,…
ZhangHanDong/makepad-skills
CRITICAL: Use for Makepad 2.0 event and action handling. Triggers on: makepad event, makepad action, MatchEvent, handle_event, handle_actions, on_click, on_render, on_return, on_startup, script_eval!,…
ZhangHanDong/makepad-skills
CRITICAL: Use for Makepad 2.0 layout system. Triggers on: makepad layout, makepad width, makepad height, makepad flex, makepad flow, makepad padding, makepad margin, makepad spacing, makepad align, makepad sizing, Fill,…
Add this badge to your README
[](https://modelsatlas.com/skills/zhanghandong/makepad-2-0-shaders/)
<a href="https://modelsatlas.com/skills/zhanghandong/makepad-2-0-shaders/"><img src="https://modelsatlas.com/skills/zhanghandong/makepad-2-0-shaders/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Makepad 2.0 Shaders
What does the Makepad 2.0 Shaders skill do?
Is Makepad 2.0 Shaders safe to install?
What can Makepad 2.0 Shaders access on my machine?
Which assistants does Makepad 2.0 Shaders work with?
How current is this page?
Sources
- github.com/ZhangHanDong/makepad-skills/tree/main/skills/makepad- — the audited source at commit 7cbc563d4f32 and every finding aboveObserved · 12 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Makepad 2.0 Shaders skill do?
- Is Makepad 2.0 Shaders safe to install?
- What can Makepad 2.0 Shaders access on my machine?