Skip to content

/wbPublish — Exhaustive Simulation () ​

/wbPublish is the shipper of packages to npm. Its job is the narrow segment between "tagged release" and "consumers can install it": run the build, validate the manifest, push to the registry, verify the published version is reachable. It does not coordinate versions (that's /wbRelease) and does not deploy apps (that's /wbDeploy).

Read this if you want to know what the four flags do, why --all is dangerous-by-default, and how the publish step interacts with the dist-folder mismatch parked in this workspace's memory.


1. Role & target ​

AspectBehavior
RoleThe Shipper — pushes packages to npm.
TargetA specific package (default: the one whose tag was most recently created) or --all for every package with a current tag awaiting publish.
Cell scopeNone directly.
Side effects allowedRunning npm publish (or pnpm equivalent); reading the registry to verify post-publish; warning on dist-folder mismatches.
Side effects forbiddenModifying source code; bumping versions (already done by /wbRelease); creating tags; deploying apps.

The "narrow segment" framing is the design center. The full ship flow has three commands — /wbRelease produces the version state, /wbPublish puts the package on npm, /wbDeploy puts apps on the web. Each command's failure mode is independent: a publish failure doesn't mean rollback the version; a deploy failure doesn't mean unpublish. The seams hold.


2. Argument resolution matrix ​

FormExampleWhat /wbPublish does
No argumentCommand: /wbPublishPublishes the package whose latest tag was most recently created and not yet on the registry.
Specific packageCommand: /wbPublish core2/packages/wb-corePublishes that one package. Most explicit.
--allCommand: /wbPublish --allPublishes every package whose current version isn't on the registry. Sequential; halts on first failure.
Free-textCommand: /wbPublish "the auth package"Refused — path required.

3. Flag matrix ​

FlagShortcutPurpose
--all-APublishes every package in the monorepo whose tag-version isn't already on the registry.
--dry-run-dValidates manifest, runs build, reports what would publish. Does not call npm.
--prerelease-pPublishes with the next (or pre-release) dist-tag instead of latest. Required for pre-release versions like 1.4.0-beta.0.
--restore-rRe-publishes a previously-failed publish attempt (same version) using the same artifacts. Useful when a registry hiccup caused the first attempt to fail mid-upload.

Why --all is dangerous-by-default ​

Publishing everything in one command means: if the registry is having issues partway through, you might be left with packages 1-3 published and packages 4-6 not — a half-shipped state. The agent treats --all as needing extra caution:

Without --allWith --all
Single package; one decision.Multi-package; cascading decisions.
Failure stops one publish.Failure stops the chain at whatever point.
Confirmation prompt: 1Confirmation prompts: per-package + summary.
Rollback: --restore re-runs the failed publish.Rollback: --restore per failed publish.

The agent always recommends not using --all unless the user is intentionally publishing a coordinated multi-package release.

How --dry-run validates ​

StepLiveDry-run
Read package.json + check version is taggedYesYes
Build (if needed)YesYes
Validate manifest (files field, main field, exports field)YesYes
Check dist-folder reality (does the file main points at exist?)YesYes
Pack tarballYesYes (cached locally)
Push to registryYesSkipped; logs what would push
Verify post-pushYesSkipped

The manifest validation is where the dist-folder mismatch surfaces. If main points at dist/index.js but the build wrote to dist-dev/index.js, dry-run catches it before any registry call.


4. Pipelines (the agent-native scenarios) ​

📋/wbPublish Exhaustive Simulation
The dry-run that catches the dist-folder mismatch/wbPublish core2/packages/wbc-ui2-cdn --dry-run
> /wbPublish core2/packages/wbc-ui2-cdn --dry-run
[SYSTEM] Dry run.
[CHECK] Reading package.json...
name: @wbc-ui2/wbc-ui2-cdn
version: 1.0.0
main: ./dist/index.js
[CHECK] Tag for v1.0.0 exists? Yes.
[BUILD] Running build...
Output: dist-dev/index.js (vite outDir = dist-dev)
[VALIDATE] Manifest sanity:
- main: ./dist/index.js
- dist/ exists? **NO**
- dist-dev/index.js exists? Yes.
[**FAIL**] Manifest claims main is at ./dist/index.js but the file
does not exist at that path.
[CONTEXT] Memory: project_pkg_dist_mismatch.md records this as
parked tech debt — both candidate fixes (update main, or
reconfigure vite) have unresolved trade-offs.
[REFUSE] /wbPublish will not publish a package whose `main` field
points at a non-existent file. Consumers would resolve the
module and find nothing.
[NEXT STEPS]
Option A: Decide the parked dist-folder question first.
Open the architecture conversation; pick one of the two fixes;
then re-run /wbPublish.
Option B: Manual workaround for an emergency publish:
pnpm --filter wbc-ui2-cdn build (writes to dist/ via different path)
Then re-run /wbPublish --dry-run to verify before publish.
[NO REGISTRY CALL] Dry-run halted at validation.
⚠️ Note: A real situation in this workspace: `core2/packages/wbc-ui2-cdn/` has a parked dist-folder mismatch (per `project_pkg_dist_mismatch.md`). What happens when someone tries to publish it?

💠 Pipeline The dry-run that catches the dist-folder mismatch ​

A real situation in this workspace: core2/packages/wbc-ui2-cdn/ has a parked dist-folder mismatch (per project_pkg_dist_mismatch.md). What happens when someone tries to publish it?

💠 Pipeline A clean single-package publish ​

💠 Pipeline --all with a partial failure ​

💠 Pipeline The pre-release path ​


5. Edge cases & refusals ​

TriggerWhat /wbPublish does
No tag for the versionHalt. Says "run /wbRelease first."
Already on registryHalt. Says "this version is published. Bump first."
Dirty working treeHalt. Same as /wbRelease — clean tree required.
Manifest mismatch (main file doesn't exist)Halt. Suggests the parked-decision conversation if memory flags it.
--dry-run + --allPermitted and recommended pattern.
--restore for a publish that succeededHonest "already on registry; nothing to restore."
Free-text targetHalt.
--prerelease for a non-prerelease version (no -beta/-rc suffix)Halt. The flag and the version must agree.
Network/registry failure mid-publishReports clearly. --restore re-attempts using the same packed tarball.
User asks to unpublishRefuse. Unpublish is a destructive npm op with policy implications; not in /wbPublish's lane. Tells the user to use npm unpublish directly with full understanding.

The pattern: /wbPublish is the npm registry interface — narrow, manifest-validating, dist-folder-aware. It refuses to publish bad manifests, refuses to bypass the parked-decision conversation, refuses to silently overwrite latest with pre-releases. The dry-run is the recommended first step, especially for --all which is dangerous-by-default. Memory awareness shows up most clearly here: the dist-folder mismatch parked in project_pkg_dist_mismatch.md is a publish-blocker, and /wbPublish won't paper over it.