← 返回列表
全部 Skill›工具 Tools›pr-gardening

pr-gardening

作者 @paperclipai · 语言 en
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.
工具 Tools生产力工具通用执行命令访问网络待翻译
最近源活动
—
检测 SKILL.md 语言
en
星标 ★
116,728
分支 Fork
0
安装选项
提示
指令
使用 AI 助手安装
将下面的提示复制到你正在使用的 AI 助手中。
下载完整 Skill 目录(含全部配套文件)。 下载压缩包 ↓
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-pr against a community PR. Only PRs from the Stage A author allowlist are actionable.
  • Never use mutating gh commands or mutating GitHub API requests. The scripts only use gh pr view and read-only gh api GET 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-run suppresses 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, default 14. Applies to both mentioning-issue activity and the PR's own updatedAt; 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 the gh authenticated user.
  • --include-community: disable the author filter entirely. Only on explicit caller request.
  • --repo <owner/repo>: GitHub repository, default detected by gh 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, default 48.
  • --max-rounds <N>: maximum gardening rounds per PR, default 3.

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;
  • statusCheckRollup check-run and legacy status inventory;
  • a completed Greptile check-run on the exact head, clean only for success or neutral;
  • 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:

  1. Search open Paperclip issues for the exact branch name with statuses backlog, todo, in_progress, in_review, and blocked.
  2. Inspect matching issue titles, descriptions, and recent comments for an equivalent open "create PR from this branch" task for the same branch.
  3. 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.
  4. 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

评论
Ppaperclipai
paperclipai
paperclipai/paperclip
查看 GitHub 仓库 查看作者的其他 Skill
来源信息
作者@paperclipai
所属大类工具 Tools / 生产力工具
国内可用性通用
最近源活动—
风险提示执行命令、访问网络
提示:风险标签为程序静态扫描结果,仅作提示,不代表安全认证。安装前请阅读 SKILL.md 及其引用的脚本、权限,自行判断是否可信。