# tui-testing

tui-testing is a Claude Code skill for writing unit tests for Warp's headless TUI. It validates interface elements by rendering their tree to a fixed text grid.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 720 repo stars
- Author: dominikmartn
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dominikmartn/harp/tree/HEAD/.agents/skills/tui-testing/SKILL.md
- Updated: 2026-11-10
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/tui-testing

## What it does

tui-testing directs the authoring of headless terminal UI tests in `warp_tui` and `warpui_core`. These checks bypass real display servers: components render directly onto a cell grid, allowing assertions against deterministic text slices.

Shared element tests inside `warpui_core` use helpers like `render_to_lines` and `with_paint_context`. Composite elements require calling `layout` prior to `render`, because child dimensions remain empty without it. View-level tests in `warp_tui` run under `App::test` and require an `Appearance::mock()` singleton from `warp_core` whenever themes must resolve.

Execution relies on Cargo tools via `cargo nextest run -p warp_tui` or `cargo nextest run -p warpui_core`. Enabling the element library during tests requires the `--features tui` flag.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dominikmartn/harp --skill tui-testing -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/tui-testing/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/tui-testing/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dominikmartn/harp --skill tui-testing -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/tui-testing/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dominikmartn/harp --skill tui-testing -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/tui-testing/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dominikmartn/harp .agents/skills/tui-testing
```

2. **Manually: put the files in place**
- File: `.github/skills/tui-testing/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dominikmartn/harp --skill tui-testing -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dominikmartn/harp --path .agents/skills/tui-testing
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/tui-testing/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dominikmartn/harp/tree/HEAD/.agents/skills/tui-testing/SKILL.md

## When to use it
- test headless TUI elements without spinning up a display server
- verify cell attributes, text colors, and cursor coordinates in memory
- simulate keyboard and scroll actions through `dispatch_event`
- wire up mock appearance models for themed terminal views

## Example prompts
- Write a unit test for a new composite TUI element in warpui_core using render_to_lines
- Implement a view test in crates/warp_tui that asserts cursor position after keystroke events
- Show how to run a single TUI test using cargo nextest filtering

## Similar
- [ratatui-tui](https://affpapa.org/en/nevibecode/skills/ratatui-tui.md) — skill · 959 installs
- [textual-tui-skill](https://affpapa.org/en/nevibecode/skills/textual-tui-skill.md) — skill · 268 installs
- [codex-tui-proof](https://affpapa.org/en/nevibecode/plugins/codex-tui-proof.md) — plugin · ★ 1596 repo stars
- [rust-write-tests](https://affpapa.org/en/nevibecode/skills/rust-write-tests.md) — skill · 257 installs
- [cargo-nextest](https://affpapa.org/en/nevibecode/skills/cargo-nextest.md) — skill · 101 installs
- [tui-design](https://affpapa.org/en/nevibecode/skills/tui-design.md) — skill · 1400 installs

From the same set: [dominikmartn/harp](https://affpapa.org/en/nevibecode/by/dominikmartn/harp.md) — 62 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
