ratatui-patterns
Skill7 starsChanged 18 days agoMITView on GitHub
Modern-ratatui knowledge pack for Rust TUI code on ratatui and crossterm.
In this repository15 other files it gives its agents.
- askamaSkill
- cargo-toml-optimizationSkill
- clean-codeSkill
- clean-flutterSkill
- clean-rustSkill
- clean-shellSkill
- docs-syncSkill
- emulator-testingSkill
- maudSkill
- mcp-statelessSkill
- name-checkSkill
- terminal-uxSkill
- todoSkill
- ux-patternsSkill
- webapp-testingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Before writing any TUI render/layout/lifecycle code, read references/modernization-checklist.md.
- Very specific: line 17
Before claiming an API exists or writing a signature, verify it in references/api-reference.md (generated from ratatui source, …
- Distinctive: line 18
Use a built-in unless it cannot meet a measured, approved rendering invariant.
- Distinctive: line 45
If crates.io reports a version newer than the one at the top of this file, flag it before trusting the bundled references.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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. - Use a built-in unless it cannot meet a measured, approved rendering invariant; record that gap beside the custom renderer. 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).
Files
| file | when to read |
references/modernization-checklist.md | always, first: hand-rolled → built-in map + hunt greps |
references/api-reference.md | exact signatures, feature flags, full widget/API surface, events (mouse capture, sync vs async loop, kitty key flags) |
references/limitations.md | before writing custom render code; design-system conformance limits |
references/testing.md | writing or reviewing TUI tests |
references/patterns.md | composition idioms, corrected cookbook, widget-choice guidance |
references/audit-prompt.md | fanning out per-repo modernization audits |
Live Docs, on Demand
For anything the bundled references don't answer 1:1, fetch instead of guessing:
- API detail:
https://docs.rs/ratatui/latest/ratatui/(append module path, e.g.widgets/struct.Table.html) - release highlights:
https://ratatui.rs/highlights/v0302/(version digits, no dots) - breaking changes:
https://raw.githubusercontent.com/ratatui/ratatui/main/BREAKING-CHANGES.md - concepts/recipes:
https://ratatui.rs/concepts/andhttps://ratatui.rs/recipes/ - version check:
curl -s -H 'User-Agent: ratatui-version-check' https://crates.io/api/v1/crates/ratatui(a bare curl without User-Agent gets policy-blocked)
If crates.io reports a version newer than the one at the top of this file, flag it before trusting the bundled references; they get re-synced upstream per release.
Related
- design language (colors, spacing, motion grammar): the project's design-language skill, if it has one. That skill says WHAT it should look like; this one says WHICH ratatui API renders it.
- panic-safe teardown + shimmer recipe: under 0.30,
ratatui::init()already installs the restore panic hook; hand-rolled guards are only for extra seams like bracketed paste or kitty flags. Kitty flags are what let you tell Shift+Enter/Ctrl+Enter apart from plain Enter, seereferences/api-reference.md§14.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

