# Prevu Agent Skill

Use this skill when a coding agent needs to create, operate, or share a Prevu staging environment for human review.

## When to use this skill

Use this skill when a coding agent needs to turn code changes into a live, reviewable environment: web app previews, API service previews, UI regression checks, stakeholder review links, or long-running tasks where the workspace should survive between agent sessions. Do not use it for one-shot CI builds, production deployment, or destructive cleanup unless the human explicitly asks.

## What Prevu provides

Prevu is the staging and review layer for coding agents. It gives an external agent a persistent VM-backed Linux workspace, stable HTTPS preview URLs on `*.prevu.page`, SSH access, a dashboard at `app.prevu.cloud`, REST APIs, and an MCP server surface.

## Best workflow

1. Create or select an environment for the project.
2. Get the SSH command and connect to the VM.
3. Clone or sync the project into `/workspace`.
4. Install dependencies and start the app with the project's normal command.
5. Expose the app port with Prevu to receive a stable HTTPS preview URL.
6. Share the preview URL with the human reviewer.
7. Keep the environment paused when idle; destroy it only when explicitly requested.

## Important invariants

- Environments are persistent workspaces, not disposable CI jobs.
- Pause stops compute but keeps the disk and workspace.
- Destroy permanently deletes the VM and workspace and requires explicit confirmation.
- Dashboard domain: `https://app.prevu.cloud`.
- Preview domain: `https://<environment>-<port>.prevu.page`.
- API base URL: `https://app.prevu.cloud/api/v1`.
- OpenAPI document: `https://prevu.cloud/openapi.json`.
- MCP discovery: `https://prevu.cloud/.well-known/mcp`.

## Authentication

Use a Prevu personal access token as a bearer token:

```http
Authorization: Bearer <PREVU_API_TOKEN>
```

Agents should ask the human for a token or use the token already configured in their environment. Never print tokens in logs or preview pages.

## Core API actions

- `GET /me` — identify the authenticated user.
- `GET /quota` — inspect retained slots, concurrency, and storage quota.
- `GET /environments` — list environments.
- `POST /environments` — create an environment.
- `GET /environments/{slug}` — inspect one environment.
- `POST /environments/{slug}/pause` — pause compute and keep disk.
- `POST /environments/{slug}/resume` — resume compute.
- `DELETE /environments/{slug}` — destroy permanently; use only after explicit confirmation.
- `GET /environments/{slug}/ssh` — get SSH connection information.
- `GET /environments/{slug}/services` — list managed services.
- `POST /environments/{slug}/ports` — expose a port and return a public URL.

## MCP tools

The Prevu MCP server exposes tools for environment lifecycle, SSH commands, URLs, port exposure, and lightweight service management. Prefer MCP when available because tool names encode safe semantics such as `pause_environment` versus `destroy_environment`.
