Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

Auto Task.Execute With Stacked Prs

FreeNo executable scriptsNot checked

Execute a sequence of tasks as one stack of branches and PRs

gpsaggeseby gpsaggese★ 158 GitHub stars

About this skill

Goal

  • Execute one GitHub issue as a stack of sequential branches and PRs
    • Name each branch <BASE>_<ID> (ID = 1, 2, 3, ...)
    • Branch each one from the previous branch, so the PRs stack in review order
  • Create the whole stack without stopping for review
    • The user reviews, edits, and merges each PR bottom-up later
  • Follow .claude/skills/auto_task.rules.md for how tasks are queued, specified, and named

Input

  • The user passes a task in the format
    • <FILE>: file with the ordered task list (e.g., 05-tasks.md)
    • --only_plan: write the execution plan to a file, without executing it

When to Use This Skill

  • Use only when tasks favor stacked execution: complete specs, a real dependency chain, and a user who prefers one batch review over interruptions
  • If a spec is unclear, follow .claude/skills/auto_task.rules.md section "Ask for Clarification Before Executing an Unclear Plan". Do not build on a guess
  • Resolve all doubts with the user before you start, so the stack runs uninterrupted

Workflow

Create Only the Plan (--only_plan)

  • With --only_plan, follow .claude/skills/auto_task.rules.md section "Create Only a Plan with --only_plan"
  • Write the plan to auto_task.execute_with_stacked_prs.<INPUT_REF>.md, then stop: skip all the following sections of this workflow

Confirm the Task List

  • Follow .claude/skills/auto_task.rules.md section "Confirm the Task List Before Executing". Each ordered task is one branch
  • Keep the stack linear: branch <ID+1> from <ID>, in plan order
  • A task can depend on an earlier task and not on the one just before it (e.g., PR3 and PR4 both depend only on PR2)
    • Stack it on the task just before it (PR4 on PR3). Do not ask
    • Do not fork a sibling branch: sibling tasks often edit the same files and conflict at merge time
  • If the order or a dependency is unclear, ask before starting. A wrong dependency means rebasing the whole stack above it

Pick the Repo That Stacks

  • If the outer repo has changes, the outer repo stacks
    • See "Conventions" when a submodule also has changes
  • If all the changes are in a submodule (e.g., helpers_root), the submodule stacks. Do not ask
    • File the issue in the outer repo tracker

    • The outer repo gets only the issue and a <BASE>_1 branch, with no PR:

      > git_create_issue_and_branch.py \
          --gh_issue_title "<TITLE>" --gh_issue_body "<Description of entire stack>" \
          --suffix 1 --no_create_pr
      
    • Create <BASE>_1 to <BASE>_<N> and their PRs in the submodule repo

    • Create those branches by hand with git, since the tool does not stack submodule branches:

      > cd helpers_root
      # Create the first branch from `master`.
      > git fetch origin
      > git checkout -b <BASE>_1 origin/master
      # Create each following branch while on `<BASE>_<ID-1>`.
      > git checkout -b <BASE>_<ID>
      # After the commits of task `<ID>`, push and open the PR.
      # The base of the `<BASE>_1` PR is `master`.
      > git push -u origin <BASE>_<ID>
      > gh pr create --base <BASE>_<ID-1> --head <BASE>_<ID> --title "<TITLE>"
      

Create the Issue and the First Branch (_1)

  • Follow .claude/skills/auto_task.rules.md section "One GitHub Issue Is the Unit of Work": one issue covers the whole stack

  • For a stack in a submodule, use the commands in "Pick the Repo That Stacks" instead of the commands in this section and the next one

  • Create the issue and the first branch / PR <BASE>_1

    > git_create_issue_and_branch.py \
        --gh_issue_title "<TITLE>" --gh_issue_body "<Description of entire stack>" \
        --suffix 1
    
  • The description of the entire task is

  • Commit the file passed by the user (e.g., 05-tasks.md)

  • Implement task 1, run its tests, commit, push

Stack Each Following Branch (_<ID>)

  • For ID from 2 to N, while still checked out on <BASE>_<ID-1>:
    • Derive <BASE>_<ID> from the issue, not from the current branch name. Branch it from <BASE>_<ID-1>, not from master:

      > invoke git_branch_create --issue-id <NUM> --suffix <ID> \
          --no-only-branch-from-master --no-create-pr
      
      • Do not use invoke git_branch_next_name. It appends _1, _2, ... to the current branch, so from <BASE>_<ID-1> it gives <BASE>_<ID-1>_1
      • Pass --no-only-branch-from-master. The default only_branch_from_master (True) branches from origin/master, not from the current branch
    • Implement task <ID>, run its tests, commit, and push

    • Open the PR against <BASE>_<ID-1>, not master:

      > gh pr create --base <BASE>_<ID-1> --head <BASE>_<ID> --title "<TITLE>"
      
    • Do not stop for review. Move to <BASE>_<ID+1> once <BASE>_<ID>'s tests pass

Report the Stack

  • Confirm each PR's base with gh pr view <BASE>_<ID> --json baseRefName
  • Report one ordered list to the user: branch, PR link, and b
Full SKILL.md on GitHub

Install Auto Task.Execute With Stacked Prs in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the Auto Task.Execute With Stacked Prs skill do?

Execute a sequence of tasks as one stack of branches and PRs

How do I install the Auto Task.Execute With Stacked Prs skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the Auto Task.Execute With Stacked Prs skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare Auto Task.Execute With Stacked Prs with