makepad-dsl
CRITICAL: Use for Makepad DSL syntax and inheritance. Triggers on: makepad dsl, live_design, makepad inheritance, makepad prototype, "<Widget>", "Foo = { }", makepad object, makepad property, makepad DSL 语法, makepad 继承, makepad 原型, 如何定义 makepad 组件
About this skill
This skill transforms the AI agent into an expert on the Makepad Domain Specific Language (DSL), specifically for the `makepad-widgets` crate in Rust. It is critical for developers working with Makepad to efficiently design and build user interfaces. The agent can generate correct Makepad DSL code, explain complex syntax rules, clarify inheritance patterns, and guide users on property overriding. This includes providing assistance with core Makepad concepts like `live_design`, widget creation (`<Widget>`), object definitions (`Foo = { }`), and understanding properties. The skill is designed to significantly reduce the learning curve and accelerate development for Makepad projects by acting as a knowledgeable assistant.
Best use case
Rapidly prototyping Makepad UI components using DSL. Understanding the specific syntax, structure, and best practices of Makepad DSL. Debugging issues related to Makepad inheritance, live design, or property conflicts. Learning how to define custom widgets and properties within the Makepad framework. Generating boilerplate Makepad DSL code for new UI elements or complex component compositions.
CRITICAL: Use for Makepad DSL syntax and inheritance. Triggers on: makepad dsl, live_design, makepad inheritance, makepad prototype, "<Widget>", "Foo = { }", makepad object, makepad property, makepad DSL 语法, makepad 继承, makepad 原型, 如何定义 makepad 组件
Accurate, idiomatic, and well-formed Makepad DSL code snippets for various UI components. Clear, concise explanations of Makepad DSL concepts, syntax rules, inheritance mechanisms, and live design principles. Guidance on how to implement specific UI patterns or design solutions using Makepad DSL. Troubleshooting assistance for common Makepad DSL-related errors or architectural challenges.
Practical example
Example input
How do I define a custom Makepad button widget with a specific background color and rounded corners using DSL inheritance?
Example output
```makepad
Button = {{ Button {
draw_bg: {{ DrawQuad {
fn get_color(self) -> vec4 {
return mix(
mix(#808080, #A0A0A0, self.pressed),
mix(#606060, #909090, self.pressed),
self.hover
);
}
fn get_radius(self) -> float {
return 5.0; // Rounded corners
}
}}}
// You can override other properties or behavior here
}}}
```
This defines a `Button` component, inheriting from a base `Button` and overriding its `draw_bg` property to provide a custom background color that changes on hover/press, along with a `5.0` pixel radius for rounded corners.When to use this skill
- When asking questions about Makepad DSL syntax, structure, inheritance, or property overriding.
- When you need to generate Makepad DSL code for UI elements, widgets, or components.
- When encountering issues with Makepad inheritance, prototyping, or property overriding.
- When your prompt contains keywords like 'makepad dsl', 'live_design', 'makepad inheritance', 'makepad prototype', '<Widget>', 'Foo = { }', 'makepad object', 'makepad property', or their Chinese equivalents.
When not to use this skill
- For general Rust programming questions unrelated to the Makepad framework or its DSL.
- For inquiries about other UI frameworks (e.g., egui, iced, web frameworks).
- For tasks that do not involve code generation, explanation, or troubleshooting specific to Makepad DSL.
- When discussing non-Makepad specific design principles or software architecture.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/makepad-dsl/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How makepad-dsl Compares
| Feature / Agent | makepad-dsl | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | easy | N/A |
Frequently Asked Questions
What does this skill do?
CRITICAL: Use for Makepad DSL syntax and inheritance. Triggers on: makepad dsl, live_design, makepad inheritance, makepad prototype, "<Widget>", "Foo = { }", makepad object, makepad property, makepad DSL 语法, makepad 继承, makepad 原型, 如何定义 makepad 组件
Which AI agents support this skill?
This skill is designed for Claude.
How difficult is it to install?
The installation complexity is rated as easy. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Makepad DSL Skill
> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-01-19
>
> Check for updates: https://crates.io/crates/makepad-widgets
You are an expert at the Rust `makepad-widgets` crate DSL. Help users by:
- **Writing code**: Generate DSL code following the patterns below
- **Answering questions**: Explain DSL syntax, inheritance, property overriding
## When to Use
- You need help with Makepad `live_design!` syntax, object definitions, or inheritance patterns.
- The task involves widget declarations, property overrides, prototypes, or DSL composition rules.
- You want Makepad DSL-specific examples rather than generic Rust syntax advice.
## Documentation
Refer to the local files for detailed documentation:
- `./references/dsl-syntax.md` - Complete DSL syntax reference
- `./references/inheritance.md` - Inheritance patterns and examples
## IMPORTANT: Documentation Completeness Check
**Before answering questions, Claude MUST:**
1. Read the relevant reference file(s) listed above
2. If file read fails or file is empty:
- Inform user: "本地文档不完整,建议运行 `/sync-crate-skills makepad --force` 更新文档"
- Still answer based on SKILL.md patterns + built-in knowledge
3. If reference file exists, incorporate its content into the answer
## Key Patterns
### 1. Anonymous Object
```rust
{
width: 100.0
height: 50.0
color: #FF0000
}
```
### 2. Named Object (Prototype)
```rust
MyButton = {
width: Fit
height: 40.0
padding: 10.0
draw_bg: { color: #333333 }
}
```
### 3. Inheritance with Override
```rust
PrimaryButton = <MyButton> {
draw_bg: { color: #0066CC } // Override parent color
draw_text: { color: #FFFFFF } // Add new property
}
```
### 4. Widget Instantiation
```rust
<View> {
// Inherits from View prototype
width: Fill
height: Fill
<Button> { text: "Click Me" } // Child widget
<Label> { text: "Hello" } // Another child
}
```
### 5. Linking Rust Struct to DSL
```rust
// In live_design!
MyWidget = {{MyWidget}} {
// DSL properties
width: 100.0
}
// In Rust
#[derive(Live, LiveHook, Widget)]
pub struct MyWidget {
#[deref] view: View,
#[live] width: f64,
}
```
## DSL Syntax Reference
| Syntax | Description | Example |
|--------|-------------|---------|
| `{ ... }` | Anonymous object | `{ width: 100.0 }` |
| `Name = { ... }` | Named prototype | `MyStyle = { color: #FFF }` |
| `<Name> { ... }` | Inherit from prototype | `<MyStyle> { size: 10.0 }` |
| `{{RustType}}` | Link to Rust struct | `App = {{App}} { ... }` |
| `name = <Widget>` | Named child widget | `btn = <Button> { }` |
| `dep("...")` | Resource dependency | `dep("crate://self/img.png")` |
## Property Types
| Type | Example | Description |
|------|---------|-------------|
| Number | `width: 100.0` | Float value |
| Color | `color: #FF0000FF` | RGBA hex color |
| String | `text: "Hello"` | Text string |
| Enum | `flow: Down` | Enum variant |
| Size | `width: Fit` | Fit, Fill, or numeric |
| Object | `padding: { top: 10.0 }` | Nested object |
| Array | `labels: ["A", "B"]` | List of values |
## Inheritance Rules
1. **Eager Copy**: All parent properties are copied immediately
2. **Override**: Child can override any parent property
3. **Extend**: Child can add new properties
4. **Nested Override**: Override nested objects partially
```rust
Parent = {
a: 1
nested: { x: 10, y: 20 }
}
Child = <Parent> {
a: 2 // Override a
b: 3 // Add new property
nested: { x: 30 } // Override only x, y remains 20
}
```
## When Writing Code
1. Use `<Widget>` syntax to inherit from built-in widgets
2. Define reusable styles as named prototypes
3. Use `{{RustType}}` to link DSL to Rust structs
4. Override only properties that need to change
5. Use meaningful names for child widget references
## When Answering Questions
1. Explain inheritance as "eager copy" - properties are copied at definition time
2. Emphasize that DSL is embedded in Rust via `live_design!` macro
3. Highlight that changes to DSL are live-reloaded without recompilation
4. Distinguish between named objects (prototypes) and widget instancesRelated Skills
makepad-widgets
Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19 > > Check for updates: https://crates.io/crates/makepad-widgets
makepad-splash
CRITICAL: Use for Makepad Splash scripting language. Triggers on: splash language, makepad script, makepad scripting, script!, cx.eval, makepad dynamic, makepad AI, splash 语言, makepad 脚本
new-rails-project
Create a new Rails project
javascript-typescript-typescript-scaffold
You are a TypeScript project architecture expert specializing in scaffolding production-ready Node.js and frontend applications. Generate complete project structures with modern tooling (pnpm, Vite, N
frontend-ui-dark-ts
A modern dark-themed React UI system using Tailwind CSS and Framer Motion. Designed for dashboards, admin panels, and data-rich applications with glassmorphism effects and tasteful animations.
frontend-mobile-development-component-scaffold
You are a React component architecture expert specializing in scaffolding production-ready, accessible, and performant components. Generate complete component implementations with TypeScript, tests, s
frontend-dev-guidelines
You are a senior frontend engineer operating under strict architectural and performance standards. Use when creating components or pages, adding new features, or fetching or mutating data.
fp-backend
Functional programming patterns for Node.js/Deno backend development using fp-ts, ReaderTaskEither, and functional dependency injection
fastapi-templates
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
fastapi-router-py
Create FastAPI routers following established patterns with proper authentication, response models, and HTTP status codes.
dotnet-backend
Build ASP.NET Core 8+ backend services with EF Core, auth, background jobs, and production API patterns.
core-components
Core component library and design system patterns. Use when building UI, using design tokens, or working with the component library.