Global Rank · of 601 Skills
merge-stack AI Agent Skill
View Source: rarestg/rarestg-skills
MediumInstallation
npx skills add rarestg/rarestg-skills --skill merge-stack 6
Installs
Merge Stacked PRs
Merge a linear chain of stacked PRs into main one at a time, re-targeting each subsequent PR to main before merging.
Workflow
1. Discover the stack
gh pr list --state open --json number,title,headRefName,baseRefName,additions,deletions \
--jq '.[] | "#\(.number) \(.headRefName) → \(.baseRefName) (+\(.additions) -\(.deletions))"'If a branch prefix argument is provided, filter to only PRs whose branch names match it. Confirm the PRs form a single linear chain ending at main. Show the user the full stack (bottom to top) and get confirmation before proceeding.
2. Merge bottom-up
Starting with the PR that targets main:
- Merge it:
gh pr merge <number> --merge - For each next PR in the chain:
a. Re-target to main:gh pr edit <number> --base main
b. Merge it:gh pr merge <number> --merge - Repeat until all PRs are merged.
Use --merge (not --squash or --rebase) to preserve commit history, unless the user requests otherwise.
3. Verify
gh pr list --state openConfirm zero open PRs remain (or only unrelated PRs remain) and report the result.
Notes
- Always show the user the discovered stack and get confirmation before merging anything.
- If a merge fails (e.g. conflicts), stop and report the issue rather than continuing.
- If a merge fails because required CI checks haven't passed (common after re-targeting to
main), suggestgh pr merge <number> --merge --autoto auto-merge once checks pass. - The branch naming pattern is typically incremental (e.g.
feature-1,feature-2), but detect the actual chain by following base branch references, not by name pattern.
Installs
Security Audit
View Source
rarestg/rarestg-skills
More from this source
Power your AI Agents with
the best open-source models.
Drop-in OpenAI-compatible API. No data leaves Europe.
Explore Inference APIGLM
GLM 5
$1.00 / $3.20
per M tokens
Kimi
Kimi K2.5
$0.60 / $2.80
per M tokens
MiniMax
MiniMax M2.5
$0.30 / $1.20
per M tokens
Qwen
Qwen3.5 122B
$0.40 / $3.00
per M tokens
How to use this skill
Install merge-stack by running npx skills add rarestg/rarestg-skills --skill merge-stack in your project directory. Run the install command above in your project directory. The skill file will be downloaded from GitHub and placed in your project.
No configuration needed. Your AI agent (Claude Code, Cursor, Windsurf, etc.) automatically detects installed skills and uses them as context when generating code.
The skill enhances your agent's understanding of merge-stack, helping it follow established patterns, avoid common mistakes, and produce production-ready output.
What you get
Skills are plain-text instruction files — not executable code. They encode expert knowledge about frameworks, languages, or tools that your AI agent reads to improve its output. This means zero runtime overhead, no dependency conflicts, and full transparency: you can read and review every instruction before installing.
Compatibility
This skill works with any AI coding agent that supports the skills.sh format, including Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider, and other tools that read project-level context files. Skills are framework-agnostic at the transport level — the content inside determines which language or framework it applies to.
Chat with 100+ AI Models in one App.
Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.