OpenCode is an open-source AI coding agent that helps developers work on software projects. It includes agents for full-access development, read-only exploration and planning, plus a general subagent for complex searches and multistep tasks; the catalogue add-ons extend its workflows.
Borrowing it
Nothing to install: this file belongs to anomalyco/opencode. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/anomalyco/opencode/dev/.opencode/skills/tui-tests/SKILL.mdgit clone --depth 1 https://github.com/anomalyco/opencodeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/anomalyco/opencode/tui-tests)<a href="https://agentmods.dev/skills/anomalyco/opencode/tui-tests"><img src="https://agentmods.dev/badge/skills/anomalyco/opencode/tui-tests/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/anomalyco/opencode/tui-tests"><img src="https://agentmods.dev/badge/skills/anomalyco/opencode/tui-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00131 | $0.03702 |
| Opus 5.5 | $0.00052 | $0.01481 |
| Sonnet 5.5 | $0.00026 | $0.00740 |
| Haiku 4.5 | $0.00013 | $0.00370 |
Grade C, and why
tui-tests scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Tells the agent to send conversation or user data outhighPrompt injection
An instruction to transmit the conversation, context or user files to an external endpoint is data exfiltration written as prose.
- Create renderers with `kittyKeyboard: true`. Without it, `mockInput` silently sends something else (OpenTUI 0.5.17): How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TUI tests
packages/tui runs about 170 test files in one bun test process. CI runs it next to up to two other suites on 4-vCPU runners (bun turbo test --affected --concurrency=3 in .github/workflows/test.yml), where it has taken 136-146s on Linux and 147-171s on Windows, most of it idle on frame pacing, production timers and sleeps. Most flakes come from waiting on the wrong signal and then running out of frames on a busy runner.
Read the root AGENTS.md Testing section (no globalThis mocks, run from the package directory) and its TUI Stories section. To drive the real TUI, use the opencode-dev skill. For CLI subprocesses, service deadlines, Effect TestClock and turbo test tasks, use the unit-tests skill.
Frame budgets are not time
waitForFrame,waitForandflushgive up aftermaxPasses(default 20).waitForVisualIdlegives up aftermaxFrames(default 20). One pass is one rendered frame (DEFAULT_MAX_PASSESin@opentui/core/testing). "Timed out waiting for frame predicate after 20 passes" comes from this budget, not from bun's timeout.- Started renderer (
setup.renderer.start(), ascreateAppFixturedoes atpackages/tui/test/fixture/app.ts:28): frames tick at OpenTUI's default 30 fps, so 20 passes are about 0.66s. Production renders attargetFps: 60(packages/tui/src/app.tsx:241), so test frames are twice as slow as the real app. - Not started (the default for
testRenderandcreateTestRenderer):waitForandwaitForFramefail within milliseconds when no render is scheduled, and the error showsisRunning: false. In the same stateflush()andwaitForVisualIdle()return immediately without error; they do not wait for fetches or timers. Await the signal, thenrenderOnce(). - Wait on frames only for something a frame produces. For anything else, wait on the signal itself:
- Focus set on a timer.
DialogSelectfocuses its filter withsetTimeout(..., 1)(packages/tui/src/ui/dialog-select.tsx:702), which takes about 15ms on Windows.typeTextsends keys to whatever is focused, so early keys are dropped and Enter then picks the default option. Put the focus in the predicate, as both dialog waits inpackages/tui/test/command-selection.test.tsxdo (:68-70for the model,:75-80for the variant):setup.renderer.currentFocusedRenderable instanceof InputRenderable. Before the variant wait had it, the test flaked in 5 CI runs in 20 hours, including a dev push, and a bigger budget did not help: it still failed withmaxPasses: 150, because the keys were lost, not late. If a wait fails with the focus in the predicate, look for a state race, not the budget. - Markdown and code text.
<markdown>(packages/tui/src/routes/session/message-parts.tsx:182) draws no text until the shared tree-sitter worker replies, while frames keep ticking, so a plainwaitForFramecan spend all 20 passes on a loaded runner with the text still pending. UsewaitForHighlightedFrame(setup, predicate, options?)frompackages/tui/test/fixture/frame.ts. When the predicate fails, it awaits every in-flightCodeRenderable.highlightingDoneinside the frame predicate, and awaiting there does not use up passes. It accepts any setup withrendererandwaitForFrame; app-lifecycle, session-group-navigation and session-home wait on transcript text this way. If the code under test accepts a client, injectnew MockTreeSitterClient({ autoResolveTimeout: 0 })instead (packages/tui/test/mini/scrollback.surface.test.ts:87). - Requests and other state. Await the deferred response your fetch handler returns. With no signal to await, poll with a wall-clock deadline instead of raising
maxPasses: the file-localwaitForFrame(setup, matches)atcommand-selection.test.tsx:117checkscaptureCharFrame()every 10ms for up to 2s.waitinpackages/tui/test/cli/tui/data.test.tsx:37andwaitForModelinpackages/tui/test/fixture/local.tsx:109do the same for state.
- Focus set on a timer.
waitForVisualIdlereturns on the first frame withcellsUpdated === 0by default. A frame waiting on a highlight is also quiet, so wait for the text before you measure layout or assert on it:session-home.test.tsx:227waits for "History message 0001" withwaitForHighlightedFrameafterwaitForVisualIdle()instead of reading the frame directly.- Settle steps cost frames. Each
waitForVisualIdle({ quietFrames: 3 })takes at least 3 frames, about 100ms at 30 fps.session-group-navigation.test.tsxhas 14 of them. When you know what you are waiting for, wait for that frame instead. - Do not use
maxPassesas a clock. Several waits do, and each assumes 33ms frames:app-lifecycle.test.tsx:792: 120 passes to cover the 1s reconnect delay aftersetup.events.disconnect()at:784;app-lifecycle.test.tsx:1721-1723: 200 passes per retry-countdown second;component/dialog-shell-output.test.tsx:144: 100 passes for a 1s poll, plusBun.sleep(1100)at:163and:182;session-panel.test.tsx:590: 120 passes inready()for the initial load.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 83 lines · 131 tokens per session scan C a972296db48b
tui-tests is a skill published in the GitHub repository anomalyco/opencode (220,205 stars, last pushed today), licensed MIT. It adds 131 tokens to every session and 3,702 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it C with 1 finding (tells the agent to send conversation or user data out). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-16.
Other skills, from other repositories
research-engineer
An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.
tika-eval-compare
Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".
cua-driver
Use Cua Driver for desktop or browser tasks that are awkward or unavailable through Bash/APIs, or when the user explicitly wants GUI interaction: app testing, visual bug reproduction, form filling, calendar entry, screenshots, and demo recording. Also covers Cua setup; not OpenAI Codex Computer Use or web research.
jetson-validate-image
Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.
atmos-validation
Validate Atmos projects, components, arbitrary JSON Schema inputs, EditorConfig, and GitHub Actions; use affected-file selection and native CI annotations.
skill-benchmark
Benchmark AI skill effectiveness by measuring implementation quality against legacy constraints.