01 / Behavioral framing
Give surrounding code precedence over written defaults
The opening instruction makes adjacent files the authority when local conventions differ. It explicitly includes file naming, which varies across this monorepo.
Source excerpt starting at line 5.5Match the surrounding code — the adjacent files in the directory you are editing beat any written rule, including for file naming, which varies by area.
02 / Verification by change type
Identify stale artifacts before diagnosing failures
The guide treats the shared package output as branch-specific state. It requires rebuilding without Nx cache after branch switches or shared-package edits before trusting dependent test results.
Source excerpt starting at line 43.43- **`twenty-shared/dist` is per-branch state nothing tracks.** After switching branches or editing `twenty-shared`, run `npx nx build twenty-shared --skip-nx-cache` before trusting any typecheck or test failure in a dependent package.
03 / Verification by change type
Bypass cached success when verifying a fix
A separate gotcha warns that the task runner can return an old passing result. It names a direct compiler invocation for checking whether a change actually fixes the problem.
Source excerpt starting at line 44.44- **Nx caching can serve a stale pass.** To verify a fix, run `npx tsgo -p tsconfig.json --noEmit` in the package directly rather than `nx typecheck`.
04 / Generated file guards
Keep incidental generated changes out of a patch
Translation extraction can rewrite large catalogs as a side effect of editing a message. The guide reserves those files for translation work and leaves their routine maintenance to the translation pipeline.
Source excerpt starting at line 45.45- **Do not commit translation catalogs unless translations are the task.** `lingui extract`/`compile` regenerate `packages/twenty-server/src/engine/core-modules/i18n/locales/*.po` and `locales/generated/*` with thousands of lines of churn as a side effect of touching any `msg` string. The i18n pipeline maintains them; leave them out of your commit.
05 / Behavioral framing
Name an observed agent failure
The house rules point to existing guard packages before allowing new helpers. They identify redundant utilities as a recurring agent-authored defect, giving the lookup step a concrete reason.
Source excerpt starting at line 16.16- Use existing guards and helpers before writing your own: `isDefined`, `isNonEmptyArray`, `isPlainObject`, … from `twenty-shared/utils`; `isNonEmptyString`, `isString`, `isNull`, `isObject`, … from `@sniptt/guards`. Reimplementing an existing util is the most common AI-authored defect here.