Guides queue authorization, fleet role contracts, VCS routing, and landing evidence for stacked PRs and trunk-based PRs in gitea-mq repositories. Use when preparing, authorizing, or reviewing stacked changes.
Ships in version-control-and-forge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill guides authors and orchestrators preparing ordinary PRs or stacked changes for repositories managed by gitea-mq.
It owns queue authorization, fleet role contracts, VCS routing, and landing evidence.
The upstream mergify-stack skill owns Git-native stack authoring and publication mechanics, subject to §Fleet upstream overrides below.
Keep both skills separately visible; the upstream skill is third-party content and must remain unedited.
The pattern was verified landing PRs 2738, 2739, and 2740 in cameronraysmith/vanixiets on 2026-08-18: main was fast-forwarded to fe5a4b71 and GitHub merged all three PRs by reachability within one second. This evidence covers only the observed fast-forward landing and GitHub reachability. It does not establish Mergify publication, native registration, queue batching, or asynchronous queue completion.
A worker prepares and verifies one independently shippable change, commits it, and returns its ref plus verification evidence to the orchestrator without publishing or landing it.
The worker follows mergify-stack for Git-native stack identity, commit, and rewrite mechanics while keeping the result local.
Each stack delivery step remains one commit and one PR, with exactly one Change-Id matching ^I[0-9a-f]{40}$ and the Linear issue id in the commit body.
Corrections update that delivery commit only; this does not permit rewriting unrelated history.
mergify stack copies each delivery commit's subject and body into its pull request's title and body, so the commit message is the pull request's text.
Title each member by what it changes, never by its place in the stack or the plan (wave 3, part 2 of 4), and write the body for a reader who has only that pull request and the repository; the outward-facing writing rule in agent-context-core says which terms that reader can resolve, and preferences-style-and-conventions §Forge and tracker text sets its line wrapping and references to other repositories.
The same holds for an ordinary PR and for each of several PRs authorized together.
For delegated work, the orchestrator alone orders returned refs and publishes their pull-request stack through mergify-stack, subject to §Fleet upstream overrides.
Its terminal action is authorization under §Queue authorization, followed by asynchronous queue ownership of landing.
Independent authors use the same policy directly for their own PRs and stacks.
| Requirement | Mechanism | Owner |
|---|---|---|
| Each step is independently shippable | Run relevant tests and return the ref with evidence. | Worker |
| Git-native identity survives worker rewrites | Follow upstream mergify-stack and preserve Change-Id without publishing. | Worker |
| Delegated refs form the intended stack | Order and inspect refs, then publish under §Fleet upstream overrides. | Orchestrator |
| Authorization covers the intended changes | Follow §Queue authorization. | Author or orchestrator |
| Authorized work lands asynchronously | Test and land the selected head or batch. | Queue |
| Colocated-jj local work preserves the development join | Follow jj-version-control and its return-by-ref contract. | Worker and orchestrator |
Before a pull request is opened or a stack is pushed, the publisher (the orchestrator, or an author publishing their own work) has the titles, bodies and commit messages read by someone with none of the conversation: a fresh subagent given only that text and the diff, or, when no subagent is available, the publisher rereading them alone.
The reader lists every term it cannot resolve from that text and the repository, and every sentence that justifies a change by who decided it rather than by a reason.
The publisher replaces each listed term with what it refers to, or defines it where it stands, and each listed sentence with the reason, following the outward-facing writing rule in agent-context-core, and then publishes.
Nothing enforces this step; it is not a gate.
Give the reader this prompt:
You have only the pull-request titles, bodies, commit messages and diff below, and this repository at the diff's head commit.
Quote every word, number or label in the titles, bodies and commit messages whose meaning you cannot work out from them or from the repository.
Also quote every sentence that justifies a change by who decided or approved it rather than by a reason.
For each quote, say what you would need to know. Report nothing else and change nothing.
In vanixiets, gitea-mq is deployed at https://mq.scientistexperience.net with App id 4875422, batchMax = 20, and skipQueueIfUpToDate = true, and the App is installed on cameronraysmith/vanixiets (modules/nixos/gitea-mq.nix).
Its required external checks come from our active default-branch ruleset: nixbot/nix-eval, nixbot/nix-build, and nixbot/effects.
The App's own ruleset requires the gitea-mq context, which it posts only after enqueue; never treat that context's absence as a reason to withhold authorization.
.github/mergify.yml carries pull-request rules only and no queue rules; Mergify lands nothing.
For a repository whose queue is not yet installed, stop before authorization and request the coordinated cutover; do not use a direct-push or real stack-land fallback.
Risk class determines when to authorize; PR shape independently determines how to enqueue. Human or agent authorship determines neither axis. CI-sufficient changes need no additional review by policy, while review-required changes need review of all intended changes before the signal. For a stack, that review includes every member selected by the topmost intended PR. If the risk classification is unresolved, ask before authorizing.
Under policy E1, the enqueue signal itself is merge authorization, governed by convention and manual audit rather than queue enforcement of review.
The queue is review-blind and its App bypasses rulesets, so an approving-review rule does not constrain its ref update.
The queue derives required external checks from the forge ruleset; those checks gate the selected head and tested batch, not each lower stack member separately.
See docs/notes/development/version-control/adr-substitution-first-rollup-landing.md §Decision and Appendix A R15/R16 for this policy's authority.
Before publication from an aarch64-darwin laptop, warm Linux CI with:
just check-fast auto off x86_64-linux 2>&1 | tee logs/checks-linux-$(date +%Y%m%d-%H%M%S).log
justfile::check-fast takes positional nom push system parameters.
A non-native system adds --remote magnetite.zt --no-download --retries 2, building on magnetite and leaving outputs in magnetite's own store.
Nixbot reports those available outputs as local and skips them (build_scheduler.py::JobScheduler._classify).
just check-fast auto on populates niks3 for peer darwin laptops and is not needed to warm CI.
Native laptop feedback is separate; --no-download brings no outputs back to the laptop, and changed post-merge trees can still require new builds.
After warming and any required review, authorize according to shape:
gh pr merge <PR> --auto --rebase.
That act authorizes the queue to merge the PR; approving a review does not, because no ruleset requires review and the App bypasses rulesets.
--rebase matters only on the single up-to-date entry path, where the forge performs the merge; a batch lands by fast-forward to the tested SHA regardless.
For a wave of PRs, gh-queue-open-prs derives the required set from the live rulesets, reports each PR's verdict, and enqueues the green ones.
It reports rather than enqueues any PR that is draft, conflicting, already queued, labelled merge-queue, or based on a branch other than the target, so the stack hazard below cannot be tripped by bulk authorization.mergify stack push --trunk origin/main -R under §Fleet upstream overrides.
Verify actual GitHub-native membership, that all intended lower-member heads are ancestors of the selected head, and that the selected head descends from the intended target.
Command success or Depends-On: headers alone do not establish native registration; withhold authorization until missing membership or ancestry evidence is resolved.
Verify absence of auto-merge on every stack member, then label only the topmost intended PR merge-queue.Never enable auto-merge on any stack member, including the bottom member, even when the top PR has the correct label.
Gitea-mq internal/poller/poller.go::enqueueAutoMergePRs targets pr.BaseBranch without resolving the stack; internal/poller/poller.go::labeledTargetBranch calls ResolveStack to select the stack base.
internal/poller/poller.go::PollOnce runs auto-merge enqueue first, and internal/poller/poller.go::enqueueLabeledPRs skips already-queued PRs.
An upper member's auto-merge can therefore override a correct top label and silently land into the member below.
If any member has auto-merge enabled, remove it and inspect queue state before authorization.
Adding the correct top label does not repair an already queued entry; resolve that entry with the operator before proceeding.
After authorization, the author does not wait for landing and can begin other work. The queue owns testing and landing; rejection arrives as a queue comment on the PR.
For this protocol, these first-party overrides take precedence over examples in the unedited upstream mergify-stack skill.
Stack publication requires native registration (default since mergify-cli 2026.9.16.1; never pass --no-github-native and never set mergify-cli.stack-github-native false) and the registration checks in §Queue authorization, even when an upstream example uses plain push.
The client silently skips registration where GitHub's Stacks API is unavailable, so the default does not replace those checks.
The remote stack namespace comes from mergify-cli.stack-branch-prefix, defaulting to stack/<author> when unset.
See mergify-cli crates/mergify-stack/src/stack_context.rs::configured_branch_prefix, default_branch_prefix, and resolve_default_branch_prefix.
Keep that published namespace and the PR-opening identity stable across updates so stack discovery finds the existing PRs.
The local work branch is separate from generated remote stack branches; renaming it alone does not redefine their identity.
There is no fixed fleet prefix that replaces the configured namespace.
Never resync or repush a landed stack as the normal author workflow; start a fresh stack for subsequent work.
Merged detection requires a merge timestamp and a head matching the local commit (crates/mergify-stack/src/sync_status.rs::classify and crates/mergify-stack/src/changes.rs::classify).
Closed-unmerged PRs can be recreated by the client (crates/mergify-stack/src/remote_changes.rs::group_by_change_id).
The ADR's first-live V1 re-confirmation is a controlled verification activity, not permission to reuse a landed stack.
stack-land --dry-run --tip REV PR... is available only as an optional diagnostic in this protocol, never as a landing mechanism or prerequisite for authorization.
It checks target ancestry, exactly one valid Change-Id per selected commit, and nonempty reported-check sets containing only SUCCESS, NEUTRAL, or SKIPPED.
Pending, failing, empty, or other check sets fail that diagnostic.
These all-member assertions differ from the queue's selected-head gate and establish neither review approval nor PR-set completeness.
Do not invoke the tool's real mode, including during the transition while its package demotion is pending.
Git is the baseline; jj is an upgrade path when conflict volume warrants it.
The shared Change-Id format preserves identity and PR bookkeeping across that switch.
Use mergify-stack for Git-native local mechanics under the first-party overrides above.
When .jj/ is present, keep development-join, hazard, recovery, and worktree operations in jj-version-control.
In either mode, workers return verified refs and the publisher follows §Queue authorization for external handoff.
What SKILL.md sets; muted values are Claude Code's defaults
/version-control-and-forge:git-stacked-pr-integrationfrom version-control-and-forge
npx claudepluginhub cameronraysmith/vanixiets --plugin version-control-and-forge10 skills in this plugin
/butCommit, push, branch, and manage version control with GitButler. Use for: commit my changes, check what changed, create a PR, push my branch, view diff, create branches, stage files, edit commit history, squash commits, amend commits, undo commits, pull requests, merge, stash work. Replaces git - use 'but' instead of git commit, git status, git push, git checkout, git add, git diff, git branch, git rebase, git stash, git merge. Covers all git, version control, and source control operations./dependency-source-acquisitionResolve a named repository to a local copy before reasoning about it, and acquire one when missing. Covers two lookup kinds, maintained repositories under ~/projects/<repo> and reference repositories under $(ghq root) via ghq. Use whenever a repository is named in a task, when about to state a substantive technical claim grounded in a project's source, options, defaults, API, or upstream documentation, when resolving a package's source-repository URL from cargo/uv/bun/nix metadata, when a "(see local)" marker is appended to a name, or when given a GitHub file, issue, or PR URL.Other plugins' skills for the same job