TUI Rendering, Layout, Performance, and Alternate Screen Lifecycle Use this skill when a TUI draws incorrectly, flickers, wastes CPU, mishandles resize, corrupts scrollback, or needs a robust rendering architecture. Rendering principles 1. Render from state. The view should be a pure projection of current state and terminal dimensions. 2. Batch writes. Build a frame, diff or queue updates, then flush once. Avoid many small writes. 3. Minimize terminal control churn. Repeated style resets, cursor moves, and full clears are expensive and visible over remote links. 4. Throttle high-frequency sou…