Auto-detect branch layout from git reflog
Auto-detects branch dependencies from git reflog and creates a git-machete layout.
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemintgit/stacked/<butler_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/gitbutler-context.sh
</butler_context>
<worktree_status>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/worktree-context.sh 2>&1
</worktree_status>
<stack_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/machete-context.sh 2>&1
</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>Auto-detect branch dependencies from git reflog and create a machete layout file.
</objective> <workflow>git_common_dir=$(git rev-parse --git-common-dir 2>/dev/null)
machete_file="${git_common_dir}/machete"
if [[ -f "$machete_file" ]]; then
echo "Existing layout found:"
cat "$machete_file"
fi
If layout exists:
AskUserQuestion({
questions: [
{
question: "A machete layout already exists. What to do?",
header: "Existing",
options: [
{
label: "Keep existing",
description: "Don't modify the current layout",
},
{
label: "Re-discover",
description: "Backup existing and create new layout",
},
{ label: "Edit manually", description: "Open editor to modify layout" },
],
multiSelect: false,
},
],
});
if [[ -f "$machete_file" ]]; then
cp "$machete_file" "${machete_file}~"
echo "Backed up to ${machete_file}~"
fi
git machete discover --list-commits
AskUserQuestion({
questions: [
{
question: "Accept the discovered layout?",
header: "Confirm",
options: [
{
label: "Yes (Recommended)",
description: "Accept the discovered layout",
},
{
label: "Edit first",
description: "Open editor to modify before saving",
},
{ label: "Cancel", description: "Don't save, keep previous layout" },
],
multiSelect: false,
},
],
});
If "Yes": git machete discover --yes
If "Edit first": git machete discover --yes && git machete edit
git machete github anno-prs
git machete status --list-commits
</workflow>
<success_criteria>
.git/machete</success_criteria>
/discoverComprendre le besoin avant développement (Phase 0)
/discoverComprendre le besoin avant développement - Mode AUTO (Phase 0)