Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a343a25
Refine skill guidance and make eval trials honest
programmersd21 Nov 26, 2026
be28c2c
Fix evaluation edge cases and refine project guidance
programmersd21 Nov 26, 2026
5fc270b
Correct evaluation harness activation assertion
programmersd21 Nov 26, 2026
f9df71a
Make design guidance contextual and evidence-aware
programmersd21 Nov 26, 2026
108945e
Record skill selection expectations in evaluation results
programmersd21 Nov 26, 2026
046ebcb
Assert skill hash only for injected trials
programmersd21 Nov 26, 2026
1eeef87
Add honest human review and isolated trial summaries
programmersd21 Nov 26, 2026
de04c97
Document portable skill installation across coding agents
programmersd21 Nov 26, 2026
6fc7c2f
Clarify client installation and compatibility claims
programmersd21 Nov 26, 2026
0b346ee
Fix directory preview and help interaction edge cases
programmersd21 Nov 26, 2026
04b6fae
Format directory preview implementation
programmersd21 Nov 26, 2026
29fcf2d
Make incomplete evaluation trials impossible to overlook
programmersd21 Nov 26, 2026
a2045af
Isolate evaluation agent environments and capture tool events
programmersd21 Nov 27, 2026
8842ee2
Randomize paired evaluation order and record suite metadata
programmersd21 Nov 27, 2026
639ba65
Add functional negative-trigger acceptance
programmersd21 Nov 27, 2026
1a522e8
Test real skill activation telemetry and run negative acceptance
programmersd21 Nov 27, 2026
a6cadf1
Record structured skill activation evidence in trials
programmersd21 Nov 27, 2026
f0defdc
Capture bounded format and build check logs for each eval
programmersd21 Nov 27, 2026
44ecb6a
Verify skill activation and baseline isolation in eval reports
programmersd21 Nov 27, 2026
c9e43ff
Deduplicate and correct activation telemetry tests
programmersd21 Nov 27, 2026
00c73e4
Add Betamax interaction coverage and Ratatui evidence map
programmersd21 Nov 27, 2026
954bdaa
Correct workflow expressions and delegated telemetry assertion
programmersd21 Nov 27, 2026
421b443
Make directory preview cancellable during scans
programmersd21 Nov 27, 2026
b80c59e
Add cancellable background worker for selected previews
programmersd21 Nov 27, 2026
1f64f65
Keep preview completion visible without blocking terminal input
programmersd21 Nov 27, 2026
1b0f0e4
Adapt state and rendering tests for asynchronous previews
programmersd21 Nov 27, 2026
8be66e8
Test background directory previews with 50k entries
programmersd21 Nov 27, 2026
023a3a3
Use explicit byte slices in large preview fixture
programmersd21 Nov 27, 2026
57dccac
Format async preview worker and fix terminal help tape
programmersd21 Nov 27, 2026
d736f5f
Wait for background binary preview in render test
programmersd21 Nov 27, 2026
dcf6e3b
Fix background preview worker Clippy findings
programmersd21 Nov 27, 2026
ec663b0
Apply Rustfmt and isolate custom OpenCode config
programmersd21 Nov 27, 2026
138bbcf
Separate historical smoke tests from pending paired evaluation
programmersd21 Nov 27, 2026
66923b6
Exercise terminal resize in Betamax tape and retain failures
programmersd21 Nov 27, 2026
d1fbe55
Use Betamax Escape key syntax
programmersd21 Nov 27, 2026
1d50f84
fix deprecated Ratatui fixture API
programmersd21 Nov 28, 2026
3f830b8
document safe skill replacement installs
programmersd21 Nov 28, 2026
0aada91
align README with skill workflow
programmersd21 Nov 28, 2026
64905ed
define skill directory in command examples
programmersd21 Nov 28, 2026
378b182
seed the task-specific selection regression fixture
programmersd21 Nov 28, 2026
2156bbd
isolate Rustup and bound acceptance checks
programmersd21 Nov 28, 2026
19c8702
prevent false-complete evaluation summaries
programmersd21 Nov 28, 2026
842199c
retain Betamax terminal checkpoints as artifacts
programmersd21 Nov 28, 2026
cf8c584
make README installation replace existing skill copies
programmersd21 Nov 28, 2026
1b4ab12
test the task-specific seeded regression fixture
programmersd21 Nov 28, 2026
447d5bb
seed actual selection reset bug in eval fixture
programmersd21 Nov 28, 2026
5fd0177
cover suite completeness and activation telemetry regressions
programmersd21 Nov 28, 2026
f7770c5
tighten README version guidance
programmersd21 Nov 28, 2026
205e587
assert fixture contains the actual selection reset
programmersd21 Nov 28, 2026
50acecb
repair fixture harness regression test
programmersd21 Nov 28, 2026
b304674
restore fixture harness test structure
programmersd21 Nov 28, 2026
9906a15
rebuild harness regression tests cleanly
programmersd21 Nov 28, 2026
d56c55b
write valid suite metadata in regression test
programmersd21 Nov 28, 2026
36e40e9
simplify expected-incomplete suite assertions
programmersd21 Nov 28, 2026
982f04c
make model evaluations explicitly optional
programmersd21 Nov 28, 2026
3c1703f
clarify evaluations are optional research
programmersd21 Nov 28, 2026
d5fe4aa
make evaluation tooling optional in audit
programmersd21 Nov 28, 2026
431b2d3
remove evaluation as a contribution gate
programmersd21 Nov 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/betamax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Betamax

on:
pull_request:

permissions: {}

concurrency:
group: betamax-${{ github.ref }}
cancel-in-progress: true

jobs:
render:
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772
with:
toolchain: stable

- name: Build dirview
run: cargo build --manifest-path skills/ratatui/templates/dirview/Cargo.toml

- name: Run terminal interaction tape
uses: joshka/betamax-action@bc6fa6bfb5e20dd342b588601f4e1a945661d5fe
with:
tapes: tapes/**/*.tape
formats: gif,png
Comment thread
programmersd21 marked this conversation as resolved.
Resolved
extra-outputs: target/betamax/dirview-*.png

- name: Upload terminal state checkpoints
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: betamax-terminal-checkpoints
path: target/betamax/*.json
if-no-files-found: warn

2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ jobs:
run: bash -n skills/ratatui/scripts/*.sh
- name: python syntax
run: python3 -m py_compile skills/ratatui/scripts/pty-smoke.py
- name: lint scanner regression tests
run: python3 -m unittest discover -s skills/ratatui/scripts -p 'test_*.py'
- name: crate-versions smoke
run: skills/ratatui/scripts/crate-versions.sh ratatui | grep -q 'ratatui'

Expand Down
61 changes: 17 additions & 44 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,25 @@
# Building ratatui apps
# Building Ratatui applications

For any Rust terminal UI task, follow `skills/ratatui/SKILL.md`. It is the
full process; this file is the short version for agents that read `AGENTS.md`
instead of loading skills.
Use `skills/ratatui/SKILL.md` when creating, modifying, debugging, or reviewing a Rust terminal UI built with Ratatui.

## Which workflow
## Workflow

- **New application:** follow steps 1-5 in full, including the design brief
and the template.
- **Existing application:** skip the design brief unless the layout archetype
changes. Inspect the existing code first. Make the smallest change. Preserve
existing dependencies and patterns. Do not copy the template.
- Inspect the repository, manifest, lockfile, source, and tests first.
- For a new application, choose an architecture that fits its complexity.
- For an existing application, preserve established patterns and make a targeted change.
- Use `skills/ratatui/templates/dirview/` as an example when its structure fits. It is not a mandatory starter.
- Do not apply this guidance to non-Ratatui or non-TUI tasks.

## Before writing code
## Engineering

1. **Research.** Run `$SKILL_DIR/scripts/crate-versions.sh <crates>` for the
newest stable version and minimum Rust version of every dependency. Read the
ratatui `CHANGELOG.md` and `BREAKING-CHANGES.md` for that version. Never
write ratatui code, versions or feature flags from memory. If an API is
uncertain, compile a ten-line program that calls it.
2. **Design brief (new apps only).** State the layout archetype, one ANSI
accent color, density, modes and keys, and what each empty, error and
too-small state shows, justified from the app's data.

## Building

- New apps: start from `skills/ratatui/templates/dirview/` and copy its
structure: `action`, `keymap`, `state` (no terminal types), `ui` (no side
effects), `theme` (the only file naming colors). Rename the crate reference
in `main.rs` to match your package name.
- Existing apps: do not copy the template. Read the existing code first.
- One key table drives input, footer hints and the `?` help.
- Everything visible works. No fake data, decorative panels or dead keys.
- Measure text with `unicode-width`, sanitize untrusted text, draw only visible
rows.
- Colors by role, 16 ANSI by default, respect `NO_COLOR`, no forced background,
no emoji.
- If handling terminal events directly, declare a compatible direct `crossterm` dependency and import from `crossterm::event`. Verify `cargo tree -d` has no duplicate versions.
- No `.unwrap()` outside tests, no swallowed errors, no TODOs, comments say why.
- Verify APIs against the Ratatui version resolved by the project.
- Avoid unnecessary dependencies and version changes.
- Keep rendering responsive; move genuinely expensive work out of the draw path.
- Handle terminal resizing, input, and relevant empty or error states.
- Prefer state and behavior tests; use `TestBackend` for relevant rendering checks.
- Use PTY, VHS, Betamax, or equivalent integration tests when real terminal behavior is in scope.
- Treat architecture and visual conventions as context-dependent unless correctness requires them.

## Done means

See `skills/ratatui/SKILL.md` section 4 (Verify) for the canonical checklist.
Do not duplicate it here.

Also read the rendered screens as text at several sizes
(`skills/ratatui/templates/dirview/examples/dump.rs`). Report what was built,
the versions used, what passed, and anything you could not check.

More detail: `skills/ratatui/references/` (`research-checklist.md`,
`ux-principles.md`, `slop-tells.md`).
Run checks appropriate to the workspace and changed packages. Report exactly what ran, what passed, and what remains unverified. See `skills/ratatui/SKILL.md` for the detailed workflow and references.
73 changes: 44 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<p align="center">
<a href="#quick-start">Quick start</a> ·
<a href="docs/agent-compatibility.md">Agent support</a> ·
<a href="#what-changes">What changes</a> ·
<a href="#how-it-works">How it works</a> ·
<a href="#demo">Demo</a> ·
Expand All @@ -38,48 +39,61 @@

AI assistants write ratatui from memory. They reach for old APIs and wrong crate versions, then ship a UI that looks generated: neon defaults, decorative panels, keys that do nothing.

**ratatui-skill** replaces that with a fixed process and a tested template. The assistant looks up what is current, writes a design brief before any code (new apps only), builds from a working codebase, and proves the result before it says "done".
**ratatui-skill** provides a practical workflow, version-aware research, a working reference template, and verification guidance. The assistant inspects the project, adapts the process to the task, and reports what it actually checked.

## Quick start

1. Copy the skill into your assistant's skills directory. For Claude Code:
1. Copy the canonical skill directory into a discovery location supported by your agent. From the root of this repository:

**Codex, Cursor, Antigravity, and OpenCode:**

```bash
mkdir -p /path/to/project/.agents/skills
rm -rf /path/to/project/.agents/skills/ratatui
cp -a skills/ratatui /path/to/project/.agents/skills/ratatui
```

**Claude Code:**

```bash
mkdir -p ~/.claude/skills && cp -r skills/ratatui ~/.claude/skills/ # all projects
mkdir -p .claude/skills && cp -r skills/ratatui .claude/skills/ # one project
mkdir -p /path/to/project/.claude/skills
rm -rf /path/to/project/.claude/skills/ratatui
cp -a skills/ratatui /path/to/project/.claude/skills/ratatui
```

See [agent compatibility and installation](docs/agent-compatibility.md) for global installs and native alternatives.

2. Ask for a terminal UI:

```text
Use the ratatui skill. Build a simple TUI in Rust: a todo list. Add items,
mark them done, delete them, and save to a file so they're still there next time.
```

3. Watch it research versions, write a brief, build, and run its own checks.
3. Watch it inspect the project, choose a proportionate workflow, build, and run relevant checks.

Assistants that read `AGENTS.md` instead of loading skills can use the one at the repo root. It carries the same process in short form and points at the skill files.
`AGENTS.md` is a concise fallback for agents that read repository instructions but do not discover skills. It does not install or auto-register the skill. See [agent compatibility](docs/agent-compatibility.md) for the supported discovery paths.

## What changes

| Without the skill | With it |
|---|---|
| Versions and APIs written from memory | Newest stable versions looked up and quoted, release notes read, uncertain calls compiled |
| Design is whatever comes to mind first | A written brief: layout, one accent color, density, keys, every empty, error and too-small state |
| Versions and APIs written from memory | Resolved versions and project constraints checked; release notes reviewed when versions or recent APIs change |
| Design choices are implicit | Layout and interactions follow the requirements and displayed data; document decisions when complexity warrants it |
| Decorative panels, fake data, dead keys | Everything visible works |
| One long `main.rs` | State with no terminal types, rendering with no side effects, one key table |
| "Done" with nothing run | fmt, clippy, tests, screen dumps, a real pseudo-terminal run, and a slop scan |
| Structure chosen without considering scope | Clear state/rendering boundaries and shared key bindings where they reduce coupling or duplication |
| "Done" with nothing run | Relevant fmt, Clippy and tests; render or terminal integration checks where behavior requires them; honest reporting |
| Silent about what was skipped | A report that names anything it could not check |

## How it works

<details open>
<summary><b>Five steps, in order</b></summary>

1. **Research.** Look up the newest stable version, minimum Rust version, and (when given a manifest) the version resolved by the project of every crate, read the release notes, confirm widget crates match the ratatui version, and compile anything uncertain.
2. **Design brief.** Before any code: layout archetype, one accent color, density, keys, and what each empty or failed state shows, justified from the app's data.
3. **Build** from a tested template with a strict split: state with no terminal types, rendering with no side effects, and one key table that drives input, footer hints and help.
4. **Verify.** `cargo fmt --check`, clippy with warnings denied, tests, text dumps of the screen at several sizes, a run in a real pseudo-terminal, and a slop scan.
1. **Research.** Check the newest stable and minimum supported versions alongside versions resolved by the project. Preserve existing constraints; review release notes when changing versions or relying on recently changed APIs. Confirm widget crates match the resolved Ratatui version and compile uncertain APIs.
2. **Design.** For a non-trivial new interface, make the interaction model, layout, keyboard behavior, and relevant empty/error states explicit before implementation. Keep this lightweight for small tasks.
3. **Build** with the simplest architecture that fits. Use the dirview template as a reference when its structure is relevant; preserve existing project conventions.
4. **Verify.** Run relevant formatting, Clippy and test checks. Use TestBackend for rendering behavior and PTY or recording-based tests when real terminal interaction matters. Report anything not checked.
5. **Report honestly,** including anything it could not check.

</details>
Expand All @@ -88,10 +102,10 @@ Assistants that read `AGENTS.md` instead of loading skills can use the one at th
<summary><b>The rules it enforces</b></summary>

- Everything visible works. No fake data, decorative panels or dead keys.
- One key table drives input, footer hints and the `?` help, so a documented key always works.
- When input, footer hints, and help repeat the same bindings, keep them in sync through a shared source of truth.
- Text is measured with `unicode-width`, untrusted text is sanitized, only visible rows are drawn.
- Colors by role in one file, 16 ANSI colors by default, `NO_COLOR` respected, no forced background, no emoji.
- No `.unwrap()` outside tests, no swallowed errors, no TODOs, comments say why.
- Choose colors and visual conventions for the product and terminal environment; support monochrome output when required.
- Handle errors deliberately and use compiler-visible Clippy lints where a project wants to prohibit specific patterns.
- Destructive actions confirm. Slow work never blocks the draw loop.

</details>
Expand All @@ -109,15 +123,15 @@ cd todo
TODO_THEME=catppuccin cargo run --bin todo
```

The default uses the 16 ANSI colors from your terminal palette. `NO_COLOR` renders monochrome. Source, keys and the file format are in [`todo/README.md`](todo/README.md).
The demo uses the terminal palette by default and supports `NO_COLOR` for monochrome output. Source, keys and the file format are in [`todo/README.md`](todo/README.md).

## What's inside

```text
AGENTS.md the process in short form, for agents without skill support
assets/ banner, demo, faq and sponsor images
docs/ version-aware distribution proposal
evals/ 10 evaluation tasks, harness, scoring rubric, results
evals/ task suite, paired-run harness, scoring rubric, human-review records
skills/ratatui/
SKILL.md the process
references/
Expand Down Expand Up @@ -163,11 +177,12 @@ cargo run -- .
<summary><b>Does it only work with Claude Code?</b></summary>
<br>

**No. Any assistant that can run commands works.**
**No. The skill uses the open Agent Skills directory format.**

The skill format is read by assistants that support skills, and anything that
reads `AGENTS.md` can use the short version at the repo root. The scripts and
template are plain shell, Python and Rust.
Codex, Claude Code, Cursor, Antigravity, and OpenCode document compatible
skill discovery paths. Use the install location listed in
[`docs/agent-compatibility.md`](docs/agent-compatibility.md). The repository
has not yet been runtime-smoke-tested in every listed client.

</details>

Expand All @@ -183,8 +198,8 @@ The versions in this repo are what the template was tested with, ratatui 0.30.2
on its minimum supported Rust version, 1.88. They are not a promise about what is newest when you read this. The skill
tells the assistant to:

1. Run `crate-versions.sh` for each dependency.
2. Read the release notes for the version it returns.
1. Run `crate-versions.sh` for relevant dependencies.
2. Preserve project constraints and inspect release notes when changing versions or using recently changed APIs.
3. Compile any API it is unsure about before using it.

</details>
Expand All @@ -195,11 +210,11 @@ tells the assistant to:
<summary><b>Why a "slop scan"?</b></summary>
<br>

**Generated UIs are recognizable, so the scanner fails CI on the mechanical tells.**
**The scanner is deliberately narrow. It is a guardrail, not an AI-slop detector.**

Emoji icons, neon gradients, placeholder rows and comments that narrate the code
are checked by [`lint-slop.sh`](skills/ratatui/scripts/lint-slop.sh). The rest are
judgment calls listed in
It checks a small set of mechanical source conventions. It cannot reliably
judge visual hierarchy, fake data, unnecessary abstractions, or whether a design
fits the product. Those require behavior tests and human review. See
[`references/slop-tells.md`](skills/ratatui/references/slop-tells.md).

</details>
Expand Down
92 changes: 92 additions & 0 deletions docs/agent-compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Agent compatibility

`skills/ratatui/` is the canonical skill source in this repository. It follows the open Agent Skills directory format: one directory containing `SKILL.md` and optional `references/`, `scripts/`, and template assets.

Do not maintain separate copies of the instructions for each agent. Install the same canonical directory at the discovery path for the client you use.

## Project-level discovery paths

| Agent | Project-level path | Notes |
|---|---|---|
| OpenAI Codex | `.agents/skills/ratatui/` | Codex also supports user-level `~/.agents/skills/ratatui/`. |
| Claude Code | `.claude/skills/ratatui/` | Claude Code also supports `~/.claude/skills/ratatui/`. |
| Cursor | `.agents/skills/ratatui/` or `.cursor/skills/ratatui/` | Cursor also recognizes Claude and Codex skill directories. |
| Google Antigravity | `.agents/skills/ratatui/` | Shared workspace path for Antigravity IDE and CLI. |
| OpenCode | `.opencode/skills/ratatui/` | OpenCode also discovers `.agents/skills/` and `.claude/skills/` as compatibility locations. |

The shared `.agents/skills/ratatui/` path is the simplest project-level choice when using Codex, Cursor, Antigravity, and OpenCode together. Claude Code currently uses its own `.claude/skills/` project path, so install a copy there as well when Claude Code is part of the workflow.

## Global discovery paths

| Agent | User-level path |
|---|---|
| OpenAI Codex | `~/.agents/skills/ratatui/` |
| Claude Code | `~/.claude/skills/ratatui/` |
| Cursor | `~/.agents/skills/ratatui/` or `~/.cursor/skills/ratatui/` |
| Google Antigravity | `~/.gemini/config/skills/ratatui/` |
| OpenCode | `~/.config/opencode/skills/ratatui/` |

OpenCode additionally accepts global compatibility directories `~/.agents/skills/` and `~/.claude/skills/`.

## Install from this repository

Run these commands from the root of the cloned `ratatui-skill` repository. Replace `/path/to/project` with the root of the project where you want the skill available.

### Shared location

For Codex, Cursor, Antigravity, and OpenCode:

```bash
mkdir -p /path/to/project/.agents/skills
rm -rf /path/to/project/.agents/skills/ratatui
cp -a skills/ratatui /path/to/project/.agents/skills/ratatui
Comment thread
programmersd21 marked this conversation as resolved.
Resolved
```

### Claude Code

```bash
mkdir -p /path/to/project/.claude/skills
rm -rf /path/to/project/.claude/skills/ratatui
cp -a skills/ratatui /path/to/project/.claude/skills/ratatui
```

### OpenCode native location

```bash
mkdir -p /path/to/project/.opencode/skills
rm -rf /path/to/project/.opencode/skills/ratatui
cp -a skills/ratatui /path/to/project/.opencode/skills/ratatui
```

### Global install

For a user-level install, replace the project directory above with the global path from the tables. For example, Codex:

```bash
mkdir -p ~/.agents/skills
rm -rf ~/.agents/skills/ratatui
cp -a skills/ratatui ~/.agents/skills/ratatui
```

Avoid maintaining multiple copies of the same skill in overlapping discovery directories for one agent unless you intentionally want to test precedence or overrides. Some clients load more than one source and resolve duplicate skill names using product-specific precedence rules.

## What "compatible" means

There are separate levels of compatibility:

1. **Format-compatible:** the directory contains the standard `SKILL.md` frontmatter and supporting files.
2. **Discovery-documented:** the agent's official documentation lists the installation path.
3. **Runtime-tested:** the skill has been installed in that product and verified to appear, trigger, load references, and run its scripts.

This repository uses the standard skill directory format and documents the official discovery paths linked below. The paths are not a claim that every listed client has been smoke-tested with this repository. Live discovery, trigger behavior, reference loading, and script execution still need product-by-product validation.

The skill's portable content is shared. Product-specific features, invocation controls, and context-loading behavior may differ.

## Official documentation

- [OpenAI Codex skill locations and configuration](https://learn.chatgpt.com/docs/build-skills) and [OpenAI's skill-based OSS maintenance workflow](https://developers.openai.com/blog/skills-agents-sdk)
- [Claude Code skills](https://code.claude.com/docs/en/skills)
- [Cursor Agent Skills](https://cursor.com/docs/skills)
- [Google Antigravity agent skills](https://antigravity.google/docs/skills)
- [OpenCode skills](https://opencode.ai/docs/skills/)
- [Agent Skills specification](https://agentskills.io/specification)
Loading
Loading