And the rule is...
You can't fix a bad client with a good contract.
The value of a contract is that it sets clear expectations for both sides.
A good contract can also help protect you if something unexpectedly bad happens. But if your goal is to tame a known-bad client with some magical contract clause...
It. Does. Not. Exist.
A bad client will be a bad client no matter how good your attorney is.