Pr Sweep
Sweep open pull requests a fork contributes to an upstream GitHub repo. Composable steps — list, review (one agent per batch), sync, verdicts, summary — so an orchestrator (Ceph, a foreman agent, a workflow, or you) plans the work and delegates it, while sweep remains as the one-call convenience. Queryable per-PR and run-summary resources; the sweeper prompt ships as a bundled asset.
review: detach PR checkouts so concurrent worktree sweeps cannot collide; clean up a worktree left by a failed mint
| Argument | Type | Description |
|---|---|---|
| workdir? | string | Local checkout directory for the upstream repo. Omit to resolve it from pr-sweep-config's registered pairs. |
| upstreamRepo? | string | Upstream GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| forkRepo? | string | Fork GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| agent? | enum | Headless agent for review batches |
| model? | string | Model for the agent in provider/model form; empty uses the agent's default or the registered repo pair's model |
| mainBranch? | string | Base branch to rebase and merge into |
| swampRepoDir? | string | Path to the swamp repo that owns this workflow; only for the legacy prompt override. |
| sweeperPrompt? | string | Absolute path to a custom sweeper prompt file. |
| updateStrategy? | enum | How to update a behind branch: merge the base in (no force-push) or rebase onto it (force-push) |
| batchSize? | number | list only: group PRs into review batches of at most this many (0 = one batch, the whole list) and report the grouping for the orchestrator |
| Argument | Type | Description |
|---|---|---|
| workdir? | string | Local checkout directory for the upstream repo. Omit to resolve it from pr-sweep-config's registered pairs. |
| upstreamRepo? | string | Upstream GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| forkRepo? | string | Fork GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| agent? | enum | Headless agent for review batches |
| model? | string | Model for the agent in provider/model form; empty uses the agent's default or the registered repo pair's model |
| mainBranch? | string | Base branch to rebase and merge into |
| swampRepoDir? | string | Path to the swamp repo that owns this workflow; only for the legacy prompt override. |
| sweeperPrompt? | string | Absolute path to a custom sweeper prompt file. |
| updateStrategy? | enum | How to update a behind branch: merge the base in (no force-push) or rebase onto it (force-push) |
| batchSize? | number | list only: group PRs into review batches of at most this many (0 = one batch, the whole list) and report the grouping for the orchestrator |
| Argument | Type | Description |
|---|---|---|
| workdir? | string | Local checkout directory for the upstream repo. Omit to resolve it from pr-sweep-config's registered pairs. |
| upstreamRepo? | string | Upstream GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| forkRepo? | string | Fork GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| agent? | enum | Headless agent for review batches |
| model? | string | Model for the agent in provider/model form; empty uses the agent's default or the registered repo pair's model |
| mainBranch? | string | Base branch to rebase and merge into |
| swampRepoDir? | string | Path to the swamp repo that owns this workflow; only for the legacy prompt override. |
| sweeperPrompt? | string | Absolute path to a custom sweeper prompt file. |
| updateStrategy? | enum | How to update a behind branch: merge the base in (no force-push) or rebase onto it (force-push) |
| batchSize? | number | list only: group PRs into review batches of at most this many (0 = one batch, the whole list) and report the grouping for the orchestrator |
| Argument | Type | Description |
|---|---|---|
| workdir? | string | Local checkout directory for the upstream repo. Omit to resolve it from pr-sweep-config's registered pairs. |
| upstreamRepo? | string | Upstream GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| forkRepo? | string | Fork GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| agent? | enum | Headless agent for review batches |
| model? | string | Model for the agent in provider/model form; empty uses the agent's default or the registered repo pair's model |
| mainBranch? | string | Base branch to rebase and merge into |
| swampRepoDir? | string | Path to the swamp repo that owns this workflow; only for the legacy prompt override. |
| sweeperPrompt? | string | Absolute path to a custom sweeper prompt file. |
| updateStrategy? | enum | How to update a behind branch: merge the base in (no force-push) or rebase onto it (force-push) |
| batchSize? | number | list only: group PRs into review batches of at most this many (0 = one batch, the whole list) and report the grouping for the orchestrator |
| Argument | Type | Description |
|---|---|---|
| workdir? | string | Local checkout directory for the upstream repo. Omit to resolve it from pr-sweep-config's registered pairs. |
| upstreamRepo? | string | Upstream GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| forkRepo? | string | Fork GitHub repo as owner/name. Omit to use the newest open-prs-current. |
| agent? | enum | Headless agent for review batches |
| model? | string | Model for the agent in provider/model form; empty uses the agent's default or the registered repo pair's model |
| mainBranch? | string | Base branch to rebase and merge into |
| swampRepoDir? | string | Path to the swamp repo that owns this workflow; only for the legacy prompt override. |
| sweeperPrompt? | string | Absolute path to a custom sweeper prompt file. |
| updateStrategy? | enum | How to update a behind branch: merge the base in (no force-push) or rebase onto it (force-push) |
| batchSize? | number | list only: group PRs into review batches of at most this many (0 = one batch, the whole list) and report the grouping for the orchestrator |
| Argument | Type | Description |
|---|---|---|
| upstreamRepo | string | Upstream GitHub repo as owner/name (e.g. Kilo-Org/kilocode) |
| forkRepo | string | Fork GitHub repo as owner/name (e.g. maphew/kilocode) |
| workdir | string | Local checkout directory for the upstream repo |
| agent? | enum | Headless agent to run the sweep |
| model? | string | Model for the agent in provider/model form; empty uses the agent's default |
| mainBranch? | string | Base branch to rebase and merge into |
| swampRepoDir? | string | Path to the swamp repo that owns this workflow. Optional: only used to find a legacy `<swampRepoDir>/.kilo/agents/pr-sweeper.md` prompt override; the bundled prompt is used otherwise. |
| sweeperPrompt? | string | Absolute path to a custom sweeper prompt file. Overrides both the bundled prompt and the legacy `<swampRepoDir>/.kilo/agents/pr-sweeper.md` lookup. |
| resyncBehind? | boolean | After the agent run, re-fetch the base branch and bring any behind PR branch up to date |
| updateStrategy? | enum | How to update a behind branch: merge the base in (no force-push) or rebase onto it (force-push) |
Resources
review: run each batch in a throwaway worktree so PR sweeps run in parallel
Preflight git/gh/agent binaries before list, review, and sync so a missing tool fails fast with its name; accept a per-pair model (falling back to pr-sweep-config) and pass it to every review/sweep invocation.
Modified 1 behaviors. updated dependencies
Relicense from AGPL-3.0-only to MIT.
Declare license: AGPL-3.0-only in the manifest; no model, workflow, or schema changes.
Initial publish from maphew/swamp-extensions. Bundles the sweeper prompt (prompts/pr-sweeper.md) so the model is self-contained: swampRepoDir is now optional and a custom prompt can be supplied with sweeperPrompt. agent now selects claude/codex/opencode/kilo instead of always running kilo. Records mergeStateStatus on per-PR results and a truncated flag on summaries, and adds an upgrade entry for the source move.
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented0/1missing
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned
Spawns a subprocess with Deno.Command().
- models/src/pr_sweep.ts:400 — gh CLI is the PR-sweep contract.
- models/src/pr_sweep.ts:725 — gh CLI is the PR-sweep contract.
- models/src/pr_sweep.ts:888 — branch sync runs real git commands.