claude/skills/codex/SKILL.md
Codex CLI を使って、ユーザーが明示的に望んだ調査・実装・レビューだけを補助的に実行する。Claude Code の主導権は維持し、乗っ取り的な委譲や危険な自動化は行わない。
npx skillsauth add kazuph/dotfiles codexInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Codex CLI を Claude Code の補助として安全に使うためのスキル。
codex で と明示した時だけ使う。--dangerously-bypass-approvals-and-sandbox は禁止しない。ただし必要性と影響範囲を理解した上で、明示的に使う。git checkout -- . や git reset --hard は禁止。investigateコードベースの読取り調査、原因分析、設計確認、仕様確認に使う。
outfile=$(mktemp -t codex)
codex exec \
--sandbox read-only \
-o "$outfile" \
"<プロンプト>" >/dev/null 2>&1
cat "$outfile"
outfile=$(mktemp -t codex)
codex exec \
--sandbox read-only \
-C /path/to/dir \
-o "$outfile" \
"<プロンプト>" >/dev/null 2>&1
cat "$outfile"
implementコード修正、最小安全パッチ、明示された実装作業にだけ使う。
outfile=$(mktemp -t codex)
codex exec \
--full-auto \
-o "$outfile" \
"<プロンプト>" >/dev/null 2>&1
cat "$outfile"
outfile=$(mktemp -t codex)
codex exec \
--full-auto \
-C /path/to/dir \
-o "$outfile" \
"<プロンプト>" >/dev/null 2>&1
cat "$outfile"
git diff で変更範囲を確認する。reviewコードレビュー専用。レビュー結果から勝手に修正へ進まない。
codex review --uncommitted
codex review --base main
codex review --commit <SHA>
codex review --uncommitted \
"セキュリティ観点でレビュー。XSS、権限漏れ、データ破壊リスクを重点確認"
codex \
-C /path/to/dir \
review --base main
implement を明示実行する。-m <model> を付ける。-C /path/to/dir を付ける。--ephemeral を検討する。--output-schema <file> を使う。tcgetattr などの TTY 問題が出る環境では script -q /dev/null ... でラップする。OpenAI 版から採る価値があるのは、プロンプトを短く構造化する考え方だけ。以下は採用してよい。
<task>具体的な依頼</task>
<output_contract>欲しい出力の形</output_contract>
<safety>触ってよい範囲、触ってはいけない範囲</safety>
<verification>何を確認して完了とするか</verification>
<task>この不具合の根本原因を調べて。ファイル変更は禁止。</task>
<output_contract>観測事実、推測、未確認点を分けて簡潔に返す。</output_contract>
<verification>関連ファイルと実際のコード断片に基づいて説明する。</verification>
<task>この不具合を最小安全パッチで修正して。</task>
<safety>無関係なリファクタ禁止。既存挙動を壊さない。</safety>
<verification>変更ファイル、実施した確認、残るリスクを最後に列挙する。</verification>
<task>この差分をレビューして。</task>
<output_contract>findings first。重大度順。ファイルパスと行番号を含める。</output_contract>
<verification>根拠が弱いものは推測として明示する。</verification>
| 呼び出し | 動作 |
|---------|------|
| /codex investigate <prompt> | 読み取り調査 |
| /codex implement <prompt> | 明示依頼された実装 |
| /codex review | 未コミット変更レビュー |
| /codex review --base main | ブランチ差分レビュー |
引数の最初の語が investigate / implement / review でモードを判別する。
browserUse Codex with a lightweight model (o4-mini / Spark) for browser automation tasks. Opus is too slow for interactive browser work — delegate to Codex first, escalate only on failure.
outfile=$(mktemp -t codex)
codex exec \
--full-auto \
-m o4-mini \
-o "$outfile" \
"<browser task prompt>" >/dev/null 2>&1
cat "$outfile"
outfile=$(mktemp -t codex)
codex exec \
--full-auto \
-m o4-mini \
-o "$outfile" \
"Use browser-use CLI to: open http://localhost:3000, take a screenshot to /tmp/result.png, then close. Report what you see on the page." >/dev/null 2>&1
cat "$outfile"
<task>Use browser-use CLI to verify the login flow on http://localhost:3000</task>
<output_contract>Screenshot saved to .artifacts/feature/login.png. Report: page title, visible elements, any errors.</output_contract>
<safety>Do not modify any code. Browser interaction only.</safety>
<verification>Screenshot exists and shows expected page state.</verification>
When Claude Code consults Codex for planning or review, the goal is not confirmation — it's perspective diversity.
Claude の結論・仮説・推奨案を先に渡すと、Codex はそれに引きずられて「狭い範囲の検証」しか返さなくなる。 価値は divergent thinking (発散的思考) にあるので、Codex にはゼロベースで考えさせる。
渡す情報:
Claude 自身の結論や推奨は 渡さない。もしくは「自分はこう考えたが、ゼロベースで再検討して」と明示する。
Codex CLI は rate limit / quota / "You've hit your usage limit" エラーで使えなくなることがある。 その場合は 自動的に GitHub Copilot CLI にフォールバックする。ユーザーに聞き直さない。
以下のいずれかが Codex の出力/stderr に含まれる場合は limit と判定:
usage limitrate limitquota429You've reachedtry again laterまたは Codex の exit code が非 0 で上記に該当しない場合でも、 2 回リトライして失敗したら copilot にフォールバックしてよい。
copilot -p "<プロンプト>" --yolo --model gpt-5.4
-p でプロンプトを一発実行--yolo で承認をスキップ (codex の --full-auto に相当)--model gpt-5.4 でモデルを明示 (注: -m はエイリアスがないので必ず --model)outfile=$(mktemp -t codex)
if ! codex exec --sandbox read-only -o "$outfile" "<プロンプト>" >/dev/null 2>&1; then
if grep -qiE "usage limit|rate limit|quota|429|reached" "$outfile"; then
echo "[codex limit detected — falling back to copilot]" >&2
copilot -p "<プロンプト>" --yolo --model gpt-5.4
else
cat "$outfile"
exit 1
fi
else
cat "$outfile"
fi
--yolo はファイル変更も許可するので、investigate 相当の用途では プロンプト側で「ファイル変更禁止」を明記 するcodex --versioncodex loginscript -q /dev/null ...-o "$outfile" or --output-schematools
X (Twitter) API read-only CLI. Bookmarks retrieval, tweet search, engagement analytics (likes/RT aggregation), mentions, user lookup. Use when: reading X bookmarks, searching tweets, aggregating likes/retweets, checking mentions, looking up users. Triggers: bookmark, bookmarks, X search, Twitter search, likes count, RT count, engagement, tweet analytics.
testing
単体テスト方針の要約。Kiro流で使うときは本文を必ず参照・展開する。
tools
Send prompts to other AI CLIs (Codex, Claude Code) running in sibling tmux panes and receive results back. Use this skill when the user asks to send a question or task to Codex or another Claude Code instance in a tmux pane. Handles pane discovery, CLI startup if needed, prompt delivery with proper Enter timing, delivery verification, and result return via tmux send-keys.
data-ai
TAKT ピースエンジン。Agent Team を使ったマルチエージェントオーケストレーション。ピースYAMLワークフローに従ってマルチエージェントを実行する。