I would contact your attorney and ask that bad-mouthing you in front of the kids is not allowed (usually that is standard wording in a divorce)
I would then let her know (in a non-confrontational, matter of fact way) that if she continues to do this, you will file contempt charges
I am sorry your wife is a mess and I am sorry you both seem to be involving the kids. They should know little to nothing about the conflict in your relationship