AgentSkillsCN

codex-openclaw

在 OpenClaw 会话中,通过 OpenAI Codex CLI 进行实际编码工作(实现、重构、测试、评审)。当用户提出“使用 Codex 编码”、“在某个仓库中执行迭代式编码任务”或“以日志记录和进度更新的方式编排 Codex 运行”时使用。

SKILL.md
--- frontmatter
name: codex-openclaw
description: Drive OpenAI Codex CLI from OpenClaw sessions for real coding work (implement, refactor, test, review). Use when user asks to code with Codex, run iterative coding tasks in a repo, or orchestrate Codex runs with logs and progress updates.

Codex + OpenClaw

Use Codex CLI as the coding engine from OpenClaw.

Prerequisites

  • codex available in PATH
  • authenticated Codex CLI session
  • run inside a git repo
  • when invoked through OpenClaw tools, prefer PTY execution

Quick checks

bash
codex --version
git rev-parse --is-inside-work-tree

If not in repo:

bash
mkdir -p /tmp/codex-scratch && cd /tmp/codex-scratch && git init

Recommended execution patterns

One-shot edit

bash
codex exec "Implement <feature>, add tests, run checks, and summarize changes."

Long task (background pattern)

bash
codex exec "Build <feature> in small commits, run tests, then provide a concise report."

Use process logs to monitor progress and intervene only when needed.

Prompt template

text
Context: <project + goal>
Constraints:
- keep changes minimal and targeted
- preserve style and architecture
- add/update tests for behavior changes
- run relevant checks before finishing
Deliverables:
- changed files with rationale
- commands run + outcomes
- remaining risks / TODOs

Quality guardrails

  • Prefer iterative changes over broad rewrites.
  • Never claim completion without command/test output.
  • If blocked by missing env/secrets/tools, stop and report exact blocker.

References