agentleFS
oleg-chibikovoleg-chibikov/agent-skills/skills/create-pr/SKILL.md

create-pr

Skill1 starsChanged 3 months agoMITView on GitHub

Use when the user asks to open, create, raise or update a pull request, write a PR description, or fill in a PR body, in any repository. Produces a PR description under 20 lines with three sections (problem, solution, packages picked or rejected), written in bullets anyone can scan, then creates or updates the PR with gh.

  • Commits and pushes

91 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use update-pr, create-issue 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 5 projects that use this

  • sahinSkill

    create-issue

    Also in 9 projects that use this

  • anderson-c-santosSkill

    merge-pr

    Merge a GitHub PR after all checks pass. Trigger for: /merge-pr, merge PR, approve and merge, squash merge, ship PR. Verifies CI, draft state, and approvals, then merges with the correct strategy based on branch type.

    Also in 3 projects that use this

  • SentrySkill

    fix-ci

    Diagnose and fix failing CI on a PR. Load repo-setup first.

    Also in 6 projects that use this

  • Microsoft AzureSkill

    review-pr

    Review a pull request for functional issues, coding guideline adherence, and best practices. Use this when asked to review, inspect, or provide feedback on a pull request (Azure DevOps or GitHub). Proposes comments for user approval before posting.

    Also in 21 projects that use this

  • 32103210Skill

    create-rule

    Create Cursor rules for persistent AI guidance. Use when you want to create a rule, add coding standards, set up project conventions, configure file-specific patterns, create RULE.md files, or asks about .cursor/rules/ or AGENTS.md.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 82 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Describe only: write the title and body, show them, stop.

    line 10
  2. Very specific:

    Create or update: write them, then run gh. "Make a PR" means this one.

    line 11
  3. Distinctive:

    No convention? One short imperative sentence: what the change does, not how.

    line 53
  4. Distinctive:

    Only these are the PR body's own:

    line 122
  5. Very specific:

    Every gh MUST carry the GH_PAGER=cat prefix, or it opens a pager and hangs.

    line 136
  6. Distinctive:

    Write the body to a temp file rather than passing it inline, so newlines and backticks survive.

    line 150
  7. Very specific:

    After a rebase or force push, gh pr view --json mergeable can report a stale conflict.

    line 161

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

Two modes, picked by what the user asked for:

  • Describe only: write the title and body, show them, stop.
  • Create or update: write them, then run gh. "Make a PR" means this one.

1. Collect the facts

You MUST NOT guess what the change does. Read it.

git rev-parse --abbrev-ref HEAD                  # current branch
git log --oneline "$base"..HEAD                  # commits on this branch
git diff --stat "$base"...HEAD                   # files touched
git diff "$base"...HEAD                          # the actual change
GH_PAGER=cat gh pr view --json number,title,body # PR already open?

$base is the branch this one came off. Work it out once:

remote=$(git remote | grep -qx origin && echo origin || git remote | head -1)
base=$remote/$(GH_PAGER=cat gh repo view --json defaultBranchRef \
  -q .defaultBranchRef.name)

The remote is origin almost everywhere, and on a fork or a mirror it is not. Its name MUST be read, rather than typed.

Also check:

  • A PR template: .github/pull_request_template.md or files under .github/PULL_REQUEST_TEMPLATE/.
  • The repo's commit and PR rules: CONTRIBUTING.md, AGENTS.md, CLAUDE.md.
  • An issue id in the branch name or commits (PROJ-123, JIRA-123, #42).

Repo rules MUST win over this skill. With a template, keep the parts it demands (checkboxes, headings) and put the three sections below inside it.

2. Title

The title MUST follow the repo's commit convention. Common ones:

  • PROJ-123: add page pattern examples (issue id prefix)
  • feat(auth): add page pattern examples (conventional commits)

No convention? One short imperative sentence: what the change does, not how.

3. Body

You MUST load the writing-style skill before the first line, the way section 4 says.

A Jira ticket covers this change? Its name MUST go on the first line of the body, alone, before the sections: PROJ-123. Name only, no link. Find it in the branch name or the commits, ask if neither has one, skip the line if there is no ticket.

Then exactly these three sections, in this order. The body MUST stay under 20 lines. It is read on a phone, in a notification, by someone who has not opened the diff.

## What problem this solves

<Who was hurting and how. One or two sentences, the symptom a person could see,
not the internals. Three symptoms or more go in bullets instead.>

## How it works now

<What the change does, in order. Two to five bullets, one line each. Each one
opens with its point in bold, then the behaviour. The file name only if it
helps.>

## Packages

<Every dependency this change adds, one line each: the name, what it does for
us, its size. Then the ones you looked at and turned down, one line each, with
the reason. Nothing added? Write "No new packages." and, if a well known
package would have fit, say why you wrote it by hand instead.>

A paragraph MUST stop at three lines, and a bullet at two. Over the cap? Cut a bullet, the wording stays as it is.

What belongs in Packages

Third party code the change now depends on, or would have. A new peer or dev dependency counts.

The repo's own tooling MUST stay out: Vitest, Nx, the linter. Same for MCP servers, editors and agents. How the code got written is not part of the change.

You MUST check the diff before writing this section. A package the manifest doesn't show MUST NOT be claimed: git diff "$base"...HEAD -- '**/package.json' 'package.json'.

A turned-down package MUST carry its reason in a few words: size, unmaintained, its licence, it drags in a lot, the repo already does the job, or the hand-written version is ten lines.

Examples:

  • "date-fns 3.6, 2 kB after tree shaking, formats the due dates."
  • "Turned down moment: 70 kB and no tree shaking."
  • "No new packages. lodash.groupby would have done it, but Object.groupBy ships in every browser we support."

4. How to write it

You MUST load the writing-style skill first, from writing-style/SKILL.md in this skills folder. It holds every rule about the words and the checklist to run before posting, and its "Shape on the page" section sets the layout. Load it once, unless it is in context.

Only these are the PR body's own:

  • It MUST land on the first read, with zero context on this codebase.
  • A section heading already says what the section is, so the line under it MUST start with the fact.
  • The change MUST be there, the work MUST NOT: what the code does now, no line counts, no file counts, no "refactored".
  • A guess MUST be marked as a guess.

Reread the body once before posting, and every word the reader can do without MUST go.

5. Create or update the PR

Every gh MUST carry the GH_PAGER=cat prefix, or it opens a pager and hangs.

Push first when the branch has no upstream:

git push -u "$remote" HEAD

New PR:

GH_PAGER=cat gh pr create --base <base> --title "<title>" --body-file <file>

Write the body to a temp file rather than passing it inline, so newlines and backticks survive.

Existing PR:

GH_PAGER=cat gh pr edit --title "<title>" --body-file <file>

--draft MAY go in only when the user asked for a draft.

After a rebase or force push, gh pr view --json mergeable can report a stale conflict. Any edit resets it, so re-query once when the answer looks wrong.

6. Report back

One or two lines: the PR link and the title. Nothing else.

Guardrails

  • A push or a PR on a protected or default branch MUST NOT happen. Stop and say so.
  • A problem statement MUST NOT be invented. The diff doesn't say why the change exists? Ask the user one question.
  • Force pushing, amending published commits and --no-verify MUST NOT happen.
  • Unrelated staged or untracked files MUST be left alone.

Example body

PROJ-123

## What problem this solves

Uploading a photo over 5 MB failed with a blank screen. People retried the same
file several times and then gave up, so support got about 30 tickets a week.

## How it works now

- **Cap** files up to 25 MB upload. The old cap was 5 MB.
- **Too big** the error names the limit and the file's own size, so the person
  knows what to do next.
- **Double submit** the upload button stays disabled while a file is in flight.

## Packages

- `browser-image-compression` 2.0, 12 kB, shrinks a photo in the browser
  before it goes up.
- Turned down `sharp`: it only runs on the server, and the point here is to
  cut the upload before it starts.
- Turned down `filesize`: printing "25 MB" is three lines of our own code.

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.