Skip to content

Publish plugin: run the locked Claude Code through cli-wrapper.cjs - #48

Open
pratzm wants to merge 1 commit into
mainfrom
psd/publish-validate-launcher
Open

pratzm wants to merge 1 commit into
mainfrom
psd/publish-validate-launcher

Conversation

@pratzm

@pratzm pratzm commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Fix "Validate the marketplace" in reusable-publish-plugin.yml, which fails on every publish since v1.1.0 because npm ci --ignore-scripts leaves claude a stub that won't run.

The package's postinstall (install.cjs) copies the native binary from the platform package (@anthropic-ai/claude-code-<platform>) over bin/claude.exe. With --ignore-scripts that copy never happens, so claude exits with:

Error: claude native binary not installed.
Either postinstall did not run (--ignore-scripts, some pnpm configs)

This PR runs the CLI through the package's cli-wrapper.cjs, which finds and runs the binary in that same locked platform package. The install stays locked and integrity-checked, and still runs no scripts. The step moves into scripts/validate-marketplace.sh (matching the repo's other publish scripts), with scripts/validate-marketplace.test.sh run by publish-plugin-test.yml. That workflow now also runs when tools/claude-code/ changes, so a bump of the locked CLI is tested before it ships.

It surfaced in psd401/psd-collab-mcp's first publish at v1.1.0: https://github.com/psd401/psd-collab-mcp/actions/runs/41918450955. A patch release (v1.2.2) would let callers pick it up through Dependabot.

AI disclosure

Claude Code (Opus 5.5), working for Mason, found the cause and wrote the script, test and workflow changes. No human has reviewed the code yet.

Evidence

  • Reproduced locally with this repo's tools/claude-code lockfile: npm ci --ignore-scripts, then claude --version gives the error above.
  • Test first, against the step as it is now (extracted unchanged into the script): both tests fail. The valid marketplace fails with the error above, and the invalid one fails without naming the bad field (the launcher failing, not the validator refusing).
  • After the fix, bash scripts/validate-marketplace.test.sh gives all passed: the valid marketplace prints "Validation passed", and the invalid one is refused with plugins: Invalid input: expected array, received string.
  • node …/cli-wrapper.cjs plugin validate . passes on psd-collab-mcp's plugin/ with the locked 2.1.293.

Not changed, but stale: publish-plugin-test.yml's ABOUTME says callers use the reusable at @main; they pin to release SHAs now.

🤖 Generated with Claude Code

`npm ci --ignore-scripts` skips the package's postinstall, which copies the
native binary over bin/claude.exe; without it `claude` is a stub that exits
with "claude native binary not installed", so every publish since v1.1.0
fails at "Validate the marketplace". cli-wrapper.cjs runs the binary from
the same locked platform package with no install script.

The step moves into scripts/validate-marketplace.sh with a test that runs
the real locked CLI against a valid and an invalid marketplace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant