Ensign Scope
New scope
Scopes
Context
Loading…
Edit context doc
Title
Category
conventions
▼
Tags
Active
— included in interview & generation
Body (markdown)
Write
Preview
How Ensign writes code. Generated scopes should assume these as defaults. ## TypeScript & code quality - **Strict mode**, always. Explicit types on exported/public APIs; inference is fine internally. No `any` without a comment explaining why. - Small, focused changes. Match existing patterns in the repo before deviating. - Run typecheck + lint after substantive changes; don't mark work done on compile alone — run it. ## Database (TypeORM / Drizzle) - **UUID primary keys** for all entities. - **snake_case** column naming (TypeORM custom naming strategy). - **Soft deletes everywhere** — every entity has `deleted_at: Date | null`; hard deletes are never used in business operations. All queries filter `deleted_at IS NULL`. - Standard audit columns: `created_at`, `updated_at` (+ `deleted_at`). - **Multi-tenancy**: every business entity has an indexed `company_id`; it is auto-injected, never trusted from the client. - Monetary values: `decimal(40, 2)`; VAT/percentages: `decimal(5, 2)`. - Index `company_id`, foreign keys, and frequently-queried columns. ## Migrations - **Never delete a committed migration.** - Generate migrations from entity changes (don't hand-edit schema drift); a pre-commit hook blocks entity changes without an accompanying migration. - New non-null columns need a default or a backfill — no unguarded `NOT NULL` adds. ## Git & process - **Conventional Commits** (`feat:`, `fix:`, `chore:`…). - Never list AI tools as a contributor/co-author. - UK English in prose and user-facing copy; conventional (US) spelling in code identifiers. - Commit and push as work progresses.
Save changes
Cancel