Add Zed integration#2780
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds Zed editor as a new skills-based integration that installs Spec Kit commands as .agents/skills/speckit-<name>/SKILL.md files invokable via Zed's slash-command menu.
Changes:
- New
ZedIntegrationclass registered in the integrations registry - Hook invocation rendering and init-flow handling for
zedskill mode - Documentation, registry, and integration-test updates including a new
test_integration_zed.py
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/specify_cli/integrations/zed/init.py | New ZedIntegration (skills-based, .agents/skills, AGENTS.md) |
| src/specify_cli/integrations/init.py | Imports and registers ZedIntegration |
| src/specify_cli/extensions.py | Adds zed_skill_mode branch rendering /skill-name invocations |
| src/specify_cli/commands/init.py | Adds Zed to skill-mode flags, post-init step, and display command logic |
| docs/reference/integrations.md | Adds Zed row to integrations table |
| docs/index.md | Bumps integration count from 30 to 31 and lists Zed |
| tests/integrations/test_registry.py | Adds zed to expected-keys list |
| tests/integrations/test_integration_subcommand.py | Asserts zed appears in list output |
| tests/integrations/test_integration_zed.py | New tests for Zed integration and hook invocation rendering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
…am/main resolving conflicts
|
Side note, I have been using it last couple days and it works as expected |
|
Please address Copilot feedback and the test & lint errors |
- Remove non-actionable --skills flag from ZedIntegration (Zed is always skills-based, like Agy) - Align zed_skill_mode predicate with ai_skills for consistency across init output and hook rendering - Consolidate claude/cursor/zed slash-skill return blocks in _render_hook_invocation to reduce duplication - Override test_options_include_skills_flag for Zed (no --skills flag)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Make zed_skill_mode unconditional in hook rendering (Zed is always skills-based, no --skills option) - Add test_init_persists_ai_skills_for_zed that exercises the actual CLI init path and verifies HookExecutor renders /speckit-plan without manual init-options manipulation
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Addressed the latest Copilot review comment (agy/trae invocation inconsistency) in 045afb9:
Also addressed the earlier F841 unused-variable comments (claude_skill_mode, cursor_skill_mode) in 5f3cdb4. |
Resolved conflicts: - src/specify_cli/commands/init.py: function param formatting + removed git init / branch_numbering code from upstream/main (Zed-specific additions preserved) - src/specify_cli/extensions.py: cache write encoding (accepted upstream/main's utf-8 + OSError handling) - tests/integrations/test_integration_zed.py: removed --no-git flag (no longer accepted by the CLI)
- Add is_slash_skills_agent() helper to extensions.py to centralize the agent-to-invocation-format mapping, reducing drift risk between HookExecutor._render_hook_invocation() and init.py _display_cmd() - Use the shared helper in both locations; init.py now imports and delegates to is_slash_skills_agent() instead of maintaining its own per-agent boolean matrix - Fix test_hooks_render_skill_invocation to use ai_skills=False, proving Zed renders /speckit-<name> unconditionally - Add parameterized TestSlashSkillsSets covering all agents in ALWAYS_SLASH_AGENTS and CONDITIONAL_SLASH_AGENTS with ai_skills both true and false
|
Addressed all 4 new Copilot review comments in 3e750e8: 1-2. 3. Added parameterized 4. Centralized invocation-style logic — extracted |
|
Please address Copilot feedback |
1c5a4f0 to
b8f4ecd
Compare
- Make is_slash_skills_agent() accept str | None to match its call sites
(init_options.get("ai") can return None)
- Refactor TestSlashSkillsSets to use public execute_hook() API instead of
private _render_hook_invocation() method
b8f4ecd to
8029aba
Compare
- Add from __future__ import annotations to extensions.py so PEP 604 unions (str | None) are safe regardless of Python version - Add clarifying _ai_skills_enabled local variable in init.py's _display_cmd() to make the semantic meaning explicit when passing it to is_slash_skills_agent()
| registrar_config = { | ||
| "dir": ".agents/skills", | ||
| "format": "markdown", | ||
| "args": "$ARGUMENTS", | ||
| "extension": "/SKILL.md", | ||
| } |
| from ..extensions import is_slash_skills_agent as _is_slash_skills_agent | ||
|
|
||
| # `_is_skills_integration` means the integration is installed in | ||
| # skills mode, which is the semantic equivalent of `ai_skills_enabled` | ||
| # used by `is_slash_skills_agent()`. | ||
| _ai_skills_enabled = _is_skills_integration | ||
|
|
||
| def _display_cmd(name: str) -> str: |
- Extract ALWAYS_SLASH_AGENTS, CONDITIONAL_SLASH_AGENTS, and is_slash_skills_agent() from extensions.py into new _invocation_style.py module, eliminating the awkward init.py -> extensions.py import dependency for invocation-style decision logic - Both HookExecutor._render_hook_invocation() and init.py _display_cmd() now import from the shared module instead of one subsystem importing from the other - Revert /SKILL.md change: the leading slash is semantically significant (path component vs filename suffix)
…_flag get_integration() returns IntegrationBase | None, so i.options() is a type error without a None check.
| def test_options_include_skills_flag(self): | ||
| """Zed is always skills-based; no --skills option needed.""" | ||
| i = get_integration(self.KEY) | ||
| assert i is not None | ||
| skills_opts = [o for o in i.options() if o.name == "--skills"] | ||
| assert len(skills_opts) == 0, ( | ||
| "Zed is always skills-based and should not expose a --skills option" | ||
| ) |
…, no --skills flag) Zed is always skills-based and doesn't expose a --skills option. Override the inherited base test to assert --skills is absent.
|
Regarding the This is not something that should be changed in just the Zed integration — it would require updating all SkillsIntegration subclasses and the base test assertion, which is out of scope for this PR. |
|
Please resolve conflicts |
Summary
zedintegration that installs Spec Kit commands as Zed skills under.agents/skillsTesting
uv run --extra test python3 -m pytest tests/integrations/test_registry.py tests/integrations/test_integration_subcommand.py::TestIntegrationList::test_list_shows_available_integrations tests/integrations/test_integration_zed.py -qCloses #2779