zcode-delegate
它能做什么
这个工具可以让你把编写代码的任务交给 Z.AI ZCode CLI 来完成。你负责写下指令,并在接受生成的代码之前检查一遍。
适用场景
- ✓当你希望 AI 写代码,并且想在使用前先审查时。
- ✓当用户明确要求使用 Z.AI ZCode 时。
- ✓把一个需要事后审查的具体编码任务交出去时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/zcode-delegate/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“写一个 Python 脚本,读取 CSV 文件并计算某一列的平均值。”
每周 5 个新技能,1 分钟读完。
工作原理
你先写一份详细的“任务说明”,写清楚 AI 应该做什么。工具会把这份说明发送给 Z.AI ZCode CLI,由它生成代码。然后你再检查生成的代码。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Bundled upstream support
Supporting files are included at skill-relative paths. See UPSTREAM-NOTICE.md for their pinned sources, licenses, hashes, and import changes.
ZCode Delegate
When to Use
- You want to delegate a bounded coding task to a separate
zcodeimplementer (Z.AI ZCode) and then review its diff yourself. - The user explicitly asked for delegation to this implementer.
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)
- 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>orZCODE_CLIfirst, 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. - 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.
- You are in (or will point
--cdat) 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 provider block must exist in
~/.zcode/cli/config.json. It defines the provider, its endpoint and its models — the environment cannot supply this:{ "provider": { "zai": { "kind": "anthropic", "options": { "apiKeyRequired": true, "baseURL": "https://api.z.ai/api/anthropic" }, "models": { "glm-5.1": { "name": "GLM-5.1" } } } }, "model": { "main": "zai/glm-5.1" } }The key can live either in
provider.zai.options.apiKeyin that file, or in the environment as any one ofZAI_API_KEY,ZCODE_API_KEY, orANTHROPIC_API_KEY. Prefer the environment — it keeps the secret off disk.
If a run fails with Model provider is missing an API key: <provider>, the provider block resolved
but no key was found: set one of those variables and re-run.
Autonomy — read this before dispatching
ZCode's own term is mode. It has four values; only two are usable headlessly.
| mode | Behaviour |
|---|---|
yolo |
Writes. ZCode's own default for --prompt, and this relay's write-capable default. |
plan |
Refuses edits. What --read-only selects. |
build |
Rejected by this relay. No permission client exists headlessly, so tools are blocked and the run exits 0 having done nothing. |
edit |
Rejected for the same reason. |
Two limits stated plainly, because ZCode cannot enforce them:
planmode refused edits in testing, but the relay does not treat that as a guarantee. It takes a Git fingerprint before the run and reports a tri-statereadOnlyViolationafterwards. ConfirmtouchedFilescame back empty rather than assuming no edits.- ZCode has no
--allowed-tools. Only the--disallowed-toolsdenylist exists, and it is genuinely enforced. An explicit allowlisted tool surface is therefore impossible here — do not assume one.
The loop
Run these five steps per task. Steps 1, 4, and 5 are your judgment; 2 and 3 are mechanical.
1. Write the brief
ZCode sees only what you send — no repo memory, no chat history. Everything the task needs goes
…
常见问题
什么是 Z.AI ZCode CLI?
它是一个命令行工具,可以根据你的指令生成和修改代码。
我需要安装什么吗?
需要。ZCode CLI 要先安装好,并配置 API 密钥才能使用。
AI 会自动保存代码吗?
不会。AI 生成代码,但需要你手动审查并接受。它不会自动提交。
详情
作者的原始描述
Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.
热度
- GitHub 星标
- 48k
- 排名
- #6235
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。