publish-gate

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

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.

agentmods
npx agentmods add commands/rajconnects/founder-stack/publish-gate
Clone the repo
git clone --depth 1 https://github.com/rajconnects/founder-stack
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. Scan, not verified.
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 $0.00043 $0.01034
Opus 5 $0.00022 $0.00517
Sonnet 5 $0.00009 $0.00207
Haiku 4.5 $0.00004 $0.00103

Measured 2d ago against content hash 8791b2fdf573, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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: npmnpm pack, dockerdocker build, pythonpython -m build). Capture the output file path.

    c. Install into a fresh tmpdir. mktemp -dcd 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. 2d 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 (2 stars, last pushed 1mo ago), licensed MIT. It adds 43 tokens to every session and 1,034 once invoked, about $0.0002 per session on Opus 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.