Borrowing it
Nothing to install: this file belongs to rossumai/rossum-agents. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/rossumai/rossum-agents/master/.claude/commands/ink-tui-best-practices.mdgit clone --depth 1 https://github.com/rossumai/rossum-agentsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/rossumai/rossum-agents/ink-tui-best-practices)<a href="https://agentmods.dev/commands/rossumai/rossum-agents/ink-tui-best-practices"><img src="https://agentmods.dev/badge/commands/rossumai/rossum-agents/ink-tui-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/rossumai/rossum-agents/ink-tui-best-practices"><img src="https://agentmods.dev/badge/commands/rossumai/rossum-agents/ink-tui-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00059 | $0.03648 |
| Opus 5 | $0.00030 | $0.01824 |
| Sonnet 5 | $0.00012 | $0.00730 |
| Haiku 4.5 | $0.00006 | $0.00365 |
Grade A, and why
ink-tui-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 450 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ink TUI Best Practices
Comprehensive guide for building high-quality terminal user interfaces with Ink v5, React 18, and TypeScript. Covers layout, streaming, performance, accessibility, and AI chat UI patterns.
When to Apply
Reference these guidelines when:
- Writing or reviewing Ink/React terminal UI components
- Implementing SSE streaming or real-time data display
- Designing keyboard navigation and focus management
- Optimizing TUI rendering performance
- Building AI chat interfaces (tool calls, thinking, streaming responses)
1. Ink Fundamentals
Layout Rules
| Rule | Detail |
|---|---|
All text in <Text> |
Raw strings inside <Box> throw errors |
<Box> = flex container |
Every <Box> is display: flex by default (Yoga layout engine) |
<Text> contains only text |
Never nest <Box> inside <Text> |
| Default direction | flexDirection="row" — use "column" for vertical stacking |
| Percentage widths | <Box width="70%"> works for fluid layouts |
| No native scrolling | overflow="hidden" clips but doesn't scroll — implement virtual windowing manually |
Layout Patterns
// Vertical stack with spacing
<Box flexDirection="column" gap={1} padding={1}>
<Text>Item 1</Text>
<Text>Item 2</Text>
</Box>
// Horizontal with space distribution
<Box justifyContent="space-between" width="100%">
<Text>Left</Text>
<Spacer />
<Text>Right</Text>
</Box>
// Fixed footer with flexible content
<Box flexDirection="column" height={rows}>
<Box flexGrow={1} flexDirection="column" overflow="hidden">
{/* Scrollable content */}
</Box>
<Box height={3} borderStyle="single">
<Text>Status bar</Text>
</Box>
</Box>
Text Wrapping
<Text wrap="truncate"> prevents long text from breaking layouts. Options: "wrap" (default), "truncate", "truncate-start", "truncate-middle", "truncate-end".
2. Hooks
useInput — Keyboard Handling
useInput((input, key) => {
if (key.return) handleSubmit();
if (key.escape) handleCancel();
if (input === "q") exit();
if (key.ctrl && input === "d") scrollDown();
}, { isActive: isFocused }); // Gate handler with isActive
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 450 lines · 59 tokens per session scan A 890570b0eb66
ink-tui-best-practices is a command published in the GitHub repository rossumai/rossum-agents (11 stars, last pushed 4d ago), licensed MIT. It adds 59 tokens to every session and 3,648 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
react
Apply React with TypeScript best practices.
discover-frontend
Load frontend skills (React, Next.js, TypeScript, state management).
create-component
Create a new React component with TypeScript.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.