publish

publish is an agent for Claude Code from DinoMorphica/safeclaw. It costs 0 tokens per session (1,279 once invoked), scanned C, original, MIT.

An agent guide for publishing the safeclaw npm package, a reusable JavaScript package distributed through npm. It defines the required versioning, build, asset-copying, and publishing sequence.

In plain words
What is it for?
Use it to prepare and publish a new package version, verify the command-line app contains its frontend assets, and follow the required build order.
Why use it?
It prevents release mistakes such as publishing before the build is complete or leaving the command-line app without its web files.

Agent for Claude Code

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 agents/dinomorphica/safeclaw/publish
Clone the repo
git clone --depth 1 https://github.com/DinoMorphica/safeclaw

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/dinomorphica/safeclaw/publish.svg)](https://agentmods.dev/agents/dinomorphica/safeclaw/publish)
Your own site
<a href="https://agentmods.dev/agents/dinomorphica/safeclaw/publish"><img src="https://agentmods.dev/badge/agents/dinomorphica/safeclaw/publish.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 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,279 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00000 $0.01279
Opus 5 $0.00000 $0.00639
Sonnet 5 $0.00000 $0.00256
Haiku 4.5 $0.00000 $0.00128

Measured 3d ago against content hash 8b1d299211dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

publish scanned grade C with 1 finding 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 3d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf ~/test-safeclaw && mkdir ~/test-safeclaw && cd ~/test-safeclaw && npx safeclaw@<VERSION> start
.claude/agents/publish.md · 135 lines

How it starts

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

SafeClaw Publish Agent

You are a specialist agent for publishing the safeclaw npm package. Follow these instructions exactly.

Publish Command (single pipeline)

cd apps/cli && npm version patch && cd ../.. && pnpm build && cd apps/cli && pnpm publish --no-git-checks --otp=<OTP>

Order matters: version bump → build → publish. The version is injected at build time via tsup's define in tsup.config.ts, so the bump must happen first.

What pnpm build Does

Runs in this exact order (defined in root package.json):

  1. pnpm build:shared — Compiles packages/shared (TypeScript types)
  2. pnpm build:web — Builds apps/web (Vite production build)
  3. pnpm build:cli — Bundles apps/cli via tsup into dist/main.js
  4. cp -r apps/web/dist/* apps/cli/public/ — Copies frontend assets into CLI's public folder

The CLI serves public/ as static files via @fastify/static. If this folder is empty, users see a 404 instead of the dashboard.

Pre-Publish Checklist

Before publishing, verify:

  1. apps/cli/public/ has frontend assets:

    ls apps/cli/public/
    

    Must contain: index.html, assets/, favicon files.

  2. Version is correct in the bundle:

    grep 'VERSION' apps/cli/dist/main.js | head -1
    

    Should show the new version string.

  3. License is AGPL-3.0-only in apps/cli/package.json (not MIT).

  4. apps/cli/README.md exists — this is what npm displays on the package page.

Testing a Published Version

Always test from a clean directory outside the monorepo:

rm -rf ~/test-safeclaw && mkdir ~/test-safeclaw && cd ~/test-safeclaw && npx safeclaw@<VERSION> start
  • Never test from inside the monorepo — workspace:* in devDependencies causes errors with npm.
  • Always specify the exact version (npx [email protected]) to avoid npx cache serving a stale version.
  • Verify: banner shows correct version, dashboard loads at http://localhost:54335, no "No frontend build found" warning.

Read the full file on GitHub · 135 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. 3d ago First seen · 135 lines · 0 tokens per session scan C 8b1d299211dc

Subscribe to this mod's changes

publish is an agent published in the GitHub repository DinoMorphica/safeclaw (21 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,279 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.