From 27cf22753ebd41fc97781d7798136ecb9900197e Mon Sep 17 00:00:00 2001 From: nettee Date: Wed, 25 Nov 2026 22:43:28 +0800 Subject: [PATCH 1/5] feat(skill): add cli-code-workers for Codex and Antigravity CLI workers Document how to start tasks, pick model/effort, capture results, and enable YOLO via native `codex exec` and `agy -p`, with Sol Medium and Neon High defaults. Co-authored-by: Cursor --- skills/cli-code-workers/SKILL.md | 217 +++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 skills/cli-code-workers/SKILL.md diff --git a/skills/cli-code-workers/SKILL.md b/skills/cli-code-workers/SKILL.md new file mode 100644 index 0000000..2848e47 --- /dev/null +++ b/skills/cli-code-workers/SKILL.md @@ -0,0 +1,217 @@ +--- +name: cli-code-workers +description: >- + Run Codex CLI (`codex exec`) and Antigravity CLI (`agy -p`) as unattended + workers: start a task, pick model and reasoning effort, capture results, and + enable YOLO / no-prompt modes. Use when delegating work via native vendor CLIs, + scripting agent workers, or when the user mentions codex exec, agy print/headless, + CLI workers, or YOLO for Codex/AntiGravity. +disable-model-invocation: true +--- + +# CLI Code Workers(Codex + AntiGravity) + +用官方 CLI 当 worker:开任务 → 选模型 → 选推理强度 → 拿结果 → 可选 YOLO。 +不要走 Sidecar / 第三方 client。 + +先确认:`codex --version`、`agy --version`(已核对:Codex 0.167+、agy 1.5+)。在目标项目目录下执行;管道解析用 `set -o pipefail` + `jq`。 + +## 默认模型 & 推理强度 + +未另行指定时,worker 使用: + +| Worker | 默认 | CLI | +| --- | --- | --- | +| Codex | **GPT × Sol Medium** | `-m gpt-6.2-sol` + `-c 'model_reasoning_effort="medium"'` | +| AntiGravity | **Gemini × Neon High** | `--model gemini-4-neon-high`(slug 已含 High;勿再叠冲突的 `--effort`) | + +Sol 系列以本机 `codex debug models` 里最新的 `gpt-*-sol` 为准(当前:`gpt-6.2-sol`)。Neon High 以 `agy models` 里的 `gemini-*-neon-high` 为准(当前:`gemini-4-neon-high`)。 + +## 速查 + +| 动作 | Codex | AntiGravity (`agy`) | +| --- | --- | --- | +| 开任务 | `codex exec '…'`(别名 `codex e`) | `agy -p '…'`(=`--print`/`--prompt`) | +| 选模型 | `-m`;目录:`codex debug models`;默认 Sol | `--model`;目录:`agy models`;默认 Neon High | +| 推理强度 | `-c 'model_reasoning_effort="…"'`;默认 `medium` | 默认用 `…-neon-high` slug;或家族 slug + `--effort` | +| 看结果 | stdout / `-o` / `--json` → resume `thread_id` | stdout / `--output-format json\|stream-json` → resume `conversation_id` | +| YOLO | `--yolo` | `--dangerously-skip-permissions`(无 `--yolo`) | + +--- + +## Codex worker + +### 1. 开启任务 + +```bash +# 只用参数里的 prompt 时,关掉 stdin,避免管道内容被追加进上下文 +codex exec -C "$WORKDIR" '任务说明' /tmp/codex-models.json +jq -r '.models[] | [.slug, .default_reasoning_level, ([.supported_reasoning_levels[].effort] | join(","))] | @tsv' \ + /tmp/codex-models.json +``` + +常见:`low` | `medium` | `high` | `xhigh` | `max` | `ultra`(随模型变化)。本 skill 默认覆盖为 `medium`(目录里 Sol 原始默认可能是 `low`)。 + +### 4. 查看结果 + +| 方式 | 用法 | +| --- | --- | +| 默认 | 终稿 → **stdout**;进度 → **stderr** | +| 终稿文件 | `-o` / `--output-last-message FILE` | +| 事件 JSONL | `--json`(与 `-o` 可并用) | +| 结构化终稿 | `--output-schema schema.json` | + +```bash +codex exec --json -o "$RUN/last.txt" '…' "$RUN/events.jsonl" 2>"$RUN/stderr.log" +thread_id=$(jq -er 'select(.type=="thread.started") | .thread_id' "$RUN/events.jsonl") +``` + +成功:exit 0,且 JSONL 有 `turn.completed`;同时看有无 `turn.failed`/`error`,并核对产物。完成的 turn 仍可能报告命令失败。 + +### 5. YOLO / 不卡审批 + +`exec` 默认 sandbox 是 **`read-only`**。 + +| 模式 | 命令 | 说明 | +| --- | --- | --- | +| 推荐无人值守 | `--sandbox workspace-write -c 'approval_policy="never"'` | 不弹审批;越权变错误回给模型 | +| 全局 never | `codex -a never exec …`(`-a` 在 `exec` **之前**) | 同上思路 | +| 自动审 | `--approve-for-me`(=`--not-so-yolo`) | 固定 workspace-write;**不能**与 `--sandbox`/`--yolo` 同用 | +| 真 YOLO | `--yolo`(=`--dangerously-bypass-approvals-and-sandbox`) | 无沙箱无审批;仅外部已隔离环境 | + +本机构建拒绝 `--full-auto`。 + +**编辑型模板:** + +```bash +codex exec -C "$WORKDIR" \ + -m gpt-6.2-sol \ + -c 'model_reasoning_effort="medium"' \ + --sandbox workspace-write \ + -c 'approval_policy="never"' \ + --json -o "$RUN/last.txt" - \ + <"$RUN/prompt.md" >"$RUN/events.jsonl" 2>"$RUN/stderr.log" +``` + +--- + +## AntiGravity worker(`agy`) + +### 1. 开启任务 + +```bash +agy -p '任务说明' +agy --print-timeout 10m --print '任务说明' # 0s = 等到完成 +``` + +续跑:`agy --conversation "$conversation_id" -p '后续'`(`-r`/`--resume` 同义)。 +并发不要用 `--continue`/`-c`。无凭证且无 TTY → `authentication required`。 + +### 2. 选模型 + +```bash +agy models +agy --model gemini-4-neon-high -p '…' # 默认:Gemini × Neon High +``` + +未知模型:非零退出,JSON 里 `ERROR`。 + +### 3. 选推理强度 + +默认用 **Neon High** slug(档位已钉在模型名里): + +```bash +agy -p '/effort' --output-format json # 只读:当前/可用档位 +agy --model gemini-4-neon-high -p '…' # 推荐默认 +# 等价写法(家族 slug + effort): +agy --model gemini-4-neon --effort high -p '…' +``` + +`--effort`:`low` | `medium` | `high` | `xhigh` | `max`。 + +**冲突:** 带档位的 slug(如 `…-neon-high`)再叠不同 `--effort` 会 `ERROR`。二选一:家族 slug + `--effort`,或单一 variant slug。 + +### 4. 查看结果 + +| 格式 | stdout | +| --- | --- | +| `text`(默认) | 纯文本终稿 | +| `json` | 单对象:`status` / `response` / `conversation_id` / `usage` | +| `stream-json` | NDJSON;终稿在 `event=="result"` 的 `.result` | + +`--json-schema` → 读 `structured_output`。 + +```bash +agy -p '…' --output-format json >"$RUN/result.json" 2>"$RUN/stderr.log" +jq -er 'select(.status=="SUCCESS") | .response' "$RUN/result.json" +conversation_id=$(jq -er '.conversation_id' "$RUN/result.json") +``` + +**成功判定:** 不要只看 exit 0。要 `status=="SUCCESS"`,并核对产物。需要审批却批不了的工具会 **soft-deny 仍可能 exit 0**(看 stderr)。 + +### 5. YOLO / 不卡审批 + +无 `--yolo` 别名。 + +| 模式 | 用法 | +| --- | --- | +| 白名单(单次) | `--settings '{"permissions":{"allow":["command(git status)"]}}'` | +| 自动(可用时) | `--mode auto`(1.5.7+ headless 常默认;无 sandbox/部分账号会退回) | +| 只自动改文件 | `--mode accept-edits` | +| 真 YOLO | `--dangerously-skip-permissions` | + +`--sandbox` 是独立开关(默认关);与 `auto` 的终端沙箱相关但别混为一谈。 + +**编辑型模板:** + +```bash +agy -p "$(cat "$RUN/prompt.md")" \ + --model gemini-4-neon-high \ + --mode auto \ + --sandbox \ + --output-format json \ + --print-timeout 10m \ + >"$RUN/result.json" 2>"$RUN/stderr.log" +# 需要工具全放行时再加:--dangerously-skip-permissions +``` + +--- + +## Gotchas + +- **并行任务**只用显式 `thread_id` / `conversation_id`,别用「最近一次」快捷方式。 +- **Codex**:参数 prompt 时记得 ` Date: Wed, 25 Nov 2026 14:43:54 +0000 Subject: [PATCH 2/5] ci: auto bump patch version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 377c31f..b80bab8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zest-dev", - "version": "1.0.17", + "version": "1.0.18", "description": "A lightweight, human-interactive development workflow for AI-assisted coding", "author": { "name": "nettee", From b8574b8cd028a669b52962c11d84f5b0205a565f Mon Sep 17 00:00:00 2001 From: nettee Date: Wed, 25 Nov 2026 22:47:41 +0800 Subject: [PATCH 3/5] test(init): cover cli-code-workers deployment Generated-By: looper 0.16.1 (runner=fixer, agent=codex) --- e2e/tests/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e/tests/conftest.py b/e2e/tests/conftest.py index 7a0989b..4e4d556 100644 --- a/e2e/tests/conftest.py +++ b/e2e/tests/conftest.py @@ -12,6 +12,7 @@ EXPECTED_SKILLS = [ + "cli-code-workers", "t3-task", "zest-dev", ] From 192fbbda113507be72a29f1ab21c15048ab4760f Mon Sep 17 00:00:00 2001 From: nettee Date: Wed, 25 Nov 2026 22:47:32 +0800 Subject: [PATCH 4/5] docs(skill): rewrite cli-code-workers in English without pinned versions Keep Sol Medium / Neon High as defaults resolved from live catalogs instead of hard-coded generation slugs or CLI version notes. Co-authored-by: Cursor --- skills/cli-code-workers/SKILL.md | 214 ++++++++++++++++++------------- 1 file changed, 123 insertions(+), 91 deletions(-) diff --git a/skills/cli-code-workers/SKILL.md b/skills/cli-code-workers/SKILL.md index 2848e47..926d024 100644 --- a/skills/cli-code-workers/SKILL.md +++ b/skills/cli-code-workers/SKILL.md @@ -9,83 +9,102 @@ description: >- disable-model-invocation: true --- -# CLI Code Workers(Codex + AntiGravity) +# CLI Code Workers (Codex + AntiGravity) -用官方 CLI 当 worker:开任务 → 选模型 → 选推理强度 → 拿结果 → 可选 YOLO。 -不要走 Sidecar / 第三方 client。 +Use the official vendor CLIs as workers: start a task → choose model → choose +reasoning effort → capture results → optionally enable YOLO. +Do not use Sidecar or third-party clients. -先确认:`codex --version`、`agy --version`(已核对:Codex 0.167+、agy 1.5+)。在目标项目目录下执行;管道解析用 `set -o pipefail` + `jq`。 +Confirm `codex` and `agy` are on `PATH`. Run from the target project directory. +Use `set -o pipefail` and `jq` when parsing structured output. -## 默认模型 & 推理强度 +## Default model and reasoning effort -未另行指定时,worker 使用: +Unless the user overrides them, resolve defaults from the live catalogs (do not +hard-code a generation number in prompts or scripts): -| Worker | 默认 | CLI | +| Worker | Default | How to resolve | | --- | --- | --- | -| Codex | **GPT × Sol Medium** | `-m gpt-6.2-sol` + `-c 'model_reasoning_effort="medium"'` | -| AntiGravity | **Gemini × Neon High** | `--model gemini-4-neon-high`(slug 已含 High;勿再叠冲突的 `--effort`) | +| Codex | **GPT × Sol Medium** | Latest Sol slug from `codex debug models`, plus `model_reasoning_effort="medium"` | +| AntiGravity | **Gemini × Neon High** | Matching Neon High slug from `agy models` (effort embedded in the slug; do not also pass a conflicting `--effort`) | -Sol 系列以本机 `codex debug models` 里最新的 `gpt-*-sol` 为准(当前:`gpt-6.2-sol`)。Neon High 以 `agy models` 里的 `gemini-*-neon-high` 为准(当前:`gemini-4-neon-high`)。 +```bash +# Codex: pick the Sol slug available on this machine, then pin Medium effort +SOL_MODEL=$(codex debug models | jq -r ' + [.models[].slug | select(test("sol$"))] | last +') + +# Antigravity: pick a Neon High slug available on this machine +NEON_HIGH_MODEL=$(agy models | awk '/neon-high/ {print $1; exit}') +``` -## 速查 +If either lookup fails, inspect the catalog output and choose the closest Sol / +Neon High entry the CLI lists. -| 动作 | Codex | AntiGravity (`agy`) | +## Cheat sheet + +| Action | Codex | AntiGravity (`agy`) | | --- | --- | --- | -| 开任务 | `codex exec '…'`(别名 `codex e`) | `agy -p '…'`(=`--print`/`--prompt`) | -| 选模型 | `-m`;目录:`codex debug models`;默认 Sol | `--model`;目录:`agy models`;默认 Neon High | -| 推理强度 | `-c 'model_reasoning_effort="…"'`;默认 `medium` | 默认用 `…-neon-high` slug;或家族 slug + `--effort` | -| 看结果 | stdout / `-o` / `--json` → resume `thread_id` | stdout / `--output-format json\|stream-json` → resume `conversation_id` | -| YOLO | `--yolo` | `--dangerously-skip-permissions`(无 `--yolo`) | +| Start task | `codex exec '…'` (alias `codex e`) | `agy -p '…'` (`--print` / `--prompt`) | +| Choose model | `-m` / `--model`; catalog: `codex debug models` | `--model`; catalog: `agy models` | +| Reasoning effort | `-c 'model_reasoning_effort="…"'` (default `medium`) | Prefer `…-neon-high` slug; or family slug + `--effort` | +| Capture / resume | stdout / `-o` / `--json` → `thread_id` | stdout / `--output-format json\|stream-json` → `conversation_id` | +| YOLO | `--yolo` | `--dangerously-skip-permissions` (no `--yolo`) | --- ## Codex worker -### 1. 开启任务 +### 1. Start a task ```bash -# 只用参数里的 prompt 时,关掉 stdin,避免管道内容被追加进上下文 -codex exec -C "$WORKDIR" '任务说明' /tmp/codex-models.json -jq -r '.models[] | [.slug, .default_reasoning_level, ([.supported_reasoning_levels[].effort] | join(","))] | @tsv' \ +jq -r '.models[] | [.slug, .default_reasoning_level, + ([.supported_reasoning_levels[].effort] | join(","))] | @tsv' \ /tmp/codex-models.json ``` -常见:`low` | `medium` | `high` | `xhigh` | `max` | `ultra`(随模型变化)。本 skill 默认覆盖为 `medium`(目录里 Sol 原始默认可能是 `low`)。 +Common values: `low` | `medium` | `high` | `xhigh` | `max` | `ultra` +(availability depends on the model). This skill defaults to **`medium`** for Sol +even when the catalog default differs. -### 4. 查看结果 +### 4. Capture results -| 方式 | 用法 | +| Mode | Behavior | | --- | --- | -| 默认 | 终稿 → **stdout**;进度 → **stderr** | -| 终稿文件 | `-o` / `--output-last-message FILE` | -| 事件 JSONL | `--json`(与 `-o` 可并用) | -| 结构化终稿 | `--output-schema schema.json` | +| Default | Final answer → **stdout**; progress → **stderr** | +| Final message file | `-o` / `--output-last-message FILE` | +| Event JSONL | `--json` (works with `-o`) | +| Structured final | `--output-schema schema.json` | ```bash codex exec --json -o "$RUN/last.txt" '…' "$RUN/result.json" 2>"$RUN/stderr.log" @@ -174,44 +199,51 @@ jq -er 'select(.status=="SUCCESS") | .response' "$RUN/result.json" conversation_id=$(jq -er '.conversation_id' "$RUN/result.json") ``` -**成功判定:** 不要只看 exit 0。要 `status=="SUCCESS"`,并核对产物。需要审批却批不了的工具会 **soft-deny 仍可能 exit 0**(看 stderr)。 +**Success check:** do not trust exit 0 alone. Require `status == "SUCCESS"` and +verify artifacts. Tools that need approval they cannot get may be **soft-denied +while still exiting 0** (see stderr). -### 5. YOLO / 不卡审批 +### 5. YOLO / no-prompt modes -无 `--yolo` 别名。 +There is no `--yolo` alias. -| 模式 | 用法 | +| Mode | Flags | | --- | --- | -| 白名单(单次) | `--settings '{"permissions":{"allow":["command(git status)"]}}'` | -| 自动(可用时) | `--mode auto`(1.5.7+ headless 常默认;无 sandbox/部分账号会退回) | -| 只自动改文件 | `--mode accept-edits` | -| 真 YOLO | `--dangerously-skip-permissions` | +| Allow-list (one run) | `--settings '{"permissions":{"allow":["command(git status)"]}}'` | +| Auto where available | `--mode auto` (headless often defaults here when supported) | +| Auto-approve edits only | `--mode accept-edits` | +| Full YOLO | `--dangerously-skip-permissions` | -`--sandbox` 是独立开关(默认关);与 `auto` 的终端沙箱相关但别混为一谈。 +`--sandbox` is a separate flag (off by default). Do not confuse it with `auto` +mode's terminal sandboxing. -**编辑型模板:** +**Editing-worker template:** ```bash agy -p "$(cat "$RUN/prompt.md")" \ - --model gemini-4-neon-high \ + --model "$NEON_HIGH_MODEL" \ --mode auto \ --sandbox \ --output-format json \ --print-timeout 10m \ >"$RUN/result.json" 2>"$RUN/stderr.log" -# 需要工具全放行时再加:--dangerously-skip-permissions +# Add --dangerously-skip-permissions when every tool must auto-approve ``` --- ## Gotchas -- **并行任务**只用显式 `thread_id` / `conversation_id`,别用「最近一次」快捷方式。 -- **Codex**:参数 prompt 时记得 ` Date: Wed, 25 Nov 2026 22:48:23 +0800 Subject: [PATCH 5/5] docs(skill): keep illustrative model slugs only inside command samples Prose defaults stay catalog-resolved Sol Medium / Neon High; command examples show slug shape for -m/--model. Co-authored-by: Cursor --- skills/cli-code-workers/SKILL.md | 38 ++++++++++++-------------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/skills/cli-code-workers/SKILL.md b/skills/cli-code-workers/SKILL.md index 926d024..86de2e4 100644 --- a/skills/cli-code-workers/SKILL.md +++ b/skills/cli-code-workers/SKILL.md @@ -20,26 +20,16 @@ Use `set -o pipefail` and `jq` when parsing structured output. ## Default model and reasoning effort -Unless the user overrides them, resolve defaults from the live catalogs (do not -hard-code a generation number in prompts or scripts): +Unless the user overrides them: | Worker | Default | How to resolve | | --- | --- | --- | -| Codex | **GPT × Sol Medium** | Latest Sol slug from `codex debug models`, plus `model_reasoning_effort="medium"` | -| AntiGravity | **Gemini × Neon High** | Matching Neon High slug from `agy models` (effort embedded in the slug; do not also pass a conflicting `--effort`) | +| Codex | **GPT × Sol Medium** | Current Sol slug from `codex debug models`, plus `model_reasoning_effort="medium"` | +| AntiGravity | **Gemini × Neon High** | Current Neon High slug from `agy models` (effort is in the slug; do not also pass a conflicting `--effort`) | -```bash -# Codex: pick the Sol slug available on this machine, then pin Medium effort -SOL_MODEL=$(codex debug models | jq -r ' - [.models[].slug | select(test("sol$"))] | last -') - -# Antigravity: pick a Neon High slug available on this machine -NEON_HIGH_MODEL=$(agy models | awk '/neon-high/ {print $1; exit}') -``` - -If either lookup fails, inspect the catalog output and choose the closest Sol / -Neon High entry the CLI lists. +Resolve the live catalog at run time. Command samples below include illustrative +slug *shapes* so the flag form is obvious — replace them with whatever Sol / +Neon High entry your catalog lists today. ## Cheat sheet @@ -47,7 +37,7 @@ Neon High entry the CLI lists. | --- | --- | --- | | Start task | `codex exec '…'` (alias `codex e`) | `agy -p '…'` (`--print` / `--prompt`) | | Choose model | `-m` / `--model`; catalog: `codex debug models` | `--model`; catalog: `agy models` | -| Reasoning effort | `-c 'model_reasoning_effort="…"'` (default `medium`) | Prefer `…-neon-high` slug; or family slug + `--effort` | +| Reasoning effort | `-c 'model_reasoning_effort="…"'` (default `medium`) | Prefer a `…-neon-high` slug; or family slug + `--effort` | | Capture / resume | stdout / `-o` / `--json` → `thread_id` | stdout / `--output-format json\|stream-json` → `conversation_id` | | YOLO | `--yolo` | `--dangerously-skip-permissions` (no `--yolo`) | @@ -74,7 +64,7 @@ Resume: `codex exec resume "$thread_id" 'Follow-up'