paperclipai/paperclip/.agents/skills/pr-gardening/SKILL.md
pr-gardening
Discover the pull requests this Paperclip instance opened (never community contributions), report what each is for and how confident we are that it is merge-ready, and automatically drive the non-ready ones back to green with /prepare-paperclip-pr — without ever merging.
- Source repository stars
- 74,938
- Declared platforms
- 0
- Static risk flags
- 2
- Last source update
- 2026-07-28
- Source checked
- 2026-07-28
Decision brief
What it does—and where it fits
Actively garden the pull requests this Paperclip instance opened that are referenced by Paperclip issues active in a recent window (default 14 days). Candidate discovery and readiness checking are scripts, not LLM analysis. GitHub access is read-only throughout this workflow.
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/paperclipai/paperclip --skill ".agents/skills/pr-gardening"Inspect the Agent Skill "pr-gardening" from https://github.com/paperclipai/paperclip/blob/77979950381a99271e4690c581a7440b73807b11/.agents/skills/pr-gardening/SKILL.md at commit 77979950381a99271e4690c581a7440b73807b11. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Stage A — Discover Candidates
Run the extract-search path. It scans every result page, normalizes PR URLs, deduplicates PR numbers, records every mentioning issue, checks issue work products to identify the origin, drops PRs that GitHub says are merged or closed, drops PRs whose author is outside the allowli…
Run the extract-search path. It scans every result page, normalizes PR URLs, deduplicates PR numbers, records every mentioning issue, checks issue work products to identify the origin, drops PRs that GitHub says are mer…The script calls GET /api/companies/:companyId/search/extract with kind=url, scope=all, and updatedWithin=d, then resolves the author allowlist from gh api user unless --authors or --include-community overrides it. Do n… - 02
Stage B — Verify Current-Head Readiness
For every candidate, the script re-fetches the current head SHA and records:
open/draft state and mergeability/conflicts;statusCheckRollup check-run and legacy status inventory;a completed Greptile check-run on the exact head, clean only for success or neutral; - 03
Stage C — Drive Our PRs to Ready with /prepare-paperclip-pr
Skip this stage in --dry-run mode and for ready or reportonly entries.
Cooldown and rounds. Locate the originatingIssue from candidates.json (selection priority: issue carrying the exact PR URL as a pullrequest work product; then issue whose comment mentions the PR; then most recently acti…Deduplicate. Search open Paperclip issues for the PR number/branch. If an equivalent open prepare-PR task already exists, reuse it with a concise status comment instead of creating another (see the deduplication section…Run the prepare skill. Create one focused child task per PR assigned to a coder agent (prefer CodexCoder) instructing it to run /prepare-paperclip-pr for that PR — include the PR URL, branch, current head SHA, and the e… - 04
Stage D — Optional Inbox Tidy-Up
Run this stage only when the caller explicitly supplied --archive-inbox. --dry-run always suppresses inbox mutations, even when --archive-inbox is also present. Without the flag, do not archive anything.
Run this stage only when the caller explicitly supplied --archive-inbox. --dry-run always suppresses inbox mutations, even when --archive-inbox is also present. Without the flag, do not archive anything.Stage D applies to a previously monitored candidate that transitions to merged. Rerun Stage B immediately before this stage and require GitHub to report state: merged for the same current head SHA recorded by that verif…For each qualifying candidate, archive its originatingIssue from the responsible user's inbox with POST /api/issues/:issueId/inbox-archive and an empty JSON body. Do not pass userId; the Paperclip API resolves the respo… - 05
Stage E — Monitor to Termination
Set the gardening run issue's blockedByIssueIds to the non-terminal prepare tasks and originating issues engaged in Stage C so blocker resolution wakes the gardener. A scheduled or manual rerun is the fallback.
verified ready at the current head;merged or closed externally;maximum rounds reached, reported as not converging.
Permission review
Static risk signals and limitations
Runs scripts
The documentation asks the agent to run terminal commands or scripts.
node .agents/skills/pr-gardening/scripts/find-candidates.mjs \Network access
The documentation includes network, browsing, or remote request actions.
The script calls `GET /api/companies/:companyId/search/extract` with `kind=url`, `scope=all`, and `updatedWithin=<N>d`, then resolves the author allowlist from `gh api user` unless `--authors` or `--include-community` overrides it. Do not rRuns scripts
The documentation asks the agent to run terminal commands or scripts.
node .agents/skills/pr-gardening/scripts/check-readiness.mjs \Network access
The documentation includes network, browsing, or remote request actions.
Gardening: dispatched `/prepare-paperclip-pr` for https://github.com/paperclipai/paperclip/pull/1234 via PAP-XXXX.Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 89/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 74,938 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- paperclipai/paperclip
- Skill path
- .agents/skills/pr-gardening/SKILL.md
- Commit
- 77979950381a99271e4690c581a7440b73807b11
- License
- MIT
- Collected
- 2026-07-28
- Default branch
- master
View the original SKILL.md
PR Gardening
Actively garden the pull requests this Paperclip instance opened that are referenced by Paperclip issues active in a recent window (default 14 days). Candidate discovery and readiness checking are scripts, not LLM analysis. GitHub access is read-only throughout this workflow.
Scope — Our PRs Only
By default the workflow gardens only pull requests authored by this instance's GitHub identity (the gh authenticated login, e.g. cryppadotta). Community contributions and dependabot PRs are excluded mechanically by author login in Stage A and land in droppedCommunityPullRequests; never re-add them by hand, widen the scope only when the caller explicitly passes --authors or --include-community.
Hard Guardrails
- Never merge, approve, or close a pull request.
- Never instruct another person or agent to merge, approve, or close a pull request.
- Never garden, comment on, or run
/prepare-paperclip-pragainst a community PR. Only PRs from the Stage A author allowlist are actionable. - Never use mutating
ghcommands or mutating GitHub API requests. The scripts only usegh pr viewand read-onlygh apiGET requests. - Draft pull requests are report-only. Do not post gardening comments for drafts.
- Comment only on existing originating issues. Never create a gardening issue per pull request.
--dry-runsuppresses all Paperclip mutations, including gardening comments, prepare tasks, and inbox archives. Discovery and GitHub inspection remain read-only in every mode.
Inputs
--days <N>: activity window, default14. Applies to both mentioning-issue activity and the PR's ownupdatedAt; open PRs with no activity inside the window are dropped as stale.--authors <logins>: comma-separated GitHub logins whose PRs are in scope; default is theghauthenticated user.--include-community: disable the author filter entirely. Only on explicit caller request.--repo <owner/repo>: GitHub repository, default detected bygh repo view.--dry-run: discover, verify, and report without posting comments, creating prepare tasks, or archiving inbox entries.--archive-inbox: after GitHub confirms a candidate PR is merged at its current head, archive the originating issue from the responsible user's inbox in Stage D.--cooldown-hours <N>: repeat-gardening cooldown, default48.--max-rounds <N>: maximum gardening rounds per PR, default3.
Use a run-owned directory such as $PAPERCLIP_RUN_SCRATCH_DIR/pr-gardening for generated files.
Stage A — Discover Candidates
Run the extract-search path. It scans every result page, normalizes PR URLs, deduplicates PR numbers, records every mentioning issue, checks issue work products to identify the origin, drops PRs that GitHub says are merged or closed, drops PRs whose author is outside the allowlist (community contributions) into droppedCommunityPullRequests, and drops open PRs whose own updatedAt is older than the window into droppedStalePullRequests. Issues that exceed the per-issue extract match cap (typically digest or QA issues that enumerate hundreds of PR URLs) are recorded in source.truncatedIssues and noted in the report instead of aborting the run.
node .agents/skills/pr-gardening/scripts/find-candidates.mjs \
--days 14 \
--dry-run \
--output "$RUN_DIR/candidates.json"
The script calls GET /api/companies/:companyId/search/extract with kind=url, scope=all, and updatedWithin=<N>d, then resolves the author allowlist from gh api user unless --authors or --include-community overrides it. Do not replace it with full issue-list fetching or LLM scanning.
Stage B — Verify Current-Head Readiness
node .agents/skills/pr-gardening/scripts/check-readiness.mjs \
--input "$RUN_DIR/candidates.json" \
--output "$RUN_DIR/readiness.json" \
--dry-run
For every candidate, the script re-fetches the current head SHA and records:
- open/draft state and mergeability/conflicts;
statusCheckRollupcheck-run and legacy status inventory;- a completed Greptile check-run on the exact head, clean only for
successorneutral; reviewDecision;- commits behind the base branch.
Verdicts are ready, needs_gardening, or report_only for drafts. Always rerun this stage after any wake or claim that a PR was fixed. Never trust issue comments as proof of readiness.
Follow-up Create-PR Task Deduplication
If gardening decides a branch needs a follow-up task to create a single pull request, deduplicate before creating anything.
For each branch, process one branch at a time and do this serially:
- Search open Paperclip issues for the exact branch name with statuses
backlog,todo,in_progress,in_review, andblocked. - Inspect matching issue titles, descriptions, and recent comments for an equivalent open "create PR from this branch" task for the same branch.
- If an equivalent open task exists, reuse it: add a concise comment with the current PR/head/reason context and link it from the gardening issue or blocker list. Do not create another task.
- Only if no equivalent open task exists, create exactly one follow-up task for that branch.
Never fan out follow-up task creation in parallel. Do not issue concurrent POST /api/companies/:companyId/issues calls for create-PR or prepare-PR tasks. After P1's issue-create idempotency support is available, every create-PR follow-up task creation must include idempotencyKey: "pr-gardening:create-pr:{branch}" and every prepare-PR task idempotencyKey: "pr-gardening:prepare-pr:{owner/repo}#{number}".
Stage C — Drive Our PRs to Ready with /prepare-paperclip-pr
Skip this stage in --dry-run mode and for ready or report_only entries.
Every needs_gardening PR here was opened by this instance (Stage A guarantees it), so do not just report — actively get it merge-ready by running the /prepare-paperclip-pr skill against it. Process PRs one at a time:
-
Cooldown and rounds. Locate the
originatingIssuefromcandidates.json(selection priority: issue carrying the exact PR URL as apull_requestwork product; then issue whose comment mentions the PR; then most recently active mentioning issue). Fetch its comments and search for the marker:<!-- pr-gardening:<owner/repo>#<number> -->Skip the PR if the latest matching marker is newer than the cooldown. Track rounds from matching markers; after three rounds, stop and report
not converging; recommend close or human decision. That is a recommendation for human disposition, not an instruction to close the PR. -
Deduplicate. Search open Paperclip issues for the PR number/branch. If an equivalent open prepare-PR task already exists, reuse it with a concise status comment instead of creating another (see the deduplication section above).
-
Run the prepare skill. Create one focused child task per PR assigned to a coder agent (prefer CodexCoder) instructing it to run
/prepare-paperclip-prfor that PR — include the PR URL, branch, current head SHA, and the exact machine-detectedreasons[]fromreadiness.json. If you are the gardener and already have the PR's branch checked out in a worktree, you may run/prepare-paperclip-prdirectly instead of delegating. Either way, the prepare work must never merge, approve, or close the PR. -
Leave the marker comment. Comment on the originating issue with the marker above, the current head SHA, the copied
reasons[], the round counter, and a link to the prepare task. UsePOST /api/issues/:issueId/commentswithX-Paperclip-Run-Id. Includeresume: truewhen the issue is terminal so the comment creates a live continuation.
Suggested body:
<!-- pr-gardening:paperclipai/paperclip#1234 -->
Gardening: dispatched `/prepare-paperclip-pr` for https://github.com/paperclipai/paperclip/pull/1234 via PAP-XXXX.
Current-head verification at `abc123` found:
- failing check: test
- Greptile missing at current head
Gardening round 1/3. Re-verification is required after changes; do not merge based on this comment.
Stage D — Optional Inbox Tidy-Up
Run this stage only when the caller explicitly supplied --archive-inbox. --dry-run always suppresses inbox mutations, even when --archive-inbox is also present. Without the flag, do not archive anything.
Stage D applies to a previously monitored candidate that transitions to merged. Rerun Stage B immediately before this stage and require GitHub to report state: merged for the same current head SHA recorded by that verification. Fresh Stage A discovery intentionally drops PRs that were already merged or closed.
For each qualifying candidate, archive its originatingIssue from the responsible user's inbox with POST /api/issues/:issueId/inbox-archive and an empty JSON body. Do not pass userId; the Paperclip API resolves the responsible user from the gardener's run context and enforces that user's inbox-agent policy. GitHub access remains read-only.
Do not archive PRs that are merely ready, closed without merging, draft, pending, or merged at an unverified or stale head. Never archive an originating issue while the user is still awaiting review, a decision, approval, or other action on it. If Paperclip denies the mutation because the responsible user is unresolved, inbox management is disabled, the gardener is not allowlisted, or a trust boundary applies, report the denial and continue without retrying around policy.
After a successful archive, leave a standard gardening marker comment on the originating issue that names the archived issue and merged PR:
<!-- pr-gardening:paperclipai/paperclip#1234 -->
Inbox tidy-up: archived [PAP-310](/PAP/issues/PAP-310) from the responsible user's inbox after confirming https://github.com/paperclipai/paperclip/pull/1234 merged at current head `abc123`.
This archive is audited and reversible; later issue activity may resurface the item.
Use POST /api/issues/:issueId/comments and include X-Paperclip-Run-Id on both the archive and comment requests. In --dry-run, report the archive and marker comment that would have been written, but perform neither mutation.
Stage E — Monitor to Termination
Set the gardening run issue's blockedByIssueIds to the non-terminal prepare tasks and originating issues engaged in Stage C so blocker resolution wakes the gardener. A scheduled or manual rerun is the fallback.
On every wake, rerun Stage B first. A PR terminates from active gardening only when one of these is mechanically observed:
- verified
readyat the current head; - merged or closed externally;
- maximum rounds reached, reported as not converging.
Do not leave the gardening issue blocked on terminal issues. Do not poll agents or long-running sessions.
Stage F — Render and Publish the Report
node .agents/skills/pr-gardening/scripts/render-report.mjs \
--input "$RUN_DIR/readiness.json" \
--output "$RUN_DIR/gardening-report.md"
The report states the scope (authors + window), and for every open PR gives its author, a one-line purpose summary taken from the PR description, and a readiness confidence bucket:
- High: current-head checks green, no conflicts, Greptile clean, base fresh, originating issue terminal.
- Medium: otherwise green but base stale, review not complete, or originating issue active.
- Low: failing/pending checks, missing Greptile, draft/just-fixed-unverified state, or no identifiable origin.
If a PR's generated purpose line is empty or unhelpful, write a one-sentence description from the PR title and diff summary when publishing the report.
Upload candidates.json, readiness.json, and gardening-report.md to the gardening issue, create/update the gardening-report issue document with the Markdown body, and leave a summary comment linking the artifacts. The report is the deliverable; it is never authorization to merge.
Verification
Run focused script tests:
node --test .agents/skills/pr-gardening/scripts/pr-gardening.test.mjs
For a live dry run, execute Stages A, B, and F with --dry-run, then sanity-check named PRs only if they are still open. Merged or closed examples should appear under droppedClosedPullRequests, not in readiness results, and community-authored PRs must appear only under droppedCommunityPullRequests — a candidate or report entry with an author outside the allowlist is a scope failure. If also exercising --archive-inbox, confirm the report describes the suppressed Stage D action and that no Paperclip archive or marker-comment mutation occurred.
Alternatives
Compare before choosing
event4u-app/agent-config
design-review
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
K-Dense-AI/scientific-agent-skills
dask
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
K-Dense-AI/scientific-agent-skills
neurokit2
Use NeuroKit2 to build or audit reproducible research workflows for physiological time-series preprocessing, event/interval analysis, multimodal alignment, variability, and complexity. Trigger when code imports neurokit2 or needs its current APIs, schemas, and method-aware validation—not for diagnosis or device validation.
K-Dense-AI/scientific-agent-skills
biopython
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.