Skip to content

/wbDeploy — Exhaustive Simulation () ​

/wbDeploy is the shipper of apps, not packages. Apps are the things end users hit — domain names, build artifacts uploaded to a host, environment variables on a cloud provider. /wbPublish handles npm packages; /wbDeploy handles deployments to Vercel/Cloudflare/AWS/whatever the target is. The two commands stay separate because the failure modes are different.

Read this if you want to know what --prod actually changes vs --target, why --dry-run is the safest default for first-time use, and where deploy ends and release coordination (/wbRelease) begins.


1. Role & target ​

AspectBehavior
RoleThe Shipper — pushes apps to hosting environments.
TargetAn app directory (e.g., apps/wbc-ui.com), comma-separated set, glob, or environment shorthand (staging, production).
Cell scopeNone directly. Plan rows about deployment exist; /wbDeploy doesn't mutate them.
Side effects allowedBuilding the app; uploading artifacts; setting environment variables on the cloud provider; updating DNS aliases (with confirmation).
Side effects forbiddenModifying source code; mutating git state (no commits, no tags — that's /wbRelease's job); running migrations against shared databases without explicit confirmation; modifying deploys outside the target list.

The "no source modifications" rule is the contract with /wbRelease. /wbDeploy ships what's already in the working tree. If the working tree is dirty, the agent warns; if a version bump is needed, that's /wbRelease's job, not /wbDeploy's.


2. Argument resolution matrix ​

FormExampleWhat /wbDeploy does
App directoryCommand: /wbDeploy apps/wbc-ui.comDeploys one app.
Comma-separatedCommand: /wbDeploy apps/wbc-ui.com,apps/adminDeploys both, parallel where the host supports it.
GlobCommand: /wbDeploy "apps/*"Deploys every app. Slow; warns about scope.
Environment shorthandCommand: /wbDeploy productionRefused. Environment must be a flag (--prod/-P), not a target.
Free-textCommand: /wbDeploy "the main site"Refused.

The "environment as flag, not target" distinction exists because conflating them produces ambiguity: /wbDeploy production could mean "deploy to production" or "deploy the app named production." Forcing the flag form removes the ambiguity.


3. Flag matrix ​

FlagShortcutPurpose
--target="<env>"-tNames the deployment target environment: preview (default), staging, or any custom env declared in the host config.
--prod-PShorthand for --target="production" with extra confirmation gates. Capitalized to signal high-stakes.
--dry-run-dBuilds the app and validates the deploy steps but does not actually upload. Reports what would happen.

How --target and --prod interact ​

CombinationBehavior
no flagDeploys to preview. Produces a unique preview URL. Safe by default.
--target="staging"Deploys to staging. One confirmation.
--target="production"Deploys to production. Two confirmations + dry-run encouraged.
--prodEquivalent to --target="production" but the flag itself is loud — anyone reading the command sees "production."
--target="custom-env"Honors the custom env if declared in host config. Fails honestly if not.

The confirmation count scales with risk: preview = none, staging = 1, production = 2. Production deploys are the irreversible ones — once traffic routes to a new build, rollback is another deploy, not an undo.

How --dry-run validates ​

StepLiveDry-run
BuildRuns build command.Runs build command.
Validate configChecks env vars, host credentials.Checks env vars, host credentials.
UploadActually uploads.Skipped; logs what would upload (file list, size).
Switch trafficUpdates DNS/aliases.Skipped; logs what would switch.
NotifySends release notes if configured.Skipped.

The build runs on dry-run because build failures are the most common deploy blocker. Catching them in --dry-run is the point.


4. Pipelines (the agent-native scenarios) ​

📋/wbDeploy Exhaustive Simulation
The first preview deploy of a new app/wbDeploy apps/wbc-ui.com
> /wbDeploy apps/wbc-ui.com
[SYSTEM] Target: apps/wbc-ui.com
[ENV] Target environment: preview (default).
[CHECK] Working tree is clean? Yes.
[CHECK] Host credentials configured? Yes (vercel via .vercelrc).
[BUILD] Running pnpm --filter wbc-ui.com build...
Output: apps/wbc-ui.com/dist/ (147KB)
[VALIDATE] All required env vars present.
[UPLOAD] Pushing artifacts to Vercel preview...
[DNS] Preview URL: https://wbc-ui.com-abc123.vercel.app
[DEPLOY] Build successful. Preview URL is live.
[OK] Preview deployed. URL: https://wbc-ui.com-abc123.vercel.app
[NOTE] This is a preview only. Run with --prod for production.

💠 Pipeline The first preview deploy of a new app ​

💠 Pipeline The production deploy with double-gate ​

💠 Pipeline The dry-run before production ​

The recommended pattern for production deploys:

💠 Pipeline Multi-app deploy ​


5. Edge cases & refusals ​

TriggerWhat /wbDeploy does
No targetHalt.
Free-text targetHalt.
Working tree dirty (uncommitted changes)Warn prominently; ask confirmation. The deploy will reflect uncommitted state if proceed.
--prod on a commit that isn't on mainRefuse. Production deploys must be from a known-good branch.
Missing host credentialsHalt with explicit setup instructions.
--target="<unknown>"Halt. Lists known environments.
--prod --dry-runPermitted; safest combination for "preview the production behavior."
Build failsHalt; no upload.
Upload fails partwayReports clearly which app/env succeeded and which didn't.
Multi-app deploy with one build failureRefuse all uploads. Atomic-by-build.
Free-text "rollback"Refuse — rollback isn't an undo, it's a deploy. Suggests the explicit re-deploy of the previous artifact.

Post-deploy symptoms (GitHub Pages) ​

These land after the command reports success, which is why the practical layer insists you open the URL yourself — no gate catches any of them.

SymptomLikely causeFix
Page blank, assets 404vite base ≠ deploy base-urlMatch them, including both slashes
Refresh on a deep link → 404spa-fallback not setSet spa-fallback: true, redeploy
"Page not found" at the rootgh-pages branch emptyCheck Settings → Pages → Source
CSS loads but JS doesn'ttype="module" served with the wrong MIMEGitHub Pages quirk; usually self-resolves after a rebuild
Push succeeded but old content showsGitHub Pages cacheWait 5–10 min, then hard refresh
CNAME disappears every deploygenerate-cname: false with no manual fileEither auto-generate or commit the CNAME

The pattern: /wbDeploy is the irreversible operation in the QA chain. Multiple gates, dry-run encouraged, --prod is loud, atomic-by-build for multi-app deploys, and rollback is another deploy (not undo). It refuses to deploy from dirty trees without explicit acknowledgment, refuses to deploy to unknown environments, refuses to partially deploy when builds fail. The boundary with /wbRelease (version bumps, git tags) and /wbPublish (npm) is hard: deploy ships apps; release coordinates versions; publish ships packages.