Flexible adaptation for diverse communities