feat: add ZCode (Z.AI) integration#3063
Conversation
Add a skills-based integration for ZCode, Z.AI's Claude-Code-style agent. ZCode uses the same SKILL.md layout as Claude Code, so spec-kit installs workflows into .zcode/skills/speckit-<name>/SKILL.md, invoked in chat as $speckit-<name>. - ZcodeIntegration(SkillsIntegration) with .zcode/ folder and --skills option - Register in INTEGRATION_REGISTRY - Catalog entry (tags: cli, skills, z-ai) - Tests via SkillsIntegrationTests mixin - Document in integrations reference and README Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new built-in ZCode (Z.AI) skills-based integration to the Specify CLI, aiming to scaffold Spec Kit workflows into ZCode’s .zcode/skills/ layout and document how to invoke them.
Changes:
- Introduces
ZcodeIntegration(SkillsIntegration) with.zcode/skillsoutput +ZCODE.mdcontext file. - Registers the integration and adds it to the integrations catalog.
- Adds minimal integration scaffolding tests and updates docs/README to list ZCode as supported.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/integrations/zcode/__init__.py |
New SkillsIntegration subclass for ZCode with .zcode/ folder and skills output configuration. |
src/specify_cli/integrations/__init__.py |
Registers ZcodeIntegration() in the built-in integration registry. |
integrations/catalog.json |
Adds the zcode entry to the published integration catalog. |
tests/integrations/test_integration_zcode.py |
Adds a SkillsIntegrationTests-mixin based test class for the new integration. |
docs/reference/integrations.md |
Documents ZCode as a supported agent and describes its skills layout/invocation. |
README.md |
Updates the “agent tools installed” list to include ZCode. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 3
| | [Trae](https://www.trae.ai/) | `trae` | Skills-based integration; skills are installed automatically | | ||
| | [Windsurf](https://windsurf.com/) | `windsurf` | | | ||
| | [ZCode](https://zcode.z.ai/) | `zcode` | Skills-based integration; installs skills into `.zcode/skills/` and invokes them as `$speckit-<command>` | | ||
| | [Zed](https://zed.dev/) | `zed` | Skills-based integration; installs skills into `.agents/skills` and invokes them as `/speckit-<command>` | |
There was a problem hiding this comment.
Fixed in efc3cfd. The $speckit-* decision is now centralized in a DOLLAR_SKILLS_AGENTS set (codex + zcode) with an is_dollar_skills_agent() helper, and specify init Next Steps + extension hooks both route through it — so --integration zcode now renders $speckit-<command>, matching this docs row.
| """ZCode integration — skills-based agent (Z.AI). | ||
|
|
||
| ZCode uses the ``.zcode/skills/speckit-<name>/SKILL.md`` layout, matching | ||
| the Claude Code skill format. Skills are invoked in chat with | ||
| ``$speckit-<name>``. Z.AI recommends skills (over simple ``/`` commands) | ||
| for template- and script-driven workflows such as spec-kit. |
There was a problem hiding this comment.
Fixed in efc3cfd. Added zcode to the new DOLLAR_SKILLS_AGENTS set in _invocation_style.py; specify init now reports "skills"/"Start ZCode" and renders $speckit-<cmd> in Next Steps, and HookExecutor._render_hook_invocation renders $speckit-<cmd> for hooks.
| """Tests for ZcodeIntegration — skills-based integration (Z.AI).""" | ||
|
|
||
| from .test_integration_base_skills import SkillsIntegrationTests | ||
|
|
||
|
|
||
| class TestZcodeIntegration(SkillsIntegrationTests): | ||
| KEY = "zcode" | ||
| FOLDER = ".zcode/" | ||
| COMMANDS_SUBDIR = "skills" | ||
| REGISTRAR_DIR = ".zcode/skills" | ||
| CONTEXT_FILE = "ZCODE.md" |
There was a problem hiding this comment.
Fixed in efc3cfd. Added ZCode invocation regression coverage mirroring the Codex/Kimi tests: test_zcode_hooks_render_dollar_skill_invocation (hook rendering) in test_extensions.py and TestZcodeInvocation.test_next_steps_show_dollar_skill_invocation in this file, asserting $speckit-* appears (and /speckit.* does not) in init Next Steps output.
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
ZCode is documented as a skills agent invoked with $speckit-<command>, but the central invocation rendering only special-cased codex, so specify init Next Steps and extension hooks rendered the dotted /speckit.<command> form instead. Centralize the $speckit-* decision in a DOLLAR_SKILLS_AGENTS set with an is_dollar_skills_agent() helper, and route both init Next Steps and HookExecutor._render_hook_invocation through it. Add ZCode invocation regression tests mirroring the existing Codex/Kimi coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| def options(cls) -> list[IntegrationOption]: | ||
| return [ | ||
| IntegrationOption( | ||
| "--skills", | ||
| is_flag=True, | ||
| default=True, | ||
| help="Install as agent skills (default for ZCode)", | ||
| ), | ||
| ] |
| from ..base import IntegrationOption, SkillsIntegration | ||
|
|
||
|
|
||
| class ZcodeIntegration(SkillsIntegration): |
| | [Tabnine CLI](https://docs.tabnine.com/main/getting-started/tabnine-cli) | `tabnine` | | | ||
| | [Trae](https://www.trae.ai/) | `trae` | Skills-based integration; skills are installed automatically | | ||
| | [Windsurf](https://windsurf.com/) | `windsurf` | | | ||
| | [ZCode](https://zcode.z.ai/) | `zcode` | Skills-based integration; installs skills into `.zcode/skills/` and invokes them as `$speckit-<command>` | |
| old_cwd = os.getcwd() | ||
| try: | ||
| os.chdir(project) | ||
| runner = CliRunner() | ||
| result = runner.invoke(app, [ | ||
| "init", "--here", "--integration", "zcode", | ||
| "--ignore-agent-tools", "--script", "sh", | ||
| ], catch_exceptions=False) | ||
| finally: | ||
| os.chdir(old_cwd) |
|
Please address Copilot feedback |
…egration # Conflicts: # src/specify_cli/extensions.py
Closes #2975
Summary
Adds a skills-based integration for ZCode (Z.AI), a Claude-Code-style coding agent. ZCode uses the same
SKILL.mdskill layout as Claude Code, and Z.AI's own docs recommend Skills (over simple/commands) for template- and script-driven workflows — which is exactly what spec-kit is.Spec-kit workflows install into
.zcode/skills/speckit-<name>/SKILL.mdand are invoked in chat as$speckit-<name>.Changes
src/specify_cli/integrations/zcode/__init__.py— newZcodeIntegration(SkillsIntegration): folder.zcode/, skills dir.zcode/skills,context_file="ZCODE.md",requires_cli=True(keyzcodematches the CLI executable), and a--skillsoption.src/specify_cli/integrations/__init__.py— registered import +_register(ZcodeIntegration())(alphabetical).integrations/catalog.json— catalog entry, tags["cli", "skills", "z-ai"].tests/integrations/test_integration_zcode.py—SkillsIntegrationTestsmixin (29 tests).docs/reference/integrations.md+README.md— documentation.Modeled directly on the existing Claude/Kimi skills integrations. Two low-risk defaults: context file
ZCODE.md(consistent with the per-tool pattern; zcode docs don't pin one down) and minimal skill frontmatter (name,description) per zcode's documented format.Testing
uv run pytest tests/integrations/test_integration_zcode.py→ 29 passedtests/test_extensions.py::TestCatalogStack::test_default_stackis pre-existing onmainand unrelated to this change.Manual test results
Agent: ZCode (via
specify init) | OS/Shell: Linux/bashspecify init --integration zcode.zcode/skills/speckit-*/SKILL.mdwith correctname/descriptionfrontmatter matching zcode's documented format.AI assistance disclosure
This contribution was developed with AI assistance. The integration was researched against the zcode docs, implemented by mirroring existing skills-based integrations, and verified by me with the automated tests and the
specify initsmoke test above.