- Keep the architecture lean, concise and simple.
- Always keep a check on the number of lines in the file. If the file exceeds the limit of 800 lines, break it down into multiple files.
- Always keep function within 100 lines of code and it should follow single responsibility principle
-
-
Save rajvermacas/ef8bf3883c54820f423d2af41a645575 to your computer and use it in GitHub Desktop.
Based on the video, here are the six prompt engineering tips from OpenAI for using GPT-5 for coding:
-
Be Precise and Avoid Conflicting Information GPT-5 models are better at following instructions, but they can struggle with vague or conflicting directions. Clear and specific prompts yield better results.
-
Use the Right Reasoning Effort The model has different reasoning effort levels: minimal, low, medium, and high. The speaker recommends sticking to "high" for coding tasks, as "low" and "medium" produce much worse answers.
-
Use XML Tags Delineate different sections of your prompts with XML tags to improve the model's understanding. This helps structure instructions and reduces misinterpretations by clearly defining the start and end of each section, such as
<context>or<task>. -
Avoid Overly Firm Language Using firm language like "must" can backfire with GPT-5, as the model might overthink or over-engineer the task. Being less aggressive in your prompting can be more effective and prevent the model from making an excessive number of tool calls.
-
Give Room for Planning and Self-Reflection Let the model think before it acts. The speaker suggests splitting a task into a few separate steps, recommending a plan with five to seven categories. You can also use tags like
self-reflectionto improve the model's reasoning, allowing it to plan and iterate on the best approach before writing any code. -
Control the Eagerness of Your Coding Agent GPT-5 is designed to be thorough by default. You can control its eagerness by setting boundaries on the scope and execution of the task. An interesting method is giving the model a "tool budget," which limits the number of tools it can call to prevent overthinking. You can also use persistence XML tags to encourage the model to be more decisive and not ask for unnecessary confirmations.
Also, re-organise the requirements into their logical & sequential order of implementation including any dependancies, and finally finish with a complete TODO list. Wait for confirmation on the plan.