# Versions and the lock file

> What the [skills] table of sypnia.toml and skills.lock hold, how a version is chosen, and how its hash and signature are checked.

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

For agents: The [skills] table of sypnia.toml (the one configuration file of the project, at the repository root): targets = [sypnia, claude]; [skills.require] "<publisher>/<name>" = "<range>"; [skills.registries] default = https://skills.api.sypnia.com/v1 plus optional one per publisher (laespiga = https://skills.internal…). The CLI rewrites only the [skills] table and keeps comments. skills add with no range writes ^<latest>. .sypnia/skills.lock (YAML, lockVersion 1): per skill: version, registry, sha256 (of the package), signature (registry key id + signature over the hash), touches (copied), requiredBy. Ranges npm-style (^, ~, exact). Resolution picks the highest listed version in range, never yanked ones (unless locked already). Verification: sha256 of the downloaded package and the files on disk; signature with the registry's public key from GET /keys (cached, pinned per registry on first use, rotation announced). Mismatch = install refused.

## The `[skills]` table of `sypnia.toml`: what you asked for

Every Sypnia product keeps its settings in one file at the root of your repository, `sypnia.toml`, each in a table of its own. Skills reads and writes only `[skills]`, and keeps the rest of the file and your comments as they are.

`sypnia.toml`

```toml
format = 1
project = "la-espiga"

[skills]
targets = ["sypnia", "claude"]

[skills.require]
"sypnia/sypnia-design-guide" = "^1.4.0"
"sypnia/sypnia-starter-shop" = "^1.0.0"
"laespiga/espiga-pos-import" = "^1.0.0"

[skills.registries]
default = "https://skills.api.sypnia.com/v1"
```

| Field                 | What it is                                                                                                                              |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `targets`             | where skills are written ([Into a project](https://skills.docs.sypnia.com/install/into-a-project))                                      |
| `[skills.require]`    | each skill id (in quotes, because it holds a `/`) and its version range. `skills add` without a range writes `^` and the newest version |
| `[skills.registries]` | where to fetch skills from: `default`, and optionally one registry per publisher, such as your company's private registry               |

Ranges work like npm's: `^1.4.0` accepts any `1.x` from `1.4.0`, `~1.4.0` any `1.4.x`, and `1.4.0` only that one.

## `.sypnia/skills.lock`: what you got

`.sypnia/skills.lock`

```yaml
lockVersion: 1
skills:
  sypnia/sypnia-design-guide:
    version: 1.4.0
    registry: https://skills.api.sypnia.com/v1
    sha256: 6f1c…e2a9
    signature: { key: sk-2026-a, value: MEUCIQ…= }
    touches: {}
  sypnia/sypnia-cases:
    version: 2.1.0
    registry: https://skills.api.sypnia.com/v1
    sha256: b03d…41c7
    signature: { key: sk-2026-a, value: MEQCIF…= }
    touches: {}
    requiredBy: [sypnia/sypnia-design-guide]
```

## How a version is chosen

The highest **listed** version inside your range. Yanked versions are never chosen, unless the lock file already holds one: then it keeps working and you are warned ([Updates](https://skills.docs.sypnia.com/install/updates)).

## How it is checked

1. **The hash.** The CLI computes the SHA-256 of the downloaded package and compares it with the registry's and, on `install --frozen`, with the lock file's.
2. **The signature.** The registry signs every version's hash. The CLI checks it with the registry's public key, read from `GET /keys` the first time and pinned in `~/.config/sypnia/registries/`. A new key is announced in advance and signed with the old one.
3. **The files on disk.** `skills verify` hashes the installed files again and reports any change.

If any of the three fails, nothing is written and the command exits with an error.
