Having a contract is critical to ensuring that both parties understand and agree to expectations. Unfortunately, there are many things to consider, when writing a contract, that can add a lot of doubt and uncertainty. The laws differ from jurisdiction to jurisdiction, and some language in a contract may not be enforceable if it violates local law.
However, I've used LawDepot to help draw up some contractual agreements. They have out-of-the-box templates that you can use for a variety of different cases, and the templates are tailored to your jurisdiction.
What you're really looking for though is just a way to come to a very clear understanding with your clients before you commit any resources. As long as you communicate really well with your clients and they communicate really well with you, you shouldn't have any misunderstandings.
Writing this down is one way to ensure both parties agree, and if well-executed, you shouldn't ever have to exercise this clause of your agreement.
DISCLAIMER: I am not qualified to give you legal advice, and the purpose of this site is not to give legal advice. Use this information at your own risk.