$npx -y skills add apache/magpie --skill pr-stale-sweepSweep open pull requests on the configured <upstream> repo for inactivity past a configurable threshold and propose either a conversion to draft (when the PR is open but has gone quiet) or a closure (when the PR has been abandoned long enough to presume the author has moved on)
| 1 | <!-- SPDX-License-Identifier: Apache-2.0 |
| 2 | https://www.apache.org/licenses/LICENSE-2.0 --> |
| 3 | |
| 4 | <!-- Placeholder convention (see ../../AGENTS.md#placeholder-convention-used-in-skill-files): |
| 5 | <project-config> → adopter's project-config directory |
| 6 | <upstream> → adopter's public source repo (owner/name) |
| 7 | <default-branch> → upstream's default branch (master vs main) |
| 8 | Substitute these with concrete values from the adopting |
| 9 | project's <project-config>/ before running any command below. --> |
| 10 | |
| 11 | # pr-stale-sweep |
| 12 | |
| 13 | This skill is the **stale-PR sweep** for the project's pull request |
| 14 | queue. It identifies open PRs that have had no new commit, comment, or |
| 15 | update activity past a configurable inactivity threshold, classifies |
| 16 | each as either `REQUEST-UPDATE` (nudge the author to confirm they still |
| 17 | intend to land this) or `CLOSE-STALE` (propose closure for abandoned |
| 18 | PRs), and — on the user's explicit confirmation — posts one lightweight |
| 19 | comment per PR and optionally converts to draft or closes. |
| 20 | |
| 21 | The skill **never converts, labels, closes, or edits any PR field |
| 22 | without confirmation**. The decision belongs to the maintainer; this |
| 23 | skill surfaces the candidates and pre-drafts the comments so the |
| 24 | maintainer can review in bulk and confirm or skip individually. |
| 25 | |
| 26 | It composes with: |
| 27 | |
| 28 | - [`pr-management-triage`](../pr-management-triage/SKILL.md) — the |
| 29 | full first-pass triage skill; the stale-sweep targets the dormant-PR |
| 30 | subset only, while triage covers all action-needed PRs. |
| 31 | - [`pr-management-stats`](../pr-management-stats/SKILL.md) — for |
| 32 | queue-level health reporting before and after a stale sweep. |
| 33 | |
| 34 | --- |
| 35 | |
| 36 | ## Disposition vocabulary |
| 37 | |
| 38 | The skill uses **exactly two** disposition classes: |
| 39 | |
| 40 | | Class | When to propose | Follow-up action | |
| 41 | |---|---|---| |
| 42 | | `REQUEST-UPDATE` | PR is dormant past the warn threshold but not yet past the close threshold; author has not recently responded | Post a nudge comment asking the author to confirm the PR is still in progress and they intend to address any feedback; no state change yet | |
| 43 | | `CLOSE-STALE` | PR is dormant past the close threshold **and** has already received a `REQUEST-UPDATE` nudge with no response, **or** is dormant past a hard-close threshold with no nudge needed | Post a pre-close notice and, on a second explicit confirmation, close the PR | |
| 44 | |
| 45 | The two thresholds (`warn_days` and `close_days`) default to the values in |
| 46 | [`<project-config>/stale-sweep-config.md`](../../projects/_template/stale-sweep-config.md) |
| 47 | when that file exists, or to framework defaults (45 / 90 days) when it |
| 48 | does not. PR queues typically move faster than issue trackers, so the |
| 49 | framework defaults are tighter. The user may override either threshold |
| 50 | inline at invocation time. |
| 51 | |
| 52 | --- |
| 53 | |
| 54 | ## Golden rules |
| 55 | |
| 56 | **Golden rule 1 — read-only on PR state until confirmed.** This skill |
| 57 | posts comments and closes PRs only after the user confirms each action |
| 58 | individually. No label mutations, no merges, no force-closes. Every post |
| 59 | and every close is proposed, shown, and executed only after the user |
| 60 | says "yes" for that specific item. |
| 61 | |
| 62 | **Golden rule 2 — every comment is a draft until confirmed.** Per the |
| 63 | "draft before send" rule in [`AGENTS.md`](../../AGENTS.md), every comment |
| 64 | body is drafted and shown before posting. The fact that the user invoked |
| 65 | the skill is **not** blanket authorisation — each comment is reviewed |
| 66 | individually. Closures require a second explicit confirmation step after |
| 67 | the comment has posted. |
| 68 | |
| 69 | **Golden rule 3 — two classes, no more.** The classification is either |
| 70 | `REQUEST-UPDATE` or `CLOSE-STALE`. No hybrid proposals in a single |
| 71 | comment. |
| 72 | |
| 73 | **Golden rule 4 — never close without a posted nudge first (unless the |
| 74 | hard-close threshold applies).** A PR that has never received a |
| 75 | stale-sweep nudge must receive a `REQUEST-UPDATE` comment first, wait |
| 76 | the wa |