majiayu000/spellbook / skills/codex-agent
codex-agent
VerifiedUse when you want a second-opinion review via Codex CLI, cross-verification after another agent implements changes, debugging help, or alternative implementation proposals. Requires Codex CLI to be installed and authenticated.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 4.9 KB |
| SKILL.md | skill md | 7.5 KB |
| advanced.md | markdown | 3.8 KB |
| examples.md | markdown | 4.3 KB |
| sandbox-modes.md | markdown | 2.0 KB |
| scripts/check-codex.shexecutable | script | 1.0 KB |
| scripts/codex-wrapper.shexecutable | script | 3.5 KB |
scripts/codex-wrapper.sh
View on GitHub#!/bin/bash
# codex-wrapper.sh - Wrapper script for calling Codex with common defaults
# Place in: ~/.claude/skills/codex-agent/scripts/
set -e
# Defaults
SANDBOX="${CODEX_SANDBOX:-read-only}"
OUTPUT_FORMAT=""
OUTPUT_FILE=""
SESSION=""
WORKDIR="${PWD}"
CONFIG_OVERRIDES=()
usage() {
cat << EOF
Usage: codex-wrapper.sh [options] "<task>"
Options:
-d, --dir <path> Working directory (default: current)
-s, --sandbox <mode> Sandbox mode: read-only, workspace-write, danger-full-access
-j, --json Output as JSON
-c, --config <key=val> Pass a Codex config override (repeatable)
-o, --output <file> Save output to file
-S, --session <id> Use session ID for follow-up
-h, --help Show this help
Examples:
codex-wrapper.sh -d /path/to/project "Analyze the code"
codex-wrapper.sh -j -s workspace-write "Fix the bug in main.ts"
codex-wrapper.sh -s workspace-write -c 'sandbox_workspace_write.network_access=true' "Install dependencies"
codex-wrapper.sh -S abc123 "Continue from where we left off"
EOF
exit 0
}
# Parse arguments
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case $1 in
-d|--dir)
[[ $# -ge 2 ]] || { echo "Error: --dir requires a path" >&2; exit 2; }
WORKDIR="$2"
shift 2
;;
-s|--sandbox)
[[ $# -ge 2 ]] || { echo "Error: --sandbox requires a mode" >&2; exit 2; }
SANDBOX="$2"
shift 2
;;
-j|--json)
OUTPUT_FORMAT="--json"
shift
;;
-c|--config)
[[ $# -ge 2 ]] || { echo "Error: --config requires key=value" >&2; exit 2; }
CONFIG_OVERRIDES+=(-c "$2")
shift 2
;;
-o|--output)
[[ $# -ge 2 ]] || { echo "Error: --output requires a file" >&2; exit 2; }
OUTPUT_FILE="$2"
shift 2
;;
-S|--session)
[[ $# -ge 2 ]] || { echo "Error: --session requires an id" >&2; exit 2; }
SESSION="$2"
shift 2
;;
-h|--help)
usage
;;
-*)
echo "Error: unsupported option: $1" >&2
exit 2
;;
*)
POSITIONAL_ARGS+=("$1")
shift
;;
esac
done
set -- "${POSITIONAL_ARGS[@]}"
if [[ $# -eq 0 ]]; then
echo "Error: Task description required"
usage
fi
TASK="$*"
# Validate high-impact options before building the command.
case "$SANDBOX" in
read-only|workspace-write|danger-full-access) ;;
*)
echo "Error: unsupported sandbox mode: $SANDBOX" >&2
exit 2
;;
esac
if [[ "$SANDBOX" == "danger-full-access" && "${CODEX_ALLOW_DANGER_FULL_ACCESS:-}" != "1" ]]; then
echo "Error: danger-full-access requires CODEX_ALLOW_DANGER_FULL_ACCESS=1" >&2
exit 2
fi
if [[ -n "$SESSION" && ${#CONFIG_OVERRIDES[@]} -gt 0 ]]; then
echo "Error: --config is only supported for new codex exec tasks, not session resume" >&2
exit 2
fi
if [[ -n "$SESSION" ]]; then
# Build command as an argv array. Do not use eval with user-controlled text.
CMD=(codex exec -C "$WORKDIR" resume)
else
# Build command as an argv array. Do not use eval with user-controlled text.
CMD=(codex exec -C "$WORKDIR" -s "$SANDBOX")
CMD+=("${CONFIG_OVERRIDES[@]}")
fi
if [[ -n "$OUTPUT_FORMAT" ]]; then
CMD+=("$OUTPUT_FORMAT")
fi
if [[ -n "$OUTPUT_FILE" ]]; then
CMD+=(-o "$OUTPUT_FILE")
fi
if [[ -n "$SESSION" ]]; then
CMD+=("$SESSION")
fi
CMD+=("$TASK")
# Execute
"${CMD[@]}"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |