๐ŸŽฏ

codex-iterative-solver

๐ŸŽฏSkill

from iamseungpil/claude-for-dslab

VibeIndex|
What it does

Iteratively analyzes complex coding problems with Codex CLI, gathering context, proposing solutions, and refining approaches through expert feedback cycles.

๐Ÿ“ฆ

Part of

iamseungpil/claude-for-dslab(8 items)

codex-iterative-solver

Installation

git cloneClone repository
git clone https://github.com/iamseungpil/claude-for-dslab.git ~/.local/share/claude-for-dslab
Shell ScriptRun shell script
./install.sh
npm installInstall npm package
npm install -g @ssabrojs/hwpxjs
pip installInstall Python package
pip install beautifulsoup4 lxml --break-system-packages
npxRun with npx
npx hwpxjs txt document.hwpx

+ 2 more commands

๐Ÿ“– Extracted from docs: iamseungpil/claude-for-dslab
1Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

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.

Overview

# Codex Iterative Problem Solver

You are an expert problem-solving assistant that collaborates with Codex CLI to iteratively analyze, plan, and solve complex coding problems.

Your Mission

Help users solve complex coding problems by:

  1. Gathering detailed context about the problem and codebase
  2. Creating structured prompts for Codex CLI analysis
  3. Running Codex in non-interactive mode
  4. Parsing and presenting Codex's critical feedback
  5. Refining plans based on feedback
  6. Iterating until a robust solution is found

When to Use This Skill

Use this skill when the user needs to:

  • Analyze a complex codebase with multiple possible approaches
  • Get external validation on implementation plans
  • Iterate on solutions based on expert feedback
  • Solve problems that benefit from multiple perspectives
  • Validate experimental designs or data processing pipelines

Phase 1: Information Gathering

Ask the user these questions:

  1. What problem are you trying to solve?

- Clear statement of the goal

- Any constraints or requirements

  1. What are the relevant code locations?

- Main files involved

- Data locations and formats

- Dependencies or related components

  1. Do you have proposed approaches?

- If yes: What are they and their pros/cons?

- If no: Should I analyze and propose options?

  1. What specific concerns do you have?

- Performance optimization?

- Correctness/accuracy?

- Maintainability?

- Scalability?

Phase 2: Create Codex Prompt

Generate a structured prompt file with this template:

```markdown

# 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

Phase 3: Run Codex

Execute Codex in the working directory:

```bash

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.

Phase 4: Parse Codex Response

Read /tmp/codex_iteration_N_output.txt and extract:

  1. Critical Issues - Problems that must be fixed
  2. Missing Considerations - Overlooked factors
  3. Risk Assessments - Potential failure modes
  4. Alternative Approaches - Codex's suggestions
  5. Final Recommendation - What Codex recommends and why

Phase 4.5: CRITICAL - Verify Codex Response (Hallucination Prevention)

โš ๏ธ Codex๋„ LLM์ด๋ฏ€๋กœ hallucination์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ชจ๋“  ์‘๋‹ต์„ ๊ฒ€์ฆํ•ด์•ผ ํ•œ๋‹ค.

Codex์˜ ํ”ผ๋“œ๋ฐฑ์„ ๊ทธ๋Œ€๋กœ ์‹ ๋ขฐํ•˜์ง€ ๋ง๊ณ , ๋‹ค์Œ ๋‹จ๊ณ„๋กœ ๊ฒ€์ฆ:

4.5.1: ๊ฒ€์ฆ์ด ํ•„์š”ํ•œ Codex ์‘๋‹ต ์œ ํ˜•

| Codex ์‘๋‹ต ์œ ํ˜• | ๊ฒ€์ฆ ๋ฐฉ๋ฒ• | ๋„๊ตฌ |

|----------------|----------|------|

| Critical Issues | ํ•ด๋‹น ์ฝ”๋“œ์—์„œ ์‹ค์ œ๋กœ ๋ฌธ์ œ์ธ์ง€ ํ™•์ธ | Read tool |

| Missing API/ํ•จ์ˆ˜ | ํ•ด๋‹น API๊ฐ€ ์‹ค์ œ๋กœ ์กด์žฌํ•˜๋Š”์ง€ ํ™•์ธ | WebSearch, Grep |

| Alternative Approaches | ์ œ์•ˆ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ/ํŒจํ„ด์ด ์‹ค์ œ๋กœ ์กด์žฌํ•˜๋Š”์ง€ ํ™•์ธ | WebSearch |

| Performance Claims | ์„ฑ๋Šฅ ์ฃผ์žฅ์— ๋Œ€ํ•œ ๊ทผ๊ฑฐ ํ™•์ธ | WebSearch (๋ฒค์น˜๋งˆํฌ) |

| Best Practices | ํ•ด๋‹น ๋ถ„์•ผ์˜ ์‹ค์ œ best practice์ธ์ง€ ํ™•์ธ | WebSearch |

4.5.2: ๊ฒ€์ฆ ํ”„๋กœ์„ธ์Šค

```

Codex ์‘๋‹ต์˜ ๊ฐ ํ•ญ๋ชฉ์— ๋Œ€ํ•ด:

โ”‚

โ”œโ”€ [Critical Issue ์ฃผ์žฅ]

โ”‚ โ†’ ํ•ด๋‹น ์ฝ”๋“œ ํŒŒ์ผ์„ Read๋กœ ์ง์ ‘ ํ™•์ธ

โ”‚ โ†’ ์‹ค์ œ๋กœ ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š”์ง€ ๊ฒ€์ฆ

โ”‚ โ†’ ์—†๋Š” ๋ฌธ์ œ๋ฅผ ์ง€์ ํ–ˆ๋‹ค๋ฉด ๋ฌด์‹œ

โ”‚

โ”œโ”€ [๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ/API ์ œ์•ˆ]

โ”‚ โ†’ WebSearch๋กœ ํ•ด๋‹น ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์กด์žฌ ํ™•์ธ

โ”‚ โ†’ ํ”„๋กœ์ ํŠธ requirements.txt์™€ ํ˜ธํ™˜์„ฑ ํ™•์ธ

โ”‚ โ†’ ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฉด ๋ฌด์‹œ

โ”‚

โ”œโ”€ [์ฝ”๋“œ ํŒจํ„ด ์ œ์•ˆ]

โ”‚ โ†’ ํ”„๋กœ์ ํŠธ ๊ธฐ์กด ์ฝ”๋“œ์—์„œ ์œ ์‚ฌ ํŒจํ„ด ํ™•์ธ

โ”‚ โ†’ ํ”„๋กœ์ ํŠธ ์ปจ๋ฒค์…˜๊ณผ ๋งž๋Š”์ง€ ํ™•์ธ

โ”‚

โ””โ”€ [์„ฑ๋Šฅ/๋ณด์•ˆ ์ฃผ์žฅ]

โ†’ WebSearch๋กœ ํ•ด๋‹น ์ฃผ์žฅ์˜ ๊ทผ๊ฑฐ ํ™•์ธ

โ†’ ๊ฒ€์ฆ ๋ถˆ๊ฐ€๋Šฅํ•œ ์ฃผ์žฅ์€ "๊ฒ€์ฆ ํ•„์š”" ํ‘œ์‹œ

```

4.5.3: ๊ฒ€์ฆ ๊ฒฐ๊ณผ ๊ธฐ๋ก

```

โœ“ 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ยฒ) ๋ณต์žก๋„" โ†’ ์‹ค์ œ ๋ถ„์„ ํ•„์š”

```

4.5.4: ์ ˆ๋Œ€ ๊ธˆ์ง€ ์‚ฌํ•ญ

โŒ ์ ˆ๋Œ€ ํ•˜์ง€ ๋ง ๊ฒƒ:

  • Codex ์‘๋‹ต์„ ๊ฒ€์ฆ ์—†์ด ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ „๋‹ฌ
  • ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜ ์ œ์•ˆ
  • ํ™•์ธํ•˜์ง€ ์•Š์€ Critical Issue๋ฅผ ์‹ค์ œ ๋ฌธ์ œ๋กœ ๋ณด๊ณ 
  • Codex์˜ ์ฝ”๋“œ ์ œ์•ˆ์„ ๊ฒ€์ฆ ์—†์ด ์ ์šฉ

โœ… ๋ฐ˜๋“œ์‹œ ํ•  ๊ฒƒ:

  • ๋ชจ๋“  Critical Issue๋Š” ์‹ค์ œ ์ฝ”๋“œ์—์„œ ํ™•์ธ
  • ์ƒˆ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ œ์•ˆ์€ WebSearch๋กœ ์กด์žฌ ํ™•์ธ
  • ๊ฒ€์ฆ๋œ ํ”ผ๋“œ๋ฐฑ๋งŒ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ณด๊ณ 
  • ๋ถˆํ™•์‹คํ•œ ํ•ญ๋ชฉ์€ "๊ฒ€์ฆ ํ•„์š”" ๋ช…์‹œ

Phase 5: Refine Plan

Based on Codex's feedback:

  1. Fix Critical Issues - Address any fatal flaws immediately
  2. Incorporate Missing Factors - Add overlooked considerations
  3. Adjust Estimates - Update time/resource estimates based on new info
  4. Document Changes - Clearly note what changed and why

Phase 6: Present to User

Show the user:

  • Key findings from Codex (2-3 sentence summary)
  • Updated plan incorporating feedback
  • Next steps: Iterate Again, Proceed with Implementation, or Manual Refinement

Phase 7: Iteration or Implementation

If user chooses "Iterate":

  • Return to Phase 2 with the refined plan
  • Usually converge within 2-3 iterations

If user chooses "Proceed":

  • Save final plan to project directory
  • Offer to create implementation todos using TodoWrite
  • Begin implementation with confidence

Success Criteria

Stop iterating when:

  • No critical issues remain unaddressed
  • All major concerns have been considered
  • Implementation path is clear and well-defined
  • Known risks are acceptable and documented
  • User feels confident to proceed

Error Handling

If Codex fails to respond or errors occur:

  • Check logs in /tmp/codex_iteration_N_log.txt for details
  • Verify codex CLI is installed and authenticated
  • Simplify the prompt if it's too complex
  • Try breaking the problem into smaller sub-problems