一键导入
tui-standards
FARSPACE TUI quality standards — keyboard-first navigation, resize-safe ratatui layouts, theme usage, modal patterns, and visual language rules
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
FARSPACE TUI quality standards — keyboard-first navigation, resize-safe ratatui layouts, theme usage, modal patterns, and visual language rules
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | tui-standards |
| description | FARSPACE TUI quality standards — keyboard-first navigation, resize-safe ratatui layouts, theme usage, modal patterns, and visual language rules |
FARSPACE targets a polished, minimal terminal feel inspired by Neovim, K9s, and Lazygit. Every screen must meet these standards.
keys.rs — check there before inventing new bindings? opens contextual help on every screen: opens the command palette from any screenEsc / q exits or goes back; be consistentAll layouts use ratatui Constraint-based sizing:
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([
Constraint::Length(3), // fixed header
Constraint::Min(0), // flexible body
Constraint::Length(1), // fixed footer
])
.split(frame.area());
Never hardcode pixel/cell dimensions. Always test that the layout does not panic at small sizes (e.g. 40×12).
Respond to crossterm::event::Event::Resize — ratatui handles redraws automatically but state that depends on area size must recalculate.
Use Theme palette roles — never raw ANSI colour codes or hardcoded Color::Rgb(...) values.
Key roles (verify current names in theme.rs):
Reuse existing spacing constants and border styles before adding new ones.
Clear the area, rounded border, close on Esc, centred in the terminalcomponents/header.rs for the shared patternratatui::widgets::List or Table with consistent highlight style from ThemeTUI code:
Command values to game_core via app.rs dispatchEvent values returned by apply_turn to update display stateGameState fields directly for anything other than rendering read-only snapshotsAppState changeCommand emitted (or None)render() does not panic at minimum sizeFARSPACE crate dependency rules — which crates may import which, and what constitutes a boundary violation
FARSPACE original IP policy for content creation — what is allowed, what is forbidden, and how to invent original names and flavour text
FARSPACE determinism requirements — seeded RNG, BTreeMap ordering, no wall-clock seeding. Required for reproducible simulation.