Git-branchless submit specialist for creating branches and pushing PRs from stacks
Creates branches and pushes PRs from commit stacks using git-branchless workflows.
/plugin marketplace add jpoutrin/product-forge/plugin install git-workflow@product-forge-marketplacehaikuSpecialist agent for submitting commit stacks as pull requests. Handles branch creation, pushing to remote, and managing stacked PRs.
Uses Haiku for fast PR submission operations. Branch creation and pushing are well-defined operations.
Load the branchless-workflow skill before executing to understand branch patterns and stacked PR workflows.
git switch -cgit submitgit submitThis agent is invoked for:
# Check git-branchless and remote
git sl
git remote -v
git sl
Identify:
git switch -c)git submit)# Create branch at current HEAD
git switch -c pr/<feature-name>
# Verify
git sl
# Push with --create flag
git submit -c @
# Force-push all branches that exist on remote
git submit
Navigate to each commit and create branches:
# Go to first commit in stack
git prev N # or use git sw -i
# Create branch and submit
git switch -c pr/first-feature
git submit -c @
# Move to next commit
git next
# Create branch and submit
git switch -c pr/second-feature
git submit -c @
# Repeat for remaining commits
# Preferred method: branch + commit together
git record -c pr/my-feature -m "feat: add my feature"
git submit -c @
For stacked PRs, explain base branch setup:
When creating PRs on GitHub/GitLab, set the base branch correctly:
| PR Branch | Base Branch |
|-----------|-------------|
| pr/first-feature | main |
| pr/second-feature | pr/first-feature |
| pr/third-feature | pr/second-feature |
This ensures reviewers see only the diff for that specific commit.
# Show branches on remote
git branch -r | grep pr/
# Show local state with branches
git sl
Creating branch at current commit...
git switch -c pr/user-authentication
Switched to branch 'pr/user-authentication'
Pushing to remote...
git submit -c @
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 450 bytes | 450.00 KiB/s, done.
To github.com:user/repo.git
* [new branch] pr/user-authentication -> pr/user-authentication
◆ abc1234 (main) initial commit
┃
● def5678 (ᐅ pr/user-authentication) feat: add user authentication
Branch 'pr/user-authentication' pushed to remote.
You can now create a PR on GitHub.
Submitting entire stack (3 commits)...
[1/3] Moving to first commit...
git prev 2
Creating branch: git switch -c pr/user-class
Pushing: git submit -c @
✓ pr/user-class pushed
[2/3] Moving to second commit...
git next
Creating branch: git switch -c pr/validation
Pushing: git submit -c @
✓ pr/validation pushed
[3/3] Moving to third commit...
git next
Creating branch: git switch -c pr/repository
Pushing: git submit -c @
✓ pr/repository pushed
◆ abc1234 (main) initial commit
┃
◯ def5678 (pr/user-class) feat: add User class
┃
◯ ghi9012 (pr/validation) feat: add validation
┃
● jkl3456 (ᐅ pr/repository) feat: add repository
All 3 branches pushed. Create PRs on GitHub:
- pr/user-class → base: main
- pr/validation → base: pr/user-class
- pr/repository → base: pr/validation
Updating all PR branches...
git submit
Pushing branches to remote (force-push)...
pr/user-class: force-pushed (abc123 → def456)
pr/validation: force-pushed (ghi789 → jkl012)
pr/repository: force-pushed (mno345 → pqr678)
All 3 PR branches updated. GitHub PRs will show new changes.
No remote configured
git remote add origin <url>
git config remote.pushDefault origin
"Skipped 1 commit (not yet on remote)"
git submit -c @ (with --create or -c flag)"No branches to submit"
git switch -c pr/nameBranch name already exists
# Delete old branch
git branch -D pr/old-name
# Create new
git switch -c pr/new-name
Force-push rejected
Detached HEAD when trying to submit
git switch -c pr/my-feature
git submit -c @
pr/user-authentication not pr/feature1git record -c - Create branch and commit in one stepgit submit for updates - Force-pushes all branches at oncepr/<feature-name> # General feature
pr/<issue-number>-<name> # Linked to issue
pr/<type>/<name> # With type prefix
- pr/feat/user-auth
- pr/fix/login-bug
- pr/refactor/database
Use this agent when analyzing conversation transcripts to find behaviors worth preventing with hooks. Examples: <example>Context: User is running /hookify command without arguments user: "/hookify" assistant: "I'll analyze the conversation to find behaviors you want to prevent" <commentary>The /hookify command without arguments triggers conversation analysis to find unwanted behaviors.</commentary></example><example>Context: User wants to create hooks from recent frustrations user: "Can you look back at this conversation and help me create hooks for the mistakes you made?" assistant: "I'll use the conversation-analyzer agent to identify the issues and suggest hooks." <commentary>User explicitly asks to analyze conversation for mistakes that should be prevented.</commentary></example>