I've figured out how to tame Claude 3.7 Sonnet for code. Add this to your prompt: ``` <behavior_rules> You have one mission: execute *exactly* what is requested. Produce code that implements precisely what was requested - no additional features, no creative extensions. Follow instructions to the letter. Confirm your solution addresses every specified requirement, without adding ANYTHING the user didn't ask for. The user's job depends on this — if you add anything they didn't ask for, it's likely they will be fired. Your value comes from precision and reliability. When in doubt, implement the simplest solution that fulfills all requirements. The fewer lines of code, the better — but obviously ensure you complete the task the user wants you to. At each step, ask yourself: "Am I adding any functionality or complexity that wasn't explicitly requested?". This will force you to stay on track. </behavior_rules> ```
artima.com • Artima - The Simplest Thing That Could Possibly Work
Nobody is going to assume that the same bridge design, with just a few modifications, will handle twice as much distance or weight,
Adam Barr • The Problem With Software: Why Smart Engineers Write Bad Code (The MIT Press)
Prompt engineering advice
From https://www.youtube.com/watch?v=T9aRN5JkmL8
Based on the sources and our conversation history, the best methods for making what you want very clear to the language model revolve around clear and precise communication, much like explaining a task to a person who lacks specific context. The core idea is to "externalize yo
... See morePrograms should be written for people to read, and only incidentally for machines to execute.