@0xgeorgemathew/zcode 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -42
- package/lib/install-skills.js +54 -0
- package/package.json +14 -3
- package/skills/README.md +2 -0
package/README.md
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
| 🧾 **Contracts, not prompts** | objective, scope, constraints, binding design decisions, acceptance criteria, checks |
|
|
25
|
-
| ✅ **Evidence over claims** | zcode runs your checks itself and repairs failures in bounded turns; the model's report is only a claim |
|
|
26
|
-
| 🧵 **Real sessions** | stable ids, detach, `status`, `wait`, `resume`, `cancel`; interrupted sessions are resumable |
|
|
27
|
-
| 🧱 **Safe parallelism** | `--owns` leases per workspace; overlapping scopes are refused, out-of-scope edits are flagged |
|
|
28
|
-
| 🤖 **Machine-first output** | one stable `zcode.result/1` JSON line; clean, colour-free text when not on a TTY |
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/0xgeorgemathew/zcode/main/docs/assets/hero.svg" alt="A zcode work order: the contract on the left, the handback with changed files, a passing check and a COMPLETED stamp on the right" width="960">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@0xgeorgemathew/zcode"><img src="https://img.shields.io/npm/v/@0xgeorgemathew/zcode.svg?color=1C3F95&label=npm" alt="npm version"></a>
|
|
7
|
+
<img src="https://img.shields.io/badge/node-%E2%89%A520-1C3F95" alt="node 20 or later">
|
|
8
|
+
<img src="https://img.shields.io/badge/dependencies-0-1C3F95" alt="zero dependencies">
|
|
9
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-1C3F95" alt="MIT license"></a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
zcode is a command-line executor for orchestrator agents. Claude Code, Codex, or any agent with a shell hands it a task contract. zcode implements the task with GLM-5.3-Flash, runs your checks itself, and returns a handback that lists the changed files, the check results, and anything it could not verify.
|
|
13
|
+
|
|
14
|
+
The orchestrator keeps product decisions, design direction, and coordination. zcode works only inside the scope it is given.
|
|
15
|
+
|
|
16
|
+
<table>
|
|
17
|
+
<tr><td><b>Contract in</b></td><td>Objective, scope, constraints, binding design decisions, acceptance criteria, owned paths and checks. Only the objective is required.</td></tr>
|
|
18
|
+
<tr><td><b>Checks run by zcode</b></td><td>zcode runs each <code>--check</code> after the work. A failing check sends its output back to the model for up to 2 repair turns.</td></tr>
|
|
19
|
+
<tr><td><b>Status from evidence</b></td><td><code>completed</code> requires passing checks and no edits outside <code>--owns</code>. The model's own report is kept as a claim.</td></tr>
|
|
20
|
+
<tr><td><b>Sessions</b></td><td>Stable ids, <code>--detach</code>, <code>status</code>, <code>wait</code>, <code>resume</code>, <code>cancel</code>. A session whose process died shows as interrupted and can be resumed.</td></tr>
|
|
21
|
+
<tr><td><b>Parallel work</b></td><td>Two sessions with overlapping <code>--owns</code> in one repo are refused with exit 7.</td></tr>
|
|
22
|
+
<tr><td><b>Output</b></td><td>One <code>zcode.result/1</code> JSON line with <code>--json</code>. No colour codes when stdout is not a terminal.</td></tr>
|
|
23
|
+
</table>
|
|
29
24
|
|
|
30
25
|
|
|
31
26
|
|
|
@@ -33,35 +28,35 @@ Opus, Sonnet, GPT, or any agent with a shell delegates implementation to zcode.
|
|
|
33
28
|
|
|
34
29
|
```sh
|
|
35
30
|
npm install -g @0xgeorgemathew/zcode
|
|
36
|
-
echo "$ZAI_API_KEY" | zcode login #
|
|
37
|
-
zcode doctor #
|
|
31
|
+
echo "$ZAI_API_KEY" | zcode login # stores your Z.AI key with mode 600; zcode never prints it
|
|
32
|
+
zcode doctor # checks the engine, isolation and key
|
|
38
33
|
|
|
39
34
|
zcode task --check "npm test" "Fix the off-by-one in src/paginate.ts"
|
|
40
35
|
```
|
|
41
36
|
|
|
42
|
-
|
|
37
|
+
The CLI needs node 20 or later. The engine child runs best on node 26. zcode also needs the ZCode engine, which today ships inside the ZCode desktop app; zcode finds it automatically.
|
|
43
38
|
|
|
44
|
-
|
|
39
|
+
Installing the package also installs the Claude Code skill to `~/.claude/skills/zcode` and the Codex skill to `${CODEX_HOME:-~/.codex}/skills/zcode`. These skills teach the orchestrator how to delegate to zcode. Set `ZCODE_SKIP_SKILLS=1` to skip this step. Details are in [`skills/`](skills/README.md).
|
|
45
40
|
|
|
46
41
|
|
|
47
42
|
|
|
48
43
|
## Models and effort
|
|
49
44
|
|
|
50
|
-
Every command runs on
|
|
45
|
+
Every command runs on GLM-5.3-Flash at effort `max` unless you pass a flag.
|
|
51
46
|
|
|
52
|
-
| | flag | values | default |
|
|
47
|
+
| setting | flag | values | default |
|
|
53
48
|
|---|---|---|---|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
49
|
+
| model | `--model` | `glm-5.3-flash` (aliases `flash`, `5.3-flash`, `53f`), `glm-5.3` (aliases `5.3`, `53`) | `glm-5.3-flash` |
|
|
50
|
+
| effort | `--effort` | `low`, `medium`, `high`, `xhigh`, `max` | `max` |
|
|
56
51
|
|
|
57
52
|
```sh
|
|
58
|
-
zcode task "
|
|
59
|
-
zcode task --effort high "
|
|
60
|
-
zcode task --model glm-5.3 "
|
|
61
|
-
zcode task --model glm-5.3 --effort medium "
|
|
53
|
+
zcode task "..." # GLM-5.3-Flash, effort max
|
|
54
|
+
zcode task --effort high "..." # Flash with less reasoning
|
|
55
|
+
zcode task --model glm-5.3 "..." # GLM-5.3, effort max
|
|
56
|
+
zcode task --model glm-5.3 --effort medium "..." # GLM-5.3, effort medium
|
|
62
57
|
```
|
|
63
58
|
|
|
64
|
-
A task contract can
|
|
59
|
+
A task contract can set `"model"` and `"effort"`. Flags override the contract. A resumed session keeps its original model and effort unless you pass the flags again.
|
|
65
60
|
|
|
66
61
|
|
|
67
62
|
|
|
@@ -285,4 +280,6 @@ npm run accept:53
|
|
|
285
280
|
|
|
286
281
|
Live tests load the key from the repo `.env`, which is never committed or shipped. The design record and the wire-protocol facts pinned live are in `DESIGN.md` (§17 covers the 0.4 executor redesign) and `docs/BUILD-REPORT.md`.
|
|
287
282
|
|
|
288
|
-
|
|
283
|
+
## License
|
|
284
|
+
|
|
285
|
+
MIT. Source and issues: [github.com/0xgeorgemathew/zcode](https://github.com/0xgeorgemathew/zcode).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
// postinstall: copy the orchestrator skills into Claude Code and Codex.
|
|
4
|
+
//
|
|
5
|
+
// skills/claude-code/zcode -> ~/.claude/skills/zcode
|
|
6
|
+
// skills/codex/zcode -> ${CODEX_HOME:-~/.codex}/skills/zcode
|
|
7
|
+
//
|
|
8
|
+
// Only the zcode skill directory is replaced; nothing else is touched.
|
|
9
|
+
// Skipped inside the source checkout (a .git next to package.json) and when
|
|
10
|
+
// ZCODE_SKIP_SKILLS=1. Never fails the install: errors become one warning.
|
|
11
|
+
const fs = require('node:fs');
|
|
12
|
+
const os = require('node:os');
|
|
13
|
+
const path = require('node:path');
|
|
14
|
+
|
|
15
|
+
const pkgRoot = path.join(__dirname, '..');
|
|
16
|
+
|
|
17
|
+
function targets(env = process.env) {
|
|
18
|
+
const home = os.homedir();
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
name: 'Claude Code',
|
|
22
|
+
from: path.join(pkgRoot, 'skills', 'claude-code', 'zcode'),
|
|
23
|
+
to: path.join(home, '.claude', 'skills', 'zcode'),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Codex',
|
|
27
|
+
from: path.join(pkgRoot, 'skills', 'codex', 'zcode'),
|
|
28
|
+
to: path.join(env.CODEX_HOME || path.join(home, '.codex'), 'skills', 'zcode'),
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function installSkills(env = process.env) {
|
|
34
|
+
const done = [];
|
|
35
|
+
for (const t of targets(env)) {
|
|
36
|
+
if (!fs.existsSync(t.from)) continue;
|
|
37
|
+
fs.mkdirSync(path.dirname(t.to), { recursive: true });
|
|
38
|
+
fs.rmSync(t.to, { recursive: true, force: true });
|
|
39
|
+
fs.cpSync(t.from, t.to, { recursive: true });
|
|
40
|
+
done.push(t);
|
|
41
|
+
}
|
|
42
|
+
return done;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (require.main === module) {
|
|
46
|
+
if (process.env.ZCODE_SKIP_SKILLS === '1' || fs.existsSync(path.join(pkgRoot, '.git'))) process.exit(0);
|
|
47
|
+
try {
|
|
48
|
+
for (const t of installSkills()) console.log(`zcode: installed ${t.name} skill -> ${t.to}`);
|
|
49
|
+
} catch (err) {
|
|
50
|
+
console.warn(`zcode: could not install skills (${err.message}). Copy them from ${path.join(pkgRoot, 'skills')}.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = { installSkills, targets };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xgeorgemathew/zcode",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Lean GLM-5.3 execution engine for orchestrator agents: task contracts, independent sessions, zcode-run verification, structured handbacks, subagents, MCP, skills. Wraps the ZCode engine. Zero dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=20"
|
|
12
12
|
},
|
|
13
|
-
"dependencies": {
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@0xgeorgemathew/zcode": "^0.4.0"
|
|
15
|
+
},
|
|
14
16
|
"files": [
|
|
15
17
|
"bin",
|
|
16
18
|
"lib",
|
|
@@ -19,6 +21,7 @@
|
|
|
19
21
|
"LICENSE"
|
|
20
22
|
],
|
|
21
23
|
"scripts": {
|
|
24
|
+
"postinstall": "node lib/install-skills.js",
|
|
22
25
|
"test": "node --test --test-concurrency=1 \"test/unit/*.test.js\"",
|
|
23
26
|
"test:live": "node --test --test-concurrency=1 \"test/live/*.test.js\"",
|
|
24
27
|
"prepublishOnly": "npm test && npm run test:live",
|
|
@@ -41,5 +44,13 @@
|
|
|
41
44
|
"ndjson",
|
|
42
45
|
"orchestrator",
|
|
43
46
|
"executor"
|
|
44
|
-
]
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/0xgeorgemathew/zcode.git"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/0xgeorgemathew/zcode#readme",
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/0xgeorgemathew/zcode/issues"
|
|
55
|
+
}
|
|
45
56
|
}
|
package/skills/README.md
CHANGED
|
@@ -9,6 +9,8 @@ These skills teach an orchestrating agent how to delegate work to zcode, run ses
|
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
|
+
`npm install -g @0xgeorgemathew/zcode` installs both skills for you. Its postinstall step copies the Claude Code skill to `~/.claude/skills/zcode` and the Codex skill to `${CODEX_HOME:-~/.codex}/skills/zcode`, replacing any earlier copy of the zcode skill only. Set `ZCODE_SKIP_SKILLS=1` to skip it. If npm runs with `--ignore-scripts`, nothing is copied; use the manual steps below.
|
|
13
|
+
|
|
12
14
|
Run these from a checkout of this repo, or from the installed package (`$(npm root -g)/@0xgeorgemathew/zcode`), which ships `skills/`.
|
|
13
15
|
|
|
14
16
|
**Claude Code.** Personal skills, available in every project:
|