Skip to content
Development
Command

/sync-branch

Sync current branch with main/master (fetch, rebase or merge)

From plugin
project-starter
1.4k26 skills7 agents26 commands6 hooks
> /plugin marketplace add CloudAI-X/claude-workflow-v2
> /plugin install project-starter@claude-workflow

Command definition

sync-branch.md
allowed-tools: Bash(git:*)
description: Sync current branch with main/master (fetch, rebase or merge)
argument-hint: "[merge|rebase] (default: rebase)"

Context

  • Current branch: !`git branch --show-current`
  • Default branch: !`git remote show origin 2>/dev/null | grep 'HEAD branch' | cut -d' ' -f5 || echo "main"`
  • Uncommitted changes: !`git status --porcelain`
  • Commits behind/ahead of origin's default branch: !`git rev-list --left-right --count origin/HEAD...HEAD 2>/dev/null || echo "unknown"`
  • Current remote: !`git remote -v | head -2`

Task

Safely sync the current branch with the default branch:

1. Check for uncommitted changes - if any, stash them 2. Fetch the latest from origin 3. Based on argument (default: rebase):

  • **rebase**: `git rebase origin/<default-branch>`
  • **merge**: `git merge origin/<default-branch>`

4. Handle any conflicts by reporting them clearly 5. If changes were stashed, pop them 6. Report the sync status

Strategy: $ARGUMENTS

@cloudai-x
Ships withproject-starter

A universal Claude Code workflow plugin with specialized agents, skills, hooks, and mode commands for any software project. Compatible with skills.sh — works with Claude Code, Cursor, Codex, and 35+ AI agents.

1.4k14 skills7 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.4k
Star history of CloudAI-X/claude-workflow-v2 on GitHub, a chart by star-history.com

Other commands on project-starter.

architect

architect

Command

System design and architecture planning mode. Focuses on high-level design, trade-offs, and technical decisions before…

bootstrap-repo

bootstrap-repo

Command

Explore the repository with 10 parallel subagents to create comprehensive documentation. Creates CODEBASE.md with full…

code-simplifier

code-simplifier

Command

Simplifies code after implementation. Reviews recent changes and suggests/applies simplifications while preserving behavior.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command