agentleFS
bernacamargobernacamargo/ai-native-harness/skills/pr-stack/SKILL.md

pr-stack

Skill0 starsChanged 37 days agoMITView on GitHub

GitHub-native stacked-PR delivery — cut an approved plan into an ordered chain of PRs (each base is the layer below, merged bottom-up). Requires gh >= 2.90 with the github/gh-stack extension, trunk main. Use when the user asks for stacked PRs or after a substantial plan is approved; not for trivial one-file fixes, and never before a human has approved the layer list.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. r0adkll/Campfire★ 151same name
    2. frontier159/pr-stack★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Never git add . / git add -A across layers.

    line 20
  2. Distinctive:

    Do not split "write the test" and "implement" into separate PRs.

    line 22
  3. Distinctive:

    Do not give several agents the same checkout and tell each to take a slice — that is a merge-fight factory, not parallelism.

    line 24
  4. Distinctive:

    Never rebase, amend, or force-push main.

    line 26
  5. Very specific:

    After plan approval, gh stack submit and gh stack sync may push stack branches only.

    line 28
  6. Very specific:

    Stop. Wait for explicit approval of layer order and interfaces.

    line 48
  7. Very specific:

    Run verify-before-push per layer, not once at the top — every layer must be shippable on its own.

    line 86
  8. Distinctive:

    After submit, reviews are parallel: the human, bot reviewers, and QA reviewers can each sit on a different layer.

    line 96
  9. Distinctive:

    If the repo enables a merge queue, re-check GitHub's stacked-PR merge docs (queue support has been rolling out in public preview).

    line 117
  10. Distinctive:

    Every layer PR body follows the repo's PR template.

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Stacked PR delivery

You are delivering a feature as one GitHub stack — an ordered chain of PRs where each PR's base is the layer below it, merged bottom-up. Small PRs get real review; one giant PR gets a rubber stamp.

Tooling: gh ≥ 2.90 and gh extension install github/gh-stack. Trunk is main. Implementation quality still follows your repo's implementation skill; this skill is how work is cut, branched, submitted, and merged.

Hard rules

  • No gh stack init, no feature branches, no push until the human has approved the layer list and interfaces.
  • Never git add . / git add -A across layers. Stage only files that belong to the current layer.
  • Do not split "write the test" and "implement" into separate PRs. Tests ship with the layer that adds the behavior.
  • Do not give several agents the same checkout and tell each to take a slice — that is a merge-fight factory, not parallelism.
  • Never rebase, amend, or force-push main. Never rewrite commits already on trunk.
  • After plan approval, gh stack submit and gh stack sync may push stack branches only. Cascading rebase of unmerged stack branches via gh stack rebase / sync is allowed and expected.

1. Plan the layers

  • Restate the feature against the approved plan. Invariant or contract change → design doc / ADR first.
  • Dispatch read-only reviewers (architecture-reviewer, security-reviewer, Explore) in parallel when their concerns are independent.
  • Output an ordered layer list. Each layer names:
    • Files (create/modify/test)
    • Interfaces: Consumes / Produces — the signatures later layers rely on
    • Validation command(s) from AGENTS.md

Checkpoint: you can name each PR in the stack and what would make that layer mergeable without the layers above it.

2. Plan approved

Stop. Wait for explicit approval of layer order and interfaces. This is the human gate; gh stack init does not happen before it.

3. Cut the layers

Typical ordering when a feature spans the stack — omit layers that do not apply, and keep tightly coupled changes in one layer:

  1. Contracts — schemas, migrations, message formats, fixtures in every suite that asserts them (schema drift must fail on both sides)
  2. Core services — API / consumers / auth: the only paths that touch the system of record
  3. Workers / integrations — background processing, external calls
  4. UI / BFF — last, consuming the locked interfaces

Fold doc updates into the layer that introduces the behavior, unless the docs change is large enough to review alone.

Each layer must stay green against its base. A lower layer must not depend on unmerged code from an upper layer.

4. Implement (serial by default)

Per layer: implement, add the tests for that behavior, run the validation commands, review the diff. Then:

gh stack init          # first layer only; name the branch; trunk = main
# conventional commit(s) for this layer only
gh stack add layer-N   # next layer; or: gh stack add -Am "feat: ..."
  • Default: one agent (or one subagent) per layer; the next branch is created with gh stack add from the layer below. The primary agent reviews the diff before adding the next layer.
  • Worktrees: a second agent may start layer N+1 only if layer N's Produces signatures are locked and the parent commit exists. Otherwise it is fake parallelism and you will pay for it in merge fights.
  • Run verify-before-push per layer, not once at the top — every layer must be shippable on its own.

5. Submit and review

gh stack submit        # push stack branches, open/link PRs
gh stack view

After submit, reviews are parallel: the human, bot reviewers, and QA reviewers can each sit on a different layer. pr-reviewer is one dispatch for the whole stack — give it every PR (or just the head branch) and it reviews the chain as one unit before the URLs go to the human; never one instance per PR.

  • PR titles: Conventional Commit scoped to the layer, e.g. feat(api): ….
  • PR bodies: gh stack submit opens layer PRs with default bodies. Fill one body per layer PR following the repo's PR template, scoping WHAT / HOW / Evidence to that layer's diff.

6. Sync and merge

gh stack sync          # fetch, cascading rebase, push, retarget PR bases
gh stack merge         # contiguous bottom-up; branch protections still apply

Merging a middle layer lands everything beneath it. A partial merge of the bottom is fine; upper PRs stay open and retarget.

If the repo enables a merge queue, re-check GitHub's stacked-PR merge docs (queue support has been rolling out in public preview).

Done when

  • The approved plan's layers match gh stack view.
  • Each PR's CI is meaningful for that layer.
  • Every layer PR body follows the repo's PR template.
  • Merge proceeds from the bottom when that layer is approved.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.