Claude Code から Codex CLI に実装を委譲して進めるスキル。可能なら Claude Code の subagent として Codex を自律実行させる。ユーザーが 「codexで実装して」「Codexで実装して」「codexに任せて」と依頼したときに使用する。 Claude は計画作成・委譲・監視・結果報告のみを担当し、ソースコードは直接変更しない。
このスキルは、Claude Code 上の実装依頼を Codex CLI に渡して実装させるための運用手順です。
役割分担は固定です。
実行方式は次の優先順位で固定します。
codex exec を直接起動して監視するcodexで実装して / Codexで実装して / codexに任せて と依頼したとき次のケースでは使わない。
apply_patch などで実装を代行しない。以下を実行して前提を確認する。
command -v codex
codex --version
git rev-parse --git-dir
前提を満たさない場合の対応。
codex が見つからない: インストール手順を案内して中断codex login を案内して中断ユーザー依頼を Codex 用に構造化する。
# Task: <短いタスク名>
## Objective
<何を実装するか>
## In Scope
- <対象1>
- <対象2>
## Out of Scope
- <今回やらないこと>
## Constraints
- Follow existing patterns in this repository
- Keep changes minimal and focused
- Add or update tests for changed behavior
- Update docs only if behavior or usage changes
- Do not output full logs or full diffs in your final response
- Keep final response concise and summary-only
## Done Criteria
- Requested behavior is implemented
- Relevant tests pass
- `git status --short` で変更が説明可能
## Final Response Format
- Result: Success | Failed
- Changed Files: max 10 entries
- Test Summary: pass/fail + counts only
- Key Decisions: max 3 bullets
- Remaining Issues: optional, max 3 bullets
--full-auto を既定として Codex に実装を委譲する。
codex exec --full-auto を実行し、完了まで自律処理させる。運用ルール:
subagent を使えない環境のみ、次を実行する。
TIMESTAMP="$(date +%Y%m%d%H%M%S)"
PROMPT_FILE="/tmp/codex-prompt-${TIMESTAMP}.md"
RESULT_FILE="/tmp/codex-result-${TIMESTAMP}.txt"
cat > "$PROMPT_FILE" << 'PROMPT'
# Task: <task>
## Objective
<objective>
## In Scope
- <scope>
## Out of Scope
- <out-of-scope>
## Constraints
- Follow existing patterns in this repository
- Keep changes minimal and focused
- Add or update tests for changed behavior
- Update docs only if behavior or usage changes
- Do not output full logs or full diffs in your final response
- Keep final response concise and summary-only
## Done Criteria
- Requested behavior is implemented
- Relevant tests pass
- `git status --short` is explainable
## Final Response Format
- Result: Success | Failed
- Changed Files: max 10 entries
- Test Summary: pass/fail + counts only
- Key Decisions: max 3 bullets
- Remaining Issues: optional, max 3 bullets
PROMPT
codex exec \
--full-auto \
--output-last-message "$RESULT_FILE" \
-C "$(pwd)" \
- < "$PROMPT_FILE"
EXIT_CODE=$?
codex exec のログと終了コードを監視する。git status --short
[ -f "$RESULT_FILE" ] && tail -n 80 "$RESULT_FILE"
ログ取り扱いルール:
cat で全文を展開しない。codex 未インストール/未認証command not found または認証エラーcodex のインストールまたは codex login を案内して停止EXIT_CODE != 0RESULT_FILE の要点のみ報告し、以下のいずれかを選ぶ
Codex 完了後、Claude は次の形式で報告する。
Codex 実装が完了しました。
- Result: Success | Failed (exit code: <code>)
- Changed files: <git status --short の要約>
- Notes: <テスト結果や補足>
- Next action: <必要なら再委譲方針>
codexで実装して。ユーザー作成APIに入力バリデーションを追加してテストも更新して。
codex exec --full-auto を委譲codex exec --full-auto を実行--full-auto のため、委譲前にスコープ明確化が必須