diff --git a/marketplace.json b/marketplace.json index efd72ba..4a74266 100644 --- a/marketplace.json +++ b/marketplace.json @@ -443,6 +443,30 @@ "ci-cd", "gitlab-api" ] + }, + { + "name": "zcoder", + "source": "./plugins/zcoder", + "description": "zCoder — always-on GLM multi-model orchestration for ZCode: routes every task to the right engine (vision / turbo / deep) with pinned thinking effort, plus skill-forge, a measured skill lifecycle with oracle-graded evals, Wilson-scored trials, Pareto acceptance, and 7-gate promotion.", + "description_i18n": { + "en": "zCoder — always-on GLM multi-model orchestration for ZCode: routes every task to the right engine (vision / turbo / deep) with pinned thinking effort, plus skill-forge, a measured skill lifecycle with oracle-graded evals, Wilson-scored trials, Pareto acceptance, and 7-gate promotion.", + "zh-CN": "zCoder —— ZCode 常驻 GLM 多模型编排器:把每个任务路由到合适的引擎(视觉 / 轻量 / 深度)并锁定思考力度;内置 skill-forge 可度量技能生命周期 —— 确定性预言机评分、Wilson 加权试验台账、Pareto 前沿验收与七道门晋升。" + }, + "version": "0.1.4", + "author": { + "name": "anthonykewl20", + "url": "https://github.com/anthonykewl20" + }, + "category": "developer-tools", + "keywords": [ + "glm", + "orchestration", + "multi-model", + "routing", + "subagents", + "skill-evaluation", + "agent-swarms" + ] } ] } diff --git a/plugins/zcoder/.zcode-plugin/plugin.json b/plugins/zcoder/.zcode-plugin/plugin.json new file mode 100644 index 0000000..9c943d8 --- /dev/null +++ b/plugins/zcoder/.zcode-plugin/plugin.json @@ -0,0 +1,19 @@ +{ + "name": "zcoder", + "version": "0.1.4", + "description": "zCoder — always-on GLM multi-model orchestration for ZCode: routes every task to the right engine (vision / turbo / deep) with pinned thinking effort, plus skill-forge, a measured skill lifecycle with oracle-graded evals, Wilson-scored trials, Pareto acceptance, and 7-gate promotion.", + "description_i18n": { + "en": "zCoder — always-on GLM multi-model orchestration for ZCode: routes every task to the right engine (vision / turbo / deep) with pinned thinking effort, plus skill-forge, a measured skill lifecycle with oracle-graded evals, Wilson-scored trials, Pareto acceptance, and 7-gate promotion.", + "zh-CN": "zCoder —— ZCode 常驻 GLM 多模型编排器:把每个任务路由到合适的引擎(视觉 / 轻量 / 深度)并锁定思考力度;内置 skill-forge 可度量技能生命周期 —— 确定性预言机评分、Wilson 加权试验台账、Pareto 前沿验收与七道门晋升。" + }, + "author": { + "name": "anthonykewl20", + "url": "https://github.com/anthonykewl20" + }, + "license": "MIT", + "homepage": "https://github.com/anthonykewl20/zCoder", + "agents": "agents", + "skills": "skills", + "commands": "commands", + "hooks": "hooks" +} diff --git a/plugins/zcoder/README.md b/plugins/zcoder/README.md new file mode 100644 index 0000000..e2e9327 --- /dev/null +++ b/plugins/zcoder/README.md @@ -0,0 +1,78 @@ +# zCoder (ZCode plugin) + +Always-on GLM multi-model orchestration for ZCode, plus **skill-forge** — a measured lifecycle for building and improving skills. Every task is decomposed and routed to the right engine automatically; every skill change is graded by deterministic oracles before it ships. + +## What it solves + +- **Routing waste**: ZCode's main thread and its subagents can run the same task at the same effort. zCoder pins each engine's model and thinking effort, then routes by ordered predicates: atomic requests are answered directly, visual sub-tasks go to the vision engine, mechanical batches go to the cheap lane, and deep sub-tasks get the max-effort engine only when parallelism or context isolation pays for it. +- **Unmeasured skills**: a skill that "seems better" after an edit is a vibe. skill-forge scores skills with deterministic Python oracles into a Wilson-scored, session-stamped trials ledger; improvements must be same-session PAIRED evidence on a Pareto frontier, and promotion passes 7 explicit gates. Idle automation never promotes — promotion requires interactive `--approved-by`. + +## Engines + +| Engine agent | Model | Effort | Routes | +|---|---|---|---| +| `glm-vision` | GLM-5.3-Flash | `max` | Images, OCR, screenshots/mockups, visual diffs, UI/UX inspection, diagrams | +| `glm-turbo` | GLM-5.3-Flash | `low` | **Conditional lane** — routed to only after a verified PASS in the current session; until then mechanical batches run on the main thread (never route real work to an unverified engine) | +| `glm-main` | GLM-5.3 | `max` | Architecture, multi-file logic, algorithms, deep debugging, security analysis, final correctness audits | + +**Degradation ladder:** if the vision engine fails, perception degrades to the main thread first (same model), then `glm-main`. An unverified engine is never trusted with real work — mechanical batches route to `glm-turbo` only after a verified PASS in the current session. + +**ZCode-only.** This plugin uses the `.zcode-plugin/plugin.json` manifest and ZCode hooks/agents/skills/commands exclusively. It intentionally ships no `.claude-plugin/` or `.codex-plugin/` compatibility manifest. + +## Components + +- `agents/` — the three engine agents. The `model:` and `thoughtLevel:` in each agent's frontmatter pin routing and effort; both are required. Omitting `thoughtLevel:` makes the harness inject compiled defaults that some backends reject (e.g. `high`/`low`), so the values are pinned, not implicit. `thoughtLevel:` edits apply live on the next dispatch; `model:` edits need a session restart. +- `skills/glm-orchestrator/` — the orchestration protocol: 4-step chain (decompose → routing plan → dispatch → synthesize + Principal Engineer audit), zero-waste rule, degradation rules, worked example. +- `skills/skill-forge/` + `commands/skill-scan.md` + `commands/skill-evolve.md` — the measured skill lifecycle. `/skill-scan` detects stack gaps zero-token (manifest-based, no LLM calls); `/skill-evolve` runs a staged evaluate→mutate→promote round (Pareto-targeted, mini-batch budget: a candidate that doesn't fix its target scenario dies before any full-matrix spend). Skills are scored by deterministic Python oracles into a Wilson-scored trials ledger (`tests/skill-evals//trials.jsonl` in the project where the skill is exercised); comparisons are same-session interleaved only; improvements are reflective mutations that must cite the failing trial (`MUTATION.md`); acceptance is Pareto-frontier expansion (`pareto.py` — per-scenario dominance, never scalar averages; also emits the next mutation target and the plateau stop-rule: 2 consecutive promotions without frontier entry ⇒ write a new scenario, not another body mutation). Promotion passes 7 gates — static caps, oracle self-test, strictly-better paired evidence, mutation citation, differs-from-incumbent, growth limit, trigger evidence (a changed `description:` needs a recorded router-probe run: effective ≥0.75, zero cross-skill regressions) — and requires interactive `--approved-by`. +- `skills/laravel-dev/`, `skills/yaml-json-convert/` — the first skills born from this lifecycle, each shipping its scenario/oracle eval suite under `tests/skill-evals/`. +- `commands/` — `/orchestrate ` (full pipeline with visible routing JSON) and `/route ` (plan-only preview, no execution). +- `hooks/` — **always-on routing, three events**: `SessionStart` anchors the routing directive at chat boot (covers new, resumed, cleared, and compacted sessions), `UserPromptSubmit` re-injects it on every prompt, and `PreToolUse` on the Agent tool runs a dispatch-contract check on every glm-engine dispatch (self-contained message, ≤300 words, no inlined file bodies — non-zCoder agents stay untouched). +- `tests/` — the plugin's own regression and integrity suites (portable, zero-token): `skill-forge-static.sh` (static integrity checks), `skill-forge-smoke.sh` (adversarial fixtures against every script CLI, all state in a mktemp sandbox), the OHI monitoring scripts, the capability ledger, and the pre-registered trigger-case table. + +## Install (ZCode) + +1. Open ZCode → **Settings → Plugin Management → **Discover** tab. +2. Find **zCoder** in the official marketplace and click **Get**. +3. Keep it enabled — the plugin hooks enable the hook runner automatically. + +Verify: the `/` menu shows `orchestrate` and `route` under zCoder, and **Settings → Subagents** lists `glm-vision`, `glm-turbo`, `glm-main`. + +## Usage + +- Always-on: with the plugin enabled, zCoder orchestration applies to every chat automatically — the hooks anchor routing at session start, re-inject it on each prompt, and check each engine dispatch against the contract. No invocation needed. +- Explicit: `/orchestrate implement this dashboard mockup and optimize the server fetch logic`. +- Preview only: `/route refactor auth across 3 services and fix the CSV parser` → table of sub-tasks, engines, and effort levels without executing. +- Skill lifecycle: `/skill-scan` to detect missing stack skills; `/skill-evolve ` to run one measured improvement round. + +## Model IDs + +Defaults are model codes from the Z.ai GLM catalog: `glm-5.3-flash` (vision/turbo), `glm-5.3` (deep). If your build lists different names in the model picker, edit the `model:` line in the matching `agents/*.md` and restart the session — nothing else needs to change. + +## Tuning + +- **Thinking effort** — pinned per agent via `thoughtLevel:` in `agents/*.md`. Effort rejections are deterministic and cost zero tokens: never retry them. Pins apply at session start; mid-session `thoughtLevel:` edits may serve stale cached values. +- **Vision model** — if your plan grants a dedicated vision model, change `model:` in `agents/glm-vision.md` and restart the session. +- **Disable the always-on routing injection** (keep the agents/commands): `touch ~/.zcode/zcoder.off`, or run ZCode with `GLM_ORCHESTRATOR_DISABLE=1`. Delete the file / unset the variable to re-enable. +- **Routing rules** — the matrix and dispatch rules live in `skills/glm-orchestrator/SKILL.md`; edit there to reweight precedence (e.g. make the turbo lane the default instead of the deep engine). + +## Dependencies, side effects, and security + +- **Network**: none. The plugin makes no outbound requests and bundles no MCP servers. Subagents dispatched by the orchestrator use ZCode's own model providers. +- **Model/API dependencies**: the engine agents reference GLM models by ID (`glm-5.3`, `glm-5.3-flash`) available through ZCode's built-in Z.ai provider. A plan without those exact model IDs needs the one-line `model:` edit described above. +- **Command execution**: the hooks run a local bash script (`hooks/inject-routing.sh`) on session start, every prompt, and Agent-tool dispatches. It only reads its stdin payload and prints a routing directive — no file writes, no network, and it exits immediately when either kill switch is active. +- **File writes**: running skill-forge rounds (`/skill-evolve`) and the OHI monitors writes trial ledgers, promotion records, and logs under `tests/skill-evals/` and `tests/` **in the project where you run them**. The plugin never writes outside the current project or `~/.zcode` (the optional `zcoder.off` flag file, which you create yourself). +- **No credentials, telemetry, or analytics** are collected or transmitted. + +## Health definition (learned the hard way) + +A green static suite only proves the **files agree with each other** — it is not system health. The turbo lane once sat at zero lifetime successful dispatches while every round reported green, because nothing measured ground-truth capability. Health is now a three-way conjunction, enforced statically: + +1. **Static suite green** (config coherence) — `tests/skill-forge-static.sh`, +2. **Capability ledger green** — `tests/capability-ledger.json`: every engine explicitly VERIFIED-fresh / CONDITIONAL-routed-around / REMOVED; no silent defaults, no zombie lanes; and +3. **No lifetime alarms** — `tests/ohi-stats.py` from the dispatch ledger: 0%-success and majority-fail engines report NEVER-WORKED / remove-or-investigate; consecutive-failure streaks flagged. + +Plus institutionalized humility: every FULL dogfood round runs one adversarial **blind-spot sweep** (an engine is asked what the system still cannot see), because blind spots are found by hunting, not by checklists. + +## License and provenance + +MIT. The reflective-mutation, size-cap, growth-cap, session-mining, Pareto-frontier, staged mini-batch, and trigger/description-evolution patterns are ported from [NousResearch/hermes-agent-self-evolution](https://github.com/NousResearch/hermes-agent-self-evolution) (MIT). Its AGPL Darwinian Evolver was deliberately not ported, and its DSPy/GEPA LLM-judge machinery was re-implemented as deterministic oracles (a judge's opinion is not a measurement). diff --git a/plugins/zcoder/README_CN.md b/plugins/zcoder/README_CN.md new file mode 100644 index 0000000..d8a0373 --- /dev/null +++ b/plugins/zcoder/README_CN.md @@ -0,0 +1,78 @@ +# zCoder(ZCode 插件) + +ZCode 的常驻 GLM 多模型编排器,并内置 **skill-forge** —— 一套可度量的技能构建与改进生命周期。每个任务都会被自动分解并路由到合适的引擎;每次技能变更在发布前都要经过确定性预言机评分。 + +## 解决什么问题 + +- **路由浪费**:ZCode 主线程与其子代理可能以相同力度运行同一任务。zCoder 为每个引擎锁定模型与思考力度,再按有序谓词路由:原子请求直接回答;视觉子任务交给视觉引擎;机械批量走廉价通道;深度子任务仅在并行或上下文隔离确实有收益时才使用最大力度引擎。 +- **无法度量的技能**:改完"感觉更好"的技能只是感觉。skill-forge 用确定性 Python 预言机把技能评分写入 Wilson 加权、按会话标记的试验台账;改进必须是同会话配对的 Pareto 前沿证据,晋升要过 7 道显式闸门。空闲的自动化永不晋升 —— 晋升需要交互式 `--approved-by`。 + +## 引擎 + +| 引擎代理 | 模型 | 力度 | 路由 | +|---|---|---|---| +| `glm-vision` | GLM-5.3-Flash | `max` | 图像、OCR、截图/设计稿、视觉比对、UI/UX 检查、图表 | +| `glm-turbo` | GLM-5.3-Flash | `low` | **条件通道** —— 仅当本会话内该引擎有已验证的 PASS 后才路由;在此之前机械批量在主线程执行(绝不把真实工作交给未验证的引擎) | +| `glm-main` | GLM-5.3 | `max` | 架构、跨文件逻辑、算法、深度调试、安全分析、最终正确性审计 | + +**降级阶梯**:若视觉引擎失败,感知先降级到主线程(同一模型),再降级到 `glm-main`。未经验证的引擎绝不承担真实工作 —— 机械批量仅在当前会话内 `glm-turbo` 获得已验证的 PASS 之后才路由给它。 + +**仅限 ZCode。** 本插件使用 `.zcode-plugin/plugin.json` 清单,仅包含 ZCode 的 hooks/agents/skills/commands,刻意不附带 `.claude-plugin/` 或 `.codex-plugin/` 兼容清单。 + +## 组件 + +- `agents/` —— 三个引擎代理。每个代理 frontmatter 中的 `model:` 与 `thoughtLevel:` 锁定路由与力度,两者都必填:省略 `thoughtLevel:` 会让框架注入编译期默认值,而某些后端会拒绝(如 `high`/`low`),因此这些值是显式锁定的。`thoughtLevel:` 的修改在下一次分发即时生效;`model:` 的修改需要重启会话。 +- `skills/glm-orchestrator/` —— 编排协议:4 步链(分解 → 路由计划 → 分发 → 综合 + 主工程师审计)、零浪费规则、降级规则、完整示例。 +- `skills/skill-forge/` + `commands/skill-scan.md` + `commands/skill-evolve.md` —— 可度量的技能生命周期。`/skill-scan` 零 token 检测技术栈缺口(基于清单,不调用 LLM);`/skill-evolve` 执行一轮 分阶段 评估→变异→晋升(Pareto 定向、小批量预算:修不好目标场景的候选在任何全矩阵开销之前就被淘汰)。技能由确定性 Python 预言机评分并写入 Wilson 加权试验台账(位于运行该技能项目下的 `tests/skill-evals//trials.jsonl`);只做同会话交错比较;改进是必须引用失败试验的反身性变异(`MUTATION.md`);验收标准是 Pareto 前沿扩张(`pareto.py` —— 按场景支配,绝不使用标量平均;同时输出下一个变异目标与平台期止损规则:连续 2 次晋升未进入前沿 ⇒ 写新场景,而不是继续改正文)。晋升通过 7 道闸门 —— 静态上限、预言机自检、严格更优的配对证据、变异引用、与现任不同、增长上限、触发证据(修改 `description:` 需要记录在案的路由探针运行:有效值 ≥0.75 且零跨技能回归)—— 并需要交互式 `--approved-by`。 +- `skills/laravel-dev/`、`skills/yaml-json-convert/` —— 该生命周期产出的前两个技能,各自在 `tests/skill-evals/` 下附带场景/预言机评测套件。 +- `commands/` —— `/orchestrate <任务>`(完整流水线,可见路由 JSON)与 `/route <任务>`(仅预览计划,不执行)。 +- `hooks/` —— **常驻路由,三个事件**:`SessionStart` 在会话启动时锚定路由指令(覆盖新建、恢复、清空与压缩会话);`UserPromptSubmit` 在每次输入时重新注入;`PreToolUse`(Agent 工具)对每次 glm 引擎分发执行分发契约检查(自包含消息、≤300 词、不内联文件正文 —— 非 zCoder 代理不受影响)。 +- `tests/` —— 插件自身的回归与完整性套件(可移植、零 token):`skill-forge-static.sh`(静态完整性检查)、`skill-forge-smoke.sh`(针对每个脚本 CLI 的对抗性夹具,全部状态在 mktemp 沙箱中)、OHI 监控脚本、能力台账,以及预注册的触发用例表。 + +## 安装(ZCode) + +1. 打开 ZCode → **Settings → Plugin Management → Discover** 标签页。 +2. 在官方市场中找到 **zCoder**,点击 **Get**。 +3. 保持启用 —— 插件 hooks 会自动启用 hook runner。 + +验证:`/` 菜单在 zCoder 下显示 `orchestrate` 与 `route`,且 **Settings → Subagents** 列出 `glm-vision`、`glm-turbo`、`glm-main`。 + +## 使用 + +- 常驻:插件启用后,zCoder 编排自动作用于每次会话 —— hooks 在会话启动时锚定路由、每次输入时重新注入、每次引擎分发时检查契约。无需手动调用。 +- 显式:`/orchestrate implement this dashboard mockup and optimize the server fetch logic`。 +- 仅预览:`/route refactor auth across 3 services and fix the CSV parser` → 输出子任务、引擎与力度表格,不执行。 +- 技能生命周期:`/skill-scan` 检测缺失的技术栈技能;`/skill-evolve ` 执行一轮可度量的改进。 + +## 模型 ID + +默认值是 Z.ai GLM 目录中的模型代码:`glm-5.3-flash`(视觉/轻量)、`glm-5.3`(深度)。如果你的构建在模型选择器中列出不同名称,修改对应 `agents/*.md` 中的 `model:` 行并重启会话即可 —— 无需其他改动。 + +## 调优 + +- **思考力度** —— 通过 `agents/*.md` 中的 `thoughtLevel:` 按代理锁定。力度被拒绝是确定性且零 token 成本的:绝不重试。锁定在会话启动时生效;会话中途修改 `thoughtLevel:` 可能命中过期缓存。 +- **视觉模型** —— 如果你的套餐提供了专用视觉模型,修改 `agents/glm-vision.md` 中的 `model:` 并重启会话。 +- **关闭常驻路由注入**(保留 agents/commands):`touch ~/.zcode/zcoder.off`,或以 `GLM_ORCHESTRATOR_DISABLE=1` 启动 ZCode。删除该文件 / 取消该变量即可重新启用。 +- **路由规则** —— 路由矩阵与分发规则位于 `skills/glm-orchestrator/SKILL.md`;在其中编辑即可调整优先级(例如让轻量通道替代深度引擎成为默认)。 + +## 依赖、副作用与安全 + +- **网络**:无。插件不发起任何出站请求,不捆绑 MCP 服务器。编排器分发的子代理使用 ZCode 自身的模型提供方。 +- **模型/API 依赖**:引擎代理按 ID 引用 GLM 模型(`glm-5.3`、`glm-5.3-flash`),经由 ZCode 内置的 Z.ai 提供方访问。若套餐没有这些精确的模型 ID,按上文所述修改一行 `model:` 即可。 +- **命令执行**:hooks 在会话启动、每次输入与 Agent 工具分发时运行本地 bash 脚本(`hooks/inject-routing.sh`)。它只读取 stdin 载荷并打印路由指令 —— 不写文件、不联网,且任一开关生效时立即退出。 +- **文件写入**:运行 skill-forge 轮次(`/skill-evolve`)与 OHI 监控会**在你运行它们的项目**下的 `tests/skill-evals/` 与 `tests/` 中写入试验台账、晋升记录与日志。插件绝不写入当前项目与 `~/.zcode`(可选的 `zcoder.off` 开关文件)之外的位置。 +- **不收集、不传输**任何凭据、遥测或分析数据。 + +## 健康定义(惨痛教训) + +绿色的静态套件只能证明**文件彼此一致** —— 那不是系统健康。轻量通道曾经在整个生命周期内零成功分发,而每一轮都报告绿色,因为没有任何东西测量真实能力。健康现在是三重合取,并由静态检查强制: + +1. **静态套件绿色**(配置一致)—— `tests/skill-forge-static.sh`; +2. **能力台账绿色** —— `tests/capability-ledger.json`:每个引擎显式为 VERIFIED-fresh / CONDITIONAL-routed-around / REMOVED;无静默默认、无僵尸通道;以及 +3. **无生命周期告警** —— `tests/ohi-stats.py` 基于分发台账:0% 成功与多数失败的引擎报告 NEVER-WORKED / 移除或调查;连续失败被标记。 + +加上制度化的谦逊:每个 FULL 轮次运行一次对抗性**盲区扫描**(让一个引擎回答系统还看不见什么),因为盲区是猎出来的,不是清单查出来的。 + +## 许可与来源 + +MIT。反身性变异、尺寸上限、增长上限、会话挖掘、Pareto 前沿、分阶段小批量与触发/描述演化模式移植自 [NousResearch/hermes-agent-self-evolution](https://github.com/NousResearch/hermes-agent-self-evolution)(MIT)。其 AGPL 达尔文进化器被刻意未移植,其 DSPy/GEPA LLM 评审机制被重新实现为确定性预言机(评审的意见不是测量)。 diff --git a/plugins/zcoder/agents/glm-main.md b/plugins/zcoder/agents/glm-main.md new file mode 100644 index 0000000..986ff87 --- /dev/null +++ b/plugins/zcoder/agents/glm-main.md @@ -0,0 +1,28 @@ +--- +name: glm-main +description: "GLM_MAIN engine — GLM-5.3 core at maximum thinking effort. Use for high-depth sub-tasks: architecture and system design, complex multi-file logic, algorithm design and optimization, hard debugging with unclear root cause, concurrency/performance analysis, security and edge-case vulnerability analysis, database/data-model design, final correctness audits of generated code. Dispatch when the sub-task runs in parallel with other engine work or needs isolated, bounded context — the orchestrator's main thread runs the same GLM-5.3 at max effort, so a solo deep sub-task is usually answered there directly. Do NOT dispatch mechanical or already-fully-specified trivial work (that is glm-turbo's job)." +model: glm-5.3 +thoughtLevel: max +color: blue +tools: [Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, TodoWrite] +--- + +You are GLM_MAIN, the deep-reasoning engine of a GLM model cluster (GLM-5.3 core, maximum thinking effort). A lead orchestrator decomposes work and dispatches you the hard atomic sub-tasks. You return engineering-grade results that the orchestrator can synthesize without rework. + +## Operating rules + +1. **Reason before you touch.** State the approach in 2–4 dense lines, then execute. For design tasks, decide and commit — present the chosen design with its decisive tradeoffs, not a survey of options. +2. **Exhaust edge cases by construction.** Enumerate failure modes relevant to the dispatched sub-task (boundaries, concurrency, partial failure, empty/huge inputs, encoding, auth boundaries) and show how the design or code neutralizes each. An unaudited edge is an unfinished task. +3. **Respect the existing system.** Read the surrounding code before changing it; match its idioms, naming, and structure. Changes must integrate — never float a parallel style. +4. **Precision over volume.** Every line you emit must be load-bearing. No restating the prompt, no filler prose, no unrequested alternatives. If you rejected an approach for a non-obvious reason, one line on why is enough. Treat context as bounded: never re-read what this dispatch already read, and compress interim findings to ≤5 lines before moving to the next phase. +5. **Own correctness.** If you find a defect in your own approach mid-execution, stop and fix the approach — do not ship a known-wrong result. Surface any risk you could not eliminate in RISKS. + +## Output contract + +``` +GLM_MAIN RESULT +- decision/design: +- implementation/analysis: +- edge cases covered: +RISKS: +``` diff --git a/plugins/zcoder/agents/glm-turbo.md b/plugins/zcoder/agents/glm-turbo.md new file mode 100644 index 0000000..9bf82b5 --- /dev/null +++ b/plugins/zcoder/agents/glm-turbo.md @@ -0,0 +1,26 @@ +--- +name: glm-turbo +description: "GLM_TURBO engine — the cheap mechanical lane (GLM-5.3-Flash at low thinking effort; the GLM-5-Turbo model is retired: undispatchable in this harness — every thoughtLevel value including `none` is rejected by the backend, verified through 2026-09-04). Use for low-latency, low-depth work: code formatting, boilerplate/draft generation, light refactoring of already-identified files, JSON/YAML parsing or transformation, regex drafting, bulk text transformation, mechanical renames, docstring/comment writing — batch several independent such items into ONE dispatch to amortize overhead. The dispatch message must already contain everything needed — this engine does not explore. Do NOT dispatch for architecture, coordinated multi-file design, algorithm design, debugging of unclear causes, one-line rewrites answerable inline, or anything requiring deep reasoning (that is glm-main's job)." +model: glm-5.3-flash +thoughtLevel: low +color: green +tools: [Read, Write, Edit, Bash, Glob, Grep] +--- + +You are GLM_TURBO, the low-effort mechanical execution engine of a GLM model cluster (GLM-5.3-Flash at low thinking effort). You are dispatched for mechanical, well-specified work. Speed and precision are your only virtues. + +## Operating rules + +1. **First pass is the final pass.** Think minimally, act immediately. No exploration sweeps, no re-planning, no questions back to the orchestrator — if the dispatch is genuinely unexecutable as written, return `UNEXECUTABLE: ` and stop. +2. **Validate before transforming.** When parsing or rewriting structured data (JSON/YAML/CSV), verify well-formedness first; on malformed input, report the exact failure point instead of guessing intent. +3. **Edge-case guard, one line of thought.** Check the two obvious traps for the operation at hand (empty input, boundary index, encoding/escaping, idempotency) and handle them silently in the output. Nothing more. +4. **Touch only what was dispatched.** No drive-by edits, no restyling of unrelated code, no added dependencies. +5. **Zero commentary.** No preamble ("Sure!"), no summaries of what you did unless asked, no low-signal remarks. Return the artifact. + +## Output contract + +``` +RESULT + +NOTES: +``` diff --git a/plugins/zcoder/agents/glm-vision.md b/plugins/zcoder/agents/glm-vision.md new file mode 100644 index 0000000..db5ecc1 --- /dev/null +++ b/plugins/zcoder/agents/glm-vision.md @@ -0,0 +1,29 @@ +--- +name: glm-vision +description: "GLM_VISION engine — GLM-5.3-Flash (multimodal; this plan has no GLM-5V-Turbo access). Use EXCLUSIVELY when a sub-task requires visual input or visual spatial reasoning: image analysis, OCR/text extraction, screenshot or mockup inspection, visual diffs, UI/UX layout extraction, diagrams, charts, video frames. Dispatch with the image/screenshot file path(s) in the message plus exactly what must be extracted or judged. Returns structured visual findings, never prose fluff. For a single quick visual lookup with no other engine work in flight, the orchestrator answers on its main thread instead (same model) — dispatch glm-vision when grounding rigor, session isolation, or parallelism with other engines matters. Do NOT dispatch for text-only tasks." +model: glm-5.3-flash +thoughtLevel: max +color: cyan +tools: [Read, Glob, Grep, Bash] +--- + +You are GLM_VISION, the multimodal perception engine of a GLM model cluster (GLM-5.3-Flash). You receive dispatches from a lead orchestrator and return perception results — not implementations, not opinions, not filler. + +## Operating rules + +1. **Read the visual assets first.** Use Read on every image path in the dispatch before drawing any conclusion. If a path is missing or unreadable, report exactly that — never invent what an image might contain. +2. **Ground every claim in the asset.** Describe positions as regions ("top-left card, ~20% from left edge"), quote extracted text verbatim, and give concrete values for dimensions/colors you report. If a value is genuinely ambiguous, say `uncertain:` and state what you see — a wrong confident answer is a protocol violation. For partially corrupted text, prefer reconstruction from internal consistency (e.g., percentage shares that must sum to 100%, known label vocabularies) over transcribing fragments — and flag the reconstruction with `(R)`. Never flag `(R)` on text that is fully legible; flag only the specific items you reconstructed. **Hard limits: reconstruction must never invent entities absent from the asset — no extra rows, values, characters, or formatting; if a consistency check conflicts with what you see, report `uncertain:` instead of inventing data to satisfy it. When a consistency check uniquely determines the missing characters (e.g., two of three shares are legible and shares must sum to 100), DO reconstruct and flag `(R)` — `uncertain:` is only for when no bounded check can resolve the gap. Cap iterative re-reads of the asset at 3 — after that, commit to your best reading with uncertainties flagged.** +3. **Answer the dispatched extraction only.** The orchestrator decomposed the task and sent you one perception job. Do not implement code, do not design systems, do not speculate about requirements beyond the visual evidence. +4. **Enumerate exhaustively.** For layout/UI extraction: list every component with its hierarchy, approximate geometry, text content, and color/style markers (e.g. Tailwind-ready color estimates). For OCR: preserve reading order. For diffs: list every visible change. +5. **No low-signal commentary.** Output structure, not narrative. + +## Output contract + +``` +VISUAL FINDINGS +- assets_read: +- extraction: + +- anomalies/uncertainties: + +``` diff --git a/plugins/zcoder/commands/orchestrate.md b/plugins/zcoder/commands/orchestrate.md new file mode 100644 index 0000000..b2d0638 --- /dev/null +++ b/plugins/zcoder/commands/orchestrate.md @@ -0,0 +1,10 @@ +--- +description: Run the full GLM orchestration pipeline (decompose → route → dispatch engines → synthesize) on a task. +argument-hint: "[task to orchestrate]" +--- + +Execute the GLM multi-model orchestration protocol (glm-orchestrator skill) for this task: + +$ARGUMENTS + +Follow the full chain and show the ORCHESTRATION BLOCK: (0) lazy preflight — the first dispatch of an engine doubles as its probe; classify config-class failures (zero tokens, instant, never retried); batch-probe untested engines in parallel only before a large multi-engine fan-out, (1) decompose the task into atomic sub-tasks, (2) emit the routing plan JSON mapping each sub-task to GLM_VISION / GLM_TURBO / GLM_MAIN (only per the skill's STEP 2 emission conditions), (3) dispatch each sub-task to the matching engine agent with a self-contained message, (4) synthesize engine outputs into the final solution and run the Principal Engineer audit before presenting, reporting any engine substitutions. Do not skip the supervision checklist or substitution reporting even when only one engine dispatched. diff --git a/plugins/zcoder/commands/route.md b/plugins/zcoder/commands/route.md new file mode 100644 index 0000000..4188513 --- /dev/null +++ b/plugins/zcoder/commands/route.md @@ -0,0 +1,12 @@ +--- +description: Show the routing plan for a task — which GLM engine and thinking effort each sub-task would get — without executing it. +argument-hint: "[task to analyze]" +--- + +Routing analysis only — do NOT execute, edit files, or dispatch any engine agent. + +Apply STEP 1 and STEP 2 of the glm-orchestrator protocol to this task: + +$ARGUMENTS + +Decompose it into atomic sub-tasks and output, as a compact table plus the orchestration_plan JSON: each sub-task, its target engine (GLM_VISION / GLM_TURBO / GLM_MAIN), the model and thinking effort the engine would run with, and a one-line routing rationale. Apply the routing decision tree in order — first match wins — and mark any GLM_TURBO step `main-thread until a verified PASS this session` while the slot is unverified. Flag any sub-task you would answer directly on the main thread per the zero-waste rule. Then stop. diff --git a/plugins/zcoder/commands/skill-evolve.md b/plugins/zcoder/commands/skill-evolve.md new file mode 100644 index 0000000..385e7c3 --- /dev/null +++ b/plugins/zcoder/commands/skill-evolve.md @@ -0,0 +1,17 @@ +--- +description: Run a skill-forge improvement round — Pareto-targeted, staged eval, trigger-aware, gated promotion (GEPA-style). +argument-hint: "[skill-name]" +--- + +Run one skill-forge improvement round on $ARGUMENTS (default: the weakest skill by `stats.py --rank`). The round is staged (Hermes/GEPA port): spend small first, expand only on evidence, stop on plateau. + +0. **SELECT** (zero tokens): + `python3 skills/skill-forge/scripts/pareto.py tests/skill-evals//trials.jsonl --plateau tests/skill-evals//promotions.jsonl` + - The `NEXT MUTATION TARGET` line names the variant+scenario to mutate against. + - **If the plateau check says PLATEAU: do NOT write another body mutation.** The frontier is stalled — add one NEW scenario instead (mined from sessions or weak-spots.md), build its oracle, and re-baseline. A stalled frontier on a 1-scenario suite means overfit, not solved. +1. **SELFTEST**: `python3 skills/skill-forge/scripts/oracle_selftest.py tests/skill-evals/` — GREEN before any dispatch. +2. **STAGE A — budget probe** (mini-batch, hermes GEPA port): write ONE reflective-mutation candidate targeting the selected scenario (MUTATION.md must cite its failing trial id). Dispatch byte-identical incumbent+candidate pairs on **that scenario only** (2 runs each, interleaved, fresh subjects, same session label) and record with `grade.py --record`. + - Candidate does not fix the target scenario → **STOP. Candidate dies.** No Stage-B spend. +3. **STAGE B — full matrix**: only on a Stage-A fix, dispatch the remaining scenarios (2 runs, interleaved). Then `stats.py` and `pareto.py --frontier`: the candidate must now ENTER the frontier. A candidate that fixes its target but enters no frontier wins nothing. +4. **Description-only mutations are trigger-surface evolution** — task oracles cannot measure them. Instead: `trigger_eval.py --check` (cases must validate and be FROZEN before dispatch) → dispatch ONE fresh metadata-only router subject: give it ONLY every skill's `name:`+`description:` frontmatter (verbatim, no bodies), then the numbered utterances from trigger-cases.jsonl verbatim; it answers exactly `N: ` per line. Score with `trigger_eval.py --score --cases tests/skill-evals/trigger-cases.jsonl --run-id