makepad-basics
CRITICAL: Use for Makepad getting started and app structure. Triggers on: makepad, makepad getting started, makepad tutorial, live_design!, app_main!, makepad project setup, makepad hello world, "how to create makepad app", makepad 入门, 创建 makepad 应用, makepad 教程, makepad 项目结构
About this skill
The Makepad Basics skill transforms the AI agent into an expert on the Rust `makepad-widgets` crate, specifically targeting its `dev branch`. It is designed to assist developers with common tasks related to Makepad application development, including project setup, understanding app structure, generating Rust code snippets for UI components (`live_design!`, `app_main!`), and troubleshooting basic issues. The skill helps users get started quickly with Makepad, providing tutorials and answering conceptual questions, including support for Japanese queries related to 'Makepad getting started' or 'creating Makepad apps'. It's an essential tool for new and experienced Makepad developers seeking quick guidance and code examples.
Best use case
Quickly setting up a new Makepad project; Understanding the core architecture of Makepad applications; Generating boilerplate code for Makepad UI elements; Learning Makepad concepts through tutorials and explanations; Troubleshooting common Makepad development issues; Receiving guidance on Makepad development in Japanese.
CRITICAL: Use for Makepad getting started and app structure. Triggers on: makepad, makepad getting started, makepad tutorial, live_design!, app_main!, makepad project setup, makepad hello world, "how to create makepad app", makepad 入门, 创建 makepad 应用, makepad 教程, makepad 项目结构
Well-structured Rust code examples for Makepad components; Clear explanations of Makepad concepts and architecture; Step-by-step guidance for Makepad project setup; Answers to specific questions about Makepad development, potentially in Japanese.
Practical example
Example input
How do I start a new Makepad project and create a simple 'Hello World' application using `live_design!` and `app_main!`? Provide Rust code.
Example output
To set up a Makepad 'Hello World' application:
1. **Create your project:**
```bash
mkdir my_makepad_hello
cd my_makepad_hello
```
2. **Configure `Cargo.toml`:**
Add the necessary `makepad` dependencies. Note that Makepad often uses the `dev` branch for active development.
```toml
[package]
name = "my_makepad_hello"
version = "0.1.0"
edition = "2021"
[dependencies]
makepad-widgets = { git = "https://github.com/makepad/makepad", branch = "dev" }
makepad-live-id = { git = "https://github.com/makepad/makepad", branch = "dev" }
makepad-draw = { git = "https://github.com/makepad/makepad", branch = "dev" }
makepad-text-client = { git = "https://github.com/makepad/makepad", branch = "dev" }
makepad-platform = { git = "https://github.com/makepad/makepad", branch = "dev" }
makepad-render = { git = "https://github.com/makepad/makepad", branch = "dev" }
makepad-trace-logger = { git = "https://github.com/makepad/makepad", branch = "dev" }
```
3. **Create `src/main.rs`:**
This file will contain your Makepad application logic.
```rust
use makepad_widgets::*;
live_design! {
import makepad_widgets::base::*;
import makepad_widgets::theme_desktop_dark::*;
App = {{App}} {
ui: <Window>{
show_bg: true,
width: Fill,
height: Fill,
body = <View>{
flow: Down,
align: Center,
label = <Label>{
text: "Hello Makepad!",
draw_text: { color: #f0f0f0 }
}
}
}
}
}
app_main!(App);
impl LiveHook for App {
fn before_live_design(cx: &mut Cx) {
crate::makepad_widgets::set_widget_style(cx);
}
}
impl AppMain for App {
fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
self.ui.handle_event(cx, event, &mut AfterMove::default());
}
}
```
4. **Run your application:**
```bash
cargo run --release # Use --release for better performance
```
This will open a window displaying "Hello Makepad!" in the center.When to use this skill
- When starting a new Makepad project or learning the framework; When needing to understand `live_design!`, `app_main!`, or other core Makepad constructs; When seeking Rust code examples for Makepad widgets; When encountering basic development problems in a Makepad application; When requiring general guidance on Makepad development in English or Japanese.
When not to use this skill
- When working with Rust projects unrelated to Makepad; When seeking advanced optimization or complex architectural advice beyond basic structure; When requiring debugging tools or deep system-level insights not directly related to Makepad code generation or explanation; When the query pertains to a different UI framework or programming language.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/makepad-basics/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How makepad-basics Compares
| Feature / Agent | makepad-basics | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | easy | N/A |
Frequently Asked Questions
What does this skill do?
CRITICAL: Use for Makepad getting started and app structure. Triggers on: makepad, makepad getting started, makepad tutorial, live_design!, app_main!, makepad project setup, makepad hello world, "how to create makepad app", makepad 入门, 创建 makepad 应用, makepad 教程, makepad 项目结构
Which AI agents support this skill?
This skill is designed for Claude.
How difficult is it to install?
The installation complexity is rated as easy. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Makepad Basics 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 the Rust `makepad-widgets` crate. Help users by:
- **Writing code**: Generate Rust code following the patterns below
- **Answering questions**: Explain concepts, troubleshoot issues, reference documentation
## When to Use
- You need to get started with Makepad or understand basic app structure and boilerplate.
- The task involves project setup, `live_design!`, `app_main!`, or first-screen application wiring.
- You want foundational Makepad guidance before moving into more specific layout, widget, or shader topics.
## Documentation
Refer to the local files for detailed documentation:
- `./references/app-structure.md` - Complete app boilerplate and structure
- `./references/event-handling.md` - Event handling patterns
## 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
## Key Patterns
### 1. Basic App Structure
```rust
use makepad_widgets::*;
live_design! {
use link::theme::*;
use link::shaders::*;
use link::widgets::*;
App = {{App}} {
ui: <Root> {
main_window = <Window> {
body = <View> {
width: Fill, height: Fill
flow: Down
<Label> { text: "Hello Makepad!" }
}
}
}
}
}
app_main!(App);
#[derive(Live, LiveHook)]
pub struct App {
#[live] ui: WidgetRef,
}
impl LiveRegister for App {
fn live_register(cx: &mut Cx) {
crate::makepad_widgets::live_design(cx);
}
}
impl AppMain for App {
fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
self.ui.handle_event(cx, event, &mut Scope::empty());
}
}
```
### 2. Cargo.toml Setup
```toml
[package]
name = "my_app"
version = "0.1.0"
edition = "2024"
[dependencies]
makepad-widgets = { git = "https://github.com/makepad/makepad", branch = "dev" }
```
### 3. Handling Button Clicks
```rust
impl AppMain for App {
fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
let actions = self.ui.handle_event(cx, event, &mut Scope::empty());
if self.ui.button(id!(my_button)).clicked(&actions) {
log!("Button clicked!");
}
}
}
```
### 4. Accessing and Modifying Widgets
```rust
// Get widget references
let label = self.ui.label(id!(my_label));
label.set_text("Updated text");
let input = self.ui.text_input(id!(my_input));
let text = input.text();
```
## API Reference Table
| Macro/Type | Description | Example |
|------------|-------------|---------|
| `live_design!` | Defines UI in DSL | `live_design! { App = {{App}} { ... } }` |
| `app_main!` | Entry point macro | `app_main!(App);` |
| `#[derive(Live)]` | Derive live data | `#[derive(Live, LiveHook)]` |
| `WidgetRef` | Reference to UI tree | `#[live] ui: WidgetRef` |
| `Cx` | Context for rendering | `fn handle_event(&mut self, cx: &mut Cx, ...)` |
| `id!()` | Widget ID macro | `self.ui.button(id!(my_button))` |
## Platform Setup
| Platform | Requirements |
|----------|--------------|
| macOS | Works out of the box |
| Windows | Works out of the box |
| Linux | `apt-get install clang libaudio-dev libpulse-dev libx11-dev libxcursor-dev` |
| Web | `cargo install wasm-pack` |
## When Writing Code
1. Always include required imports: `use makepad_widgets::*;`
2. Use `live_design!` macro for all UI definitions
3. Implement `LiveRegister` and `AppMain` traits
4. Use `id!()` macro for widget references
5. Handle events through `handle_event` method
## When Answering Questions
1. Emphasize live design - changes in DSL reflect instantly without recompilation
2. Makepad is GPU-first - all rendering is shader-based
3. Cross-platform: same code runs on Android, iOS, Linux, macOS, Windows, Web
4. Recommend UI Zoo example for widget explorationRelated Skills
makepad-deployment
CRITICAL: Use for Makepad packaging and deployment. Triggers on: deploy, package, APK, IPA, 打包, 部署, cargo-packager, cargo-makepad, WASM, Android, iOS, distribution, installer, .deb, .dmg, .nsis, GitHub Actions, CI, action, marketplace
n8n-expression-syntax
Validate n8n expression syntax and fix common errors. Use when writing n8n expressions, using {{}} syntax, accessing $json/$node variables, troubleshooting expression errors, or working with webhook data in workflows.
mermaid-expert
Create Mermaid diagrams for flowcharts, sequences, ERDs, and architectures. Masters syntax for all diagram types and styling.
mcp-builder-ms
Use this skill when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
macos-menubar-tuist-app
Build, refactor, or review SwiftUI macOS menubar apps that use Tuist.
kaizen
Guide for continuous improvement, error proofing, and standardization. Use this skill when the user wants to improve code quality, refactor, or discuss process improvements.
issues
Interact with GitHub issues - create, list, and view issues.
hugging-face-tool-builder
Your purpose is now is to create reusable command line scripts and utilities for using the Hugging Face API, allowing chaining, piping and intermediate processing where helpful. You can access the API directly, as well as use the hf command line tool.
git-pushing
Stage all changes, create a conventional commit, and push to the remote branch. Use when explicitly asks to push changes ("push this", "commit and push"), mentions saving work to remote ("save to github", "push to remote"), or completes a feature and wants to share it.
git-hooks-automation
Master Git hooks setup with Husky, lint-staged, pre-commit framework, and commitlint. Automate code quality gates, formatting, linting, and commit message enforcement before code reaches CI.
gh-review-requests
Fetch unread GitHub notifications for open PRs where review is requested from a specified team or opened by a team member. Use when asked to "find PRs I need to review", "show my review requests", "what needs my review", "fetch GitHub review requests", or "check team review queue".
fp-types-ref
Quick reference for fp-ts types. Use when user asks which type to use, needs Option/Either/Task decision help, or wants fp-ts imports.