/superlite:merged runs instead · from superlite
Cleans up local state after a PR merge: removes the branch, updates main, and tidies session metadata. Useful for post-merge workflow automation.
This skill never runs in Claude Code
It ships in superlite at skills/, but /superlite:merged (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
The PR is merged on the remote. Bring the local repo up to date and remove what the PR left behind. Only existing tools, in this order; never push, never touch the remote branch. Nothing here is guessed: each step checks before it changes anything, and any check that fails stops the flow with nothing changed after it.
Take the first that works:
gh pr view <n> --json headRefName). Resolve a slug through bash <skill-dir>/../swarm/scripts/superlite-cli session status --json or <hub>/.superlite/session-store/<slug>/session.json and use its recorded branch; only fall back to superlite/sessions/<slug> when no session metadata exists.Find the base branch the way superlite:shipping step 2 does. Retain the slug resolved from an argument. For a branch selected by argument, PR, current checkout or the user's answer, find the slug by matching its branch in live session rows or archived <hub>/.superlite/session-store/*/session.json manifests. Only infer the slug from the superlite/sessions/ prefix when no matching metadata exists; otherwise a branch without matching metadata or that prefix has no slug.
gh pr list --head <branch> --state all --json number,state,url,headRefOid,headRepositoryOwner,mergeCommit,baseRefName
Keep only PRs whose headRepositoryOwner is this repo's owner (gh repo view --json owner): --head also matches same-named fork branches. The PR with the highest number decides.
gh, not signed in, or no PR for the branch: say so and stop. Do not fall back to git branch --merged; a squash merge never shows there.OPEN: say it is still open and stop.CLOSED, not merged: ask once, "Keep the branch" / "Discard it". On keep, stop. On discard, skip the head check below and step 4: run steps 3, 5 and 6.MERGED: use its baseRefName as the base and go on.Then check the local branch holds nothing the PR did not. If git cat-file -e <headRefOid> fails, run git fetch origin pull/<number>/head first; if it still fails, stop. Then git rev-parse --verify refs/heads/<branch> must equal headRefOid, or git log --oneline <headRefOid>..refs/heads/<branch> must exit 0 and print nothing. If it lists commits or exits non-zero, name them (or the error) and stop: they were never in the PR.
Look up the branch's checkout in git worktree list --porcelain.
git status --short there is not empty), its session row in session status reports stash:yes, or git rev-parse -q --verify refs/superlite/wip/<slug> finds parked work: that work is not in the PR. Name it and ask once, "Stop and keep it" / "Discard it". On stop, stop.session status: first leave its worktree if you are in one (ExitWorktree with action: "keep" under Claude Code, else cd to the main checkout), then from the main checkout run bash <skill-dir>/../swarm/scripts/superlite-cli session close --slug <slug> --keep-branch. It puts the host back on the base branch and removes a worktree superlite cut. On an ASK line (exit 4, nothing changed), ask exactly what its ask: line says and do what the chosen on ...: line says. A Claude-created worktree is not removed by close: end it with ExitWorktree remove, as superlite:shipping step 7 says.git reset --hard and git clean -fd in that checkout while it is still on the feature branch. Then switch that checkout to the base branch (git switch <base>), or leave a linked worktree the way step 7 of superlite:shipping does.git fetch --prune origin, then fast-forward only:
session status lists no session hosted there, even one whose run is finished): git merge --ff-only origin/<base> there. If another session hosts that checkout, report it and skip this step without changing its files.git fetch origin <base>:<base>.bash <skill-dir>/../swarm/scripts/superlite-cli session discard --slug <slug>. It drops the session's store and parked work ref, and the branch unless superlite adopted it.git rev-parse -q --verify refs/heads/<branch> still finds it, git branch -D <branch>. -D is safe here only because step 2 proved the branch is in the merged PR, or the user chose "Discard it"; never use it otherwise.The remote branch is not touched. GitHub's "delete branch on merge" or the user removes it.
Run bash <skill-dir>/../swarm/scripts/superlite-cli session status. Print one line per step: PR number and URL, merge commit, the session closed, base <old sha>..<new sha> (or why it was skipped), the branch deleted. Name each session now behind the base (main:+N); each one is offered the update in its own chat, nothing is synced here.
gh has not reported as merged, or one with commits the PR does not hold, unless the user chose "Discard it".What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub iha2/superlite --plugin superlite15 skills in this plugin
/closeUse when the user wants to end, abandon or park a superlite session without a merged PR/diagnosisUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes/draftingUse when you have an approved design or requirements for a multi-step task and need an implementation plan, before touching code./feature-prototypeUse in feature mode after the feature plan is approved, to cut the smallest runnable container of an existing app for the prototype build/inventingUse when the user asks to build a feature or component, add functionality, or change behavior, before any implementation code is written./mvp-prototypeUse in MVP mode (/superlite:mvp), after the .mvp.md feature plan is written, to make the one-file clickable prototype, check it, and read the user's feedback before the agent-format plan is written.Other plugins' skills for the same job