Source profileQuality 91/100

nexus-substrate/nexus-agents/skills/codex-delegator/SKILL.md

codex-delegator

Delegate code generation tasks to Codex CLI for optimal performance. Use when implementing features, generating tests, refactoring code, or making bulk code changes. Triggers on "delegate to codex", "route to codex", "use codex", "code generation".

Source repository stars
18
Declared platforms
1
Static risk flags
0
Last source update
2026-08-25
Source checked
2026-08-25

Decision brief

What it does: where it fits

Delegate code generation tasks to Codex CLI for optimal performance. Triggers on "delegate to codex", "route to codex", "use codex", "code generation".

Best for

  • Do NOT use for: Architecture decisions, security review, documentation-heavy tasks.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexDeclaredSource recordInstall path and trigger
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/nexus-substrate/nexus-agents --skill "skills/codex-delegator"
Safe inspection promptEditorial

Inspect the Agent Skill "codex-delegator" from https://github.com/nexus-substrate/nexus-agents/blob/d7d6eeb0b286dd38ab8ede233a47d92326399097/skills/codex-delegator/SKILL.md at commit d7d6eeb0b286dd38ab8ede233a47d92326399097. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Verification checklist

    [ ] Routing decision made via CompositeRouter.route() — no direct adapter instantiation

    [ ] Routing decision made via CompositeRouter.route() — no direct adapter instantiation[ ] Timeout set appropriate to task complexity (see CLAUDE.md complexity tier table)[ ] Failure mode tested — fallback CLI fires on rate-limit / connection-error
  2. 02

    Real-World Performance (Tested 2026-01-18)

    Review the “Real-World Performance (Tested 2026-01-18)” section in the pinned source before continuing.

    Review and apply the “Real-World Performance (Tested 2026-01-18)” source section.
  3. 03

    When to Use Codex

    Do NOT use for: Architecture decisions, security review, documentation-heavy tasks.

    Do NOT use for: Architecture decisions, security review, documentation-heavy tasks.
  4. 04

    Delegation Methods

    Use the delegatetomodel MCP tool for intelligent routing:

    Task contains code generation keywords ("implement", "write", "create")Task is primarily code-focused (low reasoning complexity)Budget constraints favor Codex cost efficiency
  5. 05

    Method 1: MCP Tool (Recommended)

    Use the delegatetomodel MCP tool for intelligent routing:

    Task contains code generation keywords ("implement", "write", "create")Task is primarily code-focused (low reasoning complexity)Budget constraints favor Codex cost efficiency

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score91/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars18SourceRepository attention, not individual Skill quality
Compatibility1 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
nexus-substrate/nexus-agents
Skill path
skills/codex-delegator/SKILL.md
Commit
d7d6eeb0b286dd38ab8ede233a47d92326399097
License
MIT
Collected
2026-08-25
Default branch
main
View the original SKILL.md

Codex Delegator Skill

Full documentation:

Real-World Performance (Tested 2026-01-18)

MetricValueNotes
Model versiongpt-5.2-codexLatest research preview
Latency (simple)3-4 secondsSingle function generation
Latency (complex)5-6 secondsInterface + class boilerplate
Token overhead~900-1050 per sessionFixed session initialization cost
Default sandboxread-onlySafe for code generation
Code qualityProduction-readyProper generics, types, error handling

When to Use Codex

Codex excels at:

Task TypeExamples
Code GenerationImplement functions, create classes, add features
Test GenerationWrite unit tests, integration tests, test fixtures
RefactoringExtract methods, rename variables, restructure
Code CompletionComplete partial implementations, fill in stubs
Bulk Code ChangesApply patterns across multiple files

Do NOT use for: Architecture decisions, security review, documentation-heavy tasks.

Delegation Methods

Method 1: MCP Tool (Recommended)

Use the delegate_to_model MCP tool for intelligent routing:

delegate_to_model(task: "Implement a binary search function in TypeScript")

The CompositeRouter automatically routes to Codex when:

  • Task contains code generation keywords ("implement", "write", "create")
  • Task is primarily code-focused (low reasoning complexity)
  • Budget constraints favor Codex cost efficiency

Method 2: Direct CLI Execution

For explicit Codex invocation, use codex exec for non-interactive mode:

# Basic code generation (non-interactive)
codex exec "Implement a binary search function in TypeScript"

# Via nexus-agents CLI
nexus-agents orchestrate "Implement sorting algorithm" --cli=codex

# Explicit model selection (default is gpt-5.2-codex)
codex exec -m gpt-5.2-codex "Implement a debounce function"

# Full autonomous mode (dangerous - writes files)
codex exec --full-auto "Add error handling to all functions in utils.ts"

Important: Use codex exec NOT codex -p. The -p flag is for interactive sessions.

Method 3: Routing Audit

Check routing decisions before execution:

nexus-agents routing-audit "Implement authentication middleware" --format=json

Task Profiling

The router analyzes tasks using these signals:

SignalBoost Codex When
codeGenerationKeywords: implement, write, create
reasoningSimpleNo "design", "architect", "analyze"
budgetSensitiveKeywords: quick, simple, straightforward
technicalContextReferences to APIs, frameworks, libs

Examples

Generate Unit Tests

delegate_to_model(task: "Write Jest tests for the UserService class covering:
- createUser with valid input
- createUser with invalid email
- getUserById with existing user
- getUserById with non-existent user")

Implement Feature

delegate_to_model(task: "Implement a rate limiter middleware for Express.js that:
- Uses sliding window algorithm
- Supports configurable limits per route
- Returns 429 status when limit exceeded")

Refactor Code

delegate_to_model(task: "Refactor the payment processing module to:
- Extract validation logic into separate functions
- Replace callbacks with async/await
- Add TypeScript types for all parameters")

Bulk Changes

delegate_to_model(task: "Add JSDoc comments to all exported functions in src/utils/")

Routing Decision Flow

Task Input
    |
    v
TaskAnalyzer (profile task)
    |
    v
BudgetRouter (filter by constraints)
    |
    v
TopsisRouter (rank: quality 50%, cost 30%, latency 20%)
    |
    v
LinUCBBandit (contextual learning)
    |
    v
Codex selected if: high codeGeneration + low reasoningComplexity

Codex Capabilities

CapabilityScoreNotes
Code Generation0.95Primary strength
Context Window400KLarge file support
Cost EfficiencyHighLower than Claude for code tasks
Latency3-6sFast for focused code tasks

Best Practices (From Real Testing)

  1. Be explicit in prompts - Include "Just output the function/code, no explanation" for cleaner output
  2. Batch related requests - Session overhead is ~900 tokens, batch similar generations
  3. Validate generated code - Run tsc --noEmit on TypeScript before integration
  4. Set appropriate timeouts - Use 90s timeout for complex generations
  5. Handle ambiguity - Codex asks clarifying questions for ambiguous prompts (graceful)

Fallback Behavior

If Codex is unavailable:

  1. Circuit breaker detects failure
  2. Router falls back to Claude or Gemini
  3. Task executes with alternative CLI
  4. Outcome recorded for learning

Configuration

# nexus-agents.yaml
routing:
  enableTopsisRanking: true
  enableLinUCBSelection: true

  topsis:
    qualityWeight: 0.5
    costWeight: 0.3
    latencyWeight: 0.2

Debugging

# Check Codex availability
nexus-agents doctor

# View routing decision for task
nexus-agents routing-audit "task description" --verbose

# Show bandit learning stats
nexus-agents routing-audit "task" --bandit-stats

Anti-rationalization — Codex delegation

ExcuseCounter
"Codex is fastest, always use it"Codex is fastest for code generation. For research/docs, Gemini wins on context; for design, Claude wins. Match the CLI to the task type.
"I'll route everything through Codex"Performance floors fire when one CLI is overweighted. Spread load per the routing system (CompositeRouter).
"Skip the model probe"Required after init (#1402). Without it, you may try to use a model the CLI doesn't expose.
"Codex failed, retry with same params"Transient retry already runs (#1531). If it failed twice, the failure is real — fall back to a different CLI per the routing chain.

Red flags

  • Direct adapter call bypassing UnifiedAdapterRegistry
  • No timeout set on the codex call
  • Codex used for tasks classified as research/documentation (better routed to Gemini)
  • Repeated rate-limit errors with no failover

Verification checklist

  • Routing decision made via CompositeRouter.route() — no direct adapter instantiation
  • Timeout set appropriate to task complexity (see CLAUDE.md complexity tier table)
  • Failure mode tested — fallback CLI fires on rate-limit / connection-error
  • Outcome recorded for adaptive routing (per CLAUDE.md routing changes)

Frequently asked questions

What to verify before installation and use

What does the codex-delegator source document cover?

Delegate code generation tasks to Codex CLI for optimal performance. Triggers on "delegate to codex", "route to codex", "use codex", "code generation".

How do I install codex-delegator?

The source record exposes this install command: npx skills add https://github.com/nexus-substrate/nexus-agents --skill "skills/codex-delegator". Inspect the command and pinned source before running it.

Which Agent platforms does the source record declare?

The pinned source record declares support for: codex.

Alternatives

Compare before choosing

Computed 9980

vasilyu1983/AI-Agents-public

qa-testing-ios

Guides iOS testing with XCTest, XCUITest, Swift Testing, simctl, and xcresult. Use when choosing destinations, controlling flakes, or parsing test artifacts for native apps.

Computed 973,066

samber/cc-skills-golang

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI, or debugging flaky/slow tests. For testify-specific APIs see `samber/cc-skills-golang@golang-stretchr-testify`; for measurement methodology see `samber/cc-skills-golang@golang-benchm

Computed 973,066

samber/cc-skills-golang

golang-troubleshooting

Troubleshoot Golang programs systematically - find and fix the root cause. Use when encountering bugs, crashes, deadlocks, or unexpected behavior in Go code. Covers debugging methodology, common Go pitfalls, test-driven debugging, pprof setup and capture, Delve debugger, race detection, GODEBUG tracing, and production debugging. Start here for any 'something is wrong' situation. Not for interpreting profiles or benchmarking (→ See `samber/cc-skills-golang@golang-benchmark` skill) or applying opt

Computed 973,066

samber/cc-skills-golang

golang-uber-fx

Golang application framework using uber-go/fx — fx.New, fx.Provide, fx.Invoke, fx.Module, fx.Lifecycle hooks, fx.Annotate (name/group/As), fx.Decorate, fx.Supply, fx.Replace, fx.WithLogger, and signal-aware Run(). Apply when using or adopting uber-go/fx, when the codebase imports `go.uber.org/fx`, or when wiring services with fx.New. For raw DI without lifecycle, see `samber/cc-skills-golang@golang-uber-dig` skill.