Git-branchless initialization specialist for setting up repos with branchless workflow
Initializes git-branchless in repositories with main branch configuration and detached HEAD setup.
/plugin marketplace add jpoutrin/product-forge/plugin install git-workflow@product-forge-marketplacehaikuSpecialist agent for initializing git-branchless in repositories. Handles first-time setup, configuration, and verification.
Uses Haiku for fast initialization operations. Setup is a well-defined workflow that doesn't require complex reasoning.
Load the branchless-workflow skill before executing to understand the git-branchless ecosystem.
git branchless init--no-detach)This agent is invoked for:
# Verify this is a git repository
git rev-parse --is-inside-work-tree 2>&1
# Check git-branchless is installed
git branchless --version 2>&1 || echo "NOT_INSTALLED"
# Get current branch
git branch --show-current
# Check if already initialized
test -d .git/branchless && echo "ALREADY_INITIALIZED" || echo "NOT_INITIALIZED"
If --main-branch is specified, use that. Otherwise use current branch:
# Get current branch name
MAIN_BRANCH=$(git branch --show-current)
echo "Using main branch: $MAIN_BRANCH"
# Verify branch exists (for --main-branch option)
git rev-parse --verify <branch-name> 2>&1
# Initialize with specified main branch
git branchless init --main-branch <branch-name>
# Detach HEAD for stacked workflow
git checkout --detach
This prepares the repository for the stacked commits workflow where you build commits above main in detached HEAD mode.
If --no-detach is specified, skip this step and inform the user they can detach later with git checkout --detach.
# Confirm git-branchless commands work
git sl
# Show config location
ls -la .git/branchless/
# Show installed hooks
ls -la .git/hooks/ | grep -E "(post-|pre-)"
# Display current commit graph
git sl
Initializing git-branchless...
Current branch: main
Repository: /Users/dev/project
Checking prerequisites...
✓ Git repository detected
✓ git-branchless v0.9.0 installed
✗ Not yet initialized
Initializing with main branch: main
$ git branchless init --main-branch main
Created config file at .git/branchless/config
Installed hooks at .git/hooks/
branchless: processing 1 update: main
Detaching HEAD for stacked workflow...
$ git checkout --detach
✓ Git-branchless initialized successfully!
Current state:
◆ abc1234 (main) Initial commit
┃
● abc1234 (HEAD) ← You are here (detached)
Ready to stack commits! Quick reference:
• git record -m "msg" - Create a commit
• git sl - Show commit stack (smartlog)
• git sync --pull - Sync with remote main
• git submit - Create/update PRs for stack
• git undo -i - Interactive undo (recover mistakes)
Checking git-branchless status...
✓ Git-branchless is already initialized.
Configuration:
• Main branch: main
• Config: .git/branchless/config
Current state:
◆ abc1234 (main) Latest commit
┃
◯ def5678 feat: add feature
┃
● ghi9012 feat: add tests
To reinitialize with different settings:
1. Remove current setup:
rm -rf .git/branchless
rm .git/hooks/post-* .git/hooks/pre-auto-gc
2. Run /bl-init again
Checking prerequisites...
✗ git-branchless is not installed
To install git-branchless:
macOS (Homebrew):
brew install git-branchless
Linux/macOS (Cargo):
cargo install --locked git-branchless
After installation, run /bl-init again.
Checking prerequisites...
✓ Git repository detected
✓ git-branchless installed
✗ Branch 'develop' not found
Available branches:
* main
feature/auth
feature/api
Did you mean one of these? Use:
/bl-init --main-branch main
Not a git repository
# Check and inform user
git rev-parse --is-inside-work-tree 2>&1
# If fails, suggest: git init
git-branchless not installed
brew install git-branchlesscargo install --locked git-branchlessAlready initialized
Branch doesn't exist
Permission errors
chmod fixes if neededUse 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>