gh-pr

Automates GitHub PR creation and updates using gh CLI with merge-aware logic.

Updated Jan 29, 2026
One-click install
npx skills add https://github.com/akiojin/xLLM --skill gh-pr-akiojin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-pr
Source: https://github.com/akiojin/xLLM/tree/main/.codex/skills/gh-pr
Command: npx skills add https://github.com/akiojin/xLLM --skill gh-pr-akiojin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill automates the creation and updating of GitHub Pull Requests using the gh CLI, applying decision rules to determine whether to create a new PR or push updates based on existing PRs and merge status.

Core Features & Use Cases

  • Decision-driven PRs: checks for existing PRs on the current head, and decides between create or push-only based on mergedAt and recent activity.
  • Post-merge handling: detects new commits after the last merge to avoid duplicate PRs and ensure changes are captured.
  • Templates & body generation: builds PR bodies from a standard template and can integrate with references/pr-body-template.md for consistent messaging.

Quick Start

Use this skill to open a PR from your current branch to the develop base, or to update an existing PR when you push new commits.

Frequently Asked Questions about gh-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate GitHub PR creation and updates with the gh CLI?

Automate GitHub PR creation and updates by using gh CLI to check for existing PRs on the current head, evaluate merge status, and decide whether to create a new PR or push updates based on recent activity and commit history.

Why does my automated workflow create duplicate pull requests after merging?

Duplicate pull requests occur when post-merge commits go undetected. Post-merge handling checks for new commits after the last merge to avoid duplicate PRs and ensures all changes are captured in a fresh request.

Do I need to install git and gh CLI to manage pull requests automatically?

Yes, both git and gh CLI are required to manage pull requests automatically. The workflow uses these tools to check branch rules, evaluate merge status, and execute decision logic for PR creation and updates.

What is the best way to maintain consistent PR descriptions across automated workflows?

Maintain consistent PR descriptions by generating PR bodies from a standard template. The workflow integrates with a body template file to ensure uniform messaging and structured formatting across all created or updated pull requests.

Can I push updates to an existing pull request instead of creating a new one?

Yes, you can push updates to an existing pull request. The workflow checks for active PRs on the current head and evaluates the mergedAt status to push updates safely rather than opening a duplicate request.