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.
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.
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 and sub-tasks
Break down complex tasks into verifiable sub-tasks, and start one Devin session for each sub-task
Define what success looks like for each sub-task, and optionally checkpoints within each sub-task
Ask Devin to report back after completing each checkpoint / sub-task
Tell Devin how to check its workClarify how Devin can check that its on the right track. 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.
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.
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.