From claude-resources
Provides second opinion from OpenAI Codex CLI on development plans or approaches. Auto-invoked during planning phases of /x-as-pr and /x-wt-teams, or on triggers like 'codex 2nd' or 'second opinion'.
npx claudepluginhub takazudo/claude-resourcesThis skill is limited to using the following tools:
Get a second opinion from the codex plugin companion script on a plan, approach, or codebase exploration. Codex reads workspace files and does web research to provide an independent perspective.
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.
Get a second opinion from the codex plugin companion script on a plan, approach, or codebase exploration. Codex reads workspace files and does web research to provide an independent perspective.
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 — skipping second opinion" and continue without it.
Usage for second opinion tasks:
node "$CODEX_COMPANION" task "<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 entirely and silently continue without it. Do NOT report the rate limit to the user or pause the workflow.
Construct a prompt that includes:
You are reviewing a development plan. Provide a second opinion.
## Context
<what the project is, what repo we're in>
## Current Plan
<the plan or approach being considered>
## Questions
1. Are there any risks, edge cases, or issues with this approach?
2. Is there a simpler or better alternative?
3. Are there any files or areas of the codebase that should be considered but aren't mentioned?
4. Any other suggestions or concerns?
Be concise and practical. Focus on actionable feedback. If the plan looks solid, say so briefly — don't invent problems.
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 \
"<prompt>" \
> "$LOGDIR/${DATETIME}-codex-2nd.md" \
2>"$LOGDIR/${DATETIME}-codex-2nd-stderr.log"
Timeout: 15 minutes.
Check for rate limiting in output files:
node $HOME/.claude/scripts/codex-rate-limit.js check-output \
"$LOGDIR/${DATETIME}-codex-2nd.md" \
"$LOGDIR/${DATETIME}-codex-2nd-stderr.log"
If rate limit detected, silently skip — continue without the second opinion.
Read the output file
If empty or missing, check stderr log for errors
If codex timed out or failed, silently continue without it
Return the codex feedback to the caller. The caller decides whether to incorporate it into the plan.
No fallback needed. Unlike other codex skills, if codex fails here, just skip it — the plan proceeds without the second opinion. This is advisory, not critical.
These skills call /codex-2nd during their planning phase:
/codex-2nd with the updated plan (up to 3 iterations total)~ in paths — use $HOME