I use a prompt that convinces the LLM they are a Staff Engineer at Google and care deeply about best practices and writing clean, quality code.
While not perfect, it does improve the code quality.