agentleFS
forjdforjd/agent-skills/skills/github-pr/SKILL.md

github-pr

Skill2 starsChanged 6 months agoMITView on GitHub

Create standardised GitHub pull requests using the gh CLI. Use when the user wants to create a PR, open a pull request, submit changes for review, or says things like "PR this", "open a PR", or "submit for review". Enforces conventional commit titles, structured body templates, labels, and reviewers.

  • Commits and pushes

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use github-issue and skill-creator.

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.
  • devstefanchoSkill

    github-issue

    Unified GitHub issue workflow via the gh CLI — fetch an issue (body, labels, comments, image/video attachments) into the session, create a new issue from a template, or update an existing one (body, labels, state, comments). Handles the 404 that plain curl/WebFetch hits on GitHub attachment URLs by downloading with an auth token, and extracts viewable frames from video attachments. Use whenever the user mentions GitHub issues — 이슈 가져와, 이슈 조회, 이슈 등록, 이슈 생성, 이슈 만들어줘, 이슈 업데이트, 이슈 수정, 이슈 코멘트, 이슈 작업, fetch issue N, work on issue N, create an issue, update issue N, file a bug, /github-issue.

    Also in 3 projects that use this

  • MicrosoftSkill

    skill-creator

    Guide for creating effective GitHub Copilot skills (.github/skills/) in this repository. Use when creating a new skill, updating an existing skill, or when asked about skill structure, format, or best practices for the vscode-documentdb project.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 6

    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. Very specific:

    Create well-structured pull requests using gh pr create with consistent formatting and conventions.

    line 13
  2. Distinctive:

    If the current branch matches the default/base branch, stop before pushing and ask the user to create a feature branch first.

    line 33
  3. Distinctive:

    If the branch name doesn't match a known prefix, ask the user what type of PR this is.

    line 52
  4. Distinctive:

    If the branch has a single commit, prefer the commit message as the title instead.

    line 64
  5. Very specific:

    Read the matching template from assets/ and fill it in based on the changes:

    line 68
  6. Very specific:

    If a CODEOWNERS file exists, read it to identify who should review:

    line 91
  7. Distinctive:

    Before creating the PR, verify requested labels exist:

    line 99
  8. Very specific:

    Only pass labels that exist.

    line 105
  9. Distinctive:

    Always use a heredoc for the body to preserve formatting.

    line 138
  10. Distinctive:

    After creating the PR, show the user:

    line 142

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

GitHub PR Creation

Create well-structured pull requests using gh pr create with consistent formatting and conventions.

Prerequisites

  1. gh CLI is installed and authenticated
  2. Current directory is a git repository
  3. Changes are committed and on a feature branch (not main or master)

Workflow

1. Check prerequisites

# Determine branches
current_branch=$(git branch --show-current)
base_branch=${BASE_BRANCH:-$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')}

printf 'current=%s base=%s\n' "$current_branch" "$base_branch"

If the current branch matches the default/base branch, stop before pushing and ask the user to create a feature branch first.

Once on a feature branch, ensure it is pushed to remote:

git push -u origin HEAD

2. Determine PR type

Infer the type from the branch name prefix:

PrefixTypeLabel
feat/, feature/Featureenhancement
fix/, bugfix/Bugfixbug
hotfix/Hotfixbug, priority: critical
chore/, refactor/, docs/, test/Chorechore

If the branch name doesn't match a known prefix, ask the user what type of PR this is.

3. Generate PR title

Convert the branch name to a conventional commit-style title:

  • feat/add-user-auth → feat: add user auth
  • fix/login-crash → fix: login crash
  • hotfix/null-pointer → fix: null pointer

Replace hyphens with spaces. Drop the prefix category from the branch name. Capitalise only where appropriate.

If the branch has a single commit, prefer the commit message as the title instead.

4. Fill the PR body

Read the matching template from assets/ and fill it in based on the changes:

  • Feature → assets/feature.md
  • Bugfix → assets/bugfix.md
  • Hotfix → assets/hotfix.md
  • Chore → use the feature template

To understand what changed, run:

# See commits on this branch
base_branch=${BASE_BRANCH:-$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')}
git log --oneline "$base_branch"..HEAD

# See the full diff
git diff "$base_branch"...HEAD --stat
git diff "$base_branch"...HEAD

Fill in the template sections with concrete details from the diff. Remove HTML comments. Do not leave placeholder text.

5. Set reviewers

If a CODEOWNERS file exists, read it to identify who should review:

cat .github/CODEOWNERS 2>/dev/null || cat CODEOWNERS 2>/dev/null || cat docs/CODEOWNERS 2>/dev/null

Parse CODEOWNERS conservatively. GitHub accepts usernames and team slugs as reviewers, but not email addresses or comments. If ownership is broad, ambiguous, or path-specific in a way that does not clearly match the diff, ask the user who should review.

Before creating the PR, verify requested labels exist:

gh label list --limit 200 --json name --jq '.[].name'

Only pass labels that exist. If the intended label is missing, ask whether to omit it or create it. Use the --reviewer flag only with validated usernames or team slugs; ask the user when reviewers are ambiguous.

6. Create the PR

gh pr create \
  --title "feat: add user auth" \
  --body "$(cat <<'EOF'
## Summary

Added user authentication using OAuth2...

## Changes

- Added auth middleware
- Created login/logout endpoints

## Test Plan

- Ran full test suite
- Manual testing against staging

## Checklist

- [x] Changes are scoped to the feature described above
- [x] Tests added or updated
- [x] No unrelated changes included
EOF
)" \
  --label "enhancement" \
  --reviewer "username"

Always use a heredoc for the body to preserve formatting.

7. Report back

After creating the PR, show the user:

  • The PR URL
  • Title and labels applied
  • Who was assigned to review

Conventions

  • One PR per feature/fix — don't bundle unrelated changes
  • Keep diffs small — if the diff is large (>500 lines), suggest splitting
  • Draft PRs — use --draft if the work is still in progress
  • Base branch — default to the repository default branch from gh repo view; use --base if targeting a different branch

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.