com um clique
Unified Codex command with auto-detection, intent routing, and quality gates
npx skills add https://github.com/merceralex397-collab/codex-claude-integration --skill codexCopie e cole este comando no Claude Code para instalar a skill
Unified Codex command with auto-detection, intent routing, and quality gates
npx skills add https://github.com/merceralex397-collab/codex-claude-integration --skill codexCopie e cole este comando no Claude Code para instalar a skill
| name | codex |
| description | Unified Codex command with auto-detection, intent routing, and quality gates |
| user-invocable | true |
| allowed-tools | ["mcp__codex__codex","mcp__codex__codex-reply","Bash","Read","Glob","Grep","Write","Task"] |
One command to rule them all. Auto-detects project context, routes by intent, iterates until green.
/codex <natural language task>
/codex implement a rate limiter for the API
/codex fix the auth bug and add tests
/codex review the payment module for security issues
/codex refactor UserService to use repository pattern
| Flag | Effect |
|---|---|
--no-iterate | Skip quality gates, just execute |
--gates=test,lint | Only run specified gates |
--model=<model> | Override model selection |
--reasoning=<level> | Override reasoning effort (low/medium/high/xhigh) |
--profile=<name> | Use specific profile (quick/standard/deep/review) |
--verbose | Show detailed output |
--quiet | Minimal output |
Load settings from ~/.claude/codex-settings.toml (if exists):
python scripts/settings_loader.py --json
This returns user's preferred defaults, gate configuration, and profile definitions. If no settings file exists, sensible defaults are used.
Run project detection (cached for session):
python scripts/project_dna.py --json
This returns framework, patterns, test commands, lint commands.
Run intent analysis on the user's prompt:
python scripts/task-analyzer.py "<user prompt>"
This returns JSON with:
intent.type: generate, debug, review, refactor, test, or chainintent.steps: ordered list of operations (for chain type)complexity: 1-5 scalecodex_params.profile: quick, standard, or deepcodex_params.model: gpt-5.1-codex-mini, gpt-5.2-codex, or gpt-5.1-codex-maxcodex_params.model_reasoning_effort: low, medium, high, or xhighBased on intent type, route to the appropriate subagent:
| Intent | Route To | Sandbox |
|---|---|---|
| generate, debug, refactor, test | codex-coder | workspace-write |
| review, analyze, audit | codex-reviewer | read-only |
| chain | Sequential execution | Depends on step |
For write operations (generate/debug/refactor/test): Use the Task tool to spawn a codex-coder agent:
Task tool with subagent_type: "codex-coder"
For read operations (review/analyze/audit): Use the Task tool to spawn a codex-reviewer agent:
Task tool with subagent_type: "codex-reviewer"
For direct execution (simple tasks or when agents unavailable): Continue with steps 5-7 below.
Combine DNA context with user's task:
PROJECT CONTEXT (auto-detected):
[DNA output here]
USER SETTINGS:
Model: [from settings or flag]
Reasoning: [from settings or flag]
TASK: [user's original prompt]
INSTRUCTIONS:
- Follow existing project patterns
- [Intent-specific instructions]
Start with the model based on complexity and user settings:
| Complexity | Profile | Model | Reasoning | Escalation |
|---|---|---|---|---|
| 1-2 | quick | gpt-5.1-codex-mini | low | -> standard |
| 3 | standard | gpt-5.2-codex | medium | -> deep |
| 4-5 | deep | gpt-5.1-codex-max | high/xhigh | (none) |
User settings override these defaults. Flag overrides take highest priority.
Call Codex:
Use mcp__codex__codex with:
- prompt: [enhanced prompt]
- cwd: "."
- model: [from settings/analysis]
- sandbox: [from intent - workspace-write or read-only]
- approval-policy: "never" (REQUIRED for MCP stdio)
If the response indicates struggle or failure, escalate to next model and retry.
For generate/debug/refactor/test intents, run quality gates based on user settings:
# Check which gates are enabled
python scripts/settings_loader.py --gates --json
# Run enabled gates
python scripts/quality_gates.py --gate test --command "<test command>" --json
python scripts/quality_gates.py --gate lint --command "<lint command>" --fix "<fix command>" --json
If a gate fails:
mcp__codex__codex-replyOn success:
Complete: [summary of changes]
- Files modified: [list]
- Tests: passing
- Lint: passing
On partial success:
Partially complete: [what was done]
- Remaining issue: [what's failing]
- Suggested fix: [recommendation]
For prompts like "fix X and add tests":
| Error | Response |
|---|---|
| DNA detection fails | Use defaults, warn user |
| Intent unclear | Ask clarifying question |
| Model unavailable | Fall back to available model |
| Gate max retries | Report blocker, suggest manual fix |
| Codex timeout | Offer retry with longer timeout |
| Settings load fails | Use built-in defaults, warn user |
| Command | Description |
|---|---|
/codex-config | View and modify settings |
/codex-coder <task> | Direct access to coding agent |
/codex-reviewer <target> | Direct access to review agent |
Old skills still work:
/codex-delegate X -> redirects to /codex implement X/codex-review X -> redirects to /codex review X