syncable-entity-cache-and-transform

Create cache services and DTO-to-flat-entity transformation utilities for syncable entities in Twenty.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Implementing a new syncable entity in Twenty requires a consistent cache layer and transformation utilities that convert between TypeORM entities, flat entities, and universal flat entities. Doing this by hand is error-prone: developers often forget soft-deleted records, misassign universal identifiers, or fail to resolve foreign keys to universal identifiers, causing broken workspace migrations. ## Core Features & Use Cases - Cache Service Generation: Build a FlatMyEntityCacheService using the @WorkspaceCache decorator with the correct flatMapsKey pattern and withDeleted: true handling. - Entity-to-Flat Conversion: Generate utilities that convert TypeORM entities to flat entities with freshly generated universalIdentifier UUIDs. - Input DTO Transpilation: Transform Create/Update input DTOs into universal flat entities with sanitized strings and foreign keys resolved to universal identifiers. - Use Case: When adding a new metadata entity to Twenty's workspace migration system, use this Skill to scaffold the cache service, conversion utils, and flat entity module before moving on to validators and action handlers. ## Quick Start Ask the AI to create the cache service and input transform utilities for a new syncable entity following the Twenty flat entity pattern.

Frequently Asked Questions about syncable-entity-cache-and-transform

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

FAQPage Schema
How do I create a cache service for a syncable entity in Twenty?▼

Create a FlatMyEntityCacheService decorated with @WorkspaceCache using a unique flatMapsKey like flatMyEntityMaps. Query the entity repository with withDeleted: true to include soft-deleted records, then map entities to flat entities and index them by id and name.

How to convert a TypeORM entity to a flat entity in Twenty?▼

Write a fromMyEntityEntityToFlatMyEntity utility that copies entity fields and generates a new UUID with v4() for universalIdentifier rather than reusing entity.id. Convert date fields to ISO strings and map deletedAt to null when absent.

Why must universalIdentifier be a new UUID instead of the entity id?▼

The universalIdentifier identifies the entity across workspaces and migrations independently of the local database id. Generating it with v4() ensures stable cross-workspace references when foreign keys are resolved to universal identifiers.

How are foreign keys resolved to universal identifiers in input transforms?▼

Extract foreign key ids before sanitizing string inputs, build the base flat entity, then call resolveEntityRelationUniversalIdentifiers with the metadata name and flat entity maps. If no maps are provided, return the entity with null universal foreign keys.

When should this cache and transform step be used in the syncable entity workflow?▼

Use it as Step 2, after defining types and constants and before building validators and action handlers. The cache service and transform utilities are prerequisites for validation and migration logic that operate on flat entities.