A Squadron plugin that integrates Devin AI for automated pull request QA, code review, and code development.
This plugin uses the Devin v3 API.
Performs a full QA review of a pull request. Devin checks out the PR branch, analyzes changes, runs existing tests, and returns a comprehensive summary.
The QA review covers:
- Bug detection, edge cases, and logic errors
- Error handling adequacy
- Test execution and failure reporting
- Missing test coverage for new/changed code
- Regression risks in related functionality
- Alignment with PR description and linked issues
- Performance concerns
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
pr_url |
string | yes | Full URL of the GitHub PR (e.g. https://github.com/org/repo/pull/123) |
instructions |
string | no | Additional instructions or focus areas for the QA review |
Performs a full code review of a pull request. Devin reviews the diff, posts inline comments directly on the GitHub PR, and submits an overall review summary.
The code review covers:
- Every changed file in the PR diff
- Code quality, readability, and maintainability
- Correctness and potential bugs
- Security concerns and vulnerabilities
- Adherence to best practices and coding conventions
- Improvement suggestions
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
pr_url |
string | yes | Full URL of the GitHub PR (e.g. https://github.com/org/repo/pull/123) |
instructions |
string | no | Additional instructions or focus areas for the code review |
Develops code on a repository. Devin clones the repo, implements the requested changes, runs tests, and opens a pull request with the completed work.
Use this for:
- Feature development
- Bug fixes
- Refactoring
- Any code changes on a repository
Devin will follow existing code conventions, add or update tests, and open a PR with a detailed description. The repository is passed to Devin via the v3 repos field, so Devin has direct access to it.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
repo_url |
string | yes | Full URL of the GitHub repository (e.g. https://github.com/org/repo) |
task |
string | yes | Description of the development task to perform |
branch |
string | no | Branch name for Devin to create. If omitted, Devin chooses an appropriate name. |
instructions |
string | no | Additional context, constraints, or coding guidelines |
Checks the status of an existing Devin session. Returns the full session status including current state, pull requests, and Devin's messages. Use this to inspect a session that was previously created by another tool or to check on a long-running session.
The session ID is returned by code_qa, code_review, and code_develop when they create a session.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
session_id |
string | yes | The Devin session ID (e.g. 32fee96e7997499ca010301aa50eefce) |
Sends a follow-up message to an existing Devin session and waits for Devin to finish responding. Use this to continue a conversation with a session that is waiting for user input, for example to answer a question, give additional instructions, or request changes.
The session must still be open (not archived). To keep sessions resumable after code_qa, code_review, or code_develop complete, set archive_on_complete = "false" in the plugin settings.
After sending the message, the plugin reuses the same polling logic as the other tools, waiting until Devin finishes the follow-up work before returning its response.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
session_id |
string | yes | The Devin session ID to send the message to |
message |
string | yes | The message to send to Devin (follow-up instruction, answer, or change request) |
Finalizes and archives a Devin session. Call this upon mission finalization once no further follow-up messages are needed, to archive the session and release its resources. After completion the session can no longer be resumed with send_message.
This is the explicit counterpart to archive_on_complete = "false": when sessions are left resumable, use complete_session to archive them when the work is truly done.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
session_id |
string | yes | The Devin session ID to finalize and archive |
- Go 1.23+
- A Devin AI account with v3 API access
- A Devin service user with an API key (starts with
cog_) - Your Devin organization ID
- Devin must already have access to the GitHub repos you want to review or develop on
The v3 API uses service user tokens instead of personal API keys. Follow these steps to get set up:
-
Create a service user in your Devin organization:
- Go to your Devin dashboard at app.devin.ai
- Navigate to Settings > Service Users
- Create a new service user and assign it a role with the
UseDevinSessionspermission
-
Copy the API key — it starts with
cog_and is only shown once. Store it securely. -
Find your organization ID — visible on the Settings > Service Users page in the Devin dashboard.
-
Grant repo access — ensure Devin has access to the GitHub repositories you want to work with. This is configured in your Devin organization's GitHub integration settings.
For more details, see the Devin API documentation.
# Clone the plugin project
git clone git@github.com:ericlakich/squadron-plugin-devin.git
# Build
cd squadron-plugin-devin
go mod tidy
go build -o plugin .
# Install into Squadron's plugin directory
mkdir -p ~/.squadron/plugins/devin/local
cp plugin ~/.squadron/plugins/devin/local/pluginAdd the plugin to your Squadron HCL config:
plugin "devin" {
version = "local"
settings = {
api_key = "<your-devin-service-user-key>"
org_id = "<your-devin-org-id>"
poll_timeout_minutes = "60"
archive_on_complete = "true"
}
}Then attach the tools to an agent:
agent "reviewer" {
model = models.anthropic.claude_sonnet_4
tools = [plugins.devin.code_qa, plugins.devin.code_review, plugins.devin.code_develop, plugins.devin.check_session, plugins.devin.send_message, plugins.devin.complete_session]
}| Setting | Required | Description |
|---|---|---|
api_key |
yes | Devin service user API key (starts with cog_). Created under Settings > Service Users in the Devin dashboard. |
org_id |
yes | Devin organization ID. Found on the Settings > Service Users page in the Devin dashboard. |
poll_timeout_minutes |
no | Maximum time in minutes to wait for a Devin session to complete. Defaults to 60. Increase for long-running development tasks. |
archive_on_complete |
no | Whether code_qa, code_review, and code_develop archive their session once Devin finishes. Defaults to true. Set to false to leave sessions resumable so they can be continued with send_message and finalized with complete_session. |
- The agent invokes a tool (
code_qa,code_review, orcode_develop) with the required parameters. - The plugin creates a new Devin session via the Devin v3 API (
POST /v3/organizations/{org_id}/sessions). - The plugin polls the session status every 15 seconds (up to
poll_timeout_minutes, default 60) until Devin finishes. - The session is archived (unless
archive_on_complete = "false") and the result — including Devin's messages — is returned as a text summary.
When archive_on_complete is false, sessions are left open after they finish. Use send_message to continue working with a session (the plugin sends the message and polls until Devin finishes again), and complete_session to archive it once the mission is finalized.
For code_review, Devin also posts inline review comments directly on the GitHub PR during its session.
For code_develop, the repository URL is passed via the v3 repos field so Devin has direct access. Devin implements the changes and opens a pull request. The PR link is included in the result.
For check_session, the plugin fetches the current status and message history for an existing session without creating a new one. This is useful for inspecting sessions created by other tools or checking on long-running work.
All tools respect context cancellation, so Squadron can terminate long-running sessions cleanly. Transient API errors during polling are retried automatically (up to 5 consecutive failures).
squadron-plugin-devin/
main.go # Entry point - registers the plugin with Squadron
plugin.go # ToolProvider implementation, tool definitions, prompt builders
devin/
client.go # HTTP client for the Devin AI v3 API
go.mod
go.sum
See LICENSE for details.