syncable-entity-builder-and-validation

Create validator services and migration action builders for syncable entities in Twenty.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Implementing business rule validation and workspace migration action builders for syncable entities in Twenty is error-prone, with common mistakes like validators that throw exceptions, O(n) uniqueness lookups, and forgotten orchestrator wiring that silently breaks entity synchronization. ## Core Features & Use Cases - Validator Service Patterns: Provides templates for create, update, and delete validation covering required fields, uniqueness checks, foreign key validation, and standard entity protection, with validators that never throw and never mutate. - Migration Action Builder: Shows how to extend WorkspaceEntityMigrationBuilderService to produce create, update, and delete actions that return structured success or failed results with error arrays. - Orchestrator Wiring: Documents the critical step of injecting the builder into WorkspaceMigrationBuildOrchestratorService and aggregating its actions into the migration output. - Use Case: When adding a new syncable metadata entity to Twenty, use this Skill to generate the validator and builder services and wire them into the migration orchestrator so the entity syncs correctly. ## Quick Start Ask the AI to create the validator service and migration action builder for a new syncable entity and wire the builder into the workspace migration orchestrator.

Frequently Asked Questions about syncable-entity-builder-and-validation

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

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

Create a FlatMyEntityValidatorService with validateForCreate, validateForUpdate, and validateForDelete methods that return WorkspaceMigrationValidationError arrays. Validators must never throw exceptions and never mutate inputs; they receive optimistic entity maps for lookups.

How do I build workspace migration actions for a new entity?▼

Extend WorkspaceEntityMigrationBuilderService and implement buildCreateAction, buildUpdateAction, and buildDeleteAction. Each method runs validation first and returns either a failed status with errors or a success status with the typed migration action.

Why is my syncable entity not syncing after adding a builder?▼

The most common cause is missing orchestrator wiring. You must inject the builder into WorkspaceMigrationBuildOrchestratorService, call it inside buildWorkspaceMigration, and add its actions to the returned actions array.

How should uniqueness checks be implemented in entity validators?▼

Use indexed maps like optimisticFlatEntityMaps.byName for O(1) lookups instead of Object.values().find(), which is O(n). Always exclude the entity's own id when checking for duplicates to avoid false conflicts on updates.

What validation patterns apply to standard versus custom entities?▼

Standard entities where isCustom is false must be protected from create, update, and delete operations by returning an error immediately. Custom entities proceed through required field, uniqueness, and foreign key validation including deleted parent checks.