home/claude/skills/code-review-codex/SKILL.md
Code review using OpenAI Codex CLI with project context (rules, diff, conventions)
npx skillsauth add lambdalisue/dotfiles code-review-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.
base (optional): Base branch/ref. Auto-detected if omitted.base./style-review).codex exec with a review prompt — codex reads the codebase and diff itself.CRITICAL: Follow these exact command patterns. Do NOT deviate or experiment.
codex exec --sandbox read-only "PROMPT" 2>&1
codex exec runs non-interactively and prints results to stdout--sandbox read-only ensures no writes to the repositoryIf base given → use that as {base}.
If no base → auto-detect:
git status --short — any uncommitted changes?{mode} to uncommittedgh pr view --json baseRefName -q .baseRefName 2>/dev/null → fallback to default branch (main/master). Set {base} to detected branch and {mode} to committed.If {mode} is committed, verify diff is non-empty:
git diff --stat "$(git merge-base {base} HEAD)"
If empty → STOP with "レビュー対象の変更がありません".
Run in parallel:
git diff --name-only "$(git merge-base {base} HEAD)" (or git diff --name-only + git diff --cached --name-only for uncommitted) → count changed filesgit log --oneline "$(git merge-base {base} HEAD)..HEAD" (committed mode only) → {log}Build the prompt and run codex exec:
Committed changes:
codex exec --sandbox read-only "Review the code changes between {base} and HEAD. Focus on: design mistakes, architectural misfit, best practices violations, security holes, logic bugs. Ignore style/naming/formatting nits. Output findings in Japanese." 2>&1
Uncommitted changes:
codex exec --sandbox read-only "Review the uncommitted changes (staged and unstaged). Focus on: design mistakes, architectural misfit, best practices violations, security holes, logic bugs. Ignore style/naming/formatting nits. Output findings in Japanese." 2>&1
Do NOT: retry with different invocations on failure. If the command fails, report the error as-is.
Display results:
## コードレビュー結果 (Codex)
{header} | **変更ファイル数**: N
{codex exec output}
Where {header} is:
**ベース**: \{base}``**モード**: 未コミット変更If codex found no issues, report that clearly.
Execute from Step 1.
tools
Update the title and body of an existing pull request WITHOUT asking for approval
tools
Create a pull request with title and body based on commits WITHOUT asking for approval
tools
Create a Conventional Commit from already staged changes WITHOUT asking for approval
tools
Map staged changes to existing commits and create fixup commits for autosquash WITHOUT asking for approval