本文へ移動
cccskills
無料GitHub で公開

codex-exec

Run one prompt through headless Codex and capture the result. Use when: wanting a one-shot `codex exec` run or CI step. Not for batches or retries.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md5.6 KB
  • references/guarded-runner.md3.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Codex Exec — one-shot runtime adapter

Run exactly one caller-supplied Codex prompt as one process and capture its result. This skill does not choose work, retry, validate or continue. One prompt, one process, one captured artifact keeps every output byte traceable to one invocation.

Rules that change the command

  • Sandbox from declared effects. -s read-only for review or analysis, workspace-write only for authorized edits, and network or wider access only when the caller explicitly requires those effects. "In case it needs it" is not a declared effect.
  • Close stdin. codex exec reads the prompt from stdin when no prompt argument is given, and appends piped stdin to a prompt argument. A non-TTY run (CI, a script) with an open stdin can wait forever: the stdin hang. Feed the prompt on stdin and let it end, or redirect </dev/null.
  • One deadline, never renewed. Fix one absolute deadline before the first attempt. Each invocation, including any retry the caller decides to make, gets only the time left before that deadline. A retry never gets a fresh budget: a loop that gives each attempt its own new timeout has silently multiplied the caller's bound. A missing, zero, negative or malformed bound prevents launch; an expired deadline stops before dispatch.
  • No retry here. Report a timeout, error or empty output as it is. Another invocation is the caller's decision, under the same deadline.
  • Capped capture, typed exit. Capture output to a file under a byte cap and report the exit status. A timeout is not a result.

Run it

In an AgentOps source checkout, use the guarded library. It enforces the deadline, the combined output cap (10 MiB default), process-group cleanup and echo detection:

# DEADLINE_EPOCH: absolute Unix time fixed once by the caller and reused by
# every invocation in its scope.
. "$AGENTOPS_ROOT/scripts/lib/codex-exec.sh"
CODEX_EXEC_DIR="$WORKSPACE" CODEX_EXEC_SANDBOX=read-only \
CODEX_EXEC_PROMPT_FILE="$PROMPT_FILE" CODEX_EXEC_DEADLINE_EPOCH="$DEADLINE_EPOCH" \
CODEX_EXEC_MAX_OUTPUT_BYTES=10485760 CODEX_EXEC_OUT_FILE="$OUTPUT" \
  codex_exec_guarded </dev/null

An installed skill ships only this file, so scripts/lib/codex-exec.sh is absent outside a source checkout. Run codex exec directly instead (flags as of codex-cli 0.156.1; confirm with codex exec --help; on macOS, Homebrew coreutils may provide timeout only as gtimeout):

remaining=$(( DEADLINE_EPOCH - $(date +%s) ))
[ "$remaining" -gt 0 ] || { echo "deadline passed; not launched" >&2; exit 124; }
timeout -k 10 "$remaining" \
  codex exec -C "$WORKSPACE" -s read-only - <"$PROMPT_FILE" 2>&1 \
  | head -c 10485760 >"$OUTPUT"
rc=${PIPESTATUS[0]}  # 124 timed out, 137 killed after grace, else codex's status

Add --skip-git-repo-check outside a Git repository and -o <file> to keep the final message separately (outside the cap). An output file exactly at the cap was truncated, and its status reflects the closed pipe, not a review. The fallback has no survivor check or echo detection; report both as not enforced.

Exit codes (guarded library)

ExitMeaning
0Codex completed and produced output
2precondition: binary missing, bounds invalid or missing, capability unavailable, or cleanup unverified; not a result
122descendants survived Codex's exit; degraded run
123capture or prompt-preparation cap reached; partial evidence kept
124deadline expired, or a clean exit with empty output; a stall, not a result
125output repeats the prompt; not a result
128+Ncancelled by signal N (129 HUP, 130 INT, 143 TERM)
otherCodex's own nonzero status, preserved

Reserved codes are runtime evidence, never a semantic verdict. Codex's own status can coincide with a reserved code; the runner's stderr diagnostic tells them apart. Guarded runner internals covers inputs, host requirements, process supervision and the external sandbox wrapper.

Report, then stop

command:  exact argv or library call (prompt by reference)
sandbox:  -s value and the declared effect that needs it
bound:    absolute deadline and seconds remaining at launch
capture:  output path, byte cap, truncated yes/no
exit:     status and its meaning from the table
cleanup:  library result, or "not enforced" for the direct fallback

A Codex validator follows the judgment receipt convention and the agent-native model-dispatch recipe: a requested model flag or the model's own description does not prove which model ran. Siblings: one headless Claude prompt is claude-exec, AGY is agy-native, and worker batches are agent-native.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use AtomLane to compile and execute safe atomic parallel plans on macOS and native Windows Preview for worthwhile independent argv tasks, dependency DAGs, supported platform entrypoints, or Apple-silicon operators. Use at task start or an execution boundary when structured local work may contain two or more worthwhile units; skip plain answers, one quick command, and work whose effects cannot be safely bounded.

日本語の概要は準備中です。原文の説明を表示しています。

hashgraph-online/awesome-codex-plugins1,2752026年10月11日 更新

add

無料

Register a deferred decision in the debt registry. Trigger by judgment, not a marker scan, whenever a future reader would ask "why this way?": an unmade decision, stub, loosened type, bypassed check, swallowed error, a default picked "for now", or a TODO/FIXME/HACK/XXX marker. Trigger immediately whenever you defer work, or when the user invokes $add. Over-register freely; the developer drops with "drop A", "drop A,C", or "drop all".

日本語の概要は準備中です。原文の説明を表示しています。

hashgraph-online/awesome-codex-plugins1,2752026年10月11日 更新

ADK 框架适配层。为 LangChain / EINO / AutoGen / AgentScope / CrewAI 提供框架特定的 代码模板、惯用模式、API 映射和项目结构,供 agent-dev-workshop Phase 5 代码生成使用。 每个框架 reference 文件标注 verified_date 用于版本锁定。

日本語の概要は準備中です。原文の説明を表示しています。

hashgraph-online/awesome-codex-plugins1,2752026年10月11日 更新

中文调试修复技能。用于报错、测试失败、页面异常、功能不符合预期、需要定位根因并做最小修复时。触发语包括"进入调试模式""帮我修问题""报错了""测试失败""页面坏了""找根因"。

日本語の概要は準備中です。原文の説明を表示しています。

hashgraph-online/awesome-codex-plugins1,2752026年10月11日 更新

交互式 AI Agent 开发工作坊:通过 6 阶段深度协作对话,引导用户完成 Agent 需求分析、架构设计、 工具定义、Prompt 与编排设计、代码生成、验证迭代,产出可直接运行的 Agent 项目。 框架无关设计优先,支持 LangChain / EINO / AutoGen / AgentScope / CrewAI 等 ADK 框架。

日本語の概要は準備中です。原文の説明を表示しています。

hashgraph-online/awesome-codex-plugins1,2752026年10月11日 更新

中文漂移审计技能。用于项目或学习过程变乱、上下文漂移、任务分叉、多个方案冲突、命名不一致、Codex 可能顺手改多了时。触发语包括"漂移检查""感觉跑偏了""项目变乱了""检查是否失控""分叉太多""上下文漂移"。

日本語の概要は準備中です。原文の説明を表示しています。

hashgraph-online/awesome-codex-plugins1,2752026年10月11日 更新

hashgraph-online のスキルをすべて見る

このスキルの問題を報告する