Files
github-spec-kit/tests/integrations/test_integration_zcode.py
meymchen 6a3ee9b64e feat: add ZCode (Z.AI) integration (#3063)
* feat: add ZCode (Z.AI) integration

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>

* fix: render $speckit-* invocations for ZCode skills

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>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:14:18 -05:00

39 lines
1.2 KiB
Python

"""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"
class TestZcodeInvocation:
"""ZCode renders $speckit-* chat invocations (like Codex)."""
def test_next_steps_show_dollar_skill_invocation(self, tmp_path):
"""ZCode next-steps guidance should display $speckit-* usage."""
import os
from typer.testing import CliRunner
from specify_cli import app
project = tmp_path / "zcode-next-steps"
project.mkdir()
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)
assert result.exit_code == 0
assert "$speckit-constitution" in result.output
assert "/speckit.constitution" not in result.output