Orchestrates a triple-AI engineering loop where Claude plans, Codex validates logic and reviews code, and Cursor implements, with continuous feedback for optimal code quality
This skill implements a 3-way sequential validation engineering loop:
AskUserQuestion):
gpt-5 or gpt-5-codexlow, medium, or highecho "Review this implementation plan and identify any issues:
[Claude's plan here]
Check for:
- Logic errors
- Missing edge cases
- Architecture flaws
- Security concerns" | codex exec -m <model> --config model_reasoning_effort="<effort>" --sandbox read-onlyIf Codex finds issues in the plan:
AskUserQuestion): "Should I revise the plan and re-validate, or proceed with implementation?"Once the plan is validated by Codex:
Ask user (via AskUserQuestion): "Do you want to start a new Cursor session or resume an existing one?"
If resuming:
# Note: cursor-agent ls requires interactive mode and may not work in --print mode
# Alternative: Ask user for chat ID from their previous session
# Or use: cursor-agent resume (resumes latest session without ID)
# Store session ID for subsequent callsAskUserQuestion): Which Cursor model to use
sonnet-4, sonnet-4-thinking, gpt-5, gpt-4o, composer-1sonnet-4 for balanced performance, sonnet-4-thinking for complex reasoningFor new session:
cursor-agent --model "<model-name>" -p --force --output-format json --approve-mcps "Implement this plan:
[Validated plan here]
Please implement the code following these specifications exactly."For resumed session (with chat ID):
cursor-agent --resume <chat-id> --model "<model-name>" -p --force --output-format json "Continue implementation:
[Validated plan here]"For resumed session (latest chat):
cursor-agent resume --model "<model-name>" -p --force --output-format json "Continue implementation:
[Validated plan here]"Useful options:
--output-format json: Structured output for parsing (recommended for automation)--approve-mcps: Auto-approve MCP servers (useful in headless mode)--stream-partial-output: Real-time progress monitoring (use with --output-format stream-json)--browser: Enable browser automation if neededAfter Cursor implements:
echo "Review this implementation for:
- Bugs and logic errors
- Performance issues
- Security vulnerabilities
- Best practices violations
- Code quality concerns
Files modified: [list of files]
Implementation summary: [what Cursor did]" | codex exec --sandbox read-onlyAfter Codex code review:
If issues are found (by Codex or Claude):
# IMPORTANT: Use --resume with the stored session ID
cursor-agent --resume <chat-id> --model "<model-name>" -p --force --output-format json "Fix these issues:
[Detailed fix plan]
Issues from Codex: [list]
Issues from Claude: [list]"
# Or resume latest session:
cursor-agent resume --model "<model-name>" -p --force --output-format json "Fix these issues..."--resume <chat-id> with same session ID for iterative fixescursor-agent resume to resume latest session (no ID needed)cursor-agent ls requires interactive mode (may not work in scripts)--output-format json for structured, parseable output--stream-partial-output with stream-json for real-time progress| Phase | Who | Command Pattern | Purpose |
|---|---|---|---|
| 1. Plan | Claude | TodoWrite, Read, analysis tools | Claude creates detailed plan |
| 2. Validate plan | Codex | echo "plan" | codex exec -m <model> --config model_reasoning_effort="<effort>" --sandbox read-only | Codex validates logic/security |
| 3. Refine | Claude | Analyze Codex feedback, update plan | Claude fixes plan issues |
| 4. Session setup | Claude + User | Ask new/resume, ask for chat ID if resuming | Setup or resume Cursor session |
| 5. Implement | Cursor | New: cursor-agent --model "<model>" -p --force --output-format json --approve-mcps "prompt" <br> Resume: cursor-agent --resume <chat-id> --model "<model>" -p --force --output-format json "prompt" <br> Latest: cursor-agent resume -p --force --output-format json "prompt" | Cursor implements validated plan |
| 6. Review code | Codex | echo "review" | codex exec --sandbox read-only | Codex reviews for bugs/performance |
| 7. Final review | Claude | Read tool, analysis | Claude final architectural check |
| 8. Fix plan | Claude | Create detailed fix plan | Claude plans fixes from all feedback |
| 9. Apply fixes | Cursor | cursor-agent --resume <chat-id> --model "<model>" -p --force --output-format json "fixes" OR cursor-agent resume -p --force --output-format json "fixes" | Cursor implements fixes in same session |
| 10. Re-review | Codex + Claude | Repeat phases 6-7 | Validate fixes until perfect |
--model <model>: Choose AI model (sonnet-4, sonnet-4-thinking, gpt-5, gpt-4o, composer-1)-p, --print: Print mode for scripts (headless, non-interactive)-f, --force: Auto-approve commands unless explicitly denied--output-format <format>: Output format (text | json | stream-json)--stream-partial-output: Stream partial output as deltas (with stream-json)--approve-mcps: Auto-approve all MCP servers (headless mode only)--browser: Enable browser automation support--resume [chatId]: Resume specific chat or latest if no ID providedcursor-agent create-chat: Create new empty chat and return IDcursor-agent resume: Resume latest chat session (no ID needed)cursor-agent --resume <chat-id>: Resume specific chat by IDcursor-agent ls: List sessions (requires interactive mode, not for scripts)For automation/scripts: --output-format json
For real-time monitoring: --output-format stream-json --stream-partial-output
For human review: --output-format text (default)
AskUserQuestion if:
--output-format json, parse the output to extract:
1. Plan (Claude)
↓
2. Validate Plan (Codex) → if issues → refine plan → repeat
↓
3. Implement (Cursor)
↓
4. Code Review (Codex) → captures bugs/performance issues
↓
5. Final Review (Claude) → architectural check
↓
6. Issues found? → Fix Plan (Claude) → Implement Fixes (Cursor) → back to step 4
↓
7. All passed? → Done! ✅This creates a triple-validation, self-correcting, high-quality engineering system where:
1be5394
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.