Official agent skill

Before And After

by sanity-io in sanity-io/sanity

Add existing screenshots or screen recordings to a GitHub pull request as a before/after or preview block.

OfficialMITAuto-check passedProductivity & Automation

Install Before And After

skills CLI
$ npx skills add sanity-io/sanity --skill before-and-after -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sanity-io/sanity before-and-after --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sanity-io/sanity.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/before-and-after .claude/skills/before-and-after && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
before-and-after
GitHub stars
6.4k
Used in
1 other repo
Token cost
~2.1k tokens
SKILL.md length
977 words
Files
2 (incl. scripts)
Skills in repo
34
Repo updated
First seen
Licence
MIT

At a glance

Add existing screenshots or screen recordings to a GitHub pull request as a before/after or preview block.

  • Works in 3 steps: Load the version-matched core… → If a Vercel URL is protected, load… → Save media under the repository with…
  • A PR needs visual media attached to its description
  • SKILL.md covers Capture, Format, Place the evidence and Publish, plus 1 more section
  • Runs JavaScript scripts from its folder; calls gh and node; reaches github.com

What it does

Before And After is an agent skill from sanity-io/sanity, published by the product's own GitHub organization. Add existing screenshots or screen recordings to a GitHub pull request as a before/after or preview block. Use when a PR needs visual media attached to its description. Browser navigation and capture belong to agent-browser.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts.

It sits in Productivity & Automation, covering Browser automation. It works with GitHub and Vercel. The repository describes itself as: Sanity Studio – Rapidly configure content workspaces powered by structured content. The licence is MIT.

When your agent uses it

  • A PR needs visual media attached to its description
  • Tasks that involve Browser automation

Example prompts

  • “/before-and-after”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Load the version-matched core instructions with agent-browser skills get core --full and follow them for sessions, navigation, page state…
  2. If a Vercel URL is protected, load agent-browser skills get protected-vercel-deployments --full. Do not reproduce its authentication…
  3. Save media under the repository with paths that contain no whitespace, for example

What it can do on your machine

Read from SKILL.md and the folder at commit efa15fb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • gh
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Before And After loads about 2.1k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 977 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from sanity-io/sanity at commit efa15fb, republished under its MIT licence (© sanity-io). 977 words, ~2,075 tokens.

Download SKILL.mdSave it as .claude/skills/before-and-after/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
before-and-after
description
Add existing screenshots or screen recordings to a GitHub pull request as a before/after or preview block. Use when a PR needs visual media attached to its description. Browser navigation and capture belong to agent-browser.

Add visual media to a PR

Use agent-browser to create the screenshots or recordings. This skill only owns the GitHub PR attachment workflow.

Capture

  1. Load the version-matched core instructions with agent-browser skills get core --full and follow them for sessions, navigation, page state, screenshots, and recordings.

  2. If a Vercel URL is protected, load agent-browser skills get protected-vercel-deployments --full. Do not reproduce its authentication workflow here.

  3. Save media under the repository with paths that contain no whitespace, for example:

    text
    captures/desktop-before.png
    captures/desktop-after.png
    captures/mobile-before.png
    captures/mobile-after.png

The formatter supports PNG, JPEG, GIF, WebP, MP4, MOV, and WebM files. Use an --after file without a matching --before file for a net-new preview.

Screen recordings

agent-browser record start creates a fresh browser context. It preserves cookies and local storage, but an origin-scoped header used to open a protected Vercel Preview may not carry into that new context. Before recording a protected Preview:

  1. Load agent-browser skills get protected-vercel-deployments --full.
  2. Start the recording context on a blank page.
  3. Apply the authentication method from that skill inside the recording context.
  4. Navigate to the Preview only after authentication is active, then trim the navigation lead-in if necessary.

Do not assume that a page which worked before record start will remain authenticated after it.

Agent-browser 0.35.2 and 0.36.0 capture at a hardcoded 10 fps with no CLI or environment override. Inspect the installed version and its recording reference rather than assuming this stays true in later releases. Preserve the source cadence when transcoding: changing the container to 30 or 60 fps only duplicates frames and does not make motion smoother. For animation evidence that requires a higher real frame rate, use a genuinely higher-cadence capture path instead of upsampling agent-browser output.

Equal-height image pairs

GitHub vertically centers a shorter image inside a Markdown table cell. For full-page before/after screenshots, make both files the same pixel height so their top edges align:

  1. Open both pages at the same viewport and state.
  2. Read document.documentElement.scrollHeight in both sessions.
  3. Append bottom-only space to the shorter page until both scroll heights match, then take both --full screenshots.

The padding may be transparent or use the capture tool's default canvas. Never add space above the page. For component or section comparisons, capture the same scoped region instead of padding unrelated page content.

Use raw agent-browser eval for this DOM-only adjustment; do not add an image-processing dependency to this skill. Confirm the resulting files have equal pixel dimensions before publishing.

Format

Pass one --before and --after pair for each comparison. Repeat --label to identify multiple pairs:

bash
node skill/scripts/format.mjs \
  --before captures/desktop-before.png \
  --after captures/desktop-after.png \
  --before captures/mobile-before.png \
  --after captures/mobile-after.png \
  --label Desktop \
  --label Mobile \
  > /tmp/before-and-after.md

For an after-only preview:

bash
node skill/scripts/format.mjs \
  --after captures/new-page.png \
  > /tmp/before-and-after.md

Add --attribution "<name>" to prefix the block with a > Before/after by <name> line when the PR should credit who produced the evidence.

Images render in tables. Local videos initially render on their own lines so gh --attach can upload them and expose their final attachment URLs. Before/after video tables use the two-step workflow below because gh --attach does not rewrite local references inside <video src> attributes.

Place the evidence

Read the existing PR description before inserting a new marked block. Put visual evidence near the top, after the short opening context and an existing Preview or deployment-link section when present, but before implementation-heavy sections such as Details, Changes, Testing, or Notes.

Use this reading order inside the visual evidence:

  1. Put the real before/after or Preview evidence that proves the PR first.
  2. Put supplemental formats, alternate states, or demonstrations after the primary evidence.
  3. Label anything that demonstrates this skill rather than the PR itself as a demo, and state material limitations beside it. For example, note the installed agent-browser recorder's current 10 fps limit when motion smoothness matters.

Headings are semantic hints, not required names. Never invent or rewrite prose merely to create an anchor, and never split a paragraph, list, table, code block, or other Markdown structure. If no safe anchor is clear, append the block rather than risking damage. If a marked block already exists, move or replace that whole block only; preserve every byte of unrelated prose.

After publishing, open the rendered PR and confirm the primary evidence appears before supplemental demos and before the implementation details.

Show full SKILL.md (307 more words)Show less

Publish

Preserve the existing PR description and replace only this skill's marked block:

bash
PR=123
gh pr view "$PR" --json body --jq .body > /tmp/pr-body.md

node skill/scripts/format.mjs \
  --body-file /tmp/pr-body.md \
  --before captures/desktop-before.png \
  --after captures/desktop-after.png \
  > /tmp/pr-body-next.md

ATTACH_ARGS=()
while IFS= read -r file; do
  ATTACH_ARGS+=(--attach "$file")
done < <(
  node skill/scripts/format.mjs \
    --attach-list \
    --before captures/desktop-before.png \
    --after captures/desktop-after.png
)

gh pr edit "$PR" --body-file /tmp/pr-body-next.md "${ATTACH_ARGS[@]}"

Run the formatter and gh from the same directory. gh --attach uploads the local files to GitHub and rewrites their matching local references in the PR body.

After publishing, fetch or open the PR description and confirm that no ./captures/... references remain inside the marked block and that the evidence appears in the intended reading order.

Publish a video table

Video comparisons are a first-class two-step publish operation:

  1. Upload the local videos in a temporary PR comment using the normal own-line output and gh pr comment --attach.

  2. Fetch that comment through gh api and collect the stable https://github.com/user-attachments/assets/... URLs in before/after order.

  3. Generate the final HTML table from those URLs and replace the marked PR block:

    bash
    node skill/scripts/format.mjs \
      --body-file /tmp/pr-body.md \
      --before-video-url https://github.com/user-attachments/assets/BEFORE_ID \
      --after-video-url https://github.com/user-attachments/assets/AFTER_ID \
      --label "Desktop hero" \
      > /tmp/pr-body-next.md
    
    gh pr edit "$PR" --body-file /tmp/pr-body-next.md
  4. Fetch the edited PR body before deleting the temporary comment. Confirm both final URLs are present and no local video paths remain, then delete the comment.

  5. Open the rendered PR and confirm both <video> elements are inside the comparison table, reach a playable ready state, and show controls.

If URL extraction, formatting, or PR verification fails, keep the temporary comment so its uploaded attachments remain recoverable and retry from the last successful phase. Use own-line videos as the simple fallback.

Do not publish captures containing Vercel OIDC tokens, bypass secrets, authenticated query parameters, or browser state files.

Script contract

scripts/format.mjs is intentionally the only bundled script. It:

  • formats existing local media;
  • formats final GitHub video attachment URLs as HTML comparison tables;
  • labels after-only media as Preview;
  • emits the exact attachment path list;
  • inserts or replaces <!-- before-and-after:start/end --> without changing other PR prose.

Its arguments version with this skill and are not a public library API.

© sanity-io, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in .agents/skills/before-and-after of sanity-io/sanity.

  • SKILL.md
  • scripts/format.mjs

Open the folder on GitHubat commit efa15fb

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in sanity-io/sanity, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Before And After next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Before And After compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Before And After this skillsanity-io/sanity6.4k1 repos~2.1kAutomated safety check: PassMIT
Agent Browser CLIvercel-labs/agent-browser44k24 repos~864Automated safety check: PassApache-2.0
Browserwingbrowserwing/browserwing1.4k—~1.8kAutomated safety check: PassMIT
Openclaw Rpalaziobird/openclaw-rpa229—~2.4kAutomated safety check: PassApache-2.0
Unicliolo-dot-io/Uni-CLI274—~3.8kAutomated safety check: NotesApache-2.0
Chrome Relayaindeev/agent-chrome-relay249—~669Automated safety check: PassMIT

Similar skills

  • Agent Browser CLI

    vercel-labs/agent-browser

    Official

    Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking…

    44k GitHub starsUsed in 24 repos~864 tokens
    Productivity & AutomationAuto-check passed
  • Browserwing

    browserwing/browserwing

    Browser automation platform with 78 built-in scripts and full CLI.

    1.4k GitHub stars~1.8k tokensUpdated 2 mo ago
    Productivity & AutomationAuto-check passed
  • Openclaw Rpa

    laziobird/openclaw-rpa

    Record browser, Excel, Word & API actions once — replay without the LLM: faster, cheaper, no hallucinations.

    229 GitHub stars~2.4k tokensUpdated 5 mo ago
    Productivity & AutomationAuto-check passed
  • Unicli

    olo-dot-io/Uni-CLI

    Comprehensive guide to Uni-CLI — the open Agent-Computer Interface runtime for real software.

    274 GitHub stars~3.8k tokensUpdated today
    Productivity & AutomationAuto-check: notes
  • Chrome Relay

    aindeev/agent-chrome-relay

    Use the person's own signed-in Chrome from the command line, in background tabs, through Chrome Relay.

    249 GitHub stars~669 tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Vercel Sandbox Browser

    vercel-labs/agent-browser

    Official

    Runs agent-browser with headless Chrome inside Vercel Sandbox microVMs so Vercel-deployed apps can automate a browser without binary size limits.

    44k GitHub stars~2k tokensUpdated today
    Productivity & AutomationAuto-check passed

More from sanity-io/sanity

All 34 skills in this repo
  • Playwright CLI

    sanity-io/sanity

    Official

    Automates browser interactions for web testing, form filling, screenshots, and data extraction.

    6.4k GitHub starsUsed in 18 repos~1.9k tokens
    Auto-check passed
  • Find Skills

    sanity-io/sanity

    Official

    Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities.

    6.4k GitHub starsUsed in 67 repos~1.2k tokens
    Auto-check passed
  • Official

    React and Next.js performance optimization guidelines from Vercel Engineering.

    6.4k GitHub starsUsed in 129 repos~1.6k tokens
    Auto-check passed
  • React Devtools

    sanity-io/sanity

    Official

    React DevTools CLI for AI agents. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 3 repos~2.1k tokens
    Auto-check passed
  • TDD

    sanity-io/sanity

    Official

    Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 20 repos~1k tokens
    Auto-check passed
  • Official

    Measures @sanity/ui v5 side-by-side migration progress — per-component import file counts (v5 alias vs @sanity/ui), JSX instance counts, and styled() instance counts with alias resolution.

    6.4k GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Before And After

What does Before And After do?

Add existing screenshots or screen recordings to a GitHub pull request as a before/after or preview block. Before And After is an agent skill from sanity-io/sanity, published by the product's own GitHub organization. Add existing screenshots or screen recordings to a GitHub pull request as a before/after or preview block.

When should I use Before And After?

Before And After fits situations like: A PR needs visual media attached to its description; tasks that involve Browser automation.

How do I install Before And After in Claude Code?

Run `npx skills add sanity-io/sanity --skill before-and-after -a claude-code`. Or copy the skill folder (.agents/skills/before-and-after in sanity-io/sanity) into .claude/skills/before-and-after in your project. Claude Code loads it when a task matches its description.

How do I install Before And After in Codex?

Run `npx skills add sanity-io/sanity --skill before-and-after -a codex`. Or copy the skill folder (.agents/skills/before-and-after in sanity-io/sanity) into .agents/skills/before-and-after in your project. Codex loads it when a task matches its description.

Can I use Before And After in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sanity-io/sanity --skill before-and-after -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/before-and-after, .gemini/skills/before-and-after, .github/skills/before-and-after and .opencode/skills/before-and-after in your project.

What does Before And After need to run?

Going by SKILL.md and its folder, Before And After needs JavaScript for the scripts in its folder and the command-line tools its instructions call (gh and node). Our summary lists: Node.js.

Does Before And After access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Before And After safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Before And After use?

Before And After is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Before And After use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Before And After?

Skills that share tags, products or a category with Before And After: Agent Browser CLI (vercel-labs/agent-browser, 44k stars), Browserwing (browserwing/browserwing, 1.4k stars), Openclaw Rpa (laziobird/openclaw-rpa, 229 stars) and Unicli (olo-dot-io/Uni-CLI, 274 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Before And After?

sanity-io (a GitHub organization, an official publisher) maintains it in sanity-io/sanity, which has 6,352 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on October 9, 2026.

Source: sanity-io/sanity on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.