Delegate coding tasks to Codex, Claude Code, or Pi agents via acpx (ACP protocol). Use when: (1) building/creating new features or apps, (2) reviewing PRs (s...
Memory
CodexDelegate
Try itDelegate coding, repository analysis, file edits, test runs, or code review to the local Codex CLI without embedding an OpenAI API key. This skill was created to work with ChatGPT/Codex enterprise accounts that may not have the same level of API access. Invokes codex exec with existing ChatGPT/Codex CLI authentication and returns Codex's final output.
What it does
Delegate coding, repository analysis, file edits, test runs, or code review to the local Codex CLI without embedding an OpenAI API key. This skill was created to work with ChatGPT/Codex enterprise accounts that may not have the same level of API access. Invokes codex exec with existing ChatGPT/Codex CLI authentication and returns Codex's final output.
The skill document
Codex Delegate
Use this skill when the user wants OpenClaw to hand a coding or repository task to Codex and receive a result back. It is meant for local, trusted operator setups where codex is already installed and signed in.
Preconditions
codexis installed onPATH.- Codex CLI has already been authenticated by the operator, preferably with ChatGPT sign-in. Do not ask the user for an API key.
- Run inside the target repository or pass
--cwd. - OpenClaw must allow this agent to use
execfor the wrapper script.
If Codex is not authenticated, tell the operator to run codex or codex login once and complete the ChatGPT browser login. Do not request, print, copy, or inspect ~/.codex/auth.json.
Wrapper
Prefer the bundled wrapper:
{baseDir}/scripts/codex-delegate.sh --cwd /path/to/repo --prompt "summarize the repository and list the riskiest files"
For file creation or edits:
{baseDir}/scripts/codex-delegate.sh \
--cwd /path/to/repo \
--sandbox workspace-write \
--prompt "Create docs/architecture.md explaining the current service layout."
For machine-readable event logs while still returning the final Codex answer:
{baseDir}/scripts/codex-delegate.sh \
--cwd /path/to/repo \
--sandbox workspace-write \
--json-log .openclaw/codex-runs/last.jsonl \
--output .openclaw/codex-runs/last.md \
--prompt "Review the auth changes and fix any failing tests."
To pass CLI-style context:
npm test 2>&1 | {baseDir}/scripts/codex-delegate.sh \
--cwd /path/to/repo \
--sandbox workspace-write \
--prompt "Summarize the failing tests and make the smallest safe fix."
Use --prompt-file path when a generated prompt is already on disk. Use --stdin-file path when another tool wrote context to a file.
Permissions
This skill requires:
exec: Run thecodexCLI and the bundled wrapper scriptfs.read: Read repository files for analysisfs.write: Write files when--sandbox workspace-writeis used
Scope
This skill is limited to delegating coding and repository tasks to the local Codex CLI. It does not manage Codex configuration, handle authentication, or perform actions outside the target repository. All write operations require explicit user confirmation before proceeding.
Delegation Workflow
- Restate the exact Codex task in one compact prompt.
- Choose the narrowest sandbox:
read-onlyfor analysis, review, summaries, planning.workspace-writefor creating or editing files in the repo.danger-full-accessonly on an isolated machine/container with explicit operator approval.
- Run the wrapper from the repository root or with
--cwd. - Return Codex's final answer to the user.
- If edits were allowed, inspect
git diff --statand relevant diffs before claiming files were changed.
Safety Rules
- Never pass
OPENAI_API_KEY,CODEX_API_KEY, or raw tokens to Codex. The wrapper unsets API-key env vars before invokingcodex exec. - Never read, reveal, summarize, or copy
~/.codex/auth.json. - Do not run this skill from public or untrusted chat channels.
- Do not give Codex secrets, credentials, private keys, or production data unless the operator explicitly approved that exact data flow.
- Prefer an isolated checkout or git worktree for write tasks.
- Treat Codex output as another agent's report; verify important claims locally.
Failure Handling
codex: command not found: ask the operator to install Codex CLI.- Authentication failure: ask the operator to run
codex loginwith ChatGPT sign-in, then retry. - Git repo error: run in a git repository, or use
--skip-git-repo-checkonly for a deliberately isolated scratch workspace. - Permission error on edits: retry with
--sandbox workspace-writeonly if file changes are intended.
Related skills
Multi-agent deep review for code PRs in any repo. Use when asked to "deep review this PR," "multi-agent review," "review
Senior Staff Engineer skill for AI coding agents. Enforces simplicity, reuse-first, minimal-diff changes, testability, and Clean Code discipline. Use this sk...
Use this skill when you need to publish, fetch, search, list, share, or watch AgentFiles artifacts from Codex, Claude Code, OpenClaw, or other agent runtimes...
将编程任务委派给 AI 助手处理的基础能力,支持任务分类、代码生成与执行日志记录。Use when 需要代码生成、编程辅助、调试测试、开发部署时使用。不适用于无明确技术栈的模糊需求。适用于独立开发者、企业团队和自动化工作流场景。支持中文交互,无需复杂配置即开即用。输出结果可直接使用,减少二次加工成本。
Trigger a one-shot workflow that clones (or pulls) a Git repository, generates a structured wiki from it using the `codewiki` CLI, and optionally renders the...