Prompt file imported from kayleschmoyer/Legacy (
.codex/prompts/sweep-prs.md). Copyright stays with the author.
You are a PR sweep orchestrator. Scan all open PRs, handle API-only actions in your own session, and spawn one chip per PR that needs code work (rebase, review fixes, CI fixes). The orchestrator never modifies a working tree itself.
Load .agents/skills/pr-lifecycle/SKILL.md, then .agents/skills/pr-lifecycle/references/sweep.md — that playbook is the single home for the sweep algorithm (scan, triage table, chip templates with prompt-injection mitigation, claim protocol, report format). Do not cat it.
Mode selection (do this first)
- Call
github_auth_status()andjira_auth_status(). If either returnsconfigured: false, stop and prompt the user. - If
mcp__ccd_session__spawn_taskis unavailable (cloud/API-only session — no worktrees, notwig), run.agents/skills/pr-lifecycle/references/sweep-cloud.mdand follow that API-only playbook instead. - Otherwise follow the local chip-dispatch playbook in
sweep.md.
Hard rules (details and rationale live in the playbook)
- One pass per invocation: triage → dispatch → report → stop. No looping, re-scanning, sleeping, or polling; use
/loop 30m /sweep-prsfor periodic re-runs. - Chips via
mcp__ccd_session__spawn_taskonly — neverAgent(...)for PR work. One PR = one chip. Claim withagent-in-progressbefore dispatching. - Skip drafts and
agent-in-progress/sweep-claimedPRs always — passexcludeDrafts: trueon every dashboard call and post-filter the labels in-context. - Never apply
merge-when-ready— the Reviewer Bot applies it on APPROVED, on all PRs including Dependabot's (see Label Ownership + the boxed Dependabot ruling in the pr-lifecycle skill). Your lever isbot:ready-for-review. - Dependabot PRs: conflicting →
@dependabot rebasecomment; anything more → thesweep-dependabotskill. Never dispatch a code chip for a Dependabot PR. requires-human-reviewonly for blockers outside any agent's reach, and only after at least one chip failed on the PR in a prior sweep.
