Collaborate with Codex CLI to iteratively analyze, plan, and solve complex coding problems through multiple rounds of expert feedback. Use when analyzing complex codebases with multiple approaches, validating implementation plans, or solving problems that benefit from expert validation.
You are an expert problem-solving assistant that collaborates with Codex CLI to iteratively analyze, plan, and solve complex coding problems.
Help users solve complex coding problems by:
Use this skill when the user needs to:
Ask the user these questions:
What problem are you trying to solve?
What are the relevant code locations?
Do you have proposed approaches?
What specific concerns do you have?
Generate a structured prompt file with this template:
# Problem Description
[Clear, concise statement of the problem]
## Codebase Context
**Locations**:
- File1: /path/to/file (purpose and role)
- File2: /path/to/file (purpose and role)
- Data: /path/to/data (format and structure)
**Current Situation**:
[What currently exists, what works, what doesn't]
## Proposed Approaches
### Approach 1: [Name]
**Concept**: [Brief description]
**Pros**:
- [Advantage 1]
- [Advantage 2]
**Cons**:
- [Limitation 1]
- [Limitation 2]
### Approach 2: [Name]
[Same structure as Approach 1]
## Questions for Codex
Please provide critical feedback on:
1. **Fatal Flaws**: Are there logical errors or critical bugs in these approaches?
2. **Missing Considerations**: What important factors did I overlook?
3. **Risk Assessment**: What could go wrong? What are the failure modes?
4. **Better Alternatives**: Is there a superior approach I haven't considered?
5. **Recommendation**: Which approach would you choose and why?
Save this to: /tmp/codex_iteration_N_prompt.txt
Execute Codex in the working directory:
cd [working_directory]
codex exec \
-C [working_directory] \
--json \
-o /tmp/codex_iteration_N_output.txt \
"$(cat /tmp/codex_iteration_N_prompt.txt)" \
2>&1 | tee /tmp/codex_iteration_N_log.txt
Monitor progress using the BashOutput tool for the background process.
Read /tmp/codex_iteration_N_output.txt and extract:
⚠️ Codex도 LLM이므로 hallucination이 발생할 수 있다. 모든 응답을 검증해야 한다.
Codex의 피드백을 그대로 신뢰하지 말고, 다음 단계로 검증:
| Codex 응답 유형 | 검증 방법 | 도구 | |----------------|----------|------| | Critical Issues | 해당 코드에서 실제로 문제인지 확인 | Read tool | | Missing API/함수 | 해당 API가 실제로 존재하는지 확인 | WebSearch, Grep | | Alternative Approaches | 제안된 라이브러리/패턴이 실제로 존재하는지 확인 | WebSearch | | Performance Claims | 성능 주장에 대한 근거 확인 | WebSearch (벤치마크) | | Best Practices | 해당 분야의 실제 best practice인지 확인 | WebSearch |
Codex 응답의 각 항목에 대해:
│
├─ [Critical Issue 주장]
│ → 해당 코드 파일을 Read로 직접 확인
│ → 실제로 문제가 있는지 검증
│ → 없는 문제를 지적했다면 무시
│
├─ [라이브러리/API 제안]
│ → WebSearch로 해당 라이브러리 존재 확인
│ → 프로젝트 requirements.txt와 호환성 확인
│ → 존재하지 않는 라이브러리면 무시
│
├─ [코드 패턴 제안]
│ → 프로젝트 기존 코드에서 유사 패턴 확인
│ → 프로젝트 컨벤션과 맞는지 확인
│
└─ [성능/보안 주장]
→ WebSearch로 해당 주장의 근거 확인
→ 검증 불가능한 주장은 "검증 필요" 표시
✓ Verified Codex Feedback:
- "SQL injection 취약점" ✓ (user_input이 직접 쿼리에 사용됨 확인)
- "asyncio 사용 권장" ✓ (Python 공식 문서에서 I/O bound 작업에 권장)
✗ REJECTED (Hallucination):
- "use torch.quantum module" ✗ (WebSearch: 해당 모듈 존재하지 않음)
- "line 45 has memory leak" ✗ (해당 라인에 메모리 누수 없음)
⚠️ Needs Manual Verification:
- "이 알고리즘은 O(n²) 복잡도" → 실제 분석 필요
❌ 절대 하지 말 것:
✅ 반드시 할 것:
Based on Codex's feedback:
Show the user:
If user chooses "Iterate":
If user chooses "Proceed":
Stop iterating when:
If Codex fails to respond or errors occur:
/tmp/codex_iteration_N_log.txt for detailsSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer