Publish
Publishing from Claude Code
Give Claude Code a scoped publishing token, keep it in the OS credential store, and publish with a dry run and your approval.
Claude Code can prepare, validate and publish an artifact for you through the skills CLI. It acts with a scoped token: enough to publish in your namespace, nothing more.
1. Create a publisher token
Ask for exactly the publishing scopes, your namespace, and an expiry:
| Scope | Why |
|---|---|
artifacts:read | Read your own private and draft artifacts |
artifacts:create | Create an artifact in your namespace |
artifacts:update | Edit summary, links, keywords, visibility |
uploads:create | Begin an upload and send the archive |
releases:publish | Finalize the upload into a release |
releases:update | Edit release notes (content stays immutable) |
This token cannot revoke releases, deprecate artifacts, create or list tokens, read the audit trail or moderate. Keep those for yourself in the dashboard.
Ways to create it:
- Dashboard → Tokens → New token. The token is displayed once.
- From an existing credential:
skills auth token create --name claude-code-publisher --scopes artifacts:read,artifacts:create,artifacts:update,uploads:create,releases:publish,releases:update --namespace <yourns> --expires-in 90d --store—--storeputs the new token straight into the credential store instead of printing it. The calling credential needstokens:writeand can only grant what it holds itself. - Registry operator, from the server, piped directly into the credential store so it never appears on screen:
ssh <node> 'cd ~/apps/skills-spboucher-ai && pnpm -s admin token create --user <email> --name claude-code-publisher --namespace <yourns> --expires-in 90d' \
| skills login --token-stdin
Optionally restrict the token to an address range with --ip <CIDR>.
2. Store it where Claude Code can use it but not show it
skills login # prompts with hidden input, checks the token, stores it
skills whoami # shows the identity, scopes, namespaces and expiry — never the token
Lookup order used by the CLI:
SKILLS_TOKENin the environment of the process (for one-off, process-scoped use).- The OS credential store: macOS Keychain (service
skills-registry, account = registry host), orsecret-toolon Linux. - A
0600file at~/.config/skills/credentials.json, only if you opted in with--insecure-file.
Claude Code runs skills … commands; the CLI reads the credential itself. The token never needs to be in a prompt, a CLAUDE.md, an MCP description, a .env file or your shell profile, and it must not be put there.
3. Ask in plain language
Publish the citation-check skill in ./skills/citation-check to Skills as version 1.2.0, with README, changelog and release notes.
A well-behaved session then does this, and you should expect to see each step:
- Uses the directory you named. It does not go looking through your workspace for other things to publish.
- Reads the package: manifest,
SKILL.md, scripts. It points out anything that looks like a secret, personal data, private research material or third-party proprietary content. - Updates public documentation and metadata if you asked (README, CHANGELOG, version, compatibility).
- Validates:
skills validate ./skills/citation-check. - Dry run:
skills publish ./skills/citation-check --visibility public --dry-run, and shows you the report: target, version, visibility, file list with sizes, skipped files, declared permissions, findings, checksum. - Waits for your approval when it matters (see below).
- Publishes:
skills publish ./skills/citation-check --visibility public. The CLI uploads the archive with its hash and the server validates and scans it. - Verifies: fetches the published metadata, compares the checksum, checks the install instructions.
- Reports the exact URL and version. If the server refused or quarantined the release, it says so; it does not claim success before the API confirms it.
When your explicit approval is required
| Situation | Why |
|---|---|
| First public release of an artifact | It becomes visible to everyone, permanently in the history |
| Changing visibility | Exposes or hides the artifact |
| Changing declared permissions, or adding scripts or network use | Changes what installers are agreeing to |
| Deprecating, archiving or revoking | Affects people who depend on it (and needs scopes the publisher token does not have) |
The API enforces confirmation for visibility and destructive actions: without an explicit confirmation flag it answers 428 confirmation_required. The CLI asks interactively; --yes answers on your behalf, so an agent should pass --yes only after you approved the dry run. Routine patch releases can be delegated under a policy you state in advance, for example: "patch versions of artifacts that are already public, with no change in permissions or file types, may be published after a clean dry run".
Private versus public material
The files next to a SKILL.md are not automatically meant for the public. Before the dry run, make the intended contents explicit:
- Keep the package directory free of data, drafts, notebooks and credentials.
- Use
.skillsignorefor anything that must stay local. - The dry-run file list is the release. If a file should not be there, stop and remove it.
Blocking checks catch common credential formats and files such as .env. They cannot recognise your confidential manuscript or a client's data.
Rotation, revocation and troubleshooting
skills auth status # is a credential stored, for which registry, when does it expire
skills auth token rotate # new secret, same grants; stored automatically, never printed; the old one stops working
skills auth token revoke <id|prefix>
Rotate before expiry and whenever the token may have been exposed. If a token leaks, revoke it first, then review your audit trail in the dashboard.
| Symptom | Meaning | Fix |
|---|---|---|
401 token_expired | Past its expiry | Create a new token and skills login |
401 token_revoked | Revoked or replaced by rotation | skills login with the current token |
401 invalid_token | Wrong or truncated token, or calling from an address outside the token's allowlist | Check skills auth status; re-login |
403 insufficient_scope | The action needs a scope this token lacks (the response names it) | Do it from the dashboard, or issue a token with that scope |
403 namespace_forbidden | The manifest's namespace is not on this token | Fix the manifest name or use the right token |
409 version_exists | That version is already published | Bump the version; releases are immutable |
422 release_rejected | Blocking findings | Read the findings, fix, bump nothing, publish again |
428 confirmation_required | Needs a human yes | Approve, then rerun |
429 rate_limited | Too many requests, or repeated failed authentications from your address | Wait for the time in Retry-After |
Exit codes of the CLI: 0 success, 1 error, 2 validation failed, 3 authentication or authorization problem.
Using MCP instead of the CLI
The registry MCP server offers the same publishing steps as tools. Archive bytes still travel by HTTP PUT, and the same token rules apply. The CLI is the simpler path for publishing because it packs, hashes, uploads and verifies in one command.