Agent skill
github-pr
Create GitHub pull requests using gh CLI with automatic stacked PR detection. Use when the user asks to create a PR, open a pull request, make a PR, or mentions creating/opening a pull request on GitHub.
Install this agent skill to your Project
npx add-skill https://github.com/jroslaniec/agent-skills/tree/main/github-pr
SKILL.md
GitHub Pull Request
Create pull requests using GitHub CLI with stacked PR detection.
Instructions
Step 1: Gather Context
Run the skill's context-gathering script:
<skill-location-dir>/scripts/gather-pr-context.sh
The script outputs the current working directory first. Verify you are in the correct repository before proceeding.
Step 2: Analyze Context
From the script output, determine:
Stacked vs Normal PR:
- Parse
git log --oneline --decoratefor branch refs in parentheses - First branch NOT current and NOT
main/origin/main= parent branch - Parent is
main→ Normal PR - Parent is other branch → Stacked PR
Push status:
git log origin/<branch>..HEADempty → pushed ✓- Shows commits → need to push first
Existing PR:
gh pr listreturns data → PR exists, offer to update- Empty → create new PR
Step 3: Push if Needed
git push -u origin HEAD
Step 4: Create PR
Normal PR:
gh pr create --draft --base main --title "title" --body "body"
Stacked PR:
gh pr create --draft --base <parent-branch> --title "title" --body "body"
Guidelines:
- Use ticket number from branch name as title prefix (e.g., PAT-123)
- Keep description short and proportional to changes
- For stacked PRs, describe only THIS branch's changes
- Create in draft mode unless explicitly requested otherwise
Step 5: Output
Normal PR:
Created PR
* Merge : `<branch>` into `main`
* PR URL: <url>
Stacked PR:
📚 Stacked PR 📚
* Merge : `<branch>` into `<parent>`
* New PR : <url>
* Parent PR: <parent-url or "⚠️ No Parent PR">
Rules
- NEVER include attribution markers in PR titles or descriptions. This includes but is not limited to:
- "Co-Authored-By" or "Co-authored-by" headers
- "Generated by", "Created by", "Written by" followed by any AI/LLM name
- Footers like "🤖 Generated with Claude Code" or similar
- Any mention of AI tools: Claude, GPT, Copilot, Codex, Gemini, Cursor, or other LLMs/assistants
- Any text or links indicating AI involvement in creating the PR
Requirements
- GitHub CLI (
gh) installed and authenticated - Git remote configured
- Push access to repository
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
commit
Create git commits with appropriate commit messages. Use when the user asks to commit, create a commit, write a commit message, or mentions "commit" in the context of saving changes to git.
taskify-prd
skill-new
Create or update Agent Skills for any supported coding agent. Use when the user asks how to author a skill, requests a new skill directory, or needs updates for their installed coding agent(s).
git-worktree
Manage git worktrees and branches. Use when the user asks to create a worktree, new worktree, create a branch, new branch, switch branches, or work on a new feature.
pytest-unit
Write pytest unit tests for Python code changes. Use when adding tests for new or modified Python code in projects that use pytest.
prd
Create Product Requirements Documents (PRDs) through structured interviews. Use when the user asks to create a PRD, write requirements, spec out a feature, or needs help defining what to build.
Didn't find tool you were looking for?