$npx -y skills add remotion-dev/remotion --skill vercelSet up a Codex monitor for Vercel deployments and preview URLs. Use when the user invokes /vercel or $vercel, asks Codex to watch or monitor a Vercel deployment, waits for a Vercel preview or PR preview to become ready, or wants to be notified with both the deployment URL and pre
| 1 | # Vercel Monitor |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Set up a short-lived Codex heartbeat that watches the `remotion` Vercel deployment and reports back in the current thread when it is ready or failed. Always include both the Vercel deployment/dashboard URL and the public preview URL in the final notification. |
| 6 | |
| 7 | ## Project Selection |
| 8 | |
| 9 | This repository has two Vercel deployments: `bugs` and `remotion`. The Vercel monitor skill always means the `remotion` deployment unless the user explicitly asks for another project. |
| 10 | |
| 11 | - Select checks, deployment URLs, preview URLs, and CLI results for the `remotion` project. |
| 12 | - Ignore the `bugs` deployment, even if it appears first or is newer. |
| 13 | - When output contains links for both projects, use surrounding check names, project names, or deployment metadata to associate the links with `remotion`. If necessary, inspect the candidates before creating a monitor. |
| 14 | - Do not ask the user which project they mean merely because both deployments exist; default to `remotion`. |
| 15 | |
| 16 | ## Workflow |
| 17 | |
| 18 | 1. Resolve the deployment to monitor. |
| 19 | 2. Check whether it is already ready. |
| 20 | 3. Create a heartbeat monitor if it is still building or queued. |
| 21 | 4. Tell the user what is being monitored and which links will be reported. |
| 22 | |
| 23 | ## Resolve Links |
| 24 | |
| 25 | Prefer sources in this order: |
| 26 | |
| 27 | 1. A Vercel deployment URL or preview URL explicitly provided by the user. |
| 28 | 2. URLs in the current terminal output or pasted logs. |
| 29 | 3. Vercel URLs from the active GitHub PR's `remotion` check or deployment status. Ignore the `bugs` check. |
| 30 | 4. Vercel CLI output for the `remotion` project, if the repository is linked and the user asked for the latest deployment. |
| 31 | |
| 32 | Use `scripts/extract-vercel-links.py` to normalize raw terminal, Vercel CLI, or GitHub output: |
| 33 | |
| 34 | ```bash |
| 35 | python3 .agents/skills/vercel/scripts/extract-vercel-links.py < deployment-output.txt |
| 36 | ``` |
| 37 | |
| 38 | If only one link is available, use `vercel inspect <url>` when authenticated to confirm that it belongs to the `remotion` project and discover the missing deployment or preview URL. If neither a deployment URL nor a preview URL can be found, ask the user for one concise piece of context: the Vercel URL, PR URL/number, or branch name. |
| 39 | |
| 40 | ## Check Status |
| 41 | |
| 42 | Prefer Vercel's deployment status over HTTP probing: |
| 43 | |
| 44 | ```bash |
| 45 | vercel inspect <deployment-or-preview-url> |
| 46 | ``` |
| 47 | |
| 48 | Treat these as terminal states: |
| 49 | |
| 50 | - `READY`: report success immediately; do not create a monitor. |
| 51 | - `ERROR`, `FAILED`, `CANCELED`, or `CANCELLED`: report failure immediately; do not create a monitor. |
| 52 | |
| 53 | Treat these as monitorable states: |
| 54 | |
| 55 | - `BUILDING`, `QUEUED`, `INITIALIZING`, or unknown but plausibly in progress. |
| 56 | |
| 57 | If Vercel CLI is unavailable or unauthenticated, probe the preview URL with `curl -I -L --max-time 20 <preview-url>`. HTTP 2xx or 3xx means the preview is ready. HTTP 401 or 403 can also mean the deployment is ready but protected; report it as ready/protected if the response is clearly from Vercel deployment protection. A Vercel `DEPLOYMENT_NOT_FOUND`, 404, timeout, or DNS failure means keep monitoring unless a terminal Vercel status says otherwise. |
| 58 | |
| 59 | ## Create The Monitor |
| 60 | |
| 61 | Use the Codex app automation tool. If `automation_update` is not already in the tool list, search for it with `tool_search` before creating the monitor. |
| 62 | |
| 63 | Create a `heartbeat`, not a cron, because the user wants this thread to be notified later. Use a one-minute cadence with a bounded count, usually 30 attempts unless the user asked for a different window. Do not show the raw RRULE string to the user. |
| 64 | |
| 65 | The heartbeat prompt must be self-contained. Include: |
| 66 | |
| 67 | - Deployment/dashboard URL, if known. |
| 68 | - Preview URL, if known. |
| 69 | - Branch, PR, project, or commit context, if known. |
| 70 | - Status command to prefer, normally `vercel inspect <url>`. |
| 71 | - HTTP fallback command for the preview URL. |
| 72 | - Ready criteria and failure criteria. |
| 73 | - Instruction to reply in the current thread only when ready or failed. |
| 74 | - Instruction to include both links in the notification. |
| 75 | - Instruction to delete or pause this heartbeat after reporting a terminal state, if the automation id is available. |
| 76 | |
| 77 | Example heartbeat prompt: |
| 78 | |
| 79 | ```text |
| 80 | Check this Vercel deployment until it reaches a terminal state. |
| 81 | |
| 82 | Deployment URL: <deployment-url-or-unknown> |
| 83 | Preview URL: <preview-url-or-unknown> |
| 84 | Context: <branch/pr/project/commit-or-unknown> |
| 85 | |
| 86 | Prefer `vercel inspect <deployment-or-preview-url>` if available and authenticated. If that is unavailable, use `curl -I -L --max-time 20 <preview-url>` and, if needed, fetch the response body to distinguish Vercel deployment protection from DEPLOYMENT_NOT_FOUND. |
| 87 | |
| 88 | Ready means Vercel status READY, or the preview URL returns HTTP 2xx/3xx, or it returns Vercel deployment-prote |