Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Record Asciinema

ASecurity

Record a terminal/CLI demonstration with asciinema, render it to an embeddable GIF (or SVG), and return the asset path. Reusable recording primitive used by verify-pr and validate-implementation.

10 stars
0 votes
0 copies
0 views
Added 10/6/2026
toolsshellbashgit

Works with

terminalcli

Security Analysis

A100/100

Scanned 10/6/2026

$npx -y skills add tomzx/agents --skill record-asciinema --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Record Asciinema?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Record Asciinema
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tomzx-record-asciinema/badge)](https://www.skillsdirectory.com/skills/tomzx-record-asciinema)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: record-asciinema
description: Record a terminal/CLI demonstration with asciinema, render it to an embeddable GIF (or SVG), and return the asset path. Reusable recording primitive used by verify-pr and validate-implementation.
allowed-tools: Bash(asciinema:*, agg:*, asciicast2gif:*, svg-term:*, ~/.agents/scripts/get-env:*), Read, Write, Glob
argument-hint: "[<slug>] [-- <command...>]"
---

# Record CLI Demo (asciinema)

Record a terminal demonstration with `asciinema`, render the `.cast` to a GIF (or SVG fallback) so it can be embedded inline in a GitHub PR or comment, and return the path to the rendered asset.

This is the recording primitive for CLI changes. For web UI changes, use `/record-playwright`.

## Recording principle: show commands

Always display the commands being run in the recording so viewers can see what was executed and reproduce it. Hide commands only when it is appropriate for the purpose of the demo (e.g. focusing purely on output, or a polished marketing-style demo where the command is irrelevant). When in doubt, show the command.

## Prerequisites

- `asciinema` installed
- One of `agg`, `asciicast2gif`, or `svg-term-cli` installed (for rendering). `agg` is preferred (fastest, best quality).
- If none are installed, the skill still returns the raw `.cast` with playback instructions.

## Inputs

The skill is driven by the following inputs. Set them from context, or accept them from the command line.

| Input | Meaning | Default |
|-------|---------|---------|
| `$RECORD_SLUG` (`$1`) | Filename slug for the recording, e.g. `verbose-flag` | `demo` |
| `$RECORD_TITLE` | Human-readable title shown in the asciinema player | `CLI demo` |
| `$RECORD_DIR` | Output directory for `.cast` / `.gif` | `/tmp/record-asciinema` |
| `$RECORD_COMMAND` (`$2..`) | A single command to record non-interactively (single-shot demos) | *(none; interactive mode)* |

If `$RECORD_COMMAND` is provided, the demo runs that one command and exits. If not, the skill drops into an interactive asciinema shell where the agent types the relevant commands and exits.

## Workflow

```
Inputs resolved (slug, title, dir, command?)
          |
          v
asciinema available?
   /            \
 Yes             No
  |               |
  v               v
Record .cast   Return nothing,
               caller falls back to text
  |
  v
Render to GIF (agg -> asciicast2gif -> svg-term)
   |
   v
Return rendered asset path (+ raw .cast)
```

## Steps

### 1. Resolve inputs

```bash
RECORD_SLUG="${1:-demo}"
RECORD_DIR="${RECORD_DIR:-/tmp/record-asciinema}"
RECORD_TITLE="${RECORD_TITLE:-CLI demo}"
mkdir -p "$RECORD_DIR"
```

If `$2` onward forms a command (i.e. the caller passed `-- <command...>` or a bare command string), capture it into `RECORD_COMMAND`.

### 2. Verify asciinema is available

```bash
command -v asciinema >/dev/null 2>&1 || { echo "asciinema not installed"; exit 0; }
```

If absent, stop and signal the caller to fall back to capturing stdout/stderr as text. Do not error out.

### 3. Record the demonstration

For a single-shot command, echo the command first so it appears in the recording (see the recording principle above). Omit the echo only when hiding the command is appropriate for the demo:

```bash
asciinema rec "$RECORD_DIR/${RECORD_SLUG}.cast" \
  --overwrite \
  --command="echo '$ $RECORD_COMMAND' && $RECORD_COMMAND" \
  --title="$RECORD_TITLE"
```

For a multi-step interactive demo, commands are visible by default since they are typed into the shell. Keep them visible unless hiding is appropriate for the demo:

```bash
asciinema rec "$RECORD_DIR/${RECORD_SLUG}.cast" \
  --overwrite \
  --title="$RECORD_TITLE"
# Run the relevant CLI commands inside the recorder.
# Type `exit` or Ctrl-D when done.
```

### 4. Verify the recording matches the intent

```bash
asciinema cat "$RECORD_DIR/${RECORD_SLUG}.cast"
```

Confirm the captured output demonstrates the claim. If it is empty or wrong, re-record with `--overwrite`.

### 5. Render to an embeddable asset

Try renderers in quality order. Stop at the first that succeeds.

```bash
CAST="$RECORD_DIR/${RECORD_SLUG}.cast"

if command -v agg >/dev/null 2>&1; then
  agg "$CAST" "$RECORD_DIR/${RECORD_SLUG}.gif"

elif command -v asciicast2gif >/dev/null 2>&1; then
  asciicast2gif "$CAST" "$RECORD_DIR/${RECORD_SLUG}.gif"

elif command -v svg-term >/dev/null 2>&1; then
  svg-term --in "$CAST" --out "$RECORD_DIR/${RECORD_SLUG}.svg" --window
fi
```

### 6. Return the asset

Report the path to the rendered asset so the caller can upload and embed it:

- GIF: `$RECORD_DIR/${RECORD_SLUG}.gif`
- SVG: `$RECORD_DIR/${RECORD_SLUG}.svg`
- Neither renderer available: `$RECORD_DIR/${RECORD_SLUG}.cast` (raw), with a note to upload the `.cast` and link the asciinema player.

## Failure Modes

| Mode | Response |
|------|----------|
| **asciinema not installed** | Stop cleanly; signal caller to capture stdout/stderr as text |
| **Recording is empty/wrong** | Re-record with `--overwrite` after fixing the command |
| **No renderer installed** | Return the raw `.cast` path; caller uploads it with playback instructions |
| **Render fails** | Keep the `.cast`, report the renderer error, return the `.cast` path |

## Example Usage

**Scenario 1: Single-shot demo (called by verify-pr)**
```
/record-asciinema verbose-flag -- my-tool --verbose
```
Records `my-tool --verbose`, renders `verbose-flag.gif`, returns its path for upload to the PR branch.

**Scenario 2: Interactive multi-step demo**
```
/record-asciinema export-flow
```
Opens an asciinema shell; the agent runs `my-tool export --format csv` then `cat output.csv`, exits, and renders `export-flow.gif`.

**Scenario 3: Renderer missing**
```
/record-asciinema help-text -- my-tool --help
```
`agg`/`asciicast2gif`/`svg-term` all absent. Returns `help-text.cast`; the caller uploads the raw cast and links `https://asciinema.org` playback.

Attribution

tomzxtomzx
View sourceSee grades on GitHubMore from tomzx →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

ucoz-landing-skill

Create and edit uCoz homepage landing pages via MCP: custom templates, hero sections, lead forms, navigation menus, SEO, and responsive layout. Includes a visual design system (style selection, layout/grid, section recipes, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, social proof, copy/voice, accessibility). Uses ucoz-mcp tools for templates, site file uploads, and site modules.

107 votes

Paperclip

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953191 votes

Pptx

Presentation toolkit (.pptx). Create/edit slides, layouts, content, speaker notes, comments, for programmatic presentation creation and modification.

471861 votes

Daw Music

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

761 votes

Instantly Rdsthomas Mission Control

Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.

761 votes
View all in tools →