Skip to content

Instantly share code, notes, and snippets.

@drorm
Created February 6, 2026 00:32
Show Gist options
  • Select an option

  • Save drorm/7851e6ee84a263c8bad743b037fb7abc to your computer and use it in GitHub Desktop.

Select an option

Save drorm/7851e6ee84a263c8bad743b037fb7abc to your computer and use it in GitHub Desktop.
Claude skill to run a codex review
name: codex-prepush-review
description: >
Run Codex to perform a pre-push code review for a given GitHub issue.
arguments:
issue_number:
type: integer
description: GitHub issue number to review
tools:
- bash
entrypoint: run.sh
#!/usr/bin/env bash
# codex-review.sh
#
# Usage:
# ./codex-review.sh 2
#
# Runs: codex exec "<prompt that tells codex to read issue #N + run git status/diff>"
#
set -euo pipefail
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <issue-number>" >&2
exit 1
fi
ISSUE_NUM="$1"
if ! [[ "$ISSUE_NUM" =~ ^[0-9]+$ ]]; then
echo "Error: issue-number must be an integer (got: $ISSUE_NUM)" >&2
exit 1
fi
PROMPT=$(
cat <<EOF
Look at issue #$ISSUE_NUM and then do a git status and where necessary git diff.
Goal: find likely bugs, missing edge cases, type-safety issues, Next.js server/client boundary mistakes, security issues, and missing tests.
Be strict on correctness; avoid large refactors unless necessary.
Output format:
1) Blockers (must-fix before push)
2) Important (should-fix)
3) Nits (optional)
4) Missing tests (specific test cases)
5) Questions for the author (only if truly needed)
EOF
)
# Run codex in non-interactive mode, save raw output, and print filtered results.
RAW_OUT="$(mktemp -t codex-prepush-review.XXXXXX)"
/home/dror/.npm-global/bin/codex exec --json "$PROMPT" | awk -v f="$RAW_OUT" '{
print > f
c++
printf "\rlines: %d", c > "/dev/stderr"
} END { print "" > "/dev/stderr" }'
cat "$RAW_OUT" | jq -r 'select(.type=="item.completed" and .item.type=="agent_message") | .item.text'

Codex Pre-Push Review

Use this skill when instructed by the user, typically when finished with implementing an issue.

Purpose

Run OpenAI Codex locally to review changes related to a GitHub issue. Codex will inspect the issue, run git status / git diff as needed, and return a structured review.

When to use

When instructed by the user

How it works

  • Takes a GitHub issue number as input
  • Executes a local Codex CLI command
  • Writes raw JSON output to a temporary file
  • Prints only the filtered review text (agent message output)

Expected output

  1. Blockers (must-fix before push)
  2. Important (should-fix)
  3. Nits (optional)
  4. Missing tests
  5. Questions for the author (if needed)

Do not modify the script behavior. Address blockers before continuing.

@dindinrosaot853-tech
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment