Not an open source project, but I’ve seen a Code of Conduct save a local user group when drama erupted between a founding organizer and a regular member.
Having a written agreement and guidelines to mediate conflicts is vital once a community gets to a certain size. Humans have been doing this since Hammurabi.