[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-b93d4a91-d365-43eb-8e84-3263583b7710":3,"$fJSQ88jvOMxEHa5jP0DHLCiBt6sFE3g0uQkXVfeIBPuc":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"b93d4a91-d365-43eb-8e84-3263583b7710","makepad-dsl","|","cat_life_career","mod_other","sickn33,other","---\nname: makepad-dsl\ndescription: |\n  CRITICAL: Use for Makepad DSL syntax and inheritance. Triggers on:\n  makepad dsl, live_design, makepad inheritance, makepad prototype,\n  \"\u003CWidget>\", \"Foo = { }\", makepad object, makepad property,\n  makepad DSL 语法, makepad 继承, makepad 原型, 如何定义 makepad 组件\nrisk: safe\nsource: community\n---\n\n# Makepad DSL Skill\n\n> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-01-19\n>\n> Check for updates: https:\u002F\u002Fcrates.io\u002Fcrates\u002Fmakepad-widgets\n\nYou are an expert at the Rust `makepad-widgets` crate DSL. Help users by:\n- **Writing code**: Generate DSL code following the patterns below\n- **Answering questions**: Explain DSL syntax, inheritance, property overriding\n\n## When to Use\n- You need help with Makepad `live_design!` syntax, object definitions, or inheritance patterns.\n- The task involves widget declarations, property overrides, prototypes, or DSL composition rules.\n- You want Makepad DSL-specific examples rather than generic Rust syntax advice.\n\n## Documentation\n\nRefer to the local files for detailed documentation:\n- `.\u002Freferences\u002Fdsl-syntax.md` - Complete DSL syntax reference\n- `.\u002Freferences\u002Finheritance.md` - Inheritance patterns and examples\n\n## IMPORTANT: Documentation Completeness Check\n\n**Before answering questions, Claude MUST:**\n\n1. Read the relevant reference file(s) listed above\n2. If file read fails or file is empty:\n   - Inform user: \"本地文档不完整，建议运行 `\u002Fsync-crate-skills makepad --force` 更新文档\"\n   - Still answer based on SKILL.md patterns + built-in knowledge\n3. If reference file exists, incorporate its content into the answer\n\n## Key Patterns\n\n### 1. Anonymous Object\n\n```rust\n{\n    width: 100.0\n    height: 50.0\n    color: #FF0000\n}\n```\n\n### 2. Named Object (Prototype)\n\n```rust\nMyButton = {\n    width: Fit\n    height: 40.0\n    padding: 10.0\n    draw_bg: { color: #333333 }\n}\n```\n\n### 3. Inheritance with Override\n\n```rust\nPrimaryButton = \u003CMyButton> {\n    draw_bg: { color: #0066CC }  \u002F\u002F Override parent color\n    draw_text: { color: #FFFFFF }  \u002F\u002F Add new property\n}\n```\n\n### 4. Widget Instantiation\n\n```rust\n\u003CView> {\n    \u002F\u002F Inherits from View prototype\n    width: Fill\n    height: Fill\n\n    \u003CButton> { text: \"Click Me\" }  \u002F\u002F Child widget\n    \u003CLabel> { text: \"Hello\" }      \u002F\u002F Another child\n}\n```\n\n### 5. Linking Rust Struct to DSL\n\n```rust\n\u002F\u002F In live_design!\nMyWidget = {{MyWidget}} {\n    \u002F\u002F DSL properties\n    width: 100.0\n}\n\n\u002F\u002F In Rust\n#[derive(Live, LiveHook, Widget)]\npub struct MyWidget {\n    #[deref] view: View,\n    #[live] width: f64,\n}\n```\n\n## DSL Syntax Reference\n\n| Syntax | Description | Example |\n|--------|-------------|---------|\n| `{ ... }` | Anonymous object | `{ width: 100.0 }` |\n| `Name = { ... }` | Named prototype | `MyStyle = { color: #FFF }` |\n| `\u003CName> { ... }` | Inherit from prototype | `\u003CMyStyle> { size: 10.0 }` |\n| `{{RustType}}` | Link to Rust struct | `App = {{App}} { ... }` |\n| `name = \u003CWidget>` | Named child widget | `btn = \u003CButton> { }` |\n| `dep(\"...\")` | Resource dependency | `dep(\"crate:\u002F\u002Fself\u002Fimg.png\")` |\n\n## Property Types\n\n| Type | Example | Description |\n|------|---------|-------------|\n| Number | `width: 100.0` | Float value |\n| Color | `color: #FF0000FF` | RGBA hex color |\n| String | `text: \"Hello\"` | Text string |\n| Enum | `flow: Down` | Enum variant |\n| Size | `width: Fit` | Fit, Fill, or numeric |\n| Object | `padding: { top: 10.0 }` | Nested object |\n| Array | `labels: [\"A\", \"B\"]` | List of values |\n\n## Inheritance Rules\n\n1. **Eager Copy**: All parent properties are copied immediately\n2. **Override**: Child can override any parent property\n3. **Extend**: Child can add new properties\n4. **Nested Override**: Override nested objects partially\n\n```rust\nParent = {\n    a: 1\n    nested: { x: 10, y: 20 }\n}\n\nChild = \u003CParent> {\n    a: 2              \u002F\u002F Override a\n    b: 3              \u002F\u002F Add new property\n    nested: { x: 30 } \u002F\u002F Override only x, y remains 20\n}\n```\n\n## When Writing Code\n\n1. Use `\u003CWidget>` syntax to inherit from built-in widgets\n2. Define reusable styles as named prototypes\n3. Use `{{RustType}}` to link DSL to Rust structs\n4. Override only properties that need to change\n5. Use meaningful names for child widget references\n\n## When Answering Questions\n\n1. Explain inheritance as \"eager copy\" - properties are copied at definition time\n2. Emphasize that DSL is embedded in Rust via `live_design!` macro\n3. Highlight that changes to DSL are live-reloaded without recompilation\n4. Distinguish between named objects (prototypes) and widget instances\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,167,987,"2026-05-16 13:27:35",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"其他","other","mdi-page-next-outline","其他类型Skill",5,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"职场发展","career","mdi-briefcase-outline","面试准备、简历优化、职业规划",4,575,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"b0b7c97c-0d64-45e8-ab19-613987bdc6cd","1.0.0","makepad-dsl.zip",2399,"uploads\u002Fskills\u002Fb93d4a91-d365-43eb-8e84-3263583b7710\u002Fmakepad-dsl.zip","189c50097a7b81556d18a6543b489f53e86c3795a1095ff3923ee8391327f9f8","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":4874}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]