Skill站外收录 @skilllib/skill-2117939930272413592
canvas
提供终端内可交互的图形化界面支持,能够动态创建日历、文档和航班查询等不同类型的可视化画布,实现用户选择、内容编辑与实时数据反馈,适用于需要直观操作和上下文感知的对话式任务场景。
效率工具 AI 技能
Skills.MD
# Canvas TUI Toolkit
**Start here when using terminal canvases.** This skill covers the overall workflow, canvas types, and IPC communication.
## Example Prompts
Try asking Claude things like:
**Calendar:**
- "Schedule a meeting with the team next week"
- "Find a time when Alice and Bob are both free"
**Document:**
- "Draft an email to the sales team about the new feature"
- "Help me edit this document — let me select what to change"
**Flight:**
- "Find flights from SFO to Denver next Friday"
- "Book me a window seat on the morning flight"
## Overview
Canvas provides interactive terminal displays (TUIs) that Claude can spawn and control. Each canvas type supports multiple scenarios for different interaction modes.
## Available Canvas Types
| Canvas | Purpose | Scenarios |
|--------|---------|-----------|
| `calendar` | Display calendars, pick meeting times | `display`, `meeting-picker` |
| `document` | View/edit markdown documents | `display`, `edit`, `email-preview` |
| `flight` | Flight comparison and seat selection | `booking` |
## Quick Start
```bash
cd ${CLAUDE_PLUGIN_ROOT}
# Run canvas in current terminal
bun run src/cli.ts show calendar
# Spawn canvas in new tmux split
bun run src/cli.ts spawn calendar --scenario meeting-picker --config '{...}'
```
## Spawning Canvases
**Always use `spawn` for interactive scenarios** - this opens the canvas in a tmux split pane while keeping the conversation terminal available.
```bash
bun run src/cli.ts spawn [kind] --scenario [name] --config '[json]'
```
**Parameters:**
- `kind`: Canvas type (calendar, document, flight)
- `--scenario`: Interaction mode (e.g., display, meeting-picker, edit)
- `--config`: JSON configuration for the canvas
- `--id`: Optional canvas instance ID for IPC
## IPC Communication
Interactive canvases communicate via Unix domain sockets.
**Canvas → Controller:**
```typescript
{ type: "ready", scenario } // Canvas is ready
{ type: "selected", data } // User made a selection
{ type: "cancelled", reason? } // User cancelled
{ type: "error", message } // Error occurred
```
**Controller → Canvas:**
```typescript
{ type: "update", config } // Update canvas configuration
{ type: "close" } // Request canvas to close
{ type: "ping" } // Health check
```
## High-Level API
For programmatic use, import the API module:
```typescript
import { pickMeetingTime, editDocument, bookFlight } from "${CLAUDE_PLUGIN_ROOT}/src/api";
// Spawn meeting picker and wait for selection
const result = await pickMeetingTime({
calendars: [...],
slotGranularity: 30,
});
if (result.success && result.data) {
console.log(`Selected: ${result.data.startTime}`);
}
```
## Requirements
- **tmux**: Canvas spawning requires a tmux session
- **Terminal with mouse support**: For click-based interactions
- **Bun**: Runtime for executing canvas commands
## Skills Reference
| Skill | Purpose |
|-------|---------|
| `calendar` | Calendar display and meeting picker details |
| `document` | Document rendering and text selection |
| `flight` | Flight comparison and seat map details |
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「canvas」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次