github-pr-workflow

Automates the GitHub pull request lifecycle from branch creation through CI monitoring and merge.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill github-pr-workflow-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-pr-workflow
Source: https://github.com/CHENHUI-X/toolbox/tree/main/custom-skills/github/github-pr-workflow
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill github-pr-workflow-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing pull requests involves repetitive manual steps: creating branches, writing conventional commits, opening PRs, watching CI, diagnosing failures, and merging. This Skill provides a complete operational guide for the entire PR lifecycle, with both gh CLI commands and git + curl API fallbacks for machines without the GitHub CLI. ## Core Features & Use Cases - Full PR Lifecycle: Covers branch creation with naming conventions, Conventional Commits, pushing, PR creation (including drafts and reviewers), and merging with squash/rebase/auto-merge options. - CI Monitoring and Auto-Fix: Polls commit status and check runs, downloads failed job logs, and follows a structured diagnose-fix-push-verify loop (up to 3 attempts) to resolve CI failures. - Dual Auth Paths: Detects whether gh is available and authenticated, otherwise falls back to git + curl with a GITHUB_TOKEN, extracting owner/repo from the git remote automatically. - Use Case: After fixing a login redirect bug, ask the agent to commit the changes, push a fix/ branch, open a PR that closes the related issue, watch CI, auto-fix any failing checks, and squash-merge when green. ## Quick Start Create a branch, commit my current changes with a conventional commit message, open a GitHub pull request, monitor CI, and merge it once all checks pass.

Frequently Asked Questions about github-pr-workflow

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

FAQPage Schema
How do I create a GitHub pull request from the command line?

Use `gh pr create` with a title and body after pushing your branch with `git push -u origin HEAD`. Without the gh CLI, send a POST request to the GitHub REST API pulls endpoint with your token, specifying head branch, base branch, title, and body.

How to monitor GitHub CI checks for a pull request?

Run `gh pr checks --watch` to poll until all checks finish. With curl, query the commit status endpoint or check-runs endpoint for the branch HEAD SHA and poll every 30 seconds until the state is success, failure, or error.

Can I use GitHub API without the gh CLI installed?

Yes, every operation has a git plus curl fallback using a GITHUB_TOKEN for authentication. The workflow extracts owner and repo from the git remote URL and calls the REST API directly, including GraphQL for auto-merge.

How do I automatically fix failing CI checks on a PR?

Download failed job logs with `gh run view --log-failed` or the actions runs logs API, diagnose the error pattern (test, lint, type, build, or permission failure), patch the code, commit, push, and re-check status. Repeat up to three attempts before asking the user.

What merge methods does the GitHub API support for pull requests?

The merge endpoint supports merge commit, squash, and rebase methods via the merge_method parameter. Squash merging with branch deletion is recommended for feature branches, and auto-merge can be enabled through the GraphQL API.