agentleFS
fritzprixfritzprix/libr-agent/.agents/skills/create-pr/SKILL.md

create-pr

Skill11 starsChanged 2 months agoMITView on GitHub

Create a GitHub pull request with gh, target the correct base branch, push only committed work, and bind related issues via Fixes/Closes keywords. Use when asked to create a PR, open a pull request, push and open PR, link/bind/associate an issue to a PR, add Fixes #N, or close issues on merge.

  • 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

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 82 edited versions we read keep these.

  • 6

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Only committed changes go into the PR.

    line 16
  2. Distinctive:

    Do not update git config, force-push, or skip hooks unless the user explicitly asks.

    line 17
  3. Very specific:

    Prefer gh for all GitHub operations.

    line 18
  4. Very specific:

    Use the printed name as <base> everywhere below (git log, git diff, gh pr create --base).

    line 32
  5. Distinctive:

    Always attach issues the PR actually resolves or substantially addresses.

    line 96
  6. Distinctive:

    Put closing keywords in the PR body (preferred) or add them via:

    line 99
  7. Very specific:

    Verify link: gh pr view <number> --json body,closingIssuesReferences (or check the issue sidebar on GitHub).

    line 105
  8. Distinctive:

    If the user only asked to bind an existing PR: skip create.

    line 111
  9. Distinctive:

    Do not push again unless new commits were added.

    line 112

“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 PR and Bind Issues

Open a reviewable PR from the current branch and attach the right GitHub issues so merge auto-closes them.

Preconditions

  • Only committed changes go into the PR. Leave uncommitted/WIP files out (or ask before committing).
  • Do not update git config, force-push, or skip hooks unless the user explicitly asks.
  • Prefer gh for all GitHub operations.

Resolve base branch

If the user names a base (e.g. dev/0.8.x, main) → use that exactly.

If the user does not name a base → use the latest dev/<version> branch on origin (semver; treat .x as the highest patch for that minor). Do not hardcode a version.

git fetch origin 'refs/heads/dev/*:refs/remotes/origin/dev/*'
python .agents/skills/create-pr/scripts/resolve_dev_base.py
# → e.g. dev/0.8.x

Use the printed name as <base> everywhere below (git log, git diff, gh pr create --base).

Workflow

1. Inspect branch state (parallel)

After resolving <base>:

git status
git diff
git rev-parse --abbrev-ref HEAD
git status -sb
git fetch origin <base>
git log --oneline origin/<base>..HEAD
git diff --stat origin/<base>...HEAD
gh pr list --head <current-branch> --json number,title,url,state,baseRefName

2. Decide branch / PR shape

SituationAction
Open PR already exists for this headUpdate it (gh pr edit) or push; do not open a duplicate
Head branch was merged earlier; new commits remainNew PR from same or cleaner branch is OK; confirm origin/<base>..HEAD is only the intended commits
Mixed concerns on one branchPrefer a clean branch from origin/<base> + cherry-pick (or ask) before opening

3. Push, then create

git push -u origin HEAD
gh pr create --base <base> --title "<title>" --body "$(cat <<'EOF'
## Summary
- <1-3 bullets: why / user-visible effect>

Fixes #<issue>

## Test plan
- [ ] <concrete checks>

EOF
)"

On Windows PowerShell, use a here-string for --body instead of bash HEREDOC:

gh pr create --base $base --title "..." --body @"
## Summary
- ...

Fixes #1234

## Test plan
- [ ] ...
"@

Title/body style: match recent repo commits (fix(scope): …, feat(scope): …). Include issue number in title only if helpful; always put a closing keyword in the body (see below).

Return the PR URL when done.

4. Bind relevant issues

Always attach issues the PR actually resolves or substantially addresses.

  1. Infer candidates from: user message, branch name (fix/1641-…), commit messages ((#1641)), and gh issue list / gh issue view when needed.
  2. Put closing keywords in the PR body (preferred) or add them via:
gh pr edit <number> --body "$(…updated body with Fixes #N…)"
  1. Verify link: gh pr view <number> --json body,closingIssuesReferences (or check the issue sidebar on GitHub).

Keyword details and multi-issue examples: references/issue-linking.md.

5. After create (optional)

  • If the user only asked to bind an existing PR: skip create; edit body / confirm closing references.
  • Do not push again unless new commits were added.

Quick checks before opening

  • Diff vs base matches the intended fix only
  • No secrets / generated noise unless intentional
  • At least one Fixes / Closes / Resolves line when an issue exists
  • Base is user-specified or latest dev/<version> from resolve_dev_base.py

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.