limoni_development
Skill151 starsChanged 3 months agoApache-2.0View on GitHub
Guidelines and principles for developing the Limoni TUI library in Go and teaching Go to the user.
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- limoni-agent-surfaceSkill
- limoni-performanceSkill
- limoni-text-renderingSkill
- limoni-zestSkill
The file
Files
Limoni TUI Development, Architecture, and Handover Guide
Current implementation checkpoint
The current codebase includes the roadmap foundation through the runtime, typed input, interaction, layout negotiation, virtual data, accessibility, TestKit, injectable IO, and benchmark packages. Before adding a new feature, run:
go test ./...
go vet ./...
go test -race . ./component ./core/engine ./core/terminal ./testkit ./widgets ./layout ./core/accessibility ./core/driverUseful deterministic APIs include:
testkit.NewTerminal(width, height)for snapshots and input simulationruntime.New(runtime.WithModel(model))for optionalInit/Update/Viewprogramslayout.MeasureWidgetandlayout.Arrangefor measure/arrange negotiationwidgets.NewVirtualDataStatefor cancellable viewport loading and prefetchterminal.Frame.RegisterAccessibilityfor semantic nodesbackend.MemoryTerminalIOfor injectable terminal IO tests
Benchmark workloads live under benchmarks and can be run with:
go test ./benchmarks -run '^$' -bench .This skill file defines the vision, architectural principles, current development status, solved TUI limitations, and future roadmap of the Limoni project. It is intended to serve as a complete system handbook for AI agents taking over the project after a break or in a new chat session.
1. Project Vision and Motivation
Limoni is a next-generation TUI (Terminal User Interface) engine that combines the rendering speed and immediate-mode rendering capabilities of Rust's Ratatui ecosystem with Go's native concurrency primitives (goroutines and channels).
Limitations We Aim to Overcome in Competing Libraries
- Automatic Mouse Click Routing (Mouse Event Hit-Testing):
- Problem: In Ratatui and Bubble Tea, developers must manually calculate coordinates to determine which widget received a mouse click.
- Solution: Limoni registers interactive regions during rendering through
Frame.RegisterClickHandler(area, callback).Terminal.RouteMouseEvent(ev)automatically routes clicks to the correct callback.
- An Interactivity Bridge Without Circular Package Dependencies:
- Problem: If the low-level
cellpackage depends on higher-levelterminalorbackendevent types, circular package dependencies are created. - Solution:
cell.Contextcontains aRegisterClick func(area Rect, handler func())function field.Frame.RenderWidgetconnects this bridge to its own router when rendering begins. This keeps thewidgetspackage independent.
- Problem: If the low-level
- Layout Negotiation:
- Problem: In Ratatui, a widget cannot communicate its size requirements to the layout system.
- Solution: The
Widgetinterface includes aSizeHintAPI. Components such asBlock,Paragraph, andListcan negotiate their border, title, and content requirements with the flexiblelayoutengine.
- Cascading Styles:
- Problem: In Ratatui, styles must be passed manually to every child component.
- Solution: Parent styles are automatically inherited through
cell.Context. WithStyle.Merge(other), a child component overrides only the properties it needs to change.
2. Current Architecture and Package Organization
The project is organized as modular packages within a single Go module (github.com/thebanri/limoni):
limoni/
├── go.mod
├── .agents/skills/limoni_development/skill.md # This handbook
├── core/
│ ├── cell/
│ │ ├── cell.go # Cell (16 bytes), Style (12 bytes), Color (uint32)
│ │ ├── rect.go # Screen-area geometry (Rect)
│ │ └── context.go # Stack-allocated cascading Context and Merge
│ ├── buffer/
│ │ ├── buffer.go # Flat 1D cell matrix (Buffer), Resize
│ │ └── diff.go # Zero-allocation double-buffered diff algorithm
│ ├── backend/
│ │ ├── types.go # Flat event types (Event, KeyEvent, etc.)
│ │ ├── termios_linux # Pure Go raw-mode control through Unix ioctl calls
│ │ ├── parser.go # Keyboard/mouse/focus/hover ANSI sequence parser
│ │ └── backend.go # Asynchronous event loop with SIGWINCH and 25 ms ESC timeout
│ └── terminal/
│ ├── frame.go # Frame drawing context and click-handler registration
│ └── terminal.go # Terminal manager, draw loop, and mouse router
├── layout/
│ └── layout.go # Flexbox layout engine (Fixed, Percentage, Ratio, Min, Max, Fill)
├── widgets/
│ ├── widget.go # Core Widget interface (Draw and SizeHint)
│ ├── block.go # Bordered, titled, padded Block container
│ ├── paragraph.go # Multiline word-wrapping text widget
│ └── list.go # Selectable, automatically scrolling interactive list
└── examples/
└── demo/main.go # Demo with mouse-click list selection and hover-to-exit support3. Performance Guarantees and Standards
The following technical decisions and performance requirements MUST be preserved in all newly developed modules:
- Memory Alignment:
Styleis fixed at 12 bytes (Fg: 4,Bg: 4,Modifier: 2 + 2 bytes of padding).Cellis fixed at 16 bytes (Content: 4 +Style: 12). Cache-friendly alignment must be preserved.
- Zero Heap Allocations During Drawing:
- The draw and diff loops must not perform dynamic memory allocations.
- The
writeBufbyte slice insideTerminalis reused. Usestrconv.AppendIntfor ANSI encoding. - Updating a 120x40 screen (4,800 cells) takes 18.3 μs (54,000+ FPS on a single core).
- Stack-Allocated Context:
- During drawing,
cell.Contextis passed to child widgets by value. This prevents heap escape.
- During drawing,
4. Completed Phases (Phases 1–27)
- Phase 1: Core Buffer and Diff Engine [COMPLETED]
- Matrix alignment, double-buffer diffing, and a zero-allocation ANSI encoder were completed.
- Phase 2: Backend and OS Terminal Control [COMPLETED]
- Linux ioctl termios control without CGO and an event loop with a 25 ms ESC filter were implemented.
- Phase 3: Flexible Layout Engine [COMPLETED]
- A Flexbox layout engine based on ratio, percentage, and fixed-split calculations was implemented.
- Phase 4: Terminal, Frame, and Block Widget [COMPLETED]
- The drawing Frame, Block border styles (rounded, single, etc.), and mouse-click routing were implemented.
- Phase 5: Rich Widget Set (Paragraph and List) [COMPLETED]
- Interactive
Paragraph(automatic word wrapping) andList(selection state and automatic viewport scrolling) widgets were completed.
- Interactive
- Phase 6: Braille Canvas and Vector Drawing (High-Resolution Graphics) [COMPLETED]
- A Braille Canvas widget providing 2x4-pixel resolution per cell and vector drawing functions (lines, circles, rectangles, and Bézier curves) were completed.
- Phase 7: Media and Image Display Layer (
graphics) [COMPLETED]- Native image encoders for the Kitty Graphics Protocol, Sixel, iTerm2, and Ghostty were completed for rendering real PNG/JPG images in the terminal. Base64 chunking was added for Kitty's 4,096-byte individual data-packet limit.
- Universal Half-Block (
▄, U+2584) 1x2-resolution cell-buffer rendering was added for terminals without native protocol support, such as Alacritty. TheImagewidget was completed. - A bug that prevented container widgets such as
Blockfrom forwardingRegisterClickandRegisterImagecallback bridges to child widgets was fixed, stabilizing image rendering and click support inside containers.
- Phase 8: Animation Engine [COMPLETED]
- The
animationpackage was implemented with time-based interpolation, smooth transitions, and 16 standard easing functions (Linear, Quad, Cubic, Sine, Expo, Bounce). Floatanimation structures for numeric values andColoranimation structures for 24-bit TrueColor RGB transitions were added.- An animated demo application (
examples/animation) was added to demonstrate FPS monitoring and 30 FPS drawing withtime.Tickerwithout blocking the event loop.
- The
- Phase 9: Rich Forms and Input Controls [COMPLETED]
- The
FocusManager, which manages dynamic tab-based focus traversal according to draw order, was implemented. - Single-line interactive
TextInput(with state and cursor management), booleanCheckbox, and single-selectionRadioButtoncomponents were added. - Unit tests (
widgets/form_test.go) and an integrated form demonstration with dynamic color-theme switching were added to the main demo.
- The
- Phase 10: Layered Rendering, Modal Windows, and Popups [COMPLETED]
- Support for multiple overlapping layers was added through the
Layerstructure (ID,Type,Area,ZIndex,ClickOutside). Frame.BeginLayer(id)/Frame.EndLayer()lets widgets identify their layer during drawing.- Dynamic layer creation and removal are supported through
Frame.RegisterLayer()andFrame.RemoveLayer(). RouteMouseEvent()routes events by z-index: the topmost layer receives the event first, and click-outside handlers are triggered when appropriate.- The
Popupwidget supports an opening button, dropdown list, hover selection, disabled items, and border rendering. FocusManagerprovides modal focus trapping: focus and click registrations outside the modal are automatically blocked.ClickRegionnow contains aLayerIDfield to track the layer associated with each click region.- Backward compatibility is preserved: the existing
RegisterModal()API remains available and updates bothActiveModaland theLayerslist. - The incorrect
RegisterImagecallback signature (two parameters instead of three) was fixed. - The
layer_demoexample demonstrates multi-layer rendering, popup menus, and modal interaction. - Eight unit tests were added, including
TestLayerSystemBasic,TestMultiLayerZOrdering,TestRemoveLayer,TestTopLayer, andTestResetClearsLayers.
- Support for multiple overlapping layers was added through the
- Phase 11: Interactive and Flexible-Cell Table Component [COMPLETED]
widgets/table.go, table state management, the constraint solver (SolveWidths), and theTablewidget were implemented.- Cell-level clipping, grid lines, zebra striping, and dynamic column layout were added.
- Unit tests (
widgets/table_test.go) and an interactive process-table view in the main demo were completed successfully. - Hardware z-index support for the Kitty Graphics Protocol and cell-based Half-Block layering through
ForceHalfBlockwere added.
- Phase 12: Advanced Layered Rendering and Animated Transitions [COMPLETED]
- Dialog and modal opening/closing animations were implemented using the
ScaleRectandSlideUpRecthelper matrix formulas. - A z-index-prioritized modal stack (
TopmostModaland sandboxing) was integrated intoframe.go. - Glowing, thick, dashed focus rings (
DrawFocusRing) were added around focused widgets. - Unit tests in
modal_transition_test.goand animated transitions/focus rings in the main demo were added.
- Dialog and modal opening/closing animations were implemented using the
- Phase 13: Interactive TUI Playground and Dynamic Layout Controls [COMPLETED]
- An interactive Playground tab accessible from the left menu was added to the main demo.
- A live control panel was created to handle keyboard arrow keys,
+/-ratio adjustments, and mouse-click events.
- Phase 14: CSS Grid Layout, Markdown Renderer, Retro Dither Transitions, and Vector Color Blending [COMPLETED]
- The 2D CSS Grid engine in
layout/grid.gosupportsColumns,Rows,Gap, and cell merging through.Span(rowSpan, colSpan). - The
widgets/markdown.gocomponent parses#headings,**bold**,*italic*,- list, and inline code blocks, with UTF-8-rune-aware word wrapping. - Smooth retro dither-fade transitions between screen tabs were implemented with a Bayer 4x4 matrix.
- An avatar filter applying an anti-aliased circular mask to hardware-rendered images was added.
- Sub-pixel RGB color blending for overlapping lines and graphics was integrated into the Braille Vector Canvas
Setmethod.
- The 2D CSS Grid engine in
- Phase 15: Terminal Particle Rain (Matrix Rain) and High-Resolution Sparkline Renderer [COMPLETED]
widgets/sparkline.gorenders multiline area charts using eight vertical block characters with vertical fitting and normalization.- A Matrix Rain Canvas simulation was implemented to animate vertically falling particles.
- A "Resize Ghosting Fix" buffer-reset engine was integrated to prevent character remnants after terminal resizing.
- Phase 16: Interactive Mouse-Dragged Dialogs and Shortcut Help Panel [COMPLETED]
- TUI window dragging was implemented by tracking
RegisterClickHandlerandMouseEvent.Dragevents, allowing dialogs to be freely dragged by holding the left mouse button on their title bars. - A Shortcut Help Panel modal opens when
?is pressed and includes CSS Grid, Markdown help content, and a circular profile avatar.
- TUI window dragging was implemented by tracking
- Phase 17: Advanced Performance Profiling and Zero-Allocation Optimizations [COMPLETED]
widgets/markdown.gowas converted to use pointer receivers and AST/layout caching was integrated.- Markdown rendering performance improved by 11.3x, and heap allocations during the draw loop were reduced to zero (0 B/op, 0 allocs/op).
- Phase 18: TUI Layout Inspector and Debugging Layer (Layout Inspector / Debug HUD) [COMPLETED]
- The
DebugRegionsstructure automatically records the type, dimensions, and z-index of every drawn widget. - A Debug HUD layer triggered by
Ctrl+Dwas integrated with pixel-perfect z-order clipping, allowing upper layers to obscure the outlines of lower layers. - A globally prioritized keyboard-routing system (Keyboard Focus Fix) was implemented to prevent keys from being swallowed in focused tables and buttons.
- The
- Phase 19: Interactive Mouse-Based Window Resizing [COMPLETED]
- A purple
◢resize handle was drawn in the lower-right corner of the Shortcut Help window, with click/drag tracking. - The window dynamically resizes while being dragged (minimum: 40x10, maximum: 100x30). Internal Flex layout areas resize the Markdown content and profile avatar proportionally to the window size.
- A purple
- Phase 20: Widgets with Animated Transition Effects (Animated Widget Transducers) [COMPLETED]
widgets.Transducerand dither-based modal/widget transitions were completed.- Tab transitions render directly from a clean frame to prevent the previous frame's text/canvas from being carried over piece by piece; modal and widget animations continue independently.
- In addition to disabling the transition flag,
SetTransitionActive(false)clears the transition progress andtransitionOldBuf, preventing a closed transition from carrying an old image into the next modal/frame. - The Debug HUD is rendered after the dither transition so that debug boundaries and labels are not faded by the transition effect.
- Full-frame transitions are used instead of a temporary body buffer, preventing widget text from mixing with stale cells and avoiding coordinate shifts.
- Rows containing text or borders can be changed atomically by the terminal dither engine, preventing characters from being split between the old and new frames.
- Opening a modal cancels any active terminal frame transition, preventing
transitionOldBuffrom being rendered as a second panel over the dialog. The modal runs its own scale animation independently. - Background widgets blocked by the modal sandbox are not added to
DebugRegions; the Debug HUD therefore does not redraw invisible panels over the modal.
- Phase 21: 3D Vector Graphics Engine [COMPLETED]
- Perspective projection (
Project) and axis-rotation (RotateX/RotateY/RotateZ) functions were added. - An automatically rotating 3D cube controlled by left-mouse dragging was integrated on the Braille Canvas.
- Perspective projection (
- Phase 22: Command Palette and Keybindings [COMPLETED]
- The
CommandPalettewidget (widgets/command_palette.go) was implemented. It opens withCtrl+P, performs fuzzy searches across tabs and actions, and executes the selected command. CommandItem(Label,Detail,Category,Handler) andCommandPaletteState(IsOpen,Query,Selected,ScrollOffset,MaxVisible) were implemented.- The fuzzy search engine (
widgets/fuzzy.go) includes VS Code-style scoring with consecutive-match, word-start, and CamelCase bonuses. - The declarative
KeybindingManager(widgets/keybinding.go) was implemented withRegister,Handle, andToCommandItemsAPIs for event-loop integration. formatKeybindingconverts shortcuts into readable text such asCtrl+P,Shift+Tab, and↑.- The feature was integrated into
examples/demo/main.go:Ctrl+Ptoggles the palette, all keys are routed to the palette while it is open, andEnterexecutes the selected command. - Selecting a 3D model or rendering style from the command palette automatically switches to the
Graphicstab so the change is immediately visible. - The
CommandPalette.DebugArea()andFrame.RenderWidgetdebug-area-provider bridge reports the actual centered panel bounds instead of incorrectly reporting the full terminal area. - Unit tests were added:
widgets/command_palette_test.go,widgets/keybinding_test.go, andwidgets/fuzzy_test.go.
- The
- Phase 23: Advanced Table Cell Spanning and Column Resizing [COMPLETED]
- Column dragging through
TableState.ResizeColumnpreserves the total table width. - Temporary slice allocation during column resizing was removed; the minimum column width remains two cells.
ColSpanandRowSpancells are rendered using a cell-ownership matrix.- Clipping for wide characters and emojis is based on terminal-cell width.
- Tests for spanning, resizing, and wide characters were added to
widgets/table_test.go.
- Column dragging through
- Phase 24: Form Components and UI Box Model [COMPLETED]
Select/ dropdown support with keyboard navigation, mouse selection, and hover state was added.- The
Slidercomponent was completed with keyboard, mouse, drag, and capture support. - The
ProgressBarcomponent was added; the demo uses a 0→100→0 easing animation. - CSS-like
Margin,Padding, andInsetsAPIs were added to theBlockwidget. - A standalone
examples/formsexample was created. - Click and hover events were separated;
MouseReleaseno longer triggers toggle events a second time.
- Phase 25: Advanced 3D File Import [COMPLETED / EXTENSIBLE]
- A dependency-free Wavefront OBJ parser was added with support for vertices, polygon faces, texture/normal indices, and negative indices.
Model3D.Normalizescales file-based models for the existing perspective renderer.- OBJ files can be loaded into the demo with
LIMONI_OBJ=/path/model.obj go run ./examples/demo. - Example models include
examples/demo/cube.objand the eight-partexamples/demo/deniz_topu.obj. - A Canvas depth buffer and z-interpolated filled-triangle rasterizer were added, allowing OBJ faces to use depth testing independent of draw order.
- OBJ
mtllib,usemtl,.mtl, andKddiffuse-color support was added; the demo uses material colors in filled-color mode. - OBJ
vtand face UV-index support was added; textured demo rendering uses model UV coordinates. - An ASCII and binary STL loader was added; the demo selects OBJ or STL based on the
LIMONI_MODELextension. - An ASCII PLY loader was also added; it can be loaded with
LIMONI_MODEL=/path/model.ply. - Future extensions may include a glTF/GLB loader, advanced texture/material features, and large-model optimizations.
- Phase 26: Dashboard Table [COMPLETED]
- Column sorting with
▲/▼header indicators, including numeric and text sorting. - Generic
FuzzyFilterBy,FuzzyFilterByFields, and order-preservingFuzzyFilterByStable. - Fuzzy filtering through
Table.FilterQueryand a demo search field. - Multi-select with
ToggleRow,IsRowSelected,ClearSelectedRows, andSpace-based selection. - The
Table.CellStyle(row, column, value)callback and demo CPU/status color rules were completed. - The demo process table refreshes real PID, name, CPU delta, RSS memory, and status data from Linux
/procapproximately every 500 ms. - Visible vertical-row rendering and a fixed header were completed; sticky-column horizontal navigation remains for a later phase.
- Column sorting with
5. Future Roadmap
- Phase 27: Rich Text and Centralized Theme System [COMPLETED / EXTENSIBLE]
- A
Span/Line/Textrich-text widget was added. - Semantic token infrastructure with
Theme,ThemeColors,DarkTheme, andLightThemewas added. Frame.SetTheme/Context.ThemeStylepropagates the theme from the Frame to nested child widgets.Blockautomatically uses thesurfaceandbordertokens when no custom style is provided; the main demo was migrated to semantic color tokens.- Accessibility validation was added through
HighContrastTheme,ContrastRatio, andTheme.ValidateContrast. - Rich text supports cell-width-aware wrapping and left/center/right alignment.
- Span semantic
RoleandOnClickcallback support were added. - The phase is complete; possible future extensions include text selection, hyperlink semantics, and semantic-role integration for more widgets.
- A
- Phase 28: Event Propagation, Focus Scope, and Horizontal Layout [COMPLETED]
- Provider-based virtual rows were added through
TableDataSource/RowCount/RowAt. - Mouse-wheel vertical scrolling,
Shift+wheelhorizontal offset, andStickyColumnsrendering were added. - Focus scope/group APIs (
BeginFocusScope,EndFocusScope, and scoped Tab/Shift+Tab) were added. - Help and exit modals are isolated from background widgets through focus scopes.
- Capture/target/bubble event propagation APIs (
RegisterEventHandler,EventContext,StopPropagation,PreventDefault) and their tests were completed. - A deterministic text snapshot API (
Buffer.Snapshot) and a visible-row table benchmark were added. - Horizontal grid/header intersections clipping, horizontal scroll offset column resize drag handle coordinates, and a zero-allocation responsive box model solver supporting
ConstraintMinandConstraintMaxwere completed.
- Provider-based virtual rows were added through
- Phase 29: Terminal Capabilities and Developer Tooling [COMPLETED]
- Capability profiles for TrueColor, 256 colors, mouse, paste, and graphics.
- A frame profiler, widget render-time measurements, allocation benchmarks, and a widget showcase.
- Phase 30–41: Runtime Core, Interaction 2.0, Virtual Data, A11y, Benchmarks & Compatibility [COMPLETED]
core/engine: Elm architecture (Model, Msg, Cmd, Program), message queue, cancellation, and redraw coalescing.core/driver: Multi-platform terminal drivers (Linux, Darwin, ConPTY, WASM, SSH).compat/bubbletea: Bubble Tea & Lipgloss migration adapter (Model,Cmd,Msg,Program,Style).testkit: Deterministic testing harness with golden files, snapshots, and event traces.benchmarks: Cross-implementation benchmark suite comparing Limoni, Bubble Tea, and Ratatui.
6. Benchmark Analysis & Performance Gap Insights (Limoni vs. Ratatui vs. Bubble Tea)
Cross-runner evaluation across 12 standard workloads reveals clear architectural strengths and specific optimisation targets:
Strengths Demonstrated
- Low-Latency Full Redraw: Limoni achieves 22.5 µs P50 latency on
full-redraw-120x40vs. Ratatui's 108.0 µs (~4.8x faster) and avoids Bubble Tea's high string allocations. - Single-Cell & Dirty Diff:
single-cell-updatecompletes in 5.7 µs (P50) emitting optimal ANSI bytes vs. Ratatui's 36.3 µs. - Large Virtual Data (1,000,000 Rows):
virtual-1000000renders in 22.3 µs (P50) vs. Ratatui's 195.7 µs (~8.7x faster) with zero full-dataset traversal. - Native Image Capability: Frame dispatch in 6.3 µs vs. Ratatui's 38.0 µs and Bubble Tea's 30.5 µs (284 MB allocs).
Identified Gaps & Deficiencies
- Non-Virtual Table Allocation Overhead (
table-10000):table-10000spends 13.5 MB across 124k allocs (52.2 µs P50). While faster than Ratatui (3,435 µs) and Bubble Tea (551 µs / 160 MB), non-virtual table row slice allocations should be reduced with pooled rows or inline chunk iterators.
- Layer Tree Memory Footprint (
hundred-layers):hundred-layersperforms in 6.9 µs P50 (Ratatui: 43.2 µs), but incurs 922 KB (101k allocs) due to layer slice expansion and click region registration per layer. Reusing frame region slices will achieve0 allocs/op.
- Empty Frame Fast-Path Overhead (
empty-frame):- Bubble Tea does nothing on empty frames (50 ns), whereas Limoni spends 1.7 µs for frame lifecycle traversal. Adding an immediate dirty-flag check will drop empty-frame latency to < 100 ns.
- Mouse Hit-Test Allocation Optimization (
mouse-hit-test):- Incurs 120 KB (1,001 allocs) during rapid mouse event hit-testing. The event context and hit slice can be stack-allocated / pooled.
7. Actionable Execution Plan (PATH Milestones)
┌──────────────────────────────────────────────┐
│ PATH 1: Production Polish & Zero-Alloc Gates │
│ (Table/Layer pooling, Hot-path zero alloc) │
└──────────────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────────────┐
│ PATH 2: DevEx, Ecosystem & CLI Tooling │
│ (CLI app scaffold, Bubbletea bridge docs) │
└──────────────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────────────┐
│ PATH 3: Cross-Platform Native Termios/PTY │
│ (macOS/Darwin, Windows ConPTY, SSH backend) │
└──────────────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────────────┐
│ PATH 4: Advanced Engine (WASM & 3D Shaders) │
│ (WebAssembly browser demo, Gouraud shading) │
└──────────────────────────────────────────────┘Milestone Details
- PATH 1: Hot-Path Zero-Allocation & Optimization — DONE
EventRegion&Layerreuse incore/terminal/frame.go(Frame.Resetcapacity retention + sharedEventContext):hundred-layers40.2 ns/op 0 allocs/op,mouse-hit-test98 ns/op 0 allocs/op (measured on linux/amd64, Ryzen 5 5600).Buffer.cleanfast path incore/buffer/buffer.go+ no-op frame short-circuit inTerminal.Draw(skips sync-update/diff when nothing changed):empty-frame1759 ns/op → 11.4 ns/op.widgets/table.goregisters the whole visible row block as a single mouse region instead of one closure per row (registerRowsBlockHandler):table-1000013560 B / 124 allocs → 1052 B / 6 allocs, 46.8 µs → 41.2 µs.- Automated allocation budget gate in
.github/workflows/ci.yml(Verify Zero-Allocation Hot Paths, awk-parsedallocs/op+ 100 nsempty-frameceiling).
- PATH 2: Developer Experience, Ecosystem & CLI — DONE
cmd/limoniscaffold (limoni init [module] / new <name> / version,-force,-module) generating aruntime.Modelapp; generated project verified togo build/go vetclean.docs/bubbletea-migration.mdmigration guide +bubbletea.Program.RunTerminal(ctx)so adapted Bubble Tea models can actually drive a real TTY.docs/widget-gallery.md(21 widgets, field-level API tables) generated from source byinternal/tools/widgetdocs.
- PATH 3: Cross-Platform Native Drivers & Remote PTY — DONE
- Complete native macOS/Darwin
termiosioctl bindings without CGO (core/backend/termios_darwin.go&backend.go). - Implement Windows ConPTY / VT100 backend adapter (
core/backend/raw_windows.go&backend_windows.go). - Add
backend/sshfor multi-session remote TUI applications (core/backend/ssh.go&core/backend/ssh_test.go).
- Complete native macOS/Darwin
- PATH 4: Advanced WebAssembly & Visual Engines — DONE
- Support
GOOS=js GOARCH=wasmto run the interactive demo in modern browsers (core/backend/backend_wasm.go,examples/wasm). - Implement Gouraud/Lambertian shading and depth-sorting optimizations on the Braille 3D Canvas (
graphics/shading.go,widgets/vector_depth.go).
- Support
8. Current File Structure
limoni/
├── go.mod
├── .agents/skills/limoni_development/skill.md # This handbook
├── compat/
│ └── bubbletea/ # Bubble Tea & Lipgloss compatibility adapter (Model, Cmd, Program, Style)
├── core/
│ ├── cell/
│ │ ├── cell.go # Cell (16 bytes), Style (12 bytes), Color (uint32)
│ │ ├── rect.go # Screen-area geometry (Rect)
│ │ └── context.go # Stack-allocated cascading Context and Merge
│ ├── buffer/
│ │ ├── buffer.go # Flat 1D cell matrix (Buffer), Resize
│ │ └── diff.go # Zero-allocation double-buffered diff algorithm
│ ├── backend/
│ │ ├── types.go # Flat event types (Event, KeyEvent, etc.)
│ │ ├── termios_linux # Pure Go raw-mode control through Unix ioctl calls
│ │ ├── parser.go # Keyboard/mouse/focus/hover ANSI sequence parser
│ │ └── backend.go # Asynchronous event loop with SIGWINCH and 25 ms ESC timeout
│ └── terminal/
│ ├── frame.go # Frame context, click-handler registration, Layer API, DebugArea provider
│ ├── terminal.go # Terminal manager, draw loop, multi-layer mouse router, Debug HUD
│ ├── focus.go # FocusManager: Tab/Shift+Tab navigation
│ └── modal.go # Modal, Layer, and LayerType structures; CenterRect and ContainsRect
├── layout/
│ └── layout.go # Flexbox layout engine (Fixed, Percentage, Ratio, Min, Max, Fill)
├── widgets/
│ ├── widget.go # Core Widget interface (Draw and SizeHint)
│ ├── block.go # Bordered, titled CSS box-model container with Margin/Padding
│ ├── paragraph.go # Multiline word-wrapping text widget
│ ├── list.go # Selectable, automatically scrolling interactive list
│ ├── table.go # Phase 23: Span, RowSpan, column resizing, and wide-cell clipping
│ ├── dialog.go # 3D-shadowed modal dialog window
│ ├── textinput.go # Single-line interactive text input
│ ├── checkbox.go # Checkbox [ ]/[x]
│ ├── radio.go # Single-selection control ( )/(*)
│ ├── popup.go # Dropdown widget with hover highlighting
│ ├── select.go # Select dropdown with keyboard/mouse/hover support
│ ├── textarea.go # Multiline TextArea and cursor editing
│ ├── validation.go # Form validator and field-error API
│ ├── slider.go # Slider with keyboard/mouse/drag support
│ ├── progress.go # Percentage- and style-aware ProgressBar
│ ├── richtext.go # Span/Line/Text rich-text renderer
│ └── theme.go # Semantic Theme and dark/light presets
│ ├── canvas.go # Braille 2x4 sub-pixel-resolution drawing area
│ ├── vector.go # Bresenham line, circle, rectangle, and Bézier drawing
│ ├── vector_depth.go # Z-buffer-enabled filled-triangle rasterizer
│ ├── image.go # Kitty/Sixel/iTerm2/HalfBlock image rendering
│ ├── command_palette.go # Phase 22: Command Palette (Ctrl+P, fuzzy search, CommandItem)
│ ├── keybinding.go # Phase 22: Declarative keybinding manager (KeybindingManager)
│ └── fuzzy.go # Phase 22: VS Code-style fuzzy search engine (FuzzyMatch/FuzzyFilter)
├── animation/
│ ├── float.go # Time-based float interpolation
│ ├── color.go # RGB color transition animation
│ └── easing.go # 15+ easing functions
├── graphics/
│ ├── graphics.go # Protocol detection and Kitty/Sixel/iTerm2 encoders
│ ├── vector3d.go # 3D vertices, rotation, and perspective projection
│ ├── obj.go # Wavefront OBJ parser, material library, and Model3D normalization
│ ├── mtl.go # Wavefront MTL diffuse-material parser
│ ├── stl.go # ASCII/binary STL loader
│ └── ply.go # ASCII PLY loader
└── examples/
├── demo/main.go # Fully interactive demo; table, forms, 3D, and OBJ import
├── demo/cube.obj # OBJ import example
├── demo/deniz_topu.obj # Eight-sector beach-ball OBJ example
├── animation/main.go # Animation showcase
├── forms/main.go # Select, Slider, ProgressBar, and box-model example
└── layer_demo/main.go # Phase 10: Layered rendering, modal, and popup demoDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

