From williavs-charm-dev-skill-marketplace
Build terminal UIs using Bubbletea and the Charm ecosystem (Lipgloss, Huh, Gum). Use when creating TUIs, interactive CLIs, terminal applications, or when the user mentions Bubbletea, Charm libraries, terminal styling, or TUI development.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin williavs-charm-dev-skill-marketplaceThis skill uses the workspace's default tool permissions.
Build production-quality terminal user interfaces using Bubbletea and the Charm ecosystem.
references/CHARM_ECOSYSTEM_README.mdreferences/api/BUBBLETEA_API_FEATURES.mdreferences/architecture/BEST-PRACTICES.mdreferences/architecture/COMPONENTS.mdreferences/architecture/ELM-ARCHITECTURE.mdreferences/architecture/MVC-IN-BUBBLETEA.mdreferences/bubbletea/examples/CONTEXTUAL-INVENTORY.mdreferences/bubbletea/examples/INVENTORY.mdreferences/bubbletea/examples/README.mdreferences/bubbletea/examples/altscreen-toggle/README.mdreferences/bubbletea/examples/altscreen-toggle/altscreen-toggle.gifreferences/bubbletea/examples/altscreen-toggle/main.goreferences/bubbletea/examples/autocomplete/main.goreferences/bubbletea/examples/cellbuffer/main.goreferences/bubbletea/examples/chat/README.mdreferences/bubbletea/examples/chat/chat.gifreferences/bubbletea/examples/chat/main.goreferences/bubbletea/examples/composable-views/README.mdreferences/bubbletea/examples/composable-views/composable-views.gifreferences/bubbletea/examples/composable-views/main.goGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Build production-quality terminal user interfaces using Bubbletea and the Charm ecosystem.
1. Understand the architecture → references/architecture/ELM-ARCHITECTURE.md
Read this first to understand The Elm Architecture (TEA) pattern that Bubbletea implements.
2. Find your pattern → references/bubbletea/examples/CONTEXTUAL-INVENTORY.md
Quick reference table (lines 5-45) maps use cases to example files. Find what you need, go to the example, copy the pattern.
3. Check API details → references/api/BUBBLETEA_API_FEATURES.md
Comprehensive API reference for advanced features (message filtering, focus reporting, bracketed paste, testing, etc.).
4. Style your UI → references/lipgloss/examples/
Use Lipgloss for all styling. Examples show layouts, colors, borders, alignment, and responsive design.
Read these to understand Bubbletea's design:
references/architecture/ELM-ARCHITECTURE.md - The Elm Architecture (Model-View-Update pattern)references/architecture/MVC-IN-BUBBLETEA.md - How TEA maps to MVC if you're familiar with that patternreferences/architecture/COMPONENTS.md - Component composition and focus managementreferences/architecture/BEST-PRACTICES.md - Do's and don'ts, common anti-patternsFind examples in: references/bubbletea/examples/CONTEXTUAL-INVENTORY.md
Common patterns:
| Need | Example File |
|---|---|
| Multi-step form with validation | credit-card-form/main.go:83 |
| Window resize handling | window-size/main.go:360 |
| External command execution | exec/main.go:288 |
| Real-time event handling | realtime/main.go:305 |
| HTTP requests | http/main.go:279 |
| Multiple view switching | composable-views/main.go:228 |
| File selection | file-picker/main.go:172 |
| Selectable lists | list-default/main.go:148 |
| Progress tracking | package-manager/main.go:47 |
Full table with 45+ patterns in CONTEXTUAL-INVENTORY.md lines 5-45.
Bubbletea (references/bubbletea/) - Core TUI framework with 47 examples
Lipgloss (references/lipgloss/) - Styling and layout with 20 examples
Huh (references/huh/) - Interactive forms with 40 examples
Gum (references/gum/) - CLI components with 31 examples
package main
import (
"fmt"
tea "github.com/charmbracelet/bubbletea"
)
// Model - All application state
type model struct {
cursor int
choices []string
}
// Init - Initial command
func (m model) Init() tea.Cmd {
return nil
}
// Update - Handle messages
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
switch msg.String() {
case "up":
if m.cursor > 0 {
m.cursor--
}
case "down":
if m.cursor < len(m.choices)-1 {
m.cursor++
}
case "q", "ctrl+c":
return m, tea.Quit
}
}
return m, nil
}
// View - Render UI
func (m model) View() string {
s := "Choose:\n\n"
for i, choice := range m.choices {
cursor := " "
if i == m.cursor {
cursor = ">"
}
s += fmt.Sprintf("%s %s\n", cursor, choice)
}
return s
}
func main() {
p := tea.NewProgram(model{
choices: []string{"Option 1", "Option 2", "Option 3"},
})
p.Run()
}
composable-views pattern for complex UIsMulti-step wizards → references/bubbletea/examples/credit-card-form/
Data tables → references/bubbletea/examples/table/
File browsers → references/bubbletea/examples/file-picker/
Progress indicators → references/bubbletea/examples/package-manager/
Chat interfaces → references/bubbletea/examples/chat/
External processes → references/bubbletea/examples/exec/
Real-time updates → references/bubbletea/examples/realtime/
Model = State - All state in one struct
View = Pure - (Model → String), no side effects
Update = Pure - ((Model, Msg) → (Model, Cmd)), no I/O
Commands = Side Effects - Async operations return messages
Always handle WindowSizeMsg - Make UIs responsive
Use Lipgloss for styling - Don't hand-craft ANSI codes
Batch commands - Use tea.Batch() for concurrent operations
references/architecture/ - TEA, MVC, components, best practicesreferences/bubbletea/ - 47 Bubbletea examples + CONTEXTUAL-INVENTORY.mdreferences/lipgloss/ - 20 styling examplesreferences/huh/ - 40 form examplesreferences/gum/ - 31 CLI component examplesreferences/api/ - BUBBLETEA_API_FEATURES.md (comprehensive API reference)For specific use case: Check CONTEXTUAL-INVENTORY.md lines 5-45 first
For architecture questions: Read ELM-ARCHITECTURE.md
For component composition: Read COMPONENTS.md
For common mistakes: Read BEST-PRACTICES.md
For API details: Check BUBBLETEA_API_FEATURES.md