makepad-dsl
Provides expert guidance on Makepad DSL syntax, widget declarations, and inheritance for Rust developers.
Install
mkdir -p .claude/skills/makepad-dsl-fiscfed9 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14611" && unzip -o skill.zip -d .claude/skills/makepad-dsl-fiscfed9 && rm skill.zipInstalls to .claude/skills/makepad-dsl-fiscfed9
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
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 组件Key capabilities
- →Generate Makepad DSL code for UI widgets.
- →Explain DSL syntax, inheritance, and property overriding rules.
- →Define reusable styles as named prototypes.
- →Link Rust structs to DSL definitions using `{{RustType}}`.
- →Handle nested object overrides partially.
How it works
The skill generates DSL code and answers questions based on documented patterns and rules for Makepad DSL, including inheritance and property overriding.
Inputs & outputs
When to use makepad-dsl
- →Defining new UI widgets using Makepad DSL
- →Implementing component inheritance patterns
- →Debugging Makepad live_design object definitions
About this skill
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:
- Read the relevant reference file(s) listed above
- 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
- Inform user: "本地文档不完整,建议运行
- If reference file exists, incorporate its content into the answer
Key Patterns
1. Anonymous Object
{
width: 100.0
height: 50.0
color: #FF0000
}
2. Named Object (Prototype)
MyButton = {
width: Fit
height: 40.0
padding: 10.0
draw_bg: { color: #333333 }
}
3. Inheritance with Override
PrimaryButton = <MyButton> {
draw_bg: { color: #0066CC } // Override parent color
draw_text: { color: #FFFFFF } // Add new property
}
4. Widget Instantiation
<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
// 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
- Eager Copy: All parent properties are copied immediately
- Override: Child can override any parent property
- Extend: Child can add new properties
- Nested Override: Override nested objects partially
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
- Use
<Widget>syntax to inherit from built-in widgets - Define reusable styles as named prototypes
- Use
{{RustType}}to link DSL to Rust structs - Override only properties that need to change
- Use meaningful names for child widget references
When Answering Questions
- Explain inheritance as "eager copy" - properties are copied at definition time
- Emphasize that DSL is embedded in Rust via
live_design!macro - Highlight that changes to DSL are live-reloaded without recompilation
- Distinguish between named objects (prototypes) and widget instances
When not to use it
- →When generic Rust syntax advice is needed.
- →When working with Makepad versions other than `makepad-widgets` (dev branch).
- →When the task does not involve `live_design!` syntax or widget definitions.
Limitations
- →The skill is specific to the Rust `makepad-widgets` crate DSL.
- →The skill's knowledge is based on the `dev branch` of `makepad-widgets`.
- →The skill requires local documentation files (`dsl-syntax.md`, `inheritance.md`) for complete answers.
How it compares
This workflow provides specialized knowledge and code generation for the Makepad DSL, ensuring adherence to its specific syntax and inheritance model, unlike general Rust code generation.
Compared to similar skills
makepad-dsl side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| makepad-dsl (this skill) | 0 | 2mo | Review | Advanced |
| rust-errors | 5 | 1mo | No flags | Advanced |
| tauri | 76 | 1mo | Review | Advanced |
| implementing-cards | 7 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by FISCFED9
View all by FISCFED9 →You might also like
rust-errors
EpicenterHQ
Rust to TypeScript error handling patterns for Tauri apps. Use when defining Rust errors that will be passed to TypeScript, handling Tauri command errors, or creating discriminated union error types.
tauri
EpicenterHQ
Tauri path handling, cross-platform file operations, and API usage. Use when working with file paths in Tauri frontend code, accessing filesystem APIs, or handling platform differences in desktop apps.
implementing-cards
bcollazo
Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.
write-rust-tests
RediSearch
Write Rust tests to verify correctness of Rust code.
write-script-rust
windmill-labs
MUST use when writing Rust scripts.
rust-pro
vudovn
Master Rust 1.75+ with modern async patterns, advanced type system features, and production-ready systems programming. Expert in the latest Rust ecosystem including Tokio, axum, and cutting-edge crates. Use PROACTIVELY for Rust development, performance optimization, or systems programming.