Skip to main content
skill CX Codex

terminal-ui — Claude Code skill: TUI rules for Ink and Clack

A skill with 42 rules for TypeScript terminal interfaces: rendering, keyboard input, prompts. Useful when you build a CLI on Ink or Clack.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add pproenca/dot-skills --skill terminal-ui -a claude-code
Open on GitHub

What terminal-ui does

terminal-ui is a set of 42 rules across eight categories for TypeScript terminal interfaces. It covers rendering and output, keyboard input, component patterns, state and lifecycle, prompt design, UX and feedback, CLI configuration, and compatibility. Rules are ranked by priority: rendering and input are marked critical, then components and state, then prompts, UX, configuration, and compatibility.

Each rule lives in its own file under references/ with explanations and code examples. There is a template for adding new rules at assets/templates/_template.md and a full compiled document in AGENTS.md. The skill triggers on tasks involving TUI components, CLI prompts, terminal rendering, and input handling.

The rules target Ink and Clack specifically, so if your CLI uses other libraries you will need to adapt some of them. Install runs through npx skills add or gh skill install depending on the platform.

What it helps with

  • build an interactive Clack prompt without flicker
  • wire up keyboard input handling in Ink
  • lay out TUI components with flexbox
  • cut redundant terminal redraws during animation
  • add actionable error messages and next steps to a CLI

Example prompts for the agent

  • help me design a Clack prompt for picking an environment
  • check my Ink component for flicker when the list updates
  • how should I handle key presses in a terminal interface

How to install terminal-ui

1Skills CLI (Vercel)

npx skills add pproenca/dot-skills --skill terminal-ui -a claude-code

2Manually: put the files in place

~/.claude/skills/terminal-ui/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/terminal-ui/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about terminal-ui

How do I install terminal-ui in Claude?

Run npx skills add pproenca/dot-skills --skill terminal-ui -a claude-code. The skill lands at ~/.claude/skills/terminal-ui/SKILL.md.

What does terminal-ui do?

It gives the agent 42 rules across eight categories for TypeScript terminal interfaces: rendering, input, components, state, prompts, UX, configuration, and compatibility.

Which libraries does terminal-ui support?

The rules are written for Ink and Clack. With other TUI libraries you will have to revisit them.

Source text

SKILL.md · MIT
---
name: terminal-ui
description: Terminal User Interface (TUI) performance and UX guidelines for TypeScript applications using Ink and Clack. This skill should be used when building CLI tools, interactive terminal prompts, or developer tooling with TUI components. Triggers on tasks involving TUI components, CLI prompts, terminal rendering, keyboard input handling, or developer tooling.
---

# DevEx Developer Experience TUI Best Practices

Comprehensive developer experience guide for building TypeScript terminal user interfaces using Ink (React for CLIs) and Clack prompts. Contains 42 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

## When to Apply

Reference these guidelines when:
- Building CLI tools with interactive prompts using @clack/prompts
- Creating React-based terminal UIs with Ink
- Handling keyboard input and user interactions
- Optimizing terminal rendering and preventing flicker
- Designing developer-friendly CLI experiences

## Rule Categories by Priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Rendering & Output | CRITICAL | `render-` |
| 2 | Input & Keyboard | CRITICAL | `input-` |
| 3 | Component Patterns | HIGH | `tuicomp-` |
| 4 | State & Lifecycle | HIGH | `tuistate-` |
| 5 | Prompt Design | MEDIUM-HIGH | `prompt-` |
| 6 | UX & Feedback | MEDIUM | `ux-` |
| 7 | Configuration & CLI | MEDIUM | `tuicfg-` |
| 8 | Robustness & Compatibility | LOW-MEDIUM | `robust-` |

## Quick Reference

### 1. Rendering & Output (CRITICAL)

- `render-single-write` - Batch Terminal Output in Single Write
- `render-overwrite-dont-clear` - Overwrite Content Instead of Clear and Redraw
- `render-synchronized-output` - Use Synchronized Output Protocol for Animations
- `render-60fps-baseline` - Target 60fps for Smooth Animation
- `render-partial-updates` - Update Only Changed Regions
- `render-escape-sequence-batching` - Defer ANSI Escape Code Generation to Final Output

### 2. Input & Keyboard (CRITICAL)

- `input-useinput-hook` - Use useInput Hook for Keyboard Handling
- `input-immediate-feedback` - Provide Immediate Visual Feedback for Input
- `input-modifier-keys` - Handle Modifier Keys Correctly
- `input-isactive-focus` - Use isActive Option for Focus Management
- `input-escape-routes` - Always Provide Escape Routes

### 3. Component Patterns (HIGH)

- `tuicomp-box-flexbox` - Use Box Component with Flexbox for Layouts
- `tuicomp-text-styling` - Use Text Component for All Visible Content
- `tuicomp-measure-element` - Use measureElement for Dynamic Sizing
- `tuicomp-static-for-logs` - Use Static Component for Log Output
- `tuicomp-percentage-widths` - Use Percentage Widths for Responsive Layouts
- `tuicomp-border-styles` - Use Border Styles for Visual Structure

### 4. State & Lifecycle (HIGH)

- `tuistate-useapp-exit` - Use useApp Hook for Application Lifecycle
- `tuistate-cleanup-effects` - Always Clean Up Effects on Unmount
- `tuistate-functional-updates` - Use Functional State Updates to Avoid Stale Closures
- `tuistate-usecallback-stable` - Stabilize Callbacks with useCallback
- `tuistate-usememo-expensive` - Memoize Expensive Computations with useMemo

### 5. Prompt Design (MEDIUM-HIGH)

- `prompt-group-flow` - Use Clack group() for Multi-Step Prompts
- `prompt-validation` - Validate Input Early with Descriptive Messages
- `prompt-cancellation` - Handle Cancellation Gracefully with isCancel
- `prompt-spinner-tasks` - Use Spinner and Tasks for Long Operations
- `prompt-custom-render` - Build Custom Prompts with @clack/core

### 6. UX & Feedback (MEDIUM)

- `ux-progress-indicators` - Show Progress for Operations Over 1 Second
- `ux-color-semantics` - Use Colors Semantically and Consistently
- `ux-error-messages` - Write Actionable Error Messages
- `ux-next-steps` - Show Next Steps After Completion
- `ux-intro-outro` - Use Intro and Outro for Session Framing

### 7. Configuration & CLI (MEDIUM)

- `tuicfg-sensible-defaults` - Provide Sensible Defaults for All Options
- `tuicfg-env-vars` - Support Standard Environment Variables
- `tuicfg-flags-over-args` - Prefer Flags Over Positional Arguments
- `tuicfg-help-system` - Implement Comprehensive Help System
- `tuicfg-json-output` - Support Machine-Readable Output Format

### 8. Robustness & Compatibility (LOW-MEDIUM)

- `robust-tty-detection` - Detect TTY and Adjust Behavior Accordingly
- `robust-signal-handling` - Handle Process Signals Gracefully
- `robust-exit-codes` - Use Meaningful Exit Codes
- `robust-terminal-restore` - Always Restore Terminal State on Exit
- `robust-graceful-degradation` - Degrade Gracefully for Limited Terminals

## How to Use

Read individual reference files for detailed explanations and code examples:

- [Section definitions](references/_sections.md) - Category structure and impact levels
- [Rule template](assets/templates/_template.md) - Template for adding new rules
- [render-single-write](references/render-single-write.md) - Example rule file
- [input-useinput-hook](references/input-useinput-hook.md) - Example rule file

## Full Compiled Document

For the complete guide with all rules expanded: `AGENTS.md`

© pproenca · MIT · pproenca/dot-skills

Similar skills

Everything for Frontend and UI →

From the same set46

expo-react-native-performance Performance guidelines with 42 prioritized rules for Expo React Native apps. Helps agents refactor startup bottlenecks, list virtualization, re-renders, and animations. CX Codex +1 1,500installs framer-motion Optimizes React animations using Framer Motion guidelines: slashes bundle size, eliminates unnecessary re-renders, and polishes gesture or scroll transitions. CX Codex +1 1,100installs msw A skill with 45 rules for Mock Service Worker v2: setup, handlers, test integration, GraphQL. Useful when your agent writes or fixes HTTP mocks. CX Codex +1 842installs clean-code A skill that feeds the agent 48 rules on naming, functions, errors and tests, drawn from Robert C. Martin's book with modern fixes. Useful during reviews and refactors. CX Codex +1 842installs typescript-refactor A skill with 47 rules for refactoring TypeScript and React/TSX: type architecture, narrowing, generics, and modern TS 6.0 / React 19 features. CX Codex +1 788installs react-refactor Architectural refactoring skill with 40 rules for React codebases. Guides component decomposition, custom hook design, and module boundaries. CX Codex +1 776installs shadcn A skill with 58 shadcn/ui rules that tells your agent how to add components, build forms and keep accessibility intact. CX Codex +1 724installs chrome-extension-ui A rule set for Chrome extension interfaces: when to use a popup versus a side panel, how to keep navigation keyboard-accessible, how to handle loading and errors. CX Codex +1 719installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor