gpui-kit
Skill này làm gì
Giải thích cách xây dựng ứng dụng desktop với framework GPUI Kit bằng Rust, kể cả thư viện thành phần của nó. Dành cho lập trình viên xây ứng dụng desktop và muốn có sẵn các phần giao diện.
Khi nào nên dùng
- ✓Khi bạn đang thiết lập một ứng dụng desktop mới với GPUI Kit.
- ✓Khi bạn cần dùng một thành phần như hộp thoại, thanh bên hoặc bảng dữ liệu.
- ✓Khi bạn cần xử lý trạng thái thành phần, theme hoặc lớp phủ cửa sổ.
Liên kết skill
https://github.com/longbridge/gpui-kit/blob/main/skills/gpui-kit/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thiết lập một ứng dụng desktop GPUI Kit với thanh bên, bảng dữ liệu và hộp thoại xác nhận.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill chỉ agent đến một hướng dẫn quy ước cho từng nhóm thành phần, rồi đến một công thức ứng dụng đã được kiểm thử, cho thấy trạng thái và các lớp phủ hoạt động cùng nhau. Hướng dẫn thiết kế phải được đọc trước khi làm bất kỳ việc UI nào.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
GPUI Kit
Applications depend on one crate, gpui-kit. GPUI is use gpui_kit::*;, and
each layer is reachable by name: gpui_kit::component (styled components),
gpui_kit::base (unstyled behavior), gpui_kit::assets (default icons),
gpui_kit::platform.
Start with component-family conventions to choose the constructor, state owner, event, and layout contract for the task. Learn the family once, then verify the specific component supports the capability.
For a complete compiled view with retained state, subscriptions, and overlay layers, read the tested application recipe.
Read the Guides First
Two guides hold the rules this skill assumes. They are requirements, not inspiration. Read the guide file itself; do not answer from this page, from a similar file in the codebase, or from training data.
| Guide | Read before |
|---|---|
Design Guides, skill gpui-kit-design-guides |
Choosing components, layout, spacing, hierarchy, color, density, interaction states, overlays, motion, interface copy |
| Coding Guides | Crate layering, RenderOnce vs Entity<T>, state ownership, ElementId, events, focus, async, public API, naming, testing |
Read the Design Guides first when the change has a visible surface: code
structure preserves product intent, it does not replace it. If the design
skill is not installed, fetch https://gpui-kit.com/docs/design-guides.md.
The coding guide is a verbatim copy of https://gpui-kit.com/docs/coding-guides.md,
so its links to ./design-guides.md and ./getting-started.md mean the design
skill and https://gpui-kit.com/docs/getting-started.md.
Coding Guides section map
Read the whole guide for a new crate, module, or feature. For a narrow change,
read "Architecture at a glance" and "Rules for coding agents" first, then the
section for the change (grep -n '^## ' references/coding-guides.md).
| Section | Read when |
|---|---|
| Architecture at a glance | Always; crate layering, ownership boundary |
| Bootstrap and root ownership | main, init, Root, window creation, app-level state |
| Understand GPUI's phases and contexts | Anything touching App, Window, Context<T>, render vs update |
| Choose the right unit | Deciding RenderOnce vs Entity<T> vs custom Element |
| State ownership | Where a piece of state lives, who mutates it, Entity<State> handles |
| Stable identity | ElementId, lists, repeated elements, keyed state |
| Rendering and composition | render, builder chains, when/map, child composition |
| Behavior and presentation boundary | gpui-base vs gpui-component vs application code |
| Theme and styling | cx.theme(), tokens, Styled, sizes, variants |
| Events, actions, and focus | cx.emit, subscribe, actions!, keybindings, FocusHandle |
| Async work and side effects | cx.spawn, background_spawn, Task, I/O, timers |
| Layout, measurement, and scrolling | Flex layout, sizing, overflow, scroll handles, measuring |
| Lists, tables, and large data | VirtualList, List, DataTable, delegates, large collections |
| Public API design | Anything pub: builders, private fields, setter and reader naming |
| Platform and capability boundaries | macOS/Windows/Linux/wasm differences, feature gates |
| File and naming conventions | New files, modules, type and method names, Kind suffix, Context |
| Testing strategy | What to test, #[gpui_kit::test], TestAppContext |
Câu hỏi thường gặp
Nó dùng ngôn ngữ lập trình nào?
Rust.
Nó có cung cấp một ứng dụng ví dụ đầy đủ không?
Có. Một công thức đã được kiểm thử cho thấy một view hoàn chỉnh với trạng thái, các đăng ký và lớp phủ.
Nó lấy các quy tắc thiết kế ở đâu?
Từ các hướng dẫn thiết kế GPUI Kit, phải được đọc trước mọi việc UI.
Chi tiết
Mô tả gốc của tác giả
How to build desktop applications with GPUI Kit, the Rust framework published as the gpui-kit crate (GPUI plus gpui_kit::component, gpui_kit::base, gpui_kit::assets). Use when setting up a gpui-kit app, choosing or using a component (Button, Input, Select, Dialog, Sheet, Tabs, Sidebar, List, DataTable, Tree, Chart, etc.), handling component state, theming, or window overlays, and for GPUI mechanics: actions and keybindings, async tasks, contexts, custom elements, entities, events, focus, global state, layout and styling, ElementId, and tests including UI integration testing. Holds the normativ
repo: longbridge/gpui-kit
Độ phổ biến
- Sao GitHub
- 19k
- Vị trí xếp hạng
- #10484
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.