From claude-resources
Translates text between languages using OpenAI Codex CLI with Claude Code reviewing and finalizing output. Falls back to Claude Code if Codex is unavailable.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-resources:codex-translatorThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Translation via the codex plugin companion script, reviewed and finalized by Claude Code.
Translation via the codex plugin companion script, reviewed and finalized by Claude Code.
The codex plugin provides a companion script for running tasks. Resolve it dynamically:
CODEX_PLUGIN_ROOT=$(command ls -d "$HOME/.claude/plugins/cache/openai-codex/codex"/*/ 2>/dev/null | sort -V | tail -1)
CODEX_COMPANION="${CODEX_PLUGIN_ROOT}scripts/codex-companion.mjs"
If the file does not exist, report "Codex plugin not installed. Run /codex:setup first." and fall back to Claude Code translation.
Usage for translation tasks:
node "$CODEX_COMPANION" task "<translation prompt>"
The task command runs Codex in read-only mode by default (no --write flag).
Before doing anything, check if Codex is currently rate-limited:
RATE_CHECK=$(node $HOME/.claude/scripts/codex-rate-limit.js check 2>&1)
RATE_EXIT=$?
If RATE_EXIT is non-zero (rate-limited), skip all codex steps and jump directly to the Fallback step. Do NOT report the rate limit to the user — silently fall back.
Translate the following text from <source-lang> to <target-lang>.
Context: <what the text is for — technical documentation, UI, blog, etc.>
Tone: <formal/casual/technical>
Rules:
- Preserve technical terms and code references as-is
- Maintain formatting (markdown, HTML tags, etc.)
- Preserve line breaks and paragraph structure
- Use natural phrasing in the target language
Text to translate:
---
<source text>
---
If translating a file, include the file content in the prompt.
LOGDIR=$(node $HOME/.claude/scripts/get-logdir.js)
mkdir -p "$LOGDIR"
DATETIME=$(date +%Y%m%d_%H%M%S)
# Resolve codex companion script
CODEX_PLUGIN_ROOT=$(command ls -d "$HOME/.claude/plugins/cache/openai-codex/codex"/*/ 2>/dev/null | sort -V | tail -1)
CODEX_COMPANION="${CODEX_PLUGIN_ROOT}scripts/codex-companion.mjs"
# Detect timeout command (gtimeout on macOS via coreutils, timeout on Linux/WSL)
if command -v gtimeout &>/dev/null; then
TIMEOUT_CMD="gtimeout"
elif command -v timeout &>/dev/null; then
TIMEOUT_CMD="timeout"
else
TIMEOUT_CMD=""
echo "WARNING: neither gtimeout nor timeout found. Running without timeout."
fi
${TIMEOUT_CMD:+$TIMEOUT_CMD} ${TIMEOUT_CMD:+1500} node "$CODEX_COMPANION" task \
"<translation prompt>" \
> "$LOGDIR/${DATETIME}-codex-translation-draft.md" \
2>"$LOGDIR/${DATETIME}-codex-translation-draft-stderr.log"
Timeout: 25 minutes.
After codex completes (or times out), check output files for rate limit errors:
node $HOME/.claude/scripts/codex-rate-limit.js check-output \
"$LOGDIR/${DATETIME}-codex-translation-draft.md" \
"$LOGDIR/${DATETIME}-codex-translation-draft-stderr.log"
If exit code is non-zero (rate limit detected), jump to Fallback.
If codex times out, produces no output, or is rate-limited:
text-fixer subagent (or general-purpose subagent) with model: opus to perform the translation. Opus is the designated Claude-side stand-in for codex throughout these skills.Important: Claude Code does all file writing. Codex only drafts.
Present the translation to the user. Include the draft log path.
model: opus)model: opus (text-fixer or general-purpose). NEVER pause the workflow, NEVER report the rate limit to the user, NEVER ask what to do. Opus is the designated Claude-side stand-in for codex throughout these skillsnpx claudepluginhub takazudo/claude-resources --plugin claude-resourcesTranslates text, docs, comments, or UI strings between languages using GitHub Copilot CLI (free GPT-4.1 tier) with Claude Code review. Automatically falls back to Claude Code if Copilot is rate-limited.
Delegates complex code generation, refactoring, architectural analysis, and review tasks to OpenAI's Codex CLI (GPT-5.3-codex models) via safe workflows with sandboxing and approvals. Activates on explicit triggers like 'use codex' or 'codex exec'.
Delegates coding tasks (debug, implement, refactor) to OpenAI Codex CLI via codex exec, skipping the Node companion runtime for faster execution. Codex writes code; Claude verifies.