| name | add-stacked-pr-breadcrumbs |
| description | Generate a stacked PR breadcrumbs block to add at the beginning of a PR body |
| disable-model-invocation | true |
Add Stacked PR Breadcrumbs
Generate a stacked PR breadcrumbs block to add at the beginning of a PR body.
Instructions
Use git branch-tree to figure out the branch hierarchy. Then lookup corresponding PR numbers for each branch and generate the breadcrumbs in this exact format:
> [!IMPORTANT]
> This is a stacked PR:
> - #<base_pr>
> - #<current_pr> :point_left:
> - #<child_pr>
Use gh to add the generated breadcrumbs block to the PR. If the PR already has a breadcrumbs block, replace it with the new one. Use a temp file for the PR body to ensure correct format.
Rules:
- Each level of the stack should be indented with 4 spaces more than the previous level
- The current PR (the one being created/edited) should have
:point_left: at the end
- Always start with the
> [!IMPORTANT] callout
- Always include the header line
> This is a stacked PR:
- Each PR number should be prefixed with
#
- All lines must start with
> to maintain the blockquote format
Example with 3 PRs in stack:
If the user provides: base PR #948, then #950, and current PR #951
Output:
> [!IMPORTANT]
> This is a stacked PR:
> - #948
> - #950
> - #951 :point_left:
Example with 2 PRs in stack:
If the user provides: base PR #948, current PR #950
Output:
> [!IMPORTANT]
> This is a stacked PR:
> - #948
> - #950 :point_left: