Introduction¶
Opening PRs and checking CI with gh in the terminal isn’t complicated; however, once you switch to a Stacked PR workflow (multiple dependency chains, squashing into main one by one), you have to repeatedly rebase, force-push, and change bases, all while ensuring the merge order remains correct. Missing a step can lead to scenarios like “sub-PRs still pointing to an already merged parent branch” or merging in the wrong order. While Coding Agents can run shell commands, without a fixed script, it is easy to skip a necessary rebase or base update.
Below is an introduction to the github Skill provided by Callstack in the agent-skills repository: it codifies “operating GitHub via the gh CLI” into reusable patterns, specifically solidifying the operational sequence for the entire Stacked PR chain.
What is this?¶
github is a Skill (in the universal SKILL.md format) designed for Coding Agents, maintained by Callstack, and categorized as an official development Skill on officialskills.sh.
The official positioning describes it as: providing patterns for using GitHub via the gh CLI, covering Pull Request creation, Stacked PR workflows, squash merges, rebasing, and repository automation; targeted at teams requiring complex branching strategies or dependent PR chains.
Compared to “verbally instructing the Agent to remember to rebase every time,” this Skill emphasizes: Stacked PR merging usually requires manual rebasing, force-pushing, and base updating for every PR in the chain—the Skill encodes these steps into a fixed sequence to prevent omissions or out-of-order merges.
Core Features¶
The following capabilities are derived from the official page’s “What This Skill Does” and “When to use it,” and do not exceed the scope of those descriptions.
- Pull Request Creation: Create PRs from the terminal while maintaining consistent title and body formatting.
- Stacked PR Workflow: Handle dependent PR chains; merge an entire stacked PR series into
mainas multiple independent squash commits. - Rebase and Base Maintenance: Rebase dependent branches after a parent PR is merged; update a PR’s base branch when the target branch changes.
- Squash Merge: Operate according to the Skill’s patterns when the merge strategy involves squashing.
- Status and CI: Check PR status and CI results within the shell, without switching to a browser.
- Repository Automation: Covers repository automation patterns related to the gh CLI (specific sub-items depend on the
SKILL.mdwithin the Skill).
Installation and Activation¶
The installation method provided officially is as follows:
npx skills add https://github.com/callstackincubator/agent-skills --skill github
The above command installs the Skill named github from Callstack’s agent-skills repository. The official page also notes that you can send the link below to a Coding Assistant and ask it to install it on your behalf.
https://github.com/callstackincubator/agent-skills/tree/main/skills/github
Once enabled, the Agent loads the instructions and workflows contained in the Skill; actual execution still relies on the locally installed and authenticated GitHub CLI (gh). Official materials do not separately list configuration differences for Cursor, Codex CLI, or Claude Code; installation via npx skills add or pasting the repository link is sufficient for all.
Typical Usage¶
The official index page does not expand on the complete SKILL.md command list, but it identifies five typical intents. In practice, within a session where the Skill is installed, you can use natural language to align with these scenarios, allowing the Agent to invoke gh and git operations according to the sequence encoded in the Skill.
1. Squash a Stacked PR chain into main one by one
Explain that you intend to merge a stacked chain and want each PR to correspond to a squash commit on main. The Agent should process each PR in the chain according to the order prescribed by the Skill, avoiding skipped rebases or incorrect merge orders.
2. Rebase child branches after a parent PR is merged
When a higher-level PR in the chain has been merged, explain the current branch dependencies and ask the Agent to rebase the downstream branches (and perform subsequent pushes or base updates required by the Skill).
3. Create consistently formatted PRs from the terminal
Provide the branch name, title, and key body points, and request the creation of a PR via gh that adheres to the title/body formatting conventions of the Skill.
4. View PRs and CI in the shell
Provide a PR number or branch, and ask the Agent to use gh to query PR status and check results, facilitating CI verification before merging.
5. Update PR base after the target branch changes
When a PR’s merge target or upstream branch has changed, explain that a specific PR’s base branch needs to be updated to the correct branch, and have the Agent update it according to the Skill’s workflow.
The common thread in these scenarios is: you describe the goal, and the Agent executes the hardcoded sequence of steps from the Skill, rather than piecing together commands on the fly.
Use Cases and Notes¶
Who is it for
- Teams already using or planning to use Stacked PRs / dependent PR chains who want to reduce manual errors with Agent assistance.
- Those who already use
ghto manage PRs daily and want the Agent to follow the same set of habits for merging, rebasing, and base updates. - Those who need to complete PR creation, status checks, and partial repository automation in the terminal rather than relying entirely on the GitHub Web UI.
Limitations and Notes
- The prerequisite is that the gh CLI is available and has permissions for the target repository; the Skill itself does not replace GitHub account and repository permission configuration.
- Stacked PR chains may still involve sensitive operations like force-push; before execution, you should confirm the branch and remote status within the steps guided by the Skill; the focus of the official description is “solidifying the order,” not removing human judgment.
- The installation source is the
githubSkill within thecallstackincubator/agent-skillsrepository; if the local repository directory structure does not match the official link, the installation command and the officialskills.sh page should be taken as the standard.
Conclusion¶
The github Skill distills Callstack’s operational sequence for complex PR chains for Agents. Its core value lies in: layering on top of the gh CLI to make Stacked PR squashing, rebasing, and base updates execute according to a unified script, thereby reducing the risk of missed steps and out-of-order merges.
- Official index and installation instructions: https://officialskills.sh/callstackincubator/skills/github
- Repository path (installation link): https://github.com/callstackincubator/agent-skills/tree/main/skills/github