{"id":"92af3e8d-bc9d-406e-b27d-404f69ce094a","shortId":"axBwnE","kind":"skill","title":"makepad-platform","tagline":"CRITICAL: Use for Makepad cross-platform support. Triggers on:\nmakepad platform, makepad os, makepad macos, makepad windows, makepad linux,\nmakepad android, makepad ios, makepad web, makepad wasm, makepad metal,\nmakepad d3d11, makepad opengl, makepad webgl, OsType, CxOs,\nmakepad ","description":"# Makepad Platform Skill\n\n> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-01-19\n>\n> Check for updates: https://crates.io/crates/makepad-widgets\n\nYou are an expert at Makepad cross-platform development. Help users by:\n- **Understanding platforms**: Explain supported platforms and backends\n- **Platform-specific code**: Help with conditional compilation and platform APIs\n\n## When to Use\n- You need to understand or target specific platforms and graphics backends in Makepad.\n- The task involves platform compatibility, conditional compilation, or OS-specific behavior across desktop, mobile, or web.\n- You need guidance on backend differences such as Metal, D3D11, OpenGL, WebGL, or platform modules.\n\n## Documentation\n\nRefer to the local files for detailed documentation:\n- `./references/platform-support.md` - Platform details and OsType\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: \"本地文档不完整，建议运行 `/sync-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## Supported Platforms\n\n| Platform | Graphics Backend | OS Module |\n|----------|------------------|-----------|\n| macOS | Metal | `apple/metal_*.rs`, `apple/cocoa_*.rs` |\n| iOS | Metal | `apple/metal_*.rs`, `apple/ios_*.rs` |\n| Windows | D3D11 | `mswindows/d3d11_*.rs`, `mswindows/win32_*.rs` |\n| Linux | OpenGL | `linux/opengl_*.rs`, `linux/x11*.rs`, `linux/wayland*.rs` |\n| Web | WebGL2 | `web/*.rs`, `web_browser/*.rs` |\n| Android | OpenGL ES | `android/*.rs` |\n| OpenHarmony | OHOS | `open_harmony/*.rs` |\n| OpenXR | VR/AR | `open_xr/*.rs` |\n\n## OsType Enum\n\n```rust\npub enum OsType {\n    Unknown,\n    Windows,\n    Macos,\n    Linux { custom_window_chrome: bool },\n    Ios,\n    Android(AndroidParams),\n    OpenHarmony,\n    Web(WebParams),\n    OpenXR,\n}\n\n// Check platform in code\nfn handle_event(&mut self, cx: &mut Cx, event: &Event) {\n    match cx.os_type() {\n        OsType::Macos => { /* macOS-specific */ }\n        OsType::Windows => { /* Windows-specific */ }\n        OsType::Web(_) => { /* Web-specific */ }\n        _ => {}\n    }\n}\n```\n\n## Platform Detection\n\n```rust\n// In Cx\nimpl Cx {\n    pub fn os_type(&self) -> OsType;\n    pub fn gpu_info(&self) -> &GpuInfo;\n    pub fn xr_capabilities(&self) -> &XrCapabilities;\n    pub fn cpu_cores(&self) -> usize;\n}\n```\n\n## Conditional Compilation\n\n```rust\n// Compile-time platform detection\n#[cfg(target_os = \"macos\")]\nfn macos_only() { }\n\n#[cfg(target_os = \"windows\")]\nfn windows_only() { }\n\n#[cfg(target_os = \"linux\")]\nfn linux_only() { }\n\n#[cfg(target_arch = \"wasm32\")]\nfn web_only() { }\n\n#[cfg(target_os = \"android\")]\nfn android_only() { }\n\n#[cfg(target_os = \"ios\")]\nfn ios_only() { }\n```\n\n## Platform-Specific Features\n\n### Desktop (macOS/Windows/Linux)\n- Window management (resize, minimize, maximize)\n- File dialogs\n- System menu\n- Drag and drop\n- Multiple monitors\n\n### Mobile (iOS/Android)\n- Touch input\n- Virtual keyboard\n- Screen orientation\n- App lifecycle (foreground/background)\n\n### Web (WebGL2)\n- DOM integration\n- Browser events\n- Local storage\n- HTTP requests\n\n## Entry Point\n\n```rust\n// App entry macro\napp_main!(App);\n\npub struct App {\n    ui: WidgetRef,\n}\n\nimpl LiveRegister for App {\n    fn live_register(cx: &mut Cx) {\n        // Register components\n        crate::makepad_widgets::live_design(cx);\n    }\n}\n\nimpl AppMain for App {\n    fn handle_event(&mut self, cx: &mut Cx, event: &Event) {\n        // Handle app events\n        self.ui.handle_event(cx, event, &mut Scope::empty());\n    }\n}\n```\n\n## When Answering Questions\n\n1. Makepad compiles to native code for each platform (no runtime interpreter)\n2. Shaders are compiled at build time for each graphics backend\n3. Platform-specific code is in `platform/src/os/` directory\n4. Use `cx.os_type()` for runtime platform detection\n5. Use `#[cfg(target_os = \"...\")]` for compile-time platform detection\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.","tags":["makepad","platform","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows"],"capabilities":["skill","source-sickn33","skill-makepad-platform","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/makepad-platform","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34726 github stars · SKILL.md body (4,405 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-23T12:51:12.734Z","embedding":null,"createdAt":"2026-04-18T21:40:26.538Z","updatedAt":"2026-04-23T12:51:12.734Z","lastSeenAt":"2026-04-23T12:51:12.734Z","tsv":"'-01':55 '-19':56 '/crates/makepad-widgets':62 '/references/platform-support.md':151 '/sync-crate-skills':187 '1':165,499 '2':174,511 '2026':54 '3':201,522 '4':531 '5':539 'across':122 'android':25,252,255,282,388,390 'androidparam':283 'answer':161,192,211,497 'api':93 'app':427,443,446,448,451,457,475,487 'apple/cocoa_':223 'apple/ios_':229 'apple/metal_':221,227 'appmain':473 'arch':380 'ask':583 'backend':82,107,131,216,521 'base':193 'behavior':121 'bool':280 'boundari':591 'branch':51 'browser':250,434 'build':516 'built':198 'built-in':197 'capabl':341 'cfg':357,364,371,378,385,392,541 'check':57,159,288 'chrome':279 'clarif':585 'claud':163 'clear':558 'code':86,291,504,526 'compat':114 'compil':90,116,350,353,501,514,546 'compile-tim':352,545 'complet':158 'compon':465 'condit':89,115,349 'content':208 'core':346 'cpu':345 'crate':466 'crates.io':61 'crates.io/crates/makepad-widgets':60 'criteria':594 'critic':4 'cross':9,70 'cross-platform':8,69 'custom':277 'cx':297,299,324,326,461,463,471,481,483,491 'cx.os':303,533 'cxos':41 'd3d11':35,136,232 'describ':562 'design':470 'desktop':123,403 'detail':149,153 'detect':321,356,538,549 'dev':50 'develop':72 'dialog':411 'differ':132 'directori':530 'document':142,150,157 'dom':432 'drag':414 'drop':416 'empti':182,495 'entri':440,444 'enum':268,271 'environ':574 'environment-specif':573 'es':254 'event':294,300,301,435,478,484,485,488,490,492 'exist':205 'expert':66,579 'explain':78 'fail':178 'featur':402 'file':147,170,176,180,204,410 'fn':292,328,334,339,344,361,368,375,382,389,396,458,476 'forc':189 'foreground/background':429 'gpu':335 'graphic':106,215,520 'guidanc':129 'handl':293,477,486 'harmoni':260 'help':73,87 'http':438 'impl':325,454,472 'import':156 'incorpor':206 'info':336 'inform':183 'input':422,588 'integr':433 'interpret':510 'involv':112 'io':27,225,281,395,397 'ios/android':420 'keyboard':424 'knowledg':200 'last':52 'lifecycl':428 'limit':550 'linux':23,237,276,374,376 'linux/opengl_':239 'linux/wayland':243 'linux/x11':241 'list':172 'live':459,469 'liveregist':455 'local':146,436 'maco':19,219,275,306,308,360,362 'macos-specif':307 'macos/windows/linux':404 'macro':445 'main':447 'makepad':2,7,14,16,18,20,22,24,26,28,30,32,34,36,38,42,43,48,68,109,188,467,500 'makepad-platform':1 'makepad-widget':47 'manag':406 'match':302,559 'maxim':409 'menu':413 'metal':33,135,220,226 'minim':408 'miss':596 'mobil':124,419 'modul':141,218 'monitor':418 'mswindows/d3d11_':233 'mswindows/win32_':235 'multipl':417 'must':164 'mut':295,298,462,479,482,493 'nativ':503 'need':98,128 'oho':258 'open':259,264 'opengl':37,137,238,253 'openharmoni':257,284 'openxr':262,287 'orient':426 'os':17,119,217,329,359,366,373,387,394,543 'os-specif':118 'ostyp':40,155,267,272,305,310,315,332 'output':568 'pattern':196 'permiss':589 'platform':3,10,15,44,71,77,80,84,92,104,113,140,152,213,214,289,320,355,400,507,524,537,548 'platform-specif':83,399,523 'platform/src/os':529 'point':441 'pub':270,327,333,338,343,449 'question':162,498 'read':166,177 'refer':143,169,203 'regist':460,464 'relev':168 'request':439 'requir':587 'resiz':407 'review':580 'rs':222,224,228,230,234,236,240,242,244,248,251,256,261,266 'runtim':509,536 'rust':269,322,351,442 'safeti':590 'scope':494,561 'screen':425 'self':296,331,337,342,347,480 'self.ui.handle':489 'shader':512 'skill':45,553 'skill-makepad-platform' 'skill.md':195 'source-sickn33' 'specif':85,103,120,309,314,319,401,525,575 'still':191 'stop':581 'storag':437 'struct':450 'substitut':571 'success':593 'support':11,79,212 'system':412 'target':102,358,365,372,379,386,393,542 'task':111,557 'test':577 'time':354,517,547 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'touch':421 'treat':566 'trigger':12 'type':304,330,534 'ui':452 'understand':76,100 'unknown':273 'updat':53,59 'use':5,96,532,540,551 'user':74,184 'usiz':348 'valid':576 'version':46 'virtual':423 'vr/ar':263 'wasm':31 'wasm32':381 'web':29,126,245,247,249,285,316,318,383,430 'web-specif':317 'webgl':39,138 'webgl2':246,431 'webparam':286 'widget':49,468 'widgetref':453 'window':21,231,274,278,311,313,367,369,405 'windows-specif':312 'xr':265,340 '建议运行':186 '更新文档':190 '本地文档不完整':185","prices":[{"id":"497fb23b-6b37-453e-b6f4-31600bc50767","listingId":"92af3e8d-bc9d-406e-b27d-404f69ce094a","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:40:26.538Z"}],"sources":[{"listingId":"92af3e8d-bc9d-406e-b27d-404f69ce094a","source":"github","sourceId":"sickn33/antigravity-awesome-skills/makepad-platform","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/makepad-platform","isPrimary":false,"firstSeenAt":"2026-04-18T21:40:26.538Z","lastSeenAt":"2026-04-23T12:51:12.734Z"}],"details":{"listingId":"92af3e8d-bc9d-406e-b27d-404f69ce094a","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"makepad-platform","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34726,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-23T06:41:03Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"8c9f47806be569966226c4f4f9f295f3098ecfb3","skill_md_path":"skills/makepad-platform/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/makepad-platform"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"makepad-platform","description":"CRITICAL: Use for Makepad cross-platform support. Triggers on:\nmakepad platform, makepad os, makepad macos, makepad windows, makepad linux,\nmakepad android, makepad ios, makepad web, makepad wasm, makepad metal,\nmakepad d3d11, makepad opengl, makepad webgl, OsType, CxOs,\nmakepad 跨平台, makepad 平台支持"},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/makepad-platform"},"updatedAt":"2026-04-23T12:51:12.734Z"}}