# Preview

> Preview is an open-source agent skill for developer tools. Captures screenshots of SwiftUI #Preview blocks so the agent can see the view. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/k-kohey/axe/tree/main/claude-plugin/skills/preview
- **Repository:** https://github.com/k-kohey/axe
- **GitHub stars:** 102
- **License:** MIT
- **Skill name:** preview
- **Collection:** https://github.com/k-kohey/axe
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill drives the axe command line tool to render a SwiftUI View's #Preview block and save it as a PNG. The agent resolves a view name to its Swift file, runs the report subcommand, which waits for rendering and retries on failure, and then opens the resulting image to describe the layout to the user.

For files with several #Preview blocks, the skill can save one image per preview into a directory, or fall back to the oneshot mode with a title or index selector. The oneshot mode captures right after the app reports ready, so it can produce blank images for slow-rendering views.

The skill expects the axe CLI and idb_companion to be installed, and a project configuration (.axerc or a --scheme flag) for building. It includes a one-line install command for when axe is missing. Screenshots reflect the files saved on disk, so unsaved edits will not appear.

## When your agent uses it

> Capture a SwiftUI preview screenshot using axe CLI. Use when the user wants to see the current appearance of a SwiftUI View, check layout, or verify changes visually.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/k-kohey/axe/tree/HEAD/claude-plugin/skills/preview)
- [Asks for: Bash(axe *), Bash(cat *), Read](https://github.com/k-kohey/axe/blob/HEAD/claude-plugin/skills/preview/SKILL.md)
- [License: MIT](https://github.com/k-kohey/axe/tree/HEAD/claude-plugin/skills/preview)

## Features

- **Preview screenshot capture:** Renders a SwiftUI #Preview block to a PNG image using the axe CLI.
- **Rendering wait and retries:** The report mode waits for rendering to finish and retries on failure, with an adjustable delay.
- **Multiple preview selection:** Selects a specific preview by title or index, or saves every preview in a file to a directory.
- **Build artifact reuse:** Can skip the Xcode build and reuse artifacts when capturing several previews in a row.
- **Error log reporting:** Reads the error log when a capture fails and reports likely causes to the user.

## Good for

- Show me how the ProfileView looks right now
- Check whether my new login layout renders correctly
- Capture every preview in OnboardingView.swift
- Verify visually that my button style change worked

## Install

### Claude Code

This skill ships in the `axe-preview` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add k-kohey/axe
/plugin install axe-preview@axe
```

Or copy only this skill to `~/.claude/skills/preview`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k-kohey/axe.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/preview &&
cp -R "$tmp/claude-plugin/skills/preview" ~/.claude/skills/preview &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/preview` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/preview` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k-kohey/axe.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/preview &&
cp -R "$tmp/claude-plugin/skills/preview" ~/.agents/skills/preview &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/preview` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/preview` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k-kohey/axe.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/preview &&
cp -R "$tmp/claude-plugin/skills/preview" ~/.cursor/skills/preview &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/preview` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/k-kohey/axe.git --path claude-plugin/skills/preview
```

Or copy the folder to `~/.gemini/skills/preview` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/preview`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k-kohey/axe.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/preview &&
cp -R "$tmp/claude-plugin/skills/preview" ~/.copilot/skills/preview &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/preview` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/k-kohey/axe.git
```

Then copy `axe/claude-plugin/skills/preview` into your agent's skills folder as `preview`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It needs the axe CLI and idb_companion installed, plus a .axerc file or a --scheme option. If axe is missing, the skill gives a curl install command.

### Does Preview change my source code?

No. It captures a screenshot of the current files on disk and removes generated screenshot and log files once they are no longer needed.

### Why might a screenshot come out blank?

Oneshot mode captures as soon as the app signals readiness with no rendering delay, so slow views can appear blank. The report mode is preferred for this reason.

### Can it capture a specific preview in a file with several?

Yes, through the oneshot mode with the --preview option, which takes a title or index.

### How do I install Preview in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/preview to use it in all your projects, or to .claude/skills/preview in one project. Or install the axe-preview plugin, which includes it: /plugin marketplace add k-kohey/axe, then /plugin install axe-preview@axe.

### Does Preview run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Preview?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Preview?

The closest alternatives to Preview are Preview report, UI review, Fix UI, Build and verify and Inspect view.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Preview report](https://ai-powered.com/skills/preview-report): Preview report is an open-source agent skill for developer tools.
- [UI review](https://ai-powered.com/skills/ui-review): UI review is an open-source agent skill for developer tools.
- [Fix UI](https://ai-powered.com/skills/fix-ui): Fix UI is an open-source agent skill for developer tools.
- [Build and verify](https://ai-powered.com/skills/build-and-verify): Build and verify is an open-source agent skill for developer tools.
- [Inspect view](https://ai-powered.com/skills/inspect-view): Inspect view is an open-source agent skill for developer tools.
- [Build swiftui interface](https://ai-powered.com/skills/build-swiftui-interface): Build swiftui interface is an open-source agent skill for developer tools.
- [New mac app](https://ai-powered.com/skills/new-mac-app): New mac app is an open-source agent skill for developer tools.
- [Clone](https://ai-powered.com/skills/clone-daveebbelaar): Clone is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/preview
