I've had great success by asking it to do project design first, compose the design into an artifact, and then asking it to consult the design artifact as it writes code.
This is a great idea - do you have a more detailed overview of this approach and/or an example? What types of things do you tell it to put into the "artefact"?