mcpbeat Sign in

Makepad 2 0 Migration Agent Skill

| makepad migration, live_design to script_mod, makepad upgrade, makepad 1.x, old syntax, new syntax, makepad breaking changes, makepad 迁移, 旧语法, LiveHook to ScriptHook, apply_over to script_apply_eval, Live to Script, live_design!, angle brackets to curly braces

5k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
745
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/ZhangHanDong/makepad-skills --skill makepad-2.0-migration

What comes with it

12 828 bytes besides the instruction
references/migration-guide.md

The instruction itself

14 sections, as written by the author

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.x | Makepad 2.0 | Notes |

|-------------|-------------|-------|

| live_design! { ... } | script_mod! { ... } | Core macro change |

| <Widget> { ... } | Widget{ ... } | No angle brackets |

| Key = Value | Key: value | Colon, 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 |

| DefaultNone | Default | Enum default |

| LiveRegister | WidgetRegister | Widget registration |

| live_register() | register_widget(vm) | Registration method |

| LiveId | LiveId | Unchanged |


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

  • No commas between properties (whitespace-delimited)
  • No semicolons anywhere in Splash
  • No angle brackets for widget types
  • Theme constants use theme.* prefix, not (THEME_*) syntax
  • Named children use := operator, not =
  • Merge operator is +: not : for extending parent properties
  • height: Fit is MANDATORY on containers (default is 0px, not auto)
  • Registration happens in App::run, not live_register
  • 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

| Mistake | Symptom | Fix |

|---------|---------|-----|

| Still using live_design! | Compile error | Replace with script_mod! |

| Using <Widget> syntax | Parse error | Use Widget{} |

| Using Key = Value | Property not applied | Use Key: value |

| Using (THEME_COLOR) | Unknown token | Use theme.color_* |

| Missing height: Fit | Container invisible (0px) | Add height: Fit |

| Using Live derive | Compile error | Use Script |

| Using before_apply | Method not found | Use on_before_apply |

| Using commas between props | Parse error | Remove commas |


Best Practices for Migration

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

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take zhanghandong/makepad-2.0-migration from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.