Skip to content

Installer: first-class ZCode target (MCP + skills) - #84

Open
hsliuustc0106 wants to merge 1 commit into
mainfrom
installer/zcode-target
Open

Installer: first-class ZCode target (MCP + skills)#84
hsliuustc0106 wants to merge 1 commit into
mainfrom
installer/zcode-target

Conversation

@hsliuustc0106

Copy link
Copy Markdown

Fixes #83

What

Adds zcode as a fourth installer target, mirroring the Cursor path (config-file merge + skill copy, no CLI invocation):

  • Detection: zcode on PATH, or an existing ~/.zcode/ directory. --agent zcode also accepted explicitly.
  • MCP: merges mcp.servers.infermatrix-copilot (nested key, stdio, same uvx --from ... infermatrix-copilot-mcp command as every other target) into ~/.zcode/cli/config.json. That file also holds ZCode hooks and plugin state, so the installer merges non-destructively and writes a timestamped config.json.<ts>.bak backup first — same contract as the Cursor installer. Invalid JSON aborts without touching the file.
  • Skills: copied to ~/.zcode/skills/ (user scope; {{INFERMATRIX_COPILOT_ROOT}} substituted as usual). ZCode invokes them as /imreview, /imdesign, /imcifix, /imupdate — same slash form as Claude Code / Cursor, so the restart hint now reads Claude/Cursor/ZCode.

Why

InferMatrixCopilot's core artifacts are already ZCode-compatible (standard stdio MCP server + SKILL.md skills with name/description frontmatter); only the installer lacked the target, forcing manual config wiring.

Testing

  • test/test_install_mcp_script.py: 4 new tests — merge preserves unrelated keys (plugins, existing servers) and backs up; creates config when missing; invalid JSON raises InstallError and leaves the file unchanged; detection via ~/.zcode/ dir.
  • Full file passes (12/12); related suites (test_imupdate_skill, test_skills_scope, test_packaged_runtime) pass (19/19 total).
  • End-to-end: install_mcp.py --agent zcode --config-root <tmp> produces the expected nested config, all four skills, and ~/.infermatrix-copilot/.env.

Direct mode needs no API keys; Strict config is agent-independent and unchanged.

…/cli/config.json, skills in ~/.zcode/skills
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Installer: first-class ZCode target (MCP + skills)

1 participant