sync skill
✓ VerifiedBack-merges production branch changes into the development branch to keep branches synchronized after a release.
- GitHub stars
- 30
- Files
- 1
- Last commit
- Nov 3, 2026
- License
- MIT
- Allowed tools
- 22
What does the sync skill do?
sync is an agent skill. Back-merges production branch changes into the development branch to keep branches synchronized after a release.
Summary generated from the skill's SKILL.md.
About the sync skill
Keeping development and production branches aligned after a release is what this skill automates. It is designed for developers and DevOps engineers who need to back-merge changes from a production branch, such as main, into a development branch like staging. This process ensures that hotfixes, version bumps, and release merge commits are reflected in the ongoing development environment.
An agent should load this skill after a release has been merged to production and deployed. The tool uses git commands including fetch, pull, rebase, and push, along with the GitHub CLI to create pull requests. It automatically detects project versions from files like package.json, pyproject.toml, or Cargo.toml to populate PR descriptions. By utilizing a rebase strategy, the skill intelligently skips commits that are already present in the development branch, typically leaving only essential changes like version increments to be merged.
What an agent can do with it
- 1Synchronize branches after a releaseCreate a pull request to back-merge production changes into the staging branch following a successful deployment.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the sync skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the sync skill in Plugin
/plugin marketplace add rlajous/claude-code-commands /plugin install git-workflow@git-workflow-marketplace
Install the sync skill in Claude Code
~/.claude/skills/sync/SKILL.md
$ npx degit rlajous/claude-code-commands/skills/sync ~/.claude/skills/syncInstall the sync skill in Claude Code (project)
.claude/skills/sync/SKILL.md
$ npx degit rlajous/claude-code-commands/skills/sync .claude/skills/syncInstall the sync skill in Codex
~/.agents/skills/sync/SKILL.md
$ npx degit rlajous/claude-code-commands/skills/sync ~/.agents/skills/syncInstall the sync skill in Gemini CLI
~/.gemini/skills/sync/SKILL.md
$ npx degit rlajous/claude-code-commands/skills/sync ~/.gemini/skills/syncInstall the sync skill in Claude.ai
npx degit rlajous/claude-code-commands/skills/sync sync && zip -r sync.zip sync # claude.ai → Customize → Skills → + → Create skill → Upload a skill → sync.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work · What to fix for more points
- Source repository linked and reachablerlajous/claude-code-commands/skills/sync is public and reachablegithub.com/rlajous/claude-code-commands/tree/HEAD/skills/syn ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-03github.com/rlajous/claude-code-commands/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/rlajous/claude-code-commands/blob/HEAD/skills/syn ↗Pass
- Pre-approved tools are scopedPre-approved: Read, Grep, Glob, Bash(git, branch:*), Bash(git, …github.com/rlajous/claude-code-commands/blob/HEAD/skills/syn ↗Pass
- SKILL.md follows the Agent Skills formatthe description does not say when to use the skillgithub.com/rlajous/claude-code-commands/blob/HEAD/skills/syn ↗Finding
SKILL.md
View on GitHubCross-runtime: follow runtime compatibility for invocation, delegation, configuration precedence, state paths, and permissions.
You are helping sync the production branch changes back to the development branch. This command should be run AFTER a release has been merged to production and deployed to keep branches aligned.
Step 1: Load Configuration
Check for configuration:
if [ -f ".git-workflow/config.yaml" ]; then
CONFIG_PATH=".git-workflow/config.yaml"
elif [ -f ".claude/config.yaml" ]; then
CONFIG_PATH=".claude/config.yaml" # legacy read-only fallback
else
CONFIG_PATH=""
fi
Load from the resolved CONFIG_PATH (if one exists):
workflow:
developmentBranch: staging
productionBranch: main
branches:
sync: "sync/main-to-{devBranch}"
versioning:
file: auto
Default Values:
workflow:
developmentBranch: staging
productionBranch: main
branches:
sync: "sync/main-to-{devBranch}"
Step 2: Verify Current State
Check that you're on the production branch and up-to-date:
PROD_BRANCH=$(config.workflow.productionBranch || "main")
DEV_BRANCH=$(config.workflow.developmentBranch || "staging")
# Get current branch
CURRENT=$(git branch --show-current)
# Pull latest
git pull origin ${PROD_BRANCH}
Validation:
- If not on production branch:
You should be on {PROD_BRANCH} branch to create a sync PR. Run: git checkout {PROD_BRANCH} && git pull
Step 3: Get Current Version
Read the version for reference in PR:
# Auto-detect version file
if [ -f "package.json" ]; then
VERSION=$(node -p "require('./package.json').version")
elif [ -f "pyproject.toml" ]; then
VERSION=$(grep -Po '(?<=version = ")[^"]*' pyproject.toml)
elif [ -f "Cargo.toml" ]; then
VERSION=$(grep -Po '(?<=^version = ")[^"]*' Cargo.toml)
elif [ -f "VERSION" ]; then
VERSION=$(cat VERSION)
else
VERSION="unknown"
fi
Step 4: Check What Needs Syncing
Show what commits will be synced:
git fetch origin ${DEV_BRANCH}
git log origin/${DEV_BRANCH}..origin/${PROD_BRANCH} --oneline --no-merges
Display to user:
Commits to sync from {PROD_BRANCH} to {DEV_BRANCH}:
abc1234 2.77.0
def5678 Merge pull request #679 from org/release/2.77.0
ghi9012 [Fix] Hotfix for production issue (#680)
These changes from release v{VERSION} need to be back-merged.
If No Commits:
{DEV_BRANCH} is already up-to-date with {PROD_BRANCH}.
No sync needed!
Exit early if nothing to sync.
Step 5: Create Sync Branch
Generate sync branch name from pattern:
SYNC_PATTERN=$(config.branches.sync || "sync/main-to-{devBranch}")
SYNC_BRANCH=${SYNC_PATTERN/\{devBranch\}/${DEV_BRANCH}}
# Create sync branch from production
git checkout -b ${SYNC_BRANCH}
Example: sync/main-to-staging
Step 6: Push Sync Branch
git push -u origin ${SYNC_BRANCH}
Step 7: Rebase onto Development Branch
Critical Step: Rebase to skip commits already in development:
git fetch origin ${DEV_BRANCH}
git rebase origin/${DEV_BRANCH}
What Happens:
- Git automatically skips commits already in development branch
- Usually 90%+ of commits are skipped (already merged via feature PRs)
- Typically only version bump commit remains
- This is expected and correct!
Example Output:
warning: skipped previously applied commit 357fab94
warning: skipped previously applied commit 9de0e8fd
...
Successfully rebased and updated refs/heads/sync/main-to-staging.
After rebase, force-push:
git push origin ${SYNC_BRANCH} --force-with-lease
Check remaining commits:
git log origin/${DEV_BRANCH}..${SYNC_BRANCH} --oneline
Expected Result: Usually just 1-2 commits (version bump, release merge commit).
If 0 commits remain, development is already in sync - no PR needed.
Step 8: Generate Sync PR Description
# Sync {PROD_BRANCH} to {DEV_BRANCH} (Post-Release v{VERSION})
## Description
Back-merge production changes from {PROD_BRANCH} to {DEV_BRANCH} to keep branches aligned after release v{VERSION} deployment.
### Commits Being Synced
{LIST_OF_REMAINING_COMMITS}
### Purpose
This PR ensures {DEV_BRANCH} branch includes all production changes and version bumps from the latest release. This is a standard post-release sync operation.
### What's Included
- Version bump to {VERSION}
- Any hotfixes that went to production
- Release PR merge commit
## Checklist
- [x] {PROD_BRANCH} branch is up-to-date
- [x] Rebased onto {DEV_BRANCH} to skip duplicate commits
- [ ] Code review completed (fast-track expected)
- [ ] Ready to merge
---
**Note**: This is an automated sync PR. All changes have already been reviewed and merged to {PROD_BRANCH} via the release PR.
Step 9: Create PR to Development
gh pr create \
--base ${DEV_BRANCH} \
--title "[SYNC] Back-merge ${PROD_BRANCH} to ${DEV_BRANCH} (post-release v${VERSION})" \
--body "$(cat <<'EOF'
{GENERATED_DESCRIPTION}
EOF
)"
Important: Sync PRs target development branch (opposite of feature PRs).
Step 10: Confirm
Sync branch created: {SYNC_BRANCH}
PR created: {PR_URL}
Title: [SYNC] Back-merge {PROD_BRANCH} to {DEV_BRANCH} (post-release v{VERSION})
This sync PR back-merges changes from release v{VERSION}.
Next steps:
1. Review PR (should be straightforward)
2. Get fast-track approval
3. Merge to {DEV_BRANCH}
---
Release workflow complete!
- Release v{VERSION} deployed to production
- GitHub release created with detailed notes
- {PROD_BRANCH} and {DEV_BRANCH} synchronized
Configuration Reference
| Setting | Default | Description |
|---|---|---|
workflow.developmentBranch |
staging |
Development branch name |
workflow.productionBranch |
main |
Production branch name |
branches.sync |
sync/main-to-{devBranch} |
Sync branch naming pattern |
Error Handling
| Scenario | Action |
|---|---|
| Not on production branch | Instruct to checkout and pull |
| No commits to sync | Exit early with success message |
| Sync branch exists | Ask to delete and recreate |
| Rebase conflicts | Show resolution instructions |
| gh not authenticated | Provide auth instructions |
Conflict Resolution
If conflicts occur during rebase:
Conflicts detected during rebase:
{LIST_OF_CONFLICTING_FILES}
To resolve:
1. Open each file and resolve conflicts
2. Stage resolved files:
git add {files}
3. Continue rebase:
git rebase --continue
4. Force push:
git push origin {SYNC_BRANCH} --force-with-lease
Or abort and resolve manually:
git rebase --abort
When to Run This Command
Always run /sync after:
- Release PR merged to production
- Hotfix PR merged to production
- Any direct merge to production that needs to be in development
Typical sequence:
/release → Review → Merge → Deploy → /release-notes → /sync → Merge sync PR
Example Flow
# User runs: /sync
# Checks: on main, up-to-date ✓
# Gets: version 2.77.0 from package.json
# Lists: 5 commits to sync initially
# Creates: sync/main-to-staging branch
# Pushes: sync/main-to-staging
# Rebases: onto origin/staging
# Result: 4 commits skipped, 1 remains (version bump)
# Force pushes: updated branch
# Creates: PR #680 to staging
# Output: Success with completion message
Alternative Workflows
Tag-Based Workflow
For projects without a staging branch:
workflow:
type: tag-based
developmentBranch: develop
productionBranch: main
Direct Workflow
For simpler projects:
workflow:
type: direct
developmentBranch: main
productionBranch: main
In direct workflow, sync is not needed as there's only one branch.
Files in this skill
1sync skill questions
How do I install the sync skill in Claude Code?
Run npx degit rlajous/claude-code-commands/skills/sync ~/.claude/skills/sync. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the sync skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
When should I run the sync command?
You should run it after a release has been merged to production and deployed, or after any hotfix is merged to production.
What happens if there are no new commits to sync?
The process will exit early and inform you that the development branch is already up-to-date with the production branch.