跳到正文
cccskills
免费在 GitHub 公开

ink

Comprehensive Ink skill for building CLI applications with React. Covers components (Text, Box, Static, Transform), hooks (useInput, useApp, useFocus), Flexbox layout, testing, and accessibility.

中文简介正在准备中。当前显示原文说明。

shadcn-labs/termcn星标 1,219(GitHub 1,219 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(24)

  • SKILL.md10.2 KB
  • references/accessibility/REFERENCE.md5.3 KB
  • references/components/box.md4.9 KB
  • references/components/REFERENCE.md1.7 KB
  • references/components/text.md2.4 KB
  • references/components/utilities.md3.3 KB
  • references/core/api.md3.4 KB
  • references/core/configuration.md3.7 KB
  • references/core/gotchas.md4.6 KB
  • references/core/patterns.md6.7 KB
  • references/core/REFERENCE.md3.1 KB
  • references/hooks/app-lifecycle.md1.9 KB
  • references/hooks/focus.md5.2 KB
  • references/hooks/input.md3.7 KB
  • references/hooks/REFERENCE.md1.7 KB
  • references/hooks/stdio.md3.1 KB
  • references/layout/patterns.md3.8 KB
  • references/layout/REFERENCE.md4.1 KB
  • references/testing/REFERENCE.md5.3 KB
  • rules/components.md8.3 KB
  • rules/core.md9.0 KB
  • rules/hooks.md10.1 KB
  • rules/performance.md6.6 KB
  • rules/RULES.md1.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Ink Platform Skill

Consolidated skill for building CLI applications with Ink (React for CLIs). Use decision trees below to find the right components and patterns, then load detailed references.

Critical Rules

Follow these rules in all Ink code:

  1. All text must be wrapped in <Text>. Raw strings outside <Text> will throw an error.
  2. <Text> only allows text nodes and nested <Text>. You cannot nest <Box> inside <Text>.
  3. <Box> is always display: flex. Think of every <Box> as <div style="display: flex">.
  4. Use useApp().exit() to exit. Never call process.exit() directly from within components.
  5. Install both ink and react. They are peer dependencies: npm install ink react.
  6. <Static> only renders new items. Changes to previously rendered items are ignored.

How to Use This Skill

Reference File Structure

Core references follow a 5-file pattern. Cross-cutting concepts are single-file guides.

./references/core/ contains:

FilePurposeWhen to Read
REFERENCE.mdOverview, when to use, quick startAlways read first
api.mdrender(), renderToString(), Instance, measureElementWriting code
configuration.mdRender options, environment varsConfiguring an app
patterns.mdCommon patterns, best practicesImplementation guidance
gotchas.mdPitfalls, limitations, debuggingTroubleshooting

Component, hook, and concept references in ./references/<area>/ have REFERENCE.md as the entry point.

Reading Order

  1. Start with core/REFERENCE.md for project overview
  2. Then read additional files relevant to your task:
    • Building UI -> components/REFERENCE.md + specific component files
    • Handling input -> hooks/input.md
    • Layout/positioning -> layout/REFERENCE.md
    • App lifecycle -> hooks/app-lifecycle.md
    • Focus management -> hooks/focus.md
    • Testing -> testing/REFERENCE.md
    • Accessibility -> accessibility/REFERENCE.md
    • Troubleshooting -> core/gotchas.md
    • Best practices / rules -> rules/RULES.md + specific rule files

Example Paths

./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, environment

Quick Decision Trees

"I need to display content"

Display 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)

"I need user input"

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)

"I need layout/positioning"

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.md

"I need to manage app lifecycle"

App 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.md

"I need to test my CLI"

Testing?
├─ 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)

"I need accessibility"

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)

"I need to debug/troubleshoot"

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.md

"I want best practices / production-ready code"

Best 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

Troubleshooting Index

  • Text outside <Text> -> core/gotchas.md
  • <Box> inside <Text> -> core/gotchas.md
  • Process hanging/not exiting -> core/gotchas.md
  • Console.log mixing with output -> core/configuration.md
  • Layout misalignment -> layout/REFERENCE.md
  • Input not received -> hooks/input.md + rules/hooks.md
  • Focus not cycling -> hooks/focus.md + rules/hooks.md
  • CI output issues -> core/configuration.md + rules/core.md
  • Flickering/performance -> core/configuration.md + rules/performance.md
  • Anti-patterns / pitfalls -> rules/components.md, rules/hooks.md, rules/core.md

Product Index

Core

AreaEntry FileDescription
Core./references/core/REFERENCE.mdOverview, quick start, project setup
API./references/core/api.mdrender, renderToString, Instance
Config./references/core/configuration.mdRender options, environment variables
Patterns./references/core/patterns.mdCommon patterns and recipes
Gotchas./references/core/gotchas.mdPitfalls and debugging

Components

ComponentEntry FileDescription
Overview./references/components/REFERENCE.mdAll components at a glance
Text./references/components/text.mdText display and styling
Box./references/components/box.mdLayout, borders, backgrounds
Utilities./references/components/utilities.mdNewline, Spacer, Static, Transform

Hooks

HookEntry FileDescription
Overview./references/hooks/REFERENCE.mdAll hooks at a glance
Input./references/hooks/input.mduseInput for keyboard handling
App Lifecycle./references/hooks/app-lifecycle.mduseApp for exit control
Stdio./references/hooks/stdio.mduseStdin, useStdout, useStderr
Focus./references/hooks/focus.mduseFocus, useFocusManager, useCursor

Cross-Cutting Concepts

ConceptEntry FileDescription
Layout./references/layout/REFERENCE.mdYoga/Flexbox layout system
Layout Patterns./references/layout/patterns.mdCommon layout recipes
Testing./references/testing/REFERENCE.mdink-testing-library
Accessibility./references/accessibility/REFERENCE.mdScreen reader & ARIA support

Best Practices (Rules)

Rule FileEntry FileDescription
Overview./rules/RULES.mdEntry point + 10 critical rules
Performance./rules/performance.mdFPS tuning, Static, memoization, incremental rendering
Components./rules/components.mdBox, Text, Static, Transform, Newline, Spacer rules
Hooks./rules/hooks.mduseInput, useApp, useFocus, useCursor, useStdin rules
Core./rules/core.mdrender(), renderToString(), errors, CI, Kitty protocol

Resources

Repository: https://github.com/vadimdemedes/ink npm: https://www.npmjs.com/package/ink Testing Library: https://github.com/vadimdemedes/ink-testing-library Create Ink App: https://github.com/vadimdemedes/create-ink-app

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Launch and promote a custom shadcn/ui registry end-to-end: validate registry.json, prepare the official shadcn-ui/ui directory PR, community directory PRs (registry.directory, shadcntemplates, birobirobiro/awesome-shadcn-ui, bytefer/awesome-shadcn-ui), and draft social posts for Reddit r/shadcn, X, Dev.to, and Hacker News. Use whenever the user says "launch my registry", "list on shadcn directory", "submit to awesome-shadcn-ui", "announce my shadcn registry", "registry.directory PR", or wants to promote a new @scope registry — even if they do not say "launch-shadcn-registry" explicitly.

中文简介正在准备中。当前显示原文说明。

shadcn-labs/termcn12192026年10月7日 更新

opentui

免费

Comprehensive OpenTUI skill for building terminal user interfaces. Covers the core imperative API, React reconciler, and Solid reconciler. Use for any TUI development task including components, layout, keyboard handling, animations, and testing.

中文简介正在准备中。当前显示原文说明。

shadcn-labs/termcn12192026年10月7日 更新

Create 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.

中文简介正在准备中。当前显示原文说明。

shadcn-labs/termcn12192026年10月7日 更新

Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components, animate list reorder, implement directional (forward/back) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.

中文简介正在准备中。当前显示原文说明。

shadcn-labs/termcn12192026年10月7日 更新

Add haptic feedback to web apps using the web-haptics library. Use when building mobile-facing UIs that need tactile feedback on buttons, toggles, forms, pickers, and other interactive elements.

中文简介正在准备中。当前显示原文说明。

shadcn-labs/termcn12192026年10月7日 更新

Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.

中文简介正在准备中。当前显示原文说明。

shadcn-labs/termcn12192026年10月7日 更新

查看 shadcn-labs 的全部技能

报告此技能的问题