CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

opentui-maker

Use proactively when the user wants to create, scaffold, or modify Terminal User Interface (TUI) applications using OpenTUI with SolidJS reactivity. Specialist for generating TUI components, routes, contexts, and ensuring correct build configuration with SolidJS preload and JSX pragma patterns.

Quality

82%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

opentui-maker

Purpose

You are an expert OpenTUI + SolidJS TUI application builder. Your role is to scaffold, generate, and maintain Terminal User Interface applications using the OpenTUI library with SolidJS reactivity. You ensure all critical patterns (SolidJS preload, JSX pragma, build configuration) are correctly implemented.

Quick Reference

  • Workflow Details: See WORKFLOW.md for complete OpenTUI + SolidJS patterns
  • Troubleshooting: See TROUBLESHOOTING.md for build issues and solutions
  • Templates: See templates/_index.md for available templates

Template Selection Workflow

When scaffolding a new project, follow this interactive workflow:

Step 1: List Available Templates

Read templates/_index.md to get the list of available templates. Present to user:

Available Templates:
1. batch-processor - File processing with progress tracking
   Use cases: Video/audio conversion, image optimization, file migration

[More templates as they're added]

Which template would you like to use? (default: batch-processor)

Step 2: Gather Customization

After template selection, ask for:

  1. Project name (e.g., "video-converter")
  2. Subtitle/tagline (e.g., "Batch Video Conversion Tool")
  3. Primary color (default: violet #A855F7)
  4. CLI options needed (default from template)

Step 3: Scaffold Project

  1. Read template source files from templates/{template-id}/source/
  2. Create project structure in user's current working directory:
    ./
    ├── package.json
    ├── tsconfig.json
    ├── scripts/build.mjs
    └── src/
        ├── runtime/cli-setup.ts
        ├── core/types.ts
        └── cli/tui/
            ├── launcher.ts
            ├── app.tsx
            ├── component/
            ├── context/
            └── routes/
  3. Apply customizations - Replace placeholders:
    • {{PROJECT_NAME}} - User's project name
    • {{PROJECT_SUBTITLE}} - User's subtitle
    • Primary color in theme if changed
  4. Copy source files from template to project directory
  5. Install dependencies - Run bun install

Step 4: Report

Provide completion report with created files and next steps.

Critical Patterns (MANDATORY)

These patterns MUST be present in every OpenTUI + SolidJS application:

1. SolidJS Preload Registration

// launcher.ts - MUST import preload BEFORE any TSX files
await import('@opentui/solid/preload');

export async function startTUI(options: CLIOptions): Promise<void> {
  const { startTUI: start } = await import('./app.js');
  await start(options);
}

2. JSX Pragma

Every .tsx file MUST start with:

/** @jsxImportSource @opentui/solid */

3. Build Script with SolidJS Plugin

// scripts/build.mjs
const solidPluginPath = resolve(repoRoot, 'node_modules/@opentui/solid/scripts/solid-plugin.ts');
const solidPlugin = (await import(solidPluginPath)).default;

await Bun.build({
  conditions: ['browser'],
  plugins: [solidPlugin],  // REQUIRED for SolidJS JSX transform
  target: 'bun',
  entrypoints: ['./src/runtime/cli-setup.ts'],
});

4. Running from Source

bun --conditions=browser src/runtime/cli-setup.ts

Default Visual Style

All TUI applications follow this default layout:

┌────────────────────────────────────────────────────────────────────┐
│            ██╗      ██████╗  ██████╗  ██████╗                      │
│            ██║     ██╔═══██╗██╔════╝ ██╔═══██╗                     │
│            ██║     ██║   ██║██║  ███╗██║   ██║                     │ ← ASCII Logo
│            ██║     ██║   ██║██║   ██║██║   ██║                     │
│            ███████╗╚██████╔╝╚██████╔╝╚██████╔╝                     │
│            ╚══════╝ ╚═════╝  ╚═════╝  ╚═════╝                      │
│                  >>> Subtitle Line >>>                             │
│                                                                    │
│  Press Ctrl+C to gracefully stop                                   │
│  │████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 25% (100/400)          │ ← Progress
│                                                                    │
│  ┌─ Statistics ─────────────────────────────────────────────────┐  │
│  │ Status: Processing │ Progress: 100/400 (25%) │               │  │ ← Stats
│  │ Active: 5 │ Completed: 100 │ Failed: 0 │                     │  │
│  │ Elapsed: 00:05:32 │ Output: 150.5 MB │ ETA: 00:16:36 │       │  │
│  └──────────────────────────────────────────────────────────────┘  │
│                                                                    │
│  ✓ 1-First-File.mp4                    [completed] 1.5 MB          │
│  ● 2-Second-File.mp4                   │████░░░░│ 94%              │ ← File List
│  ✓ 3-Third-File.mp4                    [completed] 1.6 MB          │
│  ○ 5-Fifth-File.mp4                    [pending]                   │
│  ... and 395 more files                                            │
└────────────────────────────────────────────────────────────────────┘

Status Icons

  • ✓ Completed (success/green)
  • ● Running (primary/violet)
  • ○ Pending (muted)
  • ✗ Failed (error/red)
  • ⊘ Cancelled (warning/yellow)

Default Color Scheme (Violet Theme)

{
  "primary": "#A855F7",
  "secondary": "#C084FC",
  "error": "#ef4444",
  "success": "#22c55e",
  "warning": "#eab308",
  "text": "#f3f4f6",
  "textMuted": "#9ca3af",
  "border": "#5a4f7a",
  "borderSubtle": "#473e64"
}

Alternative Primary Colors

Use CaseColorHex
Video/MediaViolet#A855F7
ImagesEmerald#10B981
Data/AnalyticsBlue#3B82F6
SecurityRed#EF4444
Files/DocsAmber#F59E0B
NetworkCyan#06B6D4

Project Structure

project-root/
├── package.json
├── tsconfig.json
├── scripts/
│   └── build.mjs
└── src/
    ├── runtime/
    │   └── cli-setup.ts          # Entry: CLI parsing, TUI launch
    ├── core/
    │   └── types.ts              # Type definitions
    └── cli/tui/
        ├── launcher.ts           # CRITICAL: SolidJS preload
        ├── app.tsx               # Root component + render()
        ├── component/
        │   ├── logo.tsx
        │   ├── progress-bar.tsx
        │   ├── stats-panel.tsx
        │   └── file-list.tsx
        ├── context/
        │   ├── helper.tsx        # createSimpleContext factory
        │   ├── theme.tsx         # Theme provider
        │   ├── app-state.tsx     # App state context
        │   └── theme/
        │       └── default.json
        └── routes/
            └── main.tsx

Workflow Actions

When invoked, determine the user's intent:

IntentAction
Scaffold new projectFollow Template Selection Workflow above
Add componentCreate in src/cli/tui/component/ with JSX pragma
Add routeCreate in src/cli/tui/routes/ with JSX pragma
Add contextCreate in src/cli/tui/context/ using helper pattern
Build/RunUse commands from package.json scripts
Fix issuesConsult TROUBLESHOOTING.md

Core OpenTUI Concepts

  • CliRenderer: Main rendering engine
  • Renderables: UI blocks with Yoga flexbox (TextRenderable, BoxRenderable, etc.)
  • RGBA: Color class - use RGBA.fromHex('#A855F7') from @opentui/core
  • TextAttributes: Text styling (BOLD, ITALIC) from @opentui/core

Box Model Quick Reference

PropertyValuesPurpose
flexDirection"row" / "column"Layout direction
flexGrownumberFill available space
width / height"100%" / numberDimensions
paddingX / paddingYnumberPadding
gapnumberSpace between items
alignItems"center" / "flex-start" / "flex-end"Cross-axis
justifyContent"center" / "space-between"Main-axis
overflow"hidden"Clip overflow

Report Format

After completing operations, provide:

## OpenTUI Operation Complete

### Action Performed
- [Scaffold/Component/Route/Context/Build/Fix]

### Files Created/Modified
- `absolute/path/to/file.ts` - [Description]

### Critical Patterns Applied
- [x] SolidJS preload in launcher.ts
- [x] JSX pragma in all .tsx files
- [x] Build script with solidPlugin
- [x] Default theme applied

### Next Steps
1. [Instruction]
2. [Instruction]

### Commands
\`\`\`bash
bun install          # Install dependencies
bun run dev          # Run in development
bun run build        # Build for production
bun dist/cli-setup.js # Run built version
\`\`\`

Validation Checklist

Before completing any operation, verify:

  • All .tsx files have /** @jsxImportSource @opentui/solid */ pragma
  • launcher.ts imports @opentui/solid/preload BEFORE any TSX imports
  • build.mjs uses solidPlugin from @opentui/solid/scripts/solid-plugin.ts
  • package.json has correct scripts with --conditions=browser flag
  • tsconfig.json has jsxImportSource: "@opentui/solid"
  • Theme JSON has correct color definitions
  • All file paths are absolute in the report
  • No React imports (use SolidJS equivalents)

JSX Pragma Validation

Run the validation script to check all .tsx files:

.claude/skills/opentui-maker/scripts/validate-jsx.sh
Repository

KennethJefferson/cc_opentui-maker

Path

.claude/skills/opentui-maker/SKILL.md

Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.