agentleFS
Zwin-uxZwin-ux/kit/.claude/skills/kit-tui/SKILL.md

kit-tui

Skill0 starsChanged 14 days agoMITView on GitHub

Build or change Kit's terminal UI (ratatui + crossterm + tokio in crates/kit-tui): screens, panes, keybindings, themes, motion and insta snapshot tests. Use for any change under crates/kit-tui or anything that draws to the terminal.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every state is a word as well as a colour (PASS, FAIL, RUN, GATING, UNCONFIGURED).

    line 22
  2. Distinctive:

    No stub copy on any screen: no "coming soon", no unreachable key in a footer or help panel.

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Kit TUI

Binding rules: docs/dev/DESIGN-tui.md (palette, floors, motion) and docs/QUALITY.md. Product shape: docs/PRD.md §7.

How the code is laid out

  • src/loop.rs: the only event loop. One tokio::select! over terminal input, engine deltas and one clock (AppEvent::AnimationTick, 20 Hz). No other timers, threads or sleeps anywhere in the UI.
  • src/app.rs: the reducer. App::update(AppEvent) -> Action. Navigation changes Screen; engine work is returned as an Action (DispatchSubmitted, KillSelected, …), never done inside the reducer.
  • src/ui/*.rs: pure drawing from &App into a Frame. No state changes while drawing.
  • src/theme.rs: every colour comes from a Theme token (kit, kit_light, monochrome, high_contrast, ansi16). Never write an RGB value in a screen file.
  • src/fox.rs: the mascot. Motion only on the shared clock, and off under NO_COLOR / KIT_MOTION=off.

Rules that keep it good

  • Every state is a word as well as a colour (PASS, FAIL, RUN, GATING, UNCONFIGURED).
  • Geometry is fixed under ↑↓: selection never moves columns or the header counts.
  • One footer grammar on every screen ([key] verb); ? opens help; Esc goes back; q quits only from the Control Room.
  • Floors: 80×24 is the reference, 80×14 must show every help key, below 60×12 draw the "too small" screen.
  • Idle costs nothing: redraw only when state changed or a motion frame is due. Budget: idle CPU < 1%.
  • Hit-testing (mouse) uses the same Rects the renderer drew; compute layout once per frame.
  • No stub copy on any screen: no "coming soon", no unreachable key in a footer or help panel.

Tests (required for every UI change)

  1. Reducer test in app.rs for the key or event.
  2. Snapshot in ui/mod.rs with render_to_string(&app, w, h) at 80 columns and at the narrow floor; add a monochrome or KIT_THEME=high case when a style changed.
  3. INSTA_UPDATE=always cargo test -p kitctl-tui (PowerShell: $env:INSTA_UPDATE = 'always'), then read every changed .snap line by line before committing it. A snapshot you didn't read is not a test.
  4. cargo clippy -p kitctl-tui --all-targets -- -D warnings.

For screenshots in a PR, paste the relevant .snap frame in a code block; for motion, record with scripts/record-media.sh (VHS) from a release build.

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.