Write technical documentation as well as some for the managment and customer
This can't be empasized enough: You will have to deal with (at least) three different groups:
- The technical group needs specific instructions. What is required, how is the software required to do it, the exact message-by-message, byte-by-byte specification of any required communication with other systems
- Your own managment needs an overview of how long it will take, how much it will cost in man-hours, any required external resource (servers, services, ...). Managers do not want to wade through technical specs. They do want to know however if they will be able to afford a new car or get sued by $other_company.
- Your (internal or external) customer wants one document from you: The ability to RTFM. This manual should have nice pictures, easy-to-understand "if you want to x enter y in there and click z" paragraphs. Please avoid technical explanations like "The driver hooks into the kernel by patching the system call table"...
If possible, write as much of the documentation as possible
before starting to code. Let the customer and managment review it. While your software may still fall short of the customers expectations in the end, this will minimize the risk.