rust-tui-ratatui
Installation
SKILL.md
Rust TUI Ratatui
Build terminal applications with clear state ownership, predictable rendering, responsive input, and testable UI contracts.
Operating Model
- Identify whether the app is a true TUI, a CLI with occasional prompts, or a daemon dashboard. Use Ratatui only when persistent terminal state and interactive views are justified.
- Keep rendering pure: widgets read immutable view models and write to frames. Event handlers mutate application state through explicit actions.
- Use an app/event/action/update/render shape for nontrivial TUIs. Avoid spreading terminal I/O across widgets.
- Treat terminal cleanup as reliability-critical. Restore raw mode and alternate screen on all normal and error exits.
- Preserve accessibility of terminal UX: discoverable keybindings, no required color-only state, clear focus, and deterministic fallback for narrow terminals.
Reference Map
references/ratatui-app-architecture.mdfor app structure, state machines, view models, layout, widgets, and theme ownership.references/events-async-terminal.mdfor crossterm, async tasks, cancellation, terminal restoration, and resize handling.references/testing-ux.mdfor buffer assertions, insta snapshots, keybinding tests, and performance checks.