agentleFS
anderson-c-santosanderson-c-santos/claude-skills-network/skills/open-pr/SKILL.md

open-pr

Skill1 starsChanged 5 months agoMITView on GitHub

Create a GitHub Pull Request for the current branch. Trigger for: /open-pr, create PR, open pull request, push and PR, submit PR. Gathers diff summary, writes title+body, pushes branch, opens PR via gh CLI.

  • Commits and pushes

20 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use commit, review-pr and 9 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.
  • 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 9 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 4 projects that use this

  • HashiCorpSkill

    changelog

    Add a `.changelog/<PR_NUMBER>.txt` entry for a GitHub Pull Request, commit, and push.

    Also in 3 projects that use this

  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 3 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 5 projects that use this

  • AWSSkill

    prototype

    Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If there are uncommitted changes: warn and ask whether to commit them first or proceed with existing commits only.

    line 23
  2. Distinctive:

    If git log returns nothing → STOP: "No commits ahead of $BASE — nothing to PR."

    line 42
  3. Distinctive:

    If a PR already exists → show its URL, do not create a duplicate.

    line 48
  4. Very specific:

    If diff >300 lines: read --stat + commit messages only to infer intent.

    line 54
  5. Distinctive:

    No commits ahead of base: STOP — nothing to PR

    line 105

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

Open PR

Push the current branch and open a well-structured GitHub Pull Request. After this, use /pr-review or /merge-pr.

Invocation Forms

  • /open-pr — PR from current branch to default base
  • /open-pr --draft — open as draft PR
  • /open-pr --base <branch> — override base branch
  • /open-pr --reviewer <handle> — request a reviewer

Workflow

0. Prerequisites

gh auth status    # must be authenticated
git status        # check for uncommitted changes

If there are uncommitted changes: warn and ask whether to commit them first or proceed with existing commits only.

1. Detect base branch

BASE=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|.*/||')
# If that fails, fallback:
BASE=${BASE:-$(git branch -r | grep -E 'origin/(main|master)' | head -1 | sed 's|.*/||')}
BASE=${BASE:-main}
echo "Base branch: $BASE"

2. Gather context (run in parallel)

git branch --show-current                    # current branch name
git log $BASE...HEAD --oneline               # commits on this branch
git diff $BASE...HEAD --stat                 # files changed summary
git remote get-url origin                    # repo URL (to resolve owner/repo)

If git log returns nothing → STOP: "No commits ahead of $BASE — nothing to PR."

3. Check for existing PR

gh pr list --head $(git branch --show-current) --json url --jq '.[0].url'

If a PR already exists → show its URL, do not create a duplicate.

4. Read the diff

git diff $BASE...HEAD

If diff >300 lines: read --stat + commit messages only to infer intent.

5. Draft PR title and body

Title rules:

  • Max 70 characters
  • Format: <type>: <concise description>
  • Types: feat / fix / refactor / chore / docs / hotfix
  • Infer type from branch name prefix

Body template:

## Summary
- <what this PR does — 1-3 bullets>

## Changes
- `<file or module>`: <what changed and why>

## Test plan
- [ ] <manual test step>
- [ ] <edge case to verify>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

6. Push branch

# Check if remote branch exists
git ls-remote --heads origin $(git branch --show-current) | grep -q . \
  && echo "already pushed" \
  || git push -u origin $(git branch --show-current)

7. Create PR

gh pr create \
  --title "<title>" \
  --body "$(cat <<'EOF'
<body>
EOF
)" \
  --base "$BASE" \
  ${DRAFT:+--draft} \
  ${REVIEWER:+--reviewer "$REVIEWER"}

8. Output

PR URL only. No recap.

Edge Cases

  • Uncommitted changes: warn — ask commit first or skip
  • No commits ahead of base: STOP — nothing to PR
  • gh not authenticated: suggest gh auth login
  • Existing open PR: show URL, do not duplicate
  • Draft flag: pass --draft to gh pr create
  • Force-pushed branch: git push -u origin <branch> --force-with-lease (safer than --force)

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.