Agent skill
manage-codex
Autonomous Codex batch orchestrator. Use for "/manage-codex", "manage codex", "use codex", "dispatch to codex", or long-running Codex work.
Install this agent skill to your Project
npx add-skill https://github.com/petekp/claude-code-setup/tree/main/skills/manage-codex
SKILL.md
Manage Codex
You are the orchestrator. Codex workers implement, review, and converge. Delegate the work unless a tiny orchestration-only fix is lower risk than dispatching a worker.
Loop:
plan -> implement -> review -> convergereview reject -> re-implement -> re-review
Done only when the convergence worker says COMPLETE AND HARDENED.
Principles
- Orchestrator owns planning, dispatch, artifact reads, and
{relay_root}/batch.json - Workers never edit
batch.json - Implementation and review always run in separate sessions
- Review and convergence workers diagnose only; they do not fix code
- Use
./scripts/relay/update-batch.sh --root {relay_root}; never hand-edit relay state - All relay paths thread through
--root; standalone default is--root .relay - Spot-check at least one claimed command before trusting a worker handoff
- Preserve
--skills, repeated--verification, and--criteriaon follow-up slices
Setup
which codex && codex --version- Determine relay root: use
--rootfrom caller if provided, otherwise.relay mkdir -p {relay_root}/archive {relay_root}/handoffs {relay_root}/last-messages {relay_root}/review-findings- If
AGENTS.mdis missing, create it fromreferences/agents-md-template.md
Plan
Read the task, CHARTER.md, and SLICES.yaml if present. Write {relay_root}/batch.json
with:
- batch fields:
batch_id,charter,branch,head_at_plan,max_attempts_per_slice,max_total_attempts_per_slice,max_convergence_attempts,convergence_attempts - one record per slice:
id,type,task,file_scope,domain_skills,verification_commands,success_criteria,status,impl_attempts,review_rejections
Slice types:
implement: worker writes code, then reviewreview: audit existing code, then create fix slices if neededconverge: final assessment
Write state to disk on every phase transition. The orchestrator is the only writer.
Prompt Assembly
Write only the task-specific header. Use
scripts/relay/compose-prompt.sh --header ... --skills ... --template ... --root {relay_root} --out ...
to append domain skills, the selected template, and substitute relay root paths.
implementslices:--template implement- worker review:
--template review reviewslices:--template ship-review- convergence:
--template converge
Templates own worker instructions and handoff format.
Implement
Skip this phase for review slices.
- Compose the prompt and dispatch:
cat {relay_root}/prompt.md | codex exec --full-auto -o {relay_root}/last-messages/last-message-{slice_id}.txt - - Verify output exists using explicit checks — never zsh globs or
||chains:test -f {relay_root}/handoffs/handoff-{slice_id}.md && wc -l {relay_root}/handoffs/handoff-{slice_id}.mdIf the file is missing, check the codex output trace forfile updatediffs before concluding the worker failed. The trace is the definitive record. - Read
{relay_root}/handoffs/handoff-{slice_id}.md; fall back to{relay_root}/last-messages/last-message-{slice_id}.txt - Spot-check one critical claimed command
- Record
impl_dispatchedwithupdate-batch.sh --root {relay_root}, the handoff path, and a one-line summary - Move to review
Review
- Compose the review prompt and dispatch
- Verify outputs exist using explicit checks:
test -f {relay_root}/review-findings/review-findings-{slice_id}.md && wc -l {relay_root}/review-findings/review-findings-{slice_id}.mdIf missing, check the codex output trace forfile updatediffs before re-dispatching. - Read
{relay_root}/review-findings/review-findings-{slice_id}.mdand parse### VERDICT - Cross-check that
{relay_root}/handoffs/handoff-{slice_id}.mdechoes the same verdict - Use:
review_cleanforCLEANreview_rejectedforISSUES FOUNDonimplementslices
- For
reviewslices withISSUES FOUND, add one or more fix slices with full metadata:--skills, repeated--verification,--criteria - Enforce slice attempt limits and circuit breakers before looping
Converge
Enter only when all non-converge slices are done.
- Compose the convergence prompt with the mission, slice summaries, and union of verification commands
- Dispatch and read
{relay_root}/handoffs/handoff-converge.md - If verdict is
COMPLETE AND HARDENED, recordconverge_complete - If verdict is
ISSUES REMAIN, recordconverge_failed, add fix slices with full metadata, and loop unless the convergence max is exceeded - If the handoff marks items
SANDBOX_LIMITED, rerun those commands outside the sandbox before giving the user a final verdict
Sandbox Notes
- Expect permission failures around TCP or UDP bind,
sandbox-exec, and some manifest or filesystem access - Mark these
SANDBOX_LIMITED; do not confuse them with real product failures - Real failures still block review and convergence
Direct Resolution Events
Use only via ./scripts/relay/update-batch.sh.
analytically_resolved: closed by inspection; no code change needed. Put the evidence in--summaryorchestrator_direct: orchestrator makes a narrow low-risk fix directly. Run relevant verification and summarize what changed in--summary
Never use these to skip review, hide failed attempts, or avoid verification.
Circuit Breaker
Escalate to the user when any slice hits impl_attempts > 3 or
impl_attempts + review_rejections > 5. Include: counter values, failure output, the
failure pattern, and options (adjust scope, skip, raise limit, abort).
Resume
If {relay_root}/batch.json exists, compare head_at_plan with git rev-parse HEAD.
Match → resume from the first pending slice. Mismatch → warn the user.
Run ./scripts/relay/update-batch.sh --root {relay_root} --validate after resuming.
Never restart completed slices.
User Briefing
One-line status between phases. Full briefing only for escalations or batch completion.
Verification Boundary
Workers may run ./scripts/verify/verify.sh. Workers must never modify .verifier/ files.
Offer verification evolution only after human approval of the converged batch.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
ubiquitous-language
Extract a DDD-style ubiquitous language glossary from the current conversation, flagging ambiguities and proposing canonical terms. Saves to UBIQUITOUS_LANGUAGE.md. Use when user wants to define domain terms, build a glossary, harden terminology, create a ubiquitous language, or mentions "domain model" or "DDD".
every-style-editor
This skill should be used when reviewing or editing copy to ensure adherence to Every's style guide. It provides a systematic line-by-line review process for grammar, punctuation, mechanics, and style guide compliance.
seo-audit
When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," or "indexing issues." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema-markup. For AI search optimization, see ai-seo.
capture-learning
Analyze recent conversation context and capture learnings to project knowledge files (for project-specific insights) or skills/commands/subagents (for cross-project patterns). Use when the user asks to "capture this learning", "update the docs with this", "remember this for next time", "document this issue", "add this to CLAUDE.md", "save this knowledge", or "update project knowledge". Also triggers after resolving build/setup issues, discovering non-obvious patterns, or completing debugging sessions with valuable insights.
agent-changelog
Compile an agent-optimized changelog by cross-referencing git history with plans and documentation. Use when asked to "update changelog", "compile history", "document project evolution", or proactively after major milestones, architectural changes, or when stale/deprecated information is detected that could confuse coding agents.
swift-apps
Build, refactor, review, and debug native Apple-platform software in Swift. Use when working on `.swift` files, SwiftUI views, Observation-based state, `@Bindable` and binding flow, SwiftData-backed UI, scenes and windows, search/navigation structures, UIKit/AppKit interop, Liquid Glass adoption, macOS-native UX, or SwiftUI performance/accessibility. Trigger on requests to create or polish iOS, iPadOS, macOS, or visionOS features; clean up SwiftUI view structure; diagnose jank or invalidation storms; review app quality; or make a feature feel like a good Apple-platform citizen.
Didn't find tool you were looking for?