AGENT SKILL

flow-sync

Flow: Sync - Push WIP to Remote for Cross-Machine Pickup - Push the current branch to the remote so you can continue work on another machine.

License 许可
MIT
所属仓库
cooneycw/skillc
最近更新
2026-11-15
Stars
★ 0
Forks
0

01 前言 Front Matter

name
flow-sync
description
Flow: Sync - Push WIP to Remote for Cross-Machine Pickup - Push the current branch to the remote so you can continue work on another machine.

03 SKILL.md 正文

<!-- GENERATED by claude-power-pack - scripts/codex-skill-sync.py; edit .claude/commands/flow/sync.md instead -->

Flow: Sync - Push WIP to Remote for Cross-Machine Pickup

Push the current branch to the remote so you can continue work on another machine. Optional feature - most users won't need this.

Arguments

None. Operates on the current worktree/branch.

Instructions

When the user invokes /flow-sync, perform these steps:

Step 1: Validate Context

# Ensure we're in a git repo
git rev-parse --show-toplevel

# Get current branch
BRANCH=$(git branch --show-current)
  • If on main or master: STOP. Report: "Cannot sync main branch. Use /flow-start <issue> to create a worktree first."
  • If not on an issue-* branch: Warn but allow (user may have custom branch names).

Step 2: Check for Uncommitted Changes

# Check working tree status
git status --short
  • If clean: Skip to Step 3.
  • If dirty (uncommitted changes): Auto-commit as WIP:
    git add -A
    git commit -m "wip: sync work in progress
    
    Auto-committed by /flow-sync for cross-machine pickup.
    This commit will be squash-merged - no need to clean up."
    
    Report: "Auto-committed WIP changes."

Step 3: Push to Remote

git push -u origin "$BRANCH"
  • If push fails (e.g., rejected): Report the error and suggest git pull --rebase origin "$BRANCH" to resolve.

Step 4: Output

Synced branch to remote.

  Branch: issue-42-fix-login-bug
  Remote: origin

  To continue on another machine:
    /flow-start 42
    → Detects remote branch and creates worktree from it

Error Handling

  • Not in a git repo: Report error clearly.
  • On main branch: Block sync, suggest /flow-start.
  • Push rejected: Suggest git pull --rebase to reconcile.
  • No remote configured: Report "No remote 'origin' found."

Notes

  • This command is intentionally simple - just commit WIP + push.
  • Cross-machine sync operates on the issue-<N>-<slug> branch, not on worktree paths, so the visible-sibling worktree location (per-workstation, outside the repo, issue #627) does not affect it.
  • /flow-start already handles the receiving end: it detects the remote branch and, on the git lane (issue #627), adds a worktree tracking it with git worktree add at the visible sibling <parent>/<repo>-<branch> (or $FLOW_WORKTREE_BASE when set) and enters it with cd.
  • WIP commits are harmless because /flow-merge uses squash-merge, collapsing all commits into one clean commit.
  • No configuration required - works with any git remote.

04 同仓库更多 Skills