Prompting Advice
Tips on how to best prompt and redirect Devin
Devin needs guidance on what your preferences are and how to check if it’s on the right track. If not specified, Devin will make its own judgment calls. We recommend following a simple structure in your prompts to make sure Devin stays on track and checks its own work:
What
Describe the task you want Devin to complete.
Example: Upgrade my project from Java 7 to Java 8.
How
Describe some do’s and don’t’s for Devin when completing the task (e.g. deploy using Modal, etc.)
Example: Identify and replace deprecated Java 7 APIs with their Java 8 equivalents. Analyze the codebase for potential Java 8 language and API enhancements.
Result
Describe the expected results or behaviors Devin should test for so Devin knows when the task is complete.
Example: Run the test suite and verify that all tests pass successfully. Build the project using the updated Java 8 configuration and verify that the application is up and running.
Choosing the Right Tasks
When deciding what to delegate to Devin, look for tasks that have:
-
Clear Success Criteria
- Tasks where success can be automatically validated
- Built-in feedback loops (tests, compilation, lint checks)
- Objective quality measures
-
Appropriate Scope
- Junior engineer level complexity
- Well-defined boundaries
- Clear patterns to follow
-
Repetitive Elements
- Tasks that need similar changes applied many times
- Variations that make pure scripting difficult
- Existing examples to follow
-
Common Examples
- Version upgrades across multiple packages
- Adding test coverage to untested modules
- Converting files to use new patterns/standards
- Implementing standard UI components
Split complex tasks into simpler sub-tasks, across multiple sessions
As with any entry-level engineer, Devin is more likely to succeed if complex projects are broken down into clear sub-tasks. For example, rather than asking Devin to upgrade your application code, test suite, and CI configuration in one session, you may want to break this down into three separate sessions.
For particularly complex tasks, we recommend working with Devin across multiple separate sessions as Devin’s performance can sometimes degrade as the session gets longer. If this happens, consider using snapshots as a way to maintain the progress on Devin’s machine image in your new sessions.
Tell Devin how to check its progress
Devin performs best when given clear verification steps to validate its work. This helps ensure the task is being completed correctly and allows Devin to catch potential issues early.
Here is a non-exhaustive list of some ways to help Devin verify its work:
-
Specify test requirements
- Ask Devin to run specific test suites
- Define which tests should pass
- Request test coverage metrics if relevant
-
Set clear checkpoints
- Break down complex tasks into verifiable steps
- Define what success looks like at each step
- Ask Devin to report back after completing each checkpoint
-
Provide validation criteria
For tasks without formal tests, specify how Devin should validate its work. For example:
- When working with datasets: “Verify the dataset has at least 500 rows and contains columns X, Y, Z”
- When modifying APIs: “Confirm the endpoint returns status 200 and includes all required fields”
- When updating UI: “Check that the component renders without console errors and matches the design spec”
The more specific you are about validation requirements, the more confidently Devin can proceed with the task without intervention.
Be clear and specific
Provide clear, detailed instructions and requirements for Devin. For example, try to:
- Specify the key steps necessary to complete a task
- Name specific repos, libraries, branches, etc you want Devin to work with
Nothing is “too obvious” for Devin, but it will do its best to clarify and ask questions along the way.
Use Playbooks
For repetitive or complex tasks, we suggest using and iterating on Playbooks. Playbooks are easily reusable and shareable prompts. For example, if you want Devin to address ongoing CI build failures, you can create a playbook that includes the general steps Devin should take each time to resolve the issue without having to include them in every prompt.
Provide references or examples
When available, link documentation or examples that are relevant for the task. If you don’t provide any resources, Devin may search for documentation independently.
Jump in!
Ask Devin questions and give Devin instructions while it’s working, just as you would with any other teammate!