본문으로 건너뛰기
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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Dispatch independent tasks to parallel workers or subagents without write collisions. Use when: running or planning agents in parallel, even two; check scopes before any launch.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

boshu2/agentops4502026년 10월 19일 업데이트

Run a supplied task in headless AGY (Antigravity, Gemini) and collect its result. Use when: AGY, Antigravity or Gemini is requested by name; never a fallback.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

boshu2/agentops4502026년 10월 19일 업데이트

Run one prompt through headless Claude with scoped permissions and a time bound. Use when: scripting or automating a `claude -p` call, even a simple one.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

boshu2/agentops4502026년 10월 19일 업데이트

council

무료

Compare independent opinions from several models or contexts without inflating agreement. Use when: wanting a second opinion or debate, or summarizing several reviewers' results.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

boshu2/agentops4502026년 10월 19일 업데이트

Draft or lint a bounded long-running goal prompt with a finish line and hard limits. Use when: selected by name; one change goes to Plan.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

boshu2/agentops4502026년 10월 19일 업데이트

doc

무료

Write or update READMEs, docs, repo instructions and handoff notes, checked against source. Use when: documenting something, writing a README or leaving a session handoff.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

boshu2/agentops4502026년 10월 19일 업데이트

boshu2의 스킬 모두 보기

이 스킬의 문제 신고