ワンクリックで
gpt-delegation
Use when blocked, stuck, or needing fresh perspective. Consults GPT experts via Codex CLI with graceful fallback.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when blocked, stuck, or needing fresh perspective. Consults GPT experts via Codex CLI with graceful fallback.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Coordinate specialized teammates in Agent Teams for execution, review, and planning. Delegate mode mandatory with TaskCompleted/TeammateIdle hooks.
Plan completion workflow - archive plan, verify todos, create git commit, push with retry. Use for finalizing completed plans.
Plan confirmation workflow - extract plan from conversation, create file, auto-review with Interactive Recovery. Use for confirming plans after /00_plan.
Plan execution workflow - parallel SC implementation, worktree mode, verification patterns, GPT delegation. Use for executing plans with TDD + Ralph Loop.
Coordinate independent teammates concurrently in Agent Teams for 50-70% speedup. Launch multiple teammates simultaneously.
Use after first code change. Autonomous iteration until all quality gates pass (max 7 iterations).
| name | gpt-delegation |
| description | Use when blocked, stuck, or needing fresh perspective. Consults GPT experts via Codex CLI with graceful fallback. |
Purpose: Intelligent Codex/GPT consultation for complex problems, escalation when stuck
# Graceful fallback + delegation (see CRITICAL WARNING below for valid parameters)
if ! command -v codex &> /dev/null; then
echo "Warning: Codex CLI not installed - falling back to Claude-only analysis"
return 0
fi
codex exec -m gpt-5.2 -s workspace-write -c reasoning_effort=medium --json "TASK: [goal]
EXPECTED: [outcome], CONTEXT: [attempts, errors, iteration], MUST: Analyze failures, fresh approach, report files"
MANDATORY: All GPT delegation points MUST include graceful fallback.
if ! command -v codex &> /dev/null; then
echo "Warning: Codex CLI not installed - falling back to Claude-only analysis"
return 0 # NOT an error, continue with Claude
fi
Key Points:
MANDATORY: Use EXACT values below - NO variations allowed
Valid -s modes: read-only | workspace-write | danger-full-access
FORBIDDEN: workspace-read, read-write, write (Claude often creates invalid combinations)
Valid -c value: reasoning_effort=medium ONLY (NOT high/low)
Required: -m gpt-5.2 --json "PROMPT"
| Trigger | Expert | Mode | When to Delegate |
|---|---|---|---|
| 2+ failed attempts | Architect | workspace-write | Progressive escalation |
| Stuck on task | Architect | workspace-write | Fresh perspective |
| Architecture decision | Architect | read-only | Design guidance |
| Security concern | Security Analyst | read-only | Vulnerability assessment |
| Ambiguous plan | Scope Analyst | read-only | Requirements clarification |
| Large plan (5+ SCs) | Plan Reviewer | read-only | Plan validation |
Formula:
confidence = 1.0 - (architecture_keywords * 0.3) - (multiple_approaches * 0.2) - (uncertainty_markers * 0.2)
Scale: 0.0 - 1.0
Thresholds:
Detection Patterns:
Principle: Delegate ONLY after 2nd failure, not first
Attempt 1 (Claude) → Fail
↓
Attempt 2 (Claude) → Fail
↓
Attempt 3 (GPT Architect) → Success
| Expert | Purpose | When | Mode | Output |
|---|---|---|---|---|
| Architect | Fresh perspective on implementation | 2+ failures, stuck, architecture | workspace-write | Root cause, fresh approach, files modified |
| Security Analyst | Vulnerability assessment | Security concerns, auth, sensitive data | read-only | OWASP findings, severity, fixes |
| Plan Reviewer | Plan validation | 5+ SCs, complex deps, high-risk | read-only | Quality (1-10), clarity, feasibility, risks |
| Scope Analyst | Requirements clarification | Ambiguous requirements, edge cases | read-only | Ambiguities, assumptions, acceptance criteria |
| Code Reviewer | Code quality assessment | Explicit review, quality concerns | read-only | Quality issues, violations, refactoring |
Pattern: Teammate calls GPT directly when blocked, shares results with Team Lead and other teammates via Message.
# After 2nd failure in Ralph Loop
if [ $iteration -ge 2 ] && [ $TEST_RESULT -ne 0 ]; then
PROMPT="TASK: Fix failing test ${TEST_NAME}
EXPECTED OUTCOME: All tests pass
CONTEXT: Previous attempts: ${ATTEMPT_SUMMARY}, Errors: $(cat /tmp/test.log | tail -20)"
codex exec -m gpt-5.2 -s workspace-write -c reasoning_effort=medium --json "$PROMPT"
# Share GPT recommendations with Team Lead
echo "Message to Team Lead: GPT Architect provided recommendations. Applying fixes..."
fi
Key Points:
# Large plan review
if [ $(echo "$PLAN" | grep -c "SC-") -ge 5 ]; then
PROMPT="Review plan: $PLAN (Clarity, Completeness, Feasibility, Dependencies, Risks)"
codex exec -m gpt-5.2 -s read-only -c reasoning_effort=medium --json "$PROMPT"
fi
Symptom: Warning message about Codex CLI not installed
Solution: Expected behavior. Skill gracefully falls back to Claude-only analysis.
Causes: 1) Trigger not met (< 2 failures) 2) Skill not loaded 3) Codex check failing
Debug: Check echo $iteration, verify grep -r "gpt-delegation" .claude/skills/, test command -v codex
Solution: Document previous attempts clearly with errors and stack traces.
Internal: @.claude/skills/gpt-delegation/REFERENCE.md - Complete prompt templates, integration examples, troubleshooting | @.claude/skills/ralph-loop/SKILL.md - Ralph Loop integration with GPT delegation
External: Codex Documentation