tui-component-design
TUI Component Design Patterns
Best practices for building maintainable, testable TUI components using Bubbletea v2 and the Charm ecosystem, based on the hive diff viewer implementation.
Component Organization
Single Responsibility Per File
Each component should be in its own file with clear boundaries:
internal/tui/diff/
├── model.go # Top-level compositor that orchestrates sub-components
├── diffviewer.go # Diff content display with scrolling and selection
├── filetree.go # File navigation tree with expand/collapse
├── lineparse.go # Pure function utilities for parsing diff lines
├── delta.go # External tool integration (syntax highlighting)
└── utils.go # Shared utilities
More from colonyops/hive
tui-testing
Comprehensive testing strategies for Bubbletea v2 applications. Covers unit tests, component tests, golden file testing, async operations, external tool integration, and common testing pitfalls.
48inbox
This skill should be used when the user asks to "check my inbox", "read my messages", "any unread messages?", "check for new messages", "see my inbox", or needs to read inter-agent messages from other hive sessions. Provides guidance on reading, filtering, and managing inbox messages.
21config
This skill should be used when the user asks to "configure hive", "setup hive for my workflow", "customize session spawn", "add tmux integration", "create custom keybindings", "add user commands", or needs guidance on hive configuration, rules, spawn commands, terminal integration, or keybindings.
19docs-update
Update documentation after code changes. Use when adding features, changing keybindings, modifying config options, or updating TUI behavior. Automatically finds and updates relevant documentation files (README, recipes, help text).
17session-info
This skill should be used when the user asks "what's my session ID?", "show my inbox topic", "get session info", "what session am I in?", "my agent ID", or needs to retrieve current hive session details for messaging coordination or debugging.
16wait
This skill should be used when the user asks to "wait for message from agent X", "block until response", "wait for handoff", "synchronize with other agents", "wait for acknowledgment", or needs to block execution until messages arrive on specific topics with configurable timeout.
15