charm-dev
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.
What this skill does
# Charm Development
Build production-quality terminal user interfaces using Bubbletea and the Charm ecosystem.
## Primary Workflow
**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.
## Architecture Quick Reference
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 pattern
- **`references/architecture/COMPONENTS.md`** - Component composition and focus management
- **`references/architecture/BEST-PRACTICES.md`** - Do's and don'ts, common anti-patterns
## Component Library Quick Reference
**Find 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.
## Available Libraries
**Bubbletea** (`references/bubbletea/`) - Core TUI framework with 47 examples
- Forms, lists, tables, progress, spinners, timers
- Real-time updates, HTTP, external commands
- Mouse, keyboard, window events
**Lipgloss** (`references/lipgloss/`) - Styling and layout with 20 examples
- Colors, borders, padding, margins
- Layouts (horizontal, vertical, tables)
- Responsive design
**Huh** (`references/huh/`) - Interactive forms with 40 examples
- Input fields, selects, confirms
- Multi-step forms, validation
- Dynamic forms, SSH integration
**Gum** (`references/gum/`) - CLI components with 31 examples
- One-line CLI tools
- Filters, pickers, confirmations
- Quick script integration
## Quick Start Pattern
```go
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()
}
```
## Development Approach
1. **Find the closest example** in CONTEXTUAL-INVENTORY.md
2. **Read the complete example code** - Don't skip this
3. **Copy the pattern** - Don't reinvent, adapt
4. **Compose components** - Use `composable-views` pattern for complex UIs
5. **Style with Lipgloss** - Keep styling separate from logic
## Common Use Cases
**Multi-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/`
## Key Principles
**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
## Resources Structure
- **`references/architecture/`** - TEA, MVC, components, best practices
- **`references/bubbletea/`** - 47 Bubbletea examples + CONTEXTUAL-INVENTORY.md
- **`references/lipgloss/`** - 20 styling examples
- **`references/huh/`** - 40 form examples
- **`references/gum/`** - 31 CLI component examples
- **`references/api/`** - BUBBLETEA_API_FEATURES.md (comprehensive API reference)
## Getting Help
**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
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.