Spot failed Vercel deployments and the build error behind each one

Three times a day: Vercel production and preview deployments that failed in the last 24 hours, the step and error line, and an ask on whether to redeploy.

Runs
Weekdays at 9:00, 13:00 and 17:00
Uses
Vercel
Posts
Asks you

What lands on your board

acme-webVercel failed deployments alert · Claude Code

Production build failed on a type error

It is a type error, so a plain redeploy will fail again. Open the log, or redeploy anyway?

The 14:05 production build of main (a41c9e2) failed in next build. Production still serves the 11:20 deployment. Two preview failures were fixed by later pushes.

14:06Running "next build"14:07./app/settings/page.tsx:42:714:07Type error: Property 'plan' does not exist on type 'Org'.14:07Error: Command "next build" exited with 1
DeploymentTargetBranchStatus
acme-web 14:05ProductionmainFailing
acme-web 10:42Previewfeat/org-plansFixed at 11:03
acme-docs 09:15Previewdocs/ssoFixed at 09:31
Resolve
An example with made-up numbers. Your agent posts your real ones.

What it does

Vercel keeps serving the last good deployment when a build fails. That is right for your visitors, and it is also why a broken production build can sit unnoticed until someone asks why their fix is not live.

The agent lists deployments in the ERROR state, reads each build log to find the line that actually failed, and separates production from preview. Preview failures fixed by a later push are reported as fixed. For a production failure it asks you directly whether a redeploy would help or whether to read the log first.

How it works

  1. 1List failed deployments

    GET /v7/deployments?state=ERROR&since=<ms, 24 hours ago>&limit=50&teamId=<team>, once with target=production and once with target=preview. Keep uid, name, url, created, creator.username, and the branch and commit from meta.githubCommitRef and meta.githubCommitSha (GitLab and Bitbucket use the matching gitlab* and bitbucket* keys).

  2. 2Find the error

    GET /v3/deployments/{id}/events returns the build log; take the first stderr line that reads as an error, plus the lines just before it. GET /v13/deployments/{id} adds errorCode and errorMessage for failures outside the build, such as an invalid vercel.json. From the CLI: vercel inspect <url> --logs.

  3. 3Check whether it is still broken

    Read the newest deployment for the same project and branch (projectId and branch on the list call). If it is READY, mark the failure as fixed by a later push.

  4. 4

    4Ask before redeploying

    For a production failure that is still failing, say whether a redeploy is likely to help (a transient install or network error) or not (a code error), then ask. Never redeploy on your own; run vercel redeploy <url> only after a yes.

  5. Post it to the board

    With BRIEFKIN_TOKEN set, the agent sends the result as one card that updates in place every run. Without it, you get the report in the chat.

What you get

  • Failed deployments in the last 24 hours, production first.
  • For each: project, branch, commit, who pushed it, the failing command and the error line.
  • Still failing or fixed by a later deploy.
  • For production: which deployment is live now, and the ask to redeploy, read the log or leave it.

Install and run it

Pick your agent, where the data comes from and how to schedule it; the commands below follow.

Agent
Data
Schedule
  1. Install the skill

    One command. It puts the SKILL.md in ~/.claude/skills and in ~/.agents/skills, which Codex, Cursor, Gemini CLI, Copilot CLI and OpenCode read too.

    shellcurl -fsSL https://briefkin.dev/skills/vercel-failed-deployments/install | sh
  2. Run it

    Ask Claude Code:

    promptRun the vercel-failed-deployments skill

    Or paste the prompt instead of installing:

    promptUsing the Vercel REST API (GET /v7/deployments with state=ERROR, for target=production and target=preview, over the last 24 hours) or the Vercel MCP server, list failed deployments for my team. For each, read the build log (GET /v3/deployments/{id}/events or vercel inspect <url> --logs) and give the project, branch, commit, author, the failing command and the first real error line. Check whether a later deployment of the same branch succeeded. For any production failure that is still failing, tell me which deployment is live and whether a redeploy is likely to help (transient error) or not (code error), and ask me before redeploying anything.
  3. Put it on a schedule

    Weekdays at 9:00, 13:00 and 17:00, from cron on any machine where Claude Code is signed in:

    crontab0 9,13,17 * * 1-5 claude -p "Run the vercel-failed-deployments skill"

    Add it with crontab -e. A laptop asleep at that time runs it when it wakes if you use launchd or Task Scheduler instead; GitHub Actions works for the API route.

  4. Send it to your board

    Connect Briefkin once with curl -fsSL https://briefkin.dev/install | sh and every run lands on your board as a question for you. How setup works

View the SKILL.mdRaw file
SKILL.md---
name: vercel-failed-deployments
description: "Three times a day: Vercel production and preview deployments that failed in the last 24 hours, the step and error line, and an ask on whether to redeploy. Use when the user asks for this, or when it runs on a schedule."
---

# Vercel failed deployments alert

Three times a day: Vercel production and preview deployments that failed in the last 24 hours, the step and error line, and an ask on whether to redeploy.

Vercel keeps serving the last good deployment when a build fails. That is right for your visitors, and it is also why a broken production build can sit unnoticed until someone asks why their fix is not live.

The agent lists deployments in the ERROR state, reads each build log to find the line that actually failed, and separates production from preview. Preview failures fixed by a later push are reported as fixed. For a production failure it asks you directly whether a redeploy would help or whether to read the log first.

## Two ways to get the data

Use the API or MCP route when you have an MCP server, a CLI or an API token for the app. Otherwise, if you can drive a browser the user is signed in to (Claude in Chrome, a Playwright or Chrome DevTools MCP server), use the browser route. Say which one you used.

## Route A: API or MCP server

### What you need

- A Vercel access token created under Account Settings > Tokens and scoped to the team, in `VERCEL_TOKEN`, plus the team ID.
- Or the Vercel MCP server or connector, or the `vercel` CLI signed in to that team.

If something is missing, say what and stop; do not invent numbers.

### Steps

1. **List failed deployments** (Vercel): `GET /v7/deployments?state=ERROR&since=<ms, 24 hours ago>&limit=50&teamId=<team>`, once with `target=production` and once with `target=preview`. Keep `uid`, `name`, `url`, `created`, `creator.username`, and the branch and commit from `meta.githubCommitRef` and `meta.githubCommitSha` (GitLab and Bitbucket use the matching `gitlab*` and `bitbucket*` keys).
2. **Find the error** (Vercel): `GET /v3/deployments/{id}/events` returns the build log; take the first `stderr` line that reads as an error, plus the lines just before it. `GET /v13/deployments/{id}` adds `errorCode` and `errorMessage` for failures outside the build, such as an invalid `vercel.json`. From the CLI: `vercel inspect <url> --logs`.
3. **Check whether it is still broken** (Vercel): Read the newest deployment for the same project and branch (`projectId` and `branch` on the list call). If it is `READY`, mark the failure as fixed by a later push.
4. **Ask before redeploying**: For a production failure that is still failing, say whether a redeploy is likely to help (a transient install or network error) or not (a code error), then ask. Never redeploy on your own; run `vercel redeploy <url>` only after a yes.

## Route B: the browser

### What you need

- Signed in to Vercel as a team member who can open the project; a Viewer seat can read deployments and logs, while redeploying needs the Member or Owner role.

If something is missing, say what and stop; do not invent numbers.

### Steps

Start at https://vercel.com/dashboard. The user is signed in already; never type passwords or codes, and ask if a sign-in page appears.

1. **Pick the team and project**: Use the team switcher in the top left to select your team, open the project (acme-web) and click **Deployments** in the sidebar. Repeat the next two steps for each project you care about.
2. **Filter to failures**: In the filter row set **Status** to `Error`, **Date Range** to the last 24 hours and leave **All Environments**. Each row shows the environment (Production or Preview), the branch, the commit message and who pushed it.
3. **Read the build log**: Open each failed deployment and expand **Build Logs**. Find the first red line and the command that was running, usually the lines around `Error: Command "next build" exited with 1`. Note the time.
4. **Check whether it is still broken**: Clear the Status filter and set **Branch** to that branch. If a newer deployment of the same branch is Ready, the failure was fixed by a later push. For production, the row marked **Current** is what visitors get now.
5. **Ask before redeploying**: For a production failure that is still failing, say whether a redeploy is likely to help (install or network error) or not (type or code error) and ask. Only after a yes, open the row's `...` menu, choose **Redeploy** and confirm in the **Redeploy to Production** dialog.

Note: The Deployments page filters one project at a time, so a team with many projects is quicker through the API route. Build logs are kept for the life of the deployment, but a deployment deleted by a retention policy takes its log with it.

## The report

- **Failed deployments** in the last 24 hours, production first.
- For each: project, branch, commit, who pushed it, the failing command and the error line.
- **Still failing** or **fixed by a later deploy**.
- For production: which deployment is live now, and the ask to redeploy, read the log or leave it.

## Post it to Briefkin

When `BRIEFKIN_TOKEN` is set, or `~/.config/briefkin/env` exists (the installer from https://briefkin.dev/docs writes it), also send the result to the user's Briefkin board as one card. Keep the `item_key` the same on every run so the card updates in place, use a new `event_id` per run, and put today's real numbers in place of the example ones. If the request fails, say so once and carry on.

```bash
[ -n "${BRIEFKIN_TOKEN:-}" ] || . ~/.config/briefkin/env
curl -sS -X POST "${BRIEFKIN_URL:-https://briefkin.dev}/v1/events" \
  -H "authorization: Bearer $BRIEFKIN_TOKEN" \
  -H "content-type: application/json" \
  -d @- <<'JSON'
{
  "v": 1,
  "event_id": "vercel-failed-deployments/<date of this run, e.g. 2026-10-16>",
  "item_key": "vercel-failed-deployments",
  "project": "acme-web",
  "source": "Vercel failed deployments alert skill",
  "kind": "action",
  "title": "Production build failed on a type error",
  "summary": "The 14:05 production build of `main` (`a41c9e2`) failed in `next build`. Production still serves the 11:20 deployment. Two preview failures were fixed by later pushes.",
  "action": {
    "request": "It is a type error, so a plain redeploy will fail again. Open the log, or redeploy anyway?",
    "options": [
      "Show me the build log",
      "Redeploy anyway",
      "I am on it",
      "Ignore"
    ]
  },
  "widget": [
    {
      "type": "Log",
      "props": {
        "lines": [
          {
            "time": "14:06",
            "text": "Running \"next build\"",
            "level": "info"
          },
          {
            "time": "14:07",
            "text": "./app/settings/page.tsx:42:7",
            "level": "error"
          },
          {
            "time": "14:07",
            "text": "Type error: Property 'plan' does not exist on type 'Org'.",
            "level": "error"
          },
          {
            "time": "14:07",
            "text": "Error: Command \"next build\" exited with 1",
            "level": "error"
          }
        ]
      }
    },
    {
      "type": "Table",
      "props": {
        "columns": [
          "Deployment",
          "Target",
          "Branch",
          "Status"
        ],
        "rows": [
          [
            "acme-web 14:05",
            "Production",
            "main",
            "Failing"
          ],
          [
            "acme-web 10:42",
            "Preview",
            "feat/org-plans",
            "Fixed at 11:03"
          ],
          [
            "acme-docs 09:15",
            "Preview",
            "docs/sso",
            "Fixed at 09:31"
          ]
        ]
      }
    }
  ]
}
JSON
```

Widgets come from the Briefkin catalog (https://briefkin.dev/v1/catalog). Without a token, just give the user the report.

## Run it on a schedule

Suggested: Weekdays at 9:00, 13:00 and 17:00 (`0 9,13,17 * * 1-5`). From cron, with the agent signed in on that machine:

```bash
0 9,13,17 * * 1-5 claude -p "Run the vercel-failed-deployments skill"
# Codex: codex exec, Gemini CLI: gemini -p, Copilot CLI: copilot -p, OpenCode: opencode run
```

Or use the agent's own scheduler (Claude Code routines, Codex automations, Claude or ChatGPT scheduled tasks): https://briefkin.dev/skills/vercel-failed-deployments#schedule

Source: https://briefkin.dev/skills/vercel-failed-deployments

What your agent needs

  • A Vercel access token created under Account Settings > Tokens and scoped to the team, in VERCEL_TOKEN, plus the team ID.

  • Or the Vercel MCP server or connector, or the vercel CLI signed in to that team.

Connecting Vercel

  1. Vercel MCP, Vercel's official remote server at https://mcp.vercel.com, signed in with OAuth. It lists projects and deployments, reads build and runtime logs, and searches Vercel's docs.
  2. The vercel CLI. vercel ls <project> lists recent deployments, vercel inspect <deployment-url> --logs prints the build log, and vercel logs <deployment-url> shows runtime logs. Pass --token $VERCEL_TOKEN and --scope <team> in scheduled runs.
  3. REST API with an access token created under Account Settings > Tokens and scoped to the team, stored in VERCEL_TOKEN, with VERCEL_TEAM_ID sent as teamId.

Vercel tokens can be limited to one team and given an expiry but can't be made read-only, so use a short-lived token for reports and keep deploy and env var tasks out of the same skill.

Questions

Is my site down when a production deploy fails?

No. Vercel only points your production domain at a deployment that finished building, so visitors keep the last good one. The risk is the fix or feature that did not ship, which is why the card names the deployment production is still on.

When does a redeploy help?

When the cause is outside your code: a registry timeout during install, a rate-limited API called at build time, or a bad build cache (redeploy without it). Type errors, failing tests and missing environment variables fail again until someone fixes them.

Do I need Briefkin to use the Vercel failed deployments alert skill?

No. The skill runs with your own agent and gives you the report in the chat. With a Briefkin token set, each run also posts it to your board as a asks you, so you can glance at it instead of asking again.

Which agents can run it?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, Windsurf and Amp all read SKILL.md files. The install command puts it in ~/.claude/skills and ~/.agents/skills, where they look. ChatGPT, the Claude app and Grok take the prompt instead. Pick your agent under "Install and run it" and the commands change to match.

Can it work without an API or MCP server, from my browser?

Yes. Switch the data source to "Your browser" and the steps change to the Vercel pages themselves: the agent opens vercel.com/dashboard in a browser you are signed in to and reads the numbers off the page. Claude Code, Codex, Cursor, Claude app and ChatGPT can drive a browser out of the box; Gemini CLI, Copilot CLI and OpenCode need a Playwright or Chrome DevTools MCP server first. It is slower than the API and needs you signed in, so it suits a report you run by hand or from a scheduler on your own computer.

Answer your agents from one board, or from Telegram

Skills are free to use with any agent. Briefkin is where their results land: one board for every report, number and question your agents send, with a ping when something needs you.

Free during the open beta. No card.