agentleFS
bazel-contribbazel-contrib/rules_python/.agents/skills/merge-pr/SKILL.md

merge-pr

Skill692 starsChanged 6 days agoApache-2.0View on GitHub

Merge a pull request into main, monitoring the merge queue,

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use implement-issue, create-issue and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GoogleSkill

    implement-issue

    Implement a Site Kit GitHub issue end-to-end from its implementation brief. Use when the user asks to implement, build, or work on a GitHub issue / feature by number (e.g. "implement issue #12345", "build the feature in issue 12345", "follow the implementation brief for #12345") in the google/site-kit-wp repo.

    Also in 3 projects that use this

  • sahinSkill

    create-issue

    Also in 3 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 1 is distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the user asks to merge a pull request (e.g., "merge PR <number>", "merge this PR", or monitor its merge):

    line 7
  2. Very specific:

    Enqueue for Merge: Run gh pr merge <pr_number> --repo bazel-contrib/rules_python --auto --squash.

    line 10
  3. Very specific:

    Draft PRs: If the PR is a draft (isDraft: true), mark it ready for review first via gh pr ready <pr_number> --repo …

    line 12
  4. Very specific:

    Never pass --admin while CI is pending or failing unless told to bypass CI.

    line 20
  5. Very specific:

    No --delete-branch (-d): Never pass -d or --delete-branch to gh pr merge.

    line 22
  6. Very specific:

    If a monitor_remote_ci.py <pr_number> background task is currently running in the parent conversation, stop it via manage_task first so …

    line 26
  7. Very specific:

    Blocked Builds (CI Config Approval): When the PR changes a file under .bazelci/ or a .yml file outside .github/, Buildkite blocks the build …

    line 38
  8. Very specific:

    When the PR is queued, actively discover the merge queue branch via gh api repos/:owner/:repo/branches --jq with '.[].name | …

    line 46
  9. Very specific:

    Blocked Merge Queue Builds: If the PR changes a file under .bazelci/ or a .yml file outside .github/, the merge queue build is blocked …

    line 51

“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

When the user asks to merge a pull request (e.g., "merge PR <number>", "merge this PR", or monitor its merge):

  1. Enqueue for Merge: Run gh pr merge <pr_number> --repo bazel-contrib/rules_python --auto --squash.
    • Draft PRs: If the PR is a draft (isDraft: true), mark it ready for review first via gh pr ready <pr_number> --repo bazel-contrib/rules_python (otherwise gh pr merge fails with Pull Request is still a draft).
    • Force / Admin Merge: CRITICAL: Only pass --admin (e.g., gh pr merge <pr_number> --repo bazel-contrib/rules_python --admin --squash) with explicit user consent ("force merge", "admin merge", or "merge immediately" once CI passes and only REVIEW_REQUIRED blocks). Never pass --admin while CI is pending or failing unless told to bypass CI.
    • No --delete-branch (-d): Never pass -d or --delete-branch to gh pr merge; it fails when a merge queue is enabled on the repository.
  2. Invoke a Background Shepherd: Launch a background subagent with the role Merge PR Shepherd to continuously watch the PR until it merges.
    • If a monitor_remote_ci.py <pr_number> background task is currently running in the parent conversation, stop it via manage_task first so Merge PR Shepherd can acquire .monitored_pr_<pr_number>.lock and receive CI failure notifications directly.
  3. Leverage Existing CI Skills:
    • Have the subagent use the monitor-ci-results skill to watch for CI check failures and generate analysis reports.
    • Have the subagent use the retry-ci-job skill (retry_ci_jobs.py --pr <pr_number>) to automatically retry any transient network flakes (e.g., HTTP 504 gateway timeouts, downloader errors, setup-bazel Unable to find Bazelisk version errors) and unblock manual approval steps.
    • Blocked Builds (CI Config Approval): When the PR changes a file under .bazelci/ or a .yml file outside .github/, Buildkite blocks the build until manually approved. Approve and unblock it immediately via ./.agents/skills/retry-ci-job/scripts/retry_ci_jobs.py --pr <pr_number> --unblock (or bk job unblock <job_id> --no-input) so CI does not sit blocked indefinitely.
    • Soft-Failing Jobs: Experimental Buildkite jobs (e.g. *rolling* Bazel) are non-blocking soft failures; do not treat them as merge blockers.
    • When the PR is queued, actively discover the merge queue branch via gh api repos/:owner/:repo/branches --jq with '.[].name | select(test("gh-readonly-queue/.*/pr-<pr_number>-"))' and monitor commit statuses/Buildkite builds running on that temporary branch.
    • Blocked Merge Queue Builds: If the PR changes a file under .bazelci/ or a .yml file outside .github/, the merge queue build is blocked again, even with the presubmit-auto-run label, and monitor_remote_ci.py doesn't watch it. Find it with bk build list --pipeline bazel/rules-python-python --branch <queue_branch> --json | jq '.[] | {number, state, blocked}', then unblock it with ./.agents/skills/retry-ci-job/scripts/retry_ci_jobs.py --buildkite-build bazel/rules-python-python/<build_number> --unblock. --pr <pr_number> resolves to the PR's build, not the queue build.
  4. Queue Shepherding: Periodically check gh pr view <pr_number> --repo bazel-contrib/rules_python --json state,autoMergeRequest,mergeStateStatus,mergeable. While state is "OPEN", if autoMergeRequest is null and no gh-readonly-queue/.*/pr-<pr_number>- branch exists, re-enqueue with gh pr merge <pr_number> --repo bazel-contrib/rules_python --auto --squash once checks are green.
  5. Completion Notification: Once state becomes "MERGED", send a high-priority message back to the parent conversation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.