Install any skill in seconds. Free to start, no credit card required.
Get Started Free →CRITICAL: Use for Makepad shader system. Triggers on: makepad shader, makepad draw_bg, Sdf2d, makepad pixel, makepad glsl, makepad sdf, draw_quad, makepad gpu, makepad 着色器, makepad shader 语法, makepad 绘制
.claude/skills/sickn33-makepad-shaders/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 36% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 36% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 94% | 0% |
> Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19 > > Check for updates: https://crates.io/crates/makepad-widgets
You are an expert at Makepad shaders. Help users by:
draw_bg, Sdf2d, gradients, effects, or GPU-rendered widget appearance.Refer to the local files for detailed documentation:
./references/shader-basics.md - Shader language fundamentals./references/sdf2d-reference.md - Complete Sdf2d API referenceFor production-ready shader patterns, see the _base/ directory:
| Pattern | Description | |---------|-------------| | 01-shader-structure | Shader fundamentals | | 02-shader-math | Mathematical functions | | 03-sdf-shapes | SDF shape primitives | | 04-sdf-drawing | Advanced SDF drawing | | 05-progress-track | Progress indicators | | 09-loading-spinner | Loading animations | | 10-hover-effect | Hover visual effects | | 11-gradient-effects | Color gradients | | 12-shadow-glow | Shadow and glow | | 13-disabled-state | Disabled visuals | | 14-toggle-checkbox | Toggle animations |
Community contributions: ./community/
Before answering questions, Claude MUST:
/sync-crate-skills makepad --force 更新文档"rust<View> { show_bg: true draw_bg: { // Shader uniforms color: #FF0000 // Custom pixel shader fn pixel(self) -> vec4 { return self.color; } } }
rust<View> { show_bg: true draw_bg: { color: #333333 border_color: #666666 border_radius: 8.0 border_size: 1.0 fn pixel(self) -> vec4 { let sdf = Sdf2d::viewport(self.pos * self.rect_size); sdf.box(1.0, 1.0, self.rect_size.x - 2.0, self.rect_size.y - 2.0, self.border_radius); sdf.fill_keep(self.color); sdf.stroke(self.border_color, self.border_size); return sdf.result; } } }
rust<View> { show_bg: true draw_bg: { color: #FF0000 color_2: #0000FF fn pixel(self) -> vec4 { let t = self.pos.x; // Horizontal gradient return mix(self.color, self.color_2, t); } } }
rust<View> { show_bg: true draw_bg: { color: #0066CC fn pixel(self) -> vec4 { let sdf = Sdf2d::viewport(self.pos * self.rect_size); let center = self.rect_size * 0.5; let radius = min(center.x, center.y) - 1.0; sdf.circle(center.x, center.y, radius); sdf.fill(self.color); return sdf.result; } } }
| Component | Description | |-----------|-------------| | draw_* | Shader container (draw_bg, draw_text, draw_icon) | | Uniforms | Typed properties accessible in shader | | fn pixel(self) | Fragment shader function | | fn vertex(self) | Vertex shader function (optional) | | Sdf2d | 2D signed distance field helper |
| Variable | Type | Description | |----------|------|-------------| | self.pos | vec2 | Normalized position (0-1) | | self.rect_size | vec2 | Widget size in pixels | | self.rect_pos | vec2 | Widget position |
| Category | Functions | |----------|-----------| | Shapes | circle, rect, box, hexagon | | Paths | move_to, line_to, close_path | | Fill/Stroke | fill, fill_keep, stroke, stroke_keep | | Boolean | union, intersect, subtract | | Transform | translate, rotate, scale | | Effects | glow, glow_keep, gloop |
| Category | Functions | |----------|-----------| | Math | abs, sign, floor, ceil, fract, min, max, clamp | | Trig | sin, cos, tan, asin, acos, atan | | Interp | mix, step, smoothstep | | Vector | length, distance, dot, cross, normalize | | Exp | pow, exp, log, sqrt |
show_bg: true to enable background shaderSdf2d::viewport() to create SDF contextvec4 (RGBA) from fn pixel()self. prefix to access uniforms and built-ins| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 11,791 | 9,191 | -22% | 1 | 1 | 0% | 2,623 | 3,568 | +36% | 0 | 0 | — |
case-02 | fail→pass | 11,900 | 6,474 | -46% | 1 | 1 | 0% | 2,313 | 3,268 | +41% | 0 | 0 | — |
case-03 | fail→pass | 15,149 | 9,406 | -38% | 1 | 1 | 0% | 2,749 | 3,726 | +36% | 0 | 0 | — |
case-04 | pass→pass | 13,693 | 12,125 | -11% | 1 | 1 | 0% | 2,347 | 3,763 | +60% | 0 | 0 | — |
case-05 | pass→pass | 9,031 | 6,640 | -26% | 1 | 1 | 0% | 1,644 | 2,981 | +81% | 0 | 0 | — |
case-06 | pass→pass | 9,764 | 7,233 | -26% | 1 | 1 | 0% | 1,779 | 3,118 | +75% | 0 | 0 | — |
case-07 | pass→pass | 7,080 | 5,897 | -17% | 1 | 1 | 0% | 1,276 | 2,729 | +114% | 0 | 0 | — |
case-08 | fail→pass | 11,470 | 6,306 | -45% | 1 | 1 | 0% | 1,829 | 2,963 | +62% | 0 | 0 | — |
case-09 | fail→pass | 7,846 | 6,534 | -17% | 1 | 1 | 0% | 1,591 | 3,082 | +94% | 0 | 0 | — |
case-10 | pass→pass | 8,326 | 4,670 | -44% | 1 | 1 | 0% | 1,431 | 2,669 | +87% | 0 | 0 | — |
case-11 | pass→pass | 9,821 | 5,204 | -47% | 1 | 1 | 0% | 1,587 | 2,723 | +72% | 0 | 0 | — |
case-12 | pass→pass | 7,397 | 4,571 | -38% | 1 | 1 | 0% | 1,315 | 2,607 | +98% | 0 | 0 | — |
case-13 | pass→pass | 7,029 | 3,866 | -45% | 1 | 1 | 0% | 1,353 | 2,487 | +84% | 0 | 0 | — |
case-14 | pass→pass | 8,435 | 6,039 | -28% | 1 | 1 | 0% | 1,506 | 2,893 | +92% | 0 | 0 | — |
case-15 | pass→pass | 7,159 | 5,901 | -18% | 1 | 1 | 0% | 1,403 | 2,854 | +103% | 0 | 0 | — |
case-16 | pass→pass | 6,908 | 6,802 | -2% | 1 | 1 | 0% | 1,212 | 2,979 | +146% | 0 | 0 | — |
case-17 | pass→pass | 12,605 | 11,373 | -10% | 1 | 1 | 0% | 2,360 | 3,855 | +63% | 0 | 0 | — |
case-18 | pass→pass | 8,215 | 5,909 | -28% | 1 | 1 | 0% | 1,402 | 2,814 | +101% | 0 | 0 | — |
case-19 | pass→pass | 8,563 | 13,691 | +60% | 1 | 1 | 0% | 1,516 | 2,740 | +81% | 0 | 0 | — |
case-20 | pass→pass | 5,664 | 3,789 | -33% | 1 | 1 | 0% | 1,021 | 2,311 | +126% | 0 | 0 | — |
case-21 | pass→pass | 3,163 | 4,369 | +38% | 1 | 1 | 0% | 556 | 2,523 | +354% | 0 | 0 | — |
case-22 | pass→pass | 9,045 | 7,984 | -12% | 1 | 1 | 0% | 1,573 | 3,055 | +94% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.