Set up Vercel preview subdomain with auto-sync branch and SEO protection. Creates {repo-name}-preview.jbcloud.app pattern.
Command: /setup-preview
Purpose: Configure a stable preview subdomain on Vercel with automatic branch sync and search engine blocking.
{repo-name}-preview.jbcloud.app
Examples:
claude-codex repo → claudecodex-preview.jbcloud.appjb-cloud-docs repo → jbclouddocs-preview.jbcloud.appHDFlowsheet-Cloud repo → hdflowsheetcloud-preview.jbcloud.app| Framework | Detection |
|---|
| Config File |
|---|
| Next.js | next.config.* | next.config.js |
| Astro | astro.config.* | astro.config.mjs |
| Remix | remix.config.* | remix.config.js |
| SvelteKit | svelte.config.* | svelte.config.js |
| Static | None of above | vercel.json only |
{
"headers": [
{
"source": "/(.*)",
"has": [
{
"type": "host",
"value": "{repo-name}-preview.jbcloud.app"
}
],
"headers": [
{
"key": "X-Robots-Tag",
"value": "noindex, nofollow"
}
]
}
]
}
Next.js (app/robots.ts):
import type { MetadataRoute } from 'next'
export default function robots(): MetadataRoute.Robots {
const isProduction = process.env.VERCEL_GIT_COMMIT_REF === 'main'
return isProduction
? { rules: { userAgent: '*', allow: '/' } }
: { rules: { userAgent: '*', disallow: '/' } }
}
Astro (src/pages/robots.txt.ts):
import type { APIRoute } from 'astro';
export const GET: APIRoute = () => {
const isProduction = process.env.VERCEL_GIT_COMMIT_REF === 'main';
const robotsTxt = isProduction
? `User-agent: *\nAllow: /`
: `User-agent: *\nDisallow: /`;
return new Response(robotsTxt, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
});
};
.github/workflows/preview.yml)