# Vibe Coding Unstuck Kit (free AI agent kit from Bot Pantry)

Canonical page: https://botpantry.com/kits/vibe-unstuck
Free download (.zip, no sign-up): https://botpantry.com/api/download?kit=vibe-unstuck
For: Vibe coders whose app won't install, build, run or deploy (Next.js, Vite, Supabase, Vercel)
Setup time: 10-20 min (verified by Kit Inspector)
Works with: Node.js; Next.js; Vite; Supabase; Vercel; npm / pnpm; Cursor; Claude Code; Lovable; v0; Bolt; Replit; ChatGPT, Claude, or Grok
Published: 2026-10-14 · Updated: 2026-11-28

When your AI-built app won't install, build, run or deploy: tested scripts find the real cause on your machine (Node version, lockfile, import letter case, env vars, ports, Supabase errors), link each finding to a verified fix, and write a bug report with secrets removed that your AI can actually act on.

## What's inside
- doctor: checks Node vs every installed package, lockfile sync (the pnpm/npm ci failures you otherwise only see on Vercel), import upper/lower case, env var names and leaked NEXT_PUBLIC_/VITE_ secrets, ports and Supabase settings in seconds, without changing anything
- capture: runs your build, dev server or any command (or reads a pasted Vercel log) and names the real error first, e.g. a Vite 'styleText' crash that means 'Node too old'
- repro: one ask-ai.md bug report (versions, findings, error, the code at the error line, configs, env NAMES only), with secrets removed
- Fixes for 52 specific problems, each marked verified-on-a-real-broken-project or docs-only, for Next.js 15/16, Vite 8, npm/pnpm, Supabase and Vercel
- 6 prompts plus Cursor/Claude Code/AGENTS.md rules that make your AI read the real error and fix one thing at a time
- No install, no accounts, no API keys: plain Node.js files (Node 18+), output git-ignored automatically

---

The kit's README (included in the .zip) follows.

# Vibe Coding Unstuck Kit — Bot Pantry Kit

**Your app won't install, build, run or deploy, and your AI keeps guessing.** This kit runs on your machine, finds the real cause, points you to a fix we tested on a real broken project, and writes a bug report your AI can actually act on.

For Next.js and Vite apps, with Supabase and Vercel, built with Cursor, Claude Code, Lovable, v0, Bolt or Replit.

## Why not just ask your AI?
Your AI only sees what you paste, and it can't look at your machine. Most "stuck" bugs come down to facts it never sees:
- **Your import is `./header` but the file is `Header.tsx`.** Works on your Mac, fails on Vercel with "Cannot find module". The kit checks the disk and names the real file, before you deploy.
- **Vite crashes with `does not provide an export named 'styleText'`.** That looks like a code bug, but your Node.js is too old. The kit reads the `engines` field of every installed package and says so.
- **`ERR_PNPM_OUTDATED_LOCKFILE` on Vercel only.** The kit compares your lockfile with package.json locally and lists the exact packages that differ.
- **A secret behind `NEXT_PUBLIC_` / `VITE_`.** It ships to every visitor. The kit decodes Supabase keys to tell a safe anon key from a service_role key, even when the variable is named `..._ANON_KEY`. It never prints the value.
- **"Port 3000 is in use", "fetch failed 127.0.0.1:54321", `PGRST205`, "new row violates row-level security".** The kit names the process, the local Supabase that isn't running, the missing table, and the policy you need.

## Quickstart (10-20 min, details in setup.md (in the kit .zip))
1. Copy the **`unstuck`** folder into your project (next to `package.json`).
2. **Run the doctor first, even if your build passes:** `node unstuck/doctor.mjs`. It takes seconds and changes nothing. A passing build does not mean a clean project (a stale lockfile fails on Vercel, a leaked key ships to every visitor), and only the doctor looks for those.
3. `node unstuck/capture.mjs`: runs your build and names the real error. When the build passes, it also runs the doctor's quick checks and tells you if any of them found something. Variants: `dev --seconds 20`, `-- npm install`, `--file vercel-log.txt`, `--stdin`, and `--strict` (exit 1 if the build passed but the doctor's quick checks found something: for scripts and CI).
4. `node unstuck/repro.mjs`: writes `unstuck/output/ask-ai.md` with secrets removed. Skim it, then paste it with **prompt 1** from unstuck/prompts.md (in the kit .zip).
5. Optional: add drop-in/.cursor/rules/unstuck.mdc (in the kit .zip) (Cursor) or drop-in/AGENTS-unstuck.md (in the kit .zip) (Claude Code / AGENTS.md) so your AI runs the kit before it edits.

Needs Node.js 18+ only: no npm packages, no accounts, no API keys. Lovable / v0 / Bolt: export or sync to GitHub and clone the code first (setup.md).

## What's inside
| File | What it does |
|---|---|
| `unstuck/doctor.mjs` | Works from a monorepo app folder (npm/pnpm workspaces: it uses the workspace root's lockfile and node_modules). Node vs `engines` (yours and every installed package's), `.nvmrc`, Vercel's Node versions, lockfiles and their sync, missing/outdated/undeclared packages, peer mismatches, import case and missing files, `"use client"` mistakes, env var names, leaked public secrets, ports 3000/5173/54321, local Supabase. Exit code 1 on any FAIL. |
| `unstuck/capture.mjs` | Runs a command (or reads a log), saves the output with secrets removed, and recognises 32 error types (90+ patterns taken from real output) from Next.js 15/16, Vite 8, npm, pnpm, Supabase/PostgREST and Vercel logs. Root causes go first. A pasted log has no exit code, so an error it doesn't recognise is reported as **NOT RECOGNISED**, never as OK. |
| `unstuck/repro.mjs` | One paste-ready `ask-ai.md` (max 24k characters) with versions, findings, error, code at the error line, package.json, configs, env NAMES, git status. Secrets, and the password in any `scheme://user:password@host` URL (even one with a raw `@` in it), are removed in two passes, and it warns if anything that looks like a key or URL password is left. |
| `unstuck/ports.mjs` | Which process holds a port, and the command to stop it. It never stops anything itself. |
| unstuck/fixes/ (`unstuck/fixes/README.md`) (in the kit .zip) | Fix pages for 52 problems. Each one is marked **verified** (we broke a real project, applied the fix, it passed) or **docs**. |
| unstuck/prompts.md (in the kit .zip) | 6 prompts: fix from the bug report, fix one finding, break the AI loop, works locally/fails on Vercel, Supabase error, before deploying. |
| `drop-in/` | Rules for Cursor and Claude Code / AGENTS.md. |
| examples.md (in the kit .zip) | Real output from broken test projects. |
| troubleshooting.md (in the kit .zip), sources.md (in the kit .zip) | When the kit itself misbehaves. Official docs behind every fix (checked 2026-11-27). |

## Safety
- **Read-only.** The scripts never edit your code, install packages, run SQL or connect to anything outside your computer. They never stop a process they didn't start: capture.mjs only ends the dev server it launched itself, after `--seconds`. For everything else they print the command for you to run.
- **No secret values in output.** Env files are read only to check names and kinds and to blank out values in saved output. Everything in `unstuck/output/` is redacted and git-ignored. Still skim `ask-ai.md` before pasting it into a web chat.
- **Undo is a different kit.** Need to roll back an AI change, recover a file, or deal with a pushed secret? Use **Git Undo Button for AI Coding**: https://botpantry.com/kits/git-safety-net. This kit tells you what's broken. That one gets you back to a working version.

## Tested
On 2026-11-27, on Linux, with real installs and builds (no mocks): Node 24.22.1 and 18.20.8, npm 11.21.1, pnpm 10.34.6, Next.js 16.4.6 (Turbopack) and 15.5.29, Vite 8.4.0, supabase-js 2.119.2 against a real Postgres 17 + PostgREST 16.6.
- **371 checks passed, 0 failed** across **49** scenarios (plus 14 static checks on the kit files and a 34,223-check table and generated test for URL passwords, below). A full run takes about 5 minutes. That covers 9 healthy projects (Next.js, Next.js with `server-only`, Vite, both with Supabase, pnpm, an npm monorepo and a pnpm monorepo) where doctor must report 0 FAIL and 0 WARN, plus the broken ones. Each broken project: real error captured → classified correctly as the first finding → the fix from the fix page applied → re-run passes.
- Covered for real: missing package, import case (file and folder), missing alias file, `"use client"`, `fs` in a client component, type and syntax errors (Next.js and Vite), Supabase env chain (`supabaseUrl is required` → Next.js 16 uncached-data error → Suspense fix), Node 18 for Next.js and Vite, no node_modules, env mistakes (Vite: proved the `VITE_` secret ends up in the public JS and `process.env` becomes undefined), ports (Next.js and Vite), Next.js 15 lint, ERESOLVE peer conflict, `npm ci` and pnpm frozen-lockfile out of sync, multiple lockfiles and engines, undeclared and outdated packages, 7 real supabase-js errors (RLS, PGRST205/204/116/303/301, ECONNREFUSED) with SQL fixes, pasted Vercel and browser-console logs.
- **Added after Kit Inspector's review (all run for real):** npm and pnpm monorepos (doctor and capture run from `apps/web`: root lockfile, hoisted packages, root `engines`, `npm install x -w web` / `pnpm --filter web add x` printed and tested, stale lockfile advice names pnpm and the workspace root, no second lockfile created); a healthy Next.js app that imports `server-only` and `client-only` (no false FAIL; a Vite project importing the same still fails); a pasted log with an unknown error (NOT RECOGNISED, exit 3, report still written); credentials in URLs (redis, amqp, https, git, postgres, Supabase pooler, mongodb+srv, ftp) removed from the live output, `last-run.txt`, `ask-ai.md` and `--json`, while an ordinary `host:8080` or `?email=` is left alone; the 24k cap applied after redaction; capture killed with SIGTERM/SIGHUP (dev server and its children die, a child that ignores SIGTERM is killed after 3 seconds, no hang); quoted arguments surviving; a secret split across two writes never reaching the terminal; npm ETARGET and E404, pnpm no-matching-version and 404, and both new Next.js 16 errors.
- **Added after the second review:** a raw `@` inside a URL password (`postgres://u:pa@ss@word@host/db` and 9 variants: with port and query, empty user, mongodb+srv, amqp, https, quoted passwords with spaces, slash in the password) is removed completely, and a URL with an `@` in its query string or no password is left alone; repro's leftover check catches it; lowercase and JSON secret names (`password=`, `"api_key":`, `token`) are redacted while 17 ordinary lines (`Unexpected token: expected`, `process.env.API_KEY`, `getToken()`) stay readable; a real `bun install --frozen-lockfile` failure gets bun advice (and the project's own package manager when the pasted text doesn't name one); last-run and ask-ai.md say `ok (build only; doctor quick checks found N FAIL, M WARN)`; `--strict`; no stray header line in the excerpt. The new tests fail on the previous version (31 failures) and pass on this one.
- **Added after the third review:** URL userinfo is now parsed instead of matched with a regex, so a raw `@` in the *username* (`smtp://jane@company.com:pw@smtp.gmail.com:587`, `https://alice@work.io:pw#99@host`, `postgres://us@er:pa@ss@word@host/db`) no longer leaves the password behind. Tested on SMTP, SMTPS, IMAP, IMAPS and HTTP basic with email usernames, `# ? % ;` and `:` in passwords, quoted passwords, a username with no password (left intact), `git@host:`, IPv6 hosts and `host:port/path?x=a@b`, end to end through capture, repro, `.env` and config files; plus a **generated test of 6,000 URLs** (20 schemes, 11 usernames, passwords built from parts joined by `@ : # ? % ; / , $ !` and more, quoted and unquoted, inside quotes, brackets and sentences) that checks no part of any password survives, the username and host are kept, repro's leftover check agrees, redaction is idempotent, and the same URL without a password is untouched. That test fails 7,738 of its checks on the previous version and none now. `secret-key:` and other hyphen or dot names are redacted like `api-key=`.
- **Secrets:** a worst-case build that prints the whole `.env.local` file, with fake keys of 12 kinds (Supabase service_role JWT and sb_secret, OpenAI, Anthropic, Stripe secret and webhook, GitHub, AWS, Google, database URL password, PEM private key, Bearer token), keys hard-coded in source, and a custom value with no known pattern. No fake value appeared in any output file or printed output across 184 kit runs.
- The kit's version-range logic agrees with npm's own semver library on 1,330 of 1,330 test pairs. All 10 scripts parse on Node 18.

## Limits
- **Stacks:** tuned for Next.js (App Router), Vite + React, npm/pnpm, Supabase and Vercel. Yarn and bun lockfiles are detected but sync is not checked. Remix, Astro, SvelteKit, Expo, Python backends: doctor's generic checks still run, but few error patterns are recognised.
- **Monorepos:** npm and pnpm workspaces (`package.json` `workspaces`, `pnpm-workspace.yaml`) are supported and tested. In a yarn or bun workspace the lockfile sync is **not** checked: doctor says so (an INFO line, `check-skipped`) instead of guessing. The same goes for a workspace lockfile it can't read. The kit only treats a parent folder as the workspace root if the app matches its patterns. Run the scripts from the app folder, not the repo root.
- **Next.js `"use client"` is only partly checkable before a build.** A component that uses hooks but lacks `"use client"` is caught by the build, not by doctor. Importing `client-only` from a server component is a real Next.js build error that the kit doesn't have a pattern for yet (it falls back to "not recognised" and the full output goes to `ask-ai.md`).
- **Live terminal redaction works per line.** A secret on one line is removed before it is shown, even when it arrives in pieces. A secret that spans several lines (other than a PEM private key block) can appear on screen live. It is still removed from every saved file.
- **A command that exits 0 but prints error-like text** gets a WARN, never a plain OK, and keeps the command's exit code.
- **Tested on Linux only.** Windows and macOS were not run. The scripts use cross-platform Node APIs and Windows-specific port lookup (netstat/tasklist), but that path is untested. So is how quoting in your own commands is passed through on Windows.
- **Not tested against live services:** no real Vercel deployment, no hosted Supabase project, and no runs inside Lovable, Bolt or Replit. Those fixes are marked **docs** on the fix pages. Vercel's own log wording ("Command ... exited with", "No Output Directory named") is from common logs, not confirmed.
- **Browser-only errors** (hydration, CORS, `process is not defined`) are recognised only when you paste them in (`--stdin` / `--file`). The kit doesn't open a browser.
- **Pattern-based.** Unknown errors get "no pattern this kit knows". repro.mjs still packs the real output for your AI.
- **Snapshot of today.** Vercel's Node versions (22/24/26), Next.js 16 and Vite 8 behaviour and Supabase key names were checked on 2026-11-27 and will change.
- **Secret detection** is pattern-based. A key in an unusual format may not be flagged. Names like `password=`, `"api_key":`, `secret-key:` or `client.secret=` are matched in any letter case, with `_`, `-` or `.` in the name. To keep ordinary sentences and code readable, a plain word after a bare colon (`token: expected`) and code such as `process.env.X` or `getToken()` are left alone, so a lowercase `password: correcthorse` on a line of its own is not redacted.
- **Passwords in URLs** (`scheme://user:password@host`) are parsed, not guessed: the userinfo is everything up to the last `@` before the first `/`, the username is what comes before its first `:`, and the rest is removed. A raw `@ # ? % ; :` in the password, and a raw `@` in the username (email-style `jane@company.com`), are covered, quoted or not, and a username with no password is left alone. A generated test of 6,000 URLs checks this. **Shapes that are truly ambiguous** (the kit picks the safer reading where it can):
  - a `'`, `"`, backtick, `<`, `>` or space inside an *unquoted* password: the URL looks like it ends there, so that password is **not** recognised (quote it, or percent-encode it);
  - a `/` and an `@` in the same password: only the part up to the first `@` after the slash is removed;
  - a `:` inside the username (it should be `%3A`);
  - `first.last:1234#pw@host` (dotted username, password that starts with digits and then `/`, `?` or `#`) is read as host:port and left alone;
  - over-redaction instead of a leak: a URL with no path whose query holds an `@` (`postgres://u:pw@h?x=a@b`) loses the query too, and so does `http://api:3000/v1?x=a@b` (an undotted host name looks like a username).

## Sources
See sources.md (in the kit .zip) (Next.js, Vite, Vercel, npm, pnpm, Supabase and PostgREST docs, checked 2026-11-27).

---
This kit is free from Bot Pantry: https://botpantry.com/kits/vibe-unstuck
Share that link with anyone it would help. New kits added regularly, plus a weekly roundup of the most-downloaded ones: https://botpantry.com/newsletter
