Skip to content

nledford/engineering-review-board / skills/rust-desktop-gui

rust-desktop-gui

Verified

Native Rust desktop GUI guidance. Use when building, changing, testing, debugging, or packaging Windows, macOS, or Linux desktop applications with Iced, egui/eframe, Slint, or Tauri, including event loops, UI-thread work, widgets, themes, accessibility, background work, and native distribution.

Rust Desktop GUI

Use this skill for desktop UI behavior and its framework boundary. It covers native Rust desktop applications; Tauri is included as a native host with a system WebView, not as a browser-only application. Keep application policy and domain state independent of widgets, platform handles, and event-loop types.

Use the framework-selection reference to choose or confirm a framework. After selecting Iced, load the Iced 0.14 reference only if the resolved dependency is iced 0.14.x; verify every framework API against the target's pinned version before implementation.

Workflow

  1. Inspect the target's Cargo.toml, lockfile, Rust toolchain, framework version/features, existing UI entry point, platform-specific code, asset pipeline, test commands, and packaging/release scripts. Preserve the chosen framework and supported targets unless the task explicitly changes them.
  2. Define observable interaction flows, error states, keyboard behavior, and supported OS/architecture combinations. Select a framework only after its retained/immediate/declarative/WebView model and deployment constraints fit those flows.
  3. Keep a framework-independent model, use cases, validation, and error classification outside the view layer. Translate user input into messages or commands at the UI edge; render derived state rather than letting widgets own business rules.
  4. Treat the GUI event loop and UI objects as thread-affine. Do not block the UI thread with I/O, CPU-heavy work, locks, sleeps, or synchronous process calls. Give every worker an owner, bounded queue, cancellation/shutdown path, and typed result message; marshal results back through the framework's documented UI/event-loop mechanism.
  5. Compose layouts for keyboard and resize behavior first, then apply tokens or named theme roles consistently. Use semantic labels, focus order, visible focus indication, keyboard alternatives, text scaling, contrast, and native accessibility semantics; test the actual OS behavior instead of assuming a widget exposes it.
  6. Keep user-facing errors actionable and safe. Preserve structured context for diagnostics without displaying internal paths, commands, secrets, or raw backend failures. Add cancellation, loading, empty, retry, and failure states for long-running operations.
  7. Test pure state transitions and use cases without a GUI runtime; add focused framework, accessibility, and platform smoke tests only where they prove behavior the lower layer cannot. Reproduce active GUI, rendering, event-loop, or packaging failures before changing code.
  8. Build and smoke-test release artifacts on each claimed Windows, macOS, and Linux target. Verify signing, notarization, installers, bundle metadata, native dependencies, WebView/runtime prerequisites, update behavior, and permissions from the target repository's release requirements.

Desktop Boundaries

  • Make the main/event-loop thread the sole owner of windows, widgets, renderer state, and other framework objects unless the selected framework documents a different rule. Pass owned data or messages across threads, not UI references.
  • Prefer explicit operation IDs or state generations when results can arrive out of order. Ignore superseded results and clean up workers/subscriptions on window close, navigation, or application shutdown.
  • Model modal dialogs, file pickers, clipboard, notifications, deep links, global shortcuts, files, processes, and OS permissions as boundary adapters. Validate untrusted input and retain platform-specific behavior at that edge.
  • Do not promise native accessibility, performance, portability, or installer parity from a framework name or a successful build. Verify the pinned framework, renderer, target triple, desktop environment, and release artifact.

Framework-Specific Work

  • Iced: use the Elm-style State/Message/update/view boundary; represent async actions as Tasks and long-lived event sources as Subscriptions. See the selection reference and, for 0.14.x only, the dated Iced reference.
  • egui/eframe: immediate-mode UI is rebuilt each frame. Keep state durable, make frame work bounded, and compose UI through small App::ui-style methods called by the resolved eframe App callback.
  • Slint: keep declarative .slint components, properties, callbacks, and generated bindings separate from Rust application services; schedule cross-thread UI work through its documented event-loop bridge.
  • Tauri: treat Rust commands, IPC payloads, capabilities/permissions, and WebView content as explicit trust and compatibility boundaries. Do not treat a WebView message as a local Rust function call.

Strict Routing

Completion Checks

  • UI state, event-loop ownership, worker lifecycle, cancellation, and shutdown are explicit and testable.
  • Keyboard, focus, labels, resize, theme/contrast, loading, and error paths are covered at the lowest useful level and on affected native platforms.
  • Release bundles/installers are tested on every claimed OS/architecture with required platform metadata, signing/notarization, and dependencies verified.
  • Framework guidance and API calls were checked against the resolved version, not an unversioned current documentation page.

Tauri Zod Routing

For Tauri WebView-side parsing and shared malformed-IPC fixtures, load zod-engineering. Rust retains serde DTO validation, capability/authorization checks, and published IPC ownership.

finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall