From claude-resources
Drafts documents via OpenAI Codex CLI then reviews and writes them with Claude Code. Falls back to Claude Code if Codex is unavailable or rate-limited.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-resources:codex-writerThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Draft documents via the codex plugin companion script, then review and write to files via Claude Code.
Draft documents via the codex plugin companion script, then review and write to files via 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 writing.
Usage for writing tasks:
node "$CODEX_COMPANION" task "<writing prompt>"
The task command runs Codex in read-only mode by default (no --write flag). Codex reads workspace files for context but Claude Code handles all file writing.
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.
Gather context about what needs to be written:
Build a detailed prompt including:
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 \
"<detailed prompt here>" \
> "$LOGDIR/${DATETIME}-codex-writer-draft.md" \
2>"$LOGDIR/${DATETIME}-codex-writer-draft-stderr.log"
Timeout: 25 minutes. Codex reads workspace files for context but cannot write.
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-writer-draft.md" \
"$LOGDIR/${DATETIME}-codex-writer-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:
markdown-writer subagent with model: opus to draft the document. Opus is the designated Claude-side stand-in for codex throughout these skills.Important: Claude Code always does the final file writing. Codex only provides a draft.
Tell the user what was written and where. Include the draft log path for reference.
markdown-writer subagent at model: opus)$LOGDIR/codex-writer-draft.mdmarkdown-writer subagent at model: opus. 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-resourcesWrites or updates documentation with code-verified accuracy for READMEs, guides, and API references. Use when creating, reviewing, or updating docs.
Translates text between languages using OpenAI Codex CLI with Claude Code reviewing and finalizing output. Falls back to Claude Code if Codex is unavailable.
Writes READMEs, API references, architecture docs, user guides, and inline comments for codebases, libraries, CLIs, APIs. Audits docs for accuracy, clarity, completeness.