mcpField
G
github-pr

github-pr

github.com/dhruvanbhalaraDevelopment30110 installsUpdated 9w ago
Repository

About github-pr

A skill for creating and managing GitHub pull requests with `gh`, with a manual fallback when the CLI is unavailable. It guides branch checks, PR metadata, title and description drafting, labels, and assignment.

Key features

  1. 01Check `gh` installation and authentication
  2. 02Verify commits and target base branch
  3. 03Draft Conventional Commits-style titles
  4. 04Prepare PR descriptions from commits and templates
  5. 05Suggest labels and assign a reviewer

Use cases

  1. 01Create a PR after completing a feature branch
  2. 02Draft PR details when `gh` is unavailable
  3. 03Check PR prerequisites before submitting

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dhruvanbhalara/skills --skill github-pr

After installing, type/github-prin Claude Code to confirm it loaded.

Details

From the project README

Pull Request Creation & Management

This skill automates the process of creating high-quality Pull Requests using the GitHub CLI (gh) or providing instructions if it's unavailable.

1. Preparation

  • Check GitHub CLI: Verify if gh is installed and authenticated (gh auth status).
  • Commits Check: Ensure all changes are committed in the current feature branch.
  • Base Branch: Identify the target base branch (usually main).

2. PR Quality & Metadata

  • Quality Gate: All PRs MUST pass analysis (0 warnings), formatting, and tests before merge.
  • Branch Protection: Ensure branch protection rules are respected (no direct pushes to main).
  • Metadata: ALWAYS specify relevant labels and at least one assignee.
  • Checklist: Ensure the development plan and requirements are reviewed before completing the task.

3. Generate PR Title

  • Conventional Commits: The PR title MUST follow the pattern: <type>(<scope>): <description>.
    • Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.
    • Example: feat(auth): add google sign-in support
  • Source: Analyze the commit messages in the current branch to determine the most appropriate title.

3. Generate PR Description

  • Commit History: Read all commits in the current branch (git log origin/main..HEAD --oneline).
  • PR Template: Check for .github/PULL_REQUEST_TEMPLATE.md or similar. If it exists, populate it.
  • Content:
    • Summarize the "What" and "Why" of the changes.
    • List the specific changes as bullet points.
    • Include any relevant issue numbers (e.g., Closes #123).

4. Labeling & Assignment

  • Available Labels: Fetch labels from the repo (gh label list).
  • Auto-Label: Assign labels based on the changes:
    • enhancement / feat: For new features.
    • bug / fix: For bug fixes.
    • documentation / docs: For documentation updates.
  • Assignee: Assign the PR to the current user or as per project rules.

5. Execution

  • Using CLI: If gh is available, run:
    gh pr create --title "<title>" --body "<body>" --label "<labels>"
    
  • Manual Fallback: If gh is NOT available, present the generated title, description, and suggested labels to the user and ask how to proceed.

Comments

Markdown supported