> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gatojs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# .wa/kit.json reference

> Reference of a GatoJS project's .wa/kit.json: kit version and repository, project names, locales, installed modules with file hashes, project modules and the module manifest fields.

`.wa/kit.json` records which kit version a project comes from, which kit modules it has, with their manifests and file hashes, and which modules the project wrote itself. `gato create`, `add`, `remove` and `update` write it; you edit only `locales` and `projectModules` by hand. Commit it.

```json .wa/kit.json theme={null}
{
  "kitVersion": "0.8.1",
  "kitRepo": "https://github.com/webamigos/gatojs.git",
  "project": { "name": "Acme App", "slug": "acme-app" },
  "locales": ["pl", "en"],
  "modules": {
    "core": {
      "version": "0.11.1",
      "manifest": { "name": "core", "version": "0.11.1", "description": "…", "files": ["…"] },
      "files": {
        ".env.example": "3f1c…",
        "package.json": "managed",
        "package-lock.json": "managed"
      }
    },
    "uploads": {
      "version": "0.2.6",
      "manifest": { "name": "uploads", "version": "0.2.6", "…": "…" },
      "files": { "src/features/uploads/module.ts": "9b2e…" }
    }
  },
  "projectModules": {
    "notes": {
      "manifest": {
        "name": "notes",
        "version": "0.1.0",
        "description": "Project notes",
        "files": ["src/features/notes/**", "prisma/schema/notes.prisma"]
      }
    }
  }
}
```

The example is shortened. Unknown fields are ignored without an error, so a typo such as `schemaRelation` passes and the real field gets its default.

## Top-level fields

**kitVersion** `string` *required*

Kit version the project's kit files come from. `add` and `list` fetch the kit at tag `v<kitVersion>`; `update` uses it as the merge base. Changed only by [`gato update`](https://docs.gatojs.com/cli/update).

**kitRepo** `string` (default: [https://github.com/webamigos/wa-kit.git](https://github.com/webamigos/wa-kit.git))

Default [kit source](https://docs.gatojs.com/cli/kit-source.md) for `add`, `list` and `update`. `gato create` writes the `repo` of the kit it used, `https://github.com/webamigos/gatojs.git` for the public kit. The schema default applies only to old files without the field.

**project** `\{ name: string, slug: string \}` (default: \{ name: 'WA App', slug: 'wa-app' })

Display name and slug. `add` and `update` use them to replace placeholders in kit files; `generate` uses them for `{{projectName}}` and `{{projectSlug}}` in module variable examples. The snake name is derived from the slug.

**locales** `('pl' | 'en')[]` (default: \['pl', 'en'])

App languages: at least one, must contain `pl`, no duplicates. `generate` writes them to `src/i18n/locales.generated.ts` and creates translation loaders only for them. Edit it by hand, then run `gato generate`.

**modules** `Record\<string, KitModule\>` *required*

Installed kit modules, keyed by name. Always contains `core`.

**KitModule**

**version** `string` *required*

The module's version at the time it was copied or updated.

**manifest** `ModuleManifest` *required*

A copy of the module's manifest from the kit. See [Module manifest](#module-manifest).

**files** `Record\<string, string\>` *required*

Every copied file mapped to its hash, or to `managed`. See [File hashes](#file-hashes).

**projectModules** `Record\<string, \{ manifest: ModuleManifest \}\>` (default: \{})

Features written in the project. See [Project modules](#project-modules).

## File hashes

For every file `create`, `add` or `update` copies, `modules.<name>.files` holds a value computed from the content written to the project (after placeholder replacement):

| Kind of file | Value |
| - | - |
| `package.json`, `package-lock.json` (`managedFiles` in `kit/kit.json`) | `managed`: the CLI assembles these files itself, so they are never compared |
| A file with `wa:*` regions: `.env.example`, `.github/workflows/ci.yml`, `.github/workflows/mutation.yml`, `docker-compose.yml`, `Dockerfile`, `prisma/schema/auth.prisma`, `prisma/schema/organizations.prisma` | SHA-256 of the content without the lines between region markers |
| Any other file | SHA-256 of the bytes |

The hashes let `gato remove` refuse to delete files you changed, and give `gato update` a base to tell kit changes from yours. After an update, hashes are those of the **kit's** content at the target version, so a merged file with local changes still counts as changed. Generated files are not copied and have no hash.

## Project modules

A project module is a feature written in the project, registered next to kit modules. Its entry has only a `manifest`, without a version or file hashes:

```json theme={null}
"projectModules": {
  "notes": {
    "manifest": {
      "name": "notes",
      "version": "0.1.0",
      "description": "Project notes",
      "requires": ["audit-logs"],
      "files": ["src/features/notes/**", "prisma/schema/notes.prisma"],
      "dependencies": { "sharp": "^0.35.5" },
      "schemaRelations": [{ "model": "Organization", "field": "notes Note[]" }]
    }
  }
}
```

Every command that reads `.wa/kit.json` validates these entries first and stops on the first problem:

* `name` equals the key;
* no kit module has the same name;
* every module in `requires` is installed (as a kit or project module);
* `files` has a pattern starting with `src/features/<name>/`.

How the commands treat them:

| Command | Project module |
| - | - |
| `generate` | Registers it after the kit modules and fills its regions. |
| `add` | Refuses to add a kit module with the same name. |
| `remove` | Refuses to remove a project module (delete its files and entry by hand). Does not remove a kit module it `requires`, nor npm dependencies it declares in the same section. |
| `list` | Prints it under `Projektu:`, even when the kit cannot be fetched. |
| `update` | Leaves its entry and files alone. |

> [!TIP]
>
> Declare every npm dependency your project module uses in its manifest, in the same section (`dependencies` or `devDependencies`) a kit module might use. Otherwise `gato remove` of a kit module that declares the same package removes it from `package.json`.

Building a feature step by step: [Build a feature](https://docs.gatojs.com/guides/build-a-feature.md).

## Module manifest

The same schema describes kit modules (`kit/modules/<name>.json` in the kit repository, copied into `modules.<name>.manifest`) and project modules.

**name** `string` *required*

Module name. In the kit it equals the manifest's file name; in `projectModules` it equals the key.

**version** `string` *required*

Module version. Kit modules bump it when their files change.

**description** `string` *required*

One line shown in the `create` prompt and in `gato list`. May be empty.

**requires** `string[]` (default: \[])

Modules this one needs. `create` and `add` add them; `remove` refuses to remove a module that another one requires.

**files** `string[]` (default: \[])

Patterns of the files the module owns. Supported wildcards: `**/` (zero or more directories), `**` (anything, including `/`) and `*` (anything except `/`). Everything else is literal, including `[locale]` and `(app)`; braces are not supported. `generate` uses only patterns under `src/features/<name>/` to find features.

**dependencies** `Record\<string, string\>` (default: \{})

npm dependencies added to `package.json` by `create` and `add`, and removed by `remove` when no other manifest declares them in the same section.

**devDependencies** `Record\<string, string\>` (default: \{})

Same for `devDependencies`.

**env** `\{ name: string, example: string, required?: boolean \}[]` (default: \[])

Variables written to the `wa:modules` region of `.env.example` as `name=example`. `{{projectSlug}}` and `{{projectName}}` in `example` are replaced. `required` is not read by the CLI; whether a variable is required is decided by the feature's `env.ts` schema.

**schemaRelations** `\{ model: string, field: string \}[]` (default: \[])

Back-relation lines written to `wa:relations` in the `User` model (`auth.prisma`) or the `Organization` model (`organizations.prisma`). Other models are ignored.

**compose** `string | null` (default: null)

Path, relative to the project, of a file with Docker Compose service definitions (without the `services:` key). Written into the `wa:services` region. The file must belong to the module's `files`.

**ciSteps** `string | null` (default: null)

Path, relative to the project, of a file with GitHub Actions steps. Written into the `wa:ci-integration` regions of `ci.yml` and `mutation.yml`. The file must belong to the module's `files`.

**workspaces** `string[]` (default: \[])

Reserved. No command reads it.

## In the kit repository

The kit repository has its own `.wa/kit.json`, rewritten from the manifests by `gato kit sync`. There every module has empty `files`, and `project` holds the placeholder names `WA App` and `wa-app`. Do not edit it by hand: see [Kit repository](https://docs.gatojs.com/contributing/kit-repository.md#kit-sync).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.