AgentStack
SKILL verified MIT Self-run

Stack Branch

skill-flurdy-agent-skills-stack-branch · by flurdy

Create a new branch stacked on another PR. Use when you want to start work that depends on an existing PR that hasn't been merged yet.

No reviews yet
0 installs
12 views
0.0% view→install

Install

$ agentstack add skill-flurdy-agent-skills-stack-branch

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Stack Branch? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Create Stacked Branch

Create a new branch based on an existing PR branch (not main) for dependent work.

Usage

/stack-branch AB-456
/stack-branch AB-456 feature/parent-branch    # Explicit parent

Instructions

1. Get the Jira Ticket

The first argument is the Jira ticket number for the new work.

Use the /jira-ticket skill or the Jira MCP tools directly to get ticket details:

mcp__jira__jira_get with:
  path: /rest/api/3/issue/{ticketNumber}
  jq: "{key: key, summary: fields.summary, issuetype: fields.issuetype.name}"

2. Identify Parent Branch

If parent branch not specified:

# Check if currently on a feature branch
git branch --show-current

If on a feature branch (not main), offer to use it as the parent. Otherwise, ask the user which branch to stack on.

3. Ensure Parent is Up to Date

# Fetch the parent branch
git fetch origin {parent-branch}

# Check out and update local copy
git checkout {parent-branch}
git pull origin {parent-branch}

4. Create Branch Name

Map the Jira issue type to conventional commit prefix:

| Issue Type | Prefix | |------------|--------| | Story | feat | | Task | feat | | Bug | fix | | Improvement | feat | | Spike | chore | | Sub-task | inherit from parent |

Create branch name:

{prefix}/{TICKET}-{summary-in-kebab-case}

Example: feat/AB-456-add-caching-layer

5. Create the Branch

git checkout -b {new-branch-name}

6. Push and Set Upstream

git push -u origin {new-branch-name}

7. Inform User

Tell the user:

  • Created branch {new-branch-name} based on {parent-branch}
  • When creating a PR, target {parent-branch} not main
  • When {parent-branch} is merged, use /rebase-merged-parent to rebase onto main

8. Optional: Create Draft PR

Ask if the user wants to create a draft PR now:

Check for a repo-specific PR template at .github/pull-request-template.md or .github/pull_request_template.md. If found, use that format. If not, ask user for confirmation on generating the body ourselves.

Create the PR targeting parent branch
~/.claude/skills/stack-branch/scripts/gh-pr-create.sh --draft --base {parent-branch} --title "{type}({scope}): {description}" --body "$(cat <<'EOF'
{body}
EOF
)"

If the script is unavailable, fall back to:

gh pr create --draft --base {parent-branch} --title "{type}({scope}): {description}" --body "$(cat <<'EOF'
{body}
EOF
)"

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.