
terminal-ui
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.
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 Writerender-overwrite-dont-clear- Overwrite Content Instead of Clear and Redrawrender-synchronized-output- Use Synchronized Output Protocol for Animationsrender-60fps-baseline- Target 60fps for Smooth Animationrender-partial-updates- Update Only Changed Regionsrender-escape-sequence-batching- Defer ANSI Escape Code Generation to Final Output
2. Input & Keyboard (CRITICAL)
input-useinput-hook- Use useInput Hook for Keyboard Handlinginput-immediate-feedback- Provide Immediate Visual Feedback for Inputinput-modifier-keys- Handle Modifier Keys Correctlyinput-isactive-focus- Use isActive Option for Focus Managementinput-escape-routes- Always Provide Escape Routes
3. Component Patterns (HIGH)
tuicomp-box-flexbox- Use Box Component with Flexbox for Layoutstuicomp-text-styling- Use Text Component for All Visible Contenttuicomp-measure-element- Use measureElement for Dynamic Sizingtuicomp-static-for-logs- Use Static Component for Log Outputtuicomp-percentage-widths- Use Percentage Widths for Responsive Layoutstuicomp-border-styles- Use Border Styles for Visual Structure
4. State & Lifecycle (HIGH)
tuistate-useapp-exit- Use useApp Hook for Application Lifecycletuistate-cleanup-effects- Always Clean Up Effects on Unmounttuistate-functional-updates- Use Functional State Updates to Avoid Stale Closurestuistate-usecallback-stable- Stabilize Callbacks with useCallbacktuistate-usememo-expensive- Memoize Expensive Computations with useMemo
5. Prompt Design (MEDIUM-HIGH)
prompt-group-flow- Use Clack group() for Multi-Step Promptsprompt-validation- Validate Input Early with Descriptive Messagesprompt-cancellation- Handle Cancellation Gracefully with isCancelprompt-spinner-tasks- Use Spinner and Tasks for Long Operationsprompt-custom-render- Build Custom Prompts with @clack/core
6. UX & Feedback (MEDIUM)
ux-progress-indicators- Show Progress for Operations Over 1 Secondux-color-semantics- Use Colors Semantically and Consistentlyux-error-messages- Write Actionable Error Messagesux-next-steps- Show Next Steps After Completionux-intro-outro- Use Intro and Outro for Session Framing
7. Configuration & CLI (MEDIUM)
tuicfg-sensible-defaults- Provide Sensible Defaults for All Optionstuicfg-env-vars- Support Standard Environment Variablestuicfg-flags-over-args- Prefer Flags Over Positional Argumentstuicfg-help-system- Implement Comprehensive Help Systemtuicfg-json-output- Support Machine-Readable Output Format
8. Robustness & Compatibility (LOW-MEDIUM)
robust-tty-detection- Detect TTY and Adjust Behavior Accordinglyrobust-signal-handling- Handle Process Signals Gracefullyrobust-exit-codes- Use Meaningful Exit Codesrobust-terminal-restore- Always Restore Terminal State on Exitrobust-graceful-degradation- Degrade Gracefully for Limited Terminals
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
- render-single-write - Example rule file
- input-useinput-hook - Example rule file
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
You Might Also Like
Related Skills

cache-components
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
vercel
component-refactoring
Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component --json` shows complexity > 50 or lineCount > 300, when the user asks for code splitting, hook extraction, or complexity reduction, or when `pnpm analyze-component` warns to refactor before testing; avoid for simple/well-structured components, third-party wrappers, or when the user explicitly wants testing without refactoring.
langgenius
web-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
anthropics
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
anthropics
react-modernization
Upgrade React applications to latest versions, migrate from class components to hooks, and adopt concurrent features. Use when modernizing React codebases, migrating to React Hooks, or upgrading to latest React versions.
wshobson
tailwind-design-system
Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.
wshobson