gato create copies the kit’s code into your repository, and from then on it is your code: you can read it, change it and delete it like anything else you wrote. This page covers what that means in practice: where a change belongs, which checks it passes on the way in, which files you must not edit by hand, and how to pull in later kit releases.
Your project and the kit
.wa/kit.json records where your code came from: the kit version, the repository it came from, and for each kit module its manifest and a hash of every file it installed. Those hashes let gato update and gato remove tell which kit files you’ve changed locally. Your own features live in a separate projectModules section with no hashes, so the CLI never touches them. See the .wa/kit.json reference.
Fixes made in the kit reach an existing project only through a new kit release and npx gato update in your project. The reverse is also true: a fix you make in your project stays there unless you send it upstream.
What stays in your project and what goes upstream
Ask one question: would this change be correct in every project built on the kit?
Why upstream matters: a fix that never returns to the kit is missing from every new project, so someone finds the same bug again. And the same bug fixed differently in several projects leaves copies of the core that can no longer be compared with the kit or with each other.
Sending a fix upstream
The kit and your project share the same directory layout, so file paths match.1
Branch in a clone of the kit
2
Move the change as a patch
In your project, export the fix commit:In the kit clone, check and apply it:If
--check fails because the kit changed around those lines, try git apply -3 ~/fix.patch for a three-way merge, or port the change by hand.3
Add a test that fails without the fix
Every bug fix needs one. If you wrote it in your project, bring it along.
4
Run the gates
npm run verify, plus integration and e2e tests when you touched a query, command or the sign-in flow. For files on the critical list in mutation-gate.json, also run npm run test:mutation:task -- <files> and npm run test:mutation:gate. See Testing.5
Open a pull request
Use a conventional commit message. The contribution process is described in Contributing.
npx gato update.
Where a change is checked
The first three can be bypassed, so CI is the last automatic checkpoint, and reviewers also check the rules that only hooks enforce. See Built for AI agents for the hooks and CI for the workflows.
Commits
Commit messages follow Conventional Commits with a lowercase subject. One format lets you filter history by kind of change, for examplegit log --oneline --grep '^fix'.
The first line is type(scope): subject:
- Type is one of
build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test(from@commitlint/config-conventional). - Scope is optional, usually a feature or area:
auth,users,organizations,notes,i18n,prisma. - Subject starts lowercase and has no trailing period. Identifiers keep their spelling.
feat(organizations): let superadmin enter any organization, fix(cli): keep line endings and reject marker tokens in region bodies, refactor: rename BETTER_AUTH_URL to APP_URL.
A rejected message aborts the commit:
What happens on git commit
npm install runs the prepare script (husky), which points git at the hooks in .husky/:
lint-staged only touches staged files. ESLint and Prettier skip generated files, so a commit never reformats them.
The npm run verify gate
Run npm run verify before you hand in work: before a push, a pull request or an agent’s final report. The CI verify job runs the same script, so anything you miss locally stops the pull request anyway.
package.json
Steps are chained with
&&, so the first failure stops the run. verify does not run integration, e2e or mutation tests, and does not check that generated files are current. The CI job runs the generator first and fails on any diff, so do the same locally:
Generated files
The generator writes the places through which the core learns about modules. Never edit them by hand:src/modules.generated.tsandsrc/modules.client.generated.ts: the module registry;src/i18n/locales.generated.ts: the locale list fromlocalesin.wa/kit.json;- the
wa:relationsregion inprisma/schema/auth.prismaandprisma/schema/organizations.prisma; - the
wa:modulesregion in.env.example; - the
wa:servicesregion indocker-compose.yml; - the
wa:ci-integrationregion in.github/workflows/ci.ymland.github/workflows/mutation.yml.
src/modules.generated.ts
npm run wa -- generate.”) A region is the part of a file between marker lines:
prisma/schema/organizations.prisma
- The generator rewrites these places on every run from
.wa/kit.json, the files in feature folders and the files referenced bycomposeandciSteps. A manual edit disappears on the next run. - CI runs the generator and
git diff --exit-code. A manual edit, or adding a file the generator tracks without rerunning it, fails the job. - No hook blocks these edits; CI is what catches them.
- any change to
.wa/kit.json; - adding or removing a
module.ts,env.ts,auth.ts,auth-client.ts,audit-sink.tsori18n/<locale>.jsonin a feature; - adding, removing or renaming a feature folder;
- changing a file referenced by a manifest’s
composeorciSteps.
module.ts, adding a key to an existing translation file, or adding a command, query, component or page doesn’t need it: the registry imports files rather than copying them.
Bez zmian (“no changes”) or one zmieniono <file> (“changed”) line per file written. Commit the regenerated files with the change that caused them. npm run wa -- generate runs the same command from the CLI bundle committed in .wa/bin/, which works even before npm install. More in gato generate and Module registry.
The Prisma client in src/generated/prisma/ is generated too, by prisma generate (on postinstall and via npm run db:generate), and is git-ignored. Regenerate it after schema changes instead of editing it.
Staying up to date
When the kit releases a new version, update your project with:gato update requires a clean git working tree, so commit or stash first. It merges the kit’s changes between your current version and the target into your files. Files you haven’t modified are updated, files you changed are merged, and where you and the kit changed the same lines it leaves a merge conflict for you to resolve. Some cases are left for you to decide and are listed in its report. It never downgrades. Use --dry-run to see the plan first. Details and flags are in gato update.
After an update, run the generator, npm run verify and your integration tests, and commit the result as its own commit.
The more of the kit’s code you change locally, the more conflicts updates bring. Prefer adding code in your own features over editing core files, and send generally useful core changes upstream so they come back to you in the next release.