Add current or specified branch to the machete stack
Adds a branch to the git-machete stack and sets its parent branch.
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemint[branch-name] [--onto parent]git/stacked/<butler_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/gitbutler-context.sh
</butler_context>
<stack_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/machete-context.sh
</stack_context>
<gitbutler_incompatible>
This command does not work with GitButler.
If GITBUTLER_ACTIVE=true from <butler_context>:
Stacked branches (git-machete) are not compatible with GitButler virtual branches.
GitButler has its own stacking system. Use these instead:
- `crew:git:butler:status` - View virtual branches
- `crew:git:butler:branch` - Create virtual branch
- `crew:git:butler:sync` - Sync with upstream
To use machete, first disable GitButler in this repository.
Exit immediately. Do not proceed with machete commands.
</gitbutler_incompatible>
<objective>Add branch to machete layout. Ask for parent. Optionally add qualifiers.
</objective> <workflow>branch="${1:-$(git branch --show-current)}"
if git machete is-managed "$branch" 2>/dev/null; then
echo "Branch '$branch' is already in layout"
git machete status
exit 0
fi
If no layout:
AskUserQuestion({
questions: [
{
question: "No machete layout found. How to initialize?",
header: "Layout",
options: [
{
label: "Discover (Recommended)",
description: "Auto-detect all branches",
},
{
label: "Start with this branch",
description: "Create layout with just this branch",
},
],
multiSelect: false,
},
],
});
If "Discover": Skill({ skill: "crew:git:stacked:discover" })
AskUserQuestion({
questions: [
{
question: `Which branch should '${branch}' be stacked on?`,
header: "Parent",
options: [
{ label: "main", description: "Stack directly on main" },
// Add other branches from layout
],
multiSelect: false,
},
],
});
git machete add "$branch" --onto "$parent"
AskUserQuestion({
questions: [
{
question: "Add qualifiers?",
header: "Qualifiers",
options: [
{ label: "None", description: "Standard behavior" },
{ label: "rebase=no push=no", description: "Not my branch" },
{ label: "slide-out=no", description: "Never auto-slide-out" },
],
multiSelect: false,
},
],
});
If qualifiers: git machete anno "$branch" "$qualifiers"
git machete status --list-commits
</workflow>
<success_criteria>
</success_criteria>
/addCreate a new task. Use when user wants to add work items, create todos, or break down features into tasks.
/addCreate a new task. Use when user wants to add work items, create todos, or break down features into tasks.