This advice is based on things that I have seen on my many years on this board.
1) If you have kids, get a L. If you own a house or other large assets, get a L. It is expensive but it is worth every penny to ensure that you get things done right.
2) Spell out custody and visitation in minute detail. Down to the time of drop off/ pick up, where it will take place, who is responsible for transportation, etc etc. At all cost AVOID vague language such as "As mutually agreed upon by the parents". Spell out who gets what visitation for school holidays and summer vacation, when who has to inform who about vacation plans, etc etc. Be anal about getting this level of detail into the agreement. If you and stbx have a good co parenting relationship then you do not need the level of detail. Just because it is there, you do not have to enforce it if being more casual works. However, if you and stbx do not have a good co parenting relationship, then having this level of detail will save you so much grief.
3) If you have kids then you will likely have joint legal custody. This is different than physical custody. It is very rare to get sole legal custody. What joint legal means is that you and the other parent make joint decisions about the kids medical, school, and other major life decisions. Make sure that the D agreement spells out exactly what happens if you cannot agree and spells out exactly who is the tie breaker.
4) Do not trust your stbx to be a "nice" person and to do the right thing. If your stbx was trustworthy then you would not be posting here. Yes, they might be. Or they may get a bug up their but and decide that making your life hell is their new form of entertainment.
5) Don't poke the bear. Don;t amp up the drama. And don't pet the drama llama. No good can come from antagonizing your X. That does not mean you should be a doormat, just don't be an ass for the sake of being an ass.