一键导入
stack-branch
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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | stack-branch |
| description | 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. |
| allowed-tools | Read,Bash(git:*),Bash(~/.agents/skills/stack-branch/scripts/gh-pr-create.sh:*),Bash(gh pr create:*),Skill,AskUserQuestion,mcp__jira__* |
| model-tier | standard |
| model | sonnet |
| effort | medium |
| version | 1.0.0 |
| author | flurdy |
Create a new branch based on an existing PR branch (not main) for dependent work.
/stack-branch AB-456
/stack-branch AB-456 feature/parent-branch # Explicit parent
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}"
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.
# Fetch the parent branch
git fetch origin {parent-branch}
# Check out and update local copy
git checkout {parent-branch}
git pull origin {parent-branch}
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
git checkout -b {new-branch-name}
git push -u origin {new-branch-name}
Tell the user:
{new-branch-name} based on {parent-branch}{parent-branch} not main{parent-branch} is merged, use /rebase-merged-parent to rebase onto mainAsk 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.
~/.agents/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
)"
Query an independent peer or a configurable local/OpenRouter review panel, with distinct quorum and evidence-backed consensus interpretation policies.
Safely coordinate bounded delegation while preserving observable outcome and acceptance-evidence pairs through one-writer execution, independent review, and parent validation. Explicit invocation only.
Detect whether a beads repository needs classic-to-Dolt migration or an in-place Dolt schema upgrade.
Migrate beads from classic SQLite/JSONL to Dolt, or safely upgrade an existing Dolt schema after a bd upgrade.
Read-only current-session and UTC-week token telemetry dashboard for Pi, Claude Code, Codex, and optional OpenRouter management analytics.
Read-only audit of Pi routing and configured second-opinion panel model IDs against the active Pi catalog and public live model metadata; reports when Pi or configured models merit review without editing config.