Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计未展示

makepad-2.0-migrationmakepad 2 0 迁移

Agent Skill

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

总安装

285

周安装

12

GitHub Stars

737

下载量

2
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

用于处理 GitHub 仓库与协作信息,支持代码迁移和版本变更跟踪。

  • 适合在开发流程中围绕仓库状态和代码变更进行整理。
  • 需确认权限范围和维护状态,避免触发不必要的数据读写操作。
  • 建议在测试环境验证后再执行正式迁移,确保过程可控。
  • makepad-2.0-migration 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Makepad 1.x to 2.0 Migration Skill

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

Overview

Makepad 2.0 is a fundamental architecture shift from compile-time static DSL to runtime scripting. Migration involves syntax changes, derive macro updates, lifecycle method renames, and new patterns for state management.

Documentation

Refer to the local files for detailed documentation:

  • ./references/migration-guide.md - Complete migration reference with examples

Quick Syntax Mapping Table

Makepad 1.xMakepad 2.0Notes
live_design! {...}script_mod! {...}Core macro change
<Widget> {...}Widget{...}No angle brackets
Key = ValueKey: valueColon, not equals
(THEME_COLOR)theme.color_*Theme namespace
live_body: {...}body +: {...}Merge operator
#[derive(Live)]#[derive(Script)]Derive macro
#[derive(LiveHook)]#[derive(ScriptHook)]Lifecycle hooks
#[derive(Widget)]#[derive(Widget)]Unchanged
before_apply()on_before_apply()Method rename
after_apply()on_after_apply()Method rename
apply_over!()script_apply_eval!()Runtime updates
DefaultNoneDefaultEnum default
LiveRegisterWidgetRegisterWidget registration
live_register()register_widget(vm)Registration method
LiveIdLiveIdUnchanged

Step-by-Step Migration

Step 1: Replace Macro

// OLD
live_design! {
    import makepad_widgets::base::*;
    import makepad_widgets::theme_desktop_dark::*;

    App = {{App}} {
        ui: <Root> { ... }
    }
}

// NEW
script_mod! {
    use mod.prelude.widgets.*

    startup() do #(App::script_component(vm)){
        ui: Root{
            // ... UI definition
        }
    }
}

Step 2: Update Derives

// OLD
#[derive(Live, LiveHook, Widget)]
pub struct MyWidget { ... }

// NEW
#[derive(Script, ScriptHook, Widget)]
pub struct MyWidget { ... }

Step 3: Update App::run

// OLD
impl LiveRegister for App {
    fn live_register(cx: &mut Cx) {
        makepad_widgets::live_design(cx);
    }
}

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

Step 4: Rename Lifecycle Methods

// OLD
impl LiveHook for MyWidget {
    fn before_apply(&mut self, cx: &mut Cx, ...) { ... }
    fn after_apply(&mut self, cx: &mut Cx, ...) { ... }
}

// NEW
impl ScriptHook for MyWidget {
    fn on_before_apply(&mut self, cx: &mut Cx, ...) { ... }
    fn on_after_apply(&mut self, cx: &mut Cx, ...) { ... }
}

Step 5: Update DSL Syntax

// OLD - angle brackets, equals signs
<View> {
    width: Fill, height: Fill
    show_bg: true
    draw_bg: { color: (THEME_BG) }

    title = <Label> {
        text: "Hello"
        draw_text: { color: #fff }
    }
}

// NEW - curly braces, colons, theme namespace
View{
    width: Fill height: Fill
    show_bg: true
    draw_bg.color: theme.color_bg_app

    title := Label{
        text: "Hello"
        draw_text.color: #fff
    }
}

Step 6: Replace apply_over with script_eval

// OLD
self.label(id!(title)).apply_over(cx, live! {
    text: "New text"
});

// NEW
script_eval!(cx, {
    ui.title.set_text("New text")
});
// OR
script_apply_eval!(cx, self.ui, {
    title.text: "New text"
});

Key Breaking Changes

  1. No commas between properties (whitespace-delimited)
  2. No semicolons anywhere in Splash
  3. No angle brackets for widget types
  4. Theme constants use theme.* prefix, not (THEME_*) syntax
  5. Named children use := operator, not =
  6. Merge operator is +: not : for extending parent properties
  7. height: Fit is MANDATORY on containers (default is 0px, not auto)
  8. Registration happens in App::run, not live_register
  9. Field attribute #[source] links to script object (required on some widgets)
  10. Old old/ directory contains archived 1.x code for reference

Common Migration Mistakes

MistakeSymptomFix
Still using live_design!Compile errorReplace with script_mod!
Using <Widget> syntaxParse errorUse Widget{}
Using Key = ValueProperty not appliedUse Key: value
Using (THEME_COLOR)Unknown tokenUse theme.color_*
Missing height: FitContainer invisible (0px)Add height: Fit
Using Live deriveCompile errorUse Script
Using before_applyMethod not foundUse on_before_apply
Using commas between propsParse errorRemove commas

Best Practices for Migration

  1. Start with examples - Study examples/counter and examples/todo for 2.0 patterns
  2. Migrate one widget at a time - Don't try to convert everything at once
  3. Check the old/ directory - Compare old vs new widget implementations
  4. Test height: Fit - Most invisible UI is caused by missing height
  5. Use theme variables - Replace all hardcoded theme colors with theme.*
  6. Add new_batch: true - Any View with show_bg and text children needs it

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.89%
按下载量换算1

Claude

32.14%
按下载量换算1

Cursor

17.24%
按下载量换算0

Gemini CLI

8.71%
按下载量换算0

安全审计

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

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills