codex-orchestration

Orchestrate Codex CLI non-interactive runs with logging, retries, and failure classification.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/AoManoh/project_templates --skill codex-orchestration-aomanoh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codex-orchestration
Source: https://github.com/AoManoh/project_templates/tree/main/skills/codex-orchestration
Command: npx skills add https://github.com/AoManoh/project_templates --skill codex-orchestration-aomanoh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

It prevents Codex CLI runs from silently failing or losing evidence when prompts are large, quoting breaks, network timeouts occur, or outer schedulers terminate early.

Core Features & Use Cases

  • Prompt file first: Forces the prompt to be written to a file and piped via stdin to avoid shell escaping and quoting issues in long commands.
  • Deterministic execution + retry loop: Runs codex exec with per-attempt console/stderr logs and retries, then verifies exit code and non-empty raw output.
  • Failure classification + recoverability: Classifies failures into timeout/no-stream, timeout/partial-stream, network instability after retries, empty output, and generic execution errors; extracts session_id when available and provides a resume suggestion.

Use case: You need Codex to execute a long, non-interactive planning or coding task across projects while always producing retriable, auditable artifacts under docs/codex/.

Quick Start

Ask the AI to run Codex using the prompt file docs/codex/_inputs/codex-task.prompt.md with scope codex-task and to archive raw and failures under docs/codex/.

Frequently Asked Questions about codex-orchestration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Codex CLI non-interactively without losing output to shell quoting issues?

Running Codex CLI non-interactively without losing output requires piping a prompt file via stdin to avoid shell escaping issues. This method enforces deterministic execution with per-attempt console and stderr logging for auditable artifacts.

Why does my Codex exec task fail silently or drop evidence during network timeouts?

Codex exec tasks fail silently when network timeouts or early scheduler terminations occur without heartbeat monitoring. Classifying failures into timeout, no-stream, or partial-stream categories captures evidence and extracts session_id for resume-ready recovery.

Can I resume a Codex session after a generic execution error or empty output?

You can resume a Codex session after generic execution errors or empty output if a session_id was extracted. The orchestrator applies downgrade rules and provides resume suggestions to recover from classified failures like network instability.

What is the best way to automate cross-project Codex tasks with reliable retries?

The best way to automate cross-project Codex tasks with reliable retries is using a deterministic execution loop that verifies exit codes and non-empty raw output. This enforces prompt file existence and archives console and stderr artifacts under docs/codex/.

Does non-interactive Codex orchestration support timeout and heartbeat monitoring for long runs?

Non-interactive Codex orchestration supports timeout and heartbeat monitoring for long runs. It applies these monitoring rules to cross-project automation scenarios to prevent silent failures and ensure resume-ready session handling under docs/codex/.

When should I not use stdin prompt piping for Codex CLI execution?

You should not use stdin prompt piping for Codex CLI execution if your prompt file does not exist or cannot be verified. The orchestration enforces prompt file existence and non-empty raw outputs to satisfy output integrity requirements.