From claude-resources
Translates code comments, documentation, and UI strings between languages like Japanese/English using OpenAI Codex CLI. Activates on 'translate' keywords or language requests; falls back to Claude if unavailable.
npx claudepluginhub takazudo/claude-resourcesThis skill is limited to using the following tools:
Translation via the codex plugin companion script, reviewed and finalized by Claude Code.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
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:+900} node "$CODEX_COMPANION" task \
"<translation prompt>" \
> "$LOGDIR/${DATETIME}-codex-translation-draft.md" \
2>"$LOGDIR/${DATETIME}-codex-translation-draft-stderr.log"
Timeout: 15 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:
Important: Claude Code does all file writing. Codex only drafts.
Present the translation to the user. Include the draft log path.