Vercel Deploy
Core Principle
Deploy through the $VERCEL_DEPLOY_SCRIPT helper, resolve its path from the environment or ask; never assume a machine-specific path. Every successful run returns a Preview URL (live site) and a Claim URL (transfer to the user's Vercel account).
When to Use
- When the user requests deploying a project to Vercel and needs preview/claim links.
When NOT to Use
- When deployment is not requested or targets a non-Vercel platform.
Prerequisite
This skill needs a local deploy helper script. Resolve its path from $VERCEL_DEPLOY_SCRIPT or ask the user, never assume a machine-specific path (for example /mnt/skills/...). The helper must:
- Exclude secret files (
.env*, credentials, key files) from the upload in addition tonode_modulesand.git. - Never mutate the input tree in place (stage a temporary copy if it needs to rename or transform files).
- Show the exact command it runs before executing.
How It Works
- Packages your project into a tarball (excludes
node_modules,.git, and secret files) - Auto-detects framework from
package.json - Uploads to deployment service
- Returns Preview URL (live site) and Claim URL (transfer to your Vercel account)
Usage
bash "$VERCEL_DEPLOY_SCRIPT" [path]
Arguments:
path- Directory to deploy, or a.tgzfile (defaults to current directory)
Examples:
# Deploy current directory
bash "$VERCEL_DEPLOY_SCRIPT"
# Deploy specific project
bash "$VERCEL_DEPLOY_SCRIPT" /path/to/project
# Deploy existing tarball
bash "$VERCEL_DEPLOY_SCRIPT" /path/to/project.tgz
Output
Preparing deployment...
Detected framework: nextjs
Creating deployment package...
Deploying...
✓ Deployment successful!
Preview URL: https://skill-deploy-abc123.vercel.app
Claim URL: https://vercel.com/claim-deployment?code=...
The script also outputs JSON to stdout for programmatic use:
{
"previewUrl": "https://skill-deploy-abc123.vercel.app",
"claimUrl": "https://vercel.com/claim-deployment?code=...",
"deploymentId": "dpl_...",
"projectId": "prj_..."
}
Framework Detection
The script auto-detects frameworks from package.json. Supported frameworks include:
- React: Next.js, Gatsby, Create React App, Remix, React Router
- Vue: Nuxt, Vitepress, Vuepress, Gridsome
- Svelte: SvelteKit, Svelte, Sapper
- Other Frontend: Astro, Solid Start, Angular, Ember, Preact, Docusaurus
- Backend: Express, Hono, Fastify, NestJS, Elysia, h3, Nitro
- Build Tools: Vite, Parcel
- And more: Blitz, Hydrogen, RedwoodJS, Storybook, Sanity, etc.
For static HTML projects (no package.json), framework is set to null.
Static HTML Projects
For projects without a package.json:
- If there's a single
.htmlfile not namedindex.html, it gets renamed automatically - This ensures the page is served at the root URL (
/)
Present Results to User
Always show both URLs:
✓ Deployment successful!
Preview URL: https://skill-deploy-abc123.vercel.app
Claim URL: https://vercel.com/claim-deployment?code=...
View your site at the Preview URL.
To transfer this deployment to your Vercel account, visit the Claim URL.
Troubleshooting
Network Egress Error
If deployment fails due to network restrictions, surface the provider error and ask the user to allow the required domains in their runtime/network settings, then retry:
Deployment failed due to network restrictions. To fix this:
1. Allow the required provider domains in the runtime/network settings
2. Try deploying again
Workflow
- Resolve the deploy script path from
$VERCEL_DEPLOY_SCRIPTor ask the user. - Run
bash "$VERCEL_DEPLOY_SCRIPT" [path](directory or.tgz; defaults to cwd). - Present both URLs to the user. Stop when both are shown.
Red Flags
Assuming a hardcoded script path; uploading secret files (.env*, credentials, keys); mutating the input tree in place; running the helper without showing the exact command first.
Verification
Output contains a Preview URL and a Claim URL; the stdout JSON parses with previewUrl, claimUrl, deploymentId.
References
No reference capsules, the skill is self-contained.