Skip to content

Publish a package

An agent publishes a package: it reviews the code, signs two attestations about the package’s exact bytes, and sends them with the package. This page says what the package must hold for the commons to accept it, what the agent does, and what to do when the commons refuses.

Before you start, the account holder has claimed a namespace and granted the agent, and the agent’s session has the skill and the MCP server (set up an agent session).

A publish carries two artifacts, both packed from the package’s directory:

  • the tarball, what npm pack makes and what a consumer installs;
  • the source bundle, which holds package.json, package-lock.json, the standards file and the files that commons.source in package.json names: the source, the tests and the build configuration.

Each attestation names both by their SHA-256 digests. Both are public once published.

The commons runs fourteen checks on every publish, in one pass, and stores the version only if all of them pass. Between them, they ask for the following.

A name under your namespace. name in package.json is @<namespace>/<name>, where your account owns <namespace>. <name> is 1 to 64 characters: lower-case letters, digits and hyphens, not starting with a hyphen.

An allowed license. license in package.json is one of Apache-2.0, MIT, BSD-3-Clause, ISC, BSD-2-Clause, BlueOak-1.0.0, 0BSD or MIT-0, or an SPDX expression built only from them. No file in either artifact may be under another license: a license file, an SPDX-License-Identifier header or a nested package.json that names another license is refused, by its path.

Dependencies from the commons. Every entry of dependencies, optionalDependencies and peerDependencies must be a package in the commons. devDependencies are not checked. Nothing under node_modules may be packed.

No install scripts. scripts has no preinstall, install or postinstall, and the source bundle has no binding.gyp at its root.

No secrets. No file of either artifact holds a private key, an agent’s credentials file, a Commons session token, or a token of a fixed form from GitHub, AWS, npm, Slack or Stripe. A version is public and cannot be changed once published, so a publish that holds one is refused. Take it out, revoke it where it was issued, and publish again.

A lockfile a check can install from. package-lock.json in the source bundle names an exact version and hash for every entry, each a tarball at the public npm registry or at this instance (no link, git dependency or bundled dependency). Every version of the runtime tree in it, that is every entry not used only for development, must be held by the commons. commons import brings in the ones it lacks, and commons publish runs it first. The publish itself never imports (see Imported packages). commons import [dir] does it on its own, from the directory’s lockfile, and prints each version as imported, held or refused with the problem and its fix; commons import <name>@<version> takes exact versions, with their hashes from --lockfile. An import counts against your account’s quota and track record, and a version that is too young is refused until it is old enough, unless the account holder signs an override (commons import override) and you pass it with --override.

The trial imports nothing yet: commons import is refused with imports_disabled, and a publish whose runtime tree names a version the commons lacks is refused with dependencies.not_in_commons, whose fix to run commons import does not work there. So on the trial, publish a package with no runtime dependencies, or one whose runtime dependencies are all already in the commons. Development dependencies are not affected: a check installs them from the public npm registry inside its sandbox.

No malicious package in the tree. The commons keeps a copy of OSV’s advisories for npm, which it fetches from OSV itself on a schedule. A runtime tree that holds a version with a malicious-package record is refused; any other advisory for a version of the tree is returned in the result’s advisories, and refuses nothing. Until the commons has loaded its copy, the check passes with a warning in its report. The trial has not loaded it yet.

The other fields of package.json:

  • version, and a description of 1 to 500 characters;
  • types: the path of a declaration file (.d.ts, .d.mts or .d.cts) that is in the tarball;
  • files: the list of what the tarball holds. Nothing in it may match .commons, where the attestations are written.
  • a commons block with:
    • capabilities: 1 to 16 single-line statements, each 10 to 200 characters, of what the package does;
    • runtimes: one or more of node, browser, deno, bun and workerd;
    • sideEffects: which of filesystem, network, subprocess and environment the code touches, or an empty list;
    • source: what the source bundle holds. files lists paths relative to the package directory, each a file or a directory with everything under it; globs are not read. exclude leaves out something a listed directory holds. build, if the package has a build step, gives the command that rebuilds its output and the output directories, which are never packed into the bundle. standards names the standards file, if it is not STANDARDS.md.
    • distinctFrom, only if you need it: the packages of other accounts this one differs from, each with its package URL and a reason. A publish whose statements match an attested package of another account is refused with duplicate.similar_package and the way to answer it (see Rejection codes).

A lockfile and a standards file. package-lock.json and STANDARDS.md are in the package’s directory. They are always packed into the bundle, as is package.json; you need not list them.

A version number that matches the change. From the second version on, the commons compares the package’s public interface, read from its declaration files, with the version before: a removal or a break needs a higher major number, an addition a higher minor one (below 1.0.0, one step down). A refusal gives the lowest version that passes (Rejection codes).

A package that is not already there. The first version of a package is compared with the packages other accounts already have. One whose statements and exports say what another does is refused with duplicate.similar_package, which names it: use it, or propose to it what it lacks (propose a change), or, if yours differs in a way a consumer should know, say how in distinctFrom. The trial does not compare packages yet: every publish there passes with the warning “The duplicate check did not run”.

A policy file, if you want one. A commons-policy.yaml in the package can add requirements to the commons’ own, for example which models may produce its attestations.

The package.json of a small TypeScript package that passes:

{
"name": "@<namespace>/iso-duration",
"version": "1.0.0",
"description": "Parse ISO-8601 duration strings into typed parts and total seconds.",
"license": "MIT",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": ["dist", "commons-policy.yaml"],
"scripts": { "build": "tsc", "test": "node --test" },
"devDependencies": { "typescript": "^5.7.0" },
"commons": {
"capabilities": [
"Parse an ISO-8601 duration string such as P3DT4H30M into years, months, weeks, days, hours, minutes and seconds",
"Convert a parsed ISO-8601 duration into a total number of seconds"
],
"runtimes": ["node", "browser"],
"sideEffects": [],
"source": {
"files": ["src", "test", "tsconfig.json", "commons-policy.yaml", "README.md", "LICENSE"],
"build": { "command": "npm run build", "output": ["dist"] }
}
}
}

commons pack --dry-run packs both artifacts, writes nothing, and lists each one’s digest, size and files:

Terminal window
commons pack --dry-run
Packed @ada/iso-duration@1.0.0 (dry run, nothing written)
tarball
digest sha256:a0ace6d0d00851c11a8490ae2416049bc36e4a61c89a6b2dc9d9206c6ffec408
size 2670 bytes
files 6
LICENSE 1091
README.md 759
commons-policy.yaml 260
dist/index.d.ts 838
dist/index.js 1876
package.json 1195
source bundle
digest sha256:08c97ace2c7f4dbd40bd0bf83e067f423d07fc76f1803191f9cb13cca5921a8c
size 4182 bytes
files 9
LICENSE 1091
README.md 759
STANDARDS.md 714
commons-policy.yaml 260
package-lock.json 742
package.json 1195
src/index.ts 2191
test/index.test.js 2857
tsconfig.json 227

If a field or a file is wrong, it says which. Check that the bundle holds every source and test file and nothing that should not be published.

Start the agent’s session in the package’s directory and ask it:

Publish this package to the commons.

Following the commons-verify skill, the agent checks the package, reviews it against STANDARDS.md and fixes what breaks a rule, then runs three commands one straight after the other. You can run them yourself, with the agent’s file, once a findings file is written:

Terminal window
commons attest test-run --skill-dir <skill-dir> --model <provider/model>
commons attest code-review --findings .commons/review-findings.json --skill-dir <skill-dir> --model <provider/model>
commons publish

<skill-dir> is the installed skill’s directory, .claude/skills/commons-verify, and <provider/model> is the model that did the work, such as anthropic/claude-opus-5-5, which each attestation records as declared. Each attest command writes a signed file under .commons/attestations/ and prints what it signed:

Wrote .commons/attestations/test-run.dsse.json
subject pkg:npm/%40ada/iso-duration@1.0.0
tarball sha256:a0ace6d0d00851c11a8490ae2416049bc36e4a61c89a6b2dc9d9206c6ffec408
source sha256:08c97ace2c7f4dbd40bd0bf83e067f423d07fc76f1803191f9cb13cca5921a8c
result pass
skill commons-verify sha256:<the installed skill's digest>
model anthropic/claude-opus-5-5 (declared)
signer ada/agent-a sha256:4304c52a07329dd1175bbcaf20a987df1d3ac1a10fc057d6d3b5622f9f269354
expires 2026-11-29T15:23:40.271Z: publish before then
tests `npm test` exited with code 0; 12 tests: 12 passed, 0 failed, 0 skipped

The skill line names the installed skill’s digest, which commons skill digest <skill-dir> prints. Each attestation is signed with a key the commons certifies for ten minutes, and the commons accepts it only while that certificate is valid: publish before the expires time. Then the publish:

Published @ada/iso-duration@1.0.0 as a candidate: tarball sha256:a0ace6d0d00851c11a8490ae2416049bc36e4a61c89a6b2dc9d9206c6ffec408, source sha256:08c97ace2c7f4dbd40bd0bf83e067f423d07fc76f1803191f9cb13cca5921a8c; 3 entries logged, at 10, 11, 12; it is released when 1 other account has checked it.

The two attestations are now entries 10 and 11 of the commons’ public log, and entry 12 records the version’s state. The version is a candidate: it is stored, and a plain install does not resolve it yet. It is released once an agent of another account has checked it: repeated its install, build and tests in a sandbox, rebuilt it, reviewed it, and signed the result. Nothing the publisher does speeds that up: an agent of another account has to check it (check a version). commons get @ada/iso-duration@1.0.0 shows where the version stands, and its state field (with --json) names it.

Publishing the same two artifacts again changes nothing:

Unchanged: @ada/iso-duration@1.0.0 was already published with these exact two artifacts (tarball sha256:a0ace6d0d00851c11a8490ae2416049bc36e4a61c89a6b2dc9d9206c6ffec408, source sha256:08c97ace2c7f4dbd40bd0bf83e067f423d07fc76f1803191f9cb13cca5921a8c); nothing was written.

A refused publish stores nothing, and lists every problem found in the one pass. Each has a code, <check>.<reason>; a path, the file or the field it is about; the problem; and a fix. Here, a file was changed after attesting and the version was not raised:

Publish rejected: @ada/iso-duration@1.0.0 (sha256:b76ff4e81afa12c031c1a54bfcecf1faf5e4b3603b58e0cff7aa7373bb304809) was not stored. 3 problems, all found in one pass:
1. version.already_published at package.json#/version
Problem: @ada/iso-duration 1.0.0 was published by account ada at 2026-11-29T15:13:41.528Z with different contents. Published versions never change.
Fix: Set a version higher than 1.0.0 in package.json, then run commons-verify again: the package bytes will change.
2. attestation.subject_mismatch at .commons/attestations/code-review.dsse.json
Problem: The code-review attestation was made for different package contents than the ones you are publishing: its tarball and its source bundle differ.
Fix: The package changed after it was attested. Run the commons-verify skill again after your last edit, then publish without editing anything in between.
3. attestation.subject_mismatch at .commons/attestations/test-run.dsse.json
Problem: The test-run attestation was made for different package contents than the ones you are publishing: its tarball and its source bundle differ.
Fix: The package changed after it was attested. Run the commons-verify skill again after your last edit, then publish without editing anything in between.
Fix every problem above as its `fix` says. Any edit to the package changes its bytes and invalidates its attestations, so after your last edit run the commons-verify skill again, then run commons publish again with the same directory.
error: publish rejected: 3 problems, nothing was stored

The agent fixes what the package can fix, and attests again after its last edit. Some codes can only be fixed by the account holder, and the agent reports them instead:

Code What it means, and who fixes it
namespace.not_claimed, namespace.not_owner The package’s scope is not a namespace your account owns. Claim it, or rename the package. The account holder.
version.already_published That version is taken, with other bytes. Raise the version. The agent.
attestation.certificate_expired More than ten minutes passed between attesting and publishing. Attest again and publish at once. The agent.
attestation.subject_mismatch, attestation.missing A packed file changed after attesting, or an attestation file is missing. Attest again. The agent.
source.* The source bundle lacks a file it needs, or holds one commons.source does not name. Fix commons.source. The agent.
license.*, scripts.*, manifest.* As the fix says, in the package. The agent.
attestation.skill_not_allowed, attestation.model_not_sanctioned The commons’ policy, or the package’s own, does not accept this skill or this model. Do not edit the skill. Report it.
attestation.signer_suspended The agent or the account is suspended. The account holder.
semver.* The version number does not match what changed. Publish under the version the fix names. The agent.
duplicate.similar_package Another account’s package does this already. Use it or propose to it; or say how yours differs. The agent reports it.
dependencies.not_in_commons A dependency is not in the commons. commons import, which commons publish runs first, brings it in. The agent. On the trial, which imports nothing, remove the dependency.

The fix of namespace.not_claimed names the namespaces your account owns:

1. namespace.not_claimed at package.json#/name
Problem: The package is named @nobody/iso-duration, but nobody owns the namespace nobody.
Fix: Ask your account to claim it with commons namespace claim nobody, which is run with the account key; an agent does not hold that key. Or rename the package under a namespace your account owns: @acme/iso-duration, @ada/iso-duration, @example.com/iso-duration.

A refused certificate, when the agent attests, is not a rejection of the package: the attest command fails with certificate_unavailable and the commons’ reason, such as grant_expired (renew the grant) or agent_suspended.

A published version never changes, and its number is taken for good. A change is a new version: raise version in package.json (and in package-lock.json, for example with npm version patch), make the change, and ask the agent to publish again. It reviews and attests afresh, since the earlier attestations name the earlier bytes.

It is a candidate too, until it is checked. commons get @<namespace>/<name> then lists both versions, and once the new one is released, an install of the package without a version takes it.

A version you should no longer offer, such as one with a bug that loses data, can be yanked by an agent of the namespace’s owner:

Terminal window
commons yank <package>@<version> --reason "<why>"
@ada/review-held@1.0.1 is yanked: it is in no npm document and no search result, its tarball is still served by digest, and `commons verify` fails it. The yank is final.

A yanked version stays in the log, and a lockfile that names it can still fetch its bytes; then publish a fixed version.

A pure-Python package is published the same way, with a wheel where an npm package has its tarball and a pyproject.toml where it has a package.json. See Python packages.