deploy-doctor
Skill1 starsChanged 5 months agoMITView on GitHub
Diagnose and fix common web-app deployment failures — especially full-stack JS apps (Vite SPA + Express/Node + serverless). Covers "the site shows raw JavaScript source", FUNCTION_INVOCATION_FAILED on Vercel, Render/Railway port-binding failures, env vars that don't take effect, missing build dependencies, blank social link previews, and SPA routing 404s. Use when a deploy "succeeds" but the site is broken, an API/function 500s in prod but works locally, or the user asks why their deployed app misbehaves.
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- hellocrossmanwild/Claude-skills-toolstheir own version, first seen Oct 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- hellocrossmanwild/Claude-skills-tools★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- ask-terminalSkill
- build-themeSkill
- command-paletteSkill
- github-activitySkill
- llm-endpointSkill
- numu-AOV-themesSkill
- numu-store-founderSkill
- og-imageSkill
- scroll-reveal-kitSkill
- seo-kitSkill
- theme-toggleSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
Don't run a "find an available port" loop in prod.
- Very specific: line 46
Client vs server: only VITE_/NEXT_PUBLIC_-prefixed vars reach the browser.
- Very specific: line 52
Fix: use https://domain/og-image.png (absolute), a 1200×630 image, summary_large_image.
- Distinctive: line 56
Cause: no SPA fallback — the host looks for a real file at that path.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Deploy Doctor
A diagnostic playbook for the deployment failures that look mysterious but have well-known causes. Match the symptom, apply the fix.
🔴 Site serves raw JavaScript / shows the bundled server source
Cause: an Express/Node app with server.listen() was deployed to a serverless/static host
(Vercel/Netlify). They don't run a persistent server — they served your built dist/index.js as a
static file.
Fix — pick one:
- Node host (simplest): deploy to Render/Railway/Fly/DO App Platform. Build
npm run build, startnpm start. The Express server serves the SPA + API in one process. - Stay serverless: serve the SPA statically (
outputDirectory: dist/public) and move API routes into serverless functions (/api/*). Don't ship the long-running server.
🔴 FUNCTION_INVOCATION_FAILED (Vercel) / function 500s on every request (even GET)
Cause: the function crashes on load — most often an extensionless relative import
(import x from "./util") under Vercel's per-file ESM compilation → ERR_MODULE_NOT_FOUND.
Fix: make the function self-contained (zero imports), or use explicit .js extensions on
relative imports. Also wrap the handler in try/catch so real errors return JSON instead of a
platform crash. Test: GET should return your 405, not a platform 500.
🔴 Render/Railway: "deploy live" but unreachable / "no open ports"
Cause: the app doesn't bind the platform's $PORT, or hunts for a "free" port.
Fix: in production bind exactly process.env.PORT on host 0.0.0.0:
const port = Number(process.env.PORT) || 3000;
server.listen(port, "0.0.0.0");Don't run a "find an available port" loop in prod.
🔴 Build fails: "vite: not found" / "esbuild not found"
Cause: the host sets NODE_ENV=production, so npm/pnpm install skips devDependencies
(where vite/esbuild/tsx live).
Fix: force dev deps for the build: pnpm install --prod=false (or npm ci --include=dev).
🔴 Env vars / API keys "set" but the app acts like they're missing
Causes & fixes:
- Env vars only apply at build/start of a NEW deploy — after adding them, redeploy.
- Your
.envis gitignored and NOT deployed — set the vars in the host's dashboard, not just locally. - Client vs server: only
VITE_/NEXT_PUBLIC_-prefixed vars reach the browser; secrets must stay server-side (functions / server env). - Name mismatch — confirm the exact key names.
🔴 Blank/ugly social link previews (LinkedIn/Twitter/Slack)
Cause: og:image / og:url are relative paths; crawlers need absolute URLs.
Fix: use https://domain/og-image.png (absolute), a 1200×630 image, summary_large_image.
LinkedIn caches — re-scrape via the Post Inspector. (See the seo-kit / og-image skills.)
🔴 SPA routes 404 on refresh / direct link (e.g. /projects/foo)
Cause: no SPA fallback — the host looks for a real file at that path.
Fix: rewrite all non-asset, non-API paths to /index.html. Vercel:
{ "rewrites": [{ "source": "/((?!api/).*)", "destination": "/index.html" }] }(Static assets are served by the filesystem first; the (?!api/) keeps serverless functions working.)
🔴 Stray horizontal scrollbar / layout drifts below the fold
overflow-y: autosilently promotes the other axis toautotoo → addoverflow-x: hidden.- A fixed full-height shell should be
h-screen+overflow-hidden, notmin-h-screen(which can grow past the viewport and leave gaps).
General checklist
- Does it build locally?
npm run build && npm start. - Right host for the architecture? (persistent server → Node host; static+functions → serverless)
- Env vars set in the host, and redeployed after?
- Functions: self-contained, wrapped in try/catch, bind
$PORT(servers)? - SPA fallback + absolute OG URLs configured?
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

