Ratatui UI conventions for the Mistral Vibe Rust CLI (vibe/cli-rust). Use when adding or changing any screen, list, picker, footer hint, keyboard shortcut, list navigation, scrolling or mouse clicks, back/close behavior, search field, selection highlight, color, or onboarding/dialog copy in the Rust TUI.
79
99%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
UI conventions for vibe/cli-rust/. Every screen follows them so the TUI reads as one product. Local code rules, scenarios and goldens live in vibe/cli-rust/AGENTS.md and client-e2e/AGENTS.md.
src/hints.rs: key::*, action::* and the shared pairs (hints::NAVIGATE, SELECT, SEARCH, CANCEL, CLOSE, BACK). Never write a key or action as a string literal at a call site. A single letter key ("d", "r") is fine as long as its action comes from action::*. When a key or verb is missing, add it to src/hints.rs.(key, action) pair (hints::Hint). The renderer owns all spacing; never bake spaces into a label.navigate, select, close); keys keep their canonical casing (Enter, Esc, Ctrl+C, Backspace). Combined keys use / (Space/Enter, Esc/Ctrl+C).key::NAV (↑↓/jk) whenever j/k work; use key::ARROWS (↑↓) only where a focused text field owns the letters. Horizontal navigation is key::LEFT_RIGHT (←→).key action key action, ending with the Esc hint. Inline status lines (loading line, narrator) are the one exception and read key to action.ui/hint_line.rs (draw, draw_clipped, line, spans, styled): they apply the shared key/action styles and clip to the box. Never place hint text with hardcoded x offsets or custom key styles. Center a hint with hints::width.Enter continue, Esc back), not sentences like "Press Esc to go back".j/k alongside ↑/↓ when no text field is focused. Match only plain keys (no Ctrl/Alt/Super) so Ctrl+J/Ctrl+K keep their editing meaning.↑↓/jk only where j/k are wired.↑↓/jk (and ←→ across dialog options) wrap at both ends; PageUp/PageDown/Home/End clamp. Move an OptionList (src/option_list.rs) with step(down, len, wrap, selectable), whose selectable skips rows (section headers, notes, blanks) that cannot take the cursor; list_nav::wrap is only for the onboarding's fixed two-choice screens. Never hand-roll saturating_sub/min(len - 1) for arrow moves. The only lists that do not wrap are the ones attached to the composer: Down past the newest queued prompt leaves queue mode, and Up at the top of the subagent list returns focus to the composer./mcp list) and closes only at the top level. Backspace edits text and is never a navigation key. A nested view's footer ends with hints::BACK (Esc back); a top-level view's footer ends with hints::CLOSE or hints::CANCEL.1. Trust folder). Pressing it is the same as moving to the row and pressing Enter. Parse it with list_nav::digit; never accept digits on unnumbered rows, and never number rows that do not accept their digit.OptionList: its renderer calls layout(lines, area) (the option on each line, None for headers) or layout_rows(len, area), which keeps the highlight in view through ui/list_scroll.rs follow and records the click hit map; never write its own scroll = selected reconciliation. It moves the viewport the least and brings the option's non-selectable neighbours along: its section header above it, the list's leading lines for the first option, the trailing lines for the last one. Wrapping from the bottom back to the top therefore always shows the very top of the list.wheel, detach_at) free the viewport until the next keyboard move (step, select); a freed viewport only clamps its offset. highlight moves the highlight without reattaching it.OptionList<R>: route its press, drag and release through mouse::option_gesture (it keeps text selection working inside the bottom app) or OptionList::mouse, and add it to mouse::option_list so it gets the wheel, scrollbar and hover. Never hit-test rows by hand.R is part of the list's type and comes from the item's per-item actions, the keys that act on the highlighted item. Navigation, search, Esc and whole-list keys (r refresh or reload, Tab switching the save target) do not count.
/theme, /plugins, subagents, config choices, the remote project picker): SingleAction, one click confirms. A click yields the option index./model and /thinking: Enter or s; /resume: Enter or d; /mcp: Enter, d or e; /config: Enter or Ctrl+R): MultiAction, a click highlights and a click on the highlight does what Enter does. A click yields Click::Highlight or Click::Confirm; a highlight click moves like an arrow key (/resume previews)./log-level badges) are one action each, so a click on one acts at once.search_field::Search, search_field::handle_key and search_field::paste for any filterable list, and build its footer with search_field::hints./ focuses the field; typing filters live (letters, including j/k, go to the field); ↑↓, PageUp/PageDown and Enter keep acting on the list while the field is focused; Esc first leaves the field (the filter stays), then clears the filter, then closes the screen.hints::SEARCH./ placeholder (Search plugins, Search settings). It is always visible in the list view and hidden in detail views. Draw it only with ui/search_field.rs draw_row, which owns the / and the field's indent; never put a search field at the bottom of a list or in the footer. The project picker is the one exception: its labelled Search projects: field shares the form Field of its create view.ui/list_cursor.rs style() across the full row width (block-cursor colors, bold). No glyph cursors (›, ▸, >) for focus.list_cursor: paint(f, area) fills a row area, styles(highlighted) / styles_on(highlighted, bg) give the (text, dim) styles of a row, marker_style styles the current-value marker on it. Never read theme::block_cursor_bg/block_cursor_fg outside ui/theme/ and ui/list_cursor.rs (a unit test enforces it). Text-field carets are not list cursors: use theme::block_caret (TextArea-like fields) or theme::fixed::input_caret (compact Input-like fields).label chip; the selected chip takes list_cursor::style(). Keep labels at the same columns when switching selection.list_cursor::marker(true) (› ) in list_cursor::current_color(), in a two-column slot that stays blank (list_cursor::BLANK) on other rows.(String, Style) row renderers paint the full-width bar for rows where list_cursor::is_bar holds, and keep a span's own background instead of overwriting it.src/ui/theme/: theme-dependent colors in the theme palettes (theme::foreground(), theme::muted_style(), ...), fixed brand and terminal colors in ui/theme/fixed.rs (ORANGE, LOADING_GRADIENT, onboarding colors, sgr::* escape codes, the Monokai/Alabaster named palette via fixed::named), syntax colors in ui/theme/syntax.rs. A fixed color such as the brand orange is fine, but it is defined once there and imported everywhere else.src/ui/theme/, never write Color::Rgb(..), Color::Indexed(..), a named Color::* variant or a raw SGR color code. When a screen needs a new color, add a named constant or theme accessor first. tests/units/color_literals.rs fails on any literal outside the theme module (only update_prompt/ansi.rs, which converts any Color to SGR, and test code are exempt).client-e2e scenarios (screen_contains, key sequences, mouse coordinates) and regenerate their goldens as described in vibe/cli-rust/AGENTS.md. A new behavior gets its own scenario (for example mcp/mcp_wrap_scroll).tests/units/option_list.rs, option_clicks.rs, list_nav.rs, list_scroll.rs, search_field.rs); extend them when a helper changes instead of testing the rule screen by screen.tests/units/color_literals.rs guards the color and list-cursor rules. Do not add exemptions to make it pass: move the color into src/ui/theme/ or route the bar through list_cursor.mistralai/mistral-vibe
63d0e8f
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.