What I have is signed work agreement.
It specifies deliverables, cost, cost and process of scope changes, an short term maintenance agreement(with cut off date) and how the software is licensed (I only deliver software which has an open source license, MIT usually).
Licensing the software under open source lets the client have it, and frees me to reuse it for other projects. There is also a warranty clause in the license.
Twice in 20 years I have not gotten paid. Neither time I had an agreement, both were for small amounts.
But, if you have large clients, a large budget, or intellectual property is an issue then consider a lawyer, and one who has dealt with software projects before.
I am also doing this with over 20 years of experience. When I first started I looked at and read over existing contract templates - and I was worried about protecting myself.
But, do have something in writing, do not work on a handshake (unless it is very small).
I also love the idea of using existing and well understood licenses. On the surface, it seems much safer than rolling your own licensing schemes, or having a lawyer do the same (I'm a non-practicing lawyer and a current web developer. In my research on design/dev contracts, i've never heard anyone doing this, but it sounds like a brilliant idea!)
http://rosskimbarovsky.com/contracts-for-software-and-websit...