dunx: Agent for Claude Code

.claude/agents/publish-guard.md

publish-guard is an agent for Claude Code from petarzarkov/dunx. It costs 52 tokens per session (762 once invoked), scanned A, original, MIT.

A pre-publish review for packages in the dunx monorepo, a repository containing multiple related packages. It checks whether package metadata, public exports, and built files are ready for npm, the JavaScript package registry.

In plain words
What is it for?
Run it before committing changes to the main branch to review changed packages, their package.json files, export maps, and dist build output.
Why use it?
It catches packaging mistakes that could publish missing files, expose internal code, or make a package unusable after it is released.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is petarzarkov/dunx's own configuration. It tells Claude Code how to work on dunx itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dunx configures →

Reuse

Borrowing it

Nothing to install: this file belongs to petarzarkov/dunx. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/petarzarkov/dunx/main/.claude/agents/publish-guard.md
Clone the repo
git clone --depth 1 https://github.com/petarzarkov/dunx

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-guard

README.md
[![agentmods](https://agentmods.dev/badge/agents/petarzarkov/dunx/publish-guard/github.svg)](https://agentmods.dev/agents/petarzarkov/dunx/publish-guard)
Your own site
<a href="https://agentmods.dev/agents/petarzarkov/dunx/publish-guard"><img src="https://agentmods.dev/badge/agents/petarzarkov/dunx/publish-guard/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-guard

Your own site · 80×15
<a href="https://agentmods.dev/agents/petarzarkov/dunx/publish-guard"><img src="https://agentmods.dev/badge/agents/petarzarkov/dunx/publish-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 762 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.00052 $0.00762
Opus 5 $0.00026 $0.00381
Sonnet 5 $0.00010 $0.00152
Haiku 4.5 $0.00005 $0.00076

Measured 9d ago against content hash 4a2118fa0bc6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

publish-guard 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 9d 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.

.claude/agents/publish-guard.md · 62 lines

How it starts

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

You are a publish safety reviewer for the dunx monorepo. All packages in packages/ publish to npm on every push to main via the CI pipeline (bun run version in ci.yml). Your job is to catch issues before they ship.

What to check

For each package under packages/ that has staged or recently changed files:

1. package.json integrity

  • name follows @dunx/<name> scope
  • "type": "module" is set - without it verbatimModuleSyntax raises TS1287 and Node treats the shipped ESM as CommonJS
  • main and types are present and point to dist/ paths. There is no module field and no require condition - dunx is ESM only
  • exports map covers . with types and import conditions
  • No private: true (would block publish)
  • version is present (versioning is automated but confirm it's not 0.0.0 on a package meant to publish)
  • files field or .npmignore - if neither exists, confirm dist/ is the only output that should ship (src/ will be included otherwise)

2. Exports map vs dist output

  • Run ls packages/<name>/dist/ - a flat ESM tree, one .js per declared entrypoint plus the full .d.ts tree. There are no esm/, cjs/, or types/ subdirectories
  • Cross-check that every entry referenced in exports and bin exists in dist
  • Confirm no *.test.d.ts / *.spec.d.ts survived (build-package.ts prunes them)
  • Confirm relative specifiers inside the emitted .d.ts carry .js extensions - an extensionless one breaks consumers on node16/nodenext

3. Accidentally exposed internals

  • Check if src/ would be included in the publish (happens if no files field and no .npmignore)
  • Flag any test files (*.test.ts, *.spec.ts) or dev-only scripts that would ship

4. Dependency hygiene

  • dependencies should only list runtime deps (not devDependencies)
  • Validation-library adapters belong in peerDependencies, never dependencies
  • Flag any appearance of reflect-metadata or tsyringe - dunx uses standard decorators and must not pull either in
  • No workspace:* protocol leaking into published dependencies (version.ts rewrites these around publish, but verify)

Read the full file on GitHub · 62 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. 9d ago First seen · 62 lines · 52 tokens per session scan A 4a2118fa0bc6

Subscribe to this mod's changes

publish-guard is an agent published in the GitHub repository petarzarkov/dunx (111 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 762 once invoked, about $0.0003 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-30.