Imported from rebasepro/rebase (
AGENTS.md). Install upstream withnpx skills add rebasepro/rebase. Copyright stays with the author.
Working in this repository
Rules for coding agents working on the Rebase monorepo. They apply to humans too.
The detailed guides live in .agent/workflows/. Read the one that matches the
task before you start:
coding-standards.mdcovers the TypeScript rules (noany, no structural casts,isSQLAdmin), i18n, and the auth helpers.rebase-architecture.mdcovers package entry points, CMS vs. Studio mode, and where code belongs.schema-migration.mdcovers changing a collection and applying the migration, including every relation kind.ui-components.mdcovers the@rebasepro/uikit and the design reference. Read it before building any UI.deployment.mdcovers deploys and releases: never do either without an explicit request.
Always
- Use pnpm only. Never npm or yarn.
- The UI must stay coherent. Build from the
@rebasepro/uikit, not raw HTML or ad-hoc classes.UIReferenceView(packages/app/src/debug/UIReferenceView.tsx, at/debug/uiin the example app) is the design source of truth. Read it, orContentHomePage/StudioHomePage, before creating a view. - Author collections with
defineCollectionfrom@rebasepro/cms-types. Presentation options live underadmin(admin.display.title,admin.propertiesOrder, …). A relation is a property oftype: "relation"whoserelation.kindis one ofbelongsTo,hasOne,hasMany,manyToManyorvia. Readpackages/types/src/types/relations.tsbefore writing anything unusual. - Never convert to
any, and never cast structurally around a type (for exampledriver as { executeSql?: … }). To run raw SQL, narrowdriver.adminwithisSQLAdminfrom@rebasepro/types. - Put scripts in
tooling/scripts/. Never put one-off scripts, codemods, logs or diffs in the repo root or inside a package. For truly throwaway files, use your own scratch directory outside the repository. - Ask before touching the local environment. Present a plan and get approval
before changing database settings,
.envfiles, or creating or dropping databases and roles. - Never release without consent. Never publish, tag or release a package
unless the user asked for that exact release, in the moment. Deploys are gated
the same way. See
deployment.mdfor what counts and what to do instead. - Verify before you say it is done.
./tooling/scripts/verify-quality.shruns what CI runs: the static gates, the unit tests, the build gates and the Playwright suite. For a docs-only change,pnpm verify:docs:strictis the gate that reads it.
Measuring agent changes
pnpm harness:eval -- --list shows benchmark tasks derived from real fix commits
in this repo. Use them to check whether a change to agent instructions or
tooling helps or regresses. See tooling/scripts/harness/README.md.