mirror of
https://github.com/twentyhq/twenty.git
synced 2026-09-16 16:06:17 -04:00
**224 lines → 49**, restructured along the [Claude 5 context-engineering guidance](https://claude.com/blog/the-new-rules-of-context-engineering-for-claude-5-generation-models): keep the file lightweight, spend it on what a session won't get right on its own. Two load-bearing sections: ## House rules — standing conventions that contradict model defaults Models write JSDoc, interfaces, enums, and hand-rolled guards unprompted; these are the rules that push back, one line each: short-form `//` comments only (WHY, never WHAT), types over interfaces, string literals over enums, no `any`, named exports only, functional components, event handlers over `useEffect`, no abbreviations, `twenty-shared` guards before hand-rolled ones, Lingui/Linaria, test behavior not implementation. All carried over from the old file — cut in the first revision of this PR, restored on review: "match surrounding code" is not sufficient for counter-default preferences, especially in new files. ## Gotchas — what a session cannot discover from the code - `twenty-shared/dist` is per-branch state → rebuild with `--skip-nx-cache` before trusting a failure. - Nx cache can serve a stale typecheck pass → verify with `tsgo` directly. - **Never commit lingui-regenerated catalogs unless translations are the task** — `extract`/`compile` churn thousands of `.po`/`locales/generated` lines as a side effect of touching any `msg` string. - Commit-attribution CI check (`@anthropic.com` trailers rejected). - Upgrade-command rules incl. the silent-skip: a timestamp sorting before an already-applied command never runs. ## What was cut Tech-stack prose, the package tree, command sprawl, architecture descriptions — discoverable in seconds. The dead Context7 instruction. The style sections' *long forms* — each survives as one line above. ## Open question: `.cursor/rules/` The team no longer uses Cursor, so this PR removes CLAUDE.md's *dependence* on those files (everything load-bearing is now inline) and keeps a single neutral mention. What to do with the 16 `.mdc` files themselves — move to `docs/guidelines/`, keep for Cursor-using community contributors, or delete — is left as a separate decision. ## AGENTS.md Added as a **symlink** to CLAUDE.md so Codex/OpenCode/other agents read the same instructions with no duplicate to drift. The repo's sub-app packages currently ship byte-identical CLAUDE.md/AGENTS.md *copies* — exactly the drift this avoids. Those pairs are left as real files because they feed npm-published scaffolds (`create-twenty-app`) where symlinks don't survive every checkout. Caveat: on a Windows checkout without `core.symlinks`, AGENTS.md materializes as a one-line text file containing `CLAUDE.md` — degraded but self-describing.
Symbolic link
9 B
Symbolic link
9 B
CLAUDE.md