Skip to main content
GeneralParslee-ai

source-command-sync-branch

Sync current branch with base branch. Codex (you) resolves conflicts intelligently, not automated scripts.

Stars
12
Source
Parslee-ai/neo
Updated
2026-05-26
Slug
Parslee-ai--neo--source-command-sync-branch
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/Parslee-ai/neo/HEAD/.agents/skills/source-command-sync-branch/SKILL.md -o .claude/skills/source-command-sync-branch.md

Drops the SKILL.md into .claude/skills/source-command-sync-branch.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

source-command-sync-branch

Use this skill when the user asks to run the migrated source command sync-branch.

Command Template

Sync Branch with Base

Sync the current branch with the base branch before PR review. You (Codex) will intelligently resolve any merge conflicts.

Workflow

Step 1: Fetch Latest Changes

Fetch the latest changes from origin:

git fetch origin

Step 2: Merge Base Branch

Attempt to merge the base branch:

git merge origin/$BASE_BRANCH --no-edit

Step 3: Handle Conflicts (Codex's Responsibility)

If there are conflicts, YOU (Codex) must resolve them intelligently:

  1. Check git status to see conflicted files
  2. For each conflicted file, review the conflict markers
  3. Use your understanding of the code to resolve conflicts intelligently
  4. Stage resolved files with git add
  5. Complete merge with git commit --no-edit

If conflicts cannot be resolved (e.g., too complex, unclear intent):

git merge --abort

Then return synced: false with a clear explanation.

Step 4: Push Changes

If the merge was successful (with or without conflicts):

git push origin HEAD

Final Output (STRICT JSON)

{
  "synced": true|false,
  "had_conflicts": true|false,
  "summary": "Brief summary of sync result"
}

Examples:

  • Success without conflicts: {"synced": true, "had_conflicts": false, "summary": "Branch synced with main, no conflicts"}
  • Success with resolved conflicts: {"synced": true, "had_conflicts": true, "summary": "Branch synced with main, resolved conflicts in 2 files"}
  • Aborted due to conflicts: {"synced": false, "had_conflicts": true, "summary": "Aborted merge with main: conflicts in config.json require manual resolution"}
  • Failure: {"synced": false, "had_conflicts": false, "summary": "Failed to fetch from origin"}