Create a new branch with username prefix naming convention
Creates a new branch with username prefix and type-based naming convention.
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemint[description] [--type feat|fix|hotfix|chore] [--base main|current]git/branch/<butler_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/gitbutler-context.sh
</butler_context>
<gitbutler_incompatible>
This command does not work with GitButler.
If GITBUTLER_ACTIVE=true from <butler_context>:
Traditional git branches conflict with GitButler virtual branches.
GitButler manages branches as virtual branches in a single workspace.
Creating git branches directly can cause conflicts with the workspace state.
Use this instead:
- `crew:git:butler:branch` - Create a virtual branch
To use traditional branches, first disable GitButler in this repository.
Exit immediately. Do not proceed with branch creation.
</gitbutler_incompatible>
<objective>Create branch: username/type/slug from specified base. Ask type if not provided. Confirm name.
// If --type not provided, ask
if (!type) {
AskUserQuestion({
questions: [
{
question: "What type of branch?",
header: "Type",
options: [
{ label: "Feature (Recommended)", description: "feat/" },
{ label: "Bug fix", description: "fix/" },
{ label: "Hotfix", description: "hotfix/" },
{ label: "Chore", description: "chore/" },
],
multiSelect: false,
},
],
});
}
const username = Bash({ command: "whoami" }).trim();
const typePrefix =
{ Feature: "feat", "Bug fix": "fix", Hotfix: "hotfix", Chore: "chore" }[
type
] || type;
const slug = slugify(description); // kebab-case, max 30 chars
const branchName = `${username}/${typePrefix}/${slug}`;
# --base main (default): from origin/main
git fetch origin main && git checkout -b ${branchName} origin/main
# --base current: from current HEAD (for stacked branches)
git checkout -b ${branchName}
</workflow>
<success_criteria>
username/type/slug pattern</success_criteria>