ddnetters/homelab-agent-skills / codex-issue-waves
codex-issue-waves
VerifiedRun 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).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 15.9 KB |
| references/common-commands.md | markdown | 5.8 KB |
| references/pitfalls.md | markdown | 4.6 KB |
| references/prompt-template.md | markdown | 14.1 KB |
| scripts/merge_and_cleanup.shexecutable | script | 2.5 KB |
| scripts/wait_for_ci.shexecutable | script | 1.4 KB |
scripts/merge_and_cleanup.sh
View on GitHub#!/usr/bin/env bash
# Squash-merge a PR and clean up its worktree + local branch in the correct order.
#
# The hard-won rule: `git branch -D` fails while a worktree pins the branch, and
# `gh pr merge --delete-branch` only deletes the remote branch. This script
# enforces the sequence:
# 1. gh pr merge --squash --delete-branch (merges + deletes remote branch)
# 2. git worktree remove <path> (unpins the local branch)
# 3. git branch -D <branch> (deletes the local branch)
#
# Usage:
# merge_and_cleanup.sh <PR_NUMBER> <WORKTREE_PATH> <BRANCH>
#
# Environment:
# MERGE_STRATEGY=squash|merge|rebase (default: squash)
set -euo pipefail
if [[ $# -lt 3 ]]; then
echo "Usage: $0 <PR_NUMBER> <WORKTREE_PATH> <BRANCH>" >&2
exit 2
fi
pr="$1"
worktree="$2"
branch="$3"
strategy="${MERGE_STRATEGY:-squash}"
if ! [[ "$pr" =~ ^[0-9]+$ ]]; then
echo "PR_NUMBER must be an integer, got: $pr" >&2
exit 2
fi
case "$strategy" in
squash|merge|rebase) ;;
*) echo "MERGE_STRATEGY must be squash|merge|rebase, got: $strategy" >&2; exit 2 ;;
esac
# 1. Confirm PR is mergeable first (fail fast instead of mid-sequence).
state="$(gh pr view "$pr" --json state,mergeable,mergeStateStatus \
--jq '{state, mergeable, mergeStateStatus} | "\(.state)|\(.mergeable)|\(.mergeStateStatus)"')"
if [[ "${state%%|*}" != "OPEN" ]]; then
echo "PR #$pr is not OPEN (state: ${state%%|*}); aborting." >&2
exit 1
fi
# 2. Merge. `gh` may print "failed to delete local branch" — that is expected when
# a worktree is pinning the branch and is not fatal for us; we handle it next.
echo "Merging PR #$pr (--$strategy)..."
gh pr merge "$pr" "--$strategy" --delete-branch || {
echo "gh pr merge reported an error. Inspecting..." >&2
gh pr view "$pr" --json state,mergedAt --jq '.'
merged="$(gh pr view "$pr" --json state --jq '.state')"
if [[ "$merged" != "MERGED" ]]; then
echo "PR #$pr did not merge. Aborting cleanup." >&2
exit 1
fi
echo "PR #$pr is MERGED; the error was only about local-branch cleanup. Continuing." >&2
}
# 3. Remove the worktree (this releases the branch lock).
if [[ -d "$worktree" ]]; then
echo "Removing worktree at $worktree..."
git worktree remove "$worktree"
else
echo "Worktree $worktree not present; skipping." >&2
fi
# 4. Delete the local branch if it still exists.
if git show-ref --quiet "refs/heads/$branch"; then
echo "Deleting local branch $branch..."
git branch -D "$branch"
else
echo "Local branch $branch already gone; skipping." >&2
fi
echo "Done. PR #$pr merged, worktree + branch cleaned up."
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |