Antigravity-awesome-skills makepad-platform
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-platform" ~/.claude/skills/sickn33-antigravity-awesome-skills-makepad-platform-01cf5d && rm -rf "$T"
manifest:
plugins/antigravity-awesome-skills/skills/makepad-platform/SKILL.mdsource content
Makepad Platform 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 Makepad cross-platform development. Help users by:
- Understanding platforms: Explain supported platforms and backends
- Platform-specific code: Help with conditional compilation and platform APIs
When to Use
- You need to understand or target specific platforms and graphics backends in Makepad.
- The task involves platform compatibility, conditional compilation, or OS-specific behavior across desktop, mobile, or web.
- You need guidance on backend differences such as Metal, D3D11, OpenGL, WebGL, or platform modules.
Documentation
Refer to the local files for detailed documentation:
- Platform details and OsType./references/platform-support.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
Supported Platforms
| Platform | Graphics Backend | OS Module |
|---|---|---|
| macOS | Metal | , |
| iOS | Metal | , |
| Windows | D3D11 | , |
| Linux | OpenGL | , , |
| Web | WebGL2 | , |
| Android | OpenGL ES | |
| OpenHarmony | OHOS | |
| OpenXR | VR/AR | |
OsType Enum
pub enum OsType { Unknown, Windows, Macos, Linux { custom_window_chrome: bool }, Ios, Android(AndroidParams), OpenHarmony, Web(WebParams), OpenXR, } // Check platform in code fn handle_event(&mut self, cx: &mut Cx, event: &Event) { match cx.os_type() { OsType::Macos => { /* macOS-specific */ } OsType::Windows => { /* Windows-specific */ } OsType::Web(_) => { /* Web-specific */ } _ => {} } }
Platform Detection
// In Cx impl Cx { pub fn os_type(&self) -> OsType; pub fn gpu_info(&self) -> &GpuInfo; pub fn xr_capabilities(&self) -> &XrCapabilities; pub fn cpu_cores(&self) -> usize; }
Conditional Compilation
// Compile-time platform detection #[cfg(target_os = "macos")] fn macos_only() { } #[cfg(target_os = "windows")] fn windows_only() { } #[cfg(target_os = "linux")] fn linux_only() { } #[cfg(target_arch = "wasm32")] fn web_only() { } #[cfg(target_os = "android")] fn android_only() { } #[cfg(target_os = "ios")] fn ios_only() { }
Platform-Specific Features
Desktop (macOS/Windows/Linux)
- Window management (resize, minimize, maximize)
- File dialogs
- System menu
- Drag and drop
- Multiple monitors
Mobile (iOS/Android)
- Touch input
- Virtual keyboard
- Screen orientation
- App lifecycle (foreground/background)
Web (WebGL2)
- DOM integration
- Browser events
- Local storage
- HTTP requests
Entry Point
// App entry macro app_main!(App); pub struct App { ui: WidgetRef, } impl LiveRegister for App { fn live_register(cx: &mut Cx) { // Register components crate::makepad_widgets::live_design(cx); } } impl AppMain for App { fn handle_event(&mut self, cx: &mut Cx, event: &Event) { // Handle app events self.ui.handle_event(cx, event, &mut Scope::empty()); } }
When Answering Questions
- Makepad compiles to native code for each platform (no runtime interpreter)
- Shaders are compiled at build time for each graphics backend
- Platform-specific code is in
directoryplatform/src/os/ - Use
for runtime platform detectioncx.os_type() - Use
for compile-time platform detection#[cfg(target_os = "...")]
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.