# Playground Snapshot Release

Publish a Playground UI snapshot (`@mastra/playground-ui`, `@mastra/observability`, and...

- Repository: https://github.com/mastra-ai/mastra (29259 stars)
- Category: Design
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mastra-ai/mastra --skill playground-snapshot-release -g -a claude-code -y`
Codex: `npx skills add mastra-ai/mastra --skill playground-snapshot-release -g -a codex -y`
Cursor: `npx skills add mastra-ai/mastra --skill playground-snapshot-release -g -a cursor -y`
Gemini CLI: `npx skills add mastra-ai/mastra --skill playground-snapshot-release -g -a gemini-cli -y`

## Description

Publish a Playground UI snapshot (`@mastra/playground-ui`, `@mastra/observability`, and their workspace dependencies) from `main` or the current branch via the `playground-snapshot` mode of the Publish to npm workflow, wait for it to finish, then open a PR on `mastra-ai/platform` bumping the frontend to the published snapshot version. Use when asked to release, publish, or ship a playground/studio UI snapshot to the platform frontend.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Playground Snapshot Release

Dispatches `.github/workflows/npm-publish.yml` with `publish_type=playground-snapshot`. That job publishes only `@mastra/playground-ui`, `@mastra/observability`, and their non-private workspace dependencies (currently `@mastra/ai-sdk`, `@mastra/client-js`, `@mastra/core`, `@mastra/schema-compat`, `@mastra/react`) at version `0.0.0-<tag>-<timestamp>`. It refuses to run on `main`, and publishes real immutable npm versions.

## 1. Ask which branch

Use `ask_user` with exactly this single-select question:

> Which branch should the workflow run on?

Options:

- `main`, publish from the latest `main` through a fresh branch
- `Current branch (<current-branch>)`, publish from the current branch (show the real name from `git branch --show-current`)

## 2. Prepare the branch

### If `main`

The workflow rejects `refs/heads/main`, so publish from a new branch created from up-to-date `origin/main`. Do not `git checkout main` or switch the current worktree's branch: `main` is usually checked out in another worktree (so checkout fails), and switching would disturb the user's current work. Instead, create a dedicated temporary worktree from `origin/main`:

```bash
git fetch origin main
branch="playground-snapshot/$(date +%Y%m%d-%H%M%S)"
snapshot_dir=$(mktemp -d)/mastra-snapshot
git worktree add -b "$branch" "$snapshot_dir" origin/main --no-track
git -C "$snapshot_dir" push -u origin "$branch"
```

Run every later git command for this branch with `git -C "$snapshot_dir"` (or from inside it). Once the workflow has been dispatched and the run found, remove the worktree with `git worktree remove "$snapshot_dir"` (the remote branch stays for the workflow).

### If current branch

```bash
branch=$(git branch --show-current)
```

The rest: https://github.com/mastra-ai/mastra/blob/HEAD/.mastracode/skills/playground-snapshot-release/SKILL.md
