Agent skill

Warp TUI Unit Testing

by warpdotdev in warpdotdev/warp

Explains how to write and run fast unit tests for Warp's headless TUI by rendering element trees to a fixed text grid and asserting on the resulting lines.

AGPL-3.0Auto-check passedTesting & QA

Install Warp TUI Unit Testing

skills CLI
$ npx skills add warpdotdev/warp --skill tui-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install warpdotdev/warp tui-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/warpdotdev/warp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/tui-testing .claude/skills/tui-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tui-testing
GitHub stars
65k
Used in
1 other repo
Token cost
~1.8k tokens
SKILL.md length
687 words
Files
1
Skills in repo
46
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Explains how to write and run fast unit tests for Warp's headless TUI by rendering element trees to a fixed text grid and asserting on the resulting lines.

  • Adding unit tests for a new Warp TUI element
  • SKILL.md covers Two test locations, two…, Asserting on styles, cursor,…, Where tests live and Appearance in view tests, plus 2 more sections
  • Calls cargo
  • Testing a TUI screen's rendered text output

What it does

TUI tests are plain unit tests: an element tree is rendered into a fixed cell grid and the resulting text lines are compared with expected strings. They do not use the GUI's real-display, integration or computer-use framework. Tests live in two places with different harnesses, and the choice depends on which crate the test sits in.

Element-library tests in warpui_core use crate-internal test_support helpers: render_to_lines for a one-call render at a given size, and with_paint_context for asserting on individual cells. Because render_to_lines only calls render and not layout, composite elements such as flex containers must be laid out first or they come back empty. View and screen tests in warp_tui cannot use those helpers, so they render directly inside an App test closure, running layout before render.

When your agent uses it

  • Adding unit tests for a new Warp TUI element
  • Testing a TUI screen's rendered text output
  • Debugging a TUI element test that renders empty or stale

Example prompts

  • “Write a unit test for the new progress bar TUI element that checks its rendered lines at a width of ten columns.”
  • “My flex container test renders blank lines in warpui_core, so work out what is missing.”
  • “Add a screen test in warp_tui for the transcript view that asserts on the rendered lines.”

Requirements

  • Rust and cargo
  • The Warp repository

What it can do on your machine

Read from SKILL.md and the folder at commit f571865. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Warp TUI Unit Testing loads about 1.8k tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 687 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~34
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from warpdotdev/warp at commit f571865, republished under its AGPL-3.0 licence (© warpdotdev). 687 words, ~1,789 tokens.

Download SKILL.mdSave it as .claude/skills/tui-testing/SKILL.md (or your agent's skills folder).
name
tui-testing
description
Write and run unit tests for Warp TUI (crates/warp_tui) elements/screens by rendering to text lines. Use for TUI test work.

tui-testing

How to write and run unit tests for Warp's headless TUI front-end (crates/warp_tui and the element library at crates/warpui_core/src/elements/tui). This complements rust-unit-tests (general Rust test conventions) and parallels gui-integration-test for the TUI.

TUI tests are plain, fast unit tests: they render an element tree to a fixed cell grid and assert on the resulting text lines. They do not use the GUI real-display / integration / computer-use framework (that's gui-integration-test / gui-integration-test-video, which are GUI-only).

Two test locations, two harnesses

TUI tests live in two crates, and which render helper you use depends on where the test is:

Element-library tests (in warpui_core)

Tests for the shared cell-grid elements live in crates/warpui_core/src/elements/tui/*_tests.rs and use the crate-internal test_support helpers from crates/warpui_core/src/elements/tui/mod.rs:

  • test_support::render_to_lines(element: &dyn TuiElement, size: TuiSize) -> Vec<String> — one-call harness: builds area = TuiRect::new(0, 0, size.width, size.height) and TuiBuffer::empty(area), calls element.render(area, &mut buffer, ctx) inside a paint context, and returns buffer.to_lines(). It only calls render, not layout — fine for a leaf like TuiText, but composite elements (e.g. TuiFlex) populate child sizes during layout, so lay the element out first (see the layout_at helper in flex_tests.rs) or it renders empty/stale.
  • test_support::with_paint_context(|ctx| ...) — runs a closure with a TuiPaintContext over a fresh, empty view map. Use it when you need the TuiBuffer afterward to assert on individual Cells.

These helpers are pub(crate) to warpui_core, so they are only callable from that crate's own tests. Simplest leaf assertion (see text_tests.rs, flex_tests.rs):

rust
assert_eq!(
    render_to_lines(&TuiText::new("hello"), TuiSize::new(10, 1)),
    vec!["hello     "],
);
View/screen tests (in warp_tui)

warp_tui tests (crates/warp_tui/src/*_tests.rs) can NOT use test_support — render directly instead, under an App::test read/update so an AppContext is available. layout must run before render so child sizes are populated. This local helper mirrors render_element in transcript_view_tests.rs and render_lines in editor_element_tests.rs:

rust
fn render_lines(app_ctx: &AppContext, mut element: impl TuiElement, w: u16, h: u16) -> Vec<String> {
    let mut rendered_views = EntityIdMap::default();
    let mut lctx = TuiLayoutContext { rendered_views: &mut rendered_views };
    let size = element.layout(TuiConstraint::loose(TuiSize::new(w, h)), &mut lctx, app_ctx);
    let area = TuiRect::new(0, 0, size.width, size.height);
    let mut buffer = TuiBuffer::empty(area);
    let mut paint_ctx = TuiPaintContext::new(&mut rendered_views);
    element.render(area, &mut buffer, &mut paint_ctx);
    buffer.to_lines()
}

Views that resolve theme styles need an Appearance singleton (ctx.add_singleton_model(|_| Appearance::mock())). To exercise a whole view through the real draw path, drive the presenter: TuiPresenter::new(), presenter.invalidate(&invalidation, ctx, window_id), then presenter.present(ctx, &view, area) and assert on frame.buffer.to_lines() (see transcript_view_tests.rs).

Asserting on styles, cursor, and events

  • Styles/colors: paint into a buffer yourself and index cells. to_lines() only carries glyphs, so style assertions read Cell fields:
rust
let mut buffer = TuiBuffer::empty(TuiRect::new(0, 0, 1, 1));
with_paint_context(|ctx| text.render(TuiRect::new(0, 0, 1, 1), &mut buffer, ctx));
let cell = &buffer[(0, 0)];
assert_eq!(cell.symbol(), "a");
assert_eq!(cell.fg, Color::Red);
assert!(cell.modifier.contains(Modifier::BOLD));

(with_paint_context is the warpui_core-only helper; in a warp_tui test construct the paint context directly with TuiPaintContext::new(&mut rendered_views) as in the render_lines helper above.)

  • Cursor: call element.cursor_position(area, ctx) and assert on the returned Option<(u16, u16)>.
  • Events: build a TuiEvent (e.g. TuiEvent::KeyDown { keystroke, chars, details, is_composing } or TuiEvent::ScrollWheel { .. }), then call element.dispatch_event(&event, area, &mut event_ctx, &mut layout_ctx, app_ctx) and assert on the returned bool and on the re-rendered lines/cursor. Layout must run first. See render_element / dispatch_event / dispatch_scroll helpers in crates/warp_tui/src/transcript_view_tests.rs.

Keep test areas at a stable, small width/height so golden line vectors stay readable and deterministic; trailing padding is spaces (e.g. "hello ").

Show full SKILL.md (250 more words)Show less

Where tests live

Follow the repo convention: put tests in a sibling *_tests.rs file included at the end of the source module:

rust
#[cfg(test)]
#[path = "foo_tests.rs"]
mod tests;

Real examples to model:

  • Element library: crates/warpui_core/src/elements/tui/text_tests.rs, flex_tests.rs, container_tests.rs, constrained_box_tests.rs, buffer_tests.rs.
  • Views/screens: crates/warp_tui/src/transcript_view_tests.rs, crates/warp_tui/src/input/view_tests.rs.

Appearance in view tests

Views that resolve theme styles (via TuiUiBuilder::from_app) need an Appearance singleton. Install the mock in the test with app.add_singleton_model(|_| Appearance::mock()); (as in transcript_view_tests.rs). Appearance::mock() comes from warp_core's test-util feature, wired as a dev-dependency of the TUI crates.

Process-level tests (no integration harness)

The TUI has no GUI-style integration harness: the real-display, synthetic-event framework in crates/integration (see gui-integration-test) is GUI-only and does not drive the TUI. Besides render-to-lines unit tests, binary-level behavior is covered by a process-level test that spawns the built binary and asserts on its output/exit — see crates/warp_tui/tests/worker_dispatch.rs (it runs CARGO_BIN_EXE_warp-tui-oss and checks that a worker invocation dispatches without launching the TUI frontend). Use that pattern for process/CLI-level behavior, and render-to-lines unit tests for element/screen rendering. There is no separate TUI integration-test skill because there is no such framework today.

Running

  • Whole crates: cargo nextest run -p warp_tui and cargo nextest run -p warpui_core.
  • The TUI element library is behind the tui feature; if a test needs it explicitly, add --features tui.
  • A single test by substring: cargo nextest run -p warp_tui -E 'test(<substring>)'.
  • Before opening a PR, run the relevant tests to green, then the applicable Clippy check, then ./script/format once. Do not add a full presubmit or rerun earlier checks after formatting unless explicitly required; follow AGENTS.md.

© warpdotdev, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/tui-testing of warpdotdev/warp.

Open the folder on GitHubat commit f571865

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in warpdotdev/warp, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Warp TUI Unit Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Warp TUI Unit Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Warp TUI Unit Testing this skillwarpdotdev/warp65k1 repos~1.8kAutomated safety check: PassAGPL-3.0
Rust TDD Workflowrtk-ai/rtk83k—~753Automated safety check: NotesApache-2.0
RTK Filter TDD in Rustrtk-ai/rtk83k—~1.9kAutomated safety check: NotesApache-2.0
Testing OpenLogi UIAprilNEA/OpenLogi23k—~1.1kAutomated safety check: PassApache-2.0
Rocketmq Rust Issue Generatormxsm/rocketmq-rust1.5k—~1.6kAutomated safety check: PassApache-2.0
Add UI Stringopenfootmanager/openfootmanager1.1k—~2.6kAutomated safety check: PassGPL-3.0

Similar skills

  • Enforces red-green-refactor for Rust work, with idiomatic test patterns, a naming convention and a pre-commit gate of cargo fmt, clippy and test.

    83k GitHub stars~753 tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • Enforces red-green-refactor for new RTK output filters in Rust, using real captured fixtures, snapshot tests with insta and token-savings assertions.

    83k GitHub stars~1.9k tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • Testing OpenLogi UI

    AprilNEA/OpenLogi

    Verifies OpenLogi's native GPUI interface with focused tests, the component gallery and a mock agent, choosing the evidence that fits each change.

    23k GitHub stars~1.1k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • A skill your agent uses when the user asks to create, draft, prepare, or publish a GitHub issue for the rocketmq-rust project — bugs, features, enhancements, refactors, docs, unit tests, CI…

    1.5k GitHub stars~1.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Add UI String

    openfootmanager/openfootmanager

    Add or change any text a player can see, in every locale the game ships in.

    1.1k GitHub stars~2.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Port Node Red Node

    oldrev/edgelinkd

    Port a Node-RED node into EdgeLinkd the way this repo does it: implement the node in Rust under crates/core/src/runtime/nodes, mirror Node-RED's mocha spec as pytest tests under tests/, register the…

    121 GitHub stars~3k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from warpdotdev/warp

All 46 skills in this repo
  • Builds or updates a design system in Figma from a codebase in ordered phases: discovery, variables and tokens, components, theming and documentation, with checkpoints.

    65k GitHub starsUsed in 2 repos~4.4k tokens
    Auto-check passed
  • Required groundwork before any use_figma call: the rules and reference files for running JavaScript in a Figma file through the Plugin API without common failures.

    65k GitHub starsUsed in 4 repos~4.4k tokens
    Auto-check passed
  • Warp Factory Files

    warpdotdev/warp

    Authors and edits file-based Warp software factory definitions rooted at factory.yaml, covering agents, automations, scorers and webhooks, and validates them before a pull request.

    65k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Figma Design to Code

    warpdotdev/warp

    Turns a Figma frame or component into production code that matches the design, using the Figma MCP server and the project's own design system.

    65k GitHub starsUsed in 4 repos~2.9k tokens
    Auto-check passed
  • Migrates the compatible subset of settings and global file-based MCP servers from the Warp desktop app into Warp Agent CLI without exposing credentials or state.

    65k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Creates project-specific design system rules from your codebase so coding agents implement Figma designs with your components, naming and tokens.

    65k GitHub starsUsed in 3 repos~4.6k tokens
    Auto-check passed

Works with

Categories

Questions about Warp TUI Unit Testing

What does Warp TUI Unit Testing do?

Explains how to write and run fast unit tests for Warp's headless TUI by rendering element trees to a fixed text grid and asserting on the resulting lines. TUI tests are plain unit tests: an element tree is rendered into a fixed cell grid and the resulting text lines are compared with expected strings. They do not use the GUI's real-display, integration or computer-use framework.

When should I use Warp TUI Unit Testing?

Warp TUI Unit Testing fits situations like: adding unit tests for a new Warp TUI element; testing a TUI screen's rendered text output; debugging a TUI element test that renders empty or stale.

How do I install Warp TUI Unit Testing in Claude Code?

Run `npx skills add warpdotdev/warp --skill tui-testing -a claude-code`. Or copy the skill folder (.agents/skills/tui-testing in warpdotdev/warp) into .claude/skills/tui-testing in your project. Claude Code loads it when a task matches its description.

How do I install Warp TUI Unit Testing in Codex?

Run `npx skills add warpdotdev/warp --skill tui-testing -a codex`. Or copy the skill folder (.agents/skills/tui-testing in warpdotdev/warp) into .agents/skills/tui-testing in your project. Codex loads it when a task matches its description.

Can I use Warp TUI Unit Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add warpdotdev/warp --skill tui-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tui-testing, .gemini/skills/tui-testing, .github/skills/tui-testing and .opencode/skills/tui-testing in your project.

What does Warp TUI Unit Testing need to run?

Going by SKILL.md and its folder, Warp TUI Unit Testing needs the command-line tools its instructions call (cargo). Our summary lists: Rust and cargo; The Warp repository.

Does Warp TUI Unit Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Warp TUI Unit Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Warp TUI Unit Testing use?

Warp TUI Unit Testing is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Warp TUI Unit Testing use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Warp TUI Unit Testing?

Skills that share tags, products or a category with Warp TUI Unit Testing: Rust TDD Workflow (rtk-ai/rtk, 83k stars), RTK Filter TDD in Rust (rtk-ai/rtk, 83k stars), Testing OpenLogi UI (AprilNEA/OpenLogi, 23k stars) and Rocketmq Rust Issue Generator (mxsm/rocketmq-rust, 1.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Warp TUI Unit Testing?

warpdotdev (a GitHub organization) maintains it in warpdotdev/warp, which has 65,380 GitHub stars. The repository holds 46 skills in this directory. The repository was last updated on October 7, 2026.

Source: warpdotdev/warp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.