Index of every page on this site: llms.txt
All skills
meza avatar

/charm-tui

@982e21e
by mezameza/skills2 stars
Run it yourself

Design, build, refactor, and review Go terminal interfaces using Bubble Tea, Bubbles, Lip Gloss, and Bubblebook. Use whenever work involves Charm TUI components, message routing, focus, terminal layout, styling, component stories, or UI tests. Teaches one native v2 architecture with a coordinating root, reusable components, and isolated Bubblebook stories. Does not cover unrelated Charm services or authorize a v1 migration.

Use this Skill: https://skilld.dev/gh/meza/skills/charm-tui

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencestesting-components.md

≈692 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Component contract tests

Read this when designing, building, reviewing, or testing component behavior, isolation, focus, or style overrides.

If you have not selected the applicable test layers for the current task, read the testing guide first. Read every applicable guide it selects.

Before using or reviewing the Results test example, read the worked component, including its input, style, and ownership assumptions, if you have not already read it.

Test behavior through the component contract

This test uses the Results component contract from the worked component: NewResults, SetItems, Move, and Selected. Put it in the component package's external test package and use its actual module path. The example path below is a placeholder for that project import.

package results_test

import (
    "testing"

    "example.com/project/internal/ui/results"
)

func TestResultsOwnsItemsAndClampsSelection(t *testing.T) {
    input := []results.Item{
        {ID: "alpha", Label: "Alpha"},
        {ID: "beta", Label: "Beta"},
    }
    first := results.NewResults(input, results.ResultsStyles{})
    second := results.NewResults(input, results.ResultsStyles{})
    input[0].Label = "changed by caller"

    first.Move(100)
    selected, exists := first.Selected()
    if !exists || selected.ID != "beta" {
        t.Fatalf("selection = %#v, %v; want beta", selected, exists)
    }
    selected, exists = second.Selected()
    if !exists || selected.Label != "Alpha" {
        t.Fatalf("fresh instance changed: %#v, %v", selected, exists)
    }

    first.SetItems(nil)
    first.Move(-1)
    if selected, exists := first.Selected(); exists {
        t.Fatalf("empty results selected %#v", selected)
    }
}

The test combines a meaningful journey: caller mutation cannot alter owned items, moving one instance cannot move another, movement stops at the end, and empty results have no selection. It never inspects a private index or duplicates the clamping implementation.

For focused controls, test repeated focus and blur through their public methods. Assert the defined outcome and returned commands rather than requiring all components to implement an invented common testing interface.

Test style overrides as a behavior invariant. Create fresh instances with the same data and dependencies but different semantic styles, then apply the same operations. Assert identical selection, validation, emitted actions, and effect results. Styles may change appearance and, where the component supports it, decoration geometry; they must not change domain behavior. Compare geometry against each style's own allocation contract rather than requiring identical pixels across themes.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The Charm TUI skill provides architectural guidance and practical examples for building terminal user interfaces in Go using the Bubble Tea ecosystem. It promotes best practices like component isolation, deterministic rendering, and comprehensive testing. No malicious code, data exfiltration, or obfuscation patterns were detected.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 982e21e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 weeks ago.

Activeupdated 3 months ago

README badge

README badge for meza/skills/charm-tui