shadcn-labs/termcn / .agents/skills/ink
ink
VerifiedComprehensive Ink skill for building CLI applications with React. Covers components (Text, Box, Static, Transform), hooks (useInput, useApp, useFocus), Flexbox layout, testing, and accessibility.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.2 KB |
| references/accessibility/REFERENCE.md | markdown | 5.3 KB |
| references/components/REFERENCE.md | markdown | 1.7 KB |
| references/components/box.md | markdown | 4.9 KB |
| references/components/text.md | markdown | 2.4 KB |
| references/components/utilities.md | markdown | 3.3 KB |
| references/core/REFERENCE.md | markdown | 3.1 KB |
| references/core/api.md | markdown | 3.4 KB |
| references/core/configuration.md | markdown | 3.7 KB |
| references/core/gotchas.md | markdown | 4.6 KB |
| references/core/patterns.md | markdown | 6.7 KB |
| references/hooks/REFERENCE.md | markdown | 1.7 KB |
| references/hooks/app-lifecycle.md | markdown | 1.9 KB |
| references/hooks/focus.md | markdown | 5.2 KB |
| references/hooks/input.md | markdown | 3.7 KB |
| references/hooks/stdio.md | markdown | 3.1 KB |
| references/layout/REFERENCE.md | markdown | 4.1 KB |
| references/layout/patterns.md | markdown | 3.8 KB |
| references/testing/REFERENCE.md | markdown | 5.3 KB |
| rules/RULES.md | markdown | 1.4 KB |
| rules/components.md | markdown | 8.3 KB |
| rules/core.md | markdown | 9.0 KB |
| rules/hooks.md | markdown | 10.1 KB |
| rules/performance.md | markdown | 6.6 KB |
rules/RULES.md
View on GitHub# Ink Best Practices
Best practices extracted from deep analysis of the Ink source code, tests, and examples.
## Rule Files
| File | Topic |
|------|-------|
| [performance.md](./performance.md) | FPS tuning, Static, memoization, incremental rendering |
| [components.md](./components.md) | Box, Text, Static, Transform, Newline, Spacer |
| [hooks.md](./hooks.md) | useInput, useApp, useFocus, useFocusManager, useCursor |
| [core.md](./core.md) | render(), renderToString(), error handling, environment behavior |
## Critical Rules (Always Apply)
1. **ALL text must be inside `<Text>`** — raw strings in `<Box>` throw runtime errors
2. **`<Text>` is a leaf** — cannot contain `<Box>` or structural components
3. **`<Box>` is always flexbox** — cannot disable `display: flex`
4. **NEVER use `process.exit()`** — use `useApp().exit()` for proper cleanup
5. **Tab/Shift+Tab are reserved** — intercepted by the focus system, not received by `useInput`
6. **Ctrl+C is intercepted** — by default it exits the app; set `exitOnCtrlC: false` to handle it yourself
7. **`<Static>` items are immutable** — only append new items; mutations to existing items are ignored
8. **Always `key` in `<Static>`** — each rendered element needs a stable, unique `key`
9. **Check `isRawModeSupported`** — raw mode is unavailable in CI and piped input scenarios
10. **Yoga units are characters/lines** — not pixels; `padding={1}` = 1 character horizontally, 1 line vertically
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |