publish-gate

publish-gate is a command for Claude Code from rajconnects/founder-stack. It costs 43 tokens per session (1,034 once invoked), scanned A, original, MIT.

A release check that packages a project, installs the resulting archive in a temporary folder, runs a smoke test, and checks its output. A smoke test is a small check that confirms the main behavior works.

In plain words
What is it for?
Use it before publishing an npm package or another packaged artifact to test what a fresh consumer will actually install.
Why use it?
It catches problems that local tests can miss, such as missing packaged files, stale build output, or install scripts that fail for new users.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions Claude Code.

Part of the founder-stack plugin — 21 commands, 13 agents shipped together

Good fit Use it before publishing an npm package or another packaged artifact to test what a fresh consumer will actually install.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/rajconnects/founder-stack/publish-gate
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/rajconnects/founder-stack

Made for: Claude Code.

Or install founder-stack, the plugin that ships this one along with the rest of its 21 commands, 13 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for publish-gate

README.md
[![agentmods](https://agentmods.dev/badge/commands/rajconnects/founder-stack/publish-gate/github.svg)](https://agentmods.dev/commands/rajconnects/founder-stack/publish-gate)
Your own site
<a href="https://agentmods.dev/commands/rajconnects/founder-stack/publish-gate"><img src="https://agentmods.dev/badge/commands/rajconnects/founder-stack/publish-gate/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for publish-gate

Your own site · 80×15
<a href="https://agentmods.dev/commands/rajconnects/founder-stack/publish-gate"><img src="https://agentmods.dev/badge/commands/rajconnects/founder-stack/publish-gate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,034 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.01034
Opus 5.5 $0.00017 $0.00414
Sonnet 5.5 $0.00009 $0.00207
Haiku 4.5 $0.00004 $0.00103

Measured 1mo ago against content hash 8791b2fdf573, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

publish-gate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

workflow/commands/publish-gate.md · 54 lines

How it starts

The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are running the publish gate. This gate runs BEFORE the user runs npm publish (or equivalent). It validates that the artifact you're about to ship will actually work when a fresh consumer installs it.

Arguments: $ARGUMENTS

Why this gate exists

prepublishOnly runs unit tests against your local source tree. Unit tests do not catch:

  • Files referenced from package.json (bin, hooks, scripts) that are missing from the files allowlist → consumer install crashes with MODULE_NOT_FOUND.
  • Postinstall hooks that work in dev because the file lives in the working directory, but fail in install because the working directory is the npm cache.
  • Build artifacts in dist/ that are stale because someone forgot to run npm run build before publishing.
  • Any "works on my machine" gap between the dev checkout and the tarball.

This gate closes that gap by installing the actual tarball and running it as a fresh consumer.

Steps

  1. Read .claude/project.json. Extract the release_artifacts array. If absent or empty, fail fast: "publish-gate requires release_artifacts in project.json. Skip this gate if the project doesn't ship a packaged artifact."

  2. Filter to scope. If $ARGUMENTS is empty, run all artifacts. Otherwise, run only the artifact whose name matches $ARGUMENTS. If no match, list available names and fail.

  3. For each artifact, in sequence:

    a. cd into path (the artifact's source root, e.g. apps/<package-name>).

    b. Pack. Run npm pack --pack-destination /tmp/<artifact-name>-pack (or the equivalent for the artifact type: npm → npm pack, docker → docker build, python → python -m build). Capture the output file path.

    c. Install into a fresh tmpdir. mktemp -d → cd into it → install the local tarball (npm install <tarball-path> or equivalent). For npm, use --prefix . to keep the install local to the tmpdir, so this gate never touches the user's global modules.

    d. Run the smoke command. Execute smoke (the field on the artifact entry — e.g. <package-name> --version or <package-name> doctor) from inside the tmpdir, with the local node_modules/.bin on PATH if needed.

Read the full file on GitHub · 54 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 54 lines · 43 tokens per session scan A 8791b2fdf573

Subscribe to this mod's changes

publish-gate is a command published in the GitHub repository rajconnects/founder-stack (3 stars, last pushed 3mo ago), licensed MIT. It adds 43 tokens to every session and 1,034 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.