スキル一覧に戻る
johnlindquist

gpui

by johnlindquist

Script Kit rewritten in Rust using GPUI (Zed's UI framework)

16🍴 2📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: gpui description: Build desktop apps with GPUI, the GPU-accelerated UI framework from Zed. Covers Entity state, Render trait, div() Tailwind API, actions/keybindings, gpui-component widgets, theming. Use when building Rust desktop applications with GPUI or gpui-component.

GPUI Development

GPUI is a hybrid immediate/retained mode, GPU-accelerated UI framework for Rust from Zed.

Quick Reference

TopicWhen to UseReference
FundamentalsStarting new projects, understanding architecturefundamentals.md
State ManagementEntity, notify(), emit(), subscribe()state-management.md
Renderingdiv() API, layout, conditional renderingrendering.md
ActionsKeyboard shortcuts, key bindingsactions.md
Componentsgpui-component widgets (Button, Input, Table)components.md
ThemingColors, cx.theme(), Root viewtheming.md
Anti-patternsCommon mistakes to avoidanti-patterns.md

Critical Setup (MUST DO)

use gpui::{Application, App};
use gpui_component::Root;

fn main() {
    Application::new().run(|cx: &mut App| {
        gpui_component::init(cx);  // REQUIRED when using gpui-component
        
        cx.open_window(opts, |window, cx| {
            let view = cx.new(|cx| MyView::new(window, cx));
            cx.new(|cx| Root::new(view, window, cx))  // REQUIRED for theming
        });
    });
}

Key Mental Model (React vs GPUI)

ReactGPUIKey Difference
useStateStruct fields + cx.notify()State in struct, manual re-render trigger
ComponentView (impl Render)Views are Entities that render
Virtual DOMGPU renderingNo diffing - rebuild elements each frame
Props drillingEntity<T> handlesPass entity handles, not callbacks

Instructions

REQUIRED: Before implementing GPUI code, load the relevant reference file(s) using the Read tool.

  1. Identify the task - What are you building?
  2. Load relevant references - Read the appropriate .md file(s) FIRST
  3. Follow patterns exactly - Use code patterns from references
  4. Check anti-patterns - Read anti-patterns.md before writing code

Reference Selection Guide

Cargo.toml

[dependencies]
gpui = "0.2.2"
gpui-component = "0.6.0-preview0"

Common Patterns

State Update Pattern

impl MyView {
    fn update_something(&mut self, cx: &mut Context<Self>) {
        self.value = new_value;
        cx.notify();  // ALWAYS call after state changes
    }
}

Button Click Pattern

Button::new("btn-id")
    .label("Click Me")
    .on_click(|_, _, cx| {
        // handle click
    })

Stateful Component Pattern

struct MyView {
    input: Entity<InputState>,  // Store entity in struct
}

impl MyView {
    fn new(window: &Window, cx: &mut Context<Self>) -> Self {
        Self {
            input: cx.new(|cx| InputState::new(window, cx)),  // Create once
        }
    }
}

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です