mirror of
https://github.com/github/spec-kit.git
synced 2026-07-03 12:28:06 +08:00
feat(integrations): add Devin for Terminal skills-based integration (#2364)
* feat(integrations): add Devin for Terminal skills-based integration - Register DevinIntegration as a SkillsIntegration with .devin/skills/ layout - Add catalog entry, docs row, and supported-agents listing - Display /speckit-<command> hyphen syntax in init "Next Steps" panel (matches Claude/Cursor/Copilot skills mode, since Devin invokes skills by directory name) Closes #2346 * fix(devin): implement -p non-interactive dispatch; clarify skills comment Addresses Copilot review on PR #2364: - Override build_exec_args() in DevinIntegration to emit 'devin -p <prompt> [--model X]' for non-interactive text dispatch (verified Devin CLI supports -p / --print). Returns None when output_json=True since Devin has no structured-output flag, so CommandStep workflows that require JSON cleanly raise NotImplementedError instead of crashing on an unknown CLI flag. requires_cli=True is retained for tool detection. - Extend the skills-integrations enumeration comment in specify_cli/__init__.py to include copilot and devin so the comment matches the code below it. * fix(devin): always return exec args; document plain-text stdout Addresses third Copilot review comment on PR #2364. Returning None from build_exec_args() when output_json=True incorrectly used the codebase's IDE-only sentinel: workflow CommandStep checks 'impl.build_exec_args("test") is None' to detect non-dispatchable integrations (test_workflows.py exercises this with WindsurfIntegration). The previous implementation made Devin appear non-dispatchable to all command steps even though it runs fine via 'devin -p'. Always return the args list. When output_json is requested, Devin is still dispatched and returns plain-text stdout instead of structured JSON; the docstring documents this explicitly. * docs(devin): include claude in skills-integrations enumeration comment Addresses Copilot review on PR #2364: the comment listing skills integrations omitted Claude, which is also a SkillsIntegration subclass. Updated to keep the comment accurate for future readers. * test(devin): add build_exec_args regression tests; bump catalog updated_at Addresses Copilot review on PR #2364, per @mnriem's request to 'address the Copilot feedback, especially the testing ask': - tests/integrations/test_integration_devin.py: add TestDevinBuildExecArgs with three regression assertions: * build_exec_args returns args (not the None IDE-only sentinel) * --output-format is never emitted, regardless of output_json * --model flag is passed through correctly - integrations/catalog.json: bump top-level updated_at to reflect the Devin entry addition so downstream catalog consumers can detect the change reliably.
This commit is contained in:
2
.github/ISSUE_TEMPLATE/agent_request.yml
vendored
2
.github/ISSUE_TEMPLATE/agent_request.yml
vendored
@@ -8,7 +8,7 @@ body:
|
|||||||
value: |
|
value: |
|
||||||
Thanks for requesting a new agent! Before submitting, please check if the agent is already supported.
|
Thanks for requesting a new agent! Before submitting, please check if the agent is already supported.
|
||||||
|
|
||||||
**Currently supported agents**: Claude Code, Gemini CLI, GitHub Copilot, Cursor, Qwen Code, opencode, Codex CLI, Windsurf, Kilo Code, Auggie CLI, Roo Code, CodeBuddy, Qoder CLI, Kiro CLI, Amp, SHAI, Tabnine CLI, Antigravity, IBM Bob, Mistral Vibe, Kimi Code, Trae, Pi Coding Agent, iFlow CLI
|
**Currently supported agents**: Claude Code, Gemini CLI, GitHub Copilot, Cursor, Qwen Code, opencode, Codex CLI, Windsurf, Kilo Code, Auggie CLI, Roo Code, CodeBuddy, Qoder CLI, Kiro CLI, Amp, SHAI, Tabnine CLI, Antigravity, IBM Bob, Mistral Vibe, Kimi Code, Trae, Pi Coding Agent, iFlow CLI, Devin for Terminal
|
||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
id: agent-name
|
id: agent-name
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ The Specify CLI supports a wide range of AI coding agents. When you run `specify
|
|||||||
| [CodeBuddy CLI](https://www.codebuddy.ai/cli) | `codebuddy` | |
|
| [CodeBuddy CLI](https://www.codebuddy.ai/cli) | `codebuddy` | |
|
||||||
| [Codex CLI](https://github.com/openai/codex) | `codex` | Skills-based integration; installs skills into `.agents/skills` and invokes them as `$speckit-<command>` |
|
| [Codex CLI](https://github.com/openai/codex) | `codex` | Skills-based integration; installs skills into `.agents/skills` and invokes them as `$speckit-<command>` |
|
||||||
| [Cursor](https://cursor.sh/) | `cursor-agent` | |
|
| [Cursor](https://cursor.sh/) | `cursor-agent` | |
|
||||||
|
| [Devin for Terminal](https://cli.devin.ai/docs) | `devin` | Skills-based integration; installs skills into `.devin/skills/` and invokes them as `/speckit-<command>` |
|
||||||
| [Forge](https://forgecode.dev/) | `forge` | |
|
| [Forge](https://forgecode.dev/) | `forge` | |
|
||||||
| [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `gemini` | |
|
| [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `gemini` | |
|
||||||
| [GitHub Copilot](https://code.visualstudio.com/) | `copilot` | |
|
| [GitHub Copilot](https://code.visualstudio.com/) | `copilot` | |
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"schema_version": "1.0",
|
"schema_version": "1.0",
|
||||||
"updated_at": "2026-04-08T00:00:00Z",
|
"updated_at": "2026-04-28T00:00:00Z",
|
||||||
"catalog_url": "https://raw.githubusercontent.com/github/spec-kit/main/integrations/catalog.json",
|
"catalog_url": "https://raw.githubusercontent.com/github/spec-kit/main/integrations/catalog.json",
|
||||||
"integrations": {
|
"integrations": {
|
||||||
"claude": {
|
"claude": {
|
||||||
@@ -66,6 +66,15 @@
|
|||||||
"repository": "https://github.com/github/spec-kit",
|
"repository": "https://github.com/github/spec-kit",
|
||||||
"tags": ["cli", "skills"]
|
"tags": ["cli", "skills"]
|
||||||
},
|
},
|
||||||
|
"devin": {
|
||||||
|
"id": "devin",
|
||||||
|
"name": "Devin for Terminal",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Devin for Terminal CLI skills-based integration",
|
||||||
|
"author": "spec-kit-core",
|
||||||
|
"repository": "https://github.com/github/spec-kit",
|
||||||
|
"tags": ["cli", "skills"]
|
||||||
|
},
|
||||||
"qwen": {
|
"qwen": {
|
||||||
"id": "qwen",
|
"id": "qwen",
|
||||||
"name": "Qwen Code",
|
"name": "Qwen Code",
|
||||||
|
|||||||
@@ -1528,7 +1528,7 @@ def init(
|
|||||||
step_num = 2
|
step_num = 2
|
||||||
|
|
||||||
# Determine skill display mode for the next-steps panel.
|
# Determine skill display mode for the next-steps panel.
|
||||||
# Skills integrations (codex, kimi, agy, trae, cursor-agent) should show skill invocation syntax.
|
# Skills integrations (codex, claude, kimi, agy, trae, cursor-agent, copilot, devin) should show skill invocation syntax.
|
||||||
from .integrations.base import SkillsIntegration as _SkillsInt
|
from .integrations.base import SkillsIntegration as _SkillsInt
|
||||||
_is_skills_integration = isinstance(resolved_integration, _SkillsInt) or getattr(resolved_integration, "_skills_mode", False)
|
_is_skills_integration = isinstance(resolved_integration, _SkillsInt) or getattr(resolved_integration, "_skills_mode", False)
|
||||||
|
|
||||||
@@ -1539,7 +1539,8 @@ def init(
|
|||||||
trae_skill_mode = selected_ai == "trae"
|
trae_skill_mode = selected_ai == "trae"
|
||||||
cursor_agent_skill_mode = selected_ai == "cursor-agent" and (ai_skills or _is_skills_integration)
|
cursor_agent_skill_mode = selected_ai == "cursor-agent" and (ai_skills or _is_skills_integration)
|
||||||
copilot_skill_mode = selected_ai == "copilot" and _is_skills_integration
|
copilot_skill_mode = selected_ai == "copilot" and _is_skills_integration
|
||||||
native_skill_mode = codex_skill_mode or claude_skill_mode or kimi_skill_mode or agy_skill_mode or trae_skill_mode or cursor_agent_skill_mode or copilot_skill_mode
|
devin_skill_mode = selected_ai == "devin"
|
||||||
|
native_skill_mode = codex_skill_mode or claude_skill_mode or kimi_skill_mode or agy_skill_mode or trae_skill_mode or cursor_agent_skill_mode or copilot_skill_mode or devin_skill_mode
|
||||||
|
|
||||||
if codex_skill_mode and not ai_skills:
|
if codex_skill_mode and not ai_skills:
|
||||||
# Integration path installed skills; show the helpful notice
|
# Integration path installed skills; show the helpful notice
|
||||||
@@ -1551,6 +1552,9 @@ def init(
|
|||||||
if cursor_agent_skill_mode and not ai_skills:
|
if cursor_agent_skill_mode and not ai_skills:
|
||||||
steps_lines.append(f"{step_num}. Start Cursor Agent in this project directory; spec-kit skills were installed to [cyan].cursor/skills[/cyan]")
|
steps_lines.append(f"{step_num}. Start Cursor Agent in this project directory; spec-kit skills were installed to [cyan].cursor/skills[/cyan]")
|
||||||
step_num += 1
|
step_num += 1
|
||||||
|
if devin_skill_mode:
|
||||||
|
steps_lines.append(f"{step_num}. Start Devin in this project directory; spec-kit skills were installed to [cyan].devin/skills[/cyan]")
|
||||||
|
step_num += 1
|
||||||
usage_label = "skills" if native_skill_mode else "slash commands"
|
usage_label = "skills" if native_skill_mode else "slash commands"
|
||||||
|
|
||||||
def _display_cmd(name: str) -> str:
|
def _display_cmd(name: str) -> str:
|
||||||
@@ -1560,7 +1564,7 @@ def init(
|
|||||||
return f"/speckit-{name}"
|
return f"/speckit-{name}"
|
||||||
if kimi_skill_mode:
|
if kimi_skill_mode:
|
||||||
return f"/skill:speckit-{name}"
|
return f"/skill:speckit-{name}"
|
||||||
if cursor_agent_skill_mode or copilot_skill_mode:
|
if cursor_agent_skill_mode or copilot_skill_mode or devin_skill_mode:
|
||||||
return f"/speckit-{name}"
|
return f"/speckit-{name}"
|
||||||
return f"/speckit.{name}"
|
return f"/speckit.{name}"
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ def _register_builtins() -> None:
|
|||||||
from .codex import CodexIntegration
|
from .codex import CodexIntegration
|
||||||
from .copilot import CopilotIntegration
|
from .copilot import CopilotIntegration
|
||||||
from .cursor_agent import CursorAgentIntegration
|
from .cursor_agent import CursorAgentIntegration
|
||||||
|
from .devin import DevinIntegration
|
||||||
from .forge import ForgeIntegration
|
from .forge import ForgeIntegration
|
||||||
from .gemini import GeminiIntegration
|
from .gemini import GeminiIntegration
|
||||||
from .generic import GenericIntegration
|
from .generic import GenericIntegration
|
||||||
@@ -86,6 +87,7 @@ def _register_builtins() -> None:
|
|||||||
_register(CodexIntegration())
|
_register(CodexIntegration())
|
||||||
_register(CopilotIntegration())
|
_register(CopilotIntegration())
|
||||||
_register(CursorAgentIntegration())
|
_register(CursorAgentIntegration())
|
||||||
|
_register(DevinIntegration())
|
||||||
_register(ForgeIntegration())
|
_register(ForgeIntegration())
|
||||||
_register(GeminiIntegration())
|
_register(GeminiIntegration())
|
||||||
_register(GenericIntegration())
|
_register(GenericIntegration())
|
||||||
|
|||||||
65
src/specify_cli/integrations/devin/__init__.py
Normal file
65
src/specify_cli/integrations/devin/__init__.py
Normal file
@@ -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.
|
||||||
|
|
||||||
|
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
|
||||||
|
def options(cls) -> list[IntegrationOption]:
|
||||||
|
return [
|
||||||
|
IntegrationOption(
|
||||||
|
"--skills",
|
||||||
|
is_flag=True,
|
||||||
|
default=True,
|
||||||
|
help="Install as agent skills (default for Devin)",
|
||||||
|
),
|
||||||
|
]
|
||||||
75
tests/integrations/test_integration_devin.py
Normal file
75
tests/integrations/test_integration_devin.py
Normal file
@@ -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()
|
||||||
Reference in New Issue
Block a user