Skip to content

architect — OpenAI Codex CLI

Plan complex Codex work as a policy-routed execution kit.

In practice

What it does

Turns a complex change into a durable execution kit while Astra owns planning, decomposition, dependencies, routing decisions, coordination, and final acceptance. Kit tasks express worker intent as cheap, mid, or strong; central policy resolves an available Luna, Terra, or Sol model when execution begins.

When to reach for it

  • Use it when several tasks need explicit ordering, integration decisions, or independent verification.
  • Use it when another agent should be able to resume from files instead of conversational history.
  • Not for a small edit whose scope, check, and owner are already obvious.

Worked example

python3 bin/codex_execute.py status --kit tasks/kits/<slug> --json
python3 bin/codex_execute.py run --kit tasks/kits/<slug> --task <id> --dry-run

The plan keeps Astra in the orchestration role and gives normal implementation to the cheapest sufficient worker.

Failure modes & fallbacks

If pricing, policy, or driver files cannot be proven, stop and use doctor. Legacy unpinned tasks safely resolve to the default worker; a legacy frontier pin migrates at dispatch to the strongest worker. Neither case rewrites kit history. Recovery remains unavailable until the driver records qualifying failure evidence.

Cost & safety

Creating the plan does not invoke codex exec. Real worker spend occurs later when codex_execute.py resolves a task and dispatches codex exec with the policy-selected model. Treat planned, dispatched, and observed identities as separate facts; an unattested runtime identity remains unknown.

  • execute runs and records the kit.
  • route previews worker assignment and estimates its burn.
  • doctor checks the installation without changing it.

The skill card — what the model reads

This is the SKILL.md body the model reads, transformed for this page: the source's own leading title, if it had one, is removed; every remaining heading is demoted one level to nest under this section; and relative links are rewritten to site or GitHub URLs. ${CLAUDE_PLUGIN_ROOT} and {{POLYTROPOS_ROOT}} are install-time path variables, left intact exactly as the model sees them. The unmodified original is codex/skills/architect/SKILL.md.

Resolve the plugin root before running commands

Resolve POLYTROPOS_ROOT from this skill's location. In a managed copy use POLYTROPOS_ROOT="{{POLYTROPOS_ROOT}}". Reject a literal placeholder. Confirm pricing data, bin/codex_pricing.py, bin/codex_policy.py, and bin/codex_execute.py exist. Otherwise run python3 bin/harness_select.py doctor --harness codex rather than guessing a path. Never invoke the real Codex CLI from a kit verify command.

Plan only. Write PLAN.md and TASKS.md beneath tasks/kits/<slug>/; do not dispatch implementation. Every task is self-contained, has a machine-checkable verify command, and uses exactly pending | in-progress | done | blocked.

This skill carries no model: pin: the desktop app supplies its own model, which application policy configures as Astra for orchestration. The model remains app-controlled while the kit is written.

Use worker intent in each task's model field: cheap for mechanical work, mid for routine work, and strong for hard implementation, security, integration, or independent verification. Do not pin the reserved orchestration tier or an orchestration model. Central policy resolves workers at dispatch time, migrates an unpinned legacy task to the configured default worker, and maps a legacy reserved-tier pin to the maximum worker. Availability, model identities, effort support, and cost facts come only from data and policy.

Plan Astra as coordinator: it owns decomposition, dependencies, recovery decisions, and final acceptance. It is not an ordinary worker and the CLI has no warm pool. A recovery target is created only after recorded worker attempts and a machine-checkable failure; vague dissatisfaction never unlocks it. After correction, schedule remaining work back to workers.

Use Luna for cheap mechanical work, Terra for routine implementation, and Sol for hard, security, integration, or independent verification work. Keep final acceptance separate from independent verification. Record a per-request size assumption for long-context work; do not use aggregate session tokens as a request-size estimate.

Preview assignments before handoff:

python3 "$POLYTROPOS_ROOT/bin/codex_execute.py" status --kit tasks/kits/<slug> --json
python3 "$POLYTROPOS_ROOT/bin/codex_execute.py" run --kit tasks/kits/<slug> --task <id> --dry-run

Planned, dispatched, and observed model-role facts are different records. An unobserved runtime identity remains unknown. Later, bin/codex_execute.py resolves each worker task and passes the selected id as codex exec --model <id>; that execution step is separate from planning.

Optional context travel

When an explicit repository/kit/assignment and authorized startup config are supplied, use the native context-travel skill and read {{POLYTROPOS_ROOT}}/docs/CONTEXT-TRAVEL-SURFACES.md on demand for a bounded planning brief. Treat missing, stale, partial, or refused context as advisory; retain this workflow's authoritative sources, policy, pricing, permission, and mandatory verification rules. If no authorized context transport is available, continue this workflow and report context unavailable.