Here are some of the very basic techniques to write better prompts, that you can use as a guide:
- The Role, Goal, Context Framework
Roles are useful are useful but they don’t direct every part of the behaviour. Goals are essential for the task at hand. Context is all the information surrounding the
- Learn the Key Words
If you just ask the agent to implement a feature/fix, it will go ahead and implement it in the most generic way possible. This is why you need to have an exhaustive understanding of the solution space at a high level so that you can specify what it needs to build.
- Few Shot Prompting
This is presenting examples to the model to explain what the intended output looks like. This is useful when you want to repeat a pattern, refactor code, reference documentation or reference existing work.
- Iterative Prompting
Use each completed step to ground the next one. We need a way to break down the problem, with two possible approaches including breaking down the feature and prototyping.
One very powerful example of iterative prompting is planning where agents give you a plan where you can catch misunderstandings early. Use planning for all big tasks where it would be expensive to go down the wrong track.