Agent skill

Alego Merging Stacked PRs

by singula-ai in singula-ai/alego

A skill your agent uses when landing a stack of dependent GitHub PRs (A ← B ← C, where each bases on the one below) onto master, merging a PR whose base is another open PR's branch, or whenever a…

MITAuto-check passed

Install Alego Merging Stacked PRs

skills CLI
$ npx skills add singula-ai/alego --skill alego-merging-stacked-prs -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install singula-ai/alego alego-merging-stacked-prs --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/singula-ai/alego.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/alego-merging-stacked-prs .claude/skills/alego-merging-stacked-prs && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
alego-merging-stacked-prs
GitHub stars
109
Used in
1 other repo
Token cost
~2k tokens
SKILL.md length
920 words
Files
1
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when landing a stack of dependent GitHub PRs (A ← B ← C, where each bases on the one below) onto master, merging a PR whose base is another open PR's branch, or whenever a…

  • Works in 4 steps: Compare every author.login exactly. → If all authors match, link the chain… → If authors differ or any author is… → …
  • Landing a stack of dependent GitHub PRs (A ← B ← C
  • SKILL.md covers Require native stack support, Link missing stack members, Refresh only when needed and Preflight the merge range, plus 3 more sections
  • Calls gh

What it does

Alego Merging Stacked PRs is an agent skill from singula-ai/alego. Use when landing a stack of dependent GitHub PRs (A ← B ← C, where each bases on the one below) onto master, merging a PR whose base is another open PR's branch, or whenever a request mentions "stacked PRs", "PR stack", "dependent PRs", or merging several related PRs in sequence. Requires every same-repository dependency chain to use GitHub's official stacked-PR feature before landing so GitHub owns stack-wide rules, CI, ordering, retargeting, and merge state.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with GitHub. The repository describes itself as: Build AI Agents like playing LEGOs. Everything is a Plugin. The licence is MIT.

When your agent uses it

  • Landing a stack of dependent GitHub PRs (A ← B ← C
  • Where each bases on the one below) onto master
  • Merging a PR whose base is another open PRs branch
  • Whenever a request mentions stacked PRs

Example prompts

  • “s branch, or whenever a request mentions”
  • “PR stack”
  • “dependent PRs”
  • “/alego-merging-stacked-prs”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Compare every author.login exactly.
  2. If all authors match, link the chain automatically in bottom-to-top order
  3. If authors differ or any author is unavailable, ask the user whether to link before changing GitHub state.
  4. Re-query GraphQL and require one stack number, the expected trunk, the complete PR set, and the expected positions and base chain.

What it can do on your machine

Read from SKILL.md and the folder at commit a79fe9a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Alego Merging Stacked PRs loads about 2k tokens when it runs. Until then it costs about 123 tokens; SKILL.md has 920 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~123
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from singula-ai/alego at commit a79fe9a, republished under its MIT licence (© singula-ai). 920 words, ~1,960 tokens.

Download SKILL.mdSave it as .claude/skills/alego-merging-stacked-prs/SKILL.md (or your agent's skills folder).
name
alego-merging-stacked-prs
description
Use when landing a stack of dependent GitHub PRs (A ← B ← C, where each bases on the one below) onto master, merging a PR whose base is another open PR's branch, or whenever a request mentions "stacked PRs", "PR stack", "dependent PRs", or merging several related PRs in sequence. Requires every same-repository dependency chain to use GitHub's official stacked-PR feature before landing so GitHub owns stack-wide rules, CI, ordering, retargeting, and merge state.

Landing an official GitHub PR stack

Land dependent PRs through GitHub's native stack object and gh stack merge. Do not reproduce stack semantics by merging and retargeting individual PRs with gh pr merge and gh pr edit. The root AGENTS.md owns the allowed merge-forward and rebase histories; the stack review guide owns review-fix propagation.

Require native stack support

Run gh stack --version before changing GitHub state. Hard-stop if the official extension or server-side stack feature is unavailable; do not fall back to manually merging and retargeting PRs one at a time. GitHub stacks require every head branch to live in the same repository, so hard-stop on a cross-fork chain.

Use a clean dedicated worktree. Fetch current PR metadata and exact head OIDs rather than trusting branch names or an earlier report:

sh
gh pr view <pr> --json number,author,baseRefName,baseRefOid,headRefName,headRefOid,isCrossRepository,state,isDraft,reviewDecision,mergeStateStatus,statusCheckRollup

Query PullRequest.stack and stackEntry.position for at least one PR in each apparent chain; this official GitHub object, not base-branch inference alone, is the stack-membership authority. Paginate entries when size exceeds the returned page:

sh
gh api graphql -F owner=<owner> -F name=<repo> -F number=<pr> -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      number
      author { login }
      baseRefName
      headRefName
      stackEntry { position }
      stack {
        number
        baseRefName
        size
        entries(first: 100) {
          nodes {
            position
            pullRequest { number author { login } baseRefName headRefName state isDraft }
          }
        }
      }
    }
  }
}'

Establish the expected bottom-to-top order from the live PR bases: the bottom targets the trunk, and each higher PR targets the head branch immediately below it.

First compare any existing stack entries with the expected chain. One existing stack may contain an order-preserving subset of the requested chain; multiple stack numbers, an unexpected entry, or a conflicting order requires user direction before any mutation.

When any dependent PR is not yet in that official stack:

  1. Compare every author.login exactly.
  2. If all authors match, link the chain automatically in bottom-to-top order:
sh
gh stack link --base <trunk> <bottom-pr> <next-pr> ... <top-pr>
  1. If authors differ or any author is unavailable, ask the user whether to link before changing GitHub state.
  2. Re-query GraphQL and require one stack number, the expected trunk, the complete PR set, and the expected positions and base chain.

Never dissolve, reorder, or rebuild an existing stack automatically; gh stack link is additive and merged or queued entries cannot be unstacked.

Refresh only when needed

Do not rewrite branches merely because a refresh mechanism exists. When the live merge state or repository rules require an updated trunk, choose either allowed history:

  • Native cascading rebase: check out the remote stack with gh stack checkout <pr-or-stack> when it is not tracked locally, then run gh stack sync. The command may rebase and lease-protected force-push every active layer before local validation. Immediately inspect the rewritten scope, run the relevant checks for every affected layer, and do not merge or claim readiness until they pass. If sync detects a rebase conflict, use gh stack rebase, resolve and validate it, then publish with gh stack push. If checkout or sync reports divergent local and remote stack compositions, cancel and ask rather than deleting or recreating the remote stack automatically.
  • Incremental merge-forward: merge the trunk into the bottom affected branch, then propagate each updated parent into its child in bottom-to-top order and push normally. If the base advances during an in-progress merge, preserve that checkpoint before merging the newer tip.

Any history rewrite is allowed after review, but it invalidates commit-OID assumptions. Re-fetch exact heads and re-audit unresolved review threads, approvals, mergeability, and checks after the push. Never use raw --force or overwrite a concurrently advanced remote head.

Show full SKILL.md (386 more words)Show less

Preflight the merge range

Re-query the official stack immediately before merging. Require every selected PR to be open, non-draft, in the expected order, and compliant with the repository's review and check requirements. Treat each PR's state independently; a ready top layer does not prove its dependencies are ready.

"Land the stack" selects the whole stack. A partial landing requires an explicit boundary PR and includes every layer from the bottom through that boundary.

Merge through the stack API

Merge the whole stack by its official stack number:

sh
gh stack merge <stack-number> --yes --merge

For an explicitly requested partial landing, merge through the boundary PR:

sh
gh stack merge <boundary-pr> --yes --merge

Do not pass --delete-branch, manually retarget dependents, or issue per-PR merge commands. GitHub merges the selected range bottom-up and retargets/rebases any remaining upper layers. A direct stack merge is all-or-nothing; when the trunk uses a merge queue, GitHub queues the selected range together but may land it in separate groups.

Do not bypass merge requirements. If the native merge reports a blocker, inspect and resolve that blocker through the owning PR or stop and report it; never fall back to gh pr merge.

Verify the landed state

Wait for every selected PR to report MERGED; a queued request is not a completed landing:

sh
gh pr view <pr> --json number,state,mergedAt,mergeCommit,baseRefName,headRefName

For a partial landing, re-query the official stack and verify that every remaining PR is still linked in the expected order and targets the stack trunk or the layer below it. Re-check current heads, review state, and CI because GitHub may have rebased the remaining layers.

Delete branches only in a separate final pass after the corresponding PRs report MERGED. Before deleting each branch, require GitHub to report no open PR still using it as a base:

sh
gh pr list --state open --base <branch> --json number --jq length

Anything other than 0 blocks deletion.

Checklist

  • Native gh stack support is available; every PR branch is in the same repository.
  • Live PR bases and exact heads establish one bottom-to-top dependency chain.
  • GraphQL reports one official stack with the expected trunk, entries, and order; an eligible same-author unstacked chain was linked automatically.
  • Any rewritten layers passed relevant validation, and review threads, approvals, mergeability, and checks were re-audited afterward.
  • The whole stack, or an explicitly bounded prefix, was submitted through gh stack merge --yes --merge.
  • Every selected PR reports MERGED; any remaining upper layers still form the expected official stack.
  • Branch deletion happened only after merged-state and zero-dependent verification.

© singula-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/alego-merging-stacked-prs of singula-ai/alego.

Open the folder on GitHubat commit a79fe9a

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in singula-ai/alego, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Alego Merging Stacked PRs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Alego Merging Stacked PRs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Alego Merging Stacked PRs this skillsingula-ai/alego1091 repos~2kAutomated safety check: PassMIT
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Greplooponyx-dot-app/onyx32k4 repos~3.3kAutomated safety check: PassMIT
GitHub Deep Researchbytedance/deer-flow84k4 repos~1.3kAutomated safety check: PassMIT
Diagnosing Superpowers Sessionsobra/superpowers297k3 repos~1.7kAutomated safety check: PassMIT
Update V8 Versionopeninterpreter/openinterpreter69k2 repos~845Automated safety check: PassApache-2.0

Similar skills

  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed
  • GitHub Deep Research

    bytedance/deer-flow

    Researches a GitHub repository over four rounds using the GitHub API and web search, then writes a structured markdown report with timeline, metrics and Mermaid diagrams.

    84k GitHub starsUsed in 4 repos~1.3k tokens
    Research & ScienceAuto-check passed
  • Investigates a session where Superpowers went wrong, reads the transcripts on disk and produces an evidence-cited report, optionally prepared as a bug report for the maintainers.

    297k GitHub starsUsed in 3 repos~1.7k tokens
    Agent WorkflowsAuto-check passed
  • Update V8 Version

    openinterpreter/openinterpreter

    Bumps the pinned v8 and rusty_v8 versions in Codex, validates the release-candidate path with the v8-canary check, and traces failures to upstream build changes.

    69k GitHub starsUsed in 2 repos~845 tokens
    DevOps & CloudAuto-check passed
  • Last30days

    mvanhorn/last30days-skill

    Research what people actually say about any topic in the last 30 days.

    64k GitHub stars~7.9k tokensUpdated yesterday
    Research & ScienceAuto-check: notes

More from singula-ai/alego

All 20 skills in this repo
  • Record Browser Gif

    singula-ai/alego

    Record browser or Web UI interaction demos as optimized GIFs using the available browser-control workflow, optional Playwright Videos for higher capture frame rates, and deterministic encoding, then…

    109 GitHub starsUsed in 1 repo~4.1k tokens
    Auto-check: notes
  • A skill your agent uses when adding, auditing, pruning, archiving, restoring, or reviewing Agent Notes in alego; checks every new note for superseded active records, deletes small UI and purely…

    109 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • A skill your agent uses when creating, changing, or validating an agent preset or other Cordis composition for this harness, including deciding host versus preset placement and checking that an…

    109 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Office DOCX

    singula-ai/alego

    Create, read, edit, and check Word documents (.docx), including reports, letters, and formatted tables.

    109 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Office PPTX

    singula-ai/alego

    Create, read, edit, and check PowerPoint presentations (.pptx), including slide text, tables, images, and charts.

    109 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Office XLSX

    singula-ai/alego

    Read, create, and modify Excel workbooks (.xlsx), including data, formulas, formatting, and pandas analysis.

    109 GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed

Works with

Questions about Alego Merging Stacked PRs

What does Alego Merging Stacked PRs do?

A skill your agent uses when landing a stack of dependent GitHub PRs (A ← B ← C, where each bases on the one below) onto master, merging a PR whose base is another open PR's branch, or whenever a…. Alego Merging Stacked PRs is an agent skill from singula-ai/alego. Use when landing a stack of dependent GitHub PRs (A ← B ← C, where each bases on the one below) onto master, merging a PR whose base is another open PR's branch, or whenever a request mentions "stacked PRs", "PR stack", "dependent PRs", or merging several related PRs in sequence.

When should I use Alego Merging Stacked PRs?

Alego Merging Stacked PRs fits situations like: landing a stack of dependent GitHub PRs (A ← B ← C; where each bases on the one below) onto master; merging a PR whose base is another open PRs branch; whenever a request mentions stacked PRs.

How do I install Alego Merging Stacked PRs in Claude Code?

Run `npx skills add singula-ai/alego --skill alego-merging-stacked-prs -a claude-code`. Or copy the skill folder (.agents/skills/alego-merging-stacked-prs in singula-ai/alego) into .claude/skills/alego-merging-stacked-prs in your project. Claude Code loads it when a task matches its description.

How do I install Alego Merging Stacked PRs in Codex?

Run `npx skills add singula-ai/alego --skill alego-merging-stacked-prs -a codex`. Or copy the skill folder (.agents/skills/alego-merging-stacked-prs in singula-ai/alego) into .agents/skills/alego-merging-stacked-prs in your project. Codex loads it when a task matches its description.

Can I use Alego Merging Stacked PRs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add singula-ai/alego --skill alego-merging-stacked-prs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/alego-merging-stacked-prs, .gemini/skills/alego-merging-stacked-prs, .github/skills/alego-merging-stacked-prs and .opencode/skills/alego-merging-stacked-prs in your project.

What does Alego Merging Stacked PRs need to run?

Going by SKILL.md and its folder, Alego Merging Stacked PRs needs the command-line tools its instructions call (gh).

Does Alego Merging Stacked PRs access the network?

SKILL.md contains no URLs. Its commands use gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Alego Merging Stacked PRs safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Alego Merging Stacked PRs use?

Alego Merging Stacked PRs is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Alego Merging Stacked PRs use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Alego Merging Stacked PRs?

Skills that share tags, products or a category with Alego Merging Stacked PRs: PR Babysitter (openinterpreter/openinterpreter, 69k stars), Greploop (onyx-dot-app/onyx, 32k stars), GitHub Deep Research (bytedance/deer-flow, 84k stars) and Diagnosing Superpowers Sessions (obra/superpowers, 297k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Alego Merging Stacked PRs?

singula-ai (a GitHub organization) maintains it in singula-ai/alego, which has 109 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on September 28, 2026.

Source: singula-ai/alego on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.