OpenAI has released a "GPT-5 Coding Guide", which provides 6 best practices for using GPT-5 for AI programming:



# 1. Instructions should be precise to avoid information conflicts

The new GPT-5 model has significantly improved its ability to follow instructions, but this also brings a side effect: it may struggle when faced with vague or conflicting instructions. This situation particularly requires attention in your .cursor/rules or configuration file.

# 2. Set the appropriate reasoning level

GPT-5 always engages in a certain level of reasoning when solving problems. To achieve the best results, you should use "high reasoning effort" when handling complex tasks. If you find that the model has a tendency to "overthink" simple questions, you can provide more specific instructions or choose medium or low reasoning levels.

# 3. Use XML-like syntax to help structure commands

We discovered in collaboration with Cursor that using XML-like syntax can provide more context for the model, thus improving the performance of GPT-5. For example, you can give the model the following coding guidelines:



Each component should be modular and reusable.


- Style: TailwindCSS



# 4. Avoid using overly forceful commands

When using other models, you might be accustomed to using some commands that are quite assertive, such as:
- Be thorough when collecting information.
- Ensure that you are fully aware of all the circumstances before responding.

For GPT-5, these instructions may backfire, as the model might over-execute what it naturally does. For example, it may excessively gather context through tool calls.

# 5. Provide space for planning and self-reflection for the model

If you are developing an application from scratch, guiding the model to engage in self-reflection in the instructions will greatly benefit the final result.


- First, take the time to think of an internal evaluation standard until you are confident.
- Next, think deeply about the various aspects that need to be considered when creating a world-class application, and based on this, create an evaluation criterion that includes 5-7 dimensions. This criterion is crucial, but do not show it to users; it is for your internal evaluation only.
- Finally, apply this standard, think and iterate internally to find the best solution for user needs. Remember, if your solution does not score high on all dimensions, you need to start over.


# 6. Control the Proactivity of the Encoding Proxy

By default, GPT-5 strives to be detailed and comprehensive when collecting context. You can more explicitly specify its proactivity through prompts, as well as whether it should handle information discovery/tool calls in parallel.

You can set a budget for tool usage for the model, clearly indicating when more detail is needed, when it can be brief, and when communication with the user is necessary for confirmation. For example:


- Do not ask the user to confirm or clarify your assumptions; you can make adjustments in subsequent steps at any time.
- Make your own judgment and adopt the most reasonable assumption, then continue to execute, and record that assumption for user reference after completion.
GPT11%
XPRT-2.99%
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate App
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)