Auto Task.Restack
БесплатноБез исполняемых скриптовНе проверенPropagate reviewed changes down an existing PR stack, keeping every PR mergeable
от gpsaggese★ 158 звёзд на GitHubОб этом скилле
Goal
- Given the current PR is one branch in a stack of sequential PRs, propagate changes reviewed in an earlier PR into every PR stacked on top of it
- Preserve full history: merge forward and commit. Never rebase or force-push
- End with every PR in the stack mergeable, with CI green
Input
--only_plan: write the propagation plan to a file, without executing it
When to Use This Skill
- Use after a PR in the middle or bottom of a stack was reviewed and changed, and the branches stacked on top of it need those changes
- Do not use this to build a new stack. Use
/auto_task.execute_with_stacked_prsinstead - Follow
.claude/skills/auto_task.rules.mdsection "Ask for Clarification Before Executing an Unclear Plan" when a PR's description is unclear. Do not guess and merge blind
Workflow
Create Only the Plan (--only_plan)
- With
--only_plan, follow.claude/skills/auto_task.rules.mdsection "Create Only a Plan with--only_plan" - Run only "Discover the Full Stack", "Print the Stack", and the creation of
auto_task.restack.md, then stop without waiting for a confirmation
Discover the Full Stack
- Get the current PR:
> gh pr view --json number,title,baseRefName,headRefName,url - Walk up from the current PR's
baseRefName, following each branch's own PR (gh pr list --head <base> --state all), until reaching the default branch (master). This is the bottom of the stack - Walk down from the current PR's
headRefName, finding the open PR whosebaseRefNameequals the previous PR'sheadRefName(gh pr list --base <branch> --state open). This is the top - Order the PRs from bottom (based on
master) to top - Check whether the bottom PR is behind the default branch:
If> gh pr view <bottom PR> --json mergeable,mergeStateStatusmergeableisCONFLICTING(or the branch is just behind), treat the default branch as an implicitPR_0at the bottom. It needs the same merge-forward treatment as every other pair
Print the Stack
- Print one table with columns
#,Branch,PR(#<NUM> — <title>),Base, e.g.:+---+--------------------+-----------------------------------------------+--------+ | # | Branch | PR | Base | +---+--------------------+-----------------------------------------------+--------+ | 1 | ..._invoke_tasks | #1423 -- auto-pick suffix in git_branch_create | master | | 2 | ..._invoke_tasks_2 | #1424 -- unit tests for git_*/gh_* tasks | #1423 | +---+--------------------+-----------------------------------------------+--------+
Create and Confirm the Propagation Plan
- Create
auto_task.restack.mdlisting, for every consecutive pair(PR_i, PR_i+1), including(master, PR_1)when the bottom PR is behind the default branch:- What
PR_ichanged, from its GH description andgit diff <base_i>...<head_i> - What must merge into
PR_i+1, and which files are likely to conflict (touched by both)
- What
- Wait for the user to confirm this plan before touching any branch
Propagate Changes Down the Stack
- Process pairs bottom-up, one at a time, so each merge includes everything
propagated so far. Start with
(master, PR_1)when it is in the plan - For each pair
(PR_i, PR_i+1)or(master, PR_1):- Read
PR_i's description (gh pr view <PR_i> --json body,title) to resolve conflicts by its intent, not blindly - Right before merging,
git fetchand confirm the local branch tip matchesorigin/<branch_i+1>. Another process or session can push mid-stack, and merging on a stale copy silently drops those commits> git fetch origin <branch_i> <branch_i+1> > git checkout <branch_i+1> > git reset --hard origin/<branch_i+1> > git merge origin/<branch_i> - Resolve conflicts by hand, favoring the intent of
PR_i's change. Do not usegit rebaseor force-push - Follow
.claude/skills/coding.rules.mdand.claude/skills/testing.rules.mdwhile resolving conflicts in code and tests - Commit the merge and run
git push. If the push is rejected becauseorigin/<branch_i+1>moved, re-fetch and redo the merge. Do not force-push over it
- Read
- Repeat up to the top of the stack
Make Every PR Mergeable
- For every PR in the stack, in order, run
/github_pr.get_ready_to_mergeto get its CI green - After propagation, confirm mergeability:
> gh pr view <NUM> --json mergeable,mergeStateStatus
Report Only Failures
- Do not comment on a PR that merged cleanly and passed CI
- If a PR hits an unresolved conflict or a CI failure needing human input, post
one comment explaining the problem:
> gh pr comment <NUM> --body "<what failed and why>" - Also describe the problem to the user directly. Do not leave it only in a PR comment
Conventions
- Follow `.claude/skills/auto_task.rule
Установить Auto Task.Restack в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Auto Task.Restack?
Propagate reviewed changes down an existing PR stack, keeping every PR mergeable
Как установить скилл Auto Task.Restack?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Auto Task.Restack запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic