# Packages

> A package is any folder of the repository with a sommatic.json manifest. The manifest lists the workflows and knowledge resources of the package, each with a stable logical key and a file path.

Source: https://docs.sommatic.ai/en/git-sync/packages/ (updated 2026-11-26)

A package is the unit that Sommatic AI browses and syncs from Git. Any folder that contains a `sommatic.json` file is a
package, at any depth of the repository. Group resources by business area or by solution: one package per area keeps
reviews small and lets you deploy an area without touching the rest.

## The manifest

```json
{
  "name": "support",
  "title": "Customer support",
  "version": "1.2.0",
  "schema_version": "1.0",
  "resources": {
    "workflows": [
      { "key": "support.triage", "path": "workflows/triage.json" }
    ],
    "knowledge": [
      { "key": "support.faq", "path": "knowledge/faq.json" }
    ]
  }
}
```

| Field                   | Required | Description                                 |
| ----------------------- | -------- | ------------------------------------------- |
| `name`                  | Yes      | Package name.                               |
| `title`                 | No       | Human-readable title shown in Sommatic AI.  |
| `version`               | Yes      | Package version, in semver.                 |
| `schema_version`        | Yes      | Always `1.0`.                               |
| `resources.workflows[]` | No       | Workflow files: `key` and `path`.           |
| `resources.knowledge[]` | No       | Knowledge resource files: `key` and `path`. |

`path` is relative to the package folder. The JSON Schema of the manifest is published at
[`https://docs.sommatic.ai/schemas/git-sync/package.schema.json`](https://docs.sommatic.ai/schemas/git-sync/package.schema.json).

## Keys

A `key` is a **logical, stable identifier** of a resource, such as `support.triage`. It does not change between
installations: dev and prod use the same key, and each one maps it to its own physical id in its environment file.

- Keep keys unique across the whole repository.
- Never rename a key that is already deployed: the environment files map the old key, and the resource stops being
  linked.
- The resource file repeats its key in its `sommatic` header, and the header must match the manifest. Preview reports
  a mismatch as an error for that item.

A common convention is `<package>.<resource-slug>`, which is also what **Export for Git** proposes when the resource
is not declared yet.

## What is not a package

Manifests under a `templates/` or `.github/` folder are examples, not packages: Sommatic AI ignores them. Use
`templates/` to keep a starter package that people copy.

If the connection has a root path, Sommatic AI only looks for packages (and for `environments/`) under that folder.

> **Tip: Browse before you sync**
>
> `GET /platform-infrastructure/git-repository/<repository_id>/tree?path=` lists folders and flags the packages;
> `GET /platform-infrastructure/git-repository/<repository_id>/package?path=support` returns the manifest and, for
> each resource, the physical id it has in this installation (`resource_id`, or `null` when it is not mapped).

## Next steps

- [Resource files](https://docs.sommatic.ai/en/git-sync/resource-files.md): What goes inside each workflow or knowledge file.
- [Environments and tokens](https://docs.sommatic.ai/en/git-sync/environments-and-tokens.md): Map each key to its id in every installation.
