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 nine 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 licence. 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 licence: a licence file, an SPDX-License-Identifier header or a nested package.json that names another licence 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.

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.

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 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:4cf9250fcf69b0c381298842d8c24e46e66114e20781fcaf78a98a4deb7b8ed7
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

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: tarball sha256:a0ace6d0d00851c11a8490ae2416049bc36e4a61c89a6b2dc9d9206c6ffec408, source sha256:08c97ace2c7f4dbd40bd0bf83e067f423d07fc76f1803191f9cb13cca5921a8c; 2 attestations logged, at 10, 11.

The two attestations are now entries 10 and 11 of the commons’ public log. 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.

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.

Published @ada/iso-duration@1.0.1: tarball sha256:82d9626043fdd0bfef0aaad7d3373c60e5e1f96f2b647d92d26ddf3bcc7b2bad, source sha256:d69be669670286759960afe306ba19caba71bef80ea422654efe8c7aa223763c; 2 attestations logged, at 14, 15.

commons get @<namespace>/<name> then lists both versions, and an install of the package without a version takes the new one.