Antigravity-awesome-skills makepad-dsl
install
source · Clone the upstream repo
git clone https://github.com/sickn33/antigravity-awesome-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/sickn33/antigravity-awesome-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/antigravity-awesome-skills/skills/makepad-dsl" ~/.claude/skills/sickn33-antigravity-awesome-skills-makepad-dsl-724bcf && rm -rf "$T"
manifest:
plugins/antigravity-awesome-skills/skills/makepad-dsl/SKILL.mdsource content
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
syntax, object definitions, or inheritance patterns.live_design! - 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:
- Complete DSL syntax reference./references/dsl-syntax.md
- Inheritance patterns and examples./references/inheritance.md
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 | |
| Named prototype | |
| Inherit from prototype | |
| Link to Rust struct | |
| Named child widget | |
| Resource dependency | |
Property Types
| Type | Example | Description |
|---|---|---|
| Number | | Float value |
| Color | | RGBA hex color |
| String | | Text string |
| Enum | | Enum variant |
| Size | | Fit, Fill, or numeric |
| Object | | Nested object |
| Array | | 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
syntax to inherit from built-in widgets<Widget> - Define reusable styles as named prototypes
- Use
to link DSL to Rust structs{{RustType}} - 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
macrolive_design! - Highlight that changes to DSL are live-reloaded without recompilation
- Distinguish between named objects (prototypes) and widget instances
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.