ratatui-patterns
Installation
SKILL.md
Ratatui Patterns
Modern-ratatui knowledge pack. Current stable: ratatui 0.30.2 (2026-06). Model training data predates 0.29. The biggest failure mode is reimplementing by hand what the library now provides; the second is asserting API shapes from memory. Both have the same fix: work from the bundled references, not from memory.
Hard Rules
- Before writing any TUI render/layout/lifecycle code, read
references/modernization-checklist.md. If the thing being built appears in it, use the built-in. - Before claiming an API exists or writing a signature, verify it in
references/api-reference.md(generated from ratatui source, grep-friendly). If it is not there and not inreferences/limitations.md, pull live docs (below) before hand-rolling. - Custom render code is allowed only for needs listed in
references/limitations.md(the verified beyond-API catalog). Anything else custom is a defect. - Render logic ships with
TestBackendtests perreferences/testing.md. - Depend only on the
ratatuiumbrella crate, never onratatui-core/-widgetsdirectly. Ifdefault-features = false, re-addlayout-cache. - Mouse events are opt-in.
ratatui::init()/run()do not enable mouse capture; that needsEnableMouseCapture/DisableMouseCapturearound the loop (references/api-reference.md§14). - The event loop can go async (
crossterm'sevent-streamfeature +EventStreamfortokio::select!);Terminal::drawstays sync regardless (references/api-reference.md§14).