-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add Zed integration #2780
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
Open
arrrrny
wants to merge
17
commits into
github:main
Choose a base branch
from
arrrrny:feat/2779-zed-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+775
−268
Open
Add Zed integration #2780
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b122303
feat: add Zed integration
arrrrny 1d20a63
fix: address Copilot review - fix docstring punctuation, merge upstre…
arrrrny d6df1e8
fix: update integrations stats grid to 31 for consistency
arrrrny d2538e7
Merge remote-tracking branch 'upstream/main' into feat/2779-zed-integ…
arrrrny 2e99b19
fix: address Copilot review feedback
arrrrny e4f3b4c
Potential fix for pull request finding
arrrrny 2b9b482
fix: address Copilot review round 2
arrrrny 52b6d0b
Potential fix for pull request finding
arrrrny 2dbbe75
fix: address copilot review feedback for zed integration
arrrrny 48f7e94
Merge branch 'main' into feat/2779-zed-integration
arrrrny 429ce89
fix: refine slash-skill logic and ai-skills validation
arrrrny 04d3eb3
fix: remove unused variables and update ai-skills help text
arrrrny 3d2c70b
fix: add trae_skill_mode to hook invocation for consistency
arrrrny cb89f7d
fix: make Agy always skills-based for consistency
arrrrny 8a2c278
fix: gate agy_skill_mode and refactor _render_hook_invocation to use …
arrrrny e27ce85
Merge upstream/main into feat/2779-zed-integration
arrrrny 5466d62
fix: address latest Copilot review comments
arrrrny 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
Some comments aren't visible on the classic Files Changed page.
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,41 @@ | ||
| """Zed editor integration — skills-based agent. | ||
|
|
||
| Zed uses the ``.agents/skills/speckit-<name>/SKILL.md`` layout so Spec Kit | ||
| commands are exposed as project-local skills that can be invoked from Zed's | ||
| slash-command menu. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from ..base import IntegrationOption, SkillsIntegration | ||
|
|
||
|
|
||
| class ZedIntegration(SkillsIntegration): | ||
| """Integration for Zed editor skills.""" | ||
|
|
||
| key = "zed" | ||
| config = { | ||
| "name": "Zed", | ||
| "folder": ".agents/", | ||
| "commands_subdir": "skills", | ||
| "install_url": None, | ||
| "requires_cli": False, | ||
| } | ||
| registrar_config = { | ||
| "dir": ".agents/skills", | ||
| "format": "markdown", | ||
| "args": "$ARGUMENTS", | ||
| "extension": "/SKILL.md", | ||
| } | ||
| context_file = "AGENTS.md" | ||
|
|
||
| @classmethod | ||
| def options(cls) -> list[IntegrationOption]: | ||
| return [ | ||
| IntegrationOption( | ||
| "--skills", | ||
| is_flag=True, | ||
| default=True, | ||
| help="Install as agent skills (default for Zed)", | ||
| ), | ||
| ] | ||
|
arrrrny marked this conversation as resolved.
Outdated
|
||
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,51 @@ | ||
| """Tests for ZedIntegration.""" | ||
|
|
||
| import json | ||
|
|
||
| from specify_cli.integrations import get_integration | ||
|
|
||
| from .test_integration_base_skills import SkillsIntegrationTests | ||
|
|
||
|
|
||
| class TestZedIntegration(SkillsIntegrationTests): | ||
| KEY = "zed" | ||
| FOLDER = ".agents/" | ||
| COMMANDS_SUBDIR = "skills" | ||
| REGISTRAR_DIR = ".agents/skills" | ||
| CONTEXT_FILE = "AGENTS.md" | ||
|
|
||
| def test_requires_cli_is_false(self): | ||
| """Zed is IDE-based; requires_cli must remain False.""" | ||
| i = get_integration(self.KEY) | ||
| assert i is not None | ||
| assert i.config is not None | ||
| assert i.config["requires_cli"] is False | ||
|
|
||
|
|
||
| class TestZedHookInvocations: | ||
| """Zed hook messages should reference slash-invokable skills.""" | ||
|
|
||
| def test_hooks_render_skill_invocation(self, tmp_path): | ||
| from specify_cli.extensions import HookExecutor | ||
|
|
||
| project = tmp_path / "zed-hooks" | ||
| project.mkdir() | ||
| init_options = project / ".specify" / "init-options.json" | ||
| init_options.parent.mkdir(parents=True, exist_ok=True) | ||
| init_options.write_text(json.dumps({"ai": "zed", "ai_skills": True})) | ||
|
|
||
| hook_executor = HookExecutor(project) | ||
| message = hook_executor.format_hook_message( | ||
| "before_plan", | ||
| [ | ||
| { | ||
| "extension": "test-ext", | ||
| "command": "speckit.plan", | ||
| "optional": False, | ||
| } | ||
| ], | ||
| ) | ||
|
|
||
| assert "Executing: `/speckit-plan`" in message | ||
|
arrrrny marked this conversation as resolved.
|
||
| assert "EXECUTE_COMMAND: speckit.plan" in message | ||
| assert "EXECUTE_COMMAND_INVOCATION: /speckit-plan" in message | ||
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
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.