Token导航 LogoToken导航

Agent Skill · 开发

makepad-2.0-app-structure(makepad 2 0 应用程序结构)

makepad-2.0-app-structure 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

makepad-2.0-app-structure 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,暂无第三方扫描结果,按安装量在开发类的 21,746 个 Skill 里排第 19,141。

总安装 291周安装 12GitHub Stars 737下载 95核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:makepad-2.0-app-structure(makepad 2 0 应用程序结构)
来源仓库:https://github.com/zhanghandong/makepad-skills
仓库路径:skills/makepad-2.0-app-structure
安装命令:
npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.0-app-structure
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.0-app-structure

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于分析 GitHub 仓库结构与协作状态,支持 Issue 和 PR 的管理。适合代码审查、变更追踪和团队协作流程优化等开发场景。需确认仓库访问权限和维护状态,避免触发不必要的网络请求或文件读写。建议在操作前核对权限范围,防止误删或覆盖重要代码。

makepad-2.0-app-structure 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/makepad-2.0-app-structure

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

makepad-2.0-app-structure 怎么安装?

在终端执行 npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.0-app-stru…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

makepad-2.0-app-structure 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

makepad-2.0-app-structure 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.0-app-structure 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

makepad-2.0-app-structure 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

makepad-2.0-app-structure 用的人多吗?

公开数据是累计安装 291 次,近一周安装 12 次,下载 95 次,GitHub 737 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

makepad-2.0-app-structure 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 要求有安全扫描结论才肯安装的团队。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
makepad-2.0-app-structure

makepad 2 0 应用程序结构 · 本页

291737执行命令未明确未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Makepad 2.0 App Structure Skill

Version: makepad-widgets (dev branch) | Last Updated: 2026-03-03

Overview

A Makepad 2.0 app combines Rust code with Splash scripting. The Rust side handles app lifecycle, event routing, and business logic. The Splash side defines UI structure, templates, and inline interactions.

Documentation

Refer to the local files for detailed documentation:

  • ./references/app-boilerplate.md - Complete working app template with Cargo.toml
  • ./references/rust-splash-integration.md - Rust ↔ Splash communication patterns

IMPORTANT: Documentation Completeness Check

Before answering questions, Claude MUST:

  1. Read the relevant reference file(s) listed above
  2. If file read fails, answer based on SKILL.md patterns + built-in knowledge

Minimal App Template

Cargo.toml

[package]
name = "my-app"
version = "0.1.0"
edition = "2024"

[dependencies]
makepad-widgets = { path = "../path/to/makepad/widgets" }

src/app.rs (or src/main.rs)

use makepad_widgets::*;

app_main!(App);

script_mod! {
    use mod.prelude.widgets.*

    let state = {
        counter: 0
    }
    mod.state = state

    startup() do #(App::script_component(vm)){
        ui: Root{
            on_startup: ||{
                ui.main_view.render()
            }
            main_window := Window{
                window.inner_size: vec2(420, 300)
                body +: {
                    main_view := View{
                        width: Fill height: Fill
                        flow: Down spacing: 12
                        align: Center
                        on_render: ||{
                            Label{
                                text: "Count: " + state.counter
                                draw_text.text_style.font_size: 24
                            }
                        }
                    }
                    increment_button := Button{
                        text: "Increment"
                    }
                }
            }
        }
    }
}

impl App {
    fn run(vm: &mut ScriptVm) -> Self {
        crate::makepad_widgets::script_mod(vm);
        App::from_script_mod(vm, self::script_mod)
    }
}

#[derive(Script, ScriptHook)]
pub struct App {
    #[live]
    ui: WidgetRef,
}

impl MatchEvent for App {
    fn handle_actions(&mut self, cx: &mut Cx, actions: &Actions) {
        if self.ui.button(cx, ids!(increment_button)).clicked(actions) {
            script_eval!(cx, {
                mod.state.counter += 1
                ui.main_view.render()
            });
        }
    }
}

impl AppMain for App {
    fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
        self.match_event(cx, event);
        self.ui.handle_event(cx, event, &mut Scope::empty());
    }
}

Key Components Explained

1. app_main!(App)

Registers App as the application entry point. MUST be called at module level.

2. script_mod! {...}

Defines the Splash script that runs at startup. Contains:

  • use mod.prelude.widgets.* - Import widget definitions
  • State definitions (let state = {...})
  • Functions and templates
  • startup() do #(App::script_component(vm)){...} - UI construction

3. App::run(vm) - Initialization Order

CRITICAL: Registration order matters!

fn run(vm: &mut ScriptVm) -> Self {
    // 1. Register theme (optional, for light/dark theme)
    crate::makepad_widgets::theme_mod(vm);
    script_eval!(vm, { mod.theme = mod.themes.light });

    // 2. Register base widgets
    crate::makepad_widgets::widgets_mod(vm);

    // 3. Register custom widget modules (if any)
    // crate::my_widgets::script_mod(vm);

    // 4. Build app from script module
    App::from_script_mod(vm, self::script_mod)
}

Simplified (without theme selection):

fn run(vm: &mut ScriptVm) -> Self {
    crate::makepad_widgets::script_mod(vm);   // Registers both theme + widgets
    App::from_script_mod(vm, self::script_mod)
}

4. #[derive(Script, ScriptHook)] on App struct

#[derive(Script, ScriptHook)]
pub struct App {
    #[live]
    ui: WidgetRef,    // The widget tree root
}
  • Script - Enables Splash integration (replaces old Live)
  • ScriptHook - Enables lifecycle hooks (replaces old LiveHook)
  • #[live] - Field settable from DSL

5. MatchEvent for Action Handling

impl MatchEvent for App {
    fn handle_actions(&mut self, cx: &mut Cx, actions: &Actions) {
        // Check button clicks
        if self.ui.button(cx, ids!(my_button)).clicked(actions) {
            // Handle click
        }
        // Check text input changes
        if let Some(text) = self.ui.text_input(cx, ids!(my_input)).changed(actions) {
            log!("Input: {}", text);
        }
    }
}

6. AppMain for Event Dispatch

impl AppMain for App {
    fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
        self.match_event(cx, event);  // MUST call for MatchEvent to work
        self.ui.handle_event(cx, event, &mut Scope::empty());
    }
}

Rust → Splash Communication

script_eval! - Update state and trigger renders

script_eval!(cx, {
    mod.state.counter += 1
    ui.main_view.render()
});

script_apply_eval! - Patch widget properties

script_apply_eval!(cx, self.ui, {
    title.text: "New Title"
    subtitle.draw_text.color: #f00
});

Splash → Rust Communication

Inline Event Handlers in script_mod!

Button{
    text: "Click"
    on_click: || {
        // Splash code runs here
        state.count += 1
        ui.display.render()
    }
}

TextInput{
    on_return: || {
        let text = ui.my_input.text()
        add_item(text)
        ui.my_input.set_text("")
    }
}

// Render callback
on_render: || {
    for i, item in items {
        ItemTemplate{label.text: item.name}
    }
}

Widget Access from Rust

// Buttons
self.ui.button(cx, ids!(button_name)).clicked(actions)

// Labels
self.ui.label(cx, ids!(label_name)).set_text(cx, "text")

// Text inputs
self.ui.text_input(cx, ids!(input_name)).text()

// Nested access
self.ui.label(cx, ids!(container.inner.title))

Running the App

# Development
cargo run -p my-app

# Development with hot reload (Splash changes apply without recompilation)
cargo run -p my-app -- --hot

# Release
cargo run -p my-app --release

# With cargo-makepad for mobile/web
cargo makepad run -p my-app

Command-Line Flags

FlagDescription
--hotEnable hot reload: watches script_mod! source files and auto-refreshes UI on save. Only affects Splash DSL; Rust code changes still need recompilation.
--stdin-loopStudio mode: communicates with Makepad Studio via stdin/websocket. Used internally by Studio, not for manual use.
`--linux-backend=<x11\wayland>`(Linux only) Select windowing backend.

Makepad Studio: Debugging Splash

Running Splash Scripts in Studio

Studio looks for a makepad.splash file in the project root. It can run Splash scripts directly via the Run List panel (uses start_script_run internally), without needing cargo run.

Debug Output

Use std.println() / std.print() inside Splash scripts — output appears in both Studio's Log View panel and terminal stdout:

// makepad.splash
std.println("debug: value = " + my_var);

Error Display

Script failures show in Studio's Log View with file path and error details:

script failed while evaluating makepad.splash: <error details>

Hub API (Studio-injected hub module)

When running under Studio, Splash scripts get a hub module:

APIDescription
hub.run(env, cmd, args)Launch subprocess from Splash
hub.set_run_items(items)Register runnable items in Studio's Run List
hub.studio_ipStudio's WebSocket address

Current Limitations

  • No breakpoint debugging — Splash VM does not support breakpoints or stepping
  • No AST dump flag — Inspecting parse results requires adding logs in Rust source (script/)
  • Print-based debugging — std.println() is the primary debugging tool

Audio API (Rust-only, not exposed to Splash)

Makepad 2.0 provides native audio I/O via the CxMediaApi trait. Audio callbacks run on a separate real-time thread.

Audio Output

use makepad_widgets::*;

impl AppMain for App {
    fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
        match event {
            Event::Startup => {
                cx.audio_output(0, move |_info, buffer: &mut AudioBuffer| {
                    for frame in 0..buffer.frame_count() {
                        let sample = /* generate sample */;
                        buffer.set(0, frame, sample);
                        buffer.set(1, frame, sample);
                    }
                });
            }
            _ => {}
        }
        self.match_event(cx, event);
        self.ui.handle_event(cx, event, &mut Scope::empty());
    }
}

Audio Input

cx.audio_input(0, move |info: AudioInfo, buffer: &AudioBuffer| {
    let sample_rate = info.sample_rate;
    for frame in 0..buffer.frame_count() {
        let sample = buffer.get(0, frame);
    }
});

Key Audio Types (platform/src/audio.rs)

TypeDescription
AudioBufferMultichannel sample container (f32)
AudioInfoDevice ID, sample rate, timing
AudioDeviceDescDevice metadata (name, type, channels)
AudioStreamSender/ReceiverDecoupled audio routing with adaptive buffering

Cross-Thread Data Flow Pattern (Audio → UI)

Audio callbacks run on a real-time thread. Use atomics to pass data to the UI thread:

use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;

let amplitude = Arc::new(AtomicU64::new(0));
let amp_clone = amplitude.clone();

cx.audio_output(0, move |_info, buffer: &mut AudioBuffer| {
    let mut sum = 0.0f32;
    for frame in 0..buffer.frame_count() {
        let s = buffer.get(0, frame);
        sum += s * s;
    }
    let rms = (sum / buffer.frame_count() as f32).sqrt();
    amp_clone.store(rms.to_bits() as u64, Ordering::Relaxed);
});

// UI thread: read on NextFrame
let rms = f32::from_bits(amplitude.load(Ordering::Relaxed) as u32);

IMPORTANT: Audio is NOT exposed to Splash scripting. All audio processing must happen in Rust.

Platform Support

PlatformAudio OutputAudio InputImplementation
macOS/iOSAudioUnitAVCaptureapple_media.rs
WindowsWASAPIWASAPIwindows_media.rs
LinuxALSA/PulseAudioALSAlinux_media.rs
Web/WASMWebAudioMediaDevicesweb_media.rs
AndroidAAudioNDK Camera2android_media.rs

Reference: TeamTalk Example

examples/teamtalk/ demonstrates full P2P audio chat with cx.audio_input()/cx.audio_output(), resampling, and UDP streaming.


Best Practices

  1. Registration order - Theme → Base widgets → Custom widgets → App module
  2. Use script_eval! to bridge Rust actions to Splash state updates
  3. Call self.match_event(cx, event) in handle_event (required for MatchEvent)
  4. Use on_render for dynamic content, call .render() to trigger updates
  5. Keep business logic in Rust, keep UI declarations in Splash
  6. Use mod.state for app-wide state accessible from both Rust and Splash
  7. Audio processing in Rust only - Use atomics for audio→UI data flow

macOS System Integration Patterns (learned 2026-03-31)

NSStatusBar (Menu Bar Icon)

Makepad has no built-in NSStatusBar API. Use makepad_objc_sys (same ObjC runtime as Makepad) for system tray integration:

use makepad_objc_sys::{msg_send, class, sel, sel_impl};
use makepad_objc_sys::runtime::{Object, Sel, YES, NO};

// Create status bar item
let status_bar: ObjcId = msg_send![class!(NSStatusBar), systemStatusBar];
let item: ObjcId = msg_send![status_bar, statusItemWithLength: -1.0f64];
let button: ObjcId = msg_send![item, button];
let () = msg_send![button, setTitle: str_to_nsstring("MIC")];

Critical gotchas:

  • Do NOT use objc2 crate — it creates a separate NSApplication instance that conflicts with Makepad's
  • show_in_dock(false) hides NSStatusItem — use LSUIElement=true in Info.plist instead
  • Menu target objects get autoreleased — use a global singleton target + sender.tag() for action dispatch
  • Do NOT call CGEventTapEnable(tap, true) — CGEvent taps are enabled by default on creation; calling Enable actually disables them

Audio Input — Device ID Required

cx.use_audio_inputs(&[]) means stop recording, not "use default device". Must get device ID from AudioDevicesEvent:

impl MatchEvent for App {
    fn handle_audio_devices(&mut self, _cx: &mut Cx, e: &AudioDevicesEvent) {
        // Save default device ID
        self.default_input = e.default_input().into_iter().next();
    }
}

// When starting recording:
if let Some(device_id) = self.default_input {
    cx.use_audio_inputs(&[device_id]);  // Start capture with specific device
}

// When stopping:
cx.use_audio_inputs(&[]);  // Empty = stop all audio input

CGEvent Tap — Global Hotkey

For global keyboard shortcuts (e.g., press-to-talk):

// CGEventGetFlags returns 0x80000 for Option key (not 0x20 as some docs suggest)
let key_mask: u64 = 0x080000; // kCGEventFlagMaskAlternate

// Use CFRunLoopCommonModes (not DefaultMode)
CFRunLoopAddSource(run_loop, source, kCFRunLoopCommonModes);

// Do NOT call CGEventTapEnable — it's already enabled
// CGEventTapEnable(tap, true);  // WRONG — this actually breaks it

// CFRunLoopRun blocks forever — put in dedicated thread
CFRunLoopRun();

Cross-Thread Communication Pattern

macos-sys (CFRunLoop thread) → crossbeam channel → Makepad timer poll (main thread)
Audio callback (RT thread)   → Arc<AtomicU64>    → NextFrame handler (main thread)
HTTP response               → MatchEvent handler → UI update via script_eval!

Timer poll pattern for receiving ObjC callbacks:

// In handle_timer (10ms interval):
let events: Vec<u64> = self.menu_rx.as_ref()
    .map(|rx| rx.try_iter().collect())
    .unwrap_or_default();
for action_id in events {
    self.handle_menu_action(cx, action_id);
}

平台分布

Codex

34.39%
按下载量换算33

Claude

29.2%
按下载量换算28

Cursor

18.72%
按下载量换算18

Gemini CLI

10.07%
按下载量换算10

安全审计

暂无安全审计结果可展示。

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/zhanghandong/makepad-skills --skill makepad-2.0-app-structure 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills