Agent skill · langchain-ai

textual-screenshot

Capture a Textual terminal UI as an SVG using its headless test harness. Use when asked to make, attach, or preview a screenshot of deepagents-code/dcode or another Textual app, visually verify a TUI state, or render a modal, screen, or widget without a desktop or browser.

What it needs

About 2k tokens when loaded.

What this skill does

Textual Screenshot Render the real app with Textual's headless test harness, drive it to the requested state, and save the composed terminal as SVG. Prefer this over browser automation or OS-level screenshot tools. Capture workflow 1. Identify the App class and the shortest trusted local setup that reaches the requested UI. 2. Write a temporary Python script outside the repository. Keep generated screenshots outside the repository unless the user explicitly requests a committed artifact. 3. Start the app with a deterministic terminal size using app.runtest(size=(columns, rows)). 4. Call await pilot.pause() after startup and after every action that changes visible state. Use pilot.press(...) for a realistic interaction path when practical; direct app methods are acceptable for a focused preview. 5. Call app.savescreenshot(outputpath) while the desired state is visible. Use an .svg path. 6. Inspect the resulting SVG and confirm its file size is reasonable before sharing it. 7. Delete temporary scripts and captures when they are no longer needed. Minimal deepagents-code example: Run from libs/code so the project environment and editable package resolve: Adapt only the app constructor and action that opens the target state. For a standalone Textual app, import its App subclass and use the same runtest/savescreenshot sequence. Reliability and safety Use trusted local application code only. A headless app can still run startup hooks, subprocesses, or network calls. For DeepAgentsApp, set DEEPAGENTSHOME to a temporary directory before importing deepagentscode, and mock postpaintinit before mounting; replacing only the agent does not isolate startup side effects. Never capture secrets, credentials, private conversation content, or unrelated user data. Seed only synthetic content needed for the preview. Choose a bounded terminal size; start with (110, 36) and adjust only when the target clips or wastes substantial space. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills langchain-ai/textual-screenshot

View the source on GitHub

Browse the @skills marketplace