Show git-machete branch stack status with visual indicators
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemintgit/<stack_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/machete-context.sh
</stack_context>
<edge_colors>
| Color | Meaning | Action |
|---|---|---|
| š¢ Green | In sync with parent | No action needed |
| š” Yellow | In sync, but fork point differs | Hidden commits exist, may need investigation |
| š“ Red | Out of sync with parent | Run Skill({ skill: "crew:git:sync" }) |
| ā« Gray (o) | Merged into parent | Run Skill({ skill: "crew:git:slide-out" }) |
</edge_colors>
<process>If no layout:
AskUserQuestion({
questions: [
{
question: "No git-machete layout found. What to do?",
header: "Setup",
options: [
{
label: "Discover layout (Recommended)",
description: "Auto-detect from history",
},
{ label: "Skip", description: "Continue without machete" },
],
multiSelect: false,
},
],
});
If "Discover layout":
Skill({ skill: "crew:git:discover" });
# Annotate branches with PR numbers and URLs
git machete github anno-prs 2>/dev/null || true
AskUserQuestion({
questions: [
{
question: "What level of detail?",
header: "Detail",
options: [
{ label: "Summary", description: "Branch tree only" },
{
label: "With commits (Recommended)",
description: "Show commits per branch",
},
{ label: "Full", description: "Commits + fork points + remotes" },
],
multiSelect: false,
},
],
});
Summary:
git machete status
With commits:
git machete status --list-commits
Full:
git machete status --list-commits --list-commits-with-hashes
echo
echo "=== Fork Points ==="
for branch in $(git machete list managed); do
fp=$(git machete fork-point "$branch" 2>/dev/null || echo "unknown")
echo "$branch: $fp"
done
status_output=$(git machete status 2>/dev/null)
# Count issues
red_count=$(echo "$status_output" | grep -c "^[^o].*[āāā]" 2>/dev/null || echo "0")
merged_count=$(echo "$status_output" | grep -cE "^\s*o\s" 2>/dev/null || echo "0")
If issues detected, suggest next steps:
If red edges (out of sync):
ā ļø $red_count branch(es) out of sync with parent.
Recommended: Run `Skill({ skill: "crew:git:traverse" })` to sync all branches.
If gray edges (merged):
š $merged_count merged branch(es) detected.
Recommended: Run `Skill({ skill: "crew:git:slide-out" })` to clean up.
If all green:
ā
All branches are in sync!
</process>
<annotations>
Branches may have annotations showing:
Example status output:
main
ā
āā feature-auth PR #45
ā ā
ā āā feature-auth-tests PR #46 rebase=no push=no
ā
āāo feature-old PR #30 (merged)
</annotations>
<quick_actions>
After viewing status, common next steps:
| Situation | Command |
|---|---|
| Branches out of sync | Skill({ skill: "crew:git:traverse" }) |
| Merged branches to clean | Skill({ skill: "crew:git:slide-out" }) |
| Need to add current branch | Skill({ skill: "crew:git:stack-add" }) |
| Navigate to another branch | Skill({ skill: "crew:git:go" }) |
| Create PR for branch | Skill({ skill: "crew:git:pr" }) |
</quick_actions>
<success_criteria>
</success_criteria>