К основному содержанию
скилл CX Codex

terminal-screenshot — скилл для Claude Code: что делает и как ставить

Рендерит вывод консольных команд с ANSI-цветами в PNG-изображение. Это нужно, чтобы агент мог визуально оценить контрастность тем и подсветку синтаксиса в терминале.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add daymade/claude-code-skills --skill terminal-screenshot -a claude-code
Открыть на GitHub

Что делает terminal-screenshot

Claude получает вывод терминала как обычный текст с сырыми escape-последовательностями вроде \x1b[48;2;92;30;34m. Оценить читаемость подсветки по таким байтам невозможно: чтение шестнадцатеричных кодов превращается в угадывание. Скилл решает проблему в два шага: сначала сохраняет ANSI-поток в файл, а затем конвертирует его в PNG через утилиту freeze или скрипт ansi2html.py с безголовым Chrome.

Запускать команду сразу внутри рендера через freeze --execute нельзя. Утилиты вроде delta распознают дочерний pty и отключают фоновые блоки и колонки с номерами строк. Поэтому вывод сначала сохраняют в файл через флаг --color=always или переменную окружения CLICOLOR_FORCE=1.

Интерактивные TUI-программы вроде lazygit или htop этот инструмент не поддерживает из-за позиционирования курсора. Для утилиты freeze понадобится установка через charmbracelet/tap/freeze: стандартная команда brew install freeze поставит чужую GUI-программу.

Какие задачи решает

  • проверить контрастность добавленных и удалённых строк в delta
  • оценить читаемость синтаксической подсветки в bat
  • проконтролировать цветное оформление вывода ripgrep
  • настроить тёмную палитру терминала без ручных скриншотов

Примеры запросов агенту

  • Сделай terminal screenshot для git --no-pager diff | delta и проверь контрастность.
  • Сохрани вывод bat с номерами строк в PNG и оцени читаемость темы.

Как установить terminal-screenshot

1Через Skills CLI (Vercel)

npx skills add daymade/claude-code-skills --skill terminal-screenshot -a claude-code

2Вручную: положить файлы

~/.claude/skills/terminal-screenshot/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/terminal-screenshot/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора64

benchmark-due-diligence Проверяет надутый успех конкурента, отделяет маркетинг от реальных сигналов и переносит рабочий сценарий на ваши ресурсы. CX Codex +1 483установок bigdata-skill Выгружает структурированные финансовые данные и новости Bigdata.com (RavenPack) через SDK и REST API. Пригодится для построения датасетов, когда ответов MCP-сервера не хватает. CX Codex +1 473установок auto-repo-setup Диагностирует и починяет окружение репозитория, синхронизацию перед работой и хуки. Пригодится, когда проект не запускается или нужен безопасный commit. CX Codex +1 469установок pdf-to-html Превращает PDF в один самодостаточный HTML-файл с картинками, таблицами и порядком чтения. Пригодится, когда хочется читать отчёт с телефона, а не листать страницы. CX Codex +1 458установок claude-usage-analyst Скилл объясняет, куда ушли токены и деньги в Claude: собирает данные ccusage, показывает модель, кэш и пятичасовые блоки. CX Codex +1 403установок marketplace-health-check Прогоняет параллельный аудит репозитория скиллов: безопасность скриптов, документация, PII, открытые PR и issues, целостность манифеста. CX Codex +1 389установок llm-eval-harness Скилл гоняет чужой LLM-эндпоинт по шести измерениям: доступность, доходимость запроса, скорость, конкурентность, протокол и регрессия качества. CX Codex +1 372установок github-sensitive-data-cleanup Ищет и удаляет секреты, токены и приватные данные из истории Git, а затем безопасно пушит изменения в GitHub. Пригодится при случайной утечке ключей в публичный репозиторий. CX Codex +1 353установок

Похожие

terminal-ops affaan-m Скилл для работы с репозиторием через терминал: запускает команды, читает состояние git, разбирает падения CI и делает точечные правки с доказательством того, что проверено. CX Codex +1 4 500установок rattles-terminal-spinners reason-machines Скилл для работы с rattles — минимальной Rust-библиотекой терминальных спиннеров. Пригодится, когда в CLI нужен индикатор загрузки без лишних зависимостей. CX Codex +1 497установок monitoring-terminal-errors spencerpauly Скилл смотрит за выводом запущенного процесса — dev-сервера, тестов, сборки — и чинит падения по стек-трейсу. Пригодится, когда сервер сыпет ошибками, а вы не хотите читать лог вручную. CX Codex +1 449установок tui-validate mikeyobrien Скилл снимает скриншот терминального интерфейса через freeze и оценивает его по критериям с помощью LLM. Пригодится после правок в TUI, чтобы поймать сломанную вёрстку. CX Codex +1 ★ 3 186звёзд репо terminal-helper официальный github Субагент отвечает на вопросы по синтаксису оболочки и собирает команды под конкретный терминал. Пригодится, когда команда падает, а причина непонятна. ★ 40 418звёзд репо terminal-inserts Liamrjohnston Скилл для Remotion-анимаций: рисует вставки с терминалом в сдержанном стиле, без неона и свечения. Сначала спрашивает формат и фон. CX Codex +1 938установок

Рядом в теме «Настройка агента: память, контекст, субагенты»

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →

Вопросы о terminal-screenshot

Как установить terminal-screenshot в Claude Code?

Выполните команду npx skills add daymade/claude-code-skills --skill terminal-screenshot -a claude-code.

Что делает скилл terminal-screenshot?

Превращает консольный вывод с ANSI-кодами в PNG-картинку, позволяя модели увидеть подсветку и цвета терминала как человеку.

Почему нельзя ставить утилиту freeze через стандартный Homebrew?

Команда brew install freeze ставит постороннее GUI-приложение. Для консольного рендера нужен инструмент от Charmbracelet, доступный через brew install charmbracelet/tap/freeze или go install.

Исходный текст

SKILL.md · MIT
---
name: terminal-screenshot
description: >-
  MUST be used right after changing any CLI color config (delta/bat/themes/lazygit pager) — renders
  the terminal's colored output to a PNG so Claude can actually SEE contrast, alignment, and
  highlighting instead of raw ANSI codes. Use for delta git diff colors, bat syntax highlighting,
  starship prompt, eza/ls colors, or ripgrep matches. Trigger phrases: 看终端效果, 终端截图, 验证配色, terminal
  screenshot.
---

# Terminal Screenshot

Render the colored output of a terminal command into a PNG image, then read that
image to judge the result visually.

## Why this exists

When a command's output arrives as a tool result, Claude sees plain text plus raw
escape codes like `\x1b[48;2;92;30;34m` — not the rendered colors. That makes it
impossible to honestly answer "is the diff's add/remove contrast strong enough?"
or "did this theme come out too dark?". Reading hex values is guessing. This skill
turns the output into an image so the judgement is based on what a human would
actually see on screen.

## The method: capture, then render

Two separate steps. Keep them separate — that separation is the whole trick.

### Step 1 — Capture full-fidelity ANSI to a file

Most CLIs **drop or downgrade colors when they detect they're not writing to a
real terminal** (a pipe or a child process). Force full coloring and save to a
`.ansi` file. The exact flag depends on the tool — recipes below.

The single most important rule: **never let the renderer run the command for you.**
`freeze --execute "git diff | delta"` looks convenient but produces a *degraded*
result — delta (and lazygit, and anything that probes terminal capabilities) runs
inside freeze's child pty, detects a reduced environment, and silently drops its
background blocks, line-number column, and header box. Capture in a normal shell
first, render second.

### Step 2 — Render the ANSI file to PNG, then read it

Use the bundled wrapper, which prefers `freeze` and falls back to a stdlib
renderer + headless Chrome:

```bash
scripts/render_ansi.sh <input.ansi> <output.png> [background_hex]
```

Then read the PNG with the Read tool and judge the colors.

**Background color must match the real terminal**, or a dark theme verified on a
white page looks wrong. On macOS with Ghostty:

```bash
ghostty +show-config --default | grep '^background'   # e.g. 282c34 (the default)
```

Pass it as `#282c34`. If unknown, a dark terminal is usually near `#1d1f21`–`#282c34`.

## Capture recipes per tool

Pick a `--width` close to the real terminal (≈100–120) so wrapping matches.

| Tool | Capture command (writes full-color ANSI) |
|------|------------------------------------------|
| **delta** (git diff) | `git --no-pager diff \| delta --dark --line-numbers --width=110 > /tmp/x.ansi` |
| **git diff** (native) | `git -c color.ui=always --no-pager diff > /tmp/x.ansi` |
| **bat** | `bat --color=always --style=numbers <file> > /tmp/x.ansi` |
| **eza** | `eza -la --color=always --icons > /tmp/x.ansi` |
| **ls** (GNU) | `ls -la --color=always > /tmp/x.ansi` |
| **ls** (macOS/BSD) | `CLICOLOR_FORCE=1 ls -laG > /tmp/x.ansi` |
| **ripgrep** | `rg --color=always 'pattern' <path> > /tmp/x.ansi` |
| **anything else** | `CLICOLOR_FORCE=1 <cmd> > /tmp/x.ansi` or `<cmd> --color=always`, or wrap in a real pty: `script -q /dev/null <cmd>` |

Note `delta` always emits its configured colors even to a file, so the only trap
for delta is Step 1's rule (don't render it via `freeze --execute`).

### Full example: verify a delta color change

```bash
# after editing [delta] colors in gitconfig, in any repo with a diff:
git --no-pager diff | delta --dark --line-numbers --width=110 > /tmp/diff.ansi
scripts/render_ansi.sh /tmp/diff.ansi /tmp/diff.png "#282c34"
# then: Read /tmp/diff.png and judge whether add/remove contrast is clear
```

## TUI programs (lazygit, htop, top) — out of scope

Full-screen TUIs paint with cursor positioning, not a linear ANSI stream, so they
can't be captured this way. To check a TUI's *colors*, verify the underlying piece
in isolation — e.g. for lazygit's diff, render `git diff | delta` as above (lazygit
calls the same delta config). For a true TUI screenshot, run it in a real terminal
and capture the screen (a screencapture/computer-use task), not this skill.

## Installing freeze (the preferred renderer)

`freeze` is [charmbracelet/freeze](https://github.com/charmbracelet/freeze) — it
renders ANSI to PNG/SVG/WebP with faithful background blocks and nice chrome.

**Do not run `brew install freeze`** — that installs an unrelated GUI app of the
same name (a cask). The CLI lives in charmbracelet's tap or via `go install`:

```bash
# Option A — Homebrew tap (needs GitHub reachable)
brew install charmbracelet/tap/freeze

# Option B — go install (works behind a firewall via a Go module mirror)
GOPROXY=https://goproxy.cn,direct GOSUMDB=off \
  go install github.com/charmbracelet/freeze@latest
# binary lands in "$(go env GOPATH)/bin/freeze"
```

`GOSUMDB=off` is needed when the checksum database (`sum.golang.org`) is
unreachable and `go install` hangs on "verifying module ... 504".

If freeze can't be installed, the wrapper automatically falls back to the bundled
`scripts/ansi2html.py` (stdlib only) + headless Chrome — no extra dependency
beyond a Chrome install. The fallback uses a fixed window size; widen
`--window-size` in `render_ansi.sh` if output is clipped.

## Bundled scripts

- `scripts/render_ansi.sh` — render a captured `.ansi` file to PNG (freeze, else
  Chrome fallback). This is the entry point; call it after Step 1.
- `scripts/ansi2html.py` — stdlib ANSI→HTML converter used by the fallback path.
  Handles 24-bit truecolor, 256-color, bold, and resets, preserving background
  color blocks (the part naive renderers drop).

## Common pitfalls

- **Letting the renderer run the command** (`freeze --execute "delta …"`) →
  degraded output. Capture in a normal shell first, render the file second.
- **Non-TTY strips color** → force it (`--color=always` / `CLICOLOR_FORCE=1` /
  `script -q /dev/null`).
- **Wrong background color** → a dark CLI theme rendered on a white page misjudges
  contrast. Use the real terminal background.
- **Light/dark mismatch** → if the terminal is dark, the CLI's colors must be its
  dark variant. Verifying a `light=true` config against a dark terminal shows
  inverted, hard-to-read colors (and is itself the bug, not the renderer's fault).
- **`brew install freeze`** installs the wrong (GUI cask) tool — use the tap or
  `go install`.

© daymade · MIT · daymade/claude-code-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой