Loading...
Loading...
Comprehensive Ink skill for building CLI applications with React. Covers components (Text, Box, Static, Transform), hooks (useInput, useApp, useFocus), Flexbox layout, testing, and accessibility.
npx skill4agent add thanhdongnguyen/ink-skill ink<Text><Text><Text><Text><Box><Text><Box>display: flex<Box><div style="display: flex">useApp().exit()process.exit()inkreactnpm install ink react<Static>./references/core/| File | Purpose | When to Read |
|---|---|---|
| Overview, when to use, quick start | Always read first |
| render(), renderToString(), Instance, measureElement | Writing code |
| Render options, environment vars | Configuring an app |
| Common patterns, best practices | Implementation guidance |
| Pitfalls, limitations, debugging | Troubleshooting |
./references/<area>/REFERENCE.mdcore/REFERENCE.mdcomponents/REFERENCE.mdhooks/input.mdlayout/REFERENCE.mdhooks/app-lifecycle.mdhooks/focus.mdtesting/REFERENCE.mdaccessibility/REFERENCE.mdcore/gotchas.mdrules/RULES.md./references/core/REFERENCE.md # Start here
./references/core/api.md # render(), renderToString()
./references/components/text.md # <Text> component
./references/components/box.md # <Box> component (layout, borders)
./references/hooks/input.md # useInput hook
./references/layout/patterns.md # Common layout recipes
./references/testing/REFERENCE.md # ink-testing-library
./rules/RULES.md # Best practices entry point
./rules/performance.md # FPS, Static, memoization
./rules/components.md # Per-component rules
./rules/hooks.md # Per-hook rules
./rules/core.md # render(), errors, environmentDisplay content?
├─ Plain or styled text -> components/text.md
├─ Container with layout -> components/box.md
├─ Container with borders -> components/box.md (borderStyle)
├─ Container with background color -> components/box.md (backgroundColor)
├─ Line breaks within text -> components/utilities.md (Newline)
├─ Flexible spacer -> components/utilities.md (Spacer)
├─ Permanent log output (completed items) -> components/utilities.md (Static)
└─ Transform text output (uppercase, gradient) -> components/utilities.md (Transform)User input?
├─ Keyboard shortcuts/arrow keys -> hooks/input.md (useInput)
├─ Raw stdin access -> hooks/stdio.md (useStdin)
├─ Tab/Shift+Tab focus cycling -> hooks/focus.md (useFocus)
├─ Programmatic focus control -> hooks/focus.md (useFocusManager)
└─ Cursor positioning (IME) -> hooks/focus.md (useCursor)Layout?
├─ Horizontal row of elements -> layout/REFERENCE.md (flexDirection: row)
├─ Vertical stack of elements -> layout/REFERENCE.md (flexDirection: column)
├─ Centering content -> layout/patterns.md
├─ Spacing between elements -> layout/REFERENCE.md (gap, margin, padding)
├─ Fixed width/height -> components/box.md (width, height)
├─ Percentage sizing -> components/box.md (width: "50%")
├─ Min/max constraints -> components/box.md (minWidth, maxWidth, maxHeight)
├─ Push elements apart -> components/utilities.md (Spacer)
├─ Flex grow/shrink -> layout/REFERENCE.md (flexGrow, flexShrink)
├─ Wrapping content -> layout/REFERENCE.md (flexWrap)
├─ Overflow control -> components/box.md (overflow)
└─ Complex nested layouts -> layout/patterns.mdApp lifecycle?
├─ Mount and render -> core/api.md (render)
├─ Render to string (no terminal) -> core/api.md (renderToString)
├─ Exit the app programmatically -> hooks/app-lifecycle.md (useApp, exit)
├─ Wait for app to finish -> core/api.md (waitUntilExit)
├─ Re-render with new props -> core/api.md (rerender)
├─ Unmount the app -> core/api.md (unmount)
└─ Write to stdout/stderr outside Ink -> hooks/stdio.mdTesting?
├─ Render and check output -> testing/REFERENCE.md
├─ Simulate user input -> testing/REFERENCE.md (stdin.write)
├─ Snapshot testing -> testing/REFERENCE.md
└─ Check last rendered frame -> testing/REFERENCE.md (lastFrame)Accessibility?
├─ Screen reader support -> accessibility/REFERENCE.md
├─ ARIA roles (checkbox, button, etc.) -> accessibility/REFERENCE.md
├─ ARIA state (checked, disabled, etc.) -> accessibility/REFERENCE.md
├─ Custom screen reader labels -> accessibility/REFERENCE.md (aria-label)
└─ Hide from screen readers -> accessibility/REFERENCE.md (aria-hidden)Troubleshooting?
├─ Text rendering issues -> core/gotchas.md
├─ Layout problems -> core/gotchas.md + layout/REFERENCE.md
├─ Input not working -> core/gotchas.md + hooks/input.md
├─ Process not exiting -> core/gotchas.md
├─ CI rendering issues -> core/configuration.md (CI mode)
├─ Console output mixing -> core/configuration.md (patchConsole)
└─ Performance/flickering -> core/configuration.md + rules/performance.mdBest practices?
├─ General rules (critical) -> rules/RULES.md
├─ Performance (FPS, Static, memoization) -> rules/performance.md
├─ Per-component patterns & anti-patterns -> rules/components.md
├─ Per-hook patterns & gotchas -> rules/hooks.md
└─ render() / errors / environment behavior -> rules/core.md<Text>core/gotchas.md<Box><Text>core/gotchas.mdcore/gotchas.mdcore/configuration.mdlayout/REFERENCE.mdhooks/input.mdrules/hooks.mdhooks/focus.mdrules/hooks.mdcore/configuration.mdrules/core.mdcore/configuration.mdrules/performance.mdrules/components.mdrules/hooks.mdrules/core.md| Area | Entry File | Description |
|---|---|---|
| Core | | Overview, quick start, project setup |
| API | | render, renderToString, Instance |
| Config | | Render options, environment variables |
| Patterns | | Common patterns and recipes |
| Gotchas | | Pitfalls and debugging |
| Component | Entry File | Description |
|---|---|---|
| Overview | | All components at a glance |
| Text | | Text display and styling |
| Box | | Layout, borders, backgrounds |
| Utilities | | Newline, Spacer, Static, Transform |
| Hook | Entry File | Description |
|---|---|---|
| Overview | | All hooks at a glance |
| Input | | useInput for keyboard handling |
| App Lifecycle | | useApp for exit control |
| Stdio | | useStdin, useStdout, useStderr |
| Focus | | useFocus, useFocusManager, useCursor |
| Concept | Entry File | Description |
|---|---|---|
| Layout | | Yoga/Flexbox layout system |
| Layout Patterns | | Common layout recipes |
| Testing | | ink-testing-library |
| Accessibility | | Screen reader & ARIA support |
| Rule File | Entry File | Description |
|---|---|---|
| Overview | | Entry point + 10 critical rules |
| Performance | | FPS tuning, Static, memoization, incremental rendering |
| Components | | Box, Text, Static, Transform, Newline, Spacer rules |
| Hooks | | useInput, useApp, useFocus, useCursor, useStdin rules |
| Core | | render(), renderToString(), errors, CI, Kitty protocol |