gpui-entity

Manage concurrent GPUI entity state with Entity<T> and WeakEntity<T>.

62|1|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/zerx-lab/rmx --skill gpui-entity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gpui-entity
Source: https://github.com/zerx-lab/rmx/tree/main/.opencode/skills/gpui-entity
Command: npx skills add https://github.com/zerx-lab/rmx --skill gpui-entity

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

GPUI applications often struggle with safe, concurrent access to component and shared state. This Skill provides patterns and examples to manage entity state reliably, avoiding race conditions and borrow issues while enabling reactive updates.

Core Features & Use Cases

  • Entity<T> and WeakEntity<T> abstractions for strong and weak references
  • Read, read_with, and update operations with an inner context
  • Async state handling, observers, and event coordination patterns
  • Common patterns: transactions, cascading updates, and parent-child communication
  • Real-world use cases include component local state, shared state, and cross-entity communication

Quick Start

Create an Entity<Counter> with initial state { count: 0 }, then increment to demonstrate safe updates.

Frequently Asked Questions about gpui-entity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage shared state safely in GPUI without triggering race conditions?

Safe concurrent state management in GPUI requires Entity<T> and WeakEntity<T> abstractions. By using read, read_with, and update operations with an inner context, you avoid borrow issues while enabling reactive updates across components.

How do I update component local state in GPUI using an inner context?

To update component local state in GPUI, use the update operation with an inner context. This allows safe state mutation while notifying observers and coordinating cascading updates across the reactive application hierarchy.

When do I need WeakEntity references for cross-entity communication in GPUI?

WeakEntity references are needed for cross-entity communication when preventing reference cycles and memory leaks. They allow parent-child communication and observer patterns to coordinate state changes without holding strong ownership of the target entity.

How do I coordinate cascading updates and transactions across multiple GPUI entities?

Coordinating cascading updates across multiple GPUI entities requires combining observer patterns with transactional update operations. This ensures dependent state changes propagate sequentially through parent-child communication channels while maintaining data consistency.

Does this GPUI state management approach handle async state handling and event coordination?

Yes, this GPUI state management approach supports async state handling and event coordination. It provides patterns for observers and asynchronous operations, ensuring reactive updates remain consistent even with delayed or concurrent data fetching.