Tui builder

From OpenScribbler/syllago · View interactive version

Tui builder is an AI agent skill from the GitHub repository OpenScribbler/syllago. Use when building, modifying, or debugging the syllago TUI. Provides golden rules checklist, component message contracts, and collected gotchas. TRIGGER when working on any file in cli/internal/tui/.

How to use this skill

Skill file

TUI Builder — Golden Rules + Quick Reference

Context gate: On first invocation in a session, run: touch /tmp/syllago-tui-builder-${PPID}

This signals the tui-context-gate hook that the skill was loaded.

Golden Rules Checklist

Before any layout or component work, verify:

  1. Mouse + keyboard parity on EVERY interactive element — zone.Mark() in View, zone.Get().InBounds() in updateMouse. No exceptions. If it responds to a keypress, it must respond to a click.
  2. Subtract 2 from height for borders, 2 from width for borders
  3. Never rely on auto-wrap — truncate explicitly (maxTextWidth = panelWidth - 4)
  4. Use MaxWidth() not Width() — Width word-wraps
  5. Use borderedPanel() for all bordered panels
  6. Parent owns child sizes — call SetSize(), never let children calculate
  7. All async work via tea.Cmd — never goroutines
  8. All state changes returned from Update() — never mutate elsewhere
  9. Always propagate Update() to active sub-models
  10. Handle tea.WindowSizeMsg — store and recalculate

Component Message Contracts

| Component | Receives | Sends |

|-----------|----------|-------|

| topbar | tea.WindowSizeMsg, tea.KeyMsg, tea.MouseMsg | tabChangedMsg, actionPressedMsg, helpToggleMsg |

| items | tea.WindowSizeMsg, tea.KeyMsg | itemSelectedMsg |

| explorer | tea.WindowSizeMsg, tea.KeyMsg, content items | explorerDrillMsg, explorerCloseMsg |

| gallery | tea.WindowSizeMsg, tea.KeyMsg, tea.MouseMsg | cardSelectedMsg, cardDrillMsg |

| modal | tea.KeyMsg, tea.MouseMsg | editSavedMsg, editCancelledMsg |

| install | tea.KeyMsg, tea.MouseMsg, step data | installResultMsg, installDoneMsg, installCloseMsg |

| toast | tea.KeyMsg, toastTickMsg | (dismisses via Dismiss() cmd) |

Gotchas

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.