Skip to content
Skills Library
Programming · Automation

wrap

/wrap

Lands the current branch: commits what's left, rebases, pushes, opens the PR if there is none, and rebase-merges it once checks pass and GitHub reports it ready. Use when asked to wrap up, ship or land the branch. Not for native stacks (split-pr-stack) or Renovate queues (land-renovate).

Repository
skills ↗
Licence
MIT
Last repository change
13.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Lands the current branch: commits what's left, rebases, pushes, opens the PR if there is none, and rebase-merges it once checks pass and GitHub reports it ready. Use when asked to wrap up, ship or land the branch. Not for native stacks (split-pr-stack) or Renovate queues (land-renovate).

Original author description

Lands the current branch: commits what's left, rebases, pushes, opens the PR if there is none, and rebase-merges it once checks pass and GitHub reports it ready. Use when asked to wrap up, ship or land the branch. Not for native stacks (split-pr-stack) or Renovate queues (land-renovate).

How it works

  1. Steps
Original SKILL.md headings · 72 lines, 370 words
SKILL.md preview
---
name: wrap
description: >-
  Lands the current branch: commits what's left, rebases, pushes, opens the PR
  if there is none, and rebase-merges it once checks pass and GitHub reports it
  ready. Use when asked to wrap up, ship or land the branch. Not for native
  stacks (split-pr-stack) or Renovate queues (land-renovate).
---

# Wrap

Commit anything outstanding, rebase, push, and merge the PR once checks are
green. Run it from the feature worktree being landed — never from `main`.

## Steps

1. **Stack guard** — if the `gh-stack` extension is installed
   (`gh extension list`), run `gh stack view --json`. Exit 0 means this branch
   is part of a native GitHub stack: **stop**. Raw rebase/force-push corrupts
   the chain, merging a stacked PR pulls in every unmerged PR below it, and
   native stacks cannot be landed with `gh pr merge` or `--admin` at all.
   Landing a stack is a separate human-driven step (see the `split-pr-stack`
   skill); this skill does not support it yet.

2. **Commit** — if the worktree is dirty, use `/create-commit`. Stop if there
   are unrelated changes that shouldn't be bundled in.

3. **Rebase** — resolve the base branch from the open PR when one exists
   (`gh pr view --json baseRefName -q .baseRefName`), falling back to `main`;
   then fetch and rebase:

   ```bash
   git fetch origin "$BASE_BRANCH"
   git rebase "origin/$BASE_BRANCH"
   ```

   Resolve any conflicts before continuing.

4. **Push** — first push uses `-u`; after a rebase use `--force-with-lease`.

5. **PR** — if no open PR exists, use `/create-pr` (skip the interactive
   confirmation step). If one already exists, leave it as-is.

6. **Watch checks** — note the head, then wait for its checks to finish:

   ```bash
   gh pr view <number> --json headRefOid -q .headRefOid
   gh pr checks <number> --watch
   ```

   Stop if any check failed or was cancelled. Skipped and neutral checks count
   as passing: path filters and conditional jobs skip by design.

7. **Merge** — read the merge state GitHub reports, which also covers branch
   protection:

   ```bash
   gh pr view <number> --json mergeStateStatus,reviewDecision
   ```

   - `CLEAN` or `HAS_HOOKS`: merge.

     ```bash
     gh pr merge <number> --rebase --match-head-commit <head>
     ```

   - `BLOCKED` with `reviewDecision=REVIEW_REQUIRED`, and every check passed:
     the repository requires a review its author can't give. Merge with
     `--admin` and say that you did.

     ```bash
     gh pr merge <number> --admin --rebase --match-head-commit <head>
     ```

   - `BEHIND`: the base moved while checks ran; go back to step 3.
   - Anything else: stop and report the state.

   `<head>` is the SHA from step 6, so the merge fails if anything was pushed
   after the checks started.

Versions

RepositoryScoreLicence
This page · langri-sha/skills100MIT
clawnify/greybeard100MIT
egregore-labs/egregore100MIT
egregore-labs/egregore100MIT
hazarsozer/ren-os100MIT
cdeistopened/skill-stack90MIT

Database snapshot: 13.11.2026 · package version c0e79ab700cf (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100land-renovate
    Batch-lands a repository's open Renovate PRs, oldest first: approves and rebase-merges the green ones, sends conflicting or stale ones back to Renovate's rebase checkbox, and stops on real failures or upgrades that need a coordinated edit. Use when asked to land, merge or clear…
  • 100rc-git
    Moves work onto a branch, pushes, opens a PR; also rebase and conflicts. Use to ship local work. Do not use to commit in place.
  • 100rebase
    Rebases the current feature branch onto the base branch (main/master/develop). Use when the user says "rebase", "sync branch", or "update branch".
  • 100merge-renovate-prs
    Checks open Renovate pull requests in the current repository, reports their state, and merges them one by one, waiting for Renovate to rebase when a merge conflict appears. Use when the user asks to merge renovate PRs, process dependency update PRs, or clear the Renovate queue.
  • 90sync-branch
    Quickly sync current branch with main using rebase. Use when you need to pull latest main into your feature branch, before creating MR or after ongoing work. Fetches main, rebases, auto-stashes changes, optionally force-pushes.
  • 100rebase
    Rebase the current branch with flexible target options. Use when you need to rebase on main, a specific branch, or a remote branch, with intelligent conflict handling.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.