MA

makepad-platform

Assists with platform-specific code and graphics backend management in Makepad projects.

Install

mkdir -p .claude/skills/makepad-platform-tjsndhu && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17736" && unzip -o skill.zip -d .claude/skills/makepad-platform-tjsndhu && rm skill.zip

Installs to .claude/skills/makepad-platform-tjsndhu

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 cross-platform support. Triggers on: makepad platform, makepad os, makepad macos, makepad windows, makepad linux, makepad android, makepad ios, makepad web, makepad wasm, makepad metal, makepad d3d11, makepad opengl, makepad webgl, OsType, CxOs, makepad 跨平台, makepad 平台支持
297 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Explain supported platforms and graphics backends
  • Assist with conditional compilation for platform-specific code
  • Provide guidance on backend differences like Metal, D3D11, OpenGL, and WebGL
  • Help with platform compatibility and OS-specific behavior
  • Identify platform modules for various operating systems

How it works

The skill identifies specific platforms and graphics backends, then provides information on conditional compilation and platform APIs. It uses runtime and compile-time detection for platform-specific code.

Inputs & outputs

You give it
Makepad platform, OS, or graphics backend query
You get back
Explanation of platform support, conditional compilation guidance, or backend differences

When to use makepad-platform

  • Makepad platform debugging
  • Graphics backend configuration
  • Cross-platform API implementation

About this skill

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:

  • ./references/platform-support.md - Platform details and OsType

IMPORTANT: Documentation Completeness Check

Before answering questions, Claude MUST:

  1. Read the relevant reference file(s) listed above
  2. 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
  3. If reference file exists, incorporate its content into the answer

Supported Platforms

PlatformGraphics BackendOS Module
macOSMetalapple/metal_*.rs, apple/cocoa_*.rs
iOSMetalapple/metal_*.rs, apple/ios_*.rs
WindowsD3D11mswindows/d3d11_*.rs, mswindows/win32_*.rs
LinuxOpenGLlinux/opengl_*.rs, linux/x11*.rs, linux/wayland*.rs
WebWebGL2web/*.rs, web_browser/*.rs
AndroidOpenGL ESandroid/*.rs
OpenHarmonyOHOSopen_harmony/*.rs
OpenXRVR/ARopen_xr/*.rs

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

  1. Makepad compiles to native code for each platform (no runtime interpreter)
  2. Shaders are compiled at build time for each graphics backend
  3. Platform-specific code is in platform/src/os/ directory
  4. Use cx.os_type() for runtime platform detection
  5. Use #[cfg(target_os = "...")] for compile-time platform detection

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.

How it compares

This skill centralizes Makepad cross-platform development knowledge, providing specific guidance on platform APIs and conditional compilation, unlike general programming documentation.

Compared to similar skills

makepad-platform side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
makepad-platform (this skill)02moNo flagsIntermediate
tauri7617dReviewAdvanced
rust-errors519dNo flagsAdvanced
hula-skill36moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

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.

76185

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.

521

hula-skill

HuLaSpark

HuLa project skill for frontend (Vue 3 + Vite + UnoCSS + Naive UI/Vant), backend (Tauri v2 + Rust + SeaORM/SQLite), full-stack flows, and build/release work. Use when the user mentions hula or HuLa or requests changes in this repository; after triggering, ask which scope (frontend/backend/fullstack/build-release) to enable.

34

makepad-shaders

ZhangHanDong

CRITICAL: Use for Makepad shader system. Triggers on: makepad shader, makepad draw_bg, Sdf2d, makepad pixel, makepad glsl, makepad sdf, draw_quad, makepad gpu, makepad 着色器, makepad shader 语法, makepad 绘制

16

waterui

water-rs

Build cross-platform apps with WaterUI. Use when writing views, handling state, styling UI, or debugging WaterUI Rust code. Covers reactive bindings, layout, components, and the water CLI.

12

waller-wallpaper-session

gvastethecreator

Extend or debug the Wallpaper Session, monitor drafts, preview flows, editor flow, and profile composition across React, Tauri, and Rust. Use for monitor wallpaper features, profile bugs, preview issues, or domain-model changes.

00

Search skills

Search the agent skills registry