codex-issue-waves/SKILL.md
Run a batch of GitHub issues through codex exec in isolated git worktrees as parallel autonomous PRs, then manage the review and correction waves until merge. Use when the user gives a list of issue numbers (≥ 2) and asks to "spawn codex" / "dispatch codex" / "have codex work on" / "manage the PRs" / "process feedback" / "get them merged" for those issues, or when the user asks for multi-issue parallel delegation to codex. Not for single-issue wave-driven delegation (use codex-task-waves), single-issue one-shot dispatch (use invoking-codex-exec), or implementation without delegation (use /pr or direct implementation).
npx skillsauth add ddnetters/homelab-agent-skills codex-issue-wavesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run GitHub issues through codex exec in isolated worktrees, then shepherd the resulting PRs through review and merge. Four phases: dispatch → monitor → review wave → correction wave.
Orchestration model. Claude is the PO / engineering manager. Codex is the worker — implementer per worktree (parallel across worktrees), reviewer per worktree (parallel across worktrees, sequential after the implementer finishes its worktree), and corrector when fixes are needed. Claude never edits source files, never reads diffs for judgment, never runs in-place fixes. Every code touch — build, review, correction — goes through a codex dispatch. See invoking-codex-exec "Codex roles" and "Orchestrator boundaries" for the full rule.
Triggered by requests like:
Not for: single-issue work (implement directly or use /pr), or batches where codex CLI isn't available on the host.
Before creating any worktree, surface conflicts between issues in the batch. Don't just fan out blindly.
Run through this checklist for every pair of issues:
edit_suggestions[] with claim_verdicts[]; another adds a feature on top of edit_suggestions[]. Flag before dispatch.005-*.md). Decide the ordering upfront; the later one bumps on merge.Always pause here and surface findings to the user with a concrete proposal ("combine these two, skip the umbrella, run the rest in parallel"). Do not proceed silently. Only after user confirms, continue.
REQUIRED SUB-SKILL: Use invoking-codex-exec for the codex launch mechanics — flags, sandbox traps, monitoring, kill-and-recover. This skill does not duplicate that content; it covers only the multi-issue orchestration on top.
For each (possibly combined) issue to dispatch:
.worktrees/issue-<number>-<slug> and branch feat/<slug> / refactor/<slug> / fix/<slug> depending on the issue type.references/prompt-template.md for the shape — the prompt is the single most important artifact in this workflow.invoking-codex-exec, redirecting output to /tmp/codex-runs/<n>.out.See references/common-commands.md for the exact shell recipes (worktree creation, issue fetch, codex launch).
Schedule a wakeup to check back (~10–15 min for moderate refactors, ~5 min for trivial changes, ~20 min for big architectural work). Do not sleep-poll in bash. If multiple runs are outstanding, schedule a single aggregated wakeup, not one per run.
When a codex run finishes, immediately check:
pull/<N> URL? If not, codex aborted partway — tail the output to find out why.gh pr view <N> --json statusCheckRollup,mergeable,mergeStateStatus.<<<<<<< / ======= markers while it resolves conflicts. These are transient. Always verify against gh pr diff <N> before reporting "conflict markers in committed code."If multiple codex runs are still outstanding, reschedule a single aggregated wakeup; do not schedule one per run.
Treat every codex-produced PR as untrusted. Trust-but-verify — through codex, not by hand.
For each PR:
PR existence check (status, not review) — claude runs:
gh pr view <N> --json statusCheckRollup,mergeable,mergeStateStatus,headRefOid — does the PR exist, is CI green, is it mergeable?git log --oneline origin/main..origin/<branch> — does the branch have a sane shape (no ghost/lost commits)?git diff origin/main...origin/<branch> --stat — what's the blast radius (file count, line count) so claude knows whether to expect a "5-line tweak" review verdict or a "120-file refactor" review?These are status operations: they answer existence/state questions, not "is the code good." Reading the diff itself for judgment goes to the reviewer codex.
Reviewer dispatch (parallel across worktrees) — for each PR/worktree, dispatch invoking-codex-exec in reviewer role. Fire all reviewer codexes together (one process per worktree, parallel). Each reviewer codex receives:
## Scope block as the implementer.git diff origin/main...origin/<branch>, fenced as ## Artifact under review with the prompt-injection-defuse line (see invoking-codex-exec "Prompt shape — reviewer role").CLAUDE.md, AGENTS.md.## Scope block — files or behaviors outside In scope (or explicitly listed Out of scope) are scope-creep, flag as Blocking. Decisions that contradict resolved Open questions are Blocking.INSERT ... ON CONFLICT DO UPDATE for upserts.--no-verify; no TODO/FIXME/console.log slop.<worktree>/.codex-review-output.json. The orchestrator enforces read-only via the snapshot recipe in invoking-codex-exec.Concurrency notes for parallel review:
codex exec process with its own log file (/tmp/codex-review-<PR-N>.log). Wait by PID, same as implementer dispatches. Schedule a single aggregated wakeup if multiple reviewers are still in flight, not one wakeup per reviewer.Read all review outputs and decide per PR — once every reviewer has exited:
.codex-review-output.json is parseable. Malformed → handle per invoking-codex-exec "When the JSON is malformed".invoking-codex-exec "Read-only enforcement".verdict: approved and empty blocking/scope_violations → eligible for merge (still subject to the merge-order decision below).blocking or scope_violations → schedule a corrector dispatch for that PR.should_fix or nits → claude decides per item: address now via corrector, or defer to PR comment with reasoning. nits default to deferral.scope_violations against the issue body (NOT the diff). Reviewer codex sometimes flags a feature as scope-creep when it was actually requested in the issue. Read the issue body — that is a status read, not a code review.Every blocker → corrector dispatch via invoking-codex-exec (corrector role). No in-place fixes by claude. No "small fix" path. Even one-line typos go through codex.
For each PR with blockers:
references/prompt-template.md. Include:
.codex-review-output.json.blocking ∪ chosen should_fix ∪ scope_violations).## Scope block whose In scope is exactly those items and whose Out of scope is "everything else, including all nits and any item the orchestrator deferred".git log --oneline origin/main..origin/<branch> to confirm a fixup commit landed.git push --force-with-lease if the corrector rebased; otherwise plain push. Claude runs the push command directly — pushing is status, not code work.scripts/wait_for_ci.sh <PR> — run through the harness's background-command mechanism so the exit event wakes the agent; do not inline-poll in bash.verdict: approved, escalate to user. The plan or the issue itself is likely wrong — don't loop indefinitely.When CI is green, the reviewer is satisfied, and the blocking items are done:
scripts/merge_and_cleanup.sh <PR> <worktree-path> <branch> — squash-merges, then removes the worktree, then deletes the local branch, in the only order that works. Doing this by hand is error-prone because git branch -D fails while a worktree pins the branch, so always go through the script (or follow the exact sequence in references/common-commands.md).Merging to main does not auto-deploy in most repos. If the user asks to "deploy" after a merge, check the repo's workflows to see what triggers deploy — commonly a workflow_dispatch on a Deploy workflow. Production is shared infrastructure; confirm environment (development / staging / production) before dispatching.
See references/pitfalls.md for the full list. The top items:
invoking-codex-exec "Read-only enforcement". Two consecutive boundary violations → escalate.gh pr review --approve fails with "cannot approve your own PR" for the PR's author account. Post via gh pr comment instead.gh pr diff <N> before raising the alarm.gh pr view, git log --oneline, git diff --stat, CI status: status, claude does these. Reading the diff to judge if it's good: content, that's a reviewer codex dispatch.The batch is done when:
verdict: approved and read-only enforcement passed.development
Use when delegating a single coding task to `codex exec` ("hand off to codex", "run codex on this", "dispatch codex on this ticket", any one-shot invocation). Covers flags, sandbox traps, monitoring, and recovery. Not for multi-issue parallel batches — use codex-issue-waves for those.
development
Use when the user says "have codex fix this" / "have codex implement this" / "let codex handle this" / "give this to codex" / "delegate this to codex" for a single task with context already in scope (a Jira ticket, GitHub issue, file diff, bug, or described change). Plans the work, splits it into reviewable waves, dispatches codex per wave with review and correction between waves before opening a PR. Not for multi-issue parallel batches (use codex-issue-waves) or one-shot codex runs without planning (use invoking-codex-exec).
development
Slite knowledge base API — ask questions, search notes, retrieve content, manage users and groups, and audit knowledge health via the REST API
tools
Plex Media Server API — library management, media search, playback sessions, server status, and automation