syncable-entity-types-and-constants

Defines TypeORM entities, flat types, and central constant registrations for Twenty syncable entities.

Updated Aug 3, 2026
One-click install
npx skills add https://github.com/masoodtalha/twenty --skill syncable-entity-types-and-constants-masoodtalha
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: syncable-entity-types-and-constants
Source: https://github.com/masoodtalha/twenty/tree/main/.cursor/skills/syncable-entity-types-and-constants
Command: npx skills add https://github.com/masoodtalha/twenty --skill syncable-entity-types-and-constants-masoodtalha

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Creating a new syncable entity in Twenty's workspace migration system requires touching many scattered type definitions and central constants, and missing any one registration breaks the migration pipeline. This Skill provides the complete first-step blueprint so every required type and constant is defined correctly and consistently. ## Core Features & Use Cases - TypeORM Entity Scaffolding: Guides creation of entities extending SyncableEntity with required columns like isCustom, foreign keys, and JSONB fields. - Flat & Universal Type Definitions: Covers flat entity types, entity maps, editable property constants, and create/update/delete action types. - Central Constant Registration: Walks through all five registrations including ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME, ALL_ONE_TO_MANY_METADATA_RELATIONS, ALL_MANY_TO_ONE_METADATA_FOREIGN_KEY, and ALL_MANY_TO_ONE_METADATA_RELATIONS. - Use Case: When adding a new metadata object (e.g., a custom 'deal' entity) to Twenty's workspace migration system, follow this Skill to define its types and register it in every central constant before moving to cache and transform logic. ## Quick Start Ask the AI to scaffold the types and central constant registrations for a new syncable entity named after your metadata object in the Twenty codebase.

Frequently Asked Questions about syncable-entity-types-and-constants

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new syncable entity in Twenty?▼

Start by adding the metadata name to ALL_METADATA_NAME in twenty-shared, then create a TypeORM entity extending SyncableEntity with an isCustom column. Next define flat entity types, action types, and register the entity in all central constants before proceeding to cache and transform steps.

What central constants must be registered for a syncable entity?▼

Five registrations are required: AllFlatEntityTypesByMetadataName, ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME, ALL_ONE_TO_MANY_METADATA_RELATIONS, ALL_MANY_TO_ONE_METADATA_FOREIGN_KEY, and ALL_MANY_TO_ONE_METADATA_RELATIONS. Each captures different aspects like editable properties, foreign keys, and relation mappings.

What is the difference between flat and universal entity types in Twenty?▼

Flat entities are derived from TypeORM entities via FlatEntityFrom and used internally by the migration runner. Universal entities replace foreign key IDs with universal identifiers and serialize JSONB fields, enabling cross-workspace comparison and migration actions.

How are many-to-one relations configured for syncable entities?▼

Define the foreign key column in ALL_MANY_TO_ONE_METADATA_FOREIGN_KEY, then add the full relation in ALL_MANY_TO_ONE_METADATA_RELATIONS with metadataName, inverseOneToManyProperty, isNullable, and universalForeignKey. The universalForeignKey is derived by replacing the Id suffix with UniversalIdentifier.

Why does my syncable entity fail TypeScript compilation after registration?▼

The relation constants are type-checked against entity definitions, so mismatches in aggregator names or missing inverse relation keys cause compile errors. Verify aggregator names follow the pattern of removing the trailing 's' from the relation property and appending Ids or UniversalIdentifiers.