-
Notifications
You must be signed in to change notification settings - Fork 8.3k
feat(integrations): add Devin for Terminal skills-based integration #2364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2a3fb7e
feat(integrations): add Devin for Terminal skills-based integration
ivishalgandhi 0b64174
fix(devin): implement -p non-interactive dispatch; clarify skills com…
ivishalgandhi 4c99e27
fix(devin): always return exec args; document plain-text stdout
ivishalgandhi aaed83c
docs(devin): include claude in skills-integrations enumeration comment
ivishalgandhi 5dd15f4
test(devin): add build_exec_args regression tests; bump catalog updat…
ivishalgandhi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| """Devin for Terminal integration — skills-based agent. | ||
|
|
||
| Devin uses the ``.devin/skills/speckit-<name>/SKILL.md`` layout and | ||
| reads project context from ``AGENTS.md`` at the repo root. The CLI | ||
| binary is ``devin`` and skills are invoked via ``/<name>`` inside an | ||
| interactive ``devin`` session. | ||
|
|
||
| See: https://cli.devin.ai/docs/extensibility/skills/overview | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from ..base import IntegrationOption, SkillsIntegration | ||
|
|
||
|
|
||
| class DevinIntegration(SkillsIntegration): | ||
| """Integration for Cognition AI's Devin for Terminal.""" | ||
|
|
||
| key = "devin" | ||
| config = { | ||
| "name": "Devin for Terminal", | ||
| "folder": ".devin/", | ||
| "commands_subdir": "skills", | ||
| "install_url": "https://cli.devin.ai/docs", | ||
| "requires_cli": True, | ||
| } | ||
| registrar_config = { | ||
| "dir": ".devin/skills", | ||
| "format": "markdown", | ||
| "args": "$ARGUMENTS", | ||
| "extension": "/SKILL.md", | ||
| } | ||
| context_file = "AGENTS.md" | ||
|
|
||
| def build_exec_args( | ||
| self, | ||
| prompt: str, | ||
| *, | ||
| model: str | None = None, | ||
| output_json: bool = True, | ||
| ) -> list[str] | None: | ||
| """Build non-interactive CLI args for Devin for Terminal. | ||
|
|
||
|
mnriem marked this conversation as resolved.
|
||
| Devin supports ``devin -p <prompt>`` for single-turn execution | ||
| and ``--model`` for model selection, but its CLI has no flag | ||
| for structured JSON output. When ``output_json`` is requested, | ||
| Devin is still dispatched normally and returns plain-text | ||
| stdout instead of structured JSON. ``requires_cli=True`` is | ||
| kept on the integration for tool detection. | ||
| """ | ||
| args = [self.key, "-p", prompt] | ||
| if model: | ||
| args.extend(["--model", model]) | ||
| return args | ||
|
|
||
| @classmethod | ||
|
mnriem marked this conversation as resolved.
|
||
| def options(cls) -> list[IntegrationOption]: | ||
| return [ | ||
| IntegrationOption( | ||
| "--skills", | ||
| is_flag=True, | ||
| default=True, | ||
| help="Install as agent skills (default for Devin)", | ||
| ), | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| """Tests for DevinIntegration.""" | ||
|
|
||
| from .test_integration_base_skills import SkillsIntegrationTests | ||
|
|
||
|
|
||
| class TestDevinIntegration(SkillsIntegrationTests): | ||
| KEY = "devin" | ||
| FOLDER = ".devin/" | ||
| COMMANDS_SUBDIR = "skills" | ||
| REGISTRAR_DIR = ".devin/skills" | ||
| CONTEXT_FILE = "AGENTS.md" | ||
|
|
||
|
|
||
| class TestDevinBuildExecArgs: | ||
| """Regression tests for DevinIntegration.build_exec_args. | ||
|
|
||
| Devin's CLI has no --output-format flag, so build_exec_args must | ||
| omit it regardless of the output_json argument. The integration | ||
| must also remain dispatchable (must not return None, which is the | ||
| codebase's IDE-only sentinel checked by CommandStep). | ||
| """ | ||
|
|
||
| def test_returns_args_not_none_for_dispatch(self): | ||
| """Devin is CLI-dispatchable; build_exec_args must not return None.""" | ||
| from specify_cli.integrations.devin import DevinIntegration | ||
|
|
||
| impl = DevinIntegration() | ||
| args = impl.build_exec_args("test prompt") | ||
| assert args is not None, ( | ||
| "DevinIntegration.build_exec_args must not return None. " | ||
| "None is the codebase sentinel for IDE-only integrations " | ||
| "(see WindsurfIntegration); Devin is dispatchable via 'devin -p'." | ||
| ) | ||
| assert args[:3] == ["devin", "-p", "test prompt"] | ||
|
|
||
| def test_output_json_does_not_emit_output_format_flag(self): | ||
| """Devin has no --output-format flag; output_json=True must not add it.""" | ||
| from specify_cli.integrations.devin import DevinIntegration | ||
|
|
||
| impl = DevinIntegration() | ||
| args_json = impl.build_exec_args("hello", output_json=True) | ||
| args_text = impl.build_exec_args("hello", output_json=False) | ||
|
|
||
| assert "--output-format" not in args_json | ||
| assert "json" not in args_json[3:] | ||
| # The two should be identical: output_json is documented as having | ||
| # no effect on the command line for Devin (plain-text stdout). | ||
| assert args_json == args_text | ||
|
|
||
| def test_model_flag_passed_through(self): | ||
| """--model is supported and should appear when provided.""" | ||
| from specify_cli.integrations.devin import DevinIntegration | ||
|
|
||
| impl = DevinIntegration() | ||
| args = impl.build_exec_args("hi", model="claude-sonnet-4") | ||
| assert args == ["devin", "-p", "hi", "--model", "claude-sonnet-4"] | ||
|
|
||
|
|
||
| class TestDevinAutoPromote: | ||
| """--ai devin auto-promotes to integration path.""" | ||
|
|
||
| def test_ai_devin_without_ai_skills_auto_promotes(self, tmp_path): | ||
| """--ai devin should work the same as --integration devin.""" | ||
| from typer.testing import CliRunner | ||
| from specify_cli import app | ||
|
|
||
| runner = CliRunner() | ||
| target = tmp_path / "test-proj" | ||
| result = runner.invoke( | ||
| app, | ||
| ["init", str(target), "--ai", "devin", "--no-git", "--ignore-agent-tools", "--script", "sh"], | ||
| ) | ||
|
|
||
| assert result.exit_code == 0, f"init --ai devin failed: {result.output}" | ||
| assert (target / ".devin" / "skills" / "speckit-plan" / "SKILL.md").exists() | ||
|
mnriem marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.