agentleFS
BlockKnown publisherblock/berd/.agents/skills/create-pr/SKILL.md

create-pr

Skill1k starsChanged 3 months agoApache-2.0View on GitHub

Create a GitHub PR from the current branch: handle uncommitted changes, generate a summary, submit via gh CLI, then watch the PR to a ready state — fixing failing checks and addressing review comments. Use when the user says "create PR", "open PR", "submit PR", "push PR", or wants to create a pull request.

  • Commits and pushes

We split this skill into the rules it gives an agent

36 rules. 0 are common, 32 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 178 edited versions we read keep these.

  • 32

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create a GitHub PR from the current branch: handle uncommitted changes, generate a summary, submit, then watch the PR until it is in a …

    line 12
  2. Very specific:

    Before doing anything else, identify the PR base branch.

    line 16
  3. Distinctive:

    Run git status to check for staged, unstaged, or untracked changes.

    line 22
  4. Distinctive:

    If there are uncommitted changes, show the user what's outstanding and ask if they'd like to commit them before creating the PR.

    line 24
  5. Distinctive:

    If the user says yes, stage the relevant files, draft a concise commit message based on the changes, and commit.

    line 25
  6. Distinctive:

    If there are no uncommitted changes, move on.

    line 26
  7. Distinctive:

    Run these commands in parallel to understand the branch:

    line 30
  8. Distinctive:

    Start with metadata tags, then a Problem/Solution block:

    line 46
  9. Distinctive:

    Keep Problem + Solution to 2-4 sentences total.

    line 53
  10. Distinctive:

    Keep issue tracking lightweight and automatic.

    line 77
  11. Distinctive:

    Before creating the PR:

    line 79
  12. Distinctive:

    Look for an explicit GitHub issue reference in the current conversation, branch name, commit messages, PR title, or PR body.

    line 81
  13. Distinctive:

    If no issue is explicit, search the repository's open GitHub issues using the branch name, commit subjects, changed-file intent, and PR …

    line 82
  14. Distinctive:

    If one issue clearly matches the same user need or implementation intent, use it.

    line 83
  15. Very specific:

    Create the PR using gh pr create with the generated title and body.

    line 90
  16. Distinctive:

    Keep track of the latest head SHA.

    line 97
  17. Very specific:

    Use a non-blocking polling loop until both review feedback and CI have settled.

    line 101
  18. Distinctive:

    If actionable feedback exists, evaluate and address it immediately.

    line 106
  19. Distinctive:

    Only when no actionable feedback remains, fetch the current check states and handle failures or pending checks.

    line 107
  20. Distinctive:

    If checks are still pending and no feedback needs action, sleep for a fixed interval, then begin a new cycle from step 1.

    line 108
  21. Distinctive:

    Use whatever non-blocking commands are available, such as:

    line 110
  22. Distinctive:

    After every code push, comment reply, or thread resolution, restart from the latest head SHA and begin with a fresh feedback sweep.

    line 117
  23. Distinctive:

    When a check fails or gets stuck, decide whether it looks flaky/infrastructure-related or caused by the PR.

    line 121
  24. Very specific:

    If rerun is not available because of permissions or tooling limits, push an empty commit as a last-resort CI kick: confirm the working tree …

    line 126
  25. Distinctive:

    After any rerun or empty commit, restart the loop from the latest head SHA.

    line 127
  26. Distinctive:

    Read the failing logs enough to understand the cause.

    line 131
  27. Distinctive:

    Run the relevant local tests, linters, type checks, or targeted commands.

    line 134
  28. Distinctive:

    Commit only the intended changes and push, then restart the loop from the new head SHA.

    line 135
  29. Distinctive:

    Prefer rerunning before pushing an empty commit.

    line 137
  30. Distinctive:

    Read all PR comments, review summaries, inline review comments, and unresolved review threads from both people and bots.

    line 141
  31. Distinctive:

    If you take path 1 or 2: make the code changes, commit, and push.

    line 156
  32. Distinctive:

    If you take path 3: always comment back with a concise, respectful rationale for why you did not make the change, but do not resolve the …

    line 157
  33. Distinctive:

    Only review threads can be resolved.

    line 159
  34. Distinctive:

    After any code change, comment reply, or thread resolution, check whether new feedback arrived and restart this loop if needed.

    line 161
  35. Distinctive:

    When that state is reached, tell the user the PR is in a ready state, and include the PR URL, what CI/review issues you handled, and any …

    line 170
  36. Distinctive:

    Write from the perspective of a product designer explaining their thinking to engineers.

    line 174

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

Create PR

Create a GitHub PR from the current branch: handle uncommitted changes, generate a summary, submit, then watch the PR until it is in a ready state.

Step 1: Resolve Base Branch

Before doing anything else, identify the PR base branch. Prefer the branch's upstream base or the repository's default branch from git remote show origin. Fall back to origin/main only if the repo does not expose a default branch.

Remind the user to rebase onto the base branch if they have not already. Ask if they would like to proceed or rebase first.

Step 2: Check for Uncommitted Changes

Run git status to check for staged, unstaged, or untracked changes.

  • If there are uncommitted changes, show the user what's outstanding and ask if they'd like to commit them before creating the PR.
  • If the user says yes, stage the relevant files, draft a concise commit message based on the changes, and commit.
  • If there are no uncommitted changes, move on.

Step 3: Gather Branch Context

Run these commands in parallel to understand the branch:

  1. git log <base>..HEAD --oneline to see all commits on this branch.
  2. git diff <base>..HEAD --stat to get the list of changed files.
  3. git diff <base>..HEAD to understand what changed in each file.
  4. git rev-parse --abbrev-ref HEAD to get the current branch name.
  5. git status to check if the branch has been pushed to remote.

Step 4: Generate PR Title and Summary

Title: Generate a concise PR title (under 72 characters) that captures the intent of the change. Use conventional style: lowercase, imperative mood (e.g., "prevent chat list from reordering when renaming sessions").

Body: Generate a PR summary with these sections:

Section 1: Overview

Start with metadata tags, then a Problem/Solution block:

  • **Category:** — one of: new-feature, improvement, fix, infrastructure
  • **User Impact:** — one sentence describing what changed from the user's perspective. Write this as a standalone sentence a non-technical stakeholder would understand (e.g., "Users can now create and schedule repeatable tasks directly from the desktop app."). This line is used for project changelogs.
  • **Problem:** — describe the user-facing confusion, mismatch, or friction this PR addresses.
  • **Solution:** — explain how the change resolves that UX problem and, if applicable, why the approach was chosen.

Keep Problem + Solution to 2-4 sentences total. Prioritize intent and expected user experience, but include brief high-level implementation rationale when it explains reliability, maintainability, or code quality.

Section 2: Changes

Wrap this section in a collapsible <details> block with the summary "File changes".

Inside, list every changed file. For each file, use the filename as a bold header, then underneath write one or two sentences about what was changed and why. Focus on intent, not implementation details.

Format:

<details>
<summary>File changes</summary>

**path/to/file.ts**
What changed and why.

**path/to/other.rs**
What changed and why.

</details>

Step 5: Resolve And Link A GitHub Issue

Keep issue tracking lightweight and automatic. Complete the issue decision before pushing or creating the PR; a user request to create a PR is not permission to skip issue resolution.

Before creating the PR:

  1. Look for an explicit GitHub issue reference in the current conversation, branch name, commit messages, PR title, or PR body.
  2. If no issue is explicit, search the repository's open GitHub issues using the branch name, commit subjects, changed-file intent, and PR title.
  3. If one issue clearly matches the same user need or implementation intent, use it. If a few issues could match, pause and ask the user which one to link. If none match, continue without creating an issue unless the user asks for one.

When an issue is resolved, include Closes #<number> in the PR body so GitHub links the work and closes the issue when the PR merges. Use Refs #<number> instead when the PR contributes to the issue without completing it. Verify the rendered PR shows the intended issue relationship.

Step 6: Push and Create PR

  1. Push the branch to remote if it hasn't been pushed yet: git push -u origin HEAD
  2. Create the PR using gh pr create with the generated title and body. Use a HEREDOC for the body to preserve formatting.
  3. Output the PR URL as a clickable hyperlink so the user can open it directly.

Step 7: Watch the PR to a Ready State

Once the PR is created, do not stop. Own the loop from "PR is open" to "PR is in a ready state": watch GitHub, fix failing checks, and address review comments until checks pass and no actionable feedback remains. This step ends at a ready state — it does not merge the PR.

Keep track of the latest head SHA. Any new push changes the CI/review baseline and restarts this loop.

Poll feedback first, then CI

Use a non-blocking polling loop until both review feedback and CI have settled. Never use gh pr checks --watch or any other command that blocks until checks finish because review feedback commonly arrives while CI is still running.

Each polling cycle must run in this order:

  1. Fetch all new top-level comments, review summaries, inline comments, and unresolved review threads.
  2. If actionable feedback exists, evaluate and address it immediately. Do not wait for pending checks; any fix will restart CI anyway.
  3. Only when no actionable feedback remains, fetch the current check states and handle failures or pending checks.
  4. If checks are still pending and no feedback needs action, sleep for a fixed interval, then begin a new cycle from step 1.

Use whatever non-blocking commands are available, such as:

  • gh pr view for PR state, reviews, comments, and mergeability.
  • Repeated gh pr checks without --watch for current check status.
  • gh run list, gh run view, and gh run rerun for workflow failures and reruns.
  • GitHub API/GraphQL to inspect review threads and unresolved conversations.

After every code push, comment reply, or thread resolution, restart from the latest head SHA and begin with a fresh feedback sweep.

Handle failing or stuck checks

When a check fails or gets stuck, decide whether it looks flaky/infrastructure-related or caused by the PR.

If it looks flaky or infrastructure-related:

  1. Try to rerun the failed job/check first.
  2. If rerun is not available because of permissions or tooling limits, push an empty commit as a last-resort CI kick: confirm the working tree has no unrelated changes, then git commit --allow-empty -m "chore: rerun CI" and push.
  3. After any rerun or empty commit, restart the loop from the latest head SHA.

If it looks like a real failure:

  1. Read the failing logs enough to understand the cause.
  2. Reproduce locally when practical.
  3. Fix the root cause, not just the symptom.
  4. Run the relevant local tests, linters, type checks, or targeted commands.
  5. Commit only the intended changes and push, then restart the loop from the new head SHA.

Prefer rerunning before pushing an empty commit. Prefer fixing code before repeatedly rerunning a failure that has evidence of being real.

Handle GitHub comments

Read all PR comments, review summaries, inline review comments, and unresolved review threads from both people and bots.

Evaluate every comment from two perspectives:

  • Senior software engineer: correctness, maintainability, test coverage, reliability, security, architecture, readability, and long-term cost.
  • Product designer: user behavior, UX clarity, accessibility, visual/system consistency, edge cases, and whether the implementation matches product intent.

For each comment, choose the path that best matches the intent of the PR:

  1. Apply the recommended fix — the suggestion is right for the PR, so make it as described.
  2. Apply a better or different fix — the comment points at a real issue, but a larger, more holistic, or a simpler fix more closely matches the PR's intent. Prefer the systemic fix over a band-aid, and use the design system and its tokens for UI work.
  3. Decline the fix — the suggestion is not valid for the intention of the PR (incorrect, harmful, out of scope, or would work against the PR's goal).

After deciding:

  • If you take path 1 or 2: make the code changes, commit, and push. Then always comment back explaining what changed, and resolve the thread when the comment is a resolvable review thread.
  • If you take path 3: always comment back with a concise, respectful rationale for why you did not make the change, but do not resolve the thread — leave it open so the user can see that something was not resolved and decide for themselves.

Only review threads can be resolved. Top-level PR comments and review summaries are not resolvable threads, so reply to them when they call for it but do not try to resolve them.

After any code change, comment reply, or thread resolution, check whether new feedback arrived and restart this loop if needed.

Done

The workflow is complete when all of the following are true on the latest head commit:

  • Checks are passing.
  • No actionable feedback remains. Every comment has either been addressed (fixed, committed, replied to, and its review thread resolved) or intentionally declined (replied to with a rationale and left open on purpose). Declined-but-open threads and non-resolvable top-level comments do not block the ready state — do not keep polling for them or try to resolve them.

When that state is reached, tell the user the PR is in a ready state, and include the PR URL, what CI/review issues you handled, and any commits you pushed. Stop watching unless the user asks you to keep going.

Tone

Write from the perspective of a product designer explaining their thinking to engineers. Be clear and concise — just enough to establish intent. They can read the code; your job is to guide their understanding of the "why."

Download now (ZIP)

  • Other versions196 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 196

    1. microsoft/vscode★ 194ksame name
    2. vercel/next.js★ 143ksame name
    3. penpot/penpot★ 62ksame name
    4. remix-run/react-router★ 57ksame name
    5. moeru-ai/airi★ 51ksame name
    6. ToolJet/ToolJet★ 41ksame name
    7. ueberdosis/tiptap★ 39ksame name
    8. BabylonJS/Babylon.js★ 26ksame name
    9. kortix-ai/suna★ 20ksame name
    10. ryoppippi/ccusage★ 19ksame name

    186 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use update-pr, act-on-feedback 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.
    • MicrosoftSkill

      update-pr

      Update the pull request for the current session. Use when the user wants to push new changes to an existing PR.

      Also in 9 projects that use this

    • MicrosoftSkill

      act-on-feedback

      Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.

      Also in 3 projects that use this

    • ModelEngine-GroupSkill

      create-release-note

      从 PR/commit 中自动生成结构化的 Release Notes,并可选创建 GitHub Draft Release。支持 x.y.0 版本合并前一 minor 系列的 release notes。当用户要求生成发布说明、创建 release notes 时触发。参数为版本号和可选的上一版本号。

      Also in 3 projects that use this

    • frostneySkill

      native-nostalgia-stack

      Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.

      Also in 3 projects that use this

    • frostneySkill

      roadmap-review

      Reviews a roadmap from fresh project evidence and produces a verified, throughput-anchored version plan, with execution gated on confirmation. Use when reviewing a roadmap, planning releases, or sequencing a backlog.

      Also in 3 projects that use this

    • Hey-DigaSkill

      review-pr-comments

      Review and apply Claude's PR feedback interactively. Use after receiving a Claude Code review on a PR to triage and implement feedback.

      Also in 4 projects that use this

    • +1 more from microsoft
    • +1 more from frostney
  • In this repository18 other files it gives its agents.

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.