From claude-codex
Set up Vercel preview subdomain with auto-sync branch and SEO protection. Creates {repo-name}-preview.jbcloud.app pattern.
npx claudepluginhub aventerica89/claude-codex --plugin claude-codexThis skill uses the workspace's default tool permissions.
**Command:** `/setup-preview`
Provides Ktor server patterns for routing DSL, plugins (auth, CORS, serialization), Koin DI, WebSockets, services, and testApplication testing.
Conducts multi-source web research with firecrawl and exa MCPs: searches, scrapes pages, synthesizes cited reports. For deep dives, competitive analysis, tech evaluations, or due diligence.
Provides demand forecasting, safety stock optimization, replenishment planning, and promotional lift estimation for multi-location retailers managing 300-800 SKUs.
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)name: Sync Preview Branch
on:
push:
branches-ignore:
- preview
permissions:
contents: write
jobs:
sync-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Sync to preview branch
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin preview || git checkout -b preview
git checkout preview
git reset --hard ${{ github.sha }}
git push -f origin preview
After running this skill, complete these in Vercel:
Add Domain
{repo-name}-preview.jbcloud.appAssign to Branch
previewEnable System Environment Variables
DNS (if not already configured)
*.jbcloud.app → cname.vercel-dns.com# In any project directory
/setup-preview
# With custom subdomain (overrides default pattern)
/setup-preview --subdomain myapp-staging
Any branch push
│
▼
GitHub Actions workflow
│
▼
Force-push to `preview` branch
│
▼
Vercel auto-deploys `preview` branch
│
▼
{repo-name}-preview.jbcloud.app updated
After setup, verify:
{repo-name}-preview.jbcloud.appX-Robots-Tag: noindex, nofollow/robots.txt returns Disallow: /Based on: https://jonrh.is/preview-subdomain-nextj-vercel
Successfully tested on claude-codex (Astro project):
| Component | Value |
|---|---|
| Production | codex.jbcloud.app |
| Preview | claudecodex-preview.jbcloud.app |
| Framework | Astro |
| Workflow | .github/workflows/preview.yml |
Push any commit to trigger the workflow, which creates the branch:
git commit --allow-empty -m "trigger preview branch" && git push
Ensure workflow has write permission:
permissions:
contents: write
gh run list --workflow="Sync Preview Branch"preview branchReady to set up preview subdomain. Provide project path or run in project directory.