💡 摘要
一个为OpenTUI框架提供文档和决策树的参考技能,用于协助AI代理开发终端用户界面。
🎯 适合人群
🤖 AI 吐槽: “这本质上是一份组织良好的文档离线副本,所以你的AI可能会和你一样对布局的怪癖感到困惑。”
安装脚本从远程URL获取并执行代码,存在供应链风险。缓解措施:执行前审查install.sh脚本,或在内部托管已验证的副本。
OpenTUI Skill for OpenCode
OpenTUI platform reference docs. Covers the Core imperative API, React reconciler, Solid reconciler, layout system, components, keyboard handling, animations, and testing.
Install
Local installation (current project only):
curl -fsSL https://raw.githubusercontent.com/msmps/opentui-skill/main/install.sh | bash
Global installation (available in all projects):
curl -fsSL https://raw.githubusercontent.com/msmps/opentui-skill/main/install.sh | bash -s -- --global
Usage
Once installed, the skill appears in OpenCode's <available_skills> list. The agent loads it automatically when working on OpenTUI tasks.
Use the /opentui command to load the skill and get contextual guidance:
/opentui create a React TUI with keyboard navigation
Updating
To update to the latest version:
/opentui --update-skill
Structure
The installer adds both a skill and a command:
# Skill (reference docs)
skill/opentui/
├── SKILL.md # Main manifest + decision trees
└── references/ # Framework and concept subdirectories
├── core/ # Imperative API (5-file pattern)
├── react/ # React reconciler (5-file pattern)
├── solid/ # Solid reconciler (5-file pattern)
├── components/ # Component categories
├── layout/ # Yoga/Flexbox layout
├── keyboard/ # Input handling
├── animation/ # Timeline animations
└── testing/ # Test renderer + snapshots
# Command (slash command)
command/opentui.md # /opentui entrypoint
Decision Trees
The main SKILL.md contains decision trees for:
- Choosing a framework (Core, React, Solid)
- Displaying content (text, containers, code, diffs)
- Handling user input (inputs, keyboard, focus)
- Layout and positioning (flexbox, absolute, responsive)
- Animations (timeline, easing, transitions)
- Testing (snapshots, interaction, debugging)
- Troubleshooting (gotchas, common issues)
Topics Covered
Frameworks: Core (imperative), React (declarative), Solid (fine-grained reactivity)
Components: text, box, scrollbox, input, textarea, select, tab-select, ascii-font, code, line-number, diff
Cross-cutting: Layout (Yoga/Flexbox), Keyboard handling, Animations, Testing
Credits & Inspiration
This skill's structure and patterns are heavily inspired by:
-
cloudflare-skill by Dillon Mulroy — an excellent example of a platform skill, demonstrating decision trees, progressive disclosure, and the multi-file reference pattern.
-
Anatomy of an Excellent OpenCode Skill by JP Caparas — an insightful breakdown of what makes cloudflare-skill effective, covering context management, troubleshooting indexes, and intent-based routing.
License
MIT - see LICENSE
优点
- 全面覆盖OpenTUI概念和API
- 清晰的框架和组件选择决策树
- 结构良好、模块化的参考文档
缺点
- 主要是被动文档,缺乏交互式示例
- 实用性局限于已在OpenCode/OpenTUI生态系统中工作的代理
- 未展示超越信息检索的独特代理能力
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 msmps.
