Agent skill

Issue PR Loop

by thomhurst in thomhurst/EnumerableAsyncProcessor

Run the GitHub issue/PR queue when the user invokes /issue-pr-loop or requests continuous queue work: maintain PRs, claim issues, implement in isolated worktrees, and ship until stopped.

MITAuto-check passedDevelopment

Install Issue PR Loop

skills CLI
$ npx skills add thomhurst/EnumerableAsyncProcessor --skill issue-pr-loop -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install thomhurst/EnumerableAsyncProcessor issue-pr-loop --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/thomhurst/EnumerableAsyncProcessor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/issue-pr-loop .claude/skills/issue-pr-loop && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
issue-pr-loop
GitHub stars
147
Token cost
~3.1k tokens
SKILL.md length
1,589 words
Files
3 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Run the GitHub issue/PR queue when the user invokes /issue-pr-loop or requests continuous queue work: maintain PRs, claim issues, implement in isolated worktrees, and ship until stopped.

  • Works in 4 steps: Merge an eligible PR. → Fix conflicts, failed CI, or review… → Recover valuable changes from a… → …
  • Invokes /issue-pr-loop
  • SKILL.md covers Loop and completion, Isolation and ownership, Maintain PRs and Pick an issue, plus 1 more section
  • Calls pwsh, gh and git

What it does

Issue PR Loop is an agent skill from thomhurst/EnumerableAsyncProcessor. Run the GitHub issue/PR queue when the user invokes /issue-pr-loop or requests continuous queue work: maintain PRs, claim issues, implement in isolated worktrees, and ship until stopped.

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/recovery.md` and `references/repository.md`).

It sits in Development, covering Git worktrees and Async programming. It works with GitHub. The repository describes itself as: Process Multiple Asynchronous Tasks in Various Ways - One at a time / Batched / Rate limited / Concurrently. The licence is MIT.

When your agent uses it

  • Invokes /issue-pr-loop
  • Requests continuous queue work: maintain PRs
  • Implement in isolated worktrees
  • Ship until stopped

Example prompts

  • “/issue-pr-loop”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Merge an eligible PR.
  2. Fix conflicts, failed CI, or review findings on an open PR and push.
  3. Recover valuable changes from a preserved merged-PR worktree, following recovery guidance.
  4. Claim an available issue, implement its full scope, and open a PR.

What it can do on your machine

Read from SKILL.md and the folder at commit 9ea7c9b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pwsh
    • gh
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Issue PR Loop loads about 3.1k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 50 tokens; SKILL.md has 1,589 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from thomhurst/EnumerableAsyncProcessor at commit 9ea7c9b, republished under its MIT licence (© thomhurst). 1,589 words, ~3,136 tokens.

Download SKILL.mdSave it as .claude/skills/issue-pr-loop/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
issue-pr-loop
description
Run the GitHub issue/PR queue when the user invokes /issue-pr-loop or requests continuous queue work: maintain PRs, claim issues, implement in isolated worktrees, and ship until stopped.

Issue/PR Loop

Read the root agent instructions and repository guidance. Keep this workflow identical across repositories; local requirements belong in that reference or their maintained source. Reviewing or editing the skill does not start the loop. Stay within the user's authorized scope.

Loop and completion

Run unattended. At each iteration, run pwsh scripts/Remove-MergedWorktrees.ps1 from the shared checkout, survey the queue, then complete one unit in priority order:

  1. Merge an eligible PR.
  2. Fix conflicts, failed CI, or review findings on an open PR and push.
  3. Recover valuable changes from a preserved merged-PR worktree, following recovery guidance.
  4. Claim an available issue, implement its full scope, and open a PR.

After pushing or deferring, survey again. Pending CI/review means work another item; do not watch, sleep, poll one item, or schedule monitors while work is queueable. When only CI/review remains, periodically survey the whole queue and stay responsive.

Stop on the user's stop/pause, or when a fresh survey finds no queueable issue, recovery candidate, or actionable PR and remaining work requires an external decision/dependency. Pending CI alone is not completion. Defer unsafe/blocked items, record the blocker once when authorized, release ownership, and continue without blocking questions. Revisit only when evidence changes.

Use commentary while active. Preserve item IDs, worktree, lock identity/script, owned services, and unresolved validation across compaction.

Delegate only when the user explicitly authorizes subagents: one item/iteration, this skill, shared checkout, and canonical lock script. Require a confirmed merged #N, pushed fixes to #N, opened #N closing #M, or failed #N: reason; then continue surveying.

Isolation and ownership

Use the shared checkout for surveys/setup. All implementation, validation, checkouts, commits, and pushes run in an isolated worktree. Capture from the shared checkout:

powershell
$repo = git rev-parse --show-toplevel
$repoSlug = gh repo view --json nameWithOwner --jq .nameWithOwner
$repoName = ($repoSlug -split '/')[-1]
$agentLocks = Join-Path $repo 'scripts/AgentLocks.ps1'
$worktreeRoot = Join-Path (Split-Path $repo -Parent) ($repoName + '-worktrees')

Verify the repository and intended base; examples use origin/main. Use a writable temporary <repoName>-worktrees root if needed. Choose a unique worktree path when one already exists.

Acquire the Redis lock before acting on an item: pr-<N> for PR work or recovery, issue-<N> for new implementation. Always invoke the absolute shared-checkout $agentLocks path for every verb; older branch copies can have incompatible token caches.

CommandResult
pwsh $agentLocks acquire -LockName $lockNameExit 0 grants ownership; 3 means held, skip; other failures mean defer, never bypass Redis.
pwsh $agentLocks renew -LockName $lockNameRenew work approaching the two-hour TTL; exit 4 means ownership lost, stop this item and do not push.
pwsh $agentLocks status -LockName $lockNameRead-only FREE / HELD / HELD-BY-ME; verify ownership before pushing or merging.
pwsh $agentLocks release -LockName $lockNameRelease in cleanup/finally; exit 0 confirms release, 5 means stale ownership, leave the key alone.

Redis is authoritative: never steal locks based on PIDs/files/inactivity or add another backend. Do not print/manage cached tokens. Codex supplies CODEX_THREAD_ID; other automation needs the same stable unique -OwnerId on every verb. Renew when needed, without periodic heartbeats. Optional renew -Worktree $worktree records metadata; keep explicit lock names. The issue's in-progress label persists independently.

After claiming an issue, create branch/worktree issue-<N>-<short-desc> from freshly fetched origin/main. For PR fixes, create a detached worktree from origin/main, then run gh pr checkout <N> with that worktree as workdir. PR directories use pr-<N>-<description>; never rename or reuse them for another PR. A separate local review/rebase branch must retain the same pr-<N> identity.

Set every mutating tool call's workdir explicitly; shell directory changes do not persist. Before the first edit and after checkout changes, compare git rev-parse --show-toplevel with the intended worktree's resolved absolute path and inspect git status --short --branch. Abort on a mismatch.

Use repository scripts for merged-worktree cleanup; [gone] or ancestry alone is insufficient. Preserve dirty, locked, open-PR, harness-managed, and locally divergent worktrees. Inspect untracked source before cleanup: scripts may clear build artifacts. Manually remove abandoned worktrees only after verifying repository/path, ownership, and absence of valuable unpublished work. Do not enable stale/scratch cleanup during surveys.

Stop only services/processes/containers started for this worktree. Never blanket-delete containers/volumes or stop shared lock Redis. Follow local lifecycle guidance; use Aspire only where an AppHost exists.

Maintain PRs

Survey with gh pr list --author @me --state open --json number,title,headRefName,headRefOid,mergeable,mergeStateStatus,reviewDecision,statusCheckRollup,isDraft. Include other authors only when the user's queue scope includes them. Paginate or increase limits so an incomplete first page cannot make the queue appear empty.

Inspect all review surfaces, including pagination and replies: REST pulls/<N>/reviews, pulls/<N>/comments, issues/<N>/comments under repos/{owner}/{repo}, and GraphQL reviewThreads with IDs, resolution state, bodies, authors, and timestamps.

A COMMENTED review body can block with zero unresolved threads. Address outstanding concerns, CHANGES_REQUESTED, current inline findings, and unresolved threads. Empty acknowledgments are non-blocking. Assess older findings against the current head and later discussion; uncertain concerns block merging.

StateAction
ConflictsRebase onto fresh origin/main, inspect the diff for lost changes at shared insertion points, validate, and push. Abort and defer conflicts that cannot be resolved confidently.
CI failureRead failed logs and fix the cause. Investigate timing/synchronization failures. At most one rerun for a demonstrated infrastructure problem or diagnosed flake when local rules permit; never rerun for green, skip/delete failing tests, or mask a failure.
FeedbackVerify the finding against code, address useful minor and blocking suggestions, and reply to each finding with the fix or technical disposition. Discuss disagreement once; implement reaffirmed feedback unless it violates repository contracts or performance requirements, in which case document and defer the conflict.
PendingTake another item. After a fix push, allow a subsequent bot review/CI cycle before considering merge in a later iteration.
Merge candidateConfirm every condition below, then invoke the wrapper.

Resolve a bot-opened thread under the PR lock only after replying with a fix commit or concrete disposition, confirming any promised fix is in the current head, and a subsequent bot review/CI cycle completes without rebuttal. A current-head REVIEW_VERDICT: CLEAR is strongest evidence. Do not resolve newer rebuttals, unaddressed findings, or human threads awaiting response. Use GraphQL resolveReviewThread, then re-fetch reviews, threads, checks, and head SHA.

Show full SKILL.md (622 more words)Show less
Merge gate

Merge requires an open, ready-for-review PR; MERGEABLE and CLEAN; every applicable check present, terminal, and passing (SUCCESS, SKIPPED, or NEUTRAL, with successful legacy commit statuses); no unresolved threads, unaddressed comments, or outstanding review-body concerns; approval when required; and a bot review/CI cycle after the last fix push. Missing expected checks and nonterminal checks block merging. Reassess if the head changes.

Use current repository rules/instructions for approval requirements. Historical merges without approval do not prove approval is optional; inaccessible protection APIs do not prove no protection exists.

powershell
pwsh scripts/Merge-Pr.ps1 -Pr <N> -Worktree $worktree

Omit -Worktree only when none exists. The wrapper calls Assert-PrGreen.ps1, merges on a passing mechanical gate, and cleans up. Judge review dispositions and approval yourself; the script is necessary but insufficient.

Never bypass with direct gh pr merge or --auto. Nonzero exit means inspect/defer, not retry blindly. Cleanup warnings after a successful merge do not justify retrying; reconcile ambiguous results with GitHub state. Never delete fork branches through the base repository's origin.

Pick an issue

Ensure in-progress exists, then list open, unassigned candidates without that label. Skip wontfix, duplicate, question, claimed items, and external blockers. Prefer clear, smaller tasks with fewer discussion comments; size alone is not a reason to stop when larger coherent work remains.

Under the issue lock, re-fetch state, assignees, labels, native dependencies, and linked PRs. Skip closed, assigned, already claimed, blocked, or already implemented items. Add in-progress and verify the claim before branching. Keep it while the PR is open. Remove only your own claim if abandoning before PR creation; after lost ownership, leave shared claim state untouched and report the loss.

Establish full scope from source, tests, and docs; a missing API may be the requested work. Deliver coherent issues in one PR.

For independent deliverables, inspect existing children (including closed ones) before splitting into native sub-issues and blocked_by relationships. Avoid checklist-only tracking and blocked labels. Give children acceptance criteria, leave the parent open, remove your parent claim, and implement the first unclaimed child whose prerequisites are closed this iteration. If native links are unavailable, document the blocker.

Relationship writes require numeric REST issue .id, not issue numbers or gh issue view --json id (GraphQL ID). Retrieve with gh api "repos/$repoSlug/issues/$childNumber" --jq .id; link via POST issues/<parent>/sub_issues -F sub_issue_id=<id> or POST issues/<blocked>/dependencies/blocked_by -F issue_id=<prerequisite-id> under repos/$repoSlug/. Verify each write before proceeding.

Implement and ship

Follow local validation, resource limits, target frameworks, generated-code boundaries, and performance requirements. Use TDD for bugs/behavior changes where feasible; explain exceptions. Run focused and relevant broader checks, including docs/frontend checks when affected. Document unavailable validation; never silently raise guard limits or claim unrun tests passed.

Review the full diff for correctness, reuse, and efficiency (/simplify when available, otherwise equivalent review). Preserve performance/contracts and batch related fixes into one push. Use CI for environment-specific validation with limitations documented; avoid arbitrary local debugging retry counts.

  • Use non-interactive commit messages (-m, --file, or --amend --no-edit) and disable editors for rebases and continuation: git -c core.editor=true -c sequence.editor=true rebase ....
  • Reference the issue in commits. Create normal ready-for-review PRs unless the user explicitly requests a draft. Follow the repository PR template and use --body-file for multiline descriptions. Put Closes #<N> on its own line only when the full issue is delivered.
  • Use ordinary pushes for new commits and git push --force-with-lease when rewriting an owned PR branch. Never use bare --force or rewrite main. Confirm ownership and the remote PR head before reporting completion.
  • Completion requires commit, successful push, PR creation/update, and gh pr view <N> --json headRefOid matching local git rev-parse HEAD. Push/ownership failure means preserve work, report failure, release ownership, and continue. Release locks in every outcome and stop owned services when no longer needed.

Record unrelated bugs as linked issues only within authorization; finish the original scope.

© thomhurst, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .claude/skills/issue-pr-loop of thomhurst/EnumerableAsyncProcessor.

  • SKILL.md
  • references/recovery.md
  • references/repository.md

Open the folder on GitHubat commit 9ea7c9b

Compare with similar skills

Issue PR Loop next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Issue PR Loop compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Issue PR Loop this skillthomhurst/EnumerableAsyncProcessor147—~3.1kAutomated safety check: PassMIT
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Codewhale Landing Workflowcodewhale-hq/Codewhale41k—~1.6kAutomated safety check: PassMIT
Ff Worktreesdamus-io/damus2.1k—~451Automated safety check: PassGPL-3.0
Clean Complete Branchesjtenniswood/espcontrol1.1k—~820Automated safety check: PassCustom licence
Clean Merged Branch Foldersjtenniswood/espcontrol1.1k—~813Automated safety check: PassCustom licence

Similar skills

  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Codewhale Landing Workflow

    codewhale-hq/Codewhale

    Decides how verified work should reach main, directly, in a worktree or on an integration branch, while keeping contributor credit and respecting merge gates.

    41k GitHub stars~1.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Ff Worktrees

    damus-io/damus

    Fast-forward master and every git worktree branch up to a target ref (default github/master), skipping any worktree with unmerged commits.

    2.1k GitHub stars~451 tokensUpdated 26 days ago
    DevelopmentAuto-check passed
  • Clean Complete Branches

    jtenniswood/espcontrol

    Clean up completed Git branches and worktrees for this repository both locally and on GitHub.

    1.1k GitHub stars~820 tokensUpdated today
    DevelopmentAuto-check passed
  • Clean Merged Branch Folders

    jtenniswood/espcontrol

    Clean up local branch worktree folders for this repository after their branches or pull requests have merged to main.

    1.1k GitHub stars~813 tokensUpdated today
    DevelopmentAuto-check passed
  • Fix

    exercism/website

    Fix a GitHub issue end-to-end — fetches issue, creates worktree, plans and implements fix, runs validation, opens PR, cleans up.

    550 GitHub stars~1.2k tokensUpdated 3 days ago
    DevelopmentAuto-check: notes

Works with

Categories

Questions about Issue PR Loop

What does Issue PR Loop do?

Run the GitHub issue/PR queue when the user invokes /issue-pr-loop or requests continuous queue work: maintain PRs, claim issues, implement in isolated worktrees, and ship until stopped. Issue PR Loop is an agent skill from thomhurst/EnumerableAsyncProcessor. Run the GitHub issue/PR queue when the user invokes /issue-pr-loop or requests continuous queue work: maintain PRs, claim issues, implement in isolated worktrees, and ship until stopped.

When should I use Issue PR Loop?

Issue PR Loop fits situations like: invokes /issue-pr-loop; requests continuous queue work: maintain PRs; implement in isolated worktrees; ship until stopped.

How do I install Issue PR Loop in Claude Code?

Run `npx skills add thomhurst/EnumerableAsyncProcessor --skill issue-pr-loop -a claude-code`. Or copy the skill folder (.claude/skills/issue-pr-loop in thomhurst/EnumerableAsyncProcessor) into .claude/skills/issue-pr-loop in your project. Claude Code loads it when a task matches its description.

How do I install Issue PR Loop in Codex?

Run `npx skills add thomhurst/EnumerableAsyncProcessor --skill issue-pr-loop -a codex`. Or copy the skill folder (.claude/skills/issue-pr-loop in thomhurst/EnumerableAsyncProcessor) into .agents/skills/issue-pr-loop in your project. Codex loads it when a task matches its description.

Can I use Issue PR Loop in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add thomhurst/EnumerableAsyncProcessor --skill issue-pr-loop -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/issue-pr-loop, .gemini/skills/issue-pr-loop, .github/skills/issue-pr-loop and .opencode/skills/issue-pr-loop in your project.

What does Issue PR Loop need to run?

Going by SKILL.md and its folder, Issue PR Loop needs the command-line tools its instructions call (pwsh, gh and git).

Does Issue PR Loop access the network?

SKILL.md contains no URLs. Its commands use gh and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Issue PR Loop safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Issue PR Loop use?

Issue PR Loop is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Issue PR Loop use?

About 3.1k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 624 tokens, read only when the agent opens those files.

What are the alternatives to Issue PR Loop?

Skills that share tags, products or a category with Issue PR Loop: Pre-Release PR Triage (jamiepine/voicebox, 57k stars), Codewhale Landing Workflow (codewhale-hq/Codewhale, 41k stars), Ff Worktrees (damus-io/damus, 2.1k stars) and Clean Complete Branches (jtenniswood/espcontrol, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Issue PR Loop?

thomhurst (a GitHub user) maintains it in thomhurst/EnumerableAsyncProcessor, which has 147 GitHub stars. The repository was last updated on October 2, 2026.

Source: thomhurst/EnumerableAsyncProcessor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.