HARD REQUIREMENT: You MUST spawn subagents in Phase 2. Do NOT evaluate PRs sequentially yourself. If you have suspect PRs and cannot spawn subagents, STOP and reply: "BLOCKED: could not spawn subagents".
PHASE 1: Title scan (quick filter)
Fetch first 100 open PRs with titles only:
gh pr list --state open --json number,title,author,createdAt --limit 100
Scan titles for suspect signals:
- •Vague/generic titles ("fix", "update", "changes", "WIP", "test")
- •Auto-generated titles ("Bump X from Y to Z" if not a bot account)
- •Very old PRs (created 60+ days ago)
- •Titles that don't describe a clear change
Output a list of suspect PR numbers. Only these move to Phase 2.
PHASE 2: Deep evaluation (parallel subagents required)
Split suspect PRs into batches and spawn up to 4 subagents (one per batch). Do NOT evaluate sequentially.
Each subagent receives a batch of PR numbers and must:
- •Fetch full PR details:
gh pr view <number> --json body,comments,commits,reviews,files - •Evaluate against junk criteria below
- •Return list of PRs to close with reason (Stale, Duplicate, Out of scope, Abandoned, or Superseded)
Wait for all subagents to complete.
Junk criteria:
- •Stale (no activity for 60+ days)
- •Vague/meaningless title or description
- •Duplicate of another PR
- •Abandoned (author unresponsive, no recent commits)
- •Out of scope or irrelevant
Do NOT auto-close PRs that:
- •Have recent activity (last 30 days)
- •Are marked as draft and actively being worked on
PHASE 3: Present findings for approval
For each PR recommended for closure, output:
- •PR link: Full GitHub URL
- •Title: The PR title
- •Author: Who opened it
- •Age: Days since created / last updated
- •Reason: Clear explanation of why this should be closed (2-3 sentences with evidence)
Example format:
PR: https://github.com/org/repo/pull/123
Title: "fix stuff"
Author: @username (last active 90 days ago)
Reason: Stale — no activity for 90 days, vague title with no description,
only touches test files with no clear purpose. Recommend closing.
After presenting all findings, ask: "Close these PRs? (y/n or specify which ones)"
Only after user confirms, close with:
gh pr close "$PR" --comment "Closing: <reason>"