agentleFS
hybridindiehybridindie/comfyui_mcp/.claude/skills/ship-pr/SKILL.md

ship-pr

Skill2 starsChanged 7 days agoMITView on GitHub

Open or update a PR, watch CI and review, address review threads, and merge only with explicit --merge.

  • Commits and pushes

38 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ideate, review-diff and 10 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.
  • OpenAISkill

    ideate

    Generate image-based alternatives, remixes, or new design directions from a Product Design brief. Use when the user asks for design variants, visual exploration, remixes, or image-generated approaches from provided context.

    Also in 4 projects that use this

  • thunderkdsSkill

    review-diff

    Generate a Markdown review file with C4 architecture diagrams and code walkthrough for the current git changes

    Also in 3 projects that use this

  • tekumaraSkill

    babysit-pr

    Monitor a pull request through review and CI, enabling GitHub auto-merge by default. Use when the user asks to monitor, watch, or babysit a PR.

    Also in 3 projects that use this

  • jaydubya818Skill

    why

    Use when design rationale must be recovered from source history and available records.

    Also in 3 projects that use this

  • Hugging FaceSkill

    implement

    Make tests pass. Invoke after /write-tests produces failing tests.

    Also in 6 projects that use this

  • Google CloudSkill

    triage

    Gather context on a change or bug and plan the implementation.

    Also in 4 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 38 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Read: PR metadata, checks, unresolved review threads, and the diff only when a thread needs it.

    line 26
  2. Distinctive:

    Do not read: the whole repository or unrelated PRs.

    line 28
  3. Distinctive:

    Update the body only when scope or verification changed.

    line 44
  4. Distinctive:

    Watch: Run the watcher in the background:

    line 45
  5. Very specific:

    If branch protection needs a human approval, stop and report it.

    line 86
  6. Distinctive:

    Use judgment only for:

    line 91
  7. Distinctive:

    Do not invent CI results or resolve a thread you did not handle.

    line 97
  8. Distinctive:

    Stop if the worktree is dirty, the branch is unpushed, or preflight fails.

    line 110
  9. Distinctive:

    Stop if the watcher times out or the PR is blocked on a human approval.

    line 111
  10. Distinctive:

    Stop after three review cycles and report the remaining threads.

    line 112
  11. Very specific:

    Never merge without the caller's explicit --merge.

    line 113
  12. Distinctive:

    Default: read PR metadata, checks, and unresolved threads.

    line 117
  13. Distinctive:

    Do not re-fetch the same threads after a push.

    line 120
  14. Distinctive:

    Do not dump full review threads or CI logs.

    line 122

“Common” is measured: kept by at least 6 in 10 of the 38 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

Ship PR

<!-- contract: .claude/rules/doctrine/skill-execution.md version: 2.0.0, owner: John D invokes: ship-pr/scripts/watch_pr.py -->

Open or update a PR, watch CI/review, address threads, and merge only when the caller asked for --merge.

Inputs

  • Required: a PR number/URL or the current branch; explicit --merge to allow merging.
  • Read: PR metadata, checks, unresolved review threads, and the diff only when a thread needs it.
  • Do not read: the whole repository or unrelated PRs.

Deterministic Steps

  1. Preflight. Require git status clean and the branch pushed. Confirm the PR body links an issue (Closes #N or a link). Run /preflight; fix failures, never bypass a hook.
  2. Find the PR.
    gh pr view --json number,url,state 2>/dev/null
  3. Open if missing. Compose the body from the real change: what/why, verified commands, risks/rollback, issue link. Then:
    gh pr create --base main --title "<type>(<scope>): <summary>" --body-file <file>
    Update the body only when scope or verification changed.
  4. Watch. Run the watcher in the background:
    gitdir=$(git rev-parse --git-dir)
    watcher=.claude/skills/ship-pr/scripts/watch_pr.py
    [[ -f $watcher ]] || watcher=templates/_shared/skills/ship-pr/scripts/watch_pr.py
    python3 "$watcher" "$PR" --timeout 1200 > "$gitdir/ship-pr-watch.log" 2>&1 &
    Exit codes: 0 settled, 10 CI failed, 20 changes requested, 30 blocked/draft/conflict, 40 timeout, 50 merged/closed. It never merges.
  5. Fetch unresolved threads.
    python3 .claude/skills/ship-pr/scripts/pr_threads.py --pr "$PR"
    The script owns the GraphQL query, repo lookup, and resolved/outdated filter.
  6. Triage each. Real defect → fix + test + rerun preflight + push. Misread → reply with evidence. Separate concern → linked follow-up issue + reply. Ambiguous → leave open and list for the human.
  7. Reply and resolve.
    gh api graphql -f query='
    mutation($thread: ID!, $body: String!) {
      addPullRequestReviewThreadReply(input: {pullRequestReviewThreadId: $thread, body: $body}) {
        comment { id }
      }
    }' -F thread="$THREAD" -F body="$BODY"
    Resolve only what was handled or rebutted:
    gh api graphql -f query='
    mutation($thread: ID!) {
      resolveReviewThread(input: {threadId: $thread}) { thread { isResolved } }
    }' -F thread="$THREAD"
  8. Loop cap. Repeat watch/fix at most three cycles; then report what remains.
  9. Merge only with --merge. Require preflight green, watcher 0, mergeStateStatus=CLEAN, no CHANGES_REQUESTED, no unresolved blocking thread, and no do-not-merge label. Then:
    gh pr merge "$PR" --squash --delete-branch
    This repo squash-merges (see .claude/rules/enforcement.md rule 26). If branch protection needs a human approval, stop and report it. Do not use --admin or bypass hooks.

LLM Judgment

Use judgment only for:

  • classifying a review comment as defect, misread, or separate concern;
  • writing the reply/rebuttal;
  • deciding whether an ambiguous thread needs the human.

Do not invent CI results or resolve a thread you did not handle.

Output

PR: <url>
CI: <final state>    Review: <state>    Merge: <commit or not merged>
Threads: <fixed> fixed, <rebutted> rebutted, <open> open
Follow-ups: <links or none>

Stop Conditions

  • Stop if the worktree is dirty, the branch is unpushed, or preflight fails.
  • Stop if the watcher times out or the PR is blocked on a human approval.
  • Stop after three review cycles and report the remaining threads.
  • Never merge without the caller's explicit --merge.

Token Budget

  • Default: read PR metadata, checks, and unresolved threads; open the diff for a thread only when needed. Read the full thread when a truncated body would make the triage a guess.
  • Do not re-fetch the same threads after a push; watch once, then fetch.
  • Target ≤ 250 words; use a compact table if there are more than five threads.
  • Do not dump full review threads or CI logs.

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.