# Zcode Delegate

Delegate a coding task to the Z.AI ZCode CLI as a background implementer, then review...

- Repository: https://github.com/amElnagdy/delegate-skills (2546 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-29
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add amElnagdy/delegate-skills --skill zcode-delegate -g -a claude-code -y`
Codex: `npx skills add amElnagdy/delegate-skills --skill zcode-delegate -g -a codex -y`
Cursor: `npx skills add amElnagdy/delegate-skills --skill zcode-delegate -g -a cursor -y`
Gemini CLI: `npx skills add amElnagdy/delegate-skills --skill zcode-delegate -g -a gemini-cli -y`

## Description

Delegate a coding task to the Z.AI ZCode CLI as a background implementer, then review its diff and land it yourself. Use this whenever the user wants to hand implementation work to ZCode, phrasings like "have ZCode do X", "delegate this to ZCode", "run it through ZCode", or "use ZCode to implement/fix/refactor", or to run a queue of coding tasks through ZCode while staying the reviewer. DO NOT USE for tasks small enough to do inline, or when the user wants the code written directly without delegating.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# ZCode Delegate

You are the **orchestrator**. This skill lets you hand a bounded coding task to a separate
**implementer**, the Z.AI ZCode CLI, then review what it produced and land it yourself. You write
the brief and own the judgment; ZCode does the typing; you verify and commit.

Nothing here is specific to one orchestrating agent. The loop needs only the ability to run a shell
command and read a file. (It is designed for and run on Claude Code; treat other orchestrators as
designed-for, not yet proven.)

## When NOT to use this

- The task is small enough to just do inline, delegation overhead is not worth it.
- ZCode is not installed, or its CLI has no model provider configured.
- You want to write the code yourself, or you only need a review.

## Prerequisites (check once)

1. **ZCode is installed.** The CLI ships **inside the desktop app**, it is not on PATH and not on
   npm. The relay resolves it in this order: `--zcode-path <file>` or `ZCODE_CLI` first, then PATH,
   then the installed app bundle. On Linux the app is an AppImage with no fixed install path, so
   the flag or the environment variable is required there, the relay guesses nothing.
2. **A model provider is configured for the CLI**, with a key it can actually reach. Being signed
   into the desktop app is *not* enough, see below.
3. You are in (or will point `--cd` at) the target git repository.

The relay records the CLI version and how it was resolved into `result.json`, so a surprising
install is visible after the fact.

## Authenticating the headless CLI

**Signing into the ZCode desktop app does not authenticate the CLI this relay drives.** The CLI
keeps its own config at `~/.zcode/cli/config.json`, separate from the desktop app's, and nothing
bridges the two. `zcode login` is the intended path, but where it fails with `OAuth response is
not valid JSON` the way in is a Z.AI API key.

Two pieces are needed, and they are separate:

The rest: https://github.com/amElnagdy/delegate-skills/blob/HEAD/skills/zcode-delegate/SKILL.md
