# Publishing a skill

> Publishers, the publish command, trusted publishing from a repository, and the states a version goes through.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://skills.docs.sypnia.com/publish/publishing/

For agents: Publisher: handle ^[a-z][a-z0-9-]{1,38}$, a person or an organization (owners/admins manage; members with publish role). skills publish [dir] [--private|--unlisted] [--tag next]: packs (tar.gz of the folder, .gitignore and .skillsignore respected), uploads → 202 state checking. States: checking → in-review (public listing, Cloud) → listed; checking → listed for unlisted/private and for new minor/patch versions of reviewed skills; checking → refused (findings). Trusted publishing: link a skill to a repository in Sypnia Git or GitHub (repo + workflow/branch); a release publishes with a short-lived token from the CI's identity, provenance recorded (repo, commit, workflow). Publish tokens: scoped to one skill or publisher, expiry required. Agents may publish private/unlisted versions with a publish token; public listing and majors need a person (403 person_required). Every new version is e-mailed to all owners of the publisher. Public skills free unless the publisher sets a price (in credits, on skills.sypnia.com); a person confirms before installing a paid one; Sypnia keeps a commission, the creator gets the rest through PayPal; one payment, no subscription, no refunds (a bought skill can be downloaded and kept); private skills are not sold.

## Publishers

|                     | Handle                       | Who can publish                                                         |
| ------------------- | ---------------------------- | ----------------------------------------------------------------------- |
| **A person**        | your handle, such as `marta` | you                                                                     |
| **An organization** | its name, such as `laespiga` | its owners and admins, and the members they give the **publisher** role |

Handles match `^[a-z][a-z0-9-]{1,38}$`. A skill's id is `<publisher>/<name>`: `laespiga/espiga-pos-import`.

## Publishing from your machine

```bash
npx @sypnia/skills publish ./espiga-pos-import
```

The CLI runs the checks locally, packs the folder (leaving out what `.gitignore` and `.skillsignore` list), and uploads it. The registry answers `202` and the version starts `checking`.

| Flag          | Does                                                                                         |
| ------------- | -------------------------------------------------------------------------------------------- |
| `--private`   | only the publisher organization's members see and install it                                 |
| `--unlisted`  | anyone with the exact id can install it; it is not in search                                 |
| `--tag <tag>` | publish under a tag such as `next`; ranges never pick a tagged version unless asked: `@next` |

## Trusted publishing

The safest way: no token on anyone's machine. Link a skill to the repository that holds it, in Sypnia Git or GitHub, with the branch or workflow allowed to publish:

```bash
npx @sypnia/skills trusted add laespiga/espiga-pos-import --repo git.sypnia.com/laespiga/pos-skills --branch main
```

When that workflow runs `skills publish`, it proves its identity to the registry and gets a token that lasts only minutes. The version records its **provenance**: the repository, the commit and the workflow that published it, shown on the skill's page.

## The states of a version

| State       | What it means                                                                                                                     |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `checking`  | the automatic checks are running, usually under a minute                                                                          |
| `refused`   | a check failed; the findings say what and where. Fix and publish again with the same version                                      |
| `in-review` | waiting for a person, for a skill's first public listing or a new major of a public skill **\[Cloud]**                            |
| `listed`    | installable, and in search if the skill is public                                                                                 |
| `yanked`    | no new installs choose it; lock files that hold it keep working ([Versioning](https://skills.docs.sypnia.com/publish/versioning)) |

## Selling a skill

A public skill is free unless you give it a price. You set the price on the skill's page in skills.sypnia.com, in credits. People see it on the skill's page and in `skills info`, and installing a paid skill asks a person to confirm the price; an agent never buys one on its own. Sypnia keeps a commission on each sale and you get the rest.

The terms of a sale are the same for every paid skill:

- **One payment.** A buyer pays the price once, when the skill is first installed. There is no subscription.
- **Paid out through PayPal.** What you earn, after Sypnia's commission, is paid to the PayPal account you give in your publisher settings.
- **No refunds.** A skill can be downloaded and kept once it is bought, so a sale is final and is not refunded. Buyers see this before they confirm.

Private skills are for your organization's members and are not sold.

## Agents publishing

An agent can publish private and unlisted versions with a publish token. Listing a skill publicly, publishing a new major and yanking need a person: an agent's token gets `403 person_required`.

## You are told

Every new version of a publisher's skills is e-mailed to all its owners, with who or what published it. A version you did not expect can be yanked from that e-mail.
