The most important thing to remember when instructing Devin is to be as specific as possible. Just as you would provide a detailed spec when asking a coworker to code something, you should do the same with Devin. This guide will help you structure your instructions/prompts to maximize Devin’s utility.

Best Practices: Do’s and Don’ts

Example: Crafting an Effective Prompt

Providing concrete examples helps illustrate how to apply best practices. Below is a well-crafted prompt for Devin, along with an explanation of why it works well. For more examples and tips, check out our Prompting Advice guide.

In the Devin repo, I want you to build a tool that monitors the RAM and CPU usage of the remote machines that Devin runs on. To do that, please perform the following tasks:

  • Create a background task that launches automatically when devin.rs starts.
  • The task should open a connection to all forked remote machines used in this Devin session and monitor their RAM and CPU usage.
  • If usage exceeds 80% of the available resource, emit a new type of Devin event to signal this (check how we use Kafka).
  • Architect this in a smart way that doesn’t block other operations. You should understand how all the containers for the Devin sub-agents interact with each other.

Why This Works Well

Provides Helpful Context

  • Detail: Specifies the Devin repo and the broader purpose (monitoring resource usage).
  • Benefit: Devin knows the scope and domain clearly.

Gives Step-by-Step Instructions

  • Detail: Tasks like “create a background task” and “emit an event at 80% usage.”
  • Benefit: Breaks down the work into logical parts.

Defines Clear Success Criteria

  • Detail: Defines “success” as emitting a specific event upon 80% usage.
  • Benefit: Devin knows exactly what to achieve.

References Existing Patterns and Code

  • Detail: Mentions Kafka and container interactions.
  • Benefit: Encourages reuse of established code or design approaches.

Try the Prompt Improvement Button when you create a session (click the yellow warning circle to see feedback)

Conclusion

Frame tasks with enough structure and clarity to to get reliable, satisfying outcomes.