From m
Sync main + all worktree branches using Git Town. Handles conflicts, iterates worktrees, reports results.
npx claudepluginhub ai-builder-team/ai-builder-plugin-marketplace --plugin mThis skill is limited to using the following tools:
Synchronize the entire repo: main branch, all feature branches, and all worktree working directories in one pass.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Synchronize the entire repo: main branch, all feature branches, and all worktree working directories in one pass.
For worktree management (create, remove, list, launch servers), use /m:gtr.
git rev-parse --show-toplevel 2>/dev/null || echo "Not in a git repo"git branch --show-current 2>/dev/null || echo "N/A"git town --version 2>/dev/null || echo "NOT INSTALLED — install via: brew install git-town"git config git-town.sync-feature-strategy 2>/dev/null || echo "not set (default: merge)"git worktree list 2>/dev/null || echo "No worktrees"$ARGUMENTS
Git Town has no --non-interactive flag. Any unclassified local branch triggers an interactive prompt that breaks automation. Run this before every sync.
git config git-town.perennial-regex "^prod$"
git config git-town.observed-regex "backup"
known_parents=$(git config --get-regexp 'git-town-branch\..*\.parent' 2>/dev/null | sed 's/git-town-branch\.\(.*\)\.parent.*/\1/')
perennial_regex=$(git config git-town.perennial-regex 2>/dev/null || echo "^$")
observed_regex=$(git config git-town.observed-regex 2>/dev/null || echo "^$")
for branch in $(git for-each-ref --format='%(refname:short)' refs/heads/ | grep -v '^main$'); do
echo "$known_parents" | grep -qxF "$branch" && continue
echo "$branch" | grep -qE "$perennial_regex" && continue
echo "$branch" | grep -qE "$observed_regex" && continue
git config git-town.perennial-branches 2>/dev/null | tr ' ' '\n' | grep -qxF "$branch" && continue
git config "git-town-branch.$branch.parent" main
echo "Set parent: $branch -> main"
done
git town sync --all --dry-run 2>&1 | grep -c "cannot determine parent"
If count > 0, investigate before proceeding.
Run from the main worktree (repo root):
git town sync --all
This fetches all remotes, syncs every branch that isn't checked out in another worktree, pushes, and cleans up merged branches.
If sync stops with a conflict: print the conflict details and tell the user to resolve, then run /m:sync continue to resume. Do NOT attempt to resolve conflicts automatically.
git town sync --all skips branches checked out in other worktrees. To truly sync everything, iterate through each worktree and sync from within it.
main_wt=$(git rev-parse --show-toplevel)
git worktree list --porcelain | grep '^worktree ' | sed 's/^worktree //' | while read wt_path; do
[ "$wt_path" = "$main_wt" ] && continue
branch=$(cd "$wt_path" && git branch --show-current)
echo "=== Syncing worktree: $wt_path ($branch) ==="
(cd "$wt_path" && git town sync) || echo " CONFLICT in $wt_path — resolve manually, then run: /m:sync continue"
done
If a worktree sync fails with conflicts:
Summarize what happened:
When the user says "continue" or invokes /m:sync continue:
Check if there's a suspended Git Town operation:
git town status
If suspended, resume it:
git town continue
If continue succeeds and there are more worktrees to sync, pick up where Step 3 left off — iterate the remaining worktrees.
If continue hits another conflict, report it and wait.
Brief narration between commands. No inline teaching. At the end, provide a summary of what was synced and any issues found.
Keep it tight — this skill is about getting branches synced, not explaining git theory.