Agent Skillsboshu2/agentops › codex-exec

codex-exec

GitHub

非交互式运行单次 Codex 命令并捕获证据,强制使用进程组隔离与超时回收机制(默认600秒),确保执行可审计且失败时安全关闭。

images/gemini/skills/codex-exec/SKILL.md boshu2/agentops

Trigger Scenarios

run Codex headless capture Codex evidence

Install

npx skills add boshu2/agentops --skill codex-exec -g -y
More Options

Non-standard path

npx skills add https://github.com/boshu2/agentops/tree/main/images/gemini/skills/codex-exec -g -y

Use without installing

npx skills use boshu2/agentops@codex-exec

指定 Agent (Claude Code)

npx skills add boshu2/agentops --skill codex-exec -a claude-code -g -y

安装 repo 全部 skill

npx skills add boshu2/agentops --all -g -y

预览 repo 内 skill

npx skills add boshu2/agentops --list

SKILL.md

Frontmatter
{
    "name": "codex-exec",
    "context": {
        "intent": {
            "mode": "none"
        },
        "window": "inherit",
        "sections": {
            "exclude": [
                "HISTORY"
            ]
        },
        "intel_scope": "none"
    },
    "consumes": [
        "codex-command-packet"
    ],
    "metadata": {
        "tier": "orchestration",
        "effects": [
            "run_codex_process",
            "sandbox_tiered_workspace_and_network_effects"
        ],
        "stability": "stable",
        "disposition": "keep_optional_adapter",
        "capabilities": [
            "codex_exec"
        ],
        "dependencies": [],
        "canonical_status": "canonical"
    },
    "produces": [
        "codex-run-output"
    ],
    "practices": [
        "pragmatic-programmer"
    ],
    "context_rel": [
        {
            "kind": "supplier-to",
            "with": "validate"
        }
    ],
    "description": "Run one caller-supplied Codex command non-interactively and capture evidence. Triggers: \"run Codex headless\", \"capture Codex evidence\".",
    "hexagonal_role": "driving-adapter",
    "user-invocable": false,
    "output_contract": "process exit status and captured Codex output artifact",
    "skill_api_version": 1
}

Codex Exec — one-shot runtime adapter

Run exactly one caller-supplied Codex prompt and capture its result. This skill does not choose work, retry failures, validate by itself, or control continuation.

One prompt, one process, one captured artifact is what makes the run auditable: when nothing loops, every byte of output traces to exactly one invocation, and a disagreement about what happened is settled by the artifact.

Named failure mode — stdin hang: a non-TTY run left waiting forever on an open stdin nobody will write to; always pipe the prompt or close the stream.

Anti-pattern: granting workspace-write or network access "in case the prompt needs it". Corrective: match the sandbox to the declared effects; a review prompt runs read-only, full stop.

Procedure

  1. Confirm codex login status for the intended profile.
  2. Set the working root explicitly with -C.
  3. Match the sandbox to the requested effects: read-only for offline review, workspace-write for authorized edits, and broader access only when the caller explicitly requires network or external effects.
  4. Pipe the prompt to stdin (or close stdin) in non-TTY execution so the process cannot wait indefinitely for input.
  5. A wall-clock deadline is mandatory — never run codex unbounded. Use the caller's deadline, or the declared default of 600s (10 min) when the caller supplies none, and record which one applied. Enforce it so the whole process tree is reaped, not just the direct child: run codex in its own process group and kill the group on expiry: setsid (own process group) + kill -KILL -<pgid> on the group; --kill-after only escalates TERM→KILL and plain timeout <secs> codex … signals only the direct child. If the wrapper cannot guarantee process-group reaping, do not execute — that host lacks the cleanup capability this skill requires (capability unavailable, fail closed). Deadline expiry is fail-closed: the run is killed and reported as timed-out / not proven, partial output preserved — never a completed review.
  6. Capture the final response with -o, JSONL, or an output schema.
  7. Report the typed run result, then stop: the process exit status, the captured artifact path, which deadline applied and whether it fired, that the process tree was reaped (a run without guaranteed reaping never starts), and whether the codex binary was present at all. Cancellation is the caller's; this skill neither retries nor continues on its own.

Terminal outcomes are explicit: binary absent (no codex on PATH) → report unavailable and stop; deadline expiry → fail-closed, report the kill and preserved partial output, never a completed review; nonzero exit → runtime evidence, not a semantic verdict. The caller decides whether to launch another invocation.

Example

# Deadline mandatory; default 600s. `setsid` puts codex in its own process
# group so expiry kills the whole tree, with `--kill-after` escalating
# TERM->KILL. No setsid (or equivalent group kill) available -> do not run:
# fail closed as capability-unavailable.
printf '%s\n' "$PROMPT" | setsid timeout --kill-after=10s "${CODEX_TIMEOUT:-600}" \
  codex exec -C "$WORKSPACE" -s read-only -o "$OUTPUT" -

For a validator, the prompt must name the acceptance digest, exact subject manifest digest, author context ID, evidence, and required checked/not-checked report. The validator context ID must be distinct from the author's before a PASS verdict is possible. When the caller elects a cross-model fresh validator, record model identities per the agent-native model-dispatch recipe and match the sandbox to declared effects.

Version History

  • 7b07a7d Current 2026-08-19 21:58

    W6版本更新:引入强制墙钟超时(默认600s)、fail-closed机制及进程组树回收前置条件;细化沙箱权限匹配、登录状态确认及退出结果报告规范。

  • 3f402e5 2026-07-24 22:06

Same Skill Collection

images/gemini/skills/account-rotation/SKILL.md
images/gemini/skills/agent-mail/SKILL.md
images/gemini/skills/agent-native/SKILL.md
images/gemini/skills/agy-native/SKILL.md
images/gemini/skills/anti-ceremony/SKILL.md
images/gemini/skills/automation-shape-routing/SKILL.md
images/gemini/skills/bootstrap/SKILL.md
images/gemini/skills/cass/SKILL.md
images/gemini/skills/cc-hooks/SKILL.md
images/gemini/skills/codebase-recon/SKILL.md
images/gemini/skills/converter/SKILL.md
images/gemini/skills/council/SKILL.md
images/gemini/skills/craft-goal/SKILL.md
images/gemini/skills/dcg/SKILL.md
images/gemini/skills/doc/SKILL.md
images/gemini/skills/domain/SKILL.md
images/gemini/skills/fitness/SKILL.md
images/gemini/skills/goals/SKILL.md
images/gemini/skills/handoff/SKILL.md
images/gemini/skills/idea-genie/SKILL.md
images/gemini/skills/implement/SKILL.md
images/gemini/skills/learn/SKILL.md
images/gemini/skills/ms/SKILL.md
images/gemini/skills/ntm/SKILL.md
images/gemini/skills/operationalize/SKILL.md
images/gemini/skills/pattern-mining/SKILL.md
images/gemini/skills/plan/SKILL.md
images/gemini/skills/postmortem/SKILL.md
images/gemini/skills/premortem/SKILL.md
images/gemini/skills/product/SKILL.md
images/gemini/skills/rch/SKILL.md
images/gemini/skills/reality-check/SKILL.md
images/gemini/skills/refactor/SKILL.md
images/gemini/skills/research/SKILL.md
images/gemini/skills/reverse-engineer/SKILL.md
images/gemini/skills/rpi/SKILL.md
images/gemini/skills/sbh/SKILL.md
images/gemini/skills/scaffold/SKILL.md
images/gemini/skills/scope/SKILL.md
images/gemini/skills/security/SKILL.md
images/gemini/skills/shared/SKILL.md
images/gemini/skills/skill-builder/SKILL.md
images/gemini/skills/standards/SKILL.md
images/gemini/skills/status/SKILL.md
images/gemini/skills/swarm/SKILL.md
images/gemini/skills/test/SKILL.md
images/gemini/skills/toil-mining/SKILL.md
images/gemini/skills/using-flywheel/SKILL.md
images/gemini/skills/using-gc/SKILL.md

Metadata

Files
0
Version
7b07a7d
Hash
a44fe409
Indexed
2026-07-24 22:06

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 01:46
浙ICP备14020137号-1 $mapa de visitantes$