Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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 平台支持
.claude/skills/sickn33-makepad-platform/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 70% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 6% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 1% | 0% |
> 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:
Refer to the local files for detailed documentation:
./references/platform-support.md - Platform details and OsTypeBefore answering questions, Claude MUST:
/sync-crate-skills makepad --force 更新文档"| Platform | Graphics Backend | OS Module | |----------|------------------|-----------| | macOS | Metal | apple/metal_*.rs, apple/cocoa_*.rs | | iOS | Metal | apple/metal_*.rs, apple/ios_*.rs | | Windows | D3D11 | mswindows/d3d11_*.rs, mswindows/win32_*.rs | | Linux | OpenGL | linux/opengl_*.rs, linux/x11*.rs, linux/wayland*.rs | | Web | WebGL2 | web/*.rs, web_browser/*.rs | | Android | OpenGL ES | android/*.rs | | OpenHarmony | OHOS | open_harmony/*.rs | | OpenXR | VR/AR | open_xr/*.rs |
rustpub 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 */ } _ => {} } }
rust// 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; }
rust// 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() { }
rust// 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()); } }
platform/src/os/ directorycx.os_type() for runtime platform detection#[cfg(target_os = "...")] for compile-time platform detection| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 17,730 | 13,652 | -23% | 1 | 1 | 0% | 3,045 | 4,088 | +34% | 0 | 0 | — |
case-02 | fail→pass | 16,707 | 10,459 | -37% | 1 | 1 | 0% | 2,816 | 3,212 | +14% | 0 | 0 | — |
case-03 | pass→pass | 10,796 | 6,324 | -41% | 1 | 1 | 0% | 1,869 | 2,547 | +36% | 0 | 0 | — |
case-04 | pass→pass | 10,232 | 7,316 | -28% | 1 | 1 | 0% | 2,042 | 2,630 | +29% | 0 | 0 | — |
case-05 | pass→pass | 9,596 | 3,662 | -62% | 1 | 1 | 0% | 1,693 | 1,914 | +13% | 0 | 0 | — |
case-06 | fail→pass | 5,796 | 2,980 | -49% | 1 | 1 | 0% | 989 | 1,684 | +70% | 0 | 0 | — |
case-07 | fail→pass | 13,054 | 4,644 | -64% | 1 | 1 | 0% | 2,024 | 2,145 | +6% | 0 | 0 | — |
case-08 | fail→pass | 14,041 | 8,643 | -38% | 1 | 1 | 0% | 2,295 | 2,813 | +23% | 0 | 0 | — |
case-09 | pass→pass | 9,209 | 6,754 | -27% | 1 | 1 | 0% | 1,640 | 2,629 | +60% | 0 | 0 | — |
case-10 | pass→pass | 9,755 | 7,033 | -28% | 1 | 1 | 0% | 1,872 | 2,664 | +42% | 0 | 0 | — |
case-11 | fail→pass | 11,756 | 4,096 | -65% | 1 | 1 | 0% | 1,990 | 2,015 | +1% | 0 | 0 | — |
case-12 | pass→pass | 3,418 | 2,875 | -16% | 1 | 1 | 0% | 546 | 1,650 | +202% | 0 | 0 | — |
case-13 | pass→pass | 5,061 | 2,982 | -41% | 1 | 1 | 0% | 1,031 | 1,831 | +78% | 0 | 0 | — |
case-14 | pass→pass | 12,291 | 12,304 | +0% | 1 | 1 | 0% | 2,263 | 3,341 | +48% | 0 | 0 | — |
case-15 | fail→fail | 11,391 | 7,996 | -30% | 1 | 1 | 0% | 1,883 | 2,675 | +42% | 0 | 0 | — |
case-16 | pass→pass | 8,460 | 7,375 | -13% | 1 | 1 | 0% | 1,440 | 2,662 | +85% | 0 | 0 | — |
case-17 | pass→pass | 6,863 | 6,963 | +1% | 1 | 1 | 0% | 1,216 | 2,697 | +122% | 0 | 0 | — |
case-18 | pass→pass | 2,913 | 3,410 | +17% | 1 | 1 | 0% | 464 | 1,824 | +293% | 0 | 0 | — |
case-19 | pass→pass | 8,613 | 4,595 | -47% | 1 | 1 | 0% | 1,552 | 2,142 | +38% | 0 | 0 | — |
case-20 | pass→pass | 5,056 | 4,409 | -13% | 1 | 1 | 0% | 912 | 2,031 | +123% | 0 | 0 | — |
case-21 | pass→pass | 12,702 | 9,407 | -26% | 1 | 1 | 0% | 2,404 | 3,178 | +32% | 0 | 0 | — |
case-22 | pass→pass | 11,960 | 6,560 | -45% | 1 | 1 | 0% | 2,515 | 2,410 | -4% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.