January 8, 2024
Devin Best Practices
Learn how to effectively use Devin, the AI software engineer, with these essential best practices and tips
A comprehensive guide to working effectively with Devin, the AI software engineer. Learn essential best practices based on real-world experience.
1. Use DocDD.ai Approach
The foundation of working effectively with Devin is following the DocDD.ai approach:
- Break Down Work: Get your work assignments as small as possible while including maximum details
- Treat Like an Intern: Approach Devin as you would a skilled intern - clear instructions and well-defined scope
- Structured Epics: Break larger projects into manageable stories
Example: An "Invoices" epic might contain separate stories for:
- Database setup
- API development
- User interface design
2. Definition of Done
Establishing clear completion criteria is crucial:
sequenceDiagram
participant D as Devin
participant T as Tests
participant CI as CI/GitHub
participant Dev as Developer
D->>T: Write Tests
T->>CI: Push to GitHub
CI->>Dev: Run Tests
Dev->>D: Review & Feedback
D->>T: Update Tests
T->>CI: Push Updates
CI->>Dev: Verify Changes
- Ownership: Give Devin ownership of its definition of done
- Test-Driven Development: Tests are the most effective way to verify completion
- CI Integration: Set up CI in GitHub for automated test runs
- Task Completion: Always instruct Devin to create tests and consider the task complete only when tests pass
3. Working Through Pull Requests
Maintain a professional development workflow:
sequenceDiagram
participant PR as Pull Request
participant Dev as Developer
participant CI as CI/GitHub
PR->>Dev: Create PR
Dev->>CI: Run Tests
CI->>Dev: Report Status
Dev->>PR: Review Changes
PR->>Dev: Update PR
Dev->>CI: Merge
- Requirements Reference: Provide tasks with clear references to requirements
- PR Review Process: Devin will create pull requests that you can review just like any developer's work
4. Verification Process
Always verify Devin's work thoroughly:
sequenceDiagram
participant D as Devin
participant T as Tests
participant CI as CI/GitHub
participant Dev as Developer
D->>T: Write Tests
T->>CI: Push to GitHub
CI->>Dev: Run Tests
Dev->>D: Review & Feedback
D->>T: Update Tests
T->>CI: Push Updates
CI->>Dev: Verify Changes
- Local Testing: Pull the branch and run tests locally
- AI-Assisted Review: Use tools like Cursor, Cline, or Aider to:
- Review test coverage
- Verify requirements alignment
- Get feedback on test quality
Best Practices Summary
- Break down tasks into small, detailed pieces
- Establish clear definitions of done through tests
- Use proper PR workflows
- Verify work thoroughly using both manual and AI-assisted methods
Conclusion
Working with Devin effectively requires a structured approach, clear communication, and strong development practices. By following these best practices, you can maximize the benefits of AI-assisted development while maintaining high code quality and efficient workflows.