Before implementing new functionality, check if similar utilities or patterns already exist in the codebase. Reuse existing code rather than duplicating logic, and organize shared types and constants in centralized locations to prevent circular dependencies and maintain consistency.

Key practices:

Example of good practice:

// Instead of creating multiple similar selectors
export function getMigrationType(ctx: AutomaticMigrationState, migrationId: string) {
  return ctx.nxConsoleMetadata?.completedMigrations?.[migrationId]?.type;
}

// Then use it in components with comparison
const isSuccessful = getMigrationType(ctx, id) === 'successful';
const isFailed = getMigrationType(ctx, id) === 'failed';

This approach reduces code duplication, improves maintainability, and ensures consistent behavior across the codebase.