PluginBench
Skill
Official
Review
Audit score 70

github

callstackincubator/agent-skills

GitHub patterns using gh CLI for pull requests, stacked PRs, code review, and repository automation.

What is github?

This skill provides GitHub workflow patterns and automation using the gh CLI tool. Use it when managing pull requests, implementing stacked PR workflows, handling merging strategies, or automating repository tasks.

  • Create and manage pull requests via gh CLI
  • Merge stacked PRs with squash-merge strategy while maintaining clean commit history
  • Rebase branches onto main and update PR bases during multi-PR workflows
  • View PR status and check CI/CD check results
  • Automate repository operations using gh CLI commands

How to install github

npx skills add https://github.com/callstackincubator/agent-skills --skill github
Prerequisites
  • gh CLI installed and authenticated with GitHub
  • Git configured locally
  • Access to the GitHub repository
Claude Code
Cursor
Windsurf
Cline

How to use github

  1. 1.Install the skill using the provided npx command
  2. 2.Use `gh pr create` to create pull requests from your current branch
  3. 3.For stacked PRs, merge the first PR with `gh pr merge <PR_NUMBER> --squash`
  4. 4.For subsequent PRs in the stack, rebase onto main using `git rebase --onto origin/main <old-base-branch> <next-branch>`
  5. 5.Update the PR base to main with `gh pr edit <N> --base main`
  6. 6.Merge each subsequent PR with `gh pr merge <N> --squash`
  7. 7.Check PR status anytime with `gh pr status` or `gh pr checks <PR_NUMBER>`

Use cases

Good for
  • Merging a chain of stacked PRs (each targeting the previous branch) into main as individual squash commits
  • Creating pull requests from feature branches with titles and descriptions
  • Checking PR status and CI/CD pipeline results before merging
  • Rebasing dependent PRs when their base branch is merged
  • Automating repetitive GitHub operations in agent workflows
Who it's for
  • Developers managing multiple dependent pull requests
  • Teams using stacked PR workflows for code review
  • Engineers automating GitHub repository operations
  • Code reviewers checking PR status and CI checks

github FAQ

What is a stacked PR workflow?

A stacked PR workflow is when you have multiple pull requests in a chain, where each PR targets the previous branch instead of main. This allows parallel code review of dependent changes. The skill provides automation to merge them cleanly into main as individual squash commits.

Why use gh CLI instead of GitHub's web interface?

The gh CLI is preferred for lower context usage in agent workflows and enables automation of complex operations like rebasing and merging stacked PRs programmatically.

What happens if there are merge conflicts in a stacked PR?

The skill will stop and ask the user to resolve conflicts manually before continuing with the merge process.

How do I check if my PR's CI checks have passed?

Use `gh pr checks <PR_NUMBER>` to view the status of all CI/CD checks for a specific pull request.

Can I use this skill for non-stacked PR workflows?

Yes, the skill supports standard GitHub operations like creating PRs, merging, and checking status. The stacked PR workflow is just one specialized use case.

Full instructions (SKILL.md)

Source of truth, from callstackincubator/agent-skills.


name: github description: GitHub patterns using gh CLI for pull requests, stacked PRs, code review, branching strategies, and repository automation. Use when working with GitHub PRs, merging strategies, or repository management tasks. license: MIT metadata: author: Callstack tags: github, gh-cli, pull-request, stacked-pr, squash, rebase

GitHub Patterns

Tools

Use gh CLI for all GitHub operations. Prefer CLI over GitHub MCP servers for lower context usage.

Quick Commands

# Create a PR from the current branch
gh pr create --title "feat: add feature" --body "Description"

# Squash-merge a PR
gh pr merge <PR_NUMBER> --squash --title "feat: add feature (#<PR_NUMBER>)"

# View PR status and checks
gh pr status
gh pr checks <PR_NUMBER>

Stacked PR Workflow Summary

When merging a chain of stacked PRs (each targeting the previous branch):

  1. Merge the first PR into main via squash merge
  2. For each subsequent PR: rebase onto main, update base to main, then squash merge
  3. On conflicts: stop and ask the user to resolve manually
# Rebase next PR's branch onto main, excluding already-merged commits
git rebase --onto origin/main <old-base-branch> <next-branch>
git push --force-with-lease origin <next-branch>
gh pr edit <N> --base main
gh pr merge <N> --squash --title "<PR title> (#N)"

See stacked-pr-workflow.md for full step-by-step details.

Quick Reference

FileDescription
stacked-pr-workflow.mdMerge stacked PRs into main as individual squash commits

Problem -> Skill Mapping

ProblemStart With
Merge stacked PRs cleanlystacked-pr-workflow.md